diff --git a/sc2/src/uqm/planets/lander.c b/sc2/src/uqm/planets/lander.c index 722e2c9dd..f06b887c1 100644 --- a/sc2/src/uqm/planets/lander.c +++ b/sc2/src/uqm/planets/lander.c @@ -1206,14 +1206,7 @@ RepairScan (void) DrawPlanet (0, 0, 0, 0); #endif DrawScannedObjects (TRUE); - { -#define FLASH_INDEX 105 - STAMP s; - - s.origin = pMenuState->flash_rect0.corner; - s.frame = SetAbsFrameIndex (MiscDataFrame, FLASH_INDEX); - DrawStamp (&s); - } + drawPlanetCursor (pMenuState, FALSE); UnbatchGraphics (); SetContext (OldContext); @@ -1378,8 +1371,7 @@ ScrollPlanetSide (SIZE dx, SIZE dy, SIZE CountDown) } } - pMenuState->flash_rect0.corner.x = new_pt.x >> MAG_SHIFT; - pMenuState->flash_rect0.corner.y = new_pt.y >> MAG_SHIFT; + setPlanetCursorLoc (pMenuState, new_pt); RepairScan (); if (lander_flags & KILL_CREW) @@ -1552,19 +1544,8 @@ InitPlanetSide (void) else if (pt.y >= (MAP_HEIGHT << MAG_SHIFT)) pt.y = (MAP_HEIGHT << MAG_SHIFT) - 1; - // Put this back in as our original menu choice. + // Set the planet location pSolarSysState->MenuState.first_item = pt; - -#ifdef NEVER - SetContext (ScanContext); - s.origin = pMenuState->flash_rect0.corner; - s.origin.x -= (FLASH_WIDTH >> 1); - s.origin.y -= (FLASH_HEIGHT >> 1); - s.frame = pMenuState->flash_frame0; - DrawStamp (&s); -#endif /* NEVER */ - - pMenuState->flash_rect0.corner = pt; SetContext (SpaceContext); SetContextFont (TinyFont); diff --git a/sc2/src/uqm/planets/report.c b/sc2/src/uqm/planets/report.c index 982e09b0f..278628888 100644 --- a/sc2/src/uqm/planets/report.c +++ b/sc2/src/uqm/planets/report.c @@ -244,7 +244,6 @@ InitPageCell: void DoDiscoveryReport (SOUND ReadOutSounds) { - POINT old_curs; CONTEXT OldContext; #ifdef DEBUG @@ -252,15 +251,6 @@ DoDiscoveryReport (SOUND ReadOutSounds) return; #endif - if (pMenuState) - { - old_curs = pMenuState->flash_rect0.corner; - - /* Disable cursor: */ - pMenuState->flash_rect0.corner.x = -1000; - pMenuState->flash_rect0.corner.y = -1000; - } - OldContext = SetContext (ScanContext); { FONT OldFont; @@ -296,9 +286,6 @@ DoDiscoveryReport (SOUND ReadOutSounds) while (AnyButtonPress (TRUE)) TaskSwitch (); LockMutex (GraphicsLock); - - if (pMenuState) - pMenuState->flash_rect0.corner = old_curs; } diff --git a/sc2/src/uqm/planets/scan.c b/sc2/src/uqm/planets/scan.c index 659ef5dda..a29d36f35 100644 --- a/sc2/src/uqm/planets/scan.c +++ b/sc2/src/uqm/planets/scan.c @@ -537,7 +537,7 @@ restorePlanetLocationImage (MENU_STATE *pMS) DrawStamp (&s); } -static void +void drawPlanetCursor (MENU_STATE *pMS, BOOLEAN filled) { STAMP s; @@ -550,15 +550,21 @@ drawPlanetCursor (MENU_STATE *pMS, BOOLEAN filled) DrawStamp (&s); } +void +setPlanetCursorLoc (MENU_STATE *pMS, POINT new_pt) +{ + new_pt.x >>= MAG_SHIFT; + new_pt.y >>= MAG_SHIFT; + pMS->flash_rect0.corner = new_pt; +} + static void SetPlanetLoc (MENU_STATE *pMS, POINT new_pt) { pSolarSysState->MenuState.first_item = new_pt; // Set the new flash location - new_pt.x >>= MAG_SHIFT; - new_pt.y >>= MAG_SHIFT; - pMS->flash_rect0.corner = new_pt; + setPlanetCursorLoc (pMS, new_pt); SetContext (ScanContext); restorePlanetLocationImage (pMS); @@ -634,10 +640,7 @@ PickPlanetSide (MENU_STATE *pMS) LockMutex (GraphicsLock); SetContext (ScanContext); // Set the current flash location - pMS->flash_rect0.corner.x = - pSolarSysState->MenuState.first_item.x >> MAG_SHIFT; - pMS->flash_rect0.corner.y = - pSolarSysState->MenuState.first_item.y >> MAG_SHIFT; + setPlanetCursorLoc (pMS, pSolarSysState->MenuState.first_item); savePlanetLocationImage (pMS); SetFlashRect (NULL); diff --git a/sc2/src/uqm/planets/scan.h b/sc2/src/uqm/planets/scan.h index 7c6c2efb0..a4eec0a10 100644 --- a/sc2/src/uqm/planets/scan.h +++ b/sc2/src/uqm/planets/scan.h @@ -20,6 +20,7 @@ #define _SCAN_H #include "libs/gfxlib.h" +#include "../menustat.h" typedef struct @@ -45,5 +46,8 @@ typedef struct extern void RepairBackRect (RECT *pRect); extern void GeneratePlanetSide (void); +extern void drawPlanetCursor (MENU_STATE *pMS, BOOLEAN filled); +extern void setPlanetCursorLoc (MENU_STATE *pMS, POINT new_pt); + #endif /* _SCAN_H */