Flashing modules and ships to build even with PC menus (bug #871)

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2294 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
avolkov
2006-03-24 21:59:47 +00:00
parent 1030ede817
commit f98e11a3c9
2 changed files with 23 additions and 27 deletions
+13 -9
View File
@@ -189,7 +189,8 @@ DoInstallModule (PMENU_STATE pMS)
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
FirstItem = 0;
switch (NewState = pMS->CurState)
NewState = pMS->CurState;
switch (NewState)
{
case PLANET_LANDER:
case EMPTY_SLOT + 3:
@@ -376,7 +377,7 @@ DoInstallModule (PMENU_STATE pMS)
UnlockMutex (GraphicsLock);
DrawMenuStateStrings (PM_FUEL, pMS->CurState = OUTFIT_MODULES);
LockMutex (GraphicsLock);
SetFlashRect ((PRECT)~0L, (FRAME)0);
SetFlashRect (SFR_MENU_3DO, (FRAME)0);
pMS->InputFunc = DoOutfit;
ClearSISRect (DRAW_SIS_DISPLAY);
@@ -435,8 +436,10 @@ DoInstallModule (PMENU_STATE pMS)
{
if (NewItem != pMS->CurState)
{
DrawModuleStrings (pMS, pMS->CurState = NewItem);
SetFlashRect ((PRECT)~0L, (FRAME)0);
pMS->CurState = NewItem;
DrawModuleStrings (pMS, NewItem);
// flash with PC menus too
SetFlashRect (SFR_MENU_ANY, (FRAME)0);
}
}
else if (NewItem != pMS->delta_item || NewState != pMS->CurState)
@@ -523,7 +526,8 @@ InitFlash:
DrawModuleStrings (pMS, new_slot_piece);
if (pMS->CurState < EMPTY_SLOT)
SetFlashRect ((PRECT)~0L, (FRAME)0);
// flash with PC menus too
SetFlashRect (SFR_MENU_ANY, (FRAME)0);
else
SetFlashRect (&pMS->flash_rect0, (FRAME)0);
}
@@ -703,7 +707,7 @@ DoOutfit (PMENU_STATE pMS)
UnbatchGraphics ();
LockMutex (GraphicsLock);
SetFlashRect ((PRECT)~0L, (FRAME)0);
SetFlashRect (SFR_MENU_3DO, (FRAME)0);
UnlockMutex (GraphicsLock);
GLOBAL_SIS (FuelOnBoard) =
@@ -722,7 +726,7 @@ DoOutfit (PMENU_STATE pMS)
{
pMS->CurState = OUTFIT_FUEL;
LockMutex (GraphicsLock);
SetFlashRect ((PRECT)~0L, (FRAME)0);
SetFlashRect (SFR_MENU_3DO, (FRAME)0);
UnlockMutex (GraphicsLock);
}
else
@@ -755,7 +759,7 @@ ExitOutfit:
case OUTFIT_DOFUEL:
pMS->CurState = OUTFIT_FUEL;
LockMutex (GraphicsLock);
SetFlashRect ((PRECT)~0L, (FRAME)0);
SetFlashRect (SFR_MENU_3DO, (FRAME)0);
UnlockMutex (GraphicsLock);
break;
case OUTFIT_MODULES:
@@ -773,7 +777,7 @@ ExitOutfit:
goto ExitOutfit;
DrawMenuStateStrings (PM_FUEL, pMS->CurState);
LockMutex (GraphicsLock);
SetFlashRect ((PRECT)~0L, (FRAME)0);
SetFlashRect (SFR_MENU_3DO, (FRAME)0);
UnlockMutex (GraphicsLock);
break;
}
+10 -18
View File
@@ -263,19 +263,10 @@ DrawRaceStrings (BYTE NewRaceItem)
font_DrawText (&t);
}
UnbatchGraphics ();
SetContext (OldContext);
// Flash the ship purchase menu even when optMenu == OPT_PC
{
RECT flash_r;
GetContextClipRect (&flash_r);
flash_r.corner.x = RADAR_X - flash_r.corner.x;
flash_r.corner.y = RADAR_Y - flash_r.corner.y;
flash_r.extent.width = RADAR_WIDTH;
flash_r.extent.height = RADAR_HEIGHT;
SetFlashRect (&flash_r, (FRAME)0);
}
//SetFlashRect ((PRECT)~0L, (FRAME)0);
SetContext (OldContext);
SetFlashRect (SFR_MENU_ANY, (FRAME)0);
UnlockMutex (GraphicsLock);
}
@@ -703,7 +694,7 @@ DoModifyShips (PMENU_STATE pMS)
SpinStarShip (hSpinShip);
if (hStarShip)
goto ChangeFlashRect;
SetFlashRect ((PRECT)~0L, (FRAME)0);
SetFlashRect (SFR_MENU_3DO, (FRAME)0);
}
}
else
@@ -732,7 +723,7 @@ DoModifyShips (PMENU_STATE pMS)
{
pMS->delta_item ^= MODIFY_CREW_FLAG;
LockMutex (GraphicsLock);
SetFlashRect ((PRECT)~0L, (FRAME)0);
SetFlashRect (SFR_MENU_3DO, (FRAME)0);
UnlockMutex (GraphicsLock);
DrawMenuStateStrings (PM_CREW, SHIPYARD_CREW);
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
@@ -751,7 +742,7 @@ DoModifyShips (PMENU_STATE pMS)
(SHIP_FRAGMENTPTR) 0);
//Reset flash rectangle
LockMutex (GraphicsLock);
SetFlashRect ((PRECT)~0L, (FRAME)0);
SetFlashRect (SFR_MENU_3DO, (FRAME)0);
UnlockMutex (GraphicsLock);
DrawMenuStateStrings (PM_CREW, SHIPYARD_CREW);
@@ -1014,9 +1005,10 @@ DoModifyShips (PMENU_STATE pMS)
UnlockMutex (GraphicsLock);
pMS->InputFunc = DoShipyard;
DrawMenuStateStrings (PM_CREW, pMS->CurState = SHIPYARD_CREW);
pMS->CurState = SHIPYARD_CREW;
DrawMenuStateStrings (PM_CREW, pMS->CurState);
LockMutex (GraphicsLock);
SetFlashRect ((PRECT)~0L, (FRAME)0);
SetFlashRect (SFR_MENU_3DO, (FRAME)0);
UnlockMutex (GraphicsLock);
return TRUE;
@@ -1279,7 +1271,7 @@ DoShipyard (PMENU_STATE pMS)
ShowCombatShip ((COUNT)~0, (SHIP_FRAGMENTPTR)0);
LockMutex (GraphicsLock);
SetFlashRect ((PRECT)~0L, (FRAME)0);
SetFlashRect (SFR_MENU_3DO, (FRAME)0);
UnlockMutex (GraphicsLock);
}
@@ -1313,7 +1305,7 @@ ExitShipyard:
goto ExitShipyard;
DrawMenuStateStrings (PM_CREW, pMS->CurState);
LockMutex (GraphicsLock);
SetFlashRect ((PRECT)~0L, (FRAME)0);
SetFlashRect (SFR_MENU_3DO, (FRAME)0);
BeginHangarAnim (pMS);
UnlockMutex (GraphicsLock);
}