Split DoFlagshipCommands() into separate menu functions for IP, Orbital and Hyperspace; this allowed for some solarsys and manifest menu cleanups; temporary pBaseDesc setups removed; some invariant tests removed; some code moved around to more appropriate places
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3378 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -73,15 +73,14 @@ DoSelectAction (MENU_STATE *pMS)
|
|||||||
pMS->CurState = HAIL;
|
pMS->CurState = HAIL;
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
case ATTACK + 1:
|
case ATTACK + 1:
|
||||||
pMS->Initialized = GameOptions ();
|
// Clearing FlashRect is not necessary
|
||||||
if (pMS->Initialized)
|
if (!GameOptions ())
|
||||||
{
|
return FALSE;
|
||||||
DrawMenuStateStrings (PM_CONVERSE, pMS->CurState);
|
DrawMenuStateStrings (PM_CONVERSE, pMS->CurState);
|
||||||
LockMutex (GraphicsLock);
|
LockMutex (GraphicsLock);
|
||||||
SetFlashRect (SFR_MENU_3DO);
|
SetFlashRect (SFR_MENU_3DO);
|
||||||
UnlockMutex (GraphicsLock);
|
UnlockMutex (GraphicsLock);
|
||||||
}
|
break;
|
||||||
return ((BOOLEAN)pMS->Initialized);
|
|
||||||
default:
|
default:
|
||||||
printf ("Unknown option: %d\n", pMS->CurState);
|
printf ("Unknown option: %d\n", pMS->CurState);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-11
@@ -24,7 +24,6 @@
|
|||||||
#ifdef NETPLAY
|
#ifdef NETPLAY
|
||||||
# include "netplay/netmelee.h"
|
# include "netplay/netmelee.h"
|
||||||
#endif
|
#endif
|
||||||
#include "planets/planets.h"
|
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
#include "sounds.h"
|
#include "sounds.h"
|
||||||
#include "tactrans.h"
|
#include "tactrans.h"
|
||||||
@@ -377,16 +376,7 @@ DoInput (void *pInputState, BOOLEAN resetInput)
|
|||||||
|
|
||||||
soundFlags = MenuKeysToSoundFlags (&PulsedInputState);
|
soundFlags = MenuKeysToSoundFlags (&PulsedInputState);
|
||||||
|
|
||||||
if (MenuSounds
|
if (MenuSounds && (soundFlags & (sound_0 | sound_1)))
|
||||||
&& (pSolarSysState == 0
|
|
||||||
/* see if in menu */
|
|
||||||
|| pSolarSysState->MenuState.CurState
|
|
||||||
|| pSolarSysState->MenuState.Initialized > 2)
|
|
||||||
&& (soundFlags & (sound_0 | sound_1))
|
|
||||||
#ifdef NEVER
|
|
||||||
&& !PLRPlaying ((MUSIC_REF)~0)
|
|
||||||
#endif /* NEVER */
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
SOUND S;
|
SOUND S;
|
||||||
|
|
||||||
|
|||||||
+34
-13
@@ -238,8 +238,6 @@ DrawDescriptionString (MENU_STATE *pMS, UNICODE *Str, COUNT CursorPos,
|
|||||||
|
|
||||||
if (!(state & DDSHS_EDIT))
|
if (!(state & DDSHS_EDIT))
|
||||||
{ // normal state
|
{ // normal state
|
||||||
SetFlashRect (SFR_MENU_3DO);
|
|
||||||
|
|
||||||
if (pMS->CurState == CHANGE_CAPTAIN_SETTING)
|
if (pMS->CurState == CHANGE_CAPTAIN_SETTING)
|
||||||
DrawCaptainsName ();
|
DrawCaptainsName ();
|
||||||
else
|
else
|
||||||
@@ -327,6 +325,10 @@ DoNaming (MENU_STATE *pMS)
|
|||||||
pMS->Initialized = TRUE;
|
pMS->Initialized = TRUE;
|
||||||
pMS->InputFunc = DoNaming;
|
pMS->InputFunc = DoNaming;
|
||||||
|
|
||||||
|
LockMutex (GraphicsLock);
|
||||||
|
SetFlashRect (NULL);
|
||||||
|
UnlockMutex (GraphicsLock);
|
||||||
|
|
||||||
DrawDescriptionString (pMS, buf, 0, DDSHS_EDIT);
|
DrawDescriptionString (pMS, buf, 0, DDSHS_EDIT);
|
||||||
|
|
||||||
LockMutex (GraphicsLock);
|
LockMutex (GraphicsLock);
|
||||||
@@ -357,6 +359,11 @@ DoNaming (MENU_STATE *pMS)
|
|||||||
utf8StringCopy (Setting, tes.MaxSize, buf);
|
utf8StringCopy (Setting, tes.MaxSize, buf);
|
||||||
else
|
else
|
||||||
utf8StringCopy (buf, sizeof (buf), Setting);
|
utf8StringCopy (buf, sizeof (buf), Setting);
|
||||||
|
|
||||||
|
LockMutex (GraphicsLock);
|
||||||
|
SetFlashRect (SFR_MENU_3DO);
|
||||||
|
UnlockMutex (GraphicsLock);
|
||||||
|
|
||||||
DrawDescriptionString (pMS, buf, 0, DDSHS_NORMAL);
|
DrawDescriptionString (pMS, buf, 0, DDSHS_NORMAL);
|
||||||
|
|
||||||
if (namingCB)
|
if (namingCB)
|
||||||
@@ -837,11 +844,12 @@ DoPickGame (MENU_STATE *pMS)
|
|||||||
|
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
}
|
}
|
||||||
first_time = (BOOLEAN)(pMS->Initialized == 0);
|
first_time = !pMS->Initialized;
|
||||||
SetMenuSounds (MENU_SOUND_ARROWS | MENU_SOUND_PAGEUP | MENU_SOUND_PAGEDOWN, MENU_SOUND_SELECT);
|
SetMenuSounds (MENU_SOUND_ARROWS | MENU_SOUND_PAGEUP | MENU_SOUND_PAGEDOWN, MENU_SOUND_SELECT);
|
||||||
|
|
||||||
if (!pMS->Initialized)
|
if (!pMS->Initialized)
|
||||||
{
|
{
|
||||||
|
// XXX: Save DoGameOptions() state
|
||||||
pMS->delta_item = (SIZE)pMS->CurState;
|
pMS->delta_item = (SIZE)pMS->CurState;
|
||||||
pMS->CurState = NewState = prev_save;
|
pMS->CurState = NewState = prev_save;
|
||||||
pMS->InputFunc = DoPickGame;
|
pMS->InputFunc = DoPickGame;
|
||||||
@@ -863,10 +871,8 @@ Restart:
|
|||||||
}
|
}
|
||||||
else if (PulsedInputState.menu[KEY_MENU_CANCEL])
|
else if (PulsedInputState.menu[KEY_MENU_CANCEL])
|
||||||
{
|
{
|
||||||
LockMutex (GraphicsLock);
|
|
||||||
SetFlashRect (SFR_MENU_3DO);
|
|
||||||
UnlockMutex (GraphicsLock);
|
|
||||||
pMS->ModuleFrame = 0;
|
pMS->ModuleFrame = 0;
|
||||||
|
// XXX: Restore DoGameOptions() state
|
||||||
pMS->CurState = (BYTE)pMS->delta_item;
|
pMS->CurState = (BYTE)pMS->delta_item;
|
||||||
ResumeMusic ();
|
ResumeMusic ();
|
||||||
if (LastActivity == CHECK_LOAD)
|
if (LastActivity == CHECK_LOAD)
|
||||||
@@ -894,7 +900,6 @@ Restart:
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SetFlashRect (NULL);
|
|
||||||
DrawStamp (&MsgStamp);
|
DrawStamp (&MsgStamp);
|
||||||
DestroyDrawable (ReleaseDrawable (MsgStamp.frame));
|
DestroyDrawable (ReleaseDrawable (MsgStamp.frame));
|
||||||
UnlockMutex (GraphicsLock);
|
UnlockMutex (GraphicsLock);
|
||||||
@@ -916,10 +921,10 @@ Restart:
|
|||||||
if (LoadGame ((COUNT)pMS->CurState, NULL))
|
if (LoadGame ((COUNT)pMS->CurState, NULL))
|
||||||
GLOBAL (CurrentActivity) |= CHECK_LOAD;
|
GLOBAL (CurrentActivity) |= CHECK_LOAD;
|
||||||
}
|
}
|
||||||
SetFlashRect (NULL);
|
|
||||||
UnlockMutex (GraphicsLock);
|
UnlockMutex (GraphicsLock);
|
||||||
|
|
||||||
pMS->ModuleFrame = 0;
|
pMS->ModuleFrame = 0;
|
||||||
|
// XXX: Restore DoGameOptions() state
|
||||||
pMS->CurState = (BYTE)pMS->delta_item;
|
pMS->CurState = (BYTE)pMS->delta_item;
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
}
|
}
|
||||||
@@ -1076,7 +1081,6 @@ ChangeGameSelection:
|
|||||||
}
|
}
|
||||||
UnbatchGraphics ();
|
UnbatchGraphics ();
|
||||||
}
|
}
|
||||||
SetFlashRect (NULL);
|
|
||||||
UnlockMutex (GraphicsLock);
|
UnlockMutex (GraphicsLock);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1125,7 +1129,7 @@ PickGame (MENU_STATE *pMS)
|
|||||||
|
|
||||||
DoInput (pMS, TRUE);
|
DoInput (pMS, TRUE);
|
||||||
LockMutex (GraphicsLock);
|
LockMutex (GraphicsLock);
|
||||||
pMS->Initialized = -1;
|
pMS->Initialized = FALSE;
|
||||||
pMS->InputFunc = DoGameOptions;
|
pMS->InputFunc = DoGameOptions;
|
||||||
|
|
||||||
retval = TRUE;
|
retval = TRUE;
|
||||||
@@ -1169,13 +1173,13 @@ DoGameOptions (MENU_STATE *pMS)
|
|||||||
|
|
||||||
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||||
|
|
||||||
if (pMS->Initialized <= 0)
|
if (!pMS->Initialized)
|
||||||
{
|
{
|
||||||
if (LastActivity == CHECK_LOAD)
|
if (LastActivity == CHECK_LOAD)
|
||||||
pMS->CurState = LOAD_GAME;
|
pMS->CurState = LOAD_GAME;
|
||||||
DrawMenuStateStrings (PM_SAVE_GAME, pMS->CurState);
|
DrawMenuStateStrings (PM_SAVE_GAME, pMS->CurState);
|
||||||
|
|
||||||
pMS->Initialized = 1;
|
pMS->Initialized = TRUE;
|
||||||
pMS->InputFunc = DoGameOptions;
|
pMS->InputFunc = DoGameOptions;
|
||||||
}
|
}
|
||||||
else if (PulsedInputState.menu[KEY_MENU_CANCEL]
|
else if (PulsedInputState.menu[KEY_MENU_CANCEL]
|
||||||
@@ -1191,7 +1195,15 @@ DoGameOptions (MENU_STATE *pMS)
|
|||||||
{
|
{
|
||||||
case SAVE_GAME:
|
case SAVE_GAME:
|
||||||
case LOAD_GAME:
|
case LOAD_GAME:
|
||||||
return PickGame (pMS);
|
LockMutex (GraphicsLock);
|
||||||
|
SetFlashRect (NULL);
|
||||||
|
UnlockMutex (GraphicsLock);
|
||||||
|
if (!PickGame (pMS))
|
||||||
|
return FALSE;
|
||||||
|
LockMutex (GraphicsLock);
|
||||||
|
SetFlashRect (SFR_MENU_3DO);
|
||||||
|
UnlockMutex (GraphicsLock);
|
||||||
|
break;
|
||||||
case QUIT_GAME:
|
case QUIT_GAME:
|
||||||
if (ConfirmExit ())
|
if (ConfirmExit ())
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -1220,9 +1232,18 @@ GameOptions (void)
|
|||||||
|
|
||||||
MenuState.InputFunc = DoGameOptions;
|
MenuState.InputFunc = DoGameOptions;
|
||||||
MenuState.CurState = SAVE_GAME;
|
MenuState.CurState = SAVE_GAME;
|
||||||
|
|
||||||
|
LockMutex (GraphicsLock);
|
||||||
|
SetFlashRect (SFR_MENU_3DO);
|
||||||
|
UnlockMutex (GraphicsLock);
|
||||||
|
|
||||||
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||||
DoInput (&MenuState, TRUE);
|
DoInput (&MenuState, TRUE);
|
||||||
|
|
||||||
|
LockMutex (GraphicsLock);
|
||||||
|
SetFlashRect (NULL);
|
||||||
|
UnlockMutex (GraphicsLock);
|
||||||
|
|
||||||
pLocMenuState = 0;
|
pLocMenuState = 0;
|
||||||
|
|
||||||
return ((GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD)) ? FALSE : TRUE);
|
return ((GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD)) ? FALSE : TRUE);
|
||||||
|
|||||||
+74
-4
@@ -22,10 +22,12 @@
|
|||||||
#include "collide.h"
|
#include "collide.h"
|
||||||
#include "colors.h"
|
#include "colors.h"
|
||||||
#include "controls.h"
|
#include "controls.h"
|
||||||
|
#include "gameopt.h"
|
||||||
#include "menustat.h"
|
#include "menustat.h"
|
||||||
// for DrawMenuStateStrings()
|
// for DrawMenuStateStrings()
|
||||||
#include "encount.h"
|
#include "encount.h"
|
||||||
#include "ship.h"
|
#include "ship.h"
|
||||||
|
#include "shipcont.h"
|
||||||
#include "process.h"
|
#include "process.h"
|
||||||
#include "globdata.h"
|
#include "globdata.h"
|
||||||
#include "sis.h"
|
#include "sis.h"
|
||||||
@@ -35,11 +37,11 @@
|
|||||||
#include "resinst.h"
|
#include "resinst.h"
|
||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
#include "sounds.h"
|
#include "sounds.h"
|
||||||
|
#include "options.h"
|
||||||
#include "libs/graphics/gfx_common.h"
|
#include "libs/graphics/gfx_common.h"
|
||||||
#include "libs/mathlib.h"
|
#include "libs/mathlib.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define XOFFS ((RADAR_SCAN_WIDTH + (UNIT_SCREEN_WIDTH << 2)) >> 1)
|
#define XOFFS ((RADAR_SCAN_WIDTH + (UNIT_SCREEN_WIDTH << 2)) >> 1)
|
||||||
#define YOFFS ((RADAR_SCAN_HEIGHT + (UNIT_SCREEN_HEIGHT << 2)) >> 1)
|
#define YOFFS ((RADAR_SCAN_HEIGHT + (UNIT_SCREEN_HEIGHT << 2)) >> 1)
|
||||||
|
|
||||||
@@ -1598,6 +1600,74 @@ SeedUniverse (void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static BOOLEAN
|
||||||
|
DoHyperspaceMenu (MENU_STATE *pMS)
|
||||||
|
{
|
||||||
|
BOOLEAN select = PulsedInputState.menu[KEY_MENU_SELECT];
|
||||||
|
BOOLEAN handled;
|
||||||
|
|
||||||
|
if ((GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD))
|
||||||
|
|| GLOBAL_SIS (CrewEnlisted) == (COUNT)~0)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
handled = DoMenuChooser (pMS, PM_STARMAP);
|
||||||
|
if (handled)
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
if (!select)
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
LockMutex (GraphicsLock);
|
||||||
|
SetFlashRect (NULL);
|
||||||
|
UnlockMutex (GraphicsLock);
|
||||||
|
|
||||||
|
switch (pMS->CurState)
|
||||||
|
{
|
||||||
|
case EQUIP_DEVICE:
|
||||||
|
select = DevicesMenu ();
|
||||||
|
if (GET_GAME_STATE (PORTAL_COUNTER))
|
||||||
|
{ // A player-induced portal to QuasiSpace is opening
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
if (GLOBAL (CurrentActivity) & START_ENCOUNTER)
|
||||||
|
{ // Selected Talking Pet, going into conversation
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case CARGO:
|
||||||
|
CargoMenu ();
|
||||||
|
break;
|
||||||
|
case ROSTER:
|
||||||
|
select = RosterMenu ();
|
||||||
|
break;
|
||||||
|
case GAME_MENU:
|
||||||
|
if (!GameOptions ())
|
||||||
|
return FALSE; // abort or load
|
||||||
|
break;
|
||||||
|
case STARMAP:
|
||||||
|
StarMap ();
|
||||||
|
SetDefaultMenuRepeatDelay ();
|
||||||
|
return FALSE;
|
||||||
|
case NAVIGATION:
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(GLOBAL (CurrentActivity) & CHECK_ABORT))
|
||||||
|
{
|
||||||
|
if (select)
|
||||||
|
{ // 3DO menu jumps to NAVIGATE after a successful submenu run
|
||||||
|
if (optWhichMenu != OPT_PC)
|
||||||
|
pMS->CurState = NAVIGATION;
|
||||||
|
DrawMenuStateStrings (PM_STARMAP, pMS->CurState);
|
||||||
|
}
|
||||||
|
LockMutex (GraphicsLock);
|
||||||
|
SetFlashRect (SFR_MENU_3DO);
|
||||||
|
UnlockMutex (GraphicsLock);
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
HyperspaceMenu (void)
|
HyperspaceMenu (void)
|
||||||
{
|
{
|
||||||
@@ -1613,9 +1683,9 @@ UnbatchGraphics ();
|
|||||||
UnlockMutex (GraphicsLock);
|
UnlockMutex (GraphicsLock);
|
||||||
|
|
||||||
memset (&MenuState, 0, sizeof (MenuState));
|
memset (&MenuState, 0, sizeof (MenuState));
|
||||||
MenuState.InputFunc = DoFlagshipCommands;
|
MenuState.InputFunc = DoHyperspaceMenu;
|
||||||
MenuState.Initialized = 1;
|
MenuState.Initialized = TRUE;
|
||||||
MenuState.CurState = STARMAP + 1;
|
MenuState.CurState = STARMAP;
|
||||||
|
|
||||||
DrawMenuStateStrings (PM_STARMAP, STARMAP);
|
DrawMenuStateStrings (PM_STARMAP, STARMAP);
|
||||||
LockMutex (GraphicsLock);
|
LockMutex (GraphicsLock);
|
||||||
|
|||||||
@@ -144,8 +144,6 @@ ip_group_preprocess (ELEMENT *ElementPtr)
|
|||||||
- pSolarSysState->PlanetDesc + 1);
|
- pSolarSysState->PlanetDesc + 1);
|
||||||
|
|
||||||
task = GroupPtr->task;
|
task = GroupPtr->task;
|
||||||
if (pSolarSysState->MenuState.CurState)
|
|
||||||
goto ExitIPProcess;
|
|
||||||
|
|
||||||
if ((task & REFORM_GROUP) && --GroupPtr->group_counter == 0)
|
if ((task & REFORM_GROUP) && --GroupPtr->group_counter == 0)
|
||||||
{ // Finished reforming the group
|
{ // Finished reforming the group
|
||||||
@@ -471,7 +469,6 @@ CheckGetAway:
|
|||||||
+ (SIZE)((long)GroupPtr->loc.y
|
+ (SIZE)((long)GroupPtr->loc.y
|
||||||
* (DISPLAY_FACTOR >> 1) / radius);
|
* (DISPLAY_FACTOR >> 1) / radius);
|
||||||
|
|
||||||
ExitIPProcess:
|
|
||||||
EPtr->next.location.x = DISPLAY_TO_WORLD (dest_pt.x)
|
EPtr->next.location.x = DISPLAY_TO_WORLD (dest_pt.x)
|
||||||
+ (COORD)(LOG_SPACE_WIDTH >> 1)
|
+ (COORD)(LOG_SPACE_WIDTH >> 1)
|
||||||
- (LOG_SPACE_WIDTH >> (MAX_REDUCTION + 1));
|
- (LOG_SPACE_WIDTH >> (MAX_REDUCTION + 1));
|
||||||
@@ -672,7 +669,6 @@ flag_ship_preprocess (ELEMENT *ElementPtr)
|
|||||||
ElementPtr->thrust_wait = FLIP_WAIT;
|
ElementPtr->thrust_wait = FLIP_WAIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pSolarSysState->MenuState.CurState == 0)
|
|
||||||
{
|
{
|
||||||
BYTE flagship_loc, ec;
|
BYTE flagship_loc, ec;
|
||||||
SIZE vdx, vdy, radius;
|
SIZE vdx, vdy, radius;
|
||||||
|
|||||||
@@ -800,7 +800,8 @@ ExitOutfit:
|
|||||||
DoInstallModule (pMS);
|
DoInstallModule (pMS);
|
||||||
break;
|
break;
|
||||||
case OUTFIT_SAVELOAD:
|
case OUTFIT_SAVELOAD:
|
||||||
if (GameOptions () == 0)
|
// Clearing FlashRect is not necessary
|
||||||
|
if (!GameOptions ())
|
||||||
goto ExitOutfit;
|
goto ExitOutfit;
|
||||||
DrawMenuStateStrings (PM_FUEL, pMS->CurState);
|
DrawMenuStateStrings (PM_FUEL, pMS->CurState);
|
||||||
LockMutex (GraphicsLock);
|
LockMutex (GraphicsLock);
|
||||||
|
|||||||
+12
-10
@@ -303,10 +303,10 @@ DoDiscardCargo (MENU_STATE *pMS)
|
|||||||
if (GLOBAL (CurrentActivity) & CHECK_ABORT)
|
if (GLOBAL (CurrentActivity) & CHECK_ABORT)
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
|
|
||||||
if (!(pMS->Initialized & 1))
|
if (!pMS->Initialized)
|
||||||
{
|
{
|
||||||
pMS->InputFunc = DoDiscardCargo;
|
pMS->InputFunc = DoDiscardCargo;
|
||||||
++pMS->Initialized;
|
pMS->Initialized = TRUE;
|
||||||
|
|
||||||
NewState = pMS->CurState;
|
NewState = pMS->CurState;
|
||||||
pMS->CurState = (BYTE)~0;
|
pMS->CurState = (BYTE)~0;
|
||||||
@@ -372,16 +372,18 @@ SelectCargo:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Cargo (MENU_STATE *pMS)
|
CargoMenu (void)
|
||||||
{
|
{
|
||||||
pMS->InputFunc = DoDiscardCargo;
|
// XXX: Should get an own STATE struct
|
||||||
--pMS->Initialized;
|
MENU_STATE MenuState;
|
||||||
pMS->CurState = 1;
|
|
||||||
|
MenuState.InputFunc = DoDiscardCargo;
|
||||||
|
MenuState.Initialized = FALSE;
|
||||||
|
// XXX: 1-based index because this had to work around the
|
||||||
|
// pSolarSysState->MenuState.CurState abuse. Should be changed.
|
||||||
|
MenuState.CurState = 1;
|
||||||
|
|
||||||
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||||
DoInput (pMS, TRUE);
|
DoInput (&MenuState, TRUE);
|
||||||
|
|
||||||
pMS->InputFunc = DoFlagshipCommands;
|
|
||||||
pMS->CurState = CARGO + 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -460,12 +460,12 @@ DoManipulateDevices (MENU_STATE *pMS)
|
|||||||
if (GLOBAL (CurrentActivity) & CHECK_ABORT)
|
if (GLOBAL (CurrentActivity) & CHECK_ABORT)
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
|
|
||||||
if (!(pMS->Initialized & 1))
|
if (!pMS->Initialized)
|
||||||
{
|
{
|
||||||
DrawDevices (pMS, (BYTE)~0, (BYTE)~0);
|
DrawDevices (pMS, (BYTE)~0, (BYTE)~0);
|
||||||
|
|
||||||
pMS->InputFunc = DoManipulateDevices;
|
pMS->InputFunc = DoManipulateDevices;
|
||||||
++pMS->Initialized;
|
pMS->Initialized = TRUE;
|
||||||
NewState = pMS->CurState;
|
NewState = pMS->CurState;
|
||||||
goto SelectDevice;
|
goto SelectDevice;
|
||||||
}
|
}
|
||||||
@@ -640,27 +640,28 @@ InventoryDevices (BYTE *pDeviceMap, COUNT Size)
|
|||||||
}
|
}
|
||||||
|
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
Devices (MENU_STATE *pMS)
|
DevicesMenu (void)
|
||||||
{
|
{
|
||||||
BYTE DeviceMap[NUM_DEVICES];
|
BYTE DeviceMap[NUM_DEVICES];
|
||||||
|
MENU_STATE MenuState;
|
||||||
|
|
||||||
pMS->first_item.x = InventoryDevices (DeviceMap, NUM_DEVICES);
|
memset (&MenuState, 0, sizeof MenuState);
|
||||||
if (pMS->first_item.x)
|
|
||||||
|
MenuState.first_item.x = InventoryDevices (DeviceMap, NUM_DEVICES);
|
||||||
|
if (MenuState.first_item.x)
|
||||||
{
|
{
|
||||||
pMS->InputFunc = DoManipulateDevices;
|
MenuState.InputFunc = DoManipulateDevices;
|
||||||
--pMS->Initialized;
|
MenuState.Initialized = FALSE;
|
||||||
pMS->CurState = 1;
|
// XXX: 1-based index because this had to work around the
|
||||||
pMS->first_item.y = 0;
|
// pSolarSysState->MenuState.CurState abuse. Should be changed.
|
||||||
|
MenuState.CurState = 1;
|
||||||
|
MenuState.first_item.y = 0;
|
||||||
|
|
||||||
pMS->CurFrame = (FRAME)DeviceMap;
|
// XXX: CurFrame hack
|
||||||
FlushInput ();
|
MenuState.CurFrame = (FRAME)DeviceMap;
|
||||||
DoManipulateDevices (pMS); /* to make sure it's initialized */
|
//DoManipulateDevices (pMS); /* to make sure it's initialized */
|
||||||
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||||
DoInput (pMS, TRUE);
|
DoInput (&MenuState, TRUE);
|
||||||
pMS->CurFrame = 0;
|
|
||||||
|
|
||||||
pMS->InputFunc = DoFlagshipCommands;
|
|
||||||
pMS->CurState = EQUIP_DEVICE + 1;
|
|
||||||
|
|
||||||
if (GLOBAL_SIS (CrewEnlisted) != (COUNT)~0
|
if (GLOBAL_SIS (CrewEnlisted) != (COUNT)~0
|
||||||
&& !(GLOBAL (CurrentActivity) & CHECK_ABORT))
|
&& !(GLOBAL (CurrentActivity) & CHECK_ABORT))
|
||||||
|
|||||||
@@ -23,10 +23,15 @@
|
|||||||
#include "../colors.h"
|
#include "../colors.h"
|
||||||
#include "../element.h"
|
#include "../element.h"
|
||||||
#include "../settings.h"
|
#include "../settings.h"
|
||||||
|
#include "../controls.h"
|
||||||
|
#include "../sounds.h"
|
||||||
|
#include "../gameopt.h"
|
||||||
|
#include "../shipcont.h"
|
||||||
#include "../setup.h"
|
#include "../setup.h"
|
||||||
#include "../uqmdebug.h"
|
#include "../uqmdebug.h"
|
||||||
#include "../resinst.h"
|
#include "../resinst.h"
|
||||||
#include "../nameref.h"
|
#include "../nameref.h"
|
||||||
|
#include "options.h"
|
||||||
#include "libs/graphics/gfx_common.h"
|
#include "libs/graphics/gfx_common.h"
|
||||||
|
|
||||||
|
|
||||||
@@ -295,3 +300,119 @@ FreeLanderFont (PLANET_INFO *info)
|
|||||||
DestroyDrawable (ReleaseDrawable (info->LanderFontEff));
|
DestroyDrawable (ReleaseDrawable (info->LanderFontEff));
|
||||||
info->LanderFontEff = NULL;
|
info->LanderFontEff = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static BOOLEAN
|
||||||
|
DoPlanetOrbit (MENU_STATE *pMS)
|
||||||
|
{
|
||||||
|
BOOLEAN select = PulsedInputState.menu[KEY_MENU_SELECT];
|
||||||
|
BOOLEAN handled;
|
||||||
|
|
||||||
|
if ((GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD))
|
||||||
|
|| GLOBAL_SIS (CrewEnlisted) == (COUNT)~0)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
// XXX: pMS actually refers to pSolarSysState->MenuState
|
||||||
|
handled = DoMenuChooser (pMS, PM_SCAN);
|
||||||
|
if (handled)
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
if (!select)
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
LockMutex (GraphicsLock);
|
||||||
|
SetFlashRect (NULL);
|
||||||
|
UnlockMutex (GraphicsLock);
|
||||||
|
|
||||||
|
switch (pMS->CurState)
|
||||||
|
{
|
||||||
|
case SCAN:
|
||||||
|
ScanSystem ();
|
||||||
|
break;
|
||||||
|
case EQUIP_DEVICE:
|
||||||
|
select = DevicesMenu ();
|
||||||
|
if (GLOBAL (CurrentActivity) & START_ENCOUNTER)
|
||||||
|
{ // Invoked Talking Pet, a Caster or Sun Device over Chmmr,
|
||||||
|
// or a Caster for Ilwrath
|
||||||
|
// Going into conversation
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case CARGO:
|
||||||
|
CargoMenu ();
|
||||||
|
break;
|
||||||
|
case ROSTER:
|
||||||
|
select = RosterMenu ();
|
||||||
|
break;
|
||||||
|
case GAME_MENU:
|
||||||
|
if (!GameOptions ())
|
||||||
|
return FALSE; // abort or load
|
||||||
|
break;
|
||||||
|
case STARMAP:
|
||||||
|
{
|
||||||
|
BOOLEAN AutoPilotSet;
|
||||||
|
|
||||||
|
LockMutex (GraphicsLock);
|
||||||
|
pSolarSysState->PauseRotate = 1;
|
||||||
|
RepairSISBorder ();
|
||||||
|
UnlockMutex (GraphicsLock);
|
||||||
|
TaskSwitch ();
|
||||||
|
|
||||||
|
AutoPilotSet = StarMap ();
|
||||||
|
SetDefaultMenuRepeatDelay ();
|
||||||
|
|
||||||
|
if (GLOBAL (CurrentActivity) & CHECK_ABORT)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
if (!AutoPilotSet)
|
||||||
|
{ // Redraw the orbital display
|
||||||
|
LoadPlanet (NULL);
|
||||||
|
LockMutex (GraphicsLock);
|
||||||
|
pSolarSysState->PauseRotate = 0;
|
||||||
|
UnlockMutex (GraphicsLock);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// Fall through !!!
|
||||||
|
}
|
||||||
|
case NAVIGATION:
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(GLOBAL (CurrentActivity) & CHECK_ABORT))
|
||||||
|
{
|
||||||
|
if (select)
|
||||||
|
{ // 3DO menu jumps to NAVIGATE after a successful submenu run
|
||||||
|
if (optWhichMenu != OPT_PC)
|
||||||
|
pMS->CurState = NAVIGATION;
|
||||||
|
DrawMenuStateStrings (PM_SCAN, pMS->CurState);
|
||||||
|
}
|
||||||
|
LockMutex (GraphicsLock);
|
||||||
|
SetFlashRect (SFR_MENU_3DO);
|
||||||
|
UnlockMutex (GraphicsLock);
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
PlanetOrbitMenu (void)
|
||||||
|
{
|
||||||
|
void *oldInputFunc = pSolarSysState->MenuState.InputFunc;
|
||||||
|
|
||||||
|
DrawMenuStateStrings (PM_SCAN, SCAN);
|
||||||
|
LockMutex (GraphicsLock);
|
||||||
|
SetFlashRect (SFR_MENU_3DO);
|
||||||
|
UnlockMutex (GraphicsLock);
|
||||||
|
|
||||||
|
pSolarSysState->MenuState.CurState = SCAN;
|
||||||
|
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||||
|
|
||||||
|
// XXX: temporary; will have an own MENU_STATE
|
||||||
|
pSolarSysState->MenuState.InputFunc = DoPlanetOrbit;
|
||||||
|
DoInput (&pSolarSysState->MenuState, TRUE);
|
||||||
|
pSolarSysState->MenuState.InputFunc = oldInputFunc;
|
||||||
|
|
||||||
|
LockMutex (GraphicsLock);
|
||||||
|
SetFlashRect (NULL);
|
||||||
|
UnlockMutex (GraphicsLock);
|
||||||
|
DrawMenuStateStrings (PM_STARMAP, -NAVIGATION);
|
||||||
|
}
|
||||||
|
|||||||
@@ -237,20 +237,11 @@ extern void ExploreSolarSys (void);
|
|||||||
extern void DrawStarBackGround (BOOLEAN ForPlanet);
|
extern void DrawStarBackGround (BOOLEAN ForPlanet);
|
||||||
extern void XFormIPLoc (POINT *pIn, POINT *pOut, BOOLEAN ToDisplay);
|
extern void XFormIPLoc (POINT *pIn, POINT *pOut, BOOLEAN ToDisplay);
|
||||||
extern PLAN_GEN_FUNC GenerateIP (BYTE Index);
|
extern PLAN_GEN_FUNC GenerateIP (BYTE Index);
|
||||||
extern void DrawSystem (SIZE radius, BOOLEAN IsInnerSystem);
|
|
||||||
extern void DrawOval (RECT *pRect, BYTE num_off_pixels);
|
extern void DrawOval (RECT *pRect, BYTE num_off_pixels);
|
||||||
extern void DrawFilledOval (RECT *pRect);
|
extern void DrawFilledOval (RECT *pRect);
|
||||||
extern void FillOrbits (SOLARSYS_STATE *system, BYTE NumPlanets,
|
extern void FillOrbits (SOLARSYS_STATE *system, BYTE NumPlanets,
|
||||||
PLANET_DESC *pBaseDesc, BOOLEAN TypesDefined);
|
PLANET_DESC *pBaseDesc, BOOLEAN TypesDefined);
|
||||||
extern void ScanSystem (void);
|
|
||||||
extern void ChangeSolarSys (void);
|
|
||||||
extern BOOLEAN DoFlagshipCommands (MENU_STATE *pMS);
|
|
||||||
extern void ZoomSystem (void);
|
|
||||||
extern void LoadSolarSys (void);
|
|
||||||
extern void InitLander (BYTE LanderFlags);
|
extern void InitLander (BYTE LanderFlags);
|
||||||
extern BOOLEAN ValidateOrbits (void);
|
|
||||||
extern void IP_reset (void);
|
|
||||||
extern void IP_frame (void);
|
|
||||||
|
|
||||||
extern RECT* RotatePlanet (int x, int dx, int dy, COUNT scale_amt,
|
extern RECT* RotatePlanet (int x, int dx, int dy, COUNT scale_amt,
|
||||||
UBYTE zoom_from, RECT *r);
|
UBYTE zoom_from, RECT *r);
|
||||||
@@ -263,5 +254,7 @@ extern void DeltaTopography (COUNT num_iterations, SBYTE *DepthArray,
|
|||||||
extern UNICODE* GetNamedPlanetaryBody (void);
|
extern UNICODE* GetNamedPlanetaryBody (void);
|
||||||
extern void GetPlanetOrMoonName (UNICODE *buf, COUNT bufsize);
|
extern void GetPlanetOrMoonName (UNICODE *buf, COUNT bufsize);
|
||||||
|
|
||||||
|
extern void PlanetOrbitMenu (void);
|
||||||
|
|
||||||
#endif /* _PLANETS_H */
|
#endif /* _PLANETS_H */
|
||||||
|
|
||||||
|
|||||||
@@ -1586,8 +1586,8 @@ DoneSphereGrowth:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static BOOLEAN
|
BOOLEAN
|
||||||
DoStarMap (void)
|
StarMap (void)
|
||||||
{
|
{
|
||||||
MENU_STATE MenuState;
|
MENU_STATE MenuState;
|
||||||
POINT universe;
|
POINT universe;
|
||||||
@@ -1614,9 +1614,6 @@ DoStarMap (void)
|
|||||||
if (cursorLoc.x == ~0 && cursorLoc.y == ~0)
|
if (cursorLoc.x == ~0 && cursorLoc.y == ~0)
|
||||||
cursorLoc = universe;
|
cursorLoc = universe;
|
||||||
|
|
||||||
UnlockMutex (GraphicsLock);
|
|
||||||
TaskSwitch ();
|
|
||||||
|
|
||||||
MenuState.InputFunc = DoMoveCursor;
|
MenuState.InputFunc = DoMoveCursor;
|
||||||
MenuState.Initialized = FALSE;
|
MenuState.Initialized = FALSE;
|
||||||
|
|
||||||
@@ -1643,10 +1640,10 @@ DoStarMap (void)
|
|||||||
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||||
|
|
||||||
LockMutex (GraphicsLock);
|
LockMutex (GraphicsLock);
|
||||||
|
|
||||||
DrawHyperCoords (universe);
|
DrawHyperCoords (universe);
|
||||||
DrawSISMessage (NULL);
|
DrawSISMessage (NULL);
|
||||||
DrawStatusMessage (NULL);
|
DrawStatusMessage (NULL);
|
||||||
|
UnlockMutex (GraphicsLock);
|
||||||
|
|
||||||
if (GLOBAL (autopilot.x) == universe.x
|
if (GLOBAL (autopilot.x) == universe.x
|
||||||
&& GLOBAL (autopilot.y) == universe.y)
|
&& GLOBAL (autopilot.y) == universe.y)
|
||||||
@@ -1656,185 +1653,3 @@ DoStarMap (void)
|
|||||||
&& GLOBAL (autopilot.y) != ~0);
|
&& GLOBAL (autopilot.y) != ~0);
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOLEAN
|
|
||||||
DoFlagshipCommands (MENU_STATE *pMS)
|
|
||||||
{
|
|
||||||
/* TODO: Make this carried cleanly by MENU_STATE structure */
|
|
||||||
// static DWORD NextTime;
|
|
||||||
if (!(pMS->Initialized & 1))
|
|
||||||
{
|
|
||||||
/* This has some dependency on the IPtask_func */
|
|
||||||
ChangeSolarSys ();
|
|
||||||
// NextTime = GetTimeCounter ();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
BOOLEAN select = PulsedInputState.menu[KEY_MENU_SELECT];
|
|
||||||
LockMutex (GraphicsLock);
|
|
||||||
if (*(volatile BYTE *)&pMS->CurState == 0
|
|
||||||
&& (*(volatile SIZE *)&pMS->Initialized & 1)
|
|
||||||
&& !(GLOBAL (CurrentActivity)
|
|
||||||
& (START_ENCOUNTER | END_INTERPLANETARY
|
|
||||||
| CHECK_ABORT | CHECK_LOAD))
|
|
||||||
&& GLOBAL_SIS (CrewEnlisted) != (COUNT)~0)
|
|
||||||
{
|
|
||||||
UnlockMutex (GraphicsLock);
|
|
||||||
IP_frame ();
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
UnlockMutex (GraphicsLock);
|
|
||||||
|
|
||||||
if (pMS->CurState)
|
|
||||||
{
|
|
||||||
BOOLEAN DoMenu;
|
|
||||||
BYTE NewState;
|
|
||||||
|
|
||||||
/* If pMS->CurState == 0, then we're flying
|
|
||||||
* around in interplanetary. This needs to be
|
|
||||||
* corrected for the MenuChooser, which thinks
|
|
||||||
* that "0" is the first menu option */
|
|
||||||
pMS->CurState --;
|
|
||||||
DoMenu = DoMenuChooser (pMS,
|
|
||||||
(BYTE)(pMS->Initialized <= 1 ? PM_STARMAP : PM_SCAN));
|
|
||||||
pMS->CurState ++;
|
|
||||||
|
|
||||||
if (!DoMenu) {
|
|
||||||
|
|
||||||
NewState = pMS->CurState;
|
|
||||||
if (LastActivity == CHECK_LOAD)
|
|
||||||
select = TRUE; // Selected LOAD from main menu
|
|
||||||
if (select)
|
|
||||||
{
|
|
||||||
if (NewState != SCAN + 1 && NewState != (GAME_MENU) + 1)
|
|
||||||
{
|
|
||||||
LockMutex (GraphicsLock);
|
|
||||||
SetFlashRect (NULL);
|
|
||||||
UnlockMutex (GraphicsLock);
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (NewState - 1)
|
|
||||||
{
|
|
||||||
case SCAN:
|
|
||||||
ScanSystem ();
|
|
||||||
break;
|
|
||||||
case EQUIP_DEVICE:
|
|
||||||
{
|
|
||||||
if (!Devices (pMS))
|
|
||||||
select = FALSE;
|
|
||||||
if (GET_GAME_STATE (PORTAL_COUNTER)) {
|
|
||||||
// A player-induced portal to QuasiSpace is
|
|
||||||
// opening.
|
|
||||||
return (FALSE);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case CARGO:
|
|
||||||
{
|
|
||||||
Cargo (pMS);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case ROSTER:
|
|
||||||
{
|
|
||||||
if (!Roster ())
|
|
||||||
select = FALSE;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case GAME_MENU:
|
|
||||||
if (GameOptions () == 0)
|
|
||||||
return (FALSE);
|
|
||||||
break;
|
|
||||||
case STARMAP:
|
|
||||||
{
|
|
||||||
BOOLEAN AutoPilotSet;
|
|
||||||
|
|
||||||
LockMutex (GraphicsLock);
|
|
||||||
if (++pMS->Initialized > 3) {
|
|
||||||
pSolarSysState->PauseRotate = 1;
|
|
||||||
RepairSISBorder ();
|
|
||||||
}
|
|
||||||
|
|
||||||
AutoPilotSet = DoStarMap ();
|
|
||||||
SetDefaultMenuRepeatDelay ();
|
|
||||||
|
|
||||||
if (LOBYTE (GLOBAL (CurrentActivity)) == IN_HYPERSPACE
|
|
||||||
|| (GLOBAL (CurrentActivity) & CHECK_ABORT))
|
|
||||||
{
|
|
||||||
UnlockMutex (GraphicsLock);
|
|
||||||
return (FALSE);
|
|
||||||
}
|
|
||||||
else if (pMS->Initialized <= 3)
|
|
||||||
{
|
|
||||||
ZoomSystem ();
|
|
||||||
--pMS->Initialized;
|
|
||||||
}
|
|
||||||
UnlockMutex (GraphicsLock);
|
|
||||||
|
|
||||||
if (!AutoPilotSet && pMS->Initialized >= 3)
|
|
||||||
{
|
|
||||||
LoadPlanet (NULL);
|
|
||||||
--pMS->Initialized;
|
|
||||||
pSolarSysState->PauseRotate = 0;
|
|
||||||
LockMutex (GraphicsLock);
|
|
||||||
SetFlashRect (SFR_MENU_3DO);
|
|
||||||
UnlockMutex (GraphicsLock);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
case NAVIGATION:
|
|
||||||
if (LOBYTE (GLOBAL (CurrentActivity)) == IN_HYPERSPACE)
|
|
||||||
return (FALSE);
|
|
||||||
|
|
||||||
if (pMS->Initialized <= 1)
|
|
||||||
{
|
|
||||||
pMS->Initialized = 1;
|
|
||||||
}
|
|
||||||
else if (pMS->flash_task)
|
|
||||||
{ // In planet orbit
|
|
||||||
FreePlanet ();
|
|
||||||
LockMutex (GraphicsLock);
|
|
||||||
LoadSolarSys ();
|
|
||||||
ValidateOrbits ();
|
|
||||||
ZoomSystem ();
|
|
||||||
UnlockMutex (GraphicsLock);
|
|
||||||
}
|
|
||||||
|
|
||||||
LockMutex (GraphicsLock);
|
|
||||||
pMS->CurState = 0;
|
|
||||||
FlushInput ();
|
|
||||||
UnlockMutex (GraphicsLock);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (GLOBAL (CurrentActivity) & CHECK_ABORT)
|
|
||||||
;
|
|
||||||
else if (pMS->CurState)
|
|
||||||
{
|
|
||||||
LockMutex (GraphicsLock);
|
|
||||||
SetFlashRect (SFR_MENU_3DO);
|
|
||||||
UnlockMutex (GraphicsLock);
|
|
||||||
if (select)
|
|
||||||
{
|
|
||||||
if (optWhichMenu != OPT_PC)
|
|
||||||
pMS->CurState = (NAVIGATION) + 1;
|
|
||||||
DrawMenuStateStrings ((BYTE)(pMS->Initialized <= 1 ? PM_STARMAP : PM_SCAN),
|
|
||||||
pMS->CurState - 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
LockMutex (GraphicsLock);
|
|
||||||
SetFlashRect (NULL);
|
|
||||||
UnlockMutex (GraphicsLock);
|
|
||||||
DrawMenuStateStrings (PM_STARMAP, -NAVIGATION);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return (!(GLOBAL (CurrentActivity)
|
|
||||||
& (START_ENCOUNTER | END_INTERPLANETARY
|
|
||||||
| CHECK_ABORT | CHECK_LOAD))
|
|
||||||
&& GLOBAL_SIS (CrewEnlisted) != (COUNT)~0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
@@ -401,7 +401,7 @@ compShipPos (const void *ptr1, const void *ptr2)
|
|||||||
}
|
}
|
||||||
|
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
Roster (void)
|
RosterMenu (void)
|
||||||
{
|
{
|
||||||
SIZE num_support_ships;
|
SIZE num_support_ships;
|
||||||
|
|
||||||
|
|||||||
@@ -667,8 +667,6 @@ PickPlanetSide (MENU_STATE *pMS)
|
|||||||
// Set the current flash location
|
// Set the current flash location
|
||||||
setPlanetCursorLoc (planetLoc);
|
setPlanetCursorLoc (planetLoc);
|
||||||
savePlanetLocationImage ();
|
savePlanetLocationImage ();
|
||||||
|
|
||||||
SetFlashRect (NULL);
|
|
||||||
UnlockMutex (GraphicsLock);
|
UnlockMutex (GraphicsLock);
|
||||||
|
|
||||||
InitLander (0);
|
InitLander (0);
|
||||||
@@ -1001,6 +999,7 @@ DoScan (MENU_STATE *pMS)
|
|||||||
UnlockMutex (GraphicsLock);
|
UnlockMutex (GraphicsLock);
|
||||||
|
|
||||||
LockMutex (GraphicsLock);
|
LockMutex (GraphicsLock);
|
||||||
|
SetFlashRect (NULL);
|
||||||
SetContext (ScanContext);
|
SetContext (ScanContext);
|
||||||
BatchGraphics ();
|
BatchGraphics ();
|
||||||
DrawPlanet (0, 0, 0, BLACK_COLOR);
|
DrawPlanet (0, 0, 0, BLACK_COLOR);
|
||||||
@@ -1010,6 +1009,8 @@ DoScan (MENU_STATE *pMS)
|
|||||||
|
|
||||||
pMS->Initialized = FALSE;
|
pMS->Initialized = FALSE;
|
||||||
pMS->CurFrame = 0;
|
pMS->CurFrame = 0;
|
||||||
|
// XXX: PickPlanetSide() will take over the InputFunc
|
||||||
|
// and later restore it when its done
|
||||||
return PickPlanetSide (pMS);
|
return PickPlanetSide (pMS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1241,6 +1242,9 @@ ScanSystem (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
DrawMenuStateStrings (PM_MIN_SCAN, MenuState.CurState);
|
DrawMenuStateStrings (PM_MIN_SCAN, MenuState.CurState);
|
||||||
|
LockMutex (GraphicsLock);
|
||||||
|
SetFlashRect (SFR_MENU_3DO);
|
||||||
|
UnlockMutex (GraphicsLock);
|
||||||
|
|
||||||
if (optWhichCoarseScan == OPT_PC)
|
if (optWhichCoarseScan == OPT_PC)
|
||||||
PrintCoarseScanPC ();
|
PrintCoarseScanPC ();
|
||||||
@@ -1250,6 +1254,10 @@ ScanSystem (void)
|
|||||||
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||||
DoInput (&MenuState, FALSE);
|
DoInput (&MenuState, FALSE);
|
||||||
|
|
||||||
|
LockMutex (GraphicsLock);
|
||||||
|
SetFlashRect (NULL);
|
||||||
|
UnlockMutex (GraphicsLock);
|
||||||
|
|
||||||
if (ScanContext)
|
if (ScanContext)
|
||||||
{
|
{
|
||||||
LockMutex (GraphicsLock);
|
LockMutex (GraphicsLock);
|
||||||
|
|||||||
@@ -43,6 +43,8 @@ struct scan_block
|
|||||||
SCAN_DESC *scan_base;
|
SCAN_DESC *scan_base;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extern void ScanSystem (void);
|
||||||
|
|
||||||
extern void RepairBackRect (RECT *pRect);
|
extern void RepairBackRect (RECT *pRect);
|
||||||
extern void GeneratePlanetSide (void);
|
extern void GeneratePlanetSide (void);
|
||||||
extern bool callGenerateForScanType (SOLARSYS_STATE *solarSys,
|
extern bool callGenerateForScanType (SOLARSYS_STATE *solarSys,
|
||||||
|
|||||||
+312
-250
@@ -28,6 +28,8 @@
|
|||||||
#include "../globdata.h"
|
#include "../globdata.h"
|
||||||
#include "../sis.h"
|
#include "../sis.h"
|
||||||
#include "../init.h"
|
#include "../init.h"
|
||||||
|
#include "../shipcont.h"
|
||||||
|
#include "../gameopt.h"
|
||||||
#include "../nameref.h"
|
#include "../nameref.h"
|
||||||
#include "../resinst.h"
|
#include "../resinst.h"
|
||||||
#include "../settings.h"
|
#include "../settings.h"
|
||||||
@@ -39,13 +41,18 @@
|
|||||||
#include "../sounds.h"
|
#include "../sounds.h"
|
||||||
#include "../state.h"
|
#include "../state.h"
|
||||||
#include "../uqmdebug.h"
|
#include "../uqmdebug.h"
|
||||||
|
#include "options.h"
|
||||||
#include "libs/graphics/gfx_common.h"
|
#include "libs/graphics/gfx_common.h"
|
||||||
#include "libs/mathlib.h"
|
#include "libs/mathlib.h"
|
||||||
#include "libs/log.h"
|
#include "libs/log.h"
|
||||||
|
#include "libs/misc.h"
|
||||||
|
|
||||||
|
|
||||||
//#define DEBUG_SOLARSYS
|
//#define DEBUG_SOLARSYS
|
||||||
|
|
||||||
|
static BOOLEAN DoIpFlight (MENU_STATE *pMS);
|
||||||
|
static void DrawSystem (SIZE radius, BOOLEAN IsInnerSystem);
|
||||||
|
|
||||||
|
|
||||||
SOLARSYS_STATE *pSolarSysState;
|
SOLARSYS_STATE *pSolarSysState;
|
||||||
FRAME SISIPFrame;
|
FRAME SISIPFrame;
|
||||||
@@ -61,8 +68,11 @@ BYTE EncounterGroup;
|
|||||||
// last encountered group info
|
// last encountered group info
|
||||||
|
|
||||||
#define DRAW_STARS (1 << 0)
|
#define DRAW_STARS (1 << 0)
|
||||||
|
// only ever cleared by DrawSimpleSystem() which is currently disabled
|
||||||
#define DRAW_PLANETS (1 << 1)
|
#define DRAW_PLANETS (1 << 1)
|
||||||
|
// only ever cleared by DrawSimpleSystem() which is currently disabled
|
||||||
#define DRAW_ORBITS (1 << 2)
|
#define DRAW_ORBITS (1 << 2)
|
||||||
|
// only ever cleared by DrawSimpleSystem() which is currently disabled
|
||||||
#define DRAW_HYPER_COORDS (1 << 3)
|
#define DRAW_HYPER_COORDS (1 << 3)
|
||||||
#define UNBATCH_SYS (1 << 4)
|
#define UNBATCH_SYS (1 << 4)
|
||||||
#define DRAW_REFRESH (1 << 5)
|
#define DRAW_REFRESH (1 << 5)
|
||||||
@@ -132,6 +142,16 @@ matchWorld (const SOLARSYS_STATE *solarSys, const PLANET_DESC *world,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: make code outside solarsys.c call a similar external version
|
||||||
|
static inline bool
|
||||||
|
inInnerSystem (void)
|
||||||
|
{
|
||||||
|
assert (pSolarSysState->pBaseDesc == pSolarSysState->PlanetDesc
|
||||||
|
|| pSolarSysState->pBaseDesc == pSolarSysState->MoonDesc);
|
||||||
|
return pSolarSysState->pBaseDesc != pSolarSysState->PlanetDesc;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
GenerateMoons (SOLARSYS_STATE *system, PLANET_DESC *planet)
|
GenerateMoons (SOLARSYS_STATE *system, PLANET_DESC *planet)
|
||||||
{
|
{
|
||||||
@@ -161,7 +181,7 @@ GenerateMoons (SOLARSYS_STATE *system, PLANET_DESC *planet)
|
|||||||
BYTE data_index;
|
BYTE data_index;
|
||||||
|
|
||||||
pMoonDesc->pPrevDesc = planet;
|
pMoonDesc->pPrevDesc = planet;
|
||||||
if (system->MenuState.Initialized > 1 || i >= planet->NumPlanets)
|
if (i >= planet->NumPlanets)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
pMoonDesc->temp_color = planet->temp_color;
|
pMoonDesc->temp_color = planet->temp_color;
|
||||||
@@ -177,7 +197,6 @@ GenerateMoons (SOLARSYS_STATE *system, PLANET_DESC *planet)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
system->pBaseDesc = system->MoonDesc;
|
|
||||||
TFB_SeedRandom (old_seed);
|
TFB_SeedRandom (old_seed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -292,10 +311,11 @@ initSolarSysSISCharacteristics (void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static BOOLEAN
|
||||||
LoadSolarSys (void)
|
LoadSolarSys (void)
|
||||||
{
|
{
|
||||||
COUNT i;
|
COUNT i;
|
||||||
|
BOOLEAN orbital = FALSE;
|
||||||
PLANET_DESC *pCurDesc;
|
PLANET_DESC *pCurDesc;
|
||||||
DWORD old_seed;
|
DWORD old_seed;
|
||||||
#define NUM_TEMP_RANGES 5
|
#define NUM_TEMP_RANGES 5
|
||||||
@@ -308,18 +328,6 @@ LoadSolarSys (void)
|
|||||||
BUILD_COLOR (MAKE_RGB15_INIT (0x0F, 0x08, 0x00), 0x75),
|
BUILD_COLOR (MAKE_RGB15_INIT (0x0F, 0x08, 0x00), 0x75),
|
||||||
};
|
};
|
||||||
|
|
||||||
pSolarSysState->MenuState.CurState = 0;
|
|
||||||
pSolarSysState->MenuState.Initialized = GLOBAL (in_orbit);
|
|
||||||
if (pSolarSysState->MenuState.Initialized)
|
|
||||||
{
|
|
||||||
GLOBAL (in_orbit) = 0;
|
|
||||||
++pSolarSysState->MenuState.Initialized;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// LoadIPData ();
|
|
||||||
}
|
|
||||||
|
|
||||||
old_seed = TFB_SeedRandom (MAKE_DWORD (CurStarDescPtr->star_pt.x,
|
old_seed = TFB_SeedRandom (MAKE_DWORD (CurStarDescPtr->star_pt.x,
|
||||||
CurStarDescPtr->star_pt.y));
|
CurStarDescPtr->star_pt.y));
|
||||||
|
|
||||||
@@ -347,9 +355,10 @@ LoadSolarSys (void)
|
|||||||
{
|
{
|
||||||
pCurDesc->pPrevDesc = &pSolarSysState->SunDesc[0];
|
pCurDesc->pPrevDesc = &pSolarSysState->SunDesc[0];
|
||||||
pCurDesc->image.origin = pCurDesc->location;
|
pCurDesc->image.origin = pCurDesc->location;
|
||||||
if (pSolarSysState->MenuState.Initialized != 0
|
if (i >= pSolarSysState->SunDesc[0].NumPlanets)
|
||||||
|| i >= pSolarSysState->SunDesc[0].NumPlanets)
|
{
|
||||||
pCurDesc->image.frame = 0;
|
pCurDesc->image.frame = 0;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
COUNT index;
|
COUNT index;
|
||||||
@@ -374,26 +383,26 @@ LoadSolarSys (void)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
pSolarSysState->pOrbitalDesc = 0;
|
pSolarSysState->pOrbitalDesc = 0;
|
||||||
pSolarSysState->pBaseDesc = &pSolarSysState->PlanetDesc[i - 1];
|
|
||||||
pSolarSysState->SunDesc[0].location = GLOBAL (ip_location);
|
pSolarSysState->SunDesc[0].location = GLOBAL (ip_location);
|
||||||
GenerateMoons (pSolarSysState, pSolarSysState->pBaseDesc);
|
GenerateMoons (pSolarSysState, &pSolarSysState->PlanetDesc[i - 1]);
|
||||||
|
pSolarSysState->pBaseDesc = pSolarSysState->MoonDesc;
|
||||||
|
|
||||||
SET_GAME_STATE (PLANETARY_LANDING, 0);
|
SET_GAME_STATE (PLANETARY_LANDING, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
initSolarSysSISCharacteristics ();
|
initSolarSysSISCharacteristics ();
|
||||||
|
|
||||||
i = pSolarSysState->MenuState.Initialized;
|
if (GLOBAL (in_orbit))
|
||||||
if (i)
|
{ // Only when loading a game into orbital
|
||||||
{
|
orbital = TRUE;
|
||||||
i -= 2;
|
i = GLOBAL (in_orbit) - 1;
|
||||||
if (i == 0)
|
if (i == 0)
|
||||||
pSolarSysState->pOrbitalDesc =
|
pSolarSysState->pOrbitalDesc =
|
||||||
pSolarSysState->pBaseDesc->pPrevDesc;
|
pSolarSysState->pBaseDesc->pPrevDesc;
|
||||||
else
|
else
|
||||||
pSolarSysState->pOrbitalDesc = &pSolarSysState->MoonDesc[i - 1];
|
pSolarSysState->pOrbitalDesc = &pSolarSysState->MoonDesc[i - 1];
|
||||||
pSolarSysState->MenuState.Initialized = 2;
|
|
||||||
GLOBAL (ip_location) = pSolarSysState->SunDesc[0].location;
|
GLOBAL (ip_location) = pSolarSysState->SunDesc[0].location;
|
||||||
|
GLOBAL (in_orbit) = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -407,16 +416,14 @@ LoadSolarSys (void)
|
|||||||
|
|
||||||
// Restore RNG state:
|
// Restore RNG state:
|
||||||
TFB_SeedRandom (old_seed);
|
TFB_SeedRandom (old_seed);
|
||||||
|
|
||||||
|
return orbital;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
FreeSolarSys (void)
|
FreeSolarSys (void)
|
||||||
{
|
{
|
||||||
if (pSolarSysState->MenuState.flash_task)
|
if (pSolarSysState->MenuState.flash_task)
|
||||||
{
|
|
||||||
if (pSolarSysState->MenuState.Initialized >= 3)
|
|
||||||
FreePlanet ();
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
if (pSolarSysState->MenuState.flash_task != (Task)(~0))
|
if (pSolarSysState->MenuState.flash_task != (Task)(~0))
|
||||||
{
|
{
|
||||||
@@ -425,12 +432,12 @@ FreeSolarSys (void)
|
|||||||
ConcludeTask (pSolarSysState->MenuState.flash_task);
|
ConcludeTask (pSolarSysState->MenuState.flash_task);
|
||||||
}
|
}
|
||||||
pSolarSysState->MenuState.flash_task = 0;
|
pSolarSysState->MenuState.flash_task = 0;
|
||||||
|
|
||||||
LockMutex (GraphicsLock);
|
LockMutex (GraphicsLock);
|
||||||
if (!(GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD)))
|
if (!(GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD)))
|
||||||
SaveFlagshipState ();
|
SaveFlagshipState ();
|
||||||
UnlockMutex (GraphicsLock);
|
UnlockMutex (GraphicsLock);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
LockMutex (GraphicsLock);
|
LockMutex (GraphicsLock);
|
||||||
|
|
||||||
@@ -490,6 +497,8 @@ ShowPlanet:
|
|||||||
if (!just_checking)
|
if (!just_checking)
|
||||||
{
|
{
|
||||||
ZeroVelocityComponents (&GLOBAL (velocity));
|
ZeroVelocityComponents (&GLOBAL (velocity));
|
||||||
|
// XXX: signal enter orbital
|
||||||
|
assert (pSolarSysState->MenuState.Initialized == 1);
|
||||||
++pSolarSysState->MenuState.Initialized;
|
++pSolarSysState->MenuState.Initialized;
|
||||||
pSolarSysState->pOrbitalDesc = pCurDesc;
|
pSolarSysState->pOrbitalDesc = pCurDesc;
|
||||||
}
|
}
|
||||||
@@ -510,7 +519,7 @@ ShowPlanet:
|
|||||||
{
|
{
|
||||||
PlanetIntersect.IntersectStamp.origin = pCurDesc->image.origin;
|
PlanetIntersect.IntersectStamp.origin = pCurDesc->image.origin;
|
||||||
PlanetIntersect.EndPoint = PlanetIntersect.IntersectStamp.origin;
|
PlanetIntersect.EndPoint = PlanetIntersect.IntersectStamp.origin;
|
||||||
if (pSolarSysState->pBaseDesc == pSolarSysState->MoonDesc)
|
if (inInnerSystem ())
|
||||||
{
|
{
|
||||||
PlanetOffset = pCurDesc->pPrevDesc -
|
PlanetOffset = pCurDesc->pPrevDesc -
|
||||||
pSolarSysState->PlanetDesc;
|
pSolarSysState->PlanetDesc;
|
||||||
@@ -543,7 +552,7 @@ ShowPlanet:
|
|||||||
return;
|
return;
|
||||||
else if (pSolarSysState->WaitIntersect == NewWaitPlanet)
|
else if (pSolarSysState->WaitIntersect == NewWaitPlanet)
|
||||||
continue;
|
continue;
|
||||||
else if (pSolarSysState->pBaseDesc == pSolarSysState->MoonDesc)
|
else if (inInnerSystem ())
|
||||||
goto ShowPlanet;
|
goto ShowPlanet;
|
||||||
else if (!just_checking) /* pBaseDesc == PlanetDesc */
|
else if (!just_checking) /* pBaseDesc == PlanetDesc */
|
||||||
{
|
{
|
||||||
@@ -566,11 +575,11 @@ ShowPlanet:
|
|||||||
else if (GLOBAL (ShipStamp.origin.y) >= SIS_SCREEN_HEIGHT)
|
else if (GLOBAL (ShipStamp.origin.y) >= SIS_SCREEN_HEIGHT)
|
||||||
GLOBAL (ShipStamp.origin.y) =
|
GLOBAL (ShipStamp.origin.y) =
|
||||||
(SIS_SCREEN_HEIGHT - 1) - 1;
|
(SIS_SCREEN_HEIGHT - 1) - 1;
|
||||||
pSolarSysState->pBaseDesc = pCurDesc;
|
|
||||||
XFormIPLoc (&pCurDesc->image.origin,
|
XFormIPLoc (&pCurDesc->image.origin,
|
||||||
&pSolarSysState->SunDesc[0].location, FALSE);
|
&pSolarSysState->SunDesc[0].location, FALSE);
|
||||||
ZeroVelocityComponents (&GLOBAL (velocity));
|
ZeroVelocityComponents (&GLOBAL (velocity));
|
||||||
GenerateMoons (pSolarSysState, pCurDesc);
|
GenerateMoons (pSolarSysState, pCurDesc);
|
||||||
|
pSolarSysState->pBaseDesc = pSolarSysState->MoonDesc;
|
||||||
|
|
||||||
NewWaitPlanet = 0;
|
NewWaitPlanet = 0;
|
||||||
SetTransitionSource (NULL);
|
SetTransitionSource (NULL);
|
||||||
@@ -637,6 +646,7 @@ if (!(draw_sys_flags & (DRAW_ORBITS | DRAW_PLANETS)))
|
|||||||
|
|
||||||
if (draw_sys_flags & DRAW_ORBITS)
|
if (draw_sys_flags & DRAW_ORBITS)
|
||||||
{
|
{
|
||||||
|
// XXX: ValidateOrbits() sets pBaseDesc=0
|
||||||
if (pSolarSysState->pBaseDesc)
|
if (pSolarSysState->pBaseDesc)
|
||||||
{
|
{
|
||||||
SetContextForeGroundColor (pPlanetDesc->temp_color);
|
SetContextForeGroundColor (pPlanetDesc->temp_color);
|
||||||
@@ -724,7 +734,8 @@ FindRadius (void)
|
|||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if ((pSolarSysState->SunDesc[0].radius >>= 1) > MIN_ZOOM_RADIUS)
|
pSolarSysState->SunDesc[0].radius >>= 1;
|
||||||
|
if (pSolarSysState->SunDesc[0].radius > MIN_ZOOM_RADIUS)
|
||||||
radius = pSolarSysState->SunDesc[0].radius >> 1;
|
radius = pSolarSysState->SunDesc[0].radius >> 1;
|
||||||
else
|
else
|
||||||
radius = 0;
|
radius = 0;
|
||||||
@@ -746,7 +757,7 @@ FindRadius (void)
|
|||||||
&& delta_y < pSolarSysState->MenuState.flash_rect0.extent.height);
|
&& delta_y < pSolarSysState->MenuState.flash_rect0.extent.height);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
ZoomSystem (void)
|
ZoomSystem (void)
|
||||||
{
|
{
|
||||||
RECT r;
|
RECT r;
|
||||||
@@ -757,15 +768,10 @@ ZoomSystem (void)
|
|||||||
|
|
||||||
SetTransitionSource (&r);
|
SetTransitionSource (&r);
|
||||||
BatchGraphics ();
|
BatchGraphics ();
|
||||||
if (pSolarSysState->pBaseDesc == pSolarSysState->MoonDesc)
|
if (inInnerSystem ())
|
||||||
DrawSystem (pSolarSysState->pBaseDesc->pPrevDesc->radius, TRUE);
|
DrawSystem (pSolarSysState->pBaseDesc->pPrevDesc->radius, TRUE);
|
||||||
else
|
else
|
||||||
{
|
|
||||||
if (pSolarSysState->MenuState.CurState == 0)
|
|
||||||
FindRadius ();
|
|
||||||
|
|
||||||
DrawSystem (pSolarSysState->SunDesc[0].radius, FALSE);
|
DrawSystem (pSolarSysState->SunDesc[0].radius, FALSE);
|
||||||
}
|
|
||||||
ScreenTransition (3, &r);
|
ScreenTransition (3, &r);
|
||||||
UnbatchGraphics ();
|
UnbatchGraphics ();
|
||||||
LoadIntoExtraScreen (&r);
|
LoadIntoExtraScreen (&r);
|
||||||
@@ -904,7 +910,7 @@ UndrawShip (void)
|
|||||||
|| GLOBAL (ShipStamp.origin.y) >= SIS_SCREEN_HEIGHT)
|
|| GLOBAL (ShipStamp.origin.y) >= SIS_SCREEN_HEIGHT)
|
||||||
{
|
{
|
||||||
// The ship leaves the screen.
|
// The ship leaves the screen.
|
||||||
if (pSolarSysState->pBaseDesc == pSolarSysState->PlanetDesc)
|
if (!inInnerSystem ())
|
||||||
{
|
{
|
||||||
if (radius == MAX_ZOOM_RADIUS)
|
if (radius == MAX_ZOOM_RADIUS)
|
||||||
{
|
{
|
||||||
@@ -934,7 +940,7 @@ UndrawShip (void)
|
|||||||
pSolarSysState->MenuState.flash_rect0.corner.x;
|
pSolarSysState->MenuState.flash_rect0.corner.x;
|
||||||
delta_y = GLOBAL (ShipStamp.origin.y) -
|
delta_y = GLOBAL (ShipStamp.origin.y) -
|
||||||
pSolarSysState->MenuState.flash_rect0.corner.y;
|
pSolarSysState->MenuState.flash_rect0.corner.y;
|
||||||
if (pSolarSysState->pBaseDesc == pSolarSysState->PlanetDesc
|
if (!inInnerSystem ()
|
||||||
&& (radius > MAX_ZOOM_RADIUS
|
&& (radius > MAX_ZOOM_RADIUS
|
||||||
|| (delta_x >= 0 && delta_y >= 0
|
|| (delta_x >= 0 && delta_y >= 0
|
||||||
&& delta_x < pSolarSysState->MenuState.flash_rect0.extent.width
|
&& delta_x < pSolarSysState->MenuState.flash_rect0.extent.width
|
||||||
@@ -985,6 +991,10 @@ static void
|
|||||||
ScaleSystem (void)
|
ScaleSystem (void)
|
||||||
{
|
{
|
||||||
#if 0
|
#if 0
|
||||||
|
// XXX: This appears to have been an attempt to zoom the system view
|
||||||
|
// in a different way. This code would zoom gradually instead of
|
||||||
|
// doing crossfade from one zoom level to the other.
|
||||||
|
// Working state unknown.
|
||||||
#define NUM_STEPS 8
|
#define NUM_STEPS 8
|
||||||
COUNT num_steps;
|
COUNT num_steps;
|
||||||
SIZE err, d, new_radius, step;
|
SIZE err, d, new_radius, step;
|
||||||
@@ -1064,83 +1074,47 @@ ScaleSystem (void)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Constants and routines for handling interplanetary play. TODO:
|
static void
|
||||||
this is NOT THREAD-SAFE; only one IP task may be active at any
|
RestoreSystemView (void)
|
||||||
given time. --Michael */
|
{
|
||||||
|
CONTEXT oldContext;
|
||||||
|
RECT r;
|
||||||
|
|
||||||
|
oldContext = SetContext (SpaceContext);
|
||||||
|
GetContextClipRect (&r);
|
||||||
|
DrawFromExtraScreen (&r);
|
||||||
|
SetContext (oldContext);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Constants and routines for handling interplanetary play. */
|
||||||
|
|
||||||
#define IP_FRAME_RATE (ONE_SECOND / 30)
|
#define IP_FRAME_RATE (ONE_SECOND / 30)
|
||||||
|
|
||||||
static UWORD IP_input_state;
|
// Normally called by DoIpFlight() to process a frame
|
||||||
static DWORD IP_next_time;
|
static void
|
||||||
|
|
||||||
void
|
|
||||||
IP_reset (void)
|
|
||||||
{
|
|
||||||
DrawAutoPilotMessage (TRUE);
|
|
||||||
|
|
||||||
if (LastActivity != CHECK_LOAD)
|
|
||||||
{
|
|
||||||
IP_input_state = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
IP_input_state = 2; /* CANCEL */
|
|
||||||
}
|
|
||||||
|
|
||||||
IP_next_time = GetTimeCounter ();
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
IP_frame (void)
|
IP_frame (void)
|
||||||
{
|
{
|
||||||
CONTEXT OldContext;
|
CONTEXT OldContext;
|
||||||
BOOLEAN InnerSystem;
|
BOOLEAN startedInInner;
|
||||||
RECT r;
|
RECT r;
|
||||||
BOOLEAN select, cancel;
|
|
||||||
|
|
||||||
InnerSystem = FALSE;
|
|
||||||
LockMutex (GraphicsLock);
|
LockMutex (GraphicsLock);
|
||||||
if ((pSolarSysState->MenuState.Initialized > 1
|
|
||||||
|| (GLOBAL (CurrentActivity)
|
|
||||||
& (START_ENCOUNTER | END_INTERPLANETARY
|
|
||||||
| CHECK_ABORT | CHECK_LOAD))
|
|
||||||
|| GLOBAL_SIS (CrewEnlisted) == (COUNT)~0))
|
|
||||||
|
|
||||||
{
|
|
||||||
UnlockMutex (GraphicsLock);
|
|
||||||
TaskSwitch ();
|
|
||||||
IP_input_state = 0;
|
|
||||||
IP_next_time = GetTimeCounter ();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
cancel = ((IP_input_state) >> 1) & 1;
|
|
||||||
select = (IP_input_state) & 1;
|
|
||||||
OldContext = SetContext (StatusContext);
|
OldContext = SetContext (StatusContext);
|
||||||
if (pSolarSysState->MenuState.CurState
|
|
||||||
|| pSolarSysState->MenuState.Initialized == 0)
|
|
||||||
{
|
{
|
||||||
select = FALSE;
|
|
||||||
cancel = FALSE;
|
|
||||||
if (draw_sys_flags & DRAW_REFRESH)
|
|
||||||
goto TheMess;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
TheMess:
|
|
||||||
// this is a mess:
|
// this is a mess:
|
||||||
// we have to treat things slightly differently depending on the
|
// we have to treat things slightly differently depending on the
|
||||||
// situation (note that DRAW_REFRESH means we had gone to the
|
// situation (note that DRAW_REFRESH means entered a new system
|
||||||
// menu)
|
// not from a load)
|
||||||
InnerSystem = (BOOLEAN) (pSolarSysState->pBaseDesc !=
|
startedInInner = inInnerSystem ();
|
||||||
pSolarSysState->PlanetDesc);
|
if (startedInInner)
|
||||||
if (InnerSystem)
|
|
||||||
{
|
{
|
||||||
SetTransitionSource (NULL);
|
SetTransitionSource (NULL);
|
||||||
BatchGraphics ();
|
BatchGraphics ();
|
||||||
|
// XXX: this test is now invariant false
|
||||||
if (draw_sys_flags & DRAW_REFRESH)
|
if (draw_sys_flags & DRAW_REFRESH)
|
||||||
{
|
{
|
||||||
InnerSystem = FALSE;
|
startedInInner = FALSE;
|
||||||
DrawSystem (pSolarSysState->pBaseDesc->pPrevDesc->radius, TRUE);
|
DrawSystem (pSolarSysState->pBaseDesc->pPrevDesc->radius, TRUE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1157,11 +1131,6 @@ IP_frame (void)
|
|||||||
ProcessShipControls ();
|
ProcessShipControls ();
|
||||||
}
|
}
|
||||||
UndrawShip ();
|
UndrawShip ();
|
||||||
if (pSolarSysState->MenuState.Initialized != 1)
|
|
||||||
{
|
|
||||||
select = FALSE;
|
|
||||||
cancel = FALSE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (old_radius)
|
if (old_radius)
|
||||||
@@ -1171,27 +1140,18 @@ IP_frame (void)
|
|||||||
if (!(draw_sys_flags & DRAW_REFRESH))
|
if (!(draw_sys_flags & DRAW_REFRESH))
|
||||||
// don't repair from Extra or draw ship if forcing repair
|
// don't repair from Extra or draw ship if forcing repair
|
||||||
{
|
{
|
||||||
CONTEXT OldContext;
|
RestoreSystemView ();
|
||||||
|
|
||||||
OldContext = SetContext (SpaceContext);
|
|
||||||
GetContextClipRect (&r);
|
|
||||||
DrawFromExtraScreen (&r);
|
|
||||||
SetContext (OldContext);
|
|
||||||
|
|
||||||
// Don't redraw if entering/exiting inner system
|
// Don't redraw if entering/exiting inner system
|
||||||
// this screws up ScreenTransition by leaving an image of the
|
// this screws up ScreenTransition by leaving an image of the
|
||||||
// ship in the ExtraScreen (which we use for repair)
|
// ship in the ExtraScreen (which we use for repair)
|
||||||
if (pSolarSysState->MenuState.CurState == 0
|
if (startedInInner == inInnerSystem ())
|
||||||
&& (InnerSystem ^ (BOOLEAN)(
|
|
||||||
pSolarSysState->pBaseDesc != pSolarSysState->PlanetDesc)))
|
|
||||||
;
|
|
||||||
else
|
|
||||||
RedrawQueue (FALSE);
|
RedrawQueue (FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (InnerSystem)
|
if (startedInInner)
|
||||||
{
|
{
|
||||||
if (pSolarSysState->pBaseDesc == pSolarSysState->PlanetDesc)
|
if (!inInnerSystem ())
|
||||||
{
|
{
|
||||||
// transition screen if we left inner system (if going
|
// transition screen if we left inner system (if going
|
||||||
// from outer to inner, ScreenTransition happens elsewhere)
|
// from outer to inner, ScreenTransition happens elsewhere)
|
||||||
@@ -1205,7 +1165,7 @@ IP_frame (void)
|
|||||||
}
|
}
|
||||||
else if (draw_sys_flags & DRAW_REFRESH)
|
else if (draw_sys_flags & DRAW_REFRESH)
|
||||||
{
|
{
|
||||||
// must set rect for LoadInto... below
|
// must set rect for LoadIntoExtraScreen below
|
||||||
r.corner.x = SIS_ORG_X;
|
r.corner.x = SIS_ORG_X;
|
||||||
r.corner.y = SIS_ORG_Y;
|
r.corner.y = SIS_ORG_Y;
|
||||||
r.extent.width = SIS_SCREEN_WIDTH;
|
r.extent.width = SIS_SCREEN_WIDTH;
|
||||||
@@ -1220,14 +1180,14 @@ IP_frame (void)
|
|||||||
|
|
||||||
if (draw_sys_flags & UNBATCH_SYS)
|
if (draw_sys_flags & UNBATCH_SYS)
|
||||||
{
|
{
|
||||||
// means we're forcing a redraw/transition from Init- & ChangeSolarSys
|
// InitSolarSys() prepared a transition for us
|
||||||
draw_sys_flags &= ~UNBATCH_SYS;
|
draw_sys_flags &= ~UNBATCH_SYS;
|
||||||
UnbatchGraphics ();
|
UnbatchGraphics ();
|
||||||
}
|
}
|
||||||
|
|
||||||
// LoadInto Extra if we left inner system, or we forced a redraw
|
// Save the system image if we left inner system, or we forced a redraw
|
||||||
if ((InnerSystem && pSolarSysState->pBaseDesc ==
|
if ((startedInInner && !inInnerSystem ())
|
||||||
pSolarSysState->PlanetDesc) || (draw_sys_flags & DRAW_REFRESH))
|
|| (draw_sys_flags & DRAW_REFRESH))
|
||||||
{
|
{
|
||||||
LoadIntoExtraScreen (&r);
|
LoadIntoExtraScreen (&r);
|
||||||
draw_sys_flags &= ~DRAW_REFRESH;
|
draw_sys_flags &= ~DRAW_REFRESH;
|
||||||
@@ -1235,48 +1195,6 @@ IP_frame (void)
|
|||||||
|
|
||||||
SetContext (OldContext);
|
SetContext (OldContext);
|
||||||
UnlockMutex (GraphicsLock);
|
UnlockMutex (GraphicsLock);
|
||||||
|
|
||||||
if (!cancel)
|
|
||||||
{
|
|
||||||
SleepThreadUntil (IP_next_time + IP_FRAME_RATE);
|
|
||||||
IP_next_time = GetTimeCounter ();
|
|
||||||
if (pSolarSysState->MenuState.CurState
|
|
||||||
|| pSolarSysState->MenuState.Initialized != 1)
|
|
||||||
{
|
|
||||||
cancel = FALSE;
|
|
||||||
select = FALSE;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* Updating the input state is handled by
|
|
||||||
* DoFlagshipCommands, which is running in
|
|
||||||
* parallel with us */
|
|
||||||
// UpdateInputState ();
|
|
||||||
cancel = PulsedInputState.menu[KEY_MENU_CANCEL];
|
|
||||||
select = PulsedInputState.menu[KEY_MENU_SELECT];
|
|
||||||
IP_input_state = (cancel << 1) | select;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
LockMutex (GraphicsLock);
|
|
||||||
DrawStatusMessage (NULL);
|
|
||||||
if (LastActivity == CHECK_LOAD)
|
|
||||||
{ // Selected LOAD from main menu
|
|
||||||
pSolarSysState->MenuState.CurState = (ROSTER + 1) + 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
UnlockMutex (GraphicsLock);
|
|
||||||
DrawMenuStateStrings (PM_STARMAP, STARMAP);
|
|
||||||
LockMutex (GraphicsLock);
|
|
||||||
pSolarSysState->MenuState.CurState = STARMAP + 1;
|
|
||||||
IP_input_state = 0;
|
|
||||||
}
|
|
||||||
SetFlashRect (SFR_MENU_3DO);
|
|
||||||
FlushInput ();
|
|
||||||
UnlockMutex (GraphicsLock);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -1288,7 +1206,7 @@ DrawInnerSystem (void)
|
|||||||
UnlockMutex (GraphicsLock);
|
UnlockMutex (GraphicsLock);
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOLEAN
|
static BOOLEAN
|
||||||
ValidateOrbits (void)
|
ValidateOrbits (void)
|
||||||
{
|
{
|
||||||
BYTE i;
|
BYTE i;
|
||||||
@@ -1296,8 +1214,7 @@ ValidateOrbits (void)
|
|||||||
POINT old_pts[2] = { { 0, 0 }, { 0, 0 } };
|
POINT old_pts[2] = { { 0, 0 }, { 0, 0 } };
|
||||||
PLANET_DESC *pCurDesc;
|
PLANET_DESC *pCurDesc;
|
||||||
|
|
||||||
InnerSystem = (BOOLEAN)(
|
InnerSystem = inInnerSystem ();
|
||||||
pSolarSysState->pBaseDesc == pSolarSysState->MoonDesc);
|
|
||||||
if (InnerSystem)
|
if (InnerSystem)
|
||||||
{
|
{
|
||||||
old_pts[0] = GLOBAL (ShipStamp.origin);
|
old_pts[0] = GLOBAL (ShipStamp.origin);
|
||||||
@@ -1308,6 +1225,7 @@ ValidateOrbits (void)
|
|||||||
pSolarSysState->SunDesc[0].radius = MAX_ZOOM_RADIUS << 1;
|
pSolarSysState->SunDesc[0].radius = MAX_ZOOM_RADIUS << 1;
|
||||||
FindRadius ();
|
FindRadius ();
|
||||||
|
|
||||||
|
// XXX: DrawOrbit() checks pBaseDesc for 0
|
||||||
pSolarSysState->pBaseDesc = 0;
|
pSolarSysState->pBaseDesc = 0;
|
||||||
for (i = pSolarSysState->SunDesc[0].NumPlanets,
|
for (i = pSolarSysState->SunDesc[0].NumPlanets,
|
||||||
pCurDesc = &pSolarSysState->PlanetDesc[0]; i; --i, ++pCurDesc)
|
pCurDesc = &pSolarSysState->PlanetDesc[0]; i; --i, ++pCurDesc)
|
||||||
@@ -1329,15 +1247,14 @@ ValidateOrbits (void)
|
|||||||
return (InnerSystem);
|
return (InnerSystem);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
ChangeSolarSys (void)
|
ResetSolarSys (void)
|
||||||
{
|
{
|
||||||
if (pSolarSysState->MenuState.Initialized == 0)
|
// Originally there was a flash_task test here, however, I found no cases
|
||||||
{
|
// where flash_task could be set at the time of call. The test was
|
||||||
StartGroups:
|
// probably needed on 3DO when IP_frame() was a task.
|
||||||
++pSolarSysState->MenuState.Initialized;
|
assert (!pSolarSysState->MenuState.flash_task);
|
||||||
if (pSolarSysState->MenuState.flash_task == 0)
|
|
||||||
{
|
|
||||||
DrawMenuStateStrings (PM_STARMAP, -(PM_NAVIGATE - PM_SCAN));
|
DrawMenuStateStrings (PM_STARMAP, -(PM_NAVIGATE - PM_SCAN));
|
||||||
|
|
||||||
LockMutex (GraphicsLock);
|
LockMutex (GraphicsLock);
|
||||||
@@ -1347,64 +1264,65 @@ StartGroups:
|
|||||||
DoMissions ();
|
DoMissions ();
|
||||||
|
|
||||||
// if entering new system (NOT from load),
|
// if entering new system (NOT from load),
|
||||||
// force redraw and transition in IPtask_func
|
// force redraw and transition in IP_frame()
|
||||||
if ((draw_sys_flags & UNBATCH_SYS)
|
if ((draw_sys_flags & UNBATCH_SYS)
|
||||||
&& LastActivity != (CHECK_LOAD | CHECK_RESTART))
|
&& LastActivity != (CHECK_LOAD | CHECK_RESTART))
|
||||||
draw_sys_flags |= DRAW_REFRESH;
|
draw_sys_flags |= DRAW_REFRESH;
|
||||||
|
|
||||||
CheckIntersect (TRUE);
|
CheckIntersect (TRUE);
|
||||||
|
|
||||||
IP_reset ();
|
|
||||||
pSolarSysState->MenuState.flash_task = (Task)(~0);
|
pSolarSysState->MenuState.flash_task = (Task)(~0);
|
||||||
/*
|
|
||||||
pSolarSysState->MenuState.flash_task =
|
|
||||||
AssignTask (IPtask_func, 6144,
|
|
||||||
"interplanetary task");
|
|
||||||
*/
|
|
||||||
UnlockMutex (GraphicsLock);
|
UnlockMutex (GraphicsLock);
|
||||||
|
|
||||||
if (!PLRPlaying ((MUSIC_REF)~0) && LastActivity != CHECK_LOAD)
|
if (!PLRPlaying ((MUSIC_REF)~0) && LastActivity != CHECK_LOAD)
|
||||||
{
|
{
|
||||||
PlayMusic (SpaceMusic, TRUE, 1);
|
PlayMusic (SpaceMusic, TRUE, 1);
|
||||||
|
|
||||||
|
// XXX: This is begging to be moved somewhere more appropriate
|
||||||
|
// This fades in the solar system view when a New game starts
|
||||||
if (LastActivity == (CHECK_LOAD | CHECK_RESTART))
|
if (LastActivity == (CHECK_LOAD | CHECK_RESTART))
|
||||||
{
|
{ // Starting a new game, NOT from load!
|
||||||
BYTE clut_buf[] = {FadeAllToColor};
|
BYTE clut_buf[] = {FadeAllToColor};
|
||||||
|
|
||||||
LastActivity = 0;
|
LastActivity = 0;
|
||||||
|
// XXX: this test is invariant true
|
||||||
if (draw_sys_flags & UNBATCH_SYS)
|
if (draw_sys_flags & UNBATCH_SYS)
|
||||||
{
|
{
|
||||||
draw_sys_flags &= ~UNBATCH_SYS;
|
draw_sys_flags &= ~UNBATCH_SYS;
|
||||||
UnbatchGraphics ();
|
UnbatchGraphics ();
|
||||||
}
|
}
|
||||||
LockMutex (GraphicsLock);
|
|
||||||
while ((pSolarSysState->SunDesc[0].radius ==
|
|
||||||
(MAX_ZOOM_RADIUS << 1)) &&
|
|
||||||
!(GLOBAL(CurrentActivity) & CHECK_ABORT))
|
|
||||||
{
|
|
||||||
UnlockMutex (GraphicsLock);
|
|
||||||
IP_frame ();
|
|
||||||
LockMutex (GraphicsLock);
|
|
||||||
}
|
|
||||||
UnlockMutex (GraphicsLock);
|
|
||||||
XFormColorMap ((COLORMAPPTR)clut_buf, ONE_SECOND / 2);
|
XFormColorMap ((COLORMAPPTR)clut_buf, ONE_SECOND / 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
SetGameClockRate (INTERPLANETARY_CLOCK_RATE);
|
static void
|
||||||
}
|
ReinitInnerSystem (void)
|
||||||
}
|
{
|
||||||
else
|
LockMutex (GraphicsLock);
|
||||||
{
|
SetTransitionSource (NULL);
|
||||||
|
LoadSolarSys ();
|
||||||
|
ValidateOrbits ();
|
||||||
|
DrawInnerSystem ();
|
||||||
|
ScreenTransition (3, NULL);
|
||||||
|
UnlockMutex (GraphicsLock);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
EnterPlanetOrbit (void)
|
||||||
|
{
|
||||||
if (pSolarSysState->MenuState.flash_task)
|
if (pSolarSysState->MenuState.flash_task)
|
||||||
{
|
{ // This means we hit a planet in IP flight; not a Load into orbit
|
||||||
FreeSolarSys ();
|
FreeSolarSys ();
|
||||||
|
|
||||||
if (pSolarSysState->pOrbitalDesc->pPrevDesc !=
|
if (pSolarSysState->pOrbitalDesc->pPrevDesc !=
|
||||||
&pSolarSysState->SunDesc[0])
|
&pSolarSysState->SunDesc[0])
|
||||||
|
{ // Moon -- use its origin
|
||||||
GLOBAL (ShipStamp.origin) =
|
GLOBAL (ShipStamp.origin) =
|
||||||
pSolarSysState->pOrbitalDesc->image.origin;
|
pSolarSysState->pOrbitalDesc->image.origin;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{ // Planet -- its origin is for the outer view, so use mid-screen
|
||||||
GLOBAL (ShipStamp.origin.x) = SIS_SCREEN_WIDTH >> 1;
|
GLOBAL (ShipStamp.origin.x) = SIS_SCREEN_WIDTH >> 1;
|
||||||
GLOBAL (ShipStamp.origin.y) = SIS_SCREEN_HEIGHT >> 1;
|
GLOBAL (ShipStamp.origin.y) = SIS_SCREEN_HEIGHT >> 1;
|
||||||
}
|
}
|
||||||
@@ -1419,27 +1337,23 @@ StartGroups:
|
|||||||
|| GET_GAME_STATE (CHMMR_BOMB_STATE) == 2)
|
|| GET_GAME_STATE (CHMMR_BOMB_STATE) == 2)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (pSolarSysState->MenuState.flash_task == 0)
|
if (pSolarSysState->MenuState.flash_task)
|
||||||
{
|
{ // We've entered orbit; LoadPlanet() set flash_task to rotate planet
|
||||||
/* Note! This implies that our generateOrbital function started
|
PlanetOrbitMenu ();
|
||||||
a conversation; that is, that this is a homeworld */
|
FreePlanet ();
|
||||||
SetTransitionSource (NULL);
|
}
|
||||||
LoadSolarSys ();
|
// Otherwise, generateOrbital function started a homeworld conversation,
|
||||||
ValidateOrbits ();
|
// and we did not get to the planet no matter what.
|
||||||
DrawInnerSystem ();
|
|
||||||
ScreenTransition (3, NULL);
|
|
||||||
|
|
||||||
goto StartGroups;
|
// START_ENCOUNTER could be set by Devices menu a number of ways:
|
||||||
}
|
// Talking Pet, Sun Device or a Caster over Chmmr, or
|
||||||
else
|
// a Caster for Ilwrath
|
||||||
|
// Could also have blown self up with Utwig Bomb
|
||||||
|
if (!(GLOBAL (CurrentActivity) & (START_ENCOUNTER |
|
||||||
|
CHECK_ABORT | CHECK_LOAD))
|
||||||
|
&& GLOBAL_SIS (CrewEnlisted) != (COUNT)~0)
|
||||||
{
|
{
|
||||||
DrawMenuStateStrings (PM_SCAN, SCAN);
|
ReinitInnerSystem ();
|
||||||
LockMutex (GraphicsLock);
|
|
||||||
pSolarSysState->MenuState.CurState = SCAN + 1;
|
|
||||||
SetFlashRect (SFR_MENU_3DO);
|
|
||||||
FlushInput ();
|
|
||||||
UnlockMutex (GraphicsLock);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1448,6 +1362,7 @@ InitSolarSys (void)
|
|||||||
{
|
{
|
||||||
BOOLEAN InnerSystem;
|
BOOLEAN InnerSystem;
|
||||||
BOOLEAN Reentry;
|
BOOLEAN Reentry;
|
||||||
|
BOOLEAN orbital;
|
||||||
|
|
||||||
LockMutex (GraphicsLock);
|
LockMutex (GraphicsLock);
|
||||||
|
|
||||||
@@ -1455,7 +1370,7 @@ InitSolarSys (void)
|
|||||||
LoadLanderData ();
|
LoadLanderData ();
|
||||||
UnlockMutex (GraphicsLock);
|
UnlockMutex (GraphicsLock);
|
||||||
|
|
||||||
pSolarSysState->MenuState.InputFunc = DoFlagshipCommands;
|
pSolarSysState->MenuState.InputFunc = DoIpFlight;
|
||||||
|
|
||||||
Reentry = (GLOBAL (ShipFacing) != 0);
|
Reentry = (GLOBAL (ShipFacing) != 0);
|
||||||
if (!Reentry)
|
if (!Reentry)
|
||||||
@@ -1471,7 +1386,7 @@ InitSolarSys (void)
|
|||||||
XFormIPLoc (&GLOBAL (ShipStamp.origin), &GLOBAL (ip_location), FALSE);
|
XFormIPLoc (&GLOBAL (ShipStamp.origin), &GLOBAL (ip_location), FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
LoadSolarSys ();
|
orbital = LoadSolarSys ();
|
||||||
InnerSystem = ValidateOrbits ();
|
InnerSystem = ValidateOrbits ();
|
||||||
|
|
||||||
if (Reentry)
|
if (Reentry)
|
||||||
@@ -1488,14 +1403,24 @@ InitSolarSys (void)
|
|||||||
(*pSolarSysState->genFuncs->initNpcs) (pSolarSysState);
|
(*pSolarSysState->genFuncs->initNpcs) (pSolarSysState);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pSolarSysState->MenuState.Initialized == 0)
|
if (orbital)
|
||||||
|
{
|
||||||
|
// XXX: signal enter orbital
|
||||||
|
pSolarSysState->MenuState.Initialized = 2;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
LockMutex (GraphicsLock);
|
LockMutex (GraphicsLock);
|
||||||
|
|
||||||
|
// We draw the IP display here but do not flush it to the screen yet
|
||||||
|
// Whatever we have drawn will fade in in ResetSolarSys() or will
|
||||||
|
// get transitioned onto the screen in IP_frame()
|
||||||
SetTransitionSource (NULL);
|
SetTransitionSource (NULL);
|
||||||
BatchGraphics ();
|
BatchGraphics ();
|
||||||
draw_sys_flags |= UNBATCH_SYS;
|
draw_sys_flags |= UNBATCH_SYS;
|
||||||
|
|
||||||
|
// XXX: This whole "maybe loaded a game or maybe starting a new game"
|
||||||
|
// mess is begging to be cleaned up.
|
||||||
if (LastActivity & (CHECK_LOAD | CHECK_RESTART))
|
if (LastActivity & (CHECK_LOAD | CHECK_RESTART))
|
||||||
{
|
{
|
||||||
if ((LastActivity & (CHECK_LOAD | CHECK_RESTART)) ==
|
if ((LastActivity & (CHECK_LOAD | CHECK_RESTART)) ==
|
||||||
@@ -1513,8 +1438,6 @@ InitSolarSys (void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Enabled graphics synchronization again, as in 3DO code originally.
|
|
||||||
// This should fix the 'entering star' lockup/messed graphics problems.
|
|
||||||
DrawSISMessage (NULL);
|
DrawSISMessage (NULL);
|
||||||
SetContext (SpaceContext);
|
SetContext (SpaceContext);
|
||||||
SetContextFGFrame (Screen);
|
SetContextFGFrame (Screen);
|
||||||
@@ -1523,16 +1446,11 @@ InitSolarSys (void)
|
|||||||
|
|
||||||
if (InnerSystem)
|
if (InnerSystem)
|
||||||
{
|
{
|
||||||
SetGraphicGrabOther (1); // since Unbatch won't have flipped yet
|
|
||||||
DrawInnerSystem ();
|
DrawInnerSystem ();
|
||||||
SetGraphicGrabOther (0);
|
|
||||||
if (draw_sys_flags & UNBATCH_SYS)
|
|
||||||
{
|
|
||||||
draw_sys_flags &= ~UNBATCH_SYS;
|
draw_sys_flags &= ~UNBATCH_SYS;
|
||||||
ScreenTransition (3, 0);
|
ScreenTransition (3, NULL);
|
||||||
UnbatchGraphics ();
|
UnbatchGraphics ();
|
||||||
LoadIntoExtraScreen (0);
|
LoadIntoExtraScreen (NULL);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1540,7 +1458,7 @@ InitSolarSys (void)
|
|||||||
DrawHyperCoords (CurStarDescPtr->star_pt); /* Adjust position */
|
DrawHyperCoords (CurStarDescPtr->star_pt); /* Adjust position */
|
||||||
UnlockMutex (GraphicsLock);
|
UnlockMutex (GraphicsLock);
|
||||||
|
|
||||||
/* force a redraw */
|
// force a redraw in UndrawShip()
|
||||||
pSolarSysState->SunDesc[0].radius = MAX_ZOOM_RADIUS << 1;
|
pSolarSysState->SunDesc[0].radius = MAX_ZOOM_RADIUS << 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1562,7 +1480,8 @@ endInterPlanetary (void)
|
|||||||
|
|
||||||
// Find the closest planet to a point, in interplanetary.
|
// Find the closest planet to a point, in interplanetary.
|
||||||
static PLANET_DESC *
|
static PLANET_DESC *
|
||||||
closestPlanetInterPlanetary (const POINT *point) {
|
closestPlanetInterPlanetary (const POINT *point)
|
||||||
|
{
|
||||||
BYTE i;
|
BYTE i;
|
||||||
BYTE numPlanets;
|
BYTE numPlanets;
|
||||||
DWORD bestDistSquared;
|
DWORD bestDistSquared;
|
||||||
@@ -1612,16 +1531,16 @@ UninitSolarSys (void)
|
|||||||
|
|
||||||
if (GLOBAL (ip_planet) == 0)
|
if (GLOBAL (ip_planet) == 0)
|
||||||
{
|
{
|
||||||
pSolarSysState->pBaseDesc =
|
PLANET_DESC *planet =
|
||||||
closestPlanetInterPlanetary (&GLOBAL (ShipStamp.origin));
|
closestPlanetInterPlanetary (&GLOBAL (ShipStamp.origin));
|
||||||
|
|
||||||
(*pSolarSysState->genFuncs->generateName) (
|
(*pSolarSysState->genFuncs->generateName) (
|
||||||
pSolarSysState, pSolarSysState->pBaseDesc);
|
pSolarSysState, planet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
DrawSystem (SIZE radius, BOOLEAN IsInnerSystem)
|
DrawSystem (SIZE radius, BOOLEAN IsInnerSystem)
|
||||||
{
|
{
|
||||||
BYTE i;
|
BYTE i;
|
||||||
@@ -1704,7 +1623,7 @@ DrawSystem (SIZE radius, BOOLEAN IsInnerSystem)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pSolarSysState->pBaseDesc == pSolarSysState->PlanetDesc)
|
if (!inInnerSystem ())
|
||||||
XFormIPLoc (&GLOBAL (ip_location),
|
XFormIPLoc (&GLOBAL (ip_location),
|
||||||
&GLOBAL (ShipStamp.origin),
|
&GLOBAL (ShipStamp.origin),
|
||||||
TRUE);
|
TRUE);
|
||||||
@@ -1841,20 +1760,16 @@ XFormIPLoc (POINT *pIn, POINT *pOut, BOOLEAN ToDisplay)
|
|||||||
{
|
{
|
||||||
pOut->x = (SIS_SCREEN_WIDTH >> 1)
|
pOut->x = (SIS_SCREEN_WIDTH >> 1)
|
||||||
+ (SIZE)((long)pIn->x * (DISPLAY_FACTOR >> 1)
|
+ (SIZE)((long)pIn->x * (DISPLAY_FACTOR >> 1)
|
||||||
// / (long)pSolarSysState->SunDesc[0].radius);
|
|
||||||
/ pSolarSysState->SunDesc[0].radius);
|
/ pSolarSysState->SunDesc[0].radius);
|
||||||
pOut->y = (SIS_SCREEN_HEIGHT >> 1)
|
pOut->y = (SIS_SCREEN_HEIGHT >> 1)
|
||||||
+ (SIZE)((long)pIn->y * (DISPLAY_FACTOR >> 1)
|
+ (SIZE)((long)pIn->y * (DISPLAY_FACTOR >> 1)
|
||||||
// / (long)pSolarSysState->SunDesc[0].radius);
|
|
||||||
/ pSolarSysState->SunDesc[0].radius);
|
/ pSolarSysState->SunDesc[0].radius);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pOut->x = (SIZE)((long)(pIn->x - (SIS_SCREEN_WIDTH >> 1))
|
pOut->x = (SIZE)((long)(pIn->x - (SIS_SCREEN_WIDTH >> 1))
|
||||||
// * (long)pSolarSysState->SunDesc[0].radius
|
|
||||||
* pSolarSysState->SunDesc[0].radius / (DISPLAY_FACTOR >> 1));
|
* pSolarSysState->SunDesc[0].radius / (DISPLAY_FACTOR >> 1));
|
||||||
pOut->y = (SIZE)((long)(pIn->y - (SIS_SCREEN_HEIGHT >> 1))
|
pOut->y = (SIZE)((long)(pIn->y - (SIS_SCREEN_HEIGHT >> 1))
|
||||||
// * (long)pSolarSysState->SunDesc[0].radius
|
|
||||||
* pSolarSysState->SunDesc[0].radius / (DISPLAY_FACTOR >> 1));
|
* pSolarSysState->SunDesc[0].radius / (DISPLAY_FACTOR >> 1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1871,12 +1786,11 @@ ExploreSolarSys (void)
|
|||||||
universe.x = LOGX_TO_UNIVERSE (GLOBAL_SIS (log_x));
|
universe.x = LOGX_TO_UNIVERSE (GLOBAL_SIS (log_x));
|
||||||
universe.y = LOGY_TO_UNIVERSE (GLOBAL_SIS (log_y));
|
universe.y = LOGY_TO_UNIVERSE (GLOBAL_SIS (log_y));
|
||||||
CurStarDescPtr = FindStar (0, &universe, 1, 1);
|
CurStarDescPtr = FindStar (0, &universe, 1, 1);
|
||||||
/*
|
if (!CurStarDescPtr)
|
||||||
// The following code used to be there, but the test is
|
{
|
||||||
// pointless. Maybe we should panic here?
|
log_add (log_Fatal, "ExploreSolarSys(): do not know where you are!");
|
||||||
if ((CurStarDescPtr = FindStar (0, &universe, 1, 1)) == 0)
|
explode ();
|
||||||
;
|
}
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
GLOBAL_SIS (log_x) = UNIVERSE_TO_LOGX (CurStarDescPtr->star_pt.x);
|
GLOBAL_SIS (log_x) = UNIVERSE_TO_LOGX (CurStarDescPtr->star_pt.x);
|
||||||
GLOBAL_SIS (log_y) = UNIVERSE_TO_LOGY (CurStarDescPtr->star_pt.y);
|
GLOBAL_SIS (log_y) = UNIVERSE_TO_LOGY (CurStarDescPtr->star_pt.y);
|
||||||
@@ -1888,7 +1802,7 @@ ExploreSolarSys (void)
|
|||||||
SolarSysState.genFuncs = getGenerateFunctions (CurStarDescPtr->Index);
|
SolarSysState.genFuncs = getGenerateFunctions (CurStarDescPtr->Index);
|
||||||
|
|
||||||
InitSolarSys ();
|
InitSolarSys ();
|
||||||
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
SetMenuSounds (MENU_SOUND_NONE, MENU_SOUND_NONE);
|
||||||
DoInput (&SolarSysState.MenuState, FALSE);
|
DoInput (&SolarSysState.MenuState, FALSE);
|
||||||
UninitSolarSys ();
|
UninitSolarSys ();
|
||||||
pSolarSysState = 0;
|
pSolarSysState = 0;
|
||||||
@@ -2004,3 +1918,151 @@ GetPlanetOrMoonName (UNICODE *buf, COUNT bufsize)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static BOOLEAN
|
||||||
|
DoSolarSysMenu (MENU_STATE *pMS)
|
||||||
|
{
|
||||||
|
BOOLEAN select = PulsedInputState.menu[KEY_MENU_SELECT];
|
||||||
|
BOOLEAN handled;
|
||||||
|
|
||||||
|
if ((GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD))
|
||||||
|
|| GLOBAL_SIS (CrewEnlisted) == (COUNT)~0)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
// XXX: pMS actually refers to pSolarSysState->MenuState
|
||||||
|
handled = DoMenuChooser (pMS, PM_STARMAP);
|
||||||
|
if (handled)
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
if (LastActivity == CHECK_LOAD)
|
||||||
|
select = TRUE; // Selected LOAD from main menu
|
||||||
|
|
||||||
|
if (!select)
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
LockMutex (GraphicsLock);
|
||||||
|
SetFlashRect (NULL);
|
||||||
|
UnlockMutex (GraphicsLock);
|
||||||
|
|
||||||
|
switch (pMS->CurState)
|
||||||
|
{
|
||||||
|
case EQUIP_DEVICE:
|
||||||
|
select = DevicesMenu ();
|
||||||
|
if (GLOBAL (CurrentActivity) & START_ENCOUNTER)
|
||||||
|
{ // Invoked Talking Pet or a Caster for Ilwrath
|
||||||
|
// Going into conversation
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case CARGO:
|
||||||
|
CargoMenu ();
|
||||||
|
break;
|
||||||
|
case ROSTER:
|
||||||
|
select = RosterMenu ();
|
||||||
|
break;
|
||||||
|
case GAME_MENU:
|
||||||
|
if (!GameOptions ())
|
||||||
|
return FALSE; // abort or load
|
||||||
|
break;
|
||||||
|
case STARMAP:
|
||||||
|
StarMap ();
|
||||||
|
SetDefaultMenuRepeatDelay ();
|
||||||
|
|
||||||
|
if (GLOBAL (CurrentActivity) & CHECK_ABORT)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
LockMutex (GraphicsLock);
|
||||||
|
ZoomSystem ();
|
||||||
|
UnlockMutex (GraphicsLock);
|
||||||
|
// Fall through !!!
|
||||||
|
case NAVIGATION:
|
||||||
|
// TODO: what's this?
|
||||||
|
//DrawMenuStateStrings (PM_STARMAP, -NAVIGATION);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(GLOBAL (CurrentActivity) & CHECK_ABORT))
|
||||||
|
{
|
||||||
|
if (select)
|
||||||
|
{ // 3DO menu jumps to NAVIGATE after a successful submenu run
|
||||||
|
if (optWhichMenu != OPT_PC)
|
||||||
|
pMS->CurState = NAVIGATION;
|
||||||
|
DrawMenuStateStrings (PM_STARMAP, pMS->CurState);
|
||||||
|
}
|
||||||
|
LockMutex (GraphicsLock);
|
||||||
|
SetFlashRect (SFR_MENU_3DO);
|
||||||
|
UnlockMutex (GraphicsLock);
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
SolarSysMenu (void)
|
||||||
|
{
|
||||||
|
void *oldInputFunc = pSolarSysState->MenuState.InputFunc;
|
||||||
|
|
||||||
|
LockMutex (GraphicsLock);
|
||||||
|
DrawStatusMessage (NULL);
|
||||||
|
if (LastActivity == CHECK_LOAD)
|
||||||
|
{ // Selected LOAD from main menu
|
||||||
|
pSolarSysState->MenuState.CurState = GAME_MENU;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UnlockMutex (GraphicsLock);
|
||||||
|
DrawMenuStateStrings (PM_STARMAP, STARMAP);
|
||||||
|
LockMutex (GraphicsLock);
|
||||||
|
pSolarSysState->MenuState.CurState = STARMAP;
|
||||||
|
}
|
||||||
|
SetFlashRect (SFR_MENU_3DO);
|
||||||
|
UnlockMutex (GraphicsLock);
|
||||||
|
|
||||||
|
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||||
|
// XXX: temporary; will have an own MENU_STATE
|
||||||
|
pSolarSysState->MenuState.InputFunc = DoSolarSysMenu;
|
||||||
|
DoInput (&pSolarSysState->MenuState, TRUE);
|
||||||
|
pSolarSysState->MenuState.InputFunc = oldInputFunc;
|
||||||
|
}
|
||||||
|
|
||||||
|
static BOOLEAN
|
||||||
|
DoIpFlight (MENU_STATE *pMS)
|
||||||
|
{
|
||||||
|
static TimeCount NextTime;
|
||||||
|
BOOLEAN cancel = PulsedInputState.menu[KEY_MENU_CANCEL];
|
||||||
|
|
||||||
|
if (!pMS->Initialized)
|
||||||
|
{
|
||||||
|
// This has some dependency on the IP_frame()
|
||||||
|
ResetSolarSys ();
|
||||||
|
// XXX: pMS refers to pSolarSysState->MenuState
|
||||||
|
pMS->Initialized = 1;
|
||||||
|
// XXX: InitSolarSys() leaves gfx batched so that IP_frame
|
||||||
|
// does a screen transition. It's currently easier to just
|
||||||
|
// call IP_frame() for loading a game from main menu.
|
||||||
|
IP_frame ();
|
||||||
|
}
|
||||||
|
else if (pMS->Initialized == 2)
|
||||||
|
{ // CheckIntersect() or InitSolarSys() sent us to orbital
|
||||||
|
EnterPlanetOrbit ();
|
||||||
|
SetMenuSounds (MENU_SOUND_NONE, MENU_SOUND_NONE);
|
||||||
|
// Force a reset after orbital
|
||||||
|
// XXX: pMS refers to pSolarSysState->MenuState
|
||||||
|
pMS->Initialized = FALSE;
|
||||||
|
}
|
||||||
|
else if (cancel || LastActivity == CHECK_LOAD)
|
||||||
|
{
|
||||||
|
SolarSysMenu ();
|
||||||
|
SetMenuSounds (MENU_SOUND_NONE, MENU_SOUND_NONE);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
IP_frame ();
|
||||||
|
SleepThreadUntil (NextTime);
|
||||||
|
NextTime = GetTimeCounter () + IP_FRAME_RATE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (!(GLOBAL (CurrentActivity)
|
||||||
|
& (START_ENCOUNTER | END_INTERPLANETARY
|
||||||
|
| CHECK_ABORT | CHECK_LOAD))
|
||||||
|
&& GLOBAL_SIS (CrewEnlisted) != (COUNT)~0);
|
||||||
|
}
|
||||||
|
|||||||
@@ -23,9 +23,10 @@
|
|||||||
|
|
||||||
#define FIELD_WIDTH (STATUS_WIDTH - 5)
|
#define FIELD_WIDTH (STATUS_WIDTH - 5)
|
||||||
|
|
||||||
extern void Cargo (MENU_STATE *pMS);
|
extern void CargoMenu (void);
|
||||||
extern BOOLEAN Roster (void);
|
extern BOOLEAN RosterMenu (void);
|
||||||
extern BOOLEAN Devices (MENU_STATE *pMS);
|
extern BOOLEAN DevicesMenu (void);
|
||||||
|
extern BOOLEAN StarMap (void);
|
||||||
|
|
||||||
extern void DrawCargoStrings (BYTE OldElement, BYTE NewElement);
|
extern void DrawCargoStrings (BYTE OldElement, BYTE NewElement);
|
||||||
extern void ShowRemainingCapacity (void);
|
extern void ShowRemainingCapacity (void);
|
||||||
|
|||||||
@@ -1258,7 +1258,8 @@ ExitShipyard:
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (GameOptions () == 0)
|
// Clearing FlashRect is not necessary
|
||||||
|
if (!GameOptions ())
|
||||||
goto ExitShipyard;
|
goto ExitShipyard;
|
||||||
DrawMenuStateStrings (PM_CREW, pMS->CurState);
|
DrawMenuStateStrings (PM_CREW, pMS->CurState);
|
||||||
LockMutex (GraphicsLock);
|
LockMutex (GraphicsLock);
|
||||||
|
|||||||
@@ -253,6 +253,9 @@ while (--ac > 0)
|
|||||||
else if (GLOBAL (CurrentActivity) & START_INTERPLANETARY)
|
else if (GLOBAL (CurrentActivity) & START_INTERPLANETARY)
|
||||||
{
|
{
|
||||||
GLOBAL (CurrentActivity) = MAKE_WORD (IN_INTERPLANETARY, 0);
|
GLOBAL (CurrentActivity) = MAKE_WORD (IN_INTERPLANETARY, 0);
|
||||||
|
|
||||||
|
DrawAutoPilotMessage (TRUE);
|
||||||
|
SetGameClockRate (INTERPLANETARY_CLOCK_RATE);
|
||||||
ExploreSolarSys ();
|
ExploreSolarSys ();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -584,7 +584,6 @@ forAllMoons (STAR_DESC *star, SOLARSYS_STATE *system, PLANET_DESC *planet,
|
|||||||
COUNT i;
|
COUNT i;
|
||||||
|
|
||||||
assert(pSolarSysState == system);
|
assert(pSolarSysState == system);
|
||||||
assert(system->pBaseDesc == planet);
|
|
||||||
|
|
||||||
for (i = 0; i < planet->NumPlanets; i++)
|
for (i = 0; i < planet->NumPlanets; i++)
|
||||||
callback (star, system, planet, &system->MoonDesc[i], arg);
|
callback (star, system, planet, &system->MoonDesc[i], arg);
|
||||||
@@ -675,7 +674,6 @@ planetRecurse (STAR_DESC *star, SOLARSYS_STATE *system, PLANET_DESC *planet,
|
|||||||
assert(CurStarDescPtr == star);
|
assert(CurStarDescPtr == star);
|
||||||
assert(pSolarSysState == system);
|
assert(pSolarSysState == system);
|
||||||
|
|
||||||
system->pBaseDesc = planet;
|
|
||||||
planet->pPrevDesc = &system->SunDesc[0];
|
planet->pPrevDesc = &system->SunDesc[0];
|
||||||
|
|
||||||
if (universeRecurseArg->planetFuncPre != NULL)
|
if (universeRecurseArg->planetFuncPre != NULL)
|
||||||
@@ -723,7 +721,6 @@ moonRecurse (STAR_DESC *star, SOLARSYS_STATE *system, PLANET_DESC *planet,
|
|||||||
|
|
||||||
assert(CurStarDescPtr == star);
|
assert(CurStarDescPtr == star);
|
||||||
assert(pSolarSysState == system);
|
assert(pSolarSysState == system);
|
||||||
assert(system->pBaseDesc == planet);
|
|
||||||
|
|
||||||
moon->pPrevDesc = planet;
|
moon->pPrevDesc = planet;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user