From: <Mee...@us...> - 2009-10-31 15:37:55
|
Revision: 3269 http://sc2.svn.sourceforge.net/sc2/?rev=3269&view=rev Author: Meep-Eep Date: 2009-10-31 15:37:46 +0000 (Sat, 31 Oct 2009) Log Message: ----------- Second argument of SetFlashRect is now always 0. This commit removes that argument. Also some small cleanups. Modified Paths: -------------- trunk/sc2/src/uqm/encount.c trunk/sc2/src/uqm/gameopt.c trunk/sc2/src/uqm/hyper.c trunk/sc2/src/uqm/menu.c trunk/sc2/src/uqm/outfit.c trunk/sc2/src/uqm/pickship.c trunk/sc2/src/uqm/planets/pstarmap.c trunk/sc2/src/uqm/planets/roster.c trunk/sc2/src/uqm/planets/scan.c trunk/sc2/src/uqm/planets/solarsys.c trunk/sc2/src/uqm/shipyard.c trunk/sc2/src/uqm/sis.c trunk/sc2/src/uqm/sis.h trunk/sc2/src/uqm/starbase.c trunk/sc2/src/uqm/starcon.c Modified: trunk/sc2/src/uqm/encount.c =================================================================== --- trunk/sc2/src/uqm/encount.c 2009-10-31 14:42:02 UTC (rev 3268) +++ trunk/sc2/src/uqm/encount.c 2009-10-31 15:37:46 UTC (rev 3269) @@ -75,7 +75,7 @@ { 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 @@ 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); Modified: trunk/sc2/src/uqm/gameopt.c =================================================================== --- trunk/sc2/src/uqm/gameopt.c 2009-10-31 14:42:02 UTC (rev 3268) +++ trunk/sc2/src/uqm/gameopt.c 2009-10-31 15:37:46 UTC (rev 3269) @@ -237,7 +237,7 @@ if (!(state & DDSHS_EDIT)) { // normal state - SetFlashRect (SFR_MENU_3DO, (FRAME)0); + SetFlashRect (SFR_MENU_3DO); if (pMS->InputFunc == DoNaming) { @@ -318,7 +318,7 @@ SetContextForeGroundColor (ForeGround); font_DrawText (&lf); - SetFlashRect (&r, (FRAME)0); + SetFlashRect (&r); } UnlockMutex (GraphicsLock); @@ -892,7 +892,7 @@ 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 @@ } else { - SetFlashRect (NULL, (FRAME)0); + SetFlashRect (NULL); DrawStamp (&MsgStamp); DestroyDrawable (ReleaseDrawable (MsgStamp.frame)); UnlockMutex (GraphicsLock); @@ -965,7 +965,7 @@ 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 @@ } UnbatchGraphics (); } - SetFlashRect (NULL, (FRAME)0); + SetFlashRect (NULL); UnlockMutex (GraphicsLock); } Modified: trunk/sc2/src/uqm/hyper.c =================================================================== --- trunk/sc2/src/uqm/hyper.c 2009-10-31 14:42:02 UTC (rev 3268) +++ trunk/sc2/src/uqm/hyper.c 2009-10-31 15:37:46 UTC (rev 3269) @@ -1596,14 +1596,14 @@ 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); Modified: trunk/sc2/src/uqm/menu.c =================================================================== --- trunk/sc2/src/uqm/menu.c 2009-10-31 14:42:02 UTC (rev 3268) +++ trunk/sc2/src/uqm/menu.c 2009-10-31 15:37:46 UTC (rev 3269) @@ -603,7 +603,7 @@ && 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); } Modified: trunk/sc2/src/uqm/outfit.c =================================================================== --- trunk/sc2/src/uqm/outfit.c 2009-10-31 14:42:02 UTC (rev 3268) +++ trunk/sc2/src/uqm/outfit.c 2009-10-31 15:37:46 UTC (rev 3269) @@ -237,7 +237,7 @@ SetContext (SpaceContext); ClearSISRect (CLEAR_SIS_RADAR); - SetFlashRect (NULL, (FRAME)0); + SetFlashRect (NULL); goto InitFlash; } else if (select || cancel) @@ -298,7 +298,7 @@ LockMutex (GraphicsLock); SetContext (SpaceContext); - SetFlashRect (NULL, (FRAME)0); + SetFlashRect (NULL); if (select) { @@ -382,7 +382,7 @@ 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 @@ 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 @@ 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 @@ 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 @@ } SetContext (StatusContext); GetGaugeRect (&r, FALSE); - SetFlashRect (&r, (FRAME)0); + SetFlashRect (&r); UnlockMutex (GraphicsLock); } } @@ -713,7 +713,7 @@ UnbatchGraphics (); LockMutex (GraphicsLock); - SetFlashRect (SFR_MENU_3DO, (FRAME)0); + SetFlashRect (SFR_MENU_3DO); UnlockMutex (GraphicsLock); GLOBAL_SIS (FuelOnBoard) = @@ -732,7 +732,7 @@ { pMS->CurState = OUTFIT_FUEL; LockMutex (GraphicsLock); - SetFlashRect (SFR_MENU_3DO, (FRAME)0); + SetFlashRect (SFR_MENU_3DO); UnlockMutex (GraphicsLock); } else @@ -758,14 +758,14 @@ 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 @@ goto ExitOutfit; DrawMenuStateStrings (PM_FUEL, pMS->CurState); LockMutex (GraphicsLock); - SetFlashRect (SFR_MENU_3DO, (FRAME)0); + SetFlashRect (SFR_MENU_3DO); UnlockMutex (GraphicsLock); break; } Modified: trunk/sc2/src/uqm/pickship.c =================================================================== --- trunk/sc2/src/uqm/pickship.c 2009-10-31 14:42:02 UTC (rev 3268) +++ trunk/sc2/src/uqm/pickship.c 2009-10-31 15:37:46 UTC (rev 3269) @@ -236,8 +236,8 @@ 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 @@ pMenuState = 0; LockMutex (GraphicsLock); - SetFlashRect (NULL, (FRAME)0); + SetFlashRect (NULL); hBattleShip = (HSTARSHIP)MenuState.CurFrame; } Modified: trunk/sc2/src/uqm/planets/pstarmap.c =================================================================== --- trunk/sc2/src/uqm/planets/pstarmap.c 2009-10-31 14:42:02 UTC (rev 3268) +++ trunk/sc2/src/uqm/planets/pstarmap.c 2009-10-31 15:37:46 UTC (rev 3269) @@ -1724,7 +1724,7 @@ if (NewState != SCAN + 1 && NewState != (GAME_MENU) + 1) { LockMutex (GraphicsLock); - SetFlashRect (NULL, (FRAME)0); + SetFlashRect (NULL); UnlockMutex (GraphicsLock); } @@ -1793,7 +1793,7 @@ --pMS->Initialized; pSolarSysState->PauseRotate = 0; LockMutex (GraphicsLock); - SetFlashRect (SFR_MENU_3DO, (FRAME)0); + SetFlashRect (SFR_MENU_3DO); UnlockMutex (GraphicsLock); break; } @@ -1829,7 +1829,7 @@ else if (pMS->CurState) { LockMutex (GraphicsLock); - SetFlashRect (SFR_MENU_3DO, (FRAME)0); + SetFlashRect (SFR_MENU_3DO); UnlockMutex (GraphicsLock); if (select) { @@ -1842,7 +1842,7 @@ else { LockMutex (GraphicsLock); - SetFlashRect (NULL, (FRAME)0); + SetFlashRect (NULL); UnlockMutex (GraphicsLock); DrawMenuStateStrings (PM_STARMAP, -NAVIGATION); } Modified: trunk/sc2/src/uqm/planets/roster.c =================================================================== --- trunk/sc2/src/uqm/planets/roster.c 2009-10-31 14:42:02 UTC (rev 3268) +++ trunk/sc2/src/uqm/planets/roster.c 2009-10-31 15:37:46 UTC (rev 3269) @@ -137,7 +137,7 @@ 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 @@ 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 @@ LockMutex (GraphicsLock); pMS->CurState ^= SHIP_TOGGLE; if (!(pMS->CurState & SHIP_TOGGLE)) - SetFlashRect (NULL, (FRAME)0); + SetFlashRect (NULL); else { RosterCleanup (pMS); @@ -255,7 +255,7 @@ r.extent.width = STATUS_MESSAGE_WIDTH; r.extent.height = STATUS_MESSAGE_HEIGHT; SetContext (StatusContext); - SetFlashRect (&r, (FRAME)0); + SetFlashRect (&r); } UnlockMutex (GraphicsLock); } Modified: trunk/sc2/src/uqm/planets/scan.c =================================================================== --- trunk/sc2/src/uqm/planets/scan.c 2009-10-31 14:42:02 UTC (rev 3268) +++ trunk/sc2/src/uqm/planets/scan.c 2009-10-31 15:37:46 UTC (rev 3269) @@ -623,7 +623,7 @@ r.extent.height = FLASH_HEIGHT; LoadDisplayPixmap (&r, pMenuState->flash_frame0); - SetFlashRect (NULL, (FRAME)0); + SetFlashRect (NULL); UnlockMutex (GraphicsLock); InitLander (0); @@ -720,7 +720,7 @@ 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 @@ } 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) Modified: trunk/sc2/src/uqm/planets/solarsys.c =================================================================== --- trunk/sc2/src/uqm/planets/solarsys.c 2009-10-31 14:42:02 UTC (rev 3268) +++ trunk/sc2/src/uqm/planets/solarsys.c 2009-10-31 15:37:46 UTC (rev 3269) @@ -1281,7 +1281,7 @@ 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 @@ GLOBAL (ShipStamp.origin.x) = SIS_SCREEN_WIDTH >> 1; GLOBAL (ShipStamp.origin.y) = SIS_SCREEN_HEIGHT >> 1; } - } GetPlanetInfo (); @@ -1446,7 +1445,7 @@ DrawMenuStateStrings (PM_SCAN, SCAN); LockMutex (GraphicsLock); pSolarSysState->MenuState.CurState = SCAN + 1; - SetFlashRect (SFR_MENU_3DO, (FRAME)0); + SetFlashRect (SFR_MENU_3DO); FlushInput (); UnlockMutex (GraphicsLock); } Modified: trunk/sc2/src/uqm/shipyard.c =================================================================== --- trunk/sc2/src/uqm/shipyard.c 2009-10-31 14:42:02 UTC (rev 3268) +++ trunk/sc2/src/uqm/shipyard.c 2009-10-31 15:37:46 UTC (rev 3269) @@ -257,7 +257,7 @@ 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 @@ 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 @@ 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 @@ { COUNT Index; -// SetFlashRect (NULL, (FRAME)0); +// SetFlashRect (NULL); UnlockMutex (GraphicsLock); if (!(pMS->delta_item & MODIFY_CREW_FLAG)) { @@ -748,7 +748,7 @@ { 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 @@ (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 @@ 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 @@ hStarShip); if (StarShipPtr->crew_level == 0) { - SetFlashRect (NULL, (FRAME)0); + SetFlashRect (NULL); UnlockMutex (GraphicsLock); ShowCombatShip ((COUNT)pMS->CurState, StarShipPtr); @@ -845,7 +845,7 @@ 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 @@ { 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 @@ 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 @@ SetContext (StatusContext); GetGaugeRect (&r, TRUE); - SetFlashRect (&r, (FRAME)0); + SetFlashRect (&r); SetContext (SpaceContext); } else @@ -946,7 +946,7 @@ 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 @@ SetContext (StatusContext); GetGaugeRect (&r, TRUE); - SetFlashRect (&r, (FRAME)0); + SetFlashRect (&r); SetContext (SpaceContext); } else @@ -1009,7 +1009,7 @@ r.extent.width = SHIP_WIN_WIDTH; r.extent.height = 5; SetContext (SpaceContext); - SetFlashRect (&r, (FRAME)0); + SetFlashRect (&r); } } @@ -1032,7 +1032,7 @@ 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 @@ 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 @@ ShowCombatShip ((COUNT)~0, (SHIP_FRAGMENT*)0); LockMutex (GraphicsLock); - SetFlashRect (SFR_MENU_3DO, (FRAME)0); + SetFlashRect (SFR_MENU_3DO); UnlockMutex (GraphicsLock); } @@ -1332,7 +1332,7 @@ goto ExitShipyard; DrawMenuStateStrings (PM_CREW, pMS->CurState); LockMutex (GraphicsLock); - SetFlashRect (SFR_MENU_3DO, (FRAME)0); + SetFlashRect (SFR_MENU_3DO); BeginHangarAnim (pMS); UnlockMutex (GraphicsLock); } Modified: trunk/sc2/src/uqm/sis.c =================================================================== --- trunk/sc2/src/uqm/sis.c 2009-10-31 14:42:02 UTC (rev 3268) +++ trunk/sc2/src/uqm/sis.c 2009-10-31 15:37:46 UTC (rev 3269) @@ -227,9 +227,7 @@ SetContextFont (TinyFont); if (flags & DSME_CLEARFR) - { - SetFlashRect (NULL, (FRAME)0); - } + SetFlashRect (NULL); if (CurPos < 0 && ExPos < 0) { // normal state @@ -321,8 +319,9 @@ 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 @@ 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 @@ 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 @@ { 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 @@ 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 @@ 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 @@ } 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 @@ } 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 @@ } } - Modified: trunk/sc2/src/uqm/sis.h =================================================================== --- trunk/sc2/src/uqm/sis.h 2009-10-31 14:42:02 UTC (rev 3268) +++ trunk/sc2/src/uqm/sis.h 2009-10-31 15:37:46 UTC (rev 3269) @@ -261,7 +261,7 @@ 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); Modified: trunk/sc2/src/uqm/starbase.c =================================================================== --- trunk/sc2/src/uqm/starbase.c 2009-10-31 14:42:02 UTC (rev 3268) +++ trunk/sc2/src/uqm/starbase.c 2009-10-31 15:37:46 UTC (rev 3269) @@ -303,7 +303,7 @@ pMS->InputFunc = DoStarBase; LockMutex (GraphicsLock); - SetFlashRect (NULL, (FRAME)0); + SetFlashRect (NULL); if (pMS->hMusic) { Modified: trunk/sc2/src/uqm/starcon.c =================================================================== --- trunk/sc2/src/uqm/starcon.c 2009-10-31 14:42:02 UTC (rev 3268) +++ trunk/sc2/src/uqm/starcon.c 2009-10-31 15:37:46 UTC (rev 3269) @@ -274,7 +274,7 @@ } LockMutex (GraphicsLock); - SetFlashRect (NULL, (FRAME)0); + SetFlashRect (NULL); UnlockMutex (GraphicsLock); LastActivity = GLOBAL (CurrentActivity); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |