Cleanup: make MENU_STATE* parameter explicit in planet scan code

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3290 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
avolkov
2009-11-08 02:16:00 +00:00
parent a8c2acf7ba
commit 8b43b9f3c1
+12 -12
View File
@@ -524,7 +524,7 @@ savePlanetLocationImage (MENU_STATE *pMS)
r.corner.x += pMS->flash_rect1.corner.x - hs.x; r.corner.x += pMS->flash_rect1.corner.x - hs.x;
r.corner.y += pMS->flash_rect1.corner.y - hs.y; r.corner.y += pMS->flash_rect1.corner.y - hs.y;
r.extent = pMS->flash_rect0.extent; r.extent = pMS->flash_rect0.extent;
LoadDisplayPixmap (&r, pMenuState->flash_frame1); LoadDisplayPixmap (&r, pMS->flash_frame1);
} }
static void static void
@@ -551,18 +551,18 @@ drawPlanetCursor (MENU_STATE *pMS, BOOLEAN filled)
} }
static void static void
SetPlanetLoc (POINT new_pt) SetPlanetLoc (MENU_STATE *pMS, POINT new_pt)
{ {
pSolarSysState->MenuState.first_item = new_pt; pSolarSysState->MenuState.first_item = new_pt;
// Set the new flash location // Set the new flash location
new_pt.x >>= MAG_SHIFT; new_pt.x >>= MAG_SHIFT;
new_pt.y >>= MAG_SHIFT; new_pt.y >>= MAG_SHIFT;
pMenuState->flash_rect0.corner = new_pt; pMS->flash_rect0.corner = new_pt;
SetContext (ScanContext); SetContext (ScanContext);
restorePlanetLocationImage (pMenuState); restorePlanetLocationImage (pMS);
savePlanetLocationImage (pMenuState); savePlanetLocationImage (pMS);
} }
static void static void
@@ -634,11 +634,11 @@ PickPlanetSide (MENU_STATE *pMS)
LockMutex (GraphicsLock); LockMutex (GraphicsLock);
SetContext (ScanContext); SetContext (ScanContext);
// Set the current flash location // Set the current flash location
pMenuState->flash_rect0.corner.x = pMS->flash_rect0.corner.x =
pSolarSysState->MenuState.first_item.x >> MAG_SHIFT; pSolarSysState->MenuState.first_item.x >> MAG_SHIFT;
pMenuState->flash_rect0.corner.y = pMS->flash_rect0.corner.y =
pSolarSysState->MenuState.first_item.y >> MAG_SHIFT; pSolarSysState->MenuState.first_item.y >> MAG_SHIFT;
savePlanetLocationImage (pMenuState); savePlanetLocationImage (pMS);
SetFlashRect (NULL); SetFlashRect (NULL);
UnlockMutex (GraphicsLock); UnlockMutex (GraphicsLock);
@@ -659,7 +659,7 @@ PickPlanetSide (MENU_STATE *pMS)
if (!select) if (!select)
{ // Bailing out { // Bailing out
LockMutex (GraphicsLock); LockMutex (GraphicsLock);
SetPlanetLoc (pSolarSysState->MenuState.first_item); SetPlanetLoc (pMS, pSolarSysState->MenuState.first_item);
UnlockMutex (GraphicsLock); UnlockMutex (GraphicsLock);
} }
else else
@@ -677,7 +677,7 @@ PickPlanetSide (MENU_STATE *pMS)
LockMutex (GraphicsLock); LockMutex (GraphicsLock);
DeltaSISGauges (0, -(SIZE)fuel_required, 0); DeltaSISGauges (0, -(SIZE)fuel_required, 0);
SetContext (ScanContext); SetContext (ScanContext);
drawPlanetCursor (pMenuState, FALSE); drawPlanetCursor (pMS, FALSE);
UnlockMutex (GraphicsLock); UnlockMutex (GraphicsLock);
PlanetSide (pMS); PlanetSide (pMS);
@@ -773,10 +773,10 @@ ExitPlanetSide:
if (new_pt.x != pSolarSysState->MenuState.first_item.x if (new_pt.x != pSolarSysState->MenuState.first_item.x
|| new_pt.y != pSolarSysState->MenuState.first_item.y) || new_pt.y != pSolarSysState->MenuState.first_item.y)
{ {
SetPlanetLoc (new_pt); SetPlanetLoc (pMS, new_pt);
} }
flashPlanetLocation (pMenuState); flashPlanetLocation (pMS);
UnbatchGraphics (); UnbatchGraphics ();
UnlockMutex (GraphicsLock); UnlockMutex (GraphicsLock);