Header and name cleanup: moved stuff around to relevant headers; removed some irrelevant #includes; better names

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3333 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
avolkov
2009-11-21 01:15:21 +00:00
parent e40d9499b2
commit 7d3e5b3511
52 changed files with 247 additions and 164 deletions
+1
View File
@@ -20,6 +20,7 @@
#include "races.h" #include "races.h"
#include "master.h" #include "master.h"
#include "sis.h"
#include "setup.h" #include "setup.h"
#include "libs/compiler.h" #include "libs/compiler.h"
#include "libs/mathlib.h" #include "libs/mathlib.h"
+2
View File
@@ -19,6 +19,8 @@
#include <stdlib.h> #include <stdlib.h>
#include "gameev.h" #include "gameev.h"
#include "globdata.h" #include "globdata.h"
#include "sis.h"
// for DrawStatusMessage()
#include "setup.h" #include "setup.h"
#include "libs/compiler.h" #include "libs/compiler.h"
#include "libs/gfxlib.h" #include "libs/gfxlib.h"
+1
View File
@@ -23,6 +23,7 @@
#include "colors.h" #include "colors.h"
#include "gamestr.h" #include "gamestr.h"
#include "setup.h" #include "setup.h"
#include "units.h"
#include "resinst.h" #include "resinst.h"
#include "nameref.h" #include "nameref.h"
#include "libs/graphics/widgets.h" #include "libs/graphics/widgets.h"
+2
View File
@@ -24,6 +24,8 @@
#include "commglue.h" #include "commglue.h"
#include "controls.h" #include "controls.h"
#include "colors.h" #include "colors.h"
#include "sis.h"
#include "units.h"
#include "encount.h" #include "encount.h"
#include "endian_uqm.h" #include "endian_uqm.h"
#include "gamestr.h" #include "gamestr.h"
+1
View File
@@ -18,6 +18,7 @@
#define _COMM_H #define _COMM_H
#include "globdata.h" #include "globdata.h"
#include "units.h"
#include "libs/compiler.h" #include "libs/compiler.h"
#include "libs/gfxlib.h" #include "libs/gfxlib.h"
#include "commglue.h" #include "commglue.h"
+2
View File
@@ -21,6 +21,8 @@
#include "strings.h" #include "strings.h"
#include "uqm/build.h" #include "uqm/build.h"
#include "uqm/hyper.h"
// for SOL_X/SOL_Y
static LOCDATA chmmr_desc = static LOCDATA chmmr_desc =
+2
View File
@@ -21,6 +21,8 @@
#include "strings.h" #include "strings.h"
#include "uqm/setup.h" #include "uqm/setup.h"
#include "uqm/sis.h"
// for DeltaSISGauges(), DrawLanders()
#include "libs/graphics/gfx_common.h" #include "libs/graphics/gfx_common.h"
static LOCDATA commander_desc = static LOCDATA commander_desc =
+2
View File
@@ -22,6 +22,8 @@
#include "uqm/build.h" #include "uqm/build.h"
#include "uqm/setup.h" #include "uqm/setup.h"
#include "uqm/sis.h"
// for DeltaSISGauges()
static LOCDATA druuge_desc = static LOCDATA druuge_desc =
+5 -2
View File
@@ -26,8 +26,11 @@
#include "libs/inplib.h" #include "libs/inplib.h"
#include "libs/mathlib.h" #include "libs/mathlib.h"
// XXX: temporary, for SOL_X/SOL_Y #include "uqm/hyper.h"
#include "uqm/races.h" // for SOL_X/SOL_Y
#include "uqm/planets/planets.h"
// for xxx_DISASTER
#include "uqm/sis.h"
#define NUM_HISTORY_ITEMS 9 #define NUM_HISTORY_ITEMS 9
+2
View File
@@ -23,6 +23,8 @@
#include "uqm/build.h" #include "uqm/build.h"
#include "uqm/setup.h" #include "uqm/setup.h"
#include "uqm/shipcont.h" #include "uqm/shipcont.h"
#include "uqm/sis.h"
// for DeltaSISGauges()
#include "libs/graphics/gfx_common.h" #include "libs/graphics/gfx_common.h"
#include "libs/mathlib.h" #include "libs/mathlib.h"
#include "libs/inplib.h" #include "libs/inplib.h"
+4
View File
@@ -22,6 +22,10 @@
#include "resinst.h" #include "resinst.h"
#include "nameref.h" #include "nameref.h"
#include "setup.h" #include "setup.h"
#include "units.h"
// for NUM_VIEWS
#include "planets/planets.h"
// for NUMBER_OF_PLANET_TYPES, PLANET_SHIELDED
static const char *planet_types[] = { static const char *planet_types[] = {
"oolite", "yttric", "quasidegenerate", "lanthanide", "treasure", "oolite", "yttric", "quasidegenerate", "lanthanide", "treasure",
+3
View File
@@ -24,9 +24,12 @@
#include "colors.h" #include "colors.h"
#include "cons_res.h" #include "cons_res.h"
#include "controls.h" #include "controls.h"
#include "menustat.h"
#include "gameopt.h" #include "gameopt.h"
#include "gamestr.h" #include "gamestr.h"
#include "globdata.h" #include "globdata.h"
#include "sis.h"
// for DrawStatusMessage(), SetStatusMessageMode()
#include "init.h" #include "init.h"
#include "pickship.h" #include "pickship.h"
#include "intel.h" #include "intel.h"
+3 -5
View File
@@ -20,21 +20,19 @@
#include "build.h" #include "build.h"
#include "colors.h" #include "colors.h"
#include "commglue.h"
// for CommData
#include "controls.h" #include "controls.h"
// XXX: for FindStart(), GetClusterName() // XXX: for FindStart(), GetClusterName()
#include "encount.h" #include "encount.h"
#include "planets/lander.h" #include "menustat.h"
#include "sis.h"
#include "units.h"
#include "gamestr.h" #include "gamestr.h"
#include "load.h" #include "load.h"
#include "options.h" #include "options.h"
#include "save.h" #include "save.h"
#include "starbase.h"
#include "settings.h" #include "settings.h"
#include "setup.h" #include "setup.h"
#include "sounds.h" #include "sounds.h"
#include "state.h"
#include "util.h" #include "util.h"
#include "libs/graphics/gfx_common.h" #include "libs/graphics/gfx_common.h"
+9 -7
View File
@@ -22,6 +22,8 @@
#include "encount.h" #include "encount.h"
#include "master.h" #include "master.h"
#include "setup.h" #include "setup.h"
#include "units.h"
#include "hyper.h"
#include "resinst.h" #include "resinst.h"
#include "nameref.h" #include "nameref.h"
#include "build.h" #include "build.h"
@@ -42,7 +44,7 @@ FRAME PlayFrame;
GLOBDATA GlobData; GLOBDATA GlobData;
BOOLEAN initedSIS = 0; static BOOLEAN initedGameStructs = FALSE;
BYTE BYTE
@@ -184,7 +186,7 @@ copyFleetInfo (FLEET_INFO *dst, SHIP_INFO *src, FLEET_STUFF *fleet)
} }
BOOLEAN BOOLEAN
InitSIS (void) InitGameStructures (void)
{ {
COUNT i; COUNT i;
@@ -351,8 +353,8 @@ InitSIS (void)
* than once, as you can't remove the atexit function (when the full game * than once, as you can't remove the atexit function (when the full game
* ends). * ends).
*/ */
initedSIS = TRUE; initedGameStructs = TRUE;
atexit (UninitSIS); atexit (UninitGameStructures);
return (TRUE); return (TRUE);
} }
@@ -371,11 +373,11 @@ FreeSC2Data (void)
} }
void void
UninitSIS (void) UninitGameStructures (void)
{ {
HFLEETINFO hStarShip; HFLEETINFO hStarShip;
if (!initedSIS) if (!initedGameStructs)
return; return;
UninitQueue (&GLOBAL (encounter_q)); UninitQueue (&GLOBAL (encounter_q));
@@ -405,7 +407,7 @@ UninitSIS (void)
DestroyDrawable (ReleaseDrawable (PlayFrame)); DestroyDrawable (ReleaseDrawable (PlayFrame));
PlayFrame = 0; PlayFrame = 0;
initedSIS = FALSE; initedGameStructs = FALSE;
} }
void void
+5 -1
View File
@@ -22,6 +22,7 @@
#include "clock.h" #include "clock.h"
#include "libs/gfxlib.h" #include "libs/gfxlib.h"
#include "libs/reslib.h" #include "libs/reslib.h"
#include "libs/sndlib.h"
#include "sis.h" #include "sis.h"
#include "velocity.h" #include "velocity.h"
#include "commanim.h" #include "commanim.h"
@@ -961,6 +962,7 @@ extern GLOBDATA GlobData;
#define GLOBAL_SIS(f) GlobData.SIS_state.f #define GLOBAL_SIS(f) GlobData.SIS_state.f
#define MAX_ENCOUNTERS 16 #define MAX_ENCOUNTERS 16
#define MAX_BATTLE_GROUPS 32
//#define STATE_DEBUG //#define STATE_DEBUG
@@ -1002,8 +1004,10 @@ extern CONTEXT RadarContext;
extern void FreeSC2Data (void); extern void FreeSC2Data (void);
extern BOOLEAN LoadSC2Data (void); extern BOOLEAN LoadSC2Data (void);
void InitGlobData (void); extern void InitGlobData (void);
extern BOOLEAN InitGameStructures (void);
extern void UninitGameStructures (void);
#endif /* _GLOBDATA_H */ #endif /* _GLOBDATA_H */
-1
View File
@@ -22,7 +22,6 @@
#include "libs/file.h" #include "libs/file.h"
#include "globdata.h" #include "globdata.h"
#include "intel.h" #include "intel.h"
#include "sis.h"
#include "state.h" #include "state.h"
#include "grpinfo.h" #include "grpinfo.h"
+3
View File
@@ -24,6 +24,9 @@
// for POINT // for POINT
#include <assert.h> #include <assert.h>
// XXX: Needed to maintain savegame compatibility
#define NUM_SAVED_BATTLE_GROUPS 64
typedef HLINK HIPGROUP; typedef HLINK HIPGROUP;
typedef struct typedef struct
+5 -1
View File
@@ -22,10 +22,14 @@
#include "collide.h" #include "collide.h"
#include "colors.h" #include "colors.h"
#include "controls.h" #include "controls.h"
#include "menustat.h"
// for DrawMenuStateStrings()
#include "encount.h" #include "encount.h"
#include "ship.h" #include "ship.h"
#include "process.h" #include "process.h"
#include "globdata.h" #include "globdata.h"
#include "sis.h"
#include "units.h"
#include "init.h" #include "init.h"
#include "nameref.h" #include "nameref.h"
#include "resinst.h" #include "resinst.h"
@@ -1595,7 +1599,7 @@ SeedUniverse (void)
} }
void void
DoMenuOptions (void) HyperspaceMenu (void)
{ {
COLOR OldColor; COLOR OldColor;
CONTEXT OldContext; CONTEXT OldContext;
+32
View File
@@ -20,10 +20,42 @@
#define _HYPER_H #define _HYPER_H
#include "element.h" #include "element.h"
#include "units.h"
// for UNIT_SCREEN_WIDTH/HEIGHT
#define NUM_RADAR_SCREENS 12
#define RADAR_SCAN_WIDTH (UNIT_SCREEN_WIDTH * NUM_RADAR_SCREENS)
#define RADAR_SCAN_HEIGHT (UNIT_SCREEN_HEIGHT * NUM_RADAR_SCREENS)
// Hyperspace coordinates of the naturally occuring portal into QuasiSpace
#define ARILOU_SPACE_X 438
#define ARILOU_SPACE_Y 6372
// QuasiSpace coordinates of the same portal
#define QUASI_SPACE_X 5000
#define QUASI_SPACE_Y 5000
// QuasiSpace coordinates of the Arilou home world
#define ARILOU_HOME_X (QUASI_SPACE_X + ((RADAR_SCAN_WIDTH >> 1) * 3))
#define ARILOU_HOME_Y (QUASI_SPACE_Y + ((RADAR_SCAN_HEIGHT >> 1) * 3))
// Hyperspace coordinates of the Sol system
// Should be the same as in plandata.c
#define SOL_X 1752
#define SOL_Y 1450
extern BOOLEAN LoadHyperspace (void);
extern BOOLEAN FreeHyperspace (void);
extern void SeedUniverse (void);
extern void MoveSIS (SIZE *pdx, SIZE *pdy);
extern void FreeHyperData (void); extern void FreeHyperData (void);
extern void check_hyperspace_encounter (void); extern void check_hyperspace_encounter (void);
extern BOOLEAN hyper_transition (ELEMENT *ElementPtr); extern BOOLEAN hyper_transition (ELEMENT *ElementPtr);
extern void HyperspaceMenu (void);
#endif /* _HYPER_H */ #endif /* _HYPER_H */
+1
View File
@@ -25,6 +25,7 @@
#include "pickship.h" #include "pickship.h"
#include "process.h" #include "process.h"
#include "globdata.h" #include "globdata.h"
#include "hyper.h"
#include "init.h" #include "init.h"
#include "port.h" #include "port.h"
#include "resinst.h" #include "resinst.h"
+2
View File
@@ -19,6 +19,8 @@
#include "controls.h" #include "controls.h"
#include "options.h" #include "options.h"
#include "settings.h" #include "settings.h"
#include "globdata.h"
#include "sis.h"
#include "setup.h" #include "setup.h"
#include "sounds.h" #include "sounds.h"
#include "fmv.h" #include "fmv.h"
+1
View File
@@ -18,6 +18,7 @@
#define _LOAD_H #define _LOAD_H
#include "sis.h" #include "sis.h"
// for SUMMARY_DESC
#include "libs/compiler.h" #include "libs/compiler.h"
#include "globdata.h" #include "globdata.h"
+2
View File
@@ -46,6 +46,8 @@
#include "setup.h" #include "setup.h"
#include "sounds.h" #include "sounds.h"
#include "util.h" #include "util.h"
#include "planets/planets.h"
// for NUMBER_OF_PLANET_TYPES
#include "libs/graphics/drawable.h" #include "libs/graphics/drawable.h"
#include "libs/gfxlib.h" #include "libs/gfxlib.h"
#include "libs/mathlib.h" #include "libs/mathlib.h"
+3
View File
@@ -16,8 +16,11 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include "menustat.h"
#include "colors.h" #include "colors.h"
#include "controls.h" #include "controls.h"
#include "units.h"
#include "options.h" #include "options.h"
#include "setup.h" #include "setup.h"
#include "gamestr.h" #include "gamestr.h"
+71 -1
View File
@@ -48,6 +48,76 @@ typedef struct menu_state
void *Extra; void *Extra;
} MENU_STATE; } MENU_STATE;
// XXX: Should probably go to menu.h (does not yet exist)
enum
{
PM_SCAN = 0,
PM_STARMAP,
PM_DEVICES,
PM_CARGO,
PM_ROSTER,
PM_SAVE_LOAD0,
PM_NAVIGATE,
PM_MIN_SCAN,
PM_ENE_SCAN,
PM_BIO_SCAN,
PM_EXIT_MENU0,
PM_AUTO_SCAN,
PM_LAUNCH_LANDER,
PM_SAVE_GAME,
PM_LOAD_GAME,
PM_QUIT_GAME,
PM_CHANGE_SETTINGS,
PM_EXIT_MENU1,
PM_CONVERSE,
PM_ATTACK,
PM_SAVE_LOAD1,
PM_FUEL,
PM_MODULE,
PM_SAVE_LOAD2,
PM_EXIT_MENU2,
PM_CREW,
PM_SAVE_LOAD3,
PM_EXIT_MENU3,
PM_SOUND_ON,
PM_SOUND_OFF,
PM_MUSIC_ON,
PM_MUSIC_OFF,
PM_CYBORG_OFF,
PM_CYBORG_NORMAL,
PM_CYBORG_DOUBLE,
PM_CYBORG_SUPER,
PM_CHANGE_CAPTAIN,
PM_CHANGE_SHIP,
PM_EXIT_MENU4,
PM_ALT_SCAN,
PM_ALT_STARMAP,
PM_ALT_MANIFEST,
PM_ALT_SAVE0,
PM_ALT_NAVIGATE,
PM_ALT_CARGO,
PM_ALT_DEVICES,
PM_ALT_ROSTER,
PM_ALT_EXITMENU0,
PM_ALT_MSCAN,
PM_ALT_ESCAN,
PM_ALT_BSCAN,
PM_ALT_ASCAN,
PM_ALT_DISPATCH,
PM_ALT_EXITMENU1
};
extern BOOLEAN DoMenuChooser (MENU_STATE *pMS, BYTE BaseState);
extern void DrawMenuStateStrings (BYTE beg_index, SWORD NewState);
#endif /* _MENUSTAT_H */ #endif /* _MENUSTAT_H */
+3 -1
View File
@@ -18,7 +18,9 @@
#include "oscill.h" #include "oscill.h"
#include "sis.h" // XXX: we should not refer to units.h here because we should not be
// using RADAR_WIDTH constants!
#include "units.h"
#include "libs/graphics/gfx_common.h" #include "libs/graphics/gfx_common.h"
#include "libs/graphics/drawable.h" #include "libs/graphics/drawable.h"
#include "libs/sound/sound.h" #include "libs/sound/sound.h"
+4
View File
@@ -19,6 +19,7 @@
#include "options.h" #include "options.h"
#include "colors.h" #include "colors.h"
#include "controls.h" #include "controls.h"
#include "menustat.h"
#include "gameopt.h" #include "gameopt.h"
#include "gamestr.h" #include "gamestr.h"
#include "resinst.h" #include "resinst.h"
@@ -27,7 +28,10 @@
#include "starbase.h" #include "starbase.h"
#include "setup.h" #include "setup.h"
#include "sis.h" #include "sis.h"
#include "units.h"
#include "sounds.h" #include "sounds.h"
#include "planets/planets.h"
// for xxx_DISASTER
#include "libs/graphics/gfx_common.h" #include "libs/graphics/gfx_common.h"
+1
View File
@@ -21,6 +21,7 @@
#include "build.h" #include "build.h"
#include "colors.h" #include "colors.h"
#include "controls.h" #include "controls.h"
#include "menustat.h"
#include "pickmele.h" #include "pickmele.h"
#include "battle.h" #include "battle.h"
#include "races.h" #include "races.h"
+3
View File
@@ -23,6 +23,9 @@
#include "../setup.h" #include "../setup.h"
#include "../sounds.h" #include "../sounds.h"
#include "../util.h" #include "../util.h"
#include "../sis.h"
// for ClearSISRect(), DrawStatusMessage()
#include "planets.h"
void void
+2
View File
@@ -25,6 +25,8 @@
#include "../load.h" #include "../load.h"
#include "../setup.h" #include "../setup.h"
#include "../state.h" #include "../state.h"
#include "../sis.h"
// for ClearSISRect(), SaveFlagshipState()
#include "../grpinfo.h" #include "../grpinfo.h"
#include "../sounds.h" #include "../sounds.h"
#include "../util.h" #include "../util.h"
+1
View File
@@ -26,6 +26,7 @@
// XXX: for CurStarDescPtr and XXX_DEFINED // XXX: for CurStarDescPtr and XXX_DEFINED
#include "../encount.h" #include "../encount.h"
#include "../process.h" #include "../process.h"
#include "../units.h"
#include "../gamestr.h" #include "../gamestr.h"
#include "../nameref.h" #include "../nameref.h"
#include "../resinst.h" #include "../resinst.h"
+3
View File
@@ -27,6 +27,9 @@
#include "../element.h" #include "../element.h"
// Surface magnification shift (x4)
#define MAG_SHIFT 2
#define NUM_TEXT_FRAMES 32 #define NUM_TEXT_FRAMES 32
typedef struct typedef struct
+2
View File
@@ -16,6 +16,8 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include "planets.h"
#include "scan.h" #include "scan.h"
#include "lander.h" #include "lander.h"
#include "../element.h" #include "../element.h"
+5
View File
@@ -19,6 +19,7 @@
#include "scan.h" #include "scan.h"
#include "../colors.h" #include "../colors.h"
#include "../controls.h" #include "../controls.h"
#include "../menustat.h"
// XXX: for stuff that does not belong there // XXX: for stuff that does not belong there
#include "../encount.h" #include "../encount.h"
#include "../races.h" #include "../races.h"
@@ -26,6 +27,10 @@
#include "../gamestr.h" #include "../gamestr.h"
#include "../globdata.h" #include "../globdata.h"
#include "../shipcont.h" #include "../shipcont.h"
#include "../units.h"
#include "../hyper.h"
#include "../sis.h"
// for DrawHyperCoords(), DrawStatusMessage()
#include "../settings.h" #include "../settings.h"
#include "../setup.h" #include "../setup.h"
#include "../sounds.h" #include "../sounds.h"
+4 -2
View File
@@ -20,6 +20,8 @@
#include "../colors.h" #include "../colors.h"
#include "../controls.h" #include "../controls.h"
#include "../races.h" #include "../races.h"
#include "../units.h"
#include "../sis.h"
#include "../shipcont.h" #include "../shipcont.h"
#include "../setup.h" #include "../setup.h"
#include "../sounds.h" #include "../sounds.h"
@@ -30,7 +32,7 @@
#include <stdlib.h> #include <stdlib.h>
// Ship icon positions in status display around the flagship // Ship icon positions in status display around the flagship
static const POINT ship_pos[MAX_COMBAT_SHIPS] = static const POINT ship_pos[MAX_BUILT_SHIPS] =
{ {
SUPPORT_SHIP_PTS SUPPORT_SHIP_PTS
}; };
@@ -38,7 +40,7 @@ static const POINT ship_pos[MAX_COMBAT_SHIPS] =
// Ship icon positions split into (lower half) left and right (upper) // Ship icon positions split into (lower half) left and right (upper)
// and sorted in the Y coord. These are used for navigation around the // and sorted in the Y coord. These are used for navigation around the
// escort positions. // escort positions.
static POINT sorted_ship_pos[MAX_COMBAT_SHIPS]; static POINT sorted_ship_pos[MAX_BUILT_SHIPS];
static SHIP_FRAGMENT* LockSupportShip (MENU_STATE *pMS, HSHIPFRAG *phFrag); static SHIP_FRAGMENT* LockSupportShip (MENU_STATE *pMS, HSHIPFRAG *phFrag);
+2
View File
@@ -21,6 +21,7 @@
#include "../build.h" #include "../build.h"
#include "../cons_res.h" #include "../cons_res.h"
#include "../controls.h" #include "../controls.h"
#include "../menustat.h"
#include "../encount.h" #include "../encount.h"
// for EncounterGroup // for EncounterGroup
#include "../gamestr.h" #include "../gamestr.h"
@@ -33,6 +34,7 @@
#include "../setup.h" #include "../setup.h"
#include "../sounds.h" #include "../sounds.h"
#include "../state.h" #include "../state.h"
#include "../sis.h"
#include "options.h" #include "options.h"
#include "libs/graphics/gfx_common.h" #include "libs/graphics/gfx_common.h"
#include "libs/graphics/drawable.h" #include "libs/graphics/drawable.h"
+1 -5
View File
@@ -19,8 +19,8 @@
#ifndef _SCAN_H #ifndef _SCAN_H
#define _SCAN_H #define _SCAN_H
#include "libs/compiler.h"
#include "libs/gfxlib.h" #include "libs/gfxlib.h"
#include "../menustat.h"
typedef struct typedef struct
@@ -39,10 +39,6 @@ typedef struct
SCAN_DESC *scan_base; SCAN_DESC *scan_base;
} SCAN_BLOCK; } SCAN_BLOCK;
#define SAME_SCAN (1 << 16)
#define SCALED_ROOT_TWO 92682L /* root 2 * (1 << 16) */
#define SCALE_FACTOR 16
extern void RepairBackRect (RECT *pRect); extern void RepairBackRect (RECT *pRect);
extern void GeneratePlanetSide (void); extern void GeneratePlanetSide (void);
+3
View File
@@ -19,10 +19,13 @@
#include "lander.h" #include "lander.h"
#include "../colors.h" #include "../colors.h"
#include "../controls.h" #include "../controls.h"
#include "../menustat.h"
// for DrawMenuStateStrings()
#include "../encount.h" #include "../encount.h"
#include "../races.h" #include "../races.h"
#include "../gamestr.h" #include "../gamestr.h"
#include "../globdata.h" #include "../globdata.h"
#include "../sis.h"
#include "../init.h" #include "../init.h"
#include "../nameref.h" #include "../nameref.h"
#include "../resinst.h" #include "../resinst.h"
+1
View File
@@ -24,6 +24,7 @@
#include "settings.h" #include "settings.h"
#include "setup.h" #include "setup.h"
#include "sounds.h" #include "sounds.h"
#include "hyper.h"
#include "element.h" #include "element.h"
#include "battle.h" #include "battle.h"
#include "weapon.h" #include "weapon.h"
-20
View File
@@ -664,25 +664,5 @@ enum
BUILD_COLOR (MAKE_RGB15 (0x06, 0x06, 0x06), 0x20), /* BLACK_URQUAN_SHIP */ \ BUILD_COLOR (MAKE_RGB15 (0x06, 0x06, 0x06), 0x20), /* BLACK_URQUAN_SHIP */ \
BUILD_COLOR (MAKE_RGB15 (0x14, 0x07, 0x1F), 0x39), /* YEHAT_REBEL_SHIP */ BUILD_COLOR (MAKE_RGB15 (0x14, 0x07, 0x1F), 0x39), /* YEHAT_REBEL_SHIP */
#define RADAR_SCAN_WIDTH (UNIT_SCREEN_WIDTH * NUM_RADAR_SCREENS)
#define RADAR_SCAN_HEIGHT (UNIT_SCREEN_HEIGHT * NUM_RADAR_SCREENS)
// Hyperspace coordinates of the naturally occuring portal into QuasiSpace
#define ARILOU_SPACE_X 438
#define ARILOU_SPACE_Y 6372
// QuasiSpace coordinates of the same portal
#define QUASI_SPACE_X 5000
#define QUASI_SPACE_Y 5000
// QuasiSpace coordinates of the Arilou home world
#define ARILOU_HOME_X (QUASI_SPACE_X + ((RADAR_SCAN_WIDTH >> 1) * 3))
#define ARILOU_HOME_Y (QUASI_SPACE_Y + ((RADAR_SCAN_HEIGHT >> 1) * 3))
// Hyperspace coordinates of the Sol system
// Should be the same as in plandata.c
#define SOL_X 1752
#define SOL_Y 1450
#endif /* _RACES_H */ #endif /* _RACES_H */
+1
View File
@@ -24,6 +24,7 @@
// XXX: for star_array[] // XXX: for star_array[]
#include "encount.h" #include "encount.h"
#include "fmv.h" #include "fmv.h"
#include "menustat.h"
#include "gamestr.h" #include "gamestr.h"
#include "globdata.h" #include "globdata.h"
#include "intel.h" #include "intel.h"
+1
View File
@@ -18,6 +18,7 @@
#define _SAVE_H #define _SAVE_H
#include "sis.h" #include "sis.h"
// for SUMMARY_DESC
#include "libs/compiler.h" #include "libs/compiler.h"
extern void SaveProblem (void); extern void SaveProblem (void);
+2 -1
View File
@@ -22,6 +22,7 @@
#include "uqm/colors.h" #include "uqm/colors.h"
#include "uqm/controls.h" #include "uqm/controls.h"
#include "uqm/globdata.h" #include "uqm/globdata.h"
#include "uqm/hyper.h"
#include "libs/mathlib.h" #include "libs/mathlib.h"
@@ -303,7 +304,7 @@ sis_hyper_postprocess (ELEMENT *ElementPtr)
&& StarShipPtr->special_counter == 0) && StarShipPtr->special_counter == 0)
{ {
#define MENU_DELAY 10 #define MENU_DELAY 10
DoMenuOptions (); HyperspaceMenu ();
StarShipPtr->cur_status_flags &= ~SHIP_AT_MAX_SPEED; StarShipPtr->cur_status_flags &= ~SHIP_AT_MAX_SPEED;
StarShipPtr->special_counter = MENU_DELAY; StarShipPtr->special_counter = MENU_DELAY;
} }
+3 -2
View File
@@ -19,6 +19,7 @@
#include "build.h" #include "build.h"
#include "colors.h" #include "colors.h"
#include "controls.h" #include "controls.h"
#include "menustat.h"
#include "fmv.h" #include "fmv.h"
#include "gameopt.h" #include "gameopt.h"
#include "gamestr.h" #include "gamestr.h"
@@ -32,8 +33,8 @@
#include "starbase.h" #include "starbase.h"
#include "setup.h" #include "setup.h"
#include "sis.h" #include "sis.h"
#include "units.h"
#include "sounds.h" #include "sounds.h"
#include "state.h"
#include "libs/graphics/gfx_common.h" #include "libs/graphics/gfx_common.h"
#include "libs/inplib.h" #include "libs/inplib.h"
@@ -296,7 +297,7 @@ ShowCombatShip (MENU_STATE *pMS, COUNT which_window,
SHIP_FRAGMENT *StarShipPtr; SHIP_FRAGMENT *StarShipPtr;
POINT finished_s; POINT finished_s;
STAMP ship_s, lfdoor_s, rtdoor_s; STAMP ship_s, lfdoor_s, rtdoor_s;
} ship_win_info[MAX_COMBAT_SHIPS], *pship_win_info; } ship_win_info[MAX_BUILT_SHIPS], *pship_win_info;
num_ships = 1; num_ships = 1;
pship_win_info = &ship_win_info[0]; pship_win_info = &ship_win_info[0];
+6 -2
View File
@@ -16,13 +16,17 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include "sis.h"
#include "colors.h" #include "colors.h"
#include "races.h" #include "races.h"
// XXX: including encount.h for stuff that does not belong there // XXX: including encount.h for stuff that does not belong there
#include "encount.h" #include "encount.h"
#include "units.h"
#include "menustat.h"
// for DrawMenuStateStrings()
#include "gamestr.h" #include "gamestr.h"
#include "options.h" #include "options.h"
#include "starbase.h"
#include "battle.h" #include "battle.h"
// For BATTLE_FRAME_RATE // For BATTLE_FRAME_RATE
#include "element.h" #include "element.h"
@@ -941,7 +945,7 @@ DeltaSISGauges (SIZE crew_delta, SIZE fuel_delta, int resunit_delta)
{ {
HSHIPFRAG hStarShip, hNextShip; HSHIPFRAG hStarShip, hNextShip;
POINT *pship_pos; POINT *pship_pos;
POINT ship_pos[MAX_COMBAT_SHIPS] = POINT ship_pos[MAX_BUILT_SHIPS] =
{ {
SUPPORT_SHIP_PTS SUPPORT_SHIP_PTS
}; };
+4 -108
View File
@@ -1,90 +1,16 @@
#ifndef _SIS_H #ifndef _SIS_H
#define _SIS_H #define _SIS_H
#include "planets/planets.h" #include "libs/compiler.h"
#include "libs/gfxlib.h"
enum #include "planets/elemdata.h"
{ // for NUM_ELEMENT_CATEGORIES
PM_SCAN = 0,
PM_STARMAP,
PM_DEVICES,
PM_CARGO,
PM_ROSTER,
PM_SAVE_LOAD0,
PM_NAVIGATE,
PM_MIN_SCAN,
PM_ENE_SCAN,
PM_BIO_SCAN,
PM_EXIT_MENU0,
PM_AUTO_SCAN,
PM_LAUNCH_LANDER,
PM_SAVE_GAME,
PM_LOAD_GAME,
PM_QUIT_GAME,
PM_CHANGE_SETTINGS,
PM_EXIT_MENU1,
PM_CONVERSE,
PM_ATTACK,
PM_SAVE_LOAD1,
PM_FUEL,
PM_MODULE,
PM_SAVE_LOAD2,
PM_EXIT_MENU2,
PM_CREW,
PM_SAVE_LOAD3,
PM_EXIT_MENU3,
PM_SOUND_ON,
PM_SOUND_OFF,
PM_MUSIC_ON,
PM_MUSIC_OFF,
PM_CYBORG_OFF,
PM_CYBORG_NORMAL,
PM_CYBORG_DOUBLE,
PM_CYBORG_SUPER,
PM_CHANGE_CAPTAIN,
PM_CHANGE_SHIP,
PM_EXIT_MENU4,
PM_ALT_SCAN,
PM_ALT_STARMAP,
PM_ALT_MANIFEST,
PM_ALT_SAVE0,
PM_ALT_NAVIGATE,
PM_ALT_CARGO,
PM_ALT_DEVICES,
PM_ALT_ROSTER,
PM_ALT_EXITMENU0,
PM_ALT_MSCAN,
PM_ALT_ESCAN,
PM_ALT_BSCAN,
PM_ALT_ASCAN,
PM_ALT_DISPATCH,
PM_ALT_EXITMENU1
};
#define CLEAR_SIS_RADAR (1 << 2) #define CLEAR_SIS_RADAR (1 << 2)
#define DRAW_SIS_DISPLAY (1 << 3) #define DRAW_SIS_DISPLAY (1 << 3)
#define UNDEFINED_DELTA 0x7FFF #define UNDEFINED_DELTA 0x7FFF
#define RADAR_X (4 + (SCREEN_WIDTH - STATUS_WIDTH - SAFE_X))
#define RADAR_WIDTH (STATUS_WIDTH - 8)
#define RADAR_HEIGHT 53
#define RADAR_Y (SIS_ORG_Y + SIS_SCREEN_HEIGHT - RADAR_HEIGHT)
#define NUM_RADAR_SCREENS 12
#define MAG_SHIFT 2 /* driving on planet */
#define SHIP_NAME_WIDTH 60
#define SHIP_NAME_HEIGHT 7
#define NUM_DRIVE_SLOTS 11 #define NUM_DRIVE_SLOTS 11
#define NUM_JET_SLOTS 8 #define NUM_JET_SLOTS 8
#define NUM_MODULE_SLOTS 16 #define NUM_MODULE_SLOTS 16
@@ -105,18 +31,10 @@ enum
#define FUEL_VOLUME_PER_ROW (HEFUEL_TANK_CAPACITY / MAX_FUEL_BARS) #define FUEL_VOLUME_PER_ROW (HEFUEL_TANK_CAPACITY / MAX_FUEL_BARS)
#define FUEL_RESERVE FUEL_VOLUME_PER_ROW #define FUEL_RESERVE FUEL_VOLUME_PER_ROW
#define MAX_COMBAT_SHIPS 12
#define MAX_BATTLE_GROUPS 32
// XXX: Needed to maintain savegame compatibility
#define NUM_SAVED_BATTLE_GROUPS 64
#define IP_SHIP_THRUST_INCREMENT 8 #define IP_SHIP_THRUST_INCREMENT 8
#define IP_SHIP_TURN_WAIT 17 #define IP_SHIP_TURN_WAIT 17
#define IP_SHIP_TURN_DECREMENT 2 #define IP_SHIP_TURN_DECREMENT 2
#define BOGUS_MASS 5
#define BIO_CREDIT_VALUE 2 #define BIO_CREDIT_VALUE 2
enum enum
@@ -189,17 +107,6 @@ enum
{3 + 0, 30 + (5 * 16)}, \ {3 + 0, 30 + (5 * 16)}, \
{3 + 42, 30 + (5 * 16)}, {3 + 42, 30 + (5 * 16)},
#define SIS_TITLE_BOX_WIDTH 57
#define SIS_TITLE_WIDTH (SIS_TITLE_BOX_WIDTH - 2)
#define SIS_TITLE_HEIGHT 8
#define SIS_SPACER_BOX_WIDTH 12
#define SIS_MESSAGE_BOX_WIDTH (SIS_SCREEN_WIDTH - SIS_TITLE_BOX_WIDTH \
- SIS_SPACER_BOX_WIDTH)
#define SIS_MESSAGE_WIDTH (SIS_MESSAGE_BOX_WIDTH - 2)
#define SIS_MESSAGE_HEIGHT SIS_TITLE_HEIGHT
#define STATUS_MESSAGE_WIDTH (STATUS_WIDTH - 4)
#define STATUS_MESSAGE_HEIGHT 7
#define SIS_NAME_SIZE 16 #define SIS_NAME_SIZE 16
typedef struct typedef struct
@@ -250,13 +157,6 @@ typedef struct
#define OVERRIDE_LANDER_FLAGS (1 << 7) #define OVERRIDE_LANDER_FLAGS (1 << 7)
#define AFTER_BOMB_INSTALLED (1 << 7) #define AFTER_BOMB_INSTALLED (1 << 7)
extern BOOLEAN InitSIS (void);
extern void UninitSIS (void);
extern void SeedUniverse (void);
extern BOOLEAN LoadHyperspace (void);
extern BOOLEAN FreeHyperspace (void);
extern void MoveSIS (SIZE *pdx, SIZE *pdy);
extern void RepairSISBorder (void); extern void RepairSISBorder (void);
extern void InitSISContexts (void); extern void InitSISContexts (void);
extern void DrawSISFrame (void); extern void DrawSISFrame (void);
@@ -274,7 +174,6 @@ extern BOOLEAN DrawSISMessageEx (const UNICODE *pStr, SIZE CurPos,
#define DSME_BLOCKCUR (1 << 2) #define DSME_BLOCKCUR (1 << 2)
#define DSME_MYCOLOR (1 << 3) #define DSME_MYCOLOR (1 << 3)
extern void DrawSISMessage (const UNICODE *pStr); extern void DrawSISMessage (const UNICODE *pStr);
extern void DrawGameDate (void);
extern void DateToString (unsigned char *buf, size_t bufLen, extern void DateToString (unsigned char *buf, size_t bufLen,
BYTE month_index, BYTE day_index, COUNT year_index); BYTE month_index, BYTE day_index, COUNT year_index);
@@ -307,9 +206,6 @@ extern COUNT GetSBayCapacity (POINT *ppt);
extern DWORD GetFTankCapacity (POINT *ppt); extern DWORD GetFTankCapacity (POINT *ppt);
extern COUNT CountSISPieces (BYTE piece_type); extern COUNT CountSISPieces (BYTE piece_type);
extern BOOLEAN DoMenuChooser (MENU_STATE *pMS, BYTE BaseState);
extern void DrawMenuStateStrings (BYTE beg_index, SWORD NewState);
extern void DoMenuOptions (void);
extern void DrawFlagshipName (BOOLEAN InStatusArea); extern void DrawFlagshipName (BOOLEAN InStatusArea);
extern void DrawCaptainsName (void); extern void DrawCaptainsName (void);
+1
View File
@@ -25,6 +25,7 @@
#include "gamestr.h" #include "gamestr.h"
#include "load.h" #include "load.h"
#include "starbase.h" #include "starbase.h"
#include "sis.h"
#include "resinst.h" #include "resinst.h"
#include "nameref.h" #include "nameref.h"
#include "settings.h" #include "settings.h"
-3
View File
@@ -44,8 +44,5 @@ extern COUNT WrapText (const UNICODE *pStr, COUNT len, TEXT *tarray, SIZE
field_width); field_width);
// XXX: Doesn't really belong in this file. // XXX: Doesn't really belong in this file.
extern const char starbase_str_array[][20];
#endif /* _STARBASE_H */ #endif /* _STARBASE_H */
+8 -2
View File
@@ -32,6 +32,12 @@
#include "master.h" #include "master.h"
#include "controls.h" #include "controls.h"
#include "starcon.h" #include "starcon.h"
#include "clock.h"
// for GameClockTick()
#include "hyper.h"
// for SeedUniverse()
#include "planets/planets.h"
// for ExploreSolarSys()
#include "uqmdebug.h" #include "uqmdebug.h"
#include "libs/tasklib.h" #include "libs/tasklib.h"
#include "libs/log.h" #include "libs/log.h"
@@ -191,7 +197,7 @@ while (--ac > 0)
log_add (log_Fatal, "Could not set player input."); log_add (log_Fatal, "Could not set player input.");
explode (); // Does not return; explode (); // Does not return;
} }
InitSIS (); InitGameStructures ();
InitGameClock (); InitGameClock ();
AddInitialGameEvents(); AddInitialGameEvents();
@@ -281,7 +287,7 @@ while (--ac > 0)
StopSound (); StopSound ();
UninitGameClock (); UninitGameClock ();
UninitSIS (); UninitGameStructures ();
ClearPlayerInputAll (); ClearPlayerInputAll ();
} }
// CloseJournal (); // CloseJournal ();
+20
View File
@@ -44,7 +44,25 @@ extern int ScreenHeight;
/* Width of the usable part of the space "window" */ /* Width of the usable part of the space "window" */
#define SIS_SCREEN_HEIGHT (SPACE_HEIGHT - 13) #define SIS_SCREEN_HEIGHT (SPACE_HEIGHT - 13)
/* Height of the usable part of the space "window" */ /* Height of the usable part of the space "window" */
#define RADAR_X (4 + (SCREEN_WIDTH - STATUS_WIDTH - SAFE_X))
#define RADAR_WIDTH (STATUS_WIDTH - 8)
#define RADAR_HEIGHT 53
#define RADAR_Y (SIS_ORG_Y + SIS_SCREEN_HEIGHT - RADAR_HEIGHT)
#define SIS_TITLE_BOX_WIDTH 57
#define SIS_TITLE_WIDTH (SIS_TITLE_BOX_WIDTH - 2)
#define SIS_TITLE_HEIGHT 8
#define SIS_SPACER_BOX_WIDTH 12
#define SIS_MESSAGE_BOX_WIDTH (SIS_SCREEN_WIDTH - SIS_TITLE_BOX_WIDTH \
- SIS_SPACER_BOX_WIDTH)
#define SIS_MESSAGE_WIDTH (SIS_MESSAGE_BOX_WIDTH - 2)
#define SIS_MESSAGE_HEIGHT SIS_TITLE_HEIGHT
#define STATUS_MESSAGE_WIDTH (STATUS_WIDTH - 4)
#define STATUS_MESSAGE_HEIGHT 7
#define SHIP_NAME_WIDTH (STATUS_WIDTH - 4)
#define SHIP_NAME_HEIGHT 7
#define MAX_REDUCTION 3 #define MAX_REDUCTION 3
#define MAX_VIS_REDUCTION 2 #define MAX_VIS_REDUCTION 2
@@ -87,6 +105,8 @@ extern int ScreenHeight;
#define MAX_FLEET_STRENGTH (254 * SPHERE_RADIUS_INCREMENT) #define MAX_FLEET_STRENGTH (254 * SPHERE_RADIUS_INCREMENT)
// XXX: These corrected for the weird screen aspect ratio on DOS
// In part because of them, hyperflight is slower vertically
#define UNIT_SCREEN_WIDTH 63 #define UNIT_SCREEN_WIDTH 63
#define UNIT_SCREEN_HEIGHT 50 #define UNIT_SCREEN_HEIGHT 50
+1
View File
@@ -24,6 +24,7 @@
#include "clock.h" #include "clock.h"
#include "encount.h" #include "encount.h"
#include "element.h" #include "element.h"
#include "sis.h"
#include "status.h" #include "status.h"
#include "gamestr.h" #include "gamestr.h"
#include "gameev.h" #include "gameev.h"
+1
View File
@@ -19,6 +19,7 @@
#include "controls.h" #include "controls.h"
#include "util.h" #include "util.h"
#include "setup.h" #include "setup.h"
#include "units.h"
#include "settings.h" #include "settings.h"
#include "libs/inplib.h" #include "libs/inplib.h"
#include "libs/sound/trackplayer.h" #include "libs/sound/trackplayer.h"