From: <av...@us...> - 2009-11-21 01:15:30
|
Revision: 3333 http://sc2.svn.sourceforge.net/sc2/?rev=3333&view=rev Author: avolkov Date: 2009-11-21 01:15:21 +0000 (Sat, 21 Nov 2009) Log Message: ----------- Header and name cleanup: moved stuff around to relevant headers; removed some irrelevant #includes; better names Modified Paths: -------------- trunk/sc2/src/uqm/build.c trunk/sc2/src/uqm/clock.c trunk/sc2/src/uqm/cnctdlg.c trunk/sc2/src/uqm/comm/chmmr/chmmrc.c trunk/sc2/src/uqm/comm/comandr/comandr.c trunk/sc2/src/uqm/comm/druuge/druugec.c trunk/sc2/src/uqm/comm/melnorm/melnorm.c trunk/sc2/src/uqm/comm/starbas/starbas.c trunk/sc2/src/uqm/comm.c trunk/sc2/src/uqm/comm.h trunk/sc2/src/uqm/cons_res.c trunk/sc2/src/uqm/encount.c trunk/sc2/src/uqm/gameopt.c trunk/sc2/src/uqm/globdata.c trunk/sc2/src/uqm/globdata.h trunk/sc2/src/uqm/grpinfo.c trunk/sc2/src/uqm/grpinfo.h trunk/sc2/src/uqm/hyper.c trunk/sc2/src/uqm/hyper.h trunk/sc2/src/uqm/init.c trunk/sc2/src/uqm/intro.c trunk/sc2/src/uqm/load.h trunk/sc2/src/uqm/melee.c trunk/sc2/src/uqm/menu.c trunk/sc2/src/uqm/menustat.h trunk/sc2/src/uqm/oscill.c trunk/sc2/src/uqm/outfit.c trunk/sc2/src/uqm/pickship.c trunk/sc2/src/uqm/planets/cargo.c trunk/sc2/src/uqm/planets/devices.c trunk/sc2/src/uqm/planets/lander.c trunk/sc2/src/uqm/planets/lander.h trunk/sc2/src/uqm/planets/planets.c trunk/sc2/src/uqm/planets/pstarmap.c trunk/sc2/src/uqm/planets/roster.c trunk/sc2/src/uqm/planets/scan.c trunk/sc2/src/uqm/planets/scan.h trunk/sc2/src/uqm/planets/solarsys.c trunk/sc2/src/uqm/process.c trunk/sc2/src/uqm/races.h trunk/sc2/src/uqm/restart.c trunk/sc2/src/uqm/save.h trunk/sc2/src/uqm/ships/sis_ship/sis_ship.c trunk/sc2/src/uqm/shipyard.c trunk/sc2/src/uqm/sis.c trunk/sc2/src/uqm/sis.h trunk/sc2/src/uqm/starbase.c trunk/sc2/src/uqm/starbase.h trunk/sc2/src/uqm/starcon.c trunk/sc2/src/uqm/units.h trunk/sc2/src/uqm/uqmdebug.c trunk/sc2/src/uqm/util.c Modified: trunk/sc2/src/uqm/build.c =================================================================== --- trunk/sc2/src/uqm/build.c 2009-11-20 20:14:35 UTC (rev 3332) +++ trunk/sc2/src/uqm/build.c 2009-11-21 01:15:21 UTC (rev 3333) @@ -20,6 +20,7 @@ #include "races.h" #include "master.h" +#include "sis.h" #include "setup.h" #include "libs/compiler.h" #include "libs/mathlib.h" Modified: trunk/sc2/src/uqm/clock.c =================================================================== --- trunk/sc2/src/uqm/clock.c 2009-11-20 20:14:35 UTC (rev 3332) +++ trunk/sc2/src/uqm/clock.c 2009-11-21 01:15:21 UTC (rev 3333) @@ -19,6 +19,8 @@ #include <stdlib.h> #include "gameev.h" #include "globdata.h" +#include "sis.h" + // for DrawStatusMessage() #include "setup.h" #include "libs/compiler.h" #include "libs/gfxlib.h" Modified: trunk/sc2/src/uqm/cnctdlg.c =================================================================== --- trunk/sc2/src/uqm/cnctdlg.c 2009-11-20 20:14:35 UTC (rev 3332) +++ trunk/sc2/src/uqm/cnctdlg.c 2009-11-21 01:15:21 UTC (rev 3333) @@ -23,6 +23,7 @@ #include "colors.h" #include "gamestr.h" #include "setup.h" +#include "units.h" #include "resinst.h" #include "nameref.h" #include "libs/graphics/widgets.h" Modified: trunk/sc2/src/uqm/comm/chmmr/chmmrc.c =================================================================== --- trunk/sc2/src/uqm/comm/chmmr/chmmrc.c 2009-11-20 20:14:35 UTC (rev 3332) +++ trunk/sc2/src/uqm/comm/chmmr/chmmrc.c 2009-11-21 01:15:21 UTC (rev 3333) @@ -21,6 +21,8 @@ #include "strings.h" #include "uqm/build.h" +#include "uqm/hyper.h" + // for SOL_X/SOL_Y static LOCDATA chmmr_desc = Modified: trunk/sc2/src/uqm/comm/comandr/comandr.c =================================================================== --- trunk/sc2/src/uqm/comm/comandr/comandr.c 2009-11-20 20:14:35 UTC (rev 3332) +++ trunk/sc2/src/uqm/comm/comandr/comandr.c 2009-11-21 01:15:21 UTC (rev 3333) @@ -21,6 +21,8 @@ #include "strings.h" #include "uqm/setup.h" +#include "uqm/sis.h" + // for DeltaSISGauges(), DrawLanders() #include "libs/graphics/gfx_common.h" static LOCDATA commander_desc = Modified: trunk/sc2/src/uqm/comm/druuge/druugec.c =================================================================== --- trunk/sc2/src/uqm/comm/druuge/druugec.c 2009-11-20 20:14:35 UTC (rev 3332) +++ trunk/sc2/src/uqm/comm/druuge/druugec.c 2009-11-21 01:15:21 UTC (rev 3333) @@ -22,6 +22,8 @@ #include "uqm/build.h" #include "uqm/setup.h" +#include "uqm/sis.h" + // for DeltaSISGauges() static LOCDATA druuge_desc = Modified: trunk/sc2/src/uqm/comm/melnorm/melnorm.c =================================================================== --- trunk/sc2/src/uqm/comm/melnorm/melnorm.c 2009-11-20 20:14:35 UTC (rev 3332) +++ trunk/sc2/src/uqm/comm/melnorm/melnorm.c 2009-11-21 01:15:21 UTC (rev 3333) @@ -26,8 +26,11 @@ #include "libs/inplib.h" #include "libs/mathlib.h" -// XXX: temporary, for SOL_X/SOL_Y -#include "uqm/races.h" +#include "uqm/hyper.h" + // for SOL_X/SOL_Y +#include "uqm/planets/planets.h" + // for xxx_DISASTER +#include "uqm/sis.h" #define NUM_HISTORY_ITEMS 9 Modified: trunk/sc2/src/uqm/comm/starbas/starbas.c =================================================================== --- trunk/sc2/src/uqm/comm/starbas/starbas.c 2009-11-20 20:14:35 UTC (rev 3332) +++ trunk/sc2/src/uqm/comm/starbas/starbas.c 2009-11-21 01:15:21 UTC (rev 3333) @@ -23,6 +23,8 @@ #include "uqm/build.h" #include "uqm/setup.h" #include "uqm/shipcont.h" +#include "uqm/sis.h" + // for DeltaSISGauges() #include "libs/graphics/gfx_common.h" #include "libs/mathlib.h" #include "libs/inplib.h" Modified: trunk/sc2/src/uqm/comm.c =================================================================== --- trunk/sc2/src/uqm/comm.c 2009-11-20 20:14:35 UTC (rev 3332) +++ trunk/sc2/src/uqm/comm.c 2009-11-21 01:15:21 UTC (rev 3333) @@ -24,6 +24,8 @@ #include "commglue.h" #include "controls.h" #include "colors.h" +#include "sis.h" +#include "units.h" #include "encount.h" #include "endian_uqm.h" #include "gamestr.h" Modified: trunk/sc2/src/uqm/comm.h =================================================================== --- trunk/sc2/src/uqm/comm.h 2009-11-20 20:14:35 UTC (rev 3332) +++ trunk/sc2/src/uqm/comm.h 2009-11-21 01:15:21 UTC (rev 3333) @@ -18,6 +18,7 @@ #define _COMM_H #include "globdata.h" +#include "units.h" #include "libs/compiler.h" #include "libs/gfxlib.h" #include "commglue.h" Modified: trunk/sc2/src/uqm/cons_res.c =================================================================== --- trunk/sc2/src/uqm/cons_res.c 2009-11-20 20:14:35 UTC (rev 3332) +++ trunk/sc2/src/uqm/cons_res.c 2009-11-21 01:15:21 UTC (rev 3333) @@ -22,6 +22,10 @@ #include "resinst.h" #include "nameref.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[] = { "oolite", "yttric", "quasidegenerate", "lanthanide", "treasure", Modified: trunk/sc2/src/uqm/encount.c =================================================================== --- trunk/sc2/src/uqm/encount.c 2009-11-20 20:14:35 UTC (rev 3332) +++ trunk/sc2/src/uqm/encount.c 2009-11-21 01:15:21 UTC (rev 3333) @@ -24,9 +24,12 @@ #include "colors.h" #include "cons_res.h" #include "controls.h" +#include "menustat.h" #include "gameopt.h" #include "gamestr.h" #include "globdata.h" +#include "sis.h" + // for DrawStatusMessage(), SetStatusMessageMode() #include "init.h" #include "pickship.h" #include "intel.h" Modified: trunk/sc2/src/uqm/gameopt.c =================================================================== --- trunk/sc2/src/uqm/gameopt.c 2009-11-20 20:14:35 UTC (rev 3332) +++ trunk/sc2/src/uqm/gameopt.c 2009-11-21 01:15:21 UTC (rev 3333) @@ -20,21 +20,19 @@ #include "build.h" #include "colors.h" -#include "commglue.h" - // for CommData #include "controls.h" // XXX: for FindStart(), GetClusterName() #include "encount.h" -#include "planets/lander.h" +#include "menustat.h" +#include "sis.h" +#include "units.h" #include "gamestr.h" #include "load.h" #include "options.h" #include "save.h" -#include "starbase.h" #include "settings.h" #include "setup.h" #include "sounds.h" -#include "state.h" #include "util.h" #include "libs/graphics/gfx_common.h" Modified: trunk/sc2/src/uqm/globdata.c =================================================================== --- trunk/sc2/src/uqm/globdata.c 2009-11-20 20:14:35 UTC (rev 3332) +++ trunk/sc2/src/uqm/globdata.c 2009-11-21 01:15:21 UTC (rev 3333) @@ -22,6 +22,8 @@ #include "encount.h" #include "master.h" #include "setup.h" +#include "units.h" +#include "hyper.h" #include "resinst.h" #include "nameref.h" #include "build.h" @@ -42,7 +44,7 @@ GLOBDATA GlobData; -BOOLEAN initedSIS = 0; +static BOOLEAN initedGameStructs = FALSE; BYTE @@ -184,7 +186,7 @@ } BOOLEAN -InitSIS (void) +InitGameStructures (void) { COUNT i; @@ -351,8 +353,8 @@ * than once, as you can't remove the atexit function (when the full game * ends). */ - initedSIS = TRUE; - atexit (UninitSIS); + initedGameStructs = TRUE; + atexit (UninitGameStructures); return (TRUE); } @@ -371,11 +373,11 @@ } void -UninitSIS (void) +UninitGameStructures (void) { HFLEETINFO hStarShip; - if (!initedSIS) + if (!initedGameStructs) return; UninitQueue (&GLOBAL (encounter_q)); @@ -405,7 +407,7 @@ DestroyDrawable (ReleaseDrawable (PlayFrame)); PlayFrame = 0; - initedSIS = FALSE; + initedGameStructs = FALSE; } void Modified: trunk/sc2/src/uqm/globdata.h =================================================================== --- trunk/sc2/src/uqm/globdata.h 2009-11-20 20:14:35 UTC (rev 3332) +++ trunk/sc2/src/uqm/globdata.h 2009-11-21 01:15:21 UTC (rev 3333) @@ -22,6 +22,7 @@ #include "clock.h" #include "libs/gfxlib.h" #include "libs/reslib.h" +#include "libs/sndlib.h" #include "sis.h" #include "velocity.h" #include "commanim.h" @@ -961,6 +962,7 @@ #define GLOBAL_SIS(f) GlobData.SIS_state.f #define MAX_ENCOUNTERS 16 +#define MAX_BATTLE_GROUPS 32 //#define STATE_DEBUG @@ -1002,8 +1004,10 @@ extern void FreeSC2Data (void); extern BOOLEAN LoadSC2Data (void); -void InitGlobData (void); +extern void InitGlobData (void); +extern BOOLEAN InitGameStructures (void); +extern void UninitGameStructures (void); #endif /* _GLOBDATA_H */ Modified: trunk/sc2/src/uqm/grpinfo.c =================================================================== --- trunk/sc2/src/uqm/grpinfo.c 2009-11-20 20:14:35 UTC (rev 3332) +++ trunk/sc2/src/uqm/grpinfo.c 2009-11-21 01:15:21 UTC (rev 3333) @@ -22,7 +22,6 @@ #include "libs/file.h" #include "globdata.h" #include "intel.h" -#include "sis.h" #include "state.h" #include "grpinfo.h" Modified: trunk/sc2/src/uqm/grpinfo.h =================================================================== --- trunk/sc2/src/uqm/grpinfo.h 2009-11-20 20:14:35 UTC (rev 3332) +++ trunk/sc2/src/uqm/grpinfo.h 2009-11-21 01:15:21 UTC (rev 3333) @@ -24,6 +24,9 @@ // for POINT #include <assert.h> +// XXX: Needed to maintain savegame compatibility +#define NUM_SAVED_BATTLE_GROUPS 64 + typedef HLINK HIPGROUP; typedef struct Modified: trunk/sc2/src/uqm/hyper.c =================================================================== --- trunk/sc2/src/uqm/hyper.c 2009-11-20 20:14:35 UTC (rev 3332) +++ trunk/sc2/src/uqm/hyper.c 2009-11-21 01:15:21 UTC (rev 3333) @@ -22,10 +22,14 @@ #include "collide.h" #include "colors.h" #include "controls.h" +#include "menustat.h" + // for DrawMenuStateStrings() #include "encount.h" #include "ship.h" #include "process.h" #include "globdata.h" +#include "sis.h" +#include "units.h" #include "init.h" #include "nameref.h" #include "resinst.h" @@ -1595,7 +1599,7 @@ } void -DoMenuOptions (void) +HyperspaceMenu (void) { COLOR OldColor; CONTEXT OldContext; Modified: trunk/sc2/src/uqm/hyper.h =================================================================== --- trunk/sc2/src/uqm/hyper.h 2009-11-20 20:14:35 UTC (rev 3332) +++ trunk/sc2/src/uqm/hyper.h 2009-11-21 01:15:21 UTC (rev 3333) @@ -20,10 +20,42 @@ #define _HYPER_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 check_hyperspace_encounter (void); extern BOOLEAN hyper_transition (ELEMENT *ElementPtr); +extern void HyperspaceMenu (void); + #endif /* _HYPER_H */ Modified: trunk/sc2/src/uqm/init.c =================================================================== --- trunk/sc2/src/uqm/init.c 2009-11-20 20:14:35 UTC (rev 3332) +++ trunk/sc2/src/uqm/init.c 2009-11-21 01:15:21 UTC (rev 3333) @@ -25,6 +25,7 @@ #include "pickship.h" #include "process.h" #include "globdata.h" +#include "hyper.h" #include "init.h" #include "port.h" #include "resinst.h" Modified: trunk/sc2/src/uqm/intro.c =================================================================== --- trunk/sc2/src/uqm/intro.c 2009-11-20 20:14:35 UTC (rev 3332) +++ trunk/sc2/src/uqm/intro.c 2009-11-21 01:15:21 UTC (rev 3333) @@ -19,6 +19,8 @@ #include "controls.h" #include "options.h" #include "settings.h" +#include "globdata.h" +#include "sis.h" #include "setup.h" #include "sounds.h" #include "fmv.h" Modified: trunk/sc2/src/uqm/load.h =================================================================== --- trunk/sc2/src/uqm/load.h 2009-11-20 20:14:35 UTC (rev 3332) +++ trunk/sc2/src/uqm/load.h 2009-11-21 01:15:21 UTC (rev 3333) @@ -18,6 +18,7 @@ #define _LOAD_H #include "sis.h" + // for SUMMARY_DESC #include "libs/compiler.h" #include "globdata.h" Modified: trunk/sc2/src/uqm/melee.c =================================================================== --- trunk/sc2/src/uqm/melee.c 2009-11-20 20:14:35 UTC (rev 3332) +++ trunk/sc2/src/uqm/melee.c 2009-11-21 01:15:21 UTC (rev 3333) @@ -46,6 +46,8 @@ #include "setup.h" #include "sounds.h" #include "util.h" +#include "planets/planets.h" + // for NUMBER_OF_PLANET_TYPES #include "libs/graphics/drawable.h" #include "libs/gfxlib.h" #include "libs/mathlib.h" Modified: trunk/sc2/src/uqm/menu.c =================================================================== --- trunk/sc2/src/uqm/menu.c 2009-11-20 20:14:35 UTC (rev 3332) +++ trunk/sc2/src/uqm/menu.c 2009-11-21 01:15:21 UTC (rev 3333) @@ -16,8 +16,11 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include "menustat.h" + #include "colors.h" #include "controls.h" +#include "units.h" #include "options.h" #include "setup.h" #include "gamestr.h" Modified: trunk/sc2/src/uqm/menustat.h =================================================================== --- trunk/sc2/src/uqm/menustat.h 2009-11-20 20:14:35 UTC (rev 3332) +++ trunk/sc2/src/uqm/menustat.h 2009-11-21 01:15:21 UTC (rev 3333) @@ -48,6 +48,76 @@ void *Extra; } 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 */ - Modified: trunk/sc2/src/uqm/oscill.c =================================================================== --- trunk/sc2/src/uqm/oscill.c 2009-11-20 20:14:35 UTC (rev 3332) +++ trunk/sc2/src/uqm/oscill.c 2009-11-21 01:15:21 UTC (rev 3333) @@ -18,7 +18,9 @@ #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/drawable.h" #include "libs/sound/sound.h" Modified: trunk/sc2/src/uqm/outfit.c =================================================================== --- trunk/sc2/src/uqm/outfit.c 2009-11-20 20:14:35 UTC (rev 3332) +++ trunk/sc2/src/uqm/outfit.c 2009-11-21 01:15:21 UTC (rev 3333) @@ -19,6 +19,7 @@ #include "options.h" #include "colors.h" #include "controls.h" +#include "menustat.h" #include "gameopt.h" #include "gamestr.h" #include "resinst.h" @@ -27,7 +28,10 @@ #include "starbase.h" #include "setup.h" #include "sis.h" +#include "units.h" #include "sounds.h" +#include "planets/planets.h" + // for xxx_DISASTER #include "libs/graphics/gfx_common.h" Modified: trunk/sc2/src/uqm/pickship.c =================================================================== --- trunk/sc2/src/uqm/pickship.c 2009-11-20 20:14:35 UTC (rev 3332) +++ trunk/sc2/src/uqm/pickship.c 2009-11-21 01:15:21 UTC (rev 3333) @@ -21,6 +21,7 @@ #include "build.h" #include "colors.h" #include "controls.h" +#include "menustat.h" #include "pickmele.h" #include "battle.h" #include "races.h" Modified: trunk/sc2/src/uqm/planets/cargo.c =================================================================== --- trunk/sc2/src/uqm/planets/cargo.c 2009-11-20 20:14:35 UTC (rev 3332) +++ trunk/sc2/src/uqm/planets/cargo.c 2009-11-21 01:15:21 UTC (rev 3333) @@ -23,6 +23,9 @@ #include "../setup.h" #include "../sounds.h" #include "../util.h" +#include "../sis.h" + // for ClearSISRect(), DrawStatusMessage() +#include "planets.h" void Modified: trunk/sc2/src/uqm/planets/devices.c =================================================================== --- trunk/sc2/src/uqm/planets/devices.c 2009-11-20 20:14:35 UTC (rev 3332) +++ trunk/sc2/src/uqm/planets/devices.c 2009-11-21 01:15:21 UTC (rev 3333) @@ -25,6 +25,8 @@ #include "../load.h" #include "../setup.h" #include "../state.h" +#include "../sis.h" + // for ClearSISRect(), SaveFlagshipState() #include "../grpinfo.h" #include "../sounds.h" #include "../util.h" Modified: trunk/sc2/src/uqm/planets/lander.c =================================================================== --- trunk/sc2/src/uqm/planets/lander.c 2009-11-20 20:14:35 UTC (rev 3332) +++ trunk/sc2/src/uqm/planets/lander.c 2009-11-21 01:15:21 UTC (rev 3333) @@ -26,6 +26,7 @@ // XXX: for CurStarDescPtr and XXX_DEFINED #include "../encount.h" #include "../process.h" +#include "../units.h" #include "../gamestr.h" #include "../nameref.h" #include "../resinst.h" Modified: trunk/sc2/src/uqm/planets/lander.h =================================================================== --- trunk/sc2/src/uqm/planets/lander.h 2009-11-20 20:14:35 UTC (rev 3332) +++ trunk/sc2/src/uqm/planets/lander.h 2009-11-21 01:15:21 UTC (rev 3333) @@ -27,6 +27,9 @@ #include "../element.h" +// Surface magnification shift (x4) +#define MAG_SHIFT 2 + #define NUM_TEXT_FRAMES 32 typedef struct Modified: trunk/sc2/src/uqm/planets/planets.c =================================================================== --- trunk/sc2/src/uqm/planets/planets.c 2009-11-20 20:14:35 UTC (rev 3332) +++ trunk/sc2/src/uqm/planets/planets.c 2009-11-21 01:15:21 UTC (rev 3333) @@ -16,6 +16,8 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include "planets.h" + #include "scan.h" #include "lander.h" #include "../element.h" Modified: trunk/sc2/src/uqm/planets/pstarmap.c =================================================================== --- trunk/sc2/src/uqm/planets/pstarmap.c 2009-11-20 20:14:35 UTC (rev 3332) +++ trunk/sc2/src/uqm/planets/pstarmap.c 2009-11-21 01:15:21 UTC (rev 3333) @@ -19,6 +19,7 @@ #include "scan.h" #include "../colors.h" #include "../controls.h" +#include "../menustat.h" // XXX: for stuff that does not belong there #include "../encount.h" #include "../races.h" @@ -26,6 +27,10 @@ #include "../gamestr.h" #include "../globdata.h" #include "../shipcont.h" +#include "../units.h" +#include "../hyper.h" +#include "../sis.h" + // for DrawHyperCoords(), DrawStatusMessage() #include "../settings.h" #include "../setup.h" #include "../sounds.h" Modified: trunk/sc2/src/uqm/planets/roster.c =================================================================== --- trunk/sc2/src/uqm/planets/roster.c 2009-11-20 20:14:35 UTC (rev 3332) +++ trunk/sc2/src/uqm/planets/roster.c 2009-11-21 01:15:21 UTC (rev 3333) @@ -20,6 +20,8 @@ #include "../colors.h" #include "../controls.h" #include "../races.h" +#include "../units.h" +#include "../sis.h" #include "../shipcont.h" #include "../setup.h" #include "../sounds.h" @@ -30,7 +32,7 @@ #include <stdlib.h> // 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 }; @@ -38,7 +40,7 @@ // Ship icon positions split into (lower half) left and right (upper) // and sorted in the Y coord. These are used for navigation around the // 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); Modified: trunk/sc2/src/uqm/planets/scan.c =================================================================== --- trunk/sc2/src/uqm/planets/scan.c 2009-11-20 20:14:35 UTC (rev 3332) +++ trunk/sc2/src/uqm/planets/scan.c 2009-11-21 01:15:21 UTC (rev 3333) @@ -21,6 +21,7 @@ #include "../build.h" #include "../cons_res.h" #include "../controls.h" +#include "../menustat.h" #include "../encount.h" // for EncounterGroup #include "../gamestr.h" @@ -33,6 +34,7 @@ #include "../setup.h" #include "../sounds.h" #include "../state.h" +#include "../sis.h" #include "options.h" #include "libs/graphics/gfx_common.h" #include "libs/graphics/drawable.h" Modified: trunk/sc2/src/uqm/planets/scan.h =================================================================== --- trunk/sc2/src/uqm/planets/scan.h 2009-11-20 20:14:35 UTC (rev 3332) +++ trunk/sc2/src/uqm/planets/scan.h 2009-11-21 01:15:21 UTC (rev 3333) @@ -19,8 +19,8 @@ #ifndef _SCAN_H #define _SCAN_H +#include "libs/compiler.h" #include "libs/gfxlib.h" -#include "../menustat.h" typedef struct @@ -39,10 +39,6 @@ SCAN_DESC *scan_base; } 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 GeneratePlanetSide (void); Modified: trunk/sc2/src/uqm/planets/solarsys.c =================================================================== --- trunk/sc2/src/uqm/planets/solarsys.c 2009-11-20 20:14:35 UTC (rev 3332) +++ trunk/sc2/src/uqm/planets/solarsys.c 2009-11-21 01:15:21 UTC (rev 3333) @@ -19,10 +19,13 @@ #include "lander.h" #include "../colors.h" #include "../controls.h" +#include "../menustat.h" + // for DrawMenuStateStrings() #include "../encount.h" #include "../races.h" #include "../gamestr.h" #include "../globdata.h" +#include "../sis.h" #include "../init.h" #include "../nameref.h" #include "../resinst.h" Modified: trunk/sc2/src/uqm/process.c =================================================================== --- trunk/sc2/src/uqm/process.c 2009-11-20 20:14:35 UTC (rev 3332) +++ trunk/sc2/src/uqm/process.c 2009-11-21 01:15:21 UTC (rev 3333) @@ -24,6 +24,7 @@ #include "settings.h" #include "setup.h" #include "sounds.h" +#include "hyper.h" #include "element.h" #include "battle.h" #include "weapon.h" Modified: trunk/sc2/src/uqm/races.h =================================================================== --- trunk/sc2/src/uqm/races.h 2009-11-20 20:14:35 UTC (rev 3332) +++ trunk/sc2/src/uqm/races.h 2009-11-21 01:15:21 UTC (rev 3333) @@ -664,25 +664,5 @@ BUILD_COLOR (MAKE_RGB15 (0x06, 0x06, 0x06), 0x20), /* BLACK_URQUAN_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 */ Modified: trunk/sc2/src/uqm/restart.c =================================================================== --- trunk/sc2/src/uqm/restart.c 2009-11-20 20:14:35 UTC (rev 3332) +++ trunk/sc2/src/uqm/restart.c 2009-11-21 01:15:21 UTC (rev 3333) @@ -24,6 +24,7 @@ // XXX: for star_array[] #include "encount.h" #include "fmv.h" +#include "menustat.h" #include "gamestr.h" #include "globdata.h" #include "intel.h" Modified: trunk/sc2/src/uqm/save.h =================================================================== --- trunk/sc2/src/uqm/save.h 2009-11-20 20:14:35 UTC (rev 3332) +++ trunk/sc2/src/uqm/save.h 2009-11-21 01:15:21 UTC (rev 3333) @@ -18,6 +18,7 @@ #define _SAVE_H #include "sis.h" + // for SUMMARY_DESC #include "libs/compiler.h" extern void SaveProblem (void); Modified: trunk/sc2/src/uqm/ships/sis_ship/sis_ship.c =================================================================== --- trunk/sc2/src/uqm/ships/sis_ship/sis_ship.c 2009-11-20 20:14:35 UTC (rev 3332) +++ trunk/sc2/src/uqm/ships/sis_ship/sis_ship.c 2009-11-21 01:15:21 UTC (rev 3333) @@ -22,6 +22,7 @@ #include "uqm/colors.h" #include "uqm/controls.h" #include "uqm/globdata.h" +#include "uqm/hyper.h" #include "libs/mathlib.h" @@ -303,7 +304,7 @@ && StarShipPtr->special_counter == 0) { #define MENU_DELAY 10 - DoMenuOptions (); + HyperspaceMenu (); StarShipPtr->cur_status_flags &= ~SHIP_AT_MAX_SPEED; StarShipPtr->special_counter = MENU_DELAY; } Modified: trunk/sc2/src/uqm/shipyard.c =================================================================== --- trunk/sc2/src/uqm/shipyard.c 2009-11-20 20:14:35 UTC (rev 3332) +++ trunk/sc2/src/uqm/shipyard.c 2009-11-21 01:15:21 UTC (rev 3333) @@ -19,6 +19,7 @@ #include "build.h" #include "colors.h" #include "controls.h" +#include "menustat.h" #include "fmv.h" #include "gameopt.h" #include "gamestr.h" @@ -32,8 +33,8 @@ #include "starbase.h" #include "setup.h" #include "sis.h" +#include "units.h" #include "sounds.h" -#include "state.h" #include "libs/graphics/gfx_common.h" #include "libs/inplib.h" @@ -296,7 +297,7 @@ SHIP_FRAGMENT *StarShipPtr; POINT finished_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; pship_win_info = &ship_win_info[0]; Modified: trunk/sc2/src/uqm/sis.c =================================================================== --- trunk/sc2/src/uqm/sis.c 2009-11-20 20:14:35 UTC (rev 3332) +++ trunk/sc2/src/uqm/sis.c 2009-11-21 01:15:21 UTC (rev 3333) @@ -16,13 +16,17 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include "sis.h" + #include "colors.h" #include "races.h" // XXX: including encount.h for stuff that does not belong there #include "encount.h" +#include "units.h" +#include "menustat.h" + // for DrawMenuStateStrings() #include "gamestr.h" #include "options.h" -#include "starbase.h" #include "battle.h" // For BATTLE_FRAME_RATE #include "element.h" @@ -941,7 +945,7 @@ { HSHIPFRAG hStarShip, hNextShip; POINT *pship_pos; - POINT ship_pos[MAX_COMBAT_SHIPS] = + POINT ship_pos[MAX_BUILT_SHIPS] = { SUPPORT_SHIP_PTS }; Modified: trunk/sc2/src/uqm/sis.h =================================================================== --- trunk/sc2/src/uqm/sis.h 2009-11-20 20:14:35 UTC (rev 3332) +++ trunk/sc2/src/uqm/sis.h 2009-11-21 01:15:21 UTC (rev 3333) @@ -1,90 +1,16 @@ #ifndef _SIS_H #define _SIS_H -#include "planets/planets.h" +#include "libs/compiler.h" +#include "libs/gfxlib.h" +#include "planets/elemdata.h" + // for NUM_ELEMENT_CATEGORIES -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 -}; - #define CLEAR_SIS_RADAR (1 << 2) #define DRAW_SIS_DISPLAY (1 << 3) #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_JET_SLOTS 8 #define NUM_MODULE_SLOTS 16 @@ -105,18 +31,10 @@ #define FUEL_VOLUME_PER_ROW (HEFUEL_TANK_CAPACITY / MAX_FUEL_BARS) #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_TURN_WAIT 17 #define IP_SHIP_TURN_DECREMENT 2 -#define BOGUS_MASS 5 - #define BIO_CREDIT_VALUE 2 enum @@ -189,17 +107,6 @@ {3 + 0, 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 typedef struct @@ -250,13 +157,6 @@ #define OVERRIDE_LANDER_FLAGS (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 InitSISContexts (void); extern void DrawSISFrame (void); @@ -274,7 +174,6 @@ #define DSME_BLOCKCUR (1 << 2) #define DSME_MYCOLOR (1 << 3) extern void DrawSISMessage (const UNICODE *pStr); -extern void DrawGameDate (void); extern void DateToString (unsigned char *buf, size_t bufLen, BYTE month_index, BYTE day_index, COUNT year_index); @@ -307,9 +206,6 @@ extern DWORD GetFTankCapacity (POINT *ppt); 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 DrawCaptainsName (void); Modified: trunk/sc2/src/uqm/starbase.c =================================================================== --- trunk/sc2/src/uqm/starbase.c 2009-11-20 20:14:35 UTC (rev 3332) +++ trunk/sc2/src/uqm/starbase.c 2009-11-21 01:15:21 UTC (rev 3333) @@ -25,6 +25,7 @@ #include "gamestr.h" #include "load.h" #include "starbase.h" +#include "sis.h" #include "resinst.h" #include "nameref.h" #include "settings.h" Modified: trunk/sc2/src/uqm/starbase.h =================================================================== --- trunk/sc2/src/uqm/starbase.h 2009-11-20 20:14:35 UTC (rev 3332) +++ trunk/sc2/src/uqm/starbase.h 2009-11-21 01:15:21 UTC (rev 3333) @@ -44,8 +44,5 @@ field_width); // XXX: Doesn't really belong in this file. -extern const char starbase_str_array[][20]; - #endif /* _STARBASE_H */ - Modified: trunk/sc2/src/uqm/starcon.c =================================================================== --- trunk/sc2/src/uqm/starcon.c 2009-11-20 20:14:35 UTC (rev 3332) +++ trunk/sc2/src/uqm/starcon.c 2009-11-21 01:15:21 UTC (rev 3333) @@ -32,6 +32,12 @@ #include "master.h" #include "controls.h" #include "starcon.h" +#include "clock.h" + // for GameClockTick() +#include "hyper.h" + // for SeedUniverse() +#include "planets/planets.h" + // for ExploreSolarSys() #include "uqmdebug.h" #include "libs/tasklib.h" #include "libs/log.h" @@ -191,7 +197,7 @@ log_add (log_Fatal, "Could not set player input."); explode (); // Does not return; } - InitSIS (); + InitGameStructures (); InitGameClock (); AddInitialGameEvents(); @@ -281,7 +287,7 @@ StopSound (); UninitGameClock (); - UninitSIS (); + UninitGameStructures (); ClearPlayerInputAll (); } // CloseJournal (); Modified: trunk/sc2/src/uqm/units.h =================================================================== --- trunk/sc2/src/uqm/units.h 2009-11-20 20:14:35 UTC (rev 3332) +++ trunk/sc2/src/uqm/units.h 2009-11-21 01:15:21 UTC (rev 3333) @@ -44,8 +44,26 @@ /* Width of the usable part of the space "window" */ #define SIS_SCREEN_HEIGHT (SPACE_HEIGHT - 13) /* 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_VIS_REDUCTION 2 #define REDUCTION_SHIFT 1 @@ -87,6 +105,8 @@ #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_HEIGHT 50 Modified: trunk/sc2/src/uqm/uqmdebug.c =================================================================== --- trunk/sc2/src/uqm/uqmdebug.c 2009-11-20 20:14:35 UTC (rev 3332) +++ trunk/sc2/src/uqm/uqmdebug.c 2009-11-21 01:15:21 UTC (rev 3333) @@ -24,6 +24,7 @@ #include "clock.h" #include "encount.h" #include "element.h" +#include "sis.h" #include "status.h" #include "gamestr.h" #include "gameev.h" Modified: trunk/sc2/src/uqm/util.c =================================================================== --- trunk/sc2/src/uqm/util.c 2009-11-20 20:14:35 UTC (rev 3332) +++ trunk/sc2/src/uqm/util.c 2009-11-21 01:15:21 UTC (rev 3333) @@ -19,6 +19,7 @@ #include "controls.h" #include "util.h" #include "setup.h" +#include "units.h" #include "settings.h" #include "libs/inplib.h" #include "libs/sound/trackplayer.h" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |