From d595d40186d44141604e85f87c4ce15f82a30719 Mon Sep 17 00:00:00 2001 From: avolkov Date: Fri, 20 Nov 2009 18:37:32 +0000 Subject: [PATCH] Removal of redraw hacks obsoleted by revisions 390 (introduction of SOLARSYS_STATE.PauseRotate), 469 (save of screen state) and 1321 (abolishment of IPtask_func); dead PlayMusic() hacks also removed; also fixes bug #868 git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3331 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/src/uqm/gameopt.c | 67 ++++------------------------------- sc2/src/uqm/planets/plangen.c | 1 - 2 files changed, 7 insertions(+), 61 deletions(-) diff --git a/sc2/src/uqm/gameopt.c b/sc2/src/uqm/gameopt.c index f5a524d0e..b8bae91d9 100644 --- a/sc2/src/uqm/gameopt.c +++ b/sc2/src/uqm/gameopt.c @@ -875,17 +875,6 @@ Restart: { // Selected LOAD from main menu, and now canceled GLOBAL (CurrentActivity) |= CHECK_ABORT; } - else if (pSolarSysState) - { -#define DRAW_REFRESH (1 << 5) -#define REPAIR_SCAN (1 << 6) - extern BYTE draw_sys_flags; - - if (pSolarSysState->MenuState.Initialized < 3) - draw_sys_flags |= DRAW_REFRESH; - else if (pSolarSysState->MenuState.Initialized == 4) - draw_sys_flags |= REPAIR_SCAN; - } return (FALSE); } else if (PulsedInputState.menu[KEY_MENU_SELECT]) @@ -922,17 +911,6 @@ Restart: goto Restart; } ResumeMusic (); - if (pSolarSysState) - { -#define DRAW_REFRESH (1 << 5) -#define REPAIR_SCAN (1 << 6) - extern BYTE draw_sys_flags; - - if (pSolarSysState->MenuState.Initialized < 3) - draw_sys_flags |= DRAW_REFRESH; - else if (pSolarSysState->MenuState.Initialized == 4) - draw_sys_flags |= REPAIR_SCAN; - } } else { @@ -1120,7 +1098,6 @@ PickGame (MENU_STATE *pMS) if (pSolarSysState) { - ++pSolarSysState->MenuState.Initialized; pSolarSysState->PauseRotate = 1; TaskSwitch (); } @@ -1132,6 +1109,7 @@ PickGame (MENU_STATE *pMS) DlgStamp.origin.x = 0; DlgStamp.origin.y = 0; + // Save the current state of the screen for later restoration DlgRect.corner.x = SIS_ORG_X; DlgRect.corner.y = SIS_ORG_Y; DlgRect.extent.width = SIS_SCREEN_WIDTH; @@ -1164,46 +1142,15 @@ PickGame (MENU_STATE *pMS) } if (!(GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD))) - { // Restore previous screen if necessary - // TODO: Need a better test for in-encounter - if (CommData.ConversationPhrasesRes - || !(pSolarSysState - && pSolarSysState->MenuState.Initialized < 3)) - { - SetTransitionSource (&DlgRect); - BatchGraphics (); - DrawStamp(&DlgStamp); - ScreenTransition (3, &DlgRect); - UnbatchGraphics (); - } + { // Restore previous screen + SetTransitionSource (&DlgRect); + BatchGraphics (); + DrawStamp (&DlgStamp); + ScreenTransition (3, &DlgRect); + UnbatchGraphics (); if (pSolarSysState) - { - /* We're in interplanetary, so we let the IP - * functions know we're ready to draw stuff - * again and then update the frame twice; once - * for the screen transition, and once to draw - * the ships afterwards. */ - --pSolarSysState->MenuState.Initialized; pSolarSysState->PauseRotate = 0; - IP_frame (); - IP_frame (); - - - // TODO: Need a better test for in-encounter - if (!CommData.ConversationPhrasesRes - && !PLRPlaying ((MUSIC_REF)~0)) - { - if (pSolarSysState->MenuState.Initialized < 3) - { - PlayMusic (SpaceMusic, TRUE, 1); - } - else - { - PlayMusic (LanderMusic, TRUE, 1); - } - } - } } DestroyDrawable (ReleaseDrawable (DlgStamp.frame)); diff --git a/sc2/src/uqm/planets/plangen.c b/sc2/src/uqm/planets/plangen.c index b3bdae3c8..e4c851576 100644 --- a/sc2/src/uqm/planets/plangen.c +++ b/sc2/src/uqm/planets/plangen.c @@ -2088,7 +2088,6 @@ rotate_planet_task (void *data) // to acquire the graphics lock LockMutex (GraphicsLock); if (*(volatile UBYTE *)&pSS->PauseRotate != 1 -// if (((SOLARSYS_STATE *volatile)pSS)->MenuState.Initialized <= 3 && !(GLOBAL (CurrentActivity) & CHECK_ABORT)) { //PauseRotate == 2 is a single-step