When on a mission, and the map size changes (*scroll limits change midgame*), we need to make sure that the radar buffer gets reset to the new size of the map.

Fixes ticket:479 (again) and also ticket:494 (which is basically a duplicate of ticket:479)

NOTE: need a Expand_Limbo mission savegame to more fully test this. See notes in structure.c


git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7442 4a71c877-e1ca-e34f-864e-861f7616d084
master
Buginator 2009-05-16 03:33:49 +00:00 committed by Git SVN Gateway
parent 583ae5c048
commit a7e00ca81d
3 changed files with 46 additions and 27 deletions

View File

@ -111,7 +111,8 @@ void radarInitVars(void)
//called for when a new mission is started //called for when a new mission is started
void resetRadarRedraw() void resetRadarRedraw()
{ {
// nothing here now // make sure Radar buffer is correct
resizeRadar();
} }
BOOL InitRadar(void) BOOL InitRadar(void)

View File

@ -2659,6 +2659,9 @@ BOOL scrSetScrollParams(void)
prevMaxX < scrollMaxX ? prevMaxX : scrollMaxX, prevMaxX < scrollMaxX ? prevMaxX : scrollMaxX,
prevMaxY < scrollMaxY ? prevMaxY : scrollMaxY); prevMaxY < scrollMaxY ? prevMaxY : scrollMaxY);
// need to reset radar to take into account of new size
resizeRadar();
return true; return true;
} }
@ -2688,6 +2691,9 @@ BOOL scrSetScrollMinX(void)
initLighting(prevMinX < scrollMinX ? prevMinX : scrollMinX, initLighting(prevMinX < scrollMinX ? prevMinX : scrollMinX,
scrollMinY, scrollMaxX, scrollMaxY); scrollMinY, scrollMaxX, scrollMaxY);
// need to reset radar to take into account of new size
resizeRadar();
return true; return true;
} }
@ -2718,6 +2724,9 @@ BOOL scrSetScrollMinY(void)
prevMinY < scrollMinY ? prevMinY : scrollMinY, prevMinY < scrollMinY ? prevMinY : scrollMinY,
scrollMaxX, scrollMaxY); scrollMaxX, scrollMaxY);
// need to reset radar to take into account of new size
resizeRadar();
return true; return true;
} }
@ -2748,6 +2757,9 @@ BOOL scrSetScrollMaxX(void)
prevMaxX < scrollMaxX ? prevMaxX : scrollMaxX, prevMaxX < scrollMaxX ? prevMaxX : scrollMaxX,
scrollMaxY); scrollMaxY);
// need to reset radar to take into account of new size
resizeRadar();
return true; return true;
} }
@ -2777,6 +2789,9 @@ BOOL scrSetScrollMaxY(void)
initLighting(scrollMinX, scrollMinY, scrollMaxX, initLighting(scrollMinX, scrollMinY, scrollMaxX,
prevMaxY < scrollMaxY ? prevMaxY : scrollMaxY); prevMaxY < scrollMaxY ? prevMaxY : scrollMaxY);
// need to reset radar to take into account of new size
resizeRadar();
return true; return true;
} }

View File

@ -1815,6 +1815,7 @@ STRUCTURE* buildStructure(STRUCTURE_STATS* pStructureType, UDWORD x, UDWORD y, U
scrollMinY = 0; scrollMinY = 0;
scrollMaxX = mapWidth; scrollMaxX = mapWidth;
scrollMaxY = mapHeight; scrollMaxY = mapHeight;
// NOTE: resizeRadar() may be required here, since we change scroll limits?
} }
//set the functionality dependant on the type of structure //set the functionality dependant on the type of structure
if(!setFunctionality(psBuilding, pStructureType->type)) if(!setFunctionality(psBuilding, pStructureType->type))
@ -1829,6 +1830,7 @@ STRUCTURE* buildStructure(STRUCTURE_STATS* pStructureType, UDWORD x, UDWORD y, U
scrollMinY = preScrollMinY; scrollMinY = preScrollMinY;
scrollMaxX = preScrollMaxX; scrollMaxX = preScrollMaxX;
scrollMaxY = preScrollMaxY; scrollMaxY = preScrollMaxY;
// NOTE: resizeRadar() may be required here, since we change scroll limits?
} }
return NULL; return NULL;
} }
@ -1841,6 +1843,7 @@ STRUCTURE* buildStructure(STRUCTURE_STATS* pStructureType, UDWORD x, UDWORD y, U
scrollMinY = preScrollMinY; scrollMinY = preScrollMinY;
scrollMaxX = preScrollMaxX; scrollMaxX = preScrollMaxX;
scrollMaxY = preScrollMaxY; scrollMaxY = preScrollMaxY;
// NOTE: resizeRadar() may be required here, since we change scroll limits?
} }
psBuilding->body = (UWORD)structureBody(psBuilding); psBuilding->body = (UWORD)structureBody(psBuilding);