New map macro map_round() rounds map coordinates down to tile boundaries.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1684 4a71c877-e1ca-e34f-864e-861f7616d084master
parent
c0e9fa3211
commit
c0abb47655
|
@ -349,8 +349,8 @@ void renderParticle( ATPART *psPart )
|
|||
dv.z = terrainMidY * TILE_UNITS - ((UDWORD)z - player.p.z);
|
||||
iV_MatrixBegin(); /* Push the indentity matrix */
|
||||
iV_TRANSLATE(dv.x,dv.y,dv.z);
|
||||
rx = player.p.x & (TILE_UNITS-1); /* Get the x,z translation components */
|
||||
rz = player.p.z & (TILE_UNITS-1);
|
||||
rx = map_round(player.p.x); /* Get the x,z translation components */
|
||||
rz = map_round(player.p.z);
|
||||
iV_TRANSLATE(rx,0,-rz); /* Translate */
|
||||
/* Make it face camera */
|
||||
iV_MatrixRotateY(-player.r.y);
|
||||
|
|
|
@ -142,8 +142,8 @@ BOOL renderBridgeSection(STRUCTURE *psStructure)
|
|||
pie_TRANSLATE(dv.x,dv.y,dv.z);
|
||||
|
||||
/* Get the x,z translation components */
|
||||
rx = player.p.x & (TILE_UNITS-1);
|
||||
rz = player.p.z & (TILE_UNITS-1);
|
||||
rx = map_round(player.p.x);
|
||||
rz = map_round(player.p.z);
|
||||
|
||||
/* Translate */
|
||||
pie_TRANSLATE(rx,0,-rz);
|
||||
|
|
|
@ -782,8 +782,8 @@ void displayComponentObject(BASE_OBJECT *psObj)
|
|||
pie_MatBegin();
|
||||
|
||||
/* Get internal tile units coordinates */
|
||||
xShift = player.p.x & (TILE_UNITS-1);
|
||||
zShift = player.p.z & (TILE_UNITS-1);
|
||||
xShift = map_round(player.p.x);
|
||||
zShift = map_round(player.p.z);
|
||||
|
||||
/* Mask out to tile_units resolution */
|
||||
pie_TRANSLATE(xShift,0,-zShift);
|
||||
|
|
|
@ -1636,8 +1636,8 @@ void renderWaypointEffect(EFFECT *psEffect)
|
|||
dv.z = terrainMidY * TILE_UNITS - ((UDWORD)MAKEINT(psEffect->position.z) - player.p.z);
|
||||
iV_MatrixBegin(); /* Push the indentity matrix */
|
||||
iV_TRANSLATE(dv.x,dv.y,dv.z);
|
||||
rx = player.p.x & (TILE_UNITS-1); /* Get the x,z translation components */
|
||||
rz = player.p.z & (TILE_UNITS-1);
|
||||
rx = map_round(player.p.x); /* Get the x,z translation components */
|
||||
rz = map_round(player.p.z);
|
||||
iV_TRANSLATE(rx,0,-rz); /* Translate */
|
||||
|
||||
// set up lighting
|
||||
|
@ -1670,8 +1670,8 @@ void renderFirework(EFFECT *psEffect)
|
|||
dv.z = terrainMidY * TILE_UNITS - ((UDWORD)MAKEINT(psEffect->position.z) - player.p.z);
|
||||
iV_MatrixBegin(); /* Push the indentity matrix */
|
||||
iV_TRANSLATE(dv.x,dv.y,dv.z);
|
||||
rx = player.p.x & (TILE_UNITS-1); /* Get the x,z translation components */
|
||||
rz = player.p.z & (TILE_UNITS-1);
|
||||
rx = map_round(player.p.x); /* Get the x,z translation components */
|
||||
rz = map_round(player.p.z);
|
||||
iV_TRANSLATE(rx,0,-rz); /* Translate */
|
||||
|
||||
|
||||
|
@ -1702,8 +1702,8 @@ void renderBloodEffect(EFFECT *psEffect)
|
|||
dv.z = terrainMidY * TILE_UNITS - ((UDWORD)MAKEINT(psEffect->position.z) - player.p.z);
|
||||
iV_MatrixBegin(); /* Push the indentity matrix */
|
||||
iV_TRANSLATE(dv.x,dv.y,dv.z);
|
||||
rx = player.p.x & (TILE_UNITS-1); /* Get the x,z translation components */
|
||||
rz = player.p.z & (TILE_UNITS-1);
|
||||
rx = map_round(player.p.x); /* Get the x,z translation components */
|
||||
rz = map_round(player.p.z);
|
||||
iV_TRANSLATE(rx,0,-rz); /* Translate */
|
||||
iV_MatrixRotateY(-player.r.y);
|
||||
iV_MatrixRotateX(-player.r.x);
|
||||
|
@ -1741,8 +1741,8 @@ void renderDestructionEffect(EFFECT *psEffect)
|
|||
dv.z = terrainMidY * TILE_UNITS - ((UDWORD)MAKEINT(psEffect->position.z) - player.p.z);
|
||||
iV_MatrixBegin(); /* Push the indentity matrix */
|
||||
iV_TRANSLATE(dv.x,dv.y,dv.z);
|
||||
rx = player.p.x & (TILE_UNITS-1); /* Get the x,z translation components */
|
||||
rz = player.p.z & (TILE_UNITS-1);
|
||||
rx = map_round(player.p.x); /* Get the x,z translation components */
|
||||
rz = map_round(player.p.z);
|
||||
iV_TRANSLATE(rx,0,-rz); /* Translate */
|
||||
|
||||
|
||||
|
@ -1822,8 +1822,8 @@ void renderExplosionEffect(EFFECT *psEffect)
|
|||
dv.z = terrainMidY * TILE_UNITS - ((UDWORD)MAKEINT(psEffect->position.z) - player.p.z);
|
||||
iV_MatrixBegin(); /* Push the indentity matrix */
|
||||
iV_TRANSLATE(dv.x,dv.y,dv.z);
|
||||
rx = player.p.x & (TILE_UNITS-1); /* Get the x,z translation components */
|
||||
rz = player.p.z & (TILE_UNITS-1);
|
||||
rx = map_round(player.p.x); /* Get the x,z translation components */
|
||||
rz = map_round(player.p.z);
|
||||
iV_TRANSLATE(rx,0,-rz); /* Translate */
|
||||
|
||||
/* Bit in comments - doesn't quite work yet? */
|
||||
|
@ -1896,8 +1896,8 @@ void renderGravitonEffect(EFFECT *psEffect)
|
|||
iV_TRANSLATE(vec.x,vec.y,vec.z);
|
||||
|
||||
/* Offset from camera */
|
||||
rx = player.p.x & (TILE_UNITS-1);
|
||||
rz = player.p.z & (TILE_UNITS-1);
|
||||
rx = map_round(player.p.x);
|
||||
rz = map_round(player.p.z);
|
||||
|
||||
/* Move to camera reference */
|
||||
iV_TRANSLATE(rx,0,-rz);
|
||||
|
@ -1955,8 +1955,8 @@ void renderConstructionEffect(EFFECT *psEffect)
|
|||
iV_TRANSLATE(vec.x,vec.y,vec.z);
|
||||
|
||||
/* Offset from camera */
|
||||
rx = player.p.x & (TILE_UNITS-1);
|
||||
rz = player.p.z & (TILE_UNITS-1);
|
||||
rx = map_round(player.p.x);
|
||||
rz = map_round(player.p.z);
|
||||
|
||||
/* Move to camera reference */
|
||||
iV_TRANSLATE(rx,0,-rz);
|
||||
|
@ -2027,8 +2027,8 @@ void renderSmokeEffect(EFFECT *psEffect)
|
|||
iV_TRANSLATE(vec.x,vec.y,vec.z);
|
||||
|
||||
/* Offset from camera */
|
||||
rx = player.p.x & (TILE_UNITS-1);
|
||||
rz = player.p.z & (TILE_UNITS-1);
|
||||
rx = map_round(player.p.x);
|
||||
rz = map_round(player.p.z);
|
||||
|
||||
/* Move to camera reference */
|
||||
iV_TRANSLATE(rx,0,-rz);
|
||||
|
|
|
@ -275,8 +275,8 @@ extern UDWORD map_MistValue(UDWORD x, UDWORD y)
|
|||
tileY = y >> TILE_SHIFT;
|
||||
|
||||
/* Inter tile comp */
|
||||
ox = (x & (TILE_UNITS-1));
|
||||
oy = (y & (TILE_UNITS-1));
|
||||
ox = map_round(x);
|
||||
oy = map_round(y);
|
||||
|
||||
/* If this happens, then get quick height */
|
||||
if(!x && !y)
|
||||
|
|
|
@ -1337,9 +1337,8 @@ extern SWORD map_Height(UDWORD x, UDWORD y)
|
|||
tileY = map_coord(y);
|
||||
|
||||
/* Inter tile comp */
|
||||
ox = (x & (TILE_UNITS-1));
|
||||
oy = (y & (TILE_UNITS-1));
|
||||
|
||||
ox = map_round(x);
|
||||
oy = map_round(y);
|
||||
|
||||
if(TERRAIN_TYPE(mapTile(tileX,tileY)) == TER_WATER)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue