Second argument of SetFlashRect is now always 0. This commit removes that

argument.
Also some small cleanups.



git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3269 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
Meep-Eep
2009-10-31 15:37:46 +00:00
parent 6e4534b7bd
commit 5320aeeb7d
15 changed files with 102 additions and 166 deletions
+3 -3
View File
@@ -75,7 +75,7 @@ DoSelectAction (MENU_STATE *pMS)
{ {
DrawMenuStateStrings (PM_CONVERSE, pMS->CurState); DrawMenuStateStrings (PM_CONVERSE, pMS->CurState);
LockMutex (GraphicsLock); LockMutex (GraphicsLock);
SetFlashRect (SFR_MENU_3DO, (FRAME)0); SetFlashRect (SFR_MENU_3DO);
UnlockMutex (GraphicsLock); UnlockMutex (GraphicsLock);
} }
return ((BOOLEAN)pMS->Initialized); return ((BOOLEAN)pMS->Initialized);
@@ -331,13 +331,13 @@ InitEncounter (void)
DrawMenuStateStrings (PM_CONVERSE, MenuState.CurState = HAIL); DrawMenuStateStrings (PM_CONVERSE, MenuState.CurState = HAIL);
LockMutex (GraphicsLock); LockMutex (GraphicsLock);
SetFlashRect (SFR_MENU_3DO, (FRAME)0); SetFlashRect (SFR_MENU_3DO);
UnlockMutex (GraphicsLock); UnlockMutex (GraphicsLock);
DoInput (&MenuState, TRUE); DoInput (&MenuState, TRUE);
LockMutex (GraphicsLock); LockMutex (GraphicsLock);
SetFlashRect (NULL, (FRAME)0); SetFlashRect (NULL);
UnlockMutex (GraphicsLock); UnlockMutex (GraphicsLock);
return (MenuState.CurState); return (MenuState.CurState);
+6 -6
View File
@@ -237,7 +237,7 @@ DrawDescriptionString (MENU_STATE *pMS, COUNT which_string, COUNT state)
if (!(state & DDSHS_EDIT)) if (!(state & DDSHS_EDIT))
{ // normal state { // normal state
SetFlashRect (SFR_MENU_3DO, (FRAME)0); SetFlashRect (SFR_MENU_3DO);
if (pMS->InputFunc == DoNaming) if (pMS->InputFunc == DoNaming)
{ {
@@ -318,7 +318,7 @@ DrawDescriptionString (MENU_STATE *pMS, COUNT which_string, COUNT state)
SetContextForeGroundColor (ForeGround); SetContextForeGroundColor (ForeGround);
font_DrawText (&lf); font_DrawText (&lf);
SetFlashRect (&r, (FRAME)0); SetFlashRect (&r);
} }
UnlockMutex (GraphicsLock); UnlockMutex (GraphicsLock);
@@ -892,7 +892,7 @@ Restart:
else if (PulsedInputState.menu[KEY_MENU_CANCEL]) else if (PulsedInputState.menu[KEY_MENU_CANCEL])
{ {
LockMutex (GraphicsLock); LockMutex (GraphicsLock);
SetFlashRect (SFR_MENU_3DO, (FRAME)0); SetFlashRect (SFR_MENU_3DO);
UnlockMutex (GraphicsLock); UnlockMutex (GraphicsLock);
pMS->ModuleFrame = 0; pMS->ModuleFrame = 0;
pMS->CurState = (BYTE)pMS->delta_item; pMS->CurState = (BYTE)pMS->delta_item;
@@ -933,7 +933,7 @@ Restart:
} }
else else
{ {
SetFlashRect (NULL, (FRAME)0); SetFlashRect (NULL);
DrawStamp (&MsgStamp); DrawStamp (&MsgStamp);
DestroyDrawable (ReleaseDrawable (MsgStamp.frame)); DestroyDrawable (ReleaseDrawable (MsgStamp.frame));
UnlockMutex (GraphicsLock); UnlockMutex (GraphicsLock);
@@ -965,7 +965,7 @@ Restart:
if (LoadGame ((COUNT)pMS->CurState, NULL)) if (LoadGame ((COUNT)pMS->CurState, NULL))
GLOBAL (CurrentActivity) |= CHECK_LOAD; GLOBAL (CurrentActivity) |= CHECK_LOAD;
} }
SetFlashRect (NULL, (FRAME)0); SetFlashRect (NULL);
UnlockMutex (GraphicsLock); UnlockMutex (GraphicsLock);
pMS->ModuleFrame = 0; pMS->ModuleFrame = 0;
@@ -1121,7 +1121,7 @@ ChangeGameSelection:
} }
UnbatchGraphics (); UnbatchGraphics ();
} }
SetFlashRect (NULL, (FRAME)0); SetFlashRect (NULL);
UnlockMutex (GraphicsLock); UnlockMutex (GraphicsLock);
} }
+2 -2
View File
@@ -1596,14 +1596,14 @@ UnbatchGraphics ();
DrawMenuStateStrings (PM_STARMAP, STARMAP); DrawMenuStateStrings (PM_STARMAP, STARMAP);
LockMutex (GraphicsLock); LockMutex (GraphicsLock);
SetFlashRect (SFR_MENU_3DO, (FRAME)0); SetFlashRect (SFR_MENU_3DO);
UnlockMutex (GraphicsLock); UnlockMutex (GraphicsLock);
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT); SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
DoInput (&MenuState, TRUE); DoInput (&MenuState, TRUE);
LockMutex (GraphicsLock); LockMutex (GraphicsLock);
SetFlashRect (NULL, (FRAME)0); SetFlashRect (NULL);
SetContext (SpaceContext); SetContext (SpaceContext);
+1 -1
View File
@@ -603,7 +603,7 @@ DrawMenuStateStrings (BYTE beg_index, SWORD NewState)
&& flash_rect.corner.y == RADAR_Y && flash_rect.corner.y == RADAR_Y
&& flash_rect.extent.width == RADAR_WIDTH && flash_rect.extent.width == RADAR_WIDTH
&& flash_rect.extent.height == RADAR_HEIGHT) && flash_rect.extent.height == RADAR_HEIGHT)
SetFlashRect (SFR_MENU_3DO, (FRAME)0); SetFlashRect (SFR_MENU_3DO);
SetContext (OldContext); SetContext (OldContext);
UnlockMutex (GraphicsLock); UnlockMutex (GraphicsLock);
} }
+13 -13
View File
@@ -237,7 +237,7 @@ DoInstallModule (MENU_STATE *pMS)
SetContext (SpaceContext); SetContext (SpaceContext);
ClearSISRect (CLEAR_SIS_RADAR); ClearSISRect (CLEAR_SIS_RADAR);
SetFlashRect (NULL, (FRAME)0); SetFlashRect (NULL);
goto InitFlash; goto InitFlash;
} }
else if (select || cancel) else if (select || cancel)
@@ -298,7 +298,7 @@ DoInstallModule (MENU_STATE *pMS)
LockMutex (GraphicsLock); LockMutex (GraphicsLock);
SetContext (SpaceContext); SetContext (SpaceContext);
SetFlashRect (NULL, (FRAME)0); SetFlashRect (NULL);
if (select) if (select)
{ {
@@ -382,7 +382,7 @@ DoInstallModule (MENU_STATE *pMS)
UnlockMutex (GraphicsLock); UnlockMutex (GraphicsLock);
DrawMenuStateStrings (PM_FUEL, pMS->CurState = OUTFIT_MODULES); DrawMenuStateStrings (PM_FUEL, pMS->CurState = OUTFIT_MODULES);
LockMutex (GraphicsLock); LockMutex (GraphicsLock);
SetFlashRect (SFR_MENU_3DO, (FRAME)0); SetFlashRect (SFR_MENU_3DO);
pMS->InputFunc = DoOutfit; pMS->InputFunc = DoOutfit;
ClearSISRect (DRAW_SIS_DISPLAY); ClearSISRect (DRAW_SIS_DISPLAY);
@@ -444,7 +444,7 @@ DoInstallModule (MENU_STATE *pMS)
pMS->CurState = NewItem; pMS->CurState = NewItem;
DrawModuleStrings (pMS, NewItem); DrawModuleStrings (pMS, NewItem);
// flash with PC menus too // flash with PC menus too
SetFlashRect (SFR_MENU_ANY, (FRAME)0); SetFlashRect (SFR_MENU_ANY);
} }
} }
else if (NewItem != pMS->delta_item || NewState != pMS->CurState) else if (NewItem != pMS->delta_item || NewState != pMS->CurState)
@@ -532,9 +532,9 @@ InitFlash:
DrawModuleStrings (pMS, new_slot_piece); DrawModuleStrings (pMS, new_slot_piece);
if (pMS->CurState < EMPTY_SLOT) if (pMS->CurState < EMPTY_SLOT)
// flash with PC menus too // flash with PC menus too
SetFlashRect (SFR_MENU_ANY, (FRAME)0); SetFlashRect (SFR_MENU_ANY);
else else
SetFlashRect (&pMS->flash_rect0, (FRAME)0); SetFlashRect (&pMS->flash_rect0);
} }
UnlockMutex (GraphicsLock); UnlockMutex (GraphicsLock);
} }
@@ -571,7 +571,7 @@ ChangeFuelQuantity (void)
DeltaSISGauges (0, FUEL_TANK_SCALE, -GLOBAL (FuelCost)); DeltaSISGauges (0, FUEL_TANK_SCALE, -GLOBAL (FuelCost));
SetContext (StatusContext); SetContext (StatusContext);
GetGaugeRect (&r, FALSE); GetGaugeRect (&r, FALSE);
SetFlashRect (&r, (FRAME)0); SetFlashRect (&r);
} }
else else
{ // no more room for fuel or not enough RUs { // no more room for fuel or not enough RUs
@@ -603,7 +603,7 @@ ChangeFuelQuantity (void)
} }
SetContext (StatusContext); SetContext (StatusContext);
GetGaugeRect (&r, FALSE); GetGaugeRect (&r, FALSE);
SetFlashRect (&r, (FRAME)0); SetFlashRect (&r);
UnlockMutex (GraphicsLock); UnlockMutex (GraphicsLock);
} }
} }
@@ -713,7 +713,7 @@ DoOutfit (MENU_STATE *pMS)
UnbatchGraphics (); UnbatchGraphics ();
LockMutex (GraphicsLock); LockMutex (GraphicsLock);
SetFlashRect (SFR_MENU_3DO, (FRAME)0); SetFlashRect (SFR_MENU_3DO);
UnlockMutex (GraphicsLock); UnlockMutex (GraphicsLock);
GLOBAL_SIS (FuelOnBoard) = GLOBAL_SIS (FuelOnBoard) =
@@ -732,7 +732,7 @@ DoOutfit (MENU_STATE *pMS)
{ {
pMS->CurState = OUTFIT_FUEL; pMS->CurState = OUTFIT_FUEL;
LockMutex (GraphicsLock); LockMutex (GraphicsLock);
SetFlashRect (SFR_MENU_3DO, (FRAME)0); SetFlashRect (SFR_MENU_3DO);
UnlockMutex (GraphicsLock); UnlockMutex (GraphicsLock);
} }
else else
@@ -758,14 +758,14 @@ ExitOutfit:
LockMutex (GraphicsLock); LockMutex (GraphicsLock);
SetContext (StatusContext); SetContext (StatusContext);
GetGaugeRect (&r, FALSE); GetGaugeRect (&r, FALSE);
SetFlashRect (&r, (FRAME)0); SetFlashRect (&r);
UnlockMutex (GraphicsLock); UnlockMutex (GraphicsLock);
break; break;
} }
case OUTFIT_DOFUEL: case OUTFIT_DOFUEL:
pMS->CurState = OUTFIT_FUEL; pMS->CurState = OUTFIT_FUEL;
LockMutex (GraphicsLock); LockMutex (GraphicsLock);
SetFlashRect (SFR_MENU_3DO, (FRAME)0); SetFlashRect (SFR_MENU_3DO);
UnlockMutex (GraphicsLock); UnlockMutex (GraphicsLock);
break; break;
case OUTFIT_MODULES: case OUTFIT_MODULES:
@@ -783,7 +783,7 @@ ExitOutfit:
goto ExitOutfit; goto ExitOutfit;
DrawMenuStateStrings (PM_FUEL, pMS->CurState); DrawMenuStateStrings (PM_FUEL, pMS->CurState);
LockMutex (GraphicsLock); LockMutex (GraphicsLock);
SetFlashRect (SFR_MENU_3DO, (FRAME)0); SetFlashRect (SFR_MENU_3DO);
UnlockMutex (GraphicsLock); UnlockMutex (GraphicsLock);
break; break;
} }
+3 -3
View File
@@ -236,8 +236,8 @@ ChangeSelection:
font_DrawText (&t); font_DrawText (&t);
} }
SetFlashRect (NULL, (FRAME)0); SetFlashRect (NULL);
SetFlashRect (&pMS->flash_rect0, (FRAME)0); SetFlashRect (&pMS->flash_rect0);
UnlockMutex (GraphicsLock); UnlockMutex (GraphicsLock);
} }
} }
@@ -284,7 +284,7 @@ OldContext = SetContext (SpaceContext);
pMenuState = 0; pMenuState = 0;
LockMutex (GraphicsLock); LockMutex (GraphicsLock);
SetFlashRect (NULL, (FRAME)0); SetFlashRect (NULL);
hBattleShip = (HSTARSHIP)MenuState.CurFrame; hBattleShip = (HSTARSHIP)MenuState.CurFrame;
} }
+4 -4
View File
@@ -1724,7 +1724,7 @@ DoFlagshipCommands (MENU_STATE *pMS)
if (NewState != SCAN + 1 && NewState != (GAME_MENU) + 1) if (NewState != SCAN + 1 && NewState != (GAME_MENU) + 1)
{ {
LockMutex (GraphicsLock); LockMutex (GraphicsLock);
SetFlashRect (NULL, (FRAME)0); SetFlashRect (NULL);
UnlockMutex (GraphicsLock); UnlockMutex (GraphicsLock);
} }
@@ -1793,7 +1793,7 @@ DoFlagshipCommands (MENU_STATE *pMS)
--pMS->Initialized; --pMS->Initialized;
pSolarSysState->PauseRotate = 0; pSolarSysState->PauseRotate = 0;
LockMutex (GraphicsLock); LockMutex (GraphicsLock);
SetFlashRect (SFR_MENU_3DO, (FRAME)0); SetFlashRect (SFR_MENU_3DO);
UnlockMutex (GraphicsLock); UnlockMutex (GraphicsLock);
break; break;
} }
@@ -1829,7 +1829,7 @@ DoFlagshipCommands (MENU_STATE *pMS)
else if (pMS->CurState) else if (pMS->CurState)
{ {
LockMutex (GraphicsLock); LockMutex (GraphicsLock);
SetFlashRect (SFR_MENU_3DO, (FRAME)0); SetFlashRect (SFR_MENU_3DO);
UnlockMutex (GraphicsLock); UnlockMutex (GraphicsLock);
if (select) if (select)
{ {
@@ -1842,7 +1842,7 @@ DoFlagshipCommands (MENU_STATE *pMS)
else else
{ {
LockMutex (GraphicsLock); LockMutex (GraphicsLock);
SetFlashRect (NULL, (FRAME)0); SetFlashRect (NULL);
UnlockMutex (GraphicsLock); UnlockMutex (GraphicsLock);
DrawMenuStateStrings (PM_STARMAP, -NAVIGATION); DrawMenuStateStrings (PM_STARMAP, -NAVIGATION);
} }
+4 -4
View File
@@ -137,7 +137,7 @@ DeltaSupportCrew (SIZE crew_delta)
r.extent.width = STATUS_MESSAGE_WIDTH; r.extent.width = STATUS_MESSAGE_WIDTH;
r.extent.height = STATUS_MESSAGE_HEIGHT; r.extent.height = STATUS_MESSAGE_HEIGHT;
SetContext (StatusContext); SetContext (StatusContext);
SetFlashRect (&r, (FRAME)0); SetFlashRect (&r);
} }
ret = TRUE; ret = TRUE;
} }
@@ -232,7 +232,7 @@ DoModifyRoster (MENU_STATE *pMS)
else if (cancel && !(pMS->CurState & SHIP_TOGGLE)) else if (cancel && !(pMS->CurState & SHIP_TOGGLE))
{ {
LockMutex (GraphicsLock); LockMutex (GraphicsLock);
SetFlashRect (NULL, (FRAME)0); SetFlashRect (NULL);
RosterCleanup (pMS); RosterCleanup (pMS);
pMS->CurFrame = 0; pMS->CurFrame = 0;
DrawStatusMessage (NULL); DrawStatusMessage (NULL);
@@ -245,7 +245,7 @@ DoModifyRoster (MENU_STATE *pMS)
LockMutex (GraphicsLock); LockMutex (GraphicsLock);
pMS->CurState ^= SHIP_TOGGLE; pMS->CurState ^= SHIP_TOGGLE;
if (!(pMS->CurState & SHIP_TOGGLE)) if (!(pMS->CurState & SHIP_TOGGLE))
SetFlashRect (NULL, (FRAME)0); SetFlashRect (NULL);
else else
{ {
RosterCleanup (pMS); RosterCleanup (pMS);
@@ -255,7 +255,7 @@ DoModifyRoster (MENU_STATE *pMS)
r.extent.width = STATUS_MESSAGE_WIDTH; r.extent.width = STATUS_MESSAGE_WIDTH;
r.extent.height = STATUS_MESSAGE_HEIGHT; r.extent.height = STATUS_MESSAGE_HEIGHT;
SetContext (StatusContext); SetContext (StatusContext);
SetFlashRect (&r, (FRAME)0); SetFlashRect (&r);
} }
UnlockMutex (GraphicsLock); UnlockMutex (GraphicsLock);
} }
+12 -7
View File
@@ -623,7 +623,7 @@ PickPlanetSide (MENU_STATE *pMS)
r.extent.height = FLASH_HEIGHT; r.extent.height = FLASH_HEIGHT;
LoadDisplayPixmap (&r, pMenuState->flash_frame0); LoadDisplayPixmap (&r, pMenuState->flash_frame0);
SetFlashRect (NULL, (FRAME)0); SetFlashRect (NULL);
UnlockMutex (GraphicsLock); UnlockMutex (GraphicsLock);
InitLander (0); InitLander (0);
@@ -720,7 +720,7 @@ PickPlanetSide (MENU_STATE *pMS)
DrawMenuStateStrings (PM_MIN_SCAN, DISPATCH_SHUTTLE); DrawMenuStateStrings (PM_MIN_SCAN, DISPATCH_SHUTTLE);
LockMutex (GraphicsLock); LockMutex (GraphicsLock);
SetFlashRect (SFR_MENU_3DO, (FRAME)0); SetFlashRect (SFR_MENU_3DO);
UnlockMutex (GraphicsLock); UnlockMutex (GraphicsLock);
ExitPlanetSide: ExitPlanetSide:
@@ -732,15 +732,20 @@ ExitPlanetSide:
} }
else else
{ {
SIZE dx = 0, dy = 0; SIZE dx = 0;
SIZE dy = 0;
POINT new_pt; POINT new_pt;
new_pt = pSolarSysState->MenuState.first_item; new_pt = pSolarSysState->MenuState.first_item;
if (PulsedInputState.menu[KEY_MENU_LEFT]) dx = -1; if (PulsedInputState.menu[KEY_MENU_LEFT])
if (PulsedInputState.menu[KEY_MENU_RIGHT]) dx = 1; dx = -1;
if (PulsedInputState.menu[KEY_MENU_UP]) dy = -1; if (PulsedInputState.menu[KEY_MENU_RIGHT])
if (PulsedInputState.menu[KEY_MENU_DOWN]) dy = 1; dx = 1;
if (PulsedInputState.menu[KEY_MENU_UP])
dy = -1;
if (PulsedInputState.menu[KEY_MENU_DOWN])
dy = 1;
dx = dx << MAG_SHIFT; dx = dx << MAG_SHIFT;
if (dx) if (dx)
+2 -3
View File
@@ -1281,7 +1281,7 @@ IP_frame (void)
pSolarSysState->MenuState.CurState = STARMAP + 1; pSolarSysState->MenuState.CurState = STARMAP + 1;
IP_input_state = 0; IP_input_state = 0;
} }
SetFlashRect (SFR_MENU_3DO, (FRAME)0); SetFlashRect (SFR_MENU_3DO);
FlushInput (); FlushInput ();
UnlockMutex (GraphicsLock); UnlockMutex (GraphicsLock);
} }
@@ -1418,7 +1418,6 @@ StartGroups:
GLOBAL (ShipStamp.origin.x) = SIS_SCREEN_WIDTH >> 1; GLOBAL (ShipStamp.origin.x) = SIS_SCREEN_WIDTH >> 1;
GLOBAL (ShipStamp.origin.y) = SIS_SCREEN_HEIGHT >> 1; GLOBAL (ShipStamp.origin.y) = SIS_SCREEN_HEIGHT >> 1;
} }
} }
GetPlanetInfo (); GetPlanetInfo ();
@@ -1446,7 +1445,7 @@ StartGroups:
DrawMenuStateStrings (PM_SCAN, SCAN); DrawMenuStateStrings (PM_SCAN, SCAN);
LockMutex (GraphicsLock); LockMutex (GraphicsLock);
pSolarSysState->MenuState.CurState = SCAN + 1; pSolarSysState->MenuState.CurState = SCAN + 1;
SetFlashRect (SFR_MENU_3DO, (FRAME)0); SetFlashRect (SFR_MENU_3DO);
FlushInput (); FlushInput ();
UnlockMutex (GraphicsLock); UnlockMutex (GraphicsLock);
} }
+19 -19
View File
@@ -257,7 +257,7 @@ DrawRaceStrings (BYTE NewRaceItem)
SetContext (OldContext); SetContext (OldContext);
// Flash the ship purchase menu even when optMenu == OPT_PC // Flash the ship purchase menu even when optMenu == OPT_PC
SetFlashRect (SFR_MENU_ANY, (FRAME)0); SetFlashRect (SFR_MENU_ANY);
UnlockMutex (GraphicsLock); UnlockMutex (GraphicsLock);
} }
@@ -693,7 +693,7 @@ DoModifyShips (MENU_STATE *pMS)
UnlockShipFrag (&GLOBAL (built_ship_q), hStarShip); UnlockShipFrag (&GLOBAL (built_ship_q), hStarShip);
} }
SetFlashRect (NULL, (FRAME)0); SetFlashRect (NULL);
// Do not call EndHangarAnim() with GraphicsLock held! // Do not call EndHangarAnim() with GraphicsLock held!
UnlockMutex (GraphicsLock); UnlockMutex (GraphicsLock);
EndHangarAnim (pMS); EndHangarAnim (pMS);
@@ -719,7 +719,7 @@ DoModifyShips (MENU_STATE *pMS)
flash_r.corner.y = RADAR_Y - flash_r.corner.y; flash_r.corner.y = RADAR_Y - flash_r.corner.y;
flash_r.extent.width = RADAR_WIDTH; flash_r.extent.width = RADAR_WIDTH;
flash_r.extent.height = RADAR_HEIGHT; flash_r.extent.height = RADAR_HEIGHT;
SetFlashRect (&flash_r, (FRAME)0); SetFlashRect (&flash_r);
} }
} }
else else
@@ -736,7 +736,7 @@ DoModifyShips (MENU_STATE *pMS)
{ {
COUNT Index; COUNT Index;
// SetFlashRect (NULL, (FRAME)0); // SetFlashRect (NULL);
UnlockMutex (GraphicsLock); UnlockMutex (GraphicsLock);
if (!(pMS->delta_item & MODIFY_CREW_FLAG)) if (!(pMS->delta_item & MODIFY_CREW_FLAG))
{ {
@@ -748,7 +748,7 @@ DoModifyShips (MENU_STATE *pMS)
{ {
pMS->delta_item ^= MODIFY_CREW_FLAG; pMS->delta_item ^= MODIFY_CREW_FLAG;
LockMutex (GraphicsLock); LockMutex (GraphicsLock);
SetFlashRect (SFR_MENU_3DO, (FRAME)0); SetFlashRect (SFR_MENU_3DO);
UnlockMutex (GraphicsLock); UnlockMutex (GraphicsLock);
DrawMenuStateStrings (PM_CREW, SHIPYARD_CREW); DrawMenuStateStrings (PM_CREW, SHIPYARD_CREW);
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT); SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
@@ -767,7 +767,7 @@ DoModifyShips (MENU_STATE *pMS)
(SHIP_FRAGMENT*)0); (SHIP_FRAGMENT*)0);
//Reset flash rectangle //Reset flash rectangle
LockMutex (GraphicsLock); LockMutex (GraphicsLock);
SetFlashRect (SFR_MENU_3DO, (FRAME)0); SetFlashRect (SFR_MENU_3DO);
UnlockMutex (GraphicsLock); UnlockMutex (GraphicsLock);
DrawMenuStateStrings (PM_CREW, SHIPYARD_CREW); DrawMenuStateStrings (PM_CREW, SHIPYARD_CREW);
@@ -780,7 +780,7 @@ DoModifyShips (MENU_STATE *pMS)
r.extent.width = SHIP_WIN_WIDTH; r.extent.width = SHIP_WIN_WIDTH;
r.extent.height = 5; r.extent.height = 5;
SetContext (SpaceContext); SetContext (SpaceContext);
SetFlashRect (&r, (FRAME)0); SetFlashRect (&r);
UnlockMutex (GraphicsLock); UnlockMutex (GraphicsLock);
} }
else else
@@ -827,7 +827,7 @@ DoModifyShips (MENU_STATE *pMS)
hStarShip); hStarShip);
if (StarShipPtr->crew_level == 0) if (StarShipPtr->crew_level == 0)
{ {
SetFlashRect (NULL, (FRAME)0); SetFlashRect (NULL);
UnlockMutex (GraphicsLock); UnlockMutex (GraphicsLock);
ShowCombatShip ((COUNT)pMS->CurState, ShowCombatShip ((COUNT)pMS->CurState,
StarShipPtr); StarShipPtr);
@@ -845,7 +845,7 @@ DoModifyShips (MENU_STATE *pMS)
r.extent.width = SHIP_WIN_WIDTH; r.extent.width = SHIP_WIN_WIDTH;
r.extent.height = SHIP_WIN_HEIGHT; r.extent.height = SHIP_WIN_HEIGHT;
SetContext (SpaceContext); SetContext (SpaceContext);
SetFlashRect (&r, (FRAME)0); SetFlashRect (&r);
} }
else else
{ {
@@ -862,7 +862,7 @@ DoModifyShips (MENU_STATE *pMS)
{ {
SetContext (StatusContext); SetContext (StatusContext);
GetGaugeRect (&r, TRUE); GetGaugeRect (&r, TRUE);
SetFlashRect (&r, (FRAME)0); SetFlashRect (&r);
SetContext (SpaceContext); SetContext (SpaceContext);
SetMenuSounds (MENU_SOUND_UP | MENU_SOUND_DOWN, SetMenuSounds (MENU_SOUND_UP | MENU_SOUND_DOWN,
MENU_SOUND_SELECT | MENU_SOUND_CANCEL); MENU_SOUND_SELECT | MENU_SOUND_CANCEL);
@@ -875,7 +875,7 @@ DoModifyShips (MENU_STATE *pMS)
r.extent.width = SHIP_WIN_WIDTH; r.extent.width = SHIP_WIN_WIDTH;
r.extent.height = 5; r.extent.height = 5;
SetContext (SpaceContext); SetContext (SpaceContext);
SetFlashRect (&r, (FRAME)0); SetFlashRect (&r);
SetMenuSounds (MENU_SOUND_UP | MENU_SOUND_DOWN, SetMenuSounds (MENU_SOUND_UP | MENU_SOUND_DOWN,
MENU_SOUND_SELECT | MENU_SOUND_CANCEL); MENU_SOUND_SELECT | MENU_SOUND_CANCEL);
} }
@@ -907,7 +907,7 @@ DoModifyShips (MENU_STATE *pMS)
SetContext (StatusContext); SetContext (StatusContext);
GetGaugeRect (&r, TRUE); GetGaugeRect (&r, TRUE);
SetFlashRect (&r, (FRAME)0); SetFlashRect (&r);
SetContext (SpaceContext); SetContext (SpaceContext);
} }
else else
@@ -946,7 +946,7 @@ DoModifyShips (MENU_STATE *pMS)
r.extent.width = SHIP_WIN_WIDTH; r.extent.width = SHIP_WIN_WIDTH;
r.extent.height = 5; r.extent.height = 5;
SetContext (SpaceContext); SetContext (SpaceContext);
SetFlashRect (&r, (FRAME)0); SetFlashRect (&r);
} }
else else
{ // at capacity or not enough RUs { // at capacity or not enough RUs
@@ -976,7 +976,7 @@ DoModifyShips (MENU_STATE *pMS)
SetContext (StatusContext); SetContext (StatusContext);
GetGaugeRect (&r, TRUE); GetGaugeRect (&r, TRUE);
SetFlashRect (&r, (FRAME)0); SetFlashRect (&r);
SetContext (SpaceContext); SetContext (SpaceContext);
} }
else else
@@ -1009,7 +1009,7 @@ DoModifyShips (MENU_STATE *pMS)
r.extent.width = SHIP_WIN_WIDTH; r.extent.width = SHIP_WIN_WIDTH;
r.extent.height = 5; r.extent.height = 5;
SetContext (SpaceContext); SetContext (SpaceContext);
SetFlashRect (&r, (FRAME)0); SetFlashRect (&r);
} }
} }
@@ -1032,7 +1032,7 @@ DoModifyShips (MENU_STATE *pMS)
pMS->CurState = SHIPYARD_CREW; pMS->CurState = SHIPYARD_CREW;
DrawMenuStateStrings (PM_CREW, pMS->CurState); DrawMenuStateStrings (PM_CREW, pMS->CurState);
LockMutex (GraphicsLock); LockMutex (GraphicsLock);
SetFlashRect (SFR_MENU_3DO, (FRAME)0); SetFlashRect (SFR_MENU_3DO);
UnlockMutex (GraphicsLock); UnlockMutex (GraphicsLock);
return TRUE; return TRUE;
@@ -1058,7 +1058,7 @@ ChangeFlashRect:
pMS->flash_rect0.extent.width = SHIP_WIN_WIDTH; pMS->flash_rect0.extent.width = SHIP_WIN_WIDTH;
pMS->flash_rect0.extent.height = SHIP_WIN_HEIGHT; pMS->flash_rect0.extent.height = SHIP_WIN_HEIGHT;
} }
SetFlashRect (&pMS->flash_rect0, (FRAME)0); SetFlashRect (&pMS->flash_rect0);
} }
UnlockMutex (GraphicsLock); UnlockMutex (GraphicsLock);
} }
@@ -1298,7 +1298,7 @@ DoShipyard (MENU_STATE *pMS)
ShowCombatShip ((COUNT)~0, (SHIP_FRAGMENT*)0); ShowCombatShip ((COUNT)~0, (SHIP_FRAGMENT*)0);
LockMutex (GraphicsLock); LockMutex (GraphicsLock);
SetFlashRect (SFR_MENU_3DO, (FRAME)0); SetFlashRect (SFR_MENU_3DO);
UnlockMutex (GraphicsLock); UnlockMutex (GraphicsLock);
} }
@@ -1332,7 +1332,7 @@ ExitShipyard:
goto ExitShipyard; goto ExitShipyard;
DrawMenuStateStrings (PM_CREW, pMS->CurState); DrawMenuStateStrings (PM_CREW, pMS->CurState);
LockMutex (GraphicsLock); LockMutex (GraphicsLock);
SetFlashRect (SFR_MENU_3DO, (FRAME)0); SetFlashRect (SFR_MENU_3DO);
BeginHangarAnim (pMS); BeginHangarAnim (pMS);
UnlockMutex (GraphicsLock); UnlockMutex (GraphicsLock);
} }
+30 -98
View File
@@ -227,9 +227,7 @@ DrawSISMessageEx (const UNICODE *pStr, SIZE CurPos, SIZE ExPos, COUNT flags)
SetContextFont (TinyFont); SetContextFont (TinyFont);
if (flags & DSME_CLEARFR) if (flags & DSME_CLEARFR)
{ SetFlashRect (NULL);
SetFlashRect (NULL, (FRAME)0);
}
if (CurPos < 0 && ExPos < 0) if (CurPos < 0 && ExPos < 0)
{ // normal state { // normal state
@@ -321,8 +319,9 @@ DrawSISMessageEx (const UNICODE *pStr, SIZE CurPos, SIZE ExPos, COUNT flags)
if (flags & DSME_SETFR) if (flags & DSME_SETFR)
{ {
r.corner.x = r.corner.y = 0; r.corner.x = 0;
SetFlashRect (&r, (FRAME)0); r.corner.y = 0;
SetFlashRect (&r);
} }
UnbatchGraphics (); UnbatchGraphics ();
@@ -1290,7 +1289,6 @@ CountSISPieces (BYTE piece_type)
Task flash_task = 0; Task flash_task = 0;
RECT flash_rect; RECT flash_rect;
static FRAME flash_frame;
static FRAME flash_screen_frame = 0; static FRAME flash_screen_frame = 0;
static int flash_changed; static int flash_changed;
Mutex flash_mutex = 0; Mutex flash_mutex = 0;
@@ -1308,7 +1306,6 @@ flash_rect_func (void *data)
DWORD TimeIn, WaitTime; DWORD TimeIn, WaitTime;
SIZE strength, fstrength, incr; SIZE strength, fstrength, incr;
RECT cached_rect, framesize_rect; RECT cached_rect, framesize_rect;
FRAME cached_frame = 0;
FRAME cached_screen_frame = 0; FRAME cached_screen_frame = 0;
Task task = (Task)data; Task task = (Task)data;
int cached[CACHE_SIZE]; int cached[CACHE_SIZE];
@@ -1334,7 +1331,6 @@ flash_rect_func (void *data)
{ {
RECT screen_rect; RECT screen_rect;
cached_rect = flash_rect; cached_rect = flash_rect;
cached_frame = flash_frame;
if (cached_screen_frame) if (cached_screen_frame)
DestroyDrawable (ReleaseDrawable (cached_screen_frame)); DestroyDrawable (ReleaseDrawable (cached_screen_frame));
flash_changed = 0; flash_changed = 0;
@@ -1349,8 +1345,6 @@ flash_rect_func (void *data)
arith_frame_blit (flash_screen_frame, &screen_rect, arith_frame_blit (flash_screen_frame, &screen_rect,
cached_screen_frame, NULL, 0, 0); cached_screen_frame, NULL, 0, 0);
UnlockMutex (flash_mutex); UnlockMutex (flash_mutex);
if (cached_frame)
GetFrameRect (cached_frame, &framesize_rect);
for (i = 0; i < CACHE_SIZE; i++) for (i = 0; i < CACHE_SIZE; i++)
{ {
cached[i] = 0; cached[i] = 0;
@@ -1365,89 +1359,31 @@ flash_rect_func (void *data)
if (cached_rect.extent.width) if (cached_rect.extent.width)
{ {
STAMP *pStamp; STAMP *pStamp;
if (cached_frame)
{
#define MIN_F_STRENGTH -3
#define MAX_F_STRENGTH 3
int num = 0, denom = 0;
fstrength += incr;
if (fstrength > MAX_F_STRENGTH)
{
fstrength = MAX_F_STRENGTH - 1;
incr = -1;
}
else if (fstrength < MIN_F_STRENGTH)
{
fstrength = MIN_F_STRENGTH + 1;
incr = 1;
}
if (cached[fstrength - MIN_F_STRENGTH])
pStamp = &cached_stamp[fstrength - MIN_F_STRENGTH];
else
{
RECT tmp_rect = framesize_rect;
pStamp = &cached_stamp[fstrength - MIN_F_STRENGTH];
cached[fstrength - MIN_F_STRENGTH] = 1;
pStamp->frame = CaptureDrawable (CreateDrawable (
WANT_PIXMAP, framesize_rect.extent.width,
framesize_rect.extent.height, 1));
pStamp->origin.x = framesize_rect.corner.x;
pStamp->origin.y = framesize_rect.corner.y;
tmp_rect.corner.x = 0;
tmp_rect.corner.y = 0;
if (fstrength != NORMAL_F_STRENGTH)
{
arith_frame_blit (cached_frame, &tmp_rect,
pStamp->frame, NULL,
fstrength > 0 ? fstrength : -fstrength, 16);
if (fstrength < 0)
{
// Subtractive blit.
num = -8;
denom = 8;
}
else
{
// Additive blit.
num = 8;
denom = -8;
}
}
arith_frame_blit (cached_screen_frame, &framesize_rect,
pStamp->frame, &tmp_rect, num, denom);
}
}
else
{
#define MIN_STRENGTH 4 #define MIN_STRENGTH 4
#define MAX_STRENGTH 6 #define MAX_STRENGTH 6
strength += 2; strength += 2;
if (strength > MAX_STRENGTH) if (strength > MAX_STRENGTH)
strength = MIN_STRENGTH; strength = MIN_STRENGTH;
if (cached[strength - MIN_STRENGTH]) if (cached[strength - MIN_STRENGTH])
pStamp = &cached_stamp[strength - MIN_STRENGTH]; pStamp = &cached_stamp[strength - MIN_STRENGTH];
else else
{ {
RECT tmp_rect = cached_rect; RECT tmp_rect = cached_rect;
pStamp = &cached_stamp[strength - MIN_STRENGTH]; pStamp = &cached_stamp[strength - MIN_STRENGTH];
cached[strength - MIN_STRENGTH] = 1; cached[strength - MIN_STRENGTH] = 1;
pStamp->frame = CaptureDrawable (CreateDrawable (WANT_PIXMAP, pStamp->frame = CaptureDrawable (CreateDrawable (WANT_PIXMAP,
cached_rect.extent.width, cached_rect.extent.height, 1)); cached_rect.extent.width, cached_rect.extent.height,
pStamp->origin.x = 0; 1));
pStamp->origin.y = 0; pStamp->origin.x = 0;
tmp_rect.corner.x = 0; pStamp->origin.y = 0;
tmp_rect.corner.y = 0; tmp_rect.corner.x = 0;
tmp_rect.corner.y = 0;
arith_frame_blit (cached_screen_frame, &tmp_rect, pStamp->frame, arith_frame_blit (cached_screen_frame, &tmp_rect,
&tmp_rect, 4, 4); pStamp->frame, &tmp_rect, 4, 4);
if (strength != 4) if (strength != 4)
arith_frame_blit (cached_screen_frame, &tmp_rect, pStamp->frame, arith_frame_blit (cached_screen_frame, &tmp_rect,
&tmp_rect, strength, 4); pStamp->frame, &tmp_rect, strength, 4);
}
} }
LockMutex (GraphicsLock); LockMutex (GraphicsLock);
OldContext = SetContext (ScreenContext); OldContext = SetContext (ScreenContext);
@@ -1482,18 +1418,17 @@ flash_rect_func (void *data)
} }
void void
SetFlashRect (RECT *pRect, FRAME f) SetFlashRect (RECT *pRect)
{ {
RECT clip_r, temp_r, flash_rect1, old_r; RECT clip_r, temp_r, flash_rect1, old_r;
CONTEXT OldContext; CONTEXT OldContext;
FRAME old_f;
int create_flash = 0; int create_flash = 0;
if (! flash_mutex) if (! flash_mutex)
flash_mutex = CreateMutex ("FlashRect Lock", SYNC_CLASS_TOPLEVEL | SYNC_CLASS_VIDEO); flash_mutex = CreateMutex ("FlashRect Lock",
SYNC_CLASS_TOPLEVEL | SYNC_CLASS_VIDEO);
old_r = flash_rect; old_r = flash_rect;
old_f = flash_frame;
flash_rect1 = flash_rect; flash_rect1 = flash_rect;
if (pRect != SFR_MENU_3DO && pRect != SFR_MENU_ANY) if (pRect != SFR_MENU_3DO && pRect != SFR_MENU_ANY)
@@ -1541,15 +1476,13 @@ SetFlashRect (RECT *pRect, FRAME f)
} }
LockMutex (flash_mutex); LockMutex (flash_mutex);
flash_frame = f;
flash_rect = flash_rect1; flash_rect = flash_rect1;
if (old_r.extent.width if (old_r.extent.width
&& (old_r.extent.width != flash_rect.extent.width && (old_r.extent.width != flash_rect.extent.width
|| old_r.extent.height != flash_rect.extent.height || old_r.extent.height != flash_rect.extent.height
|| old_r.corner.x != flash_rect.corner.x || old_r.corner.x != flash_rect.corner.x
|| old_r.corner.y != flash_rect.corner.y || old_r.corner.y != flash_rect.corner.y))
|| old_f != flash_frame))
{ {
if (flash_screen_frame) if (flash_screen_frame)
{ {
@@ -1660,4 +1593,3 @@ SaveFlagshipState (void)
} }
} }
+1 -1
View File
@@ -261,7 +261,7 @@ extern void RepairSISBorder (void);
extern void InitSISContexts (void); extern void InitSISContexts (void);
extern void DrawSISFrame (void); extern void DrawSISFrame (void);
extern void ClearSISRect (BYTE ClearFlags); extern void ClearSISRect (BYTE ClearFlags);
extern void SetFlashRect (RECT *pRect, FRAME f); extern void SetFlashRect (RECT *pRect);
#define SFR_MENU_3DO ((RECT*)~0L) #define SFR_MENU_3DO ((RECT*)~0L)
#define SFR_MENU_ANY ((RECT*)~1L) #define SFR_MENU_ANY ((RECT*)~1L)
extern void DrawHyperCoords (POINT puniverse); extern void DrawHyperCoords (POINT puniverse);
+1 -1
View File
@@ -303,7 +303,7 @@ DoStarBase (MENU_STATE *pMS)
pMS->InputFunc = DoStarBase; pMS->InputFunc = DoStarBase;
LockMutex (GraphicsLock); LockMutex (GraphicsLock);
SetFlashRect (NULL, (FRAME)0); SetFlashRect (NULL);
if (pMS->hMusic) if (pMS->hMusic)
{ {
+1 -1
View File
@@ -274,7 +274,7 @@ while (--ac > 0)
} }
LockMutex (GraphicsLock); LockMutex (GraphicsLock);
SetFlashRect (NULL, (FRAME)0); SetFlashRect (NULL);
UnlockMutex (GraphicsLock); UnlockMutex (GraphicsLock);
LastActivity = GLOBAL (CurrentActivity); LastActivity = GLOBAL (CurrentActivity);