From ad2c60d2c81b1ef77ab0b2a10402d24f377e3bea Mon Sep 17 00:00:00 2001 From: avolkov Date: Thu, 5 May 2005 06:51:46 +0000 Subject: [PATCH] Spliting UndrawShip() into two functions so that player controls are processed separately from other actions; controls are not processed during DRAW_REFRESH; fixes #725 git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1713 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/src/sc2code/planets/solarsys.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/sc2/src/sc2code/planets/solarsys.c b/sc2/src/sc2code/planets/solarsys.c index 2822aec64..1c2b9e9a0 100644 --- a/sc2/src/sc2code/planets/solarsys.c +++ b/sc2/src/sc2code/planets/solarsys.c @@ -761,18 +761,13 @@ flagship_inertial_thrust (COUNT CurrentAngle) extern void DrawIPRadar (BOOLEAN FirstTime); static void -UndrawShip (void) +ProcessShipControls (void) { COUNT index; - SIZE radius, delta_x, delta_y; - BOOLEAN LeavingInnerSystem; + SIZE delta_x, delta_y; ClockTick (); -#ifdef SHOW_RADAR - DrawIPRadar (FALSE); -#endif /* SHOW_RADAR */ - if (CurrentInputState.key[KEY_P1_THRUST]) delta_y = -1; else @@ -820,6 +815,17 @@ UndrawShip (void) pSolarSysState->thrust_counter = THRUST_WAIT; } +} + +static void +UndrawShip (void) +{ + SIZE radius, delta_x, delta_y; + BOOLEAN LeavingInnerSystem; + +#ifdef SHOW_RADAR + DrawIPRadar (FALSE); +#endif /* SHOW_RADAR */ LeavingInnerSystem = FALSE; radius = pSolarSysState->SunDesc[0].radius; @@ -1074,6 +1080,8 @@ IP_frame (void) DrawSystem (pSolarSysState->SunDesc[0].radius, FALSE); } + if (!(draw_sys_flags & DRAW_REFRESH)) + ProcessShipControls (); UndrawShip (); if (pSolarSysState->MenuState.Initialized != 1) {