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