Fix the "smearing" caused by not enough of the terrain being drawn when the map is smaller than the amount of visible tiles. This fixes bug #11026

and bug #11026.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3801 4a71c877-e1ca-e34f-864e-861f7616d084
master
Gerard Krol 2008-02-16 16:37:24 +00:00
parent 37a96b2041
commit 7ab917ff87
1 changed files with 5 additions and 8 deletions

View File

@ -608,7 +608,7 @@ static void drawTiles(iView *player)
for (i = 0; i < visibleTiles.y+1; i++)
{
/* Go through the x's */
for (j = 0; j < (SDWORD)visibleTiles.x+1; j++)
for (j = 0; j < visibleTiles.x+1; j++)
{
Vector2i screen;
PIELIGHT TileIllum = WZCOL_BLACK;
@ -618,10 +618,7 @@ static void drawTiles(iView *player)
tileScreenInfo[i][j].pos.z = world_coord(terrainMidY - i);
tileScreenInfo[i][j].pos.y = 0;
if( playerXTile+j < 0 ||
playerZTile+i < 0 ||
playerXTile+j > (SDWORD)(mapWidth-1) ||
playerZTile+i > (SDWORD)(mapHeight-1) )
if (!tileOnMap(playerXTile + j, playerZTile + i))
{
// Special past-edge-of-map tiles
tileScreenInfo[i][j].u = 0;
@ -697,9 +694,9 @@ static void drawTiles(iView *player)
pie_SetAlphaTest(FALSE);
pie_SetFogStatus(TRUE);
pie_SetTexturePage(terrainPage);
for (i = 0; i < MIN(visibleTiles.y, mapHeight); i++)
for (i = 0; i < visibleTiles.y; i++)
{
for (j = 0; j < MIN(visibleTiles.x, mapWidth); j++)
for (j = 0; j < visibleTiles.x; j++)
{
//get distance of furthest corner
int zMax = MAX(tileScreenInfo[i][j].screen.z, tileScreenInfo[i+1][j].screen.z);
@ -715,7 +712,7 @@ static void drawTiles(iView *player)
drawTerrainTile(i, j, FALSE);
}
}
pie_DrawTerrainDone(MIN(visibleTiles.x, mapWidth), MIN(visibleTiles.y, mapHeight));
pie_DrawTerrainDone(visibleTiles.x, visibleTiles.y);
// Update height for water
for (i = 0; i < visibleTiles.y + 1; i++)