From 6562296c7cd7aff53d01f52fb3cc5bae2cc4c521 Mon Sep 17 00:00:00 2001 From: avolkov Date: Thu, 8 Oct 2009 16:23:21 +0000 Subject: [PATCH] Various include file cleanups git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3198 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/Makeproject | 2 +- sc2/src/msvc++/UrQuanMasters.dsp | 32 ++++++++-- sc2/src/options.c | 2 +- sc2/src/sc2code/battle.c | 8 ++- sc2/src/sc2code/battle.h | 13 ++-- sc2/src/sc2code/build.h | 16 ----- sc2/src/sc2code/cleanup.c | 4 +- sc2/src/sc2code/coderes.h | 2 +- sc2/src/sc2code/comm/commall.h | 2 +- sc2/src/sc2code/cons_res.h | 4 +- sc2/src/sc2code/controls.h | 2 +- sc2/src/sc2code/cyborg.c | 2 +- sc2/src/sc2code/demo.c | 3 +- sc2/src/sc2code/displist.h | 4 +- sc2/src/sc2code/element.h | 61 ++---------------- sc2/src/sc2code/encount.c | 1 + sc2/src/sc2code/fmv.c | 2 +- sc2/src/sc2code/galaxy.c | 1 + sc2/src/sc2code/gameopt.c | 2 +- sc2/src/sc2code/gameopt.h | 2 +- sc2/src/sc2code/grpinfo.c | 2 +- sc2/src/sc2code/hyper.c | 2 + sc2/src/sc2code/hyper.h | 2 + sc2/src/sc2code/init.c | 7 ++- sc2/src/sc2code/init.h | 5 ++ sc2/src/sc2code/ipdisp.c | 3 + sc2/src/sc2code/ipdisp.h | 25 ++++++++ sc2/src/sc2code/libs/decomp/lzdecode.c | 2 +- sc2/src/sc2code/libs/decomp/lzencode.c | 2 +- sc2/src/sc2code/libs/decomp/lzh.h | 4 +- sc2/src/sc2code/libs/file/dirs.c | 4 +- sc2/src/sc2code/libs/file/files.c | 4 +- sc2/src/sc2code/libs/gfxlib.h | 4 +- sc2/src/sc2code/libs/graphics/drawable.c | 2 +- sc2/src/sc2code/libs/graphics/drawcmd.h | 2 +- sc2/src/sc2code/libs/graphics/frame.c | 1 - sc2/src/sc2code/libs/graphics/gfxintrn.h | 4 +- sc2/src/sc2code/libs/graphics/sdl/3do_blt.c | 2 +- sc2/src/sc2code/libs/graphics/sdl/3do_funcs.c | 4 +- sc2/src/sc2code/libs/graphics/sdl/bbox.h | 6 +- sc2/src/sc2code/libs/graphics/sdl/rotozoom.c | 2 +- .../sc2code/libs/graphics/sdl/sdl_common.c | 2 +- sc2/src/sc2code/libs/graphics/tfb_draw.h | 2 +- sc2/src/sc2code/libs/graphics/tfb_prim.h | 2 +- sc2/src/sc2code/libs/graphics/widgets.c | 6 +- sc2/src/sc2code/libs/inplib.h | 2 +- sc2/src/sc2code/libs/input/inpintrn.h | 2 +- sc2/src/sc2code/libs/input/sdl/input.c | 2 +- sc2/src/sc2code/libs/input/sdl/vcontrol.c | 2 +- sc2/src/sc2code/libs/list/list.c | 2 +- sc2/src/sc2code/libs/math/mthintrn.h | 2 +- sc2/src/sc2code/libs/mathlib.h | 2 +- sc2/src/sc2code/libs/memlib.h | 2 +- sc2/src/sc2code/libs/memory/w_memlib.c | 2 +- sc2/src/sc2code/libs/reslib.h | 5 +- sc2/src/sc2code/libs/resource/direct.c | 2 +- sc2/src/sc2code/libs/resource/index.h | 2 +- sc2/src/sc2code/libs/resource/loadres.c | 2 +- sc2/src/sc2code/libs/resource/propfile.c | 2 +- sc2/src/sc2code/libs/resource/propfile.h | 2 +- sc2/src/sc2code/libs/resource/resinit.c | 2 +- sc2/src/sc2code/libs/resource/resintrn.h | 2 +- sc2/src/sc2code/libs/sndlib.h | 2 +- sc2/src/sc2code/libs/sound/decoders/aiffaud.c | 2 +- sc2/src/sc2code/libs/sound/decoders/decoder.h | 2 +- sc2/src/sc2code/libs/sound/decoders/dukaud.c | 2 +- sc2/src/sc2code/libs/sound/decoders/modaud.c | 2 +- sc2/src/sc2code/libs/sound/decoders/oggaud.c | 2 +- sc2/src/sc2code/libs/sound/decoders/wav.c | 2 +- sc2/src/sc2code/libs/sound/fileinst.c | 2 +- sc2/src/sc2code/libs/sound/music.c | 2 +- sc2/src/sc2code/libs/sound/sndintrn.h | 4 +- sc2/src/sc2code/libs/sound/sound.h | 2 +- sc2/src/sc2code/libs/sound/trackplayer.h | 2 +- sc2/src/sc2code/libs/strings/sfileins.c | 2 +- sc2/src/sc2code/libs/strings/strings.c | 2 +- sc2/src/sc2code/libs/strings/strintrn.h | 4 +- sc2/src/sc2code/libs/strings/unicode.c | 2 +- sc2/src/sc2code/libs/strlib.h | 2 +- sc2/src/sc2code/libs/threads/sdl/sdlthreads.c | 2 +- sc2/src/sc2code/libs/video/vfileins.c | 2 +- sc2/src/sc2code/libs/video/video.h | 4 +- sc2/src/sc2code/libs/video/videodec.h | 4 +- sc2/src/sc2code/load.c | 4 +- sc2/src/sc2code/loadship.c | 1 + sc2/src/sc2code/melee.c | 3 +- sc2/src/sc2code/misc.c | 2 + sc2/src/sc2code/nameref.h | 2 +- sc2/src/sc2code/netplay/checksum.c | 3 +- sc2/src/sc2code/netplay/netmisc.h | 2 +- sc2/src/sc2code/pickmele.c | 1 + sc2/src/sc2code/pickmele.h | 1 + sc2/src/sc2code/pickship.c | 3 + sc2/src/sc2code/pickship.h | 27 ++++++++ sc2/src/sc2code/planets/devices.c | 2 +- sc2/src/sc2code/planets/gendru.c | 1 + sc2/src/sc2code/planets/genilw.c | 1 + sc2/src/sc2code/planets/genmyc.c | 1 + sc2/src/sc2code/planets/genorz.c | 1 + sc2/src/sc2code/planets/genpet.c | 1 + sc2/src/sc2code/planets/genpku.c | 1 + sc2/src/sc2code/planets/genspa.c | 1 + sc2/src/sc2code/planets/gensup.c | 1 + sc2/src/sc2code/planets/genthrad.c | 1 + sc2/src/sc2code/planets/gentopo.c | 4 +- sc2/src/sc2code/planets/genutw.c | 1 + sc2/src/sc2code/planets/genvux.c | 1 + sc2/src/sc2code/planets/genyeh.c | 1 + sc2/src/sc2code/planets/lander.c | 4 +- sc2/src/sc2code/planets/lander.h | 3 + sc2/src/sc2code/planets/oval.c | 4 +- sc2/src/sc2code/planets/planets.h | 1 - sc2/src/sc2code/planets/scan.c | 3 +- sc2/src/sc2code/planets/solarsys.c | 2 + sc2/src/sc2code/process.c | 5 +- sc2/src/sc2code/process.h | 29 +++++++++ sc2/src/sc2code/races.h | 29 +++++---- sc2/src/sc2code/save.c | 4 +- sc2/src/sc2code/setup.c | 3 +- sc2/src/sc2code/setup.h | 3 + sc2/src/sc2code/ship.c | 14 +++-- sc2/src/sc2code/ship.h | 35 +++++++++++ sc2/src/sc2code/ships/androsyn/androsyn.c | 1 + sc2/src/sc2code/ships/chenjesu/chenjesu.c | 1 + sc2/src/sc2code/ships/ilwrath/ilwrath.c | 1 + sc2/src/sc2code/ships/lastbat/lastbat.c | 2 + sc2/src/sc2code/ships/orz/orz.c | 1 + sc2/src/sc2code/ships/ship.h | 1 + sc2/src/sc2code/ships/supox/supox.c | 1 + sc2/src/sc2code/ships/thradd/thradd.c | 1 + sc2/src/sc2code/ships/utwig/utwig.c | 1 + sc2/src/sc2code/shipstat.c | 2 +- sc2/src/sc2code/sis.c | 3 + sc2/src/sc2code/starcon.c | 2 +- sc2/src/sc2code/status.c | 5 +- sc2/src/sc2code/status.h | 62 +++++++++++++++++++ sc2/src/sc2code/tactrans.c | 6 ++ sc2/src/sc2code/tactrans.h | 12 ++++ sc2/src/sc2code/uqmdebug.c | 2 + sc2/src/sc2code/weapon.c | 3 +- sc2/src/starcon2.c | 4 +- 141 files changed, 446 insertions(+), 224 deletions(-) create mode 100644 sc2/src/sc2code/ipdisp.h create mode 100644 sc2/src/sc2code/pickship.h create mode 100644 sc2/src/sc2code/process.h create mode 100644 sc2/src/sc2code/ship.h create mode 100644 sc2/src/sc2code/status.h diff --git a/sc2/Makeproject b/sc2/Makeproject index d6c3ceeda..d3dffba37 100644 --- a/sc2/Makeproject +++ b/sc2/Makeproject @@ -16,7 +16,7 @@ case "$HOST_SYSTEM" in uqm_NAME="$uqm_NAME.exe" ;; esac -uqm_CFLAGS="$uqm_CFLAGS -Isrc -Isrc/sc2code -Isrc/sc2code/libs" +uqm_CFLAGS="$uqm_CFLAGS -Isrc -Isrc/sc2code" if [ "$uqm_HAVE_REGEX" = 0 ]; then uqm_CFLAGS="$uqm_CFLAGS -Isrc/regex" fi diff --git a/sc2/src/msvc++/UrQuanMasters.dsp b/sc2/src/msvc++/UrQuanMasters.dsp index 1eae79240..cba6a842f 100644 --- a/sc2/src/msvc++/UrQuanMasters.dsp +++ b/sc2/src/msvc++/UrQuanMasters.dsp @@ -44,7 +44,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "." /I ".." /I "..\sc2code" /I "..\sc2code\libs" /I "..\sc2code\ships" /I "..\regex" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D _VW=320 /D _VH=240 /D "HAVE_OPENGL" /D "GFXMODULE_SDL" /D "THREADLIB_SDL" /D "HAVE_OPENAL" /D "HAVE_ZIP" /D "HAVE_JOYSTICK" /D "NETPLAY" /D "ZLIB_DLL" /D "USE_INTERNAL_MIKMOD" /D "USE_PLATFORM_ACCEL" /FD /c +# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I ".." /I "..\sc2code" /I "..\regex" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D _VW=320 /D _VH=240 /D "HAVE_OPENGL" /D "GFXMODULE_SDL" /D "THREADLIB_SDL" /D "HAVE_OPENAL" /D "HAVE_ZIP" /D "HAVE_JOYSTICK" /D "NETPLAY" /D "ZLIB_DLL" /D "USE_INTERNAL_MIKMOD" /D "USE_PLATFORM_ACCEL" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" @@ -74,7 +74,7 @@ PostBuild_Cmds=rebase -b 0x400000 -x . "../../uqm.exe" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "." /I ".." /I "..\sc2code" /I "..\sc2code\libs" /I "..\sc2code\ships" /I "..\regex" /D "DEBUG" /D "_DEBUG" /D "DEBUG_TRACK_SEM" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D _VW=320 /D _VH=240 /D "HAVE_OPENGL" /D "GFXMODULE_SDL" /D "THREADLIB_SDL" /D "HAVE_OPENAL" /D "HAVE_ZIP" /D "HAVE_JOYSTICK" /D "NETPLAY" /D "ZLIB_DLL" /D "USE_INTERNAL_MIKMOD" /D "USE_PLATFORM_ACCEL" /FR /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I ".." /I "..\sc2code" /I "..\regex" /D "DEBUG" /D "_DEBUG" /D "DEBUG_TRACK_SEM" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D _VW=320 /D _VH=240 /D "HAVE_OPENGL" /D "GFXMODULE_SDL" /D "THREADLIB_SDL" /D "HAVE_OPENAL" /D "HAVE_ZIP" /D "HAVE_JOYSTICK" /D "NETPLAY" /D "ZLIB_DLL" /D "USE_INTERNAL_MIKMOD" /D "USE_PLATFORM_ACCEL" /FR /FD /GZ /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" @@ -102,7 +102,7 @@ LINK32=link.exe # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /I "." /I ".." /I "..\sc2code" /I "..\sc2code\libs" /I "..\sc2code\ships" /I "..\regex" /D "DEBUG" /D "_DEBUG" /D "DEBUG_TRACK_SEM" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D _VW=320 /D _VH=240 /D "HAVE_OPENGL" /D "GFXMODULE_SDL" /D "THREADLIB_SDL" /D "HAVE_OPENAL" /D "HAVE_ZIP" /D "ZLIB_DLL" /D "USE_PLATFORM_ACCEL" /FR /FD /GZ /c # SUBTRACT BASE CPP /YX -# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "." /I ".." /I "..\sc2code" /I "..\sc2code\libs" /I "..\sc2code\ships" /I "..\regex" /D "DEBUG" /D "_DEBUG" /D "DEBUG_TRACK_SEM" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D _VW=320 /D _VH=240 /D "HAVE_OPENGL" /D "GFXMODULE_SDL" /D "THREADLIB_SDL" /D "HAVE_OPENAL" /D "HAVE_ZIP" /D "HAVE_JOYSTICK" /D "NETPLAY" /D "ZLIB_DLL" /D "USE_INTERNAL_MIKMOD" /FR /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I ".." /I "..\sc2code" /I "..\regex" /D "DEBUG" /D "_DEBUG" /D "DEBUG_TRACK_SEM" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D _VW=320 /D _VH=240 /D "HAVE_OPENGL" /D "GFXMODULE_SDL" /D "THREADLIB_SDL" /D "HAVE_OPENAL" /D "HAVE_ZIP" /D "HAVE_JOYSTICK" /D "NETPLAY" /D "ZLIB_DLL" /D "USE_INTERNAL_MIKMOD" /FR /FD /GZ /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" @@ -130,7 +130,7 @@ LINK32=link.exe # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /GX /Zi /O2 /I "." /I ".." /I "..\sc2code" /I "..\sc2code\libs" /I "..\sc2code\ships" /I "..\regex" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D _VW=320 /D _VH=240 /D "HAVE_OPENGL" /D "GFXMODULE_SDL" /D "THREADLIB_SDL" /D "HAVE_OPENAL" /D "HAVE_ZIP" /D "ZLIB_DLL" /D "USE_PLATFORM_ACCEL" /FD /c # SUBTRACT BASE CPP /YX -# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "." /I ".." /I "..\sc2code" /I "..\sc2code\libs" /I "..\sc2code\ships" /I "..\regex" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D _VW=320 /D _VH=240 /D "HAVE_OPENGL" /D "GFXMODULE_SDL" /D "THREADLIB_SDL" /D "HAVE_OPENAL" /D "HAVE_ZIP" /D "HAVE_JOYSTICK" /D "NETPLAY" /D "ZLIB_DLL" /D "USE_INTERNAL_MIKMOD" /FR /FD /c +# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I ".." /I "..\sc2code" /I "..\regex" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D _VW=320 /D _VH=240 /D "HAVE_OPENGL" /D "GFXMODULE_SDL" /D "THREADLIB_SDL" /D "HAVE_OPENAL" /D "HAVE_ZIP" /D "HAVE_JOYSTICK" /D "NETPLAY" /D "ZLIB_DLL" /D "USE_INTERNAL_MIKMOD" /FR /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" @@ -331,6 +331,10 @@ SOURCE=..\sc2code\libs\graphics\sdl\dcqueue.c # End Source File # Begin Source File +SOURCE=..\sc2code\libs\graphics\sdl\dcqueue.h +# End Source File +# Begin Source File + SOURCE=..\sc2code\libs\graphics\sdl\hq2x.c # End Source File # Begin Source File @@ -4116,6 +4120,10 @@ SOURCE=..\sc2code\ipdisp.c # End Source File # Begin Source File +SOURCE=..\sc2code\ipdisp.h +# End Source File +# Begin Source File + SOURCE=..\sc2code\ires_ind.h # End Source File # Begin Source File @@ -4200,6 +4208,10 @@ SOURCE=..\sc2code\pickship.c # End Source File # Begin Source File +SOURCE=..\sc2code\pickship.h +# End Source File +# Begin Source File + SOURCE=..\sc2code\plandata.c # End Source File # Begin Source File @@ -4208,6 +4220,10 @@ SOURCE=..\sc2code\process.c # End Source File # Begin Source File +SOURCE=..\sc2code\process.h +# End Source File +# Begin Source File + SOURCE=..\sc2code\races.h # End Source File # Begin Source File @@ -4268,6 +4284,10 @@ SOURCE=..\sc2code\ship.c # End Source File # Begin Source File +SOURCE=..\sc2code\ship.h +# End Source File +# Begin Source File + SOURCE=..\sc2code\shipcont.h # End Source File # Begin Source File @@ -4328,6 +4348,10 @@ SOURCE=..\sc2code\status.c # End Source File # Begin Source File +SOURCE=..\sc2code\status.h +# End Source File +# Begin Source File + SOURCE=..\sc2code\tactrans.c # End Source File # Begin Source File diff --git a/sc2/src/options.c b/sc2/src/options.c index 3f185b642..b7351454c 100644 --- a/sc2/src/options.c +++ b/sc2/src/options.c @@ -23,7 +23,7 @@ #include "port.h" #include "libs/graphics/gfx_common.h" -#include "file.h" +#include "libs/file.h" #include "config.h" #include "libs/compiler.h" #include "libs/uio.h" diff --git a/sc2/src/sc2code/battle.c b/sc2/src/sc2code/battle.c index cb0375321..722ed239d 100644 --- a/sc2/src/sc2code/battle.c +++ b/sc2/src/sc2code/battle.c @@ -21,6 +21,11 @@ #include "battlecontrols.h" #include "controls.h" #include "init.h" +#include "element.h" +#include "ship.h" +#include "process.h" +#include "tactrans.h" + // for flee_preprocess() #include "intel.h" #ifdef NETPLAY # include "netplay/netmelee.h" @@ -39,7 +44,6 @@ #include "libs/mathlib.h" -QUEUE disp_q; BYTE battle_counter[NUM_SIDES]; // The number of ships still available for battle to each side. // A ship that has warped out is no longer available. @@ -81,8 +85,6 @@ DoRunAway (STARSHIP *StarShipPtr) && ElementPtr->mass_points != MAX_SHIP_MASS * 10 && !(ElementPtr->state_flags & APPEARING)) { - extern void flee_preprocess (ELEMENT *); - battle_counter[0]--; ElementPtr->turn_wait = 3; diff --git a/sc2/src/sc2code/battle.h b/sc2/src/sc2code/battle.h index 7cf0ef7fc..330d385d7 100644 --- a/sc2/src/sc2code/battle.h +++ b/sc2/src/sc2code/battle.h @@ -23,8 +23,6 @@ typedef DWORD BattleFrameCounter; #endif -#include "displist.h" - // for QUEUE #include "init.h" // For NUM_SIDES @@ -35,11 +33,6 @@ typedef struct battlestate_struct { DWORD NextTime; } BATTLE_STATE; -extern QUEUE disp_q; -// The maximum number of elements is chosen to provide a slight margin. -// Currently, it is maximum *known used* in Melee + 30 -#define MAX_DISPLAY_ELEMENTS 150 - extern BYTE battle_counter[NUM_SIDES]; extern BOOLEAN instantVictory; #if defined (NETPLAY) @@ -54,5 +47,9 @@ COUNT GetPlayerOrder (COUNT i); BOOLEAN Battle (void); -#endif /* _BATTLE_H */ +#define BATTLE_FRAME_RATE (ONE_SECOND / 24) +extern void BattleSong (BOOLEAN DoPlay); +extern void FreeBattleSong (void); + +#endif /* _BATTLE_H */ diff --git a/sc2/src/sc2code/build.h b/sc2/src/sc2code/build.h index 6bc885759..b94aa8296 100644 --- a/sc2/src/sc2code/build.h +++ b/sc2/src/sc2code/build.h @@ -23,13 +23,6 @@ #include "displist.h" #include "libs/compiler.h" -#define CREW_XOFFS 4 -#define ENERGY_XOFFS 52 -#define GAUGE_YOFFS (SHIP_INFO_HEIGHT - 10) -#define UNIT_WIDTH 2 -#define UNIT_HEIGHT 1 -#define STAT_WIDTH (1 + UNIT_WIDTH + 1 + UNIT_WIDTH + 1) - #define NAME_OFFSET 5 #define NUM_CAPTAINS_NAMES 16 @@ -67,14 +60,5 @@ extern RACE_DESC *load_ship (SPECIES_ID SpeciesID, BOOLEAN LoadBattleData); extern void free_ship (RACE_DESC *RaceDescPtr, BOOLEAN FreeIconData, BOOLEAN FreeBattleData); -extern void DrawCrewFuelString (COORD y, SIZE state); -extern void ClearShipStatus (COORD y); -extern void OutlineShipStatus (COORD y); -extern void InitShipStatus (SHIP_INFO *ShipInfoPtr, BYTE captains_name_index, - RECT *pClipRect); -extern void DeltaStatistics (SHIP_INFO *ShipInfoPtr, SIZE crew_delta, - SIZE energy_delta); -extern void DrawBattleCrewAmount (SHIP_INFO *ShipInfoPtr); - #endif /* _BUILD_H */ diff --git a/sc2/src/sc2code/cleanup.c b/sc2/src/sc2code/cleanup.c index 360a29eab..5ac70b2bb 100644 --- a/sc2/src/sc2code/cleanup.c +++ b/sc2/src/sc2code/cleanup.c @@ -16,12 +16,12 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "battle.h" #include "master.h" #include "nameref.h" -#include "reslib.h" +#include "libs/reslib.h" #include "gamestr.h" #include "init.h" +#include "element.h" #include "hyper.h" #include "planets/lander.h" #include "starcon.h" diff --git a/sc2/src/sc2code/coderes.h b/sc2/src/sc2code/coderes.h index 543d7bfe7..b23f99d69 100644 --- a/sc2/src/sc2code/coderes.h +++ b/sc2/src/sc2code/coderes.h @@ -19,7 +19,7 @@ #ifndef _CODERES_H #define _CODERES_H -#include "reslib.h" +#include "libs/reslib.h" extern BOOLEAN InstallCodeResType (void); extern void *LoadCodeResInstance (RESOURCE res); diff --git a/sc2/src/sc2code/comm/commall.h b/sc2/src/sc2code/comm/commall.h index c26030446..f84c59e38 100644 --- a/sc2/src/sc2code/comm/commall.h +++ b/sc2/src/sc2code/comm/commall.h @@ -21,7 +21,7 @@ #include "comm.h" #include "commglue.h" #include "encount.h" -#include "reslib.h" +#include "libs/reslib.h" #endif /* _COMMALL_H */ diff --git a/sc2/src/sc2code/cons_res.h b/sc2/src/sc2code/cons_res.h index 13875a7f8..6ed5bd456 100644 --- a/sc2/src/sc2code/cons_res.h +++ b/sc2/src/sc2code/cons_res.h @@ -17,8 +17,8 @@ #ifndef CONS_RES_H_ #define CONS_RES_H_ -#include "gfxlib.h" -#include "sndlib.h" +#include "libs/gfxlib.h" +#include "libs/sndlib.h" void load_gravity_well (BYTE selector); void free_gravity_well (void); diff --git a/sc2/src/sc2code/controls.h b/sc2/src/sc2code/controls.h index 536c707ad..207243b6a 100644 --- a/sc2/src/sc2code/controls.h +++ b/sc2/src/sc2code/controls.h @@ -147,7 +147,7 @@ typedef struct textentry_state } TEXTENTRY_STATE; -BOOLEAN DoTextEntry (TEXTENTRY_STATE *pTES); +extern BOOLEAN DoTextEntry (TEXTENTRY_STATE *pTES); #endif diff --git a/sc2/src/sc2code/cyborg.c b/sc2/src/sc2code/cyborg.c index f5b001bc5..2204f282c 100644 --- a/sc2/src/sc2code/cyborg.c +++ b/sc2/src/sc2code/cyborg.c @@ -16,10 +16,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "battle.h" #include "colors.h" #include "collide.h" #include "element.h" +#include "ship.h" #include "globdata.h" #include "intel.h" #include "setup.h" diff --git a/sc2/src/sc2code/demo.c b/sc2/src/sc2code/demo.c index b33b603be..78b26fa7b 100644 --- a/sc2/src/sc2code/demo.c +++ b/sc2/src/sc2code/demo.c @@ -17,7 +17,8 @@ */ #include "demo.h" -#include "declib.h" +#include "libs/declib.h" +#include "setup.h" #if DEMO_MODE || CREATE_JOURNAL static DECODE_REF journal_fh; diff --git a/sc2/src/sc2code/displist.h b/sc2/src/sc2code/displist.h index ef9b2c4b2..e52eabf7d 100644 --- a/sc2/src/sc2code/displist.h +++ b/sc2/src/sc2code/displist.h @@ -21,8 +21,8 @@ #include #include "port.h" -#include "compiler.h" -#include "misc.h" +#include "libs/compiler.h" +#include "libs/misc.h" // Note that we MUST use the QUEUE_TABLE variant at this time, because // certain gameplay elements depend on it. Namely, the maximum number diff --git a/sc2/src/sc2code/element.h b/sc2/src/sc2code/element.h index b4623799d..747a2c1a1 100644 --- a/sc2/src/sc2code/element.h +++ b/sc2/src/sc2code/element.h @@ -19,25 +19,11 @@ #ifndef _ELEMENT_H #define _ELEMENT_H -#include "battle.h" #include "displist.h" #include "units.h" #include "velocity.h" #include "libs/gfxlib.h" -#define BATTLE_FRAME_RATE (ONE_SECOND / 24) - -#define SHIP_INFO_HEIGHT 65 -#define CAPTAIN_XOFFS 4 -#define CAPTAIN_YOFFS (SHIP_INFO_HEIGHT + 4) -#define SHIP_STATUS_HEIGHT (STATUS_HEIGHT >> 1) -#define BAD_GUY_YOFFS 0 -#define GOOD_GUY_YOFFS SHIP_STATUS_HEIGHT -#define STARCON_TEXT_HEIGHT 7 -#define TINY_TEXT_HEIGHT 9 - -#define BATTLE_CREW_X 10 -#define BATTLE_CREW_Y (64 - SAFE_Y) #define NORMAL_LIFE 1 @@ -157,6 +143,11 @@ struct element HELEMENT hTarget; }; +extern QUEUE disp_q; +// The maximum number of elements is chosen to provide a slight margin. +// Currently, it is maximum *known used* in Melee + 30 +#define MAX_DISPLAY_ELEMENTS 150 + #define MAX_DISPLAY_PRIMS 330 extern COUNT DisplayFreeList; extern PRIMITIVE DisplayArray[MAX_DISPLAY_PRIMS]; @@ -200,19 +191,10 @@ extern void FreeElement (HELEMENT hElement); #define GetSuccElement(l) _GetSuccLink (l) extern void RemoveElement (HLINK hLink); -extern void RedrawQueue (BOOLEAN clear); -extern BOOLEAN DeltaEnergy (ELEMENT *ElementPtr, SIZE energy_delta); -extern BOOLEAN DeltaCrew (ELEMENT *ElementPtr, SIZE crew_delta); - -extern void PreProcessStatus (ELEMENT *ShipPtr); -extern void PostProcessStatus (ELEMENT *ShipPtr); - +// XXX: The following functions should not really be here extern void spawn_planet (void); extern void spawn_asteroid (ELEMENT *ElementPtr); -extern void animation_preprocess (ELEMENT *ElementPtr); extern void do_damage (ELEMENT *ElementPtr, SIZE damage); -extern void collision (ELEMENT *ElementPtr0, POINT *pPt0, - ELEMENT *ElementPtr1, POINT *pPt1); extern void crew_preprocess (ELEMENT *ElementPtr); extern void crew_collision (ELEMENT *ElementPtr0, POINT *pPt0, ELEMENT *ElementPtr1, POINT *pPt1); @@ -221,42 +203,11 @@ extern void AbandonShip (ELEMENT *ShipPtr, ELEMENT *TargetPtr, extern BOOLEAN TimeSpaceMatterConflict (ELEMENT *ElementPtr); extern COUNT PlotIntercept (ELEMENT *ElementPtr0, ELEMENT *ElementPtr1, COUNT max_turns, COUNT margin_of_error); -extern BOOLEAN LoadKernel (int argc, char *argv[]); -extern void FreeKernel (void); - -extern void InitDisplayList (void); extern void InitGalaxy (void); extern void MoveGalaxy (VIEW_STATE view_state, SIZE dx, SIZE dy); -extern void ship_preprocess (ELEMENT *ElementPtr); -extern void ship_postprocess (ELEMENT *ElementPtr); -extern void ship_death (ELEMENT *ShipPtr); -extern BOOLEAN hyper_transition (ELEMENT *ElementPtr); extern BOOLEAN CalculateGravity (ELEMENT *ElementPtr); -extern void SetUpElement (ELEMENT *ElementPtr); - -extern void BattleSong (BOOLEAN DoPlay); -extern void FreeBattleSong (void); - -extern void InsertPrim (PRIM_LINKS *pLinks, COUNT primIndex, COUNT iPI); - - -typedef UWORD STATUS_FLAGS; - -/* STATUS_FLAGS - heat of battle specific flags */ -#define LEFT (1 << 0) -#define RIGHT (1 << 1) -#define THRUST (1 << 2) -#define WEAPON (1 << 3) -#define SPECIAL (1 << 4) -#define LOW_ON_ENERGY (1 << 5) -#define SHIP_BEYOND_MAX_SPEED (1 << 6) -#define SHIP_AT_MAX_SPEED (1 << 7) -#define SHIP_IN_GRAVITY_WELL (1 << 8) -#define PLAY_VICTORY_DITTY (1 << 9) - -extern STATUS_FLAGS inertial_thrust (ELEMENT *ElementPtr); #endif /* _ELEMENT_H */ diff --git a/sc2/src/sc2code/encount.c b/sc2/src/sc2code/encount.c index 13ee4f603..f9231d116 100644 --- a/sc2/src/sc2code/encount.c +++ b/sc2/src/sc2code/encount.c @@ -28,6 +28,7 @@ #include "gamestr.h" #include "globdata.h" #include "init.h" +#include "pickship.h" #include "intel.h" #include "nameref.h" #include "resinst.h" diff --git a/sc2/src/sc2code/fmv.c b/sc2/src/sc2code/fmv.c index 54cef8d66..8ef9751b6 100644 --- a/sc2/src/sc2code/fmv.c +++ b/sc2/src/sc2code/fmv.c @@ -26,7 +26,7 @@ #include "nameref.h" #include "settings.h" #include "setup.h" -#include "vidlib.h" +#include "libs/vidlib.h" #include "libs/graphics/gfx_common.h" #include "libs/inplib.h" diff --git a/sc2/src/sc2code/galaxy.c b/sc2/src/sc2code/galaxy.c index db3693205..9fdac7574 100644 --- a/sc2/src/sc2code/galaxy.c +++ b/sc2/src/sc2code/galaxy.c @@ -21,6 +21,7 @@ #include "element.h" #include "globdata.h" #include "init.h" +#include "process.h" #include "units.h" #include "options.h" #include "libs/compiler.h" diff --git a/sc2/src/sc2code/gameopt.c b/sc2/src/sc2code/gameopt.c index 6045273b7..130070794 100644 --- a/sc2/src/sc2code/gameopt.c +++ b/sc2/src/sc2code/gameopt.c @@ -25,7 +25,7 @@ #include "encount.h" #include "planets/lander.h" #include "gamestr.h" -#include "inplib.h" +#include "libs/inplib.h" #include "load.h" #include "options.h" #include "save.h" diff --git a/sc2/src/sc2code/gameopt.h b/sc2/src/sc2code/gameopt.h index 0d7b7e8cd..3e6486056 100644 --- a/sc2/src/sc2code/gameopt.h +++ b/sc2/src/sc2code/gameopt.h @@ -16,7 +16,7 @@ #ifndef _GAMEOPT_H #define _GAMEOPT_H -#include "compiler.h" +#include "libs/compiler.h" #include "libs/gfxlib.h" extern void ConfirmSaveLoad (STAMP *MsgStamp); diff --git a/sc2/src/sc2code/grpinfo.c b/sc2/src/sc2code/grpinfo.c index 2f22acf85..0336746f8 100644 --- a/sc2/src/sc2code/grpinfo.c +++ b/sc2/src/sc2code/grpinfo.c @@ -18,7 +18,7 @@ #include "build.h" #include "encount.h" -#include "file.h" +#include "libs/file.h" #include "globdata.h" #include "intel.h" #include "sis.h" diff --git a/sc2/src/sc2code/hyper.c b/sc2/src/sc2code/hyper.c index c958a6843..b8daf7306 100644 --- a/sc2/src/sc2code/hyper.c +++ b/sc2/src/sc2code/hyper.c @@ -23,6 +23,8 @@ #include "colors.h" #include "controls.h" #include "encount.h" +#include "ship.h" +#include "process.h" #include "globdata.h" #include "init.h" #include "nameref.h" diff --git a/sc2/src/sc2code/hyper.h b/sc2/src/sc2code/hyper.h index 4d228144b..1b2393c43 100644 --- a/sc2/src/sc2code/hyper.h +++ b/sc2/src/sc2code/hyper.h @@ -19,9 +19,11 @@ #ifndef _HYPER_H #define _HYPER_H +#include "element.h" extern void FreeHyperData (void); extern void check_hyperspace_encounter (void); +extern BOOLEAN hyper_transition (ELEMENT *ElementPtr); #endif /* _HYPER_H */ diff --git a/sc2/src/sc2code/init.c b/sc2/src/sc2code/init.c index 3bca8cec8..2546d629a 100644 --- a/sc2/src/sc2code/init.c +++ b/sc2/src/sc2code/init.c @@ -19,12 +19,16 @@ #include "build.h" #include "colors.h" #include "cons_res.h" +#include "races.h" #include "element.h" +#include "tactrans.h" +#include "pickship.h" +#include "process.h" #include "globdata.h" #include "init.h" #include "port.h" #include "resinst.h" -#include "reslib.h" +#include "libs/reslib.h" #include "nameref.h" #include "setup.h" #include "units.h" @@ -281,7 +285,6 @@ UninitShips (void) hElement != 0; hElement = hNextElement) { ELEMENT *ElementPtr; - extern void new_ship (ELEMENT *ElementPtr); LockElement (hElement, &ElementPtr); hNextElement = GetSuccElement (ElementPtr); diff --git a/sc2/src/sc2code/init.h b/sc2/src/sc2code/init.h index 927e5b9a4..f9dba517e 100644 --- a/sc2/src/sc2code/init.h +++ b/sc2/src/sc2code/init.h @@ -18,6 +18,7 @@ #define _INIT_H #include "libs/gfxlib.h" +#include "libs/reslib.h" #define NUM_PLAYERS 2 #define NUM_SIDES 2 @@ -30,5 +31,9 @@ extern void UninitSpace (void); extern SIZE InitShips (void); extern void UninitShips (void); +extern BOOLEAN load_animation (FRAME *pixarray, RESOURCE big_res, + RESOURCE med_res, RESOURCE sml_res); +extern BOOLEAN free_image (FRAME *pixarray); + #endif /* _INIT_H */ diff --git a/sc2/src/sc2code/ipdisp.c b/sc2/src/sc2code/ipdisp.c index f75966249..d4a573d7e 100644 --- a/sc2/src/sc2code/ipdisp.c +++ b/sc2/src/sc2code/ipdisp.c @@ -16,10 +16,13 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include "ipdisp.h" + #include "collide.h" #include "globdata.h" #include "init.h" #include "races.h" +#include "process.h" #include "grpinfo.h" #include "encount.h" #include "libs/mathlib.h" diff --git a/sc2/src/sc2code/ipdisp.h b/sc2/src/sc2code/ipdisp.h new file mode 100644 index 000000000..85c3d3ae4 --- /dev/null +++ b/sc2/src/sc2code/ipdisp.h @@ -0,0 +1,25 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef UQM_IPDISP_H_INCL_ +#define UQM_IPDISP_H_INCL_ + +#include "libs/compiler.h" + +extern void NotifyOthers (COUNT which_race, BYTE target_loc); +extern void DoMissions (void); + +#endif /* UQM_IPDISP_H_INCL_ */ diff --git a/sc2/src/sc2code/libs/decomp/lzdecode.c b/sc2/src/sc2code/libs/decomp/lzdecode.c index 82aaab1bb..26d53cefe 100644 --- a/sc2/src/sc2code/libs/decomp/lzdecode.c +++ b/sc2/src/sc2code/libs/decomp/lzdecode.c @@ -29,7 +29,7 @@ #include #include #include "libs/decomp/lzh.h" -#include "reslib.h" +#include "libs/reslib.h" PLZHCODE_DESC _lpCurCodeDesc; STREAM_TYPE _StreamType; diff --git a/sc2/src/sc2code/libs/decomp/lzencode.c b/sc2/src/sc2code/libs/decomp/lzencode.c index c72ddb2e0..7d0d54496 100644 --- a/sc2/src/sc2code/libs/decomp/lzencode.c +++ b/sc2/src/sc2code/libs/decomp/lzencode.c @@ -26,7 +26,7 @@ #include #include "lzh.h" -#include "reslib.h" +#include "libs/reslib.h" static UWORD match_position, match_length; static SWORD *lson; diff --git a/sc2/src/sc2code/libs/decomp/lzh.h b/sc2/src/sc2code/libs/decomp/lzh.h index e46949751..c5d6e5746 100644 --- a/sc2/src/sc2code/libs/decomp/lzh.h +++ b/sc2/src/sc2code/libs/decomp/lzh.h @@ -19,8 +19,8 @@ #ifndef _LZH_H #define _LZH_H -#include "declib.h" -#include "misc.h" +#include "libs/declib.h" +#include "libs/misc.h" /* LZSS Parameters */ diff --git a/sc2/src/sc2code/libs/file/dirs.c b/sc2/src/sc2code/libs/file/dirs.c index 734f44b43..16548b3d5 100644 --- a/sc2/src/sc2code/libs/file/dirs.c +++ b/sc2/src/sc2code/libs/file/dirs.c @@ -25,8 +25,8 @@ #include "port.h" #include "config.h" #include "filintrn.h" -#include "compiler.h" -#include "misc.h" +#include "libs/compiler.h" +#include "libs/misc.h" #include "libs/log.h" #ifdef HAVE_DRIVE_LETTERS diff --git a/sc2/src/sc2code/libs/file/files.c b/sc2/src/sc2code/libs/file/files.c index ffe952fbb..1e99466b4 100644 --- a/sc2/src/sc2code/libs/file/files.c +++ b/sc2/src/sc2code/libs/file/files.c @@ -22,11 +22,11 @@ #include #include #include "port.h" -#include "uio.h" +#include "libs/uio.h" #include "config.h" #include "types.h" #include "filintrn.h" -#include "misc.h" +#include "libs/misc.h" #include "libs/log.h" static int copyError(uio_Handle *srcHandle, uio_Handle *dstHandle, diff --git a/sc2/src/sc2code/libs/gfxlib.h b/sc2/src/sc2code/libs/gfxlib.h index 3b8a32365..172b557d8 100644 --- a/sc2/src/sc2code/libs/gfxlib.h +++ b/sc2/src/sc2code/libs/gfxlib.h @@ -19,8 +19,8 @@ #ifndef _GFXLIB_H #define _GFXLIB_H -#include "compiler.h" -#include "reslib.h" +#include "libs/compiler.h" +#include "libs/reslib.h" typedef struct context_desc CONTEXT_DESC; typedef struct frame_desc FRAME_DESC; diff --git a/sc2/src/sc2code/libs/graphics/drawable.c b/sc2/src/sc2code/libs/graphics/drawable.c index 9301ce3f9..77b927023 100644 --- a/sc2/src/sc2code/libs/graphics/drawable.c +++ b/sc2/src/sc2code/libs/graphics/drawable.c @@ -17,7 +17,7 @@ */ #include "gfxintrn.h" -#include "misc.h" +#include "libs/misc.h" #include "tfb_draw.h" #include "units.h" #include "libs/mathlib.h" diff --git a/sc2/src/sc2code/libs/graphics/drawcmd.h b/sc2/src/sc2code/libs/graphics/drawcmd.h index 25fe06c1b..1edcb1f11 100644 --- a/sc2/src/sc2code/libs/graphics/drawcmd.h +++ b/sc2/src/sc2code/libs/graphics/drawcmd.h @@ -19,7 +19,7 @@ #ifndef DRAWCMD_H #define DRAWCMD_H -#include "graphics/tfb_draw.h" +#include "libs/graphics/tfb_draw.h" enum { diff --git a/sc2/src/sc2code/libs/graphics/frame.c b/sc2/src/sc2code/libs/graphics/frame.c index c9dd19eba..7cd51b6e8 100644 --- a/sc2/src/sc2code/libs/graphics/frame.c +++ b/sc2/src/sc2code/libs/graphics/frame.c @@ -17,7 +17,6 @@ */ #include "gfxintrn.h" -#include "declib.h" #include "gfx_common.h" #include "tfb_draw.h" #include "tfb_prim.h" diff --git a/sc2/src/sc2code/libs/graphics/gfxintrn.h b/sc2/src/sc2code/libs/graphics/gfxintrn.h index 276274c65..84351dc80 100644 --- a/sc2/src/sc2code/libs/graphics/gfxintrn.h +++ b/sc2/src/sc2code/libs/graphics/gfxintrn.h @@ -22,8 +22,8 @@ #include #include -#include "gfxlib.h" -#include "reslib.h" +#include "libs/gfxlib.h" +#include "libs/reslib.h" #include "context.h" #include "drawable.h" #include "font.h" diff --git a/sc2/src/sc2code/libs/graphics/sdl/3do_blt.c b/sc2/src/sc2code/libs/graphics/sdl/3do_blt.c index 7e809ea26..a12a74d99 100644 --- a/sc2/src/sc2code/libs/graphics/sdl/3do_blt.c +++ b/sc2/src/sc2code/libs/graphics/sdl/3do_blt.c @@ -19,7 +19,7 @@ #ifdef GFXMODULE_SDL #include "sdl_common.h" -#include "graphics/tfb_draw.h" +#include "libs/graphics/tfb_draw.h" #include "libs/log.h" static void diff --git a/sc2/src/sc2code/libs/graphics/sdl/3do_funcs.c b/sc2/src/sc2code/libs/graphics/sdl/3do_funcs.c index 43b9a3f1f..02dd5a5cd 100644 --- a/sc2/src/sc2code/libs/graphics/sdl/3do_funcs.c +++ b/sc2/src/sc2code/libs/graphics/sdl/3do_funcs.c @@ -23,8 +23,8 @@ #include "opengl.h" #include "primitives.h" #include "units.h" -#include "graphics/drawcmd.h" -#include "graphics/tfb_draw.h" +#include "libs/graphics/drawcmd.h" +#include "libs/graphics/tfb_draw.h" int batch_depth = 0; diff --git a/sc2/src/sc2code/libs/graphics/sdl/bbox.h b/sc2/src/sc2code/libs/graphics/sdl/bbox.h index 3138324f1..43c9dddec 100644 --- a/sc2/src/sc2code/libs/graphics/sdl/bbox.h +++ b/sc2/src/sc2code/libs/graphics/sdl/bbox.h @@ -14,9 +14,9 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gfxlib.h" -#include "graphics/tfb_draw.h" -#include "graphics/gfx_common.h" +#include "libs/gfxlib.h" +#include "libs/graphics/tfb_draw.h" +#include "libs/graphics/gfx_common.h" #ifndef _BBOX_H_ #define _BBOX_H_ diff --git a/sc2/src/sc2code/libs/graphics/sdl/rotozoom.c b/sc2/src/sc2code/libs/graphics/sdl/rotozoom.c index a281fb911..dcccb67f2 100644 --- a/sc2/src/sc2code/libs/graphics/sdl/rotozoom.c +++ b/sc2/src/sc2code/libs/graphics/sdl/rotozoom.c @@ -13,7 +13,7 @@ #include #include -#include "misc.h" +#include "libs/misc.h" #include "port.h" #include "rotozoom.h" diff --git a/sc2/src/sc2code/libs/graphics/sdl/sdl_common.c b/sc2/src/sc2code/libs/graphics/sdl/sdl_common.c index a9df62104..a8bdd1966 100644 --- a/sc2/src/sc2code/libs/graphics/sdl/sdl_common.c +++ b/sc2/src/sc2code/libs/graphics/sdl/sdl_common.c @@ -32,7 +32,7 @@ #include "libs/uio.h" #include "libs/log.h" #include "controls.h" -#include "vidlib.h" +#include "libs/vidlib.h" // XXX: Should not be included from here. #include "uqmdebug.h" #include SDL_INCLUDE(SDL_thread.h) diff --git a/sc2/src/sc2code/libs/graphics/tfb_draw.h b/sc2/src/sc2code/libs/graphics/tfb_draw.h index a1c9519d3..e682016a8 100644 --- a/sc2/src/sc2code/libs/graphics/tfb_draw.h +++ b/sc2/src/sc2code/libs/graphics/tfb_draw.h @@ -40,7 +40,7 @@ typedef struct tfb_palette UBYTE unused; } TFB_Palette; -#include "graphics/gfx_common.h" +#include "libs/graphics/gfx_common.h" #include "cmap.h" typedef struct tfb_image diff --git a/sc2/src/sc2code/libs/graphics/tfb_prim.h b/sc2/src/sc2code/libs/graphics/tfb_prim.h index 7d241bdb4..d593b9cb8 100644 --- a/sc2/src/sc2code/libs/graphics/tfb_prim.h +++ b/sc2/src/sc2code/libs/graphics/tfb_prim.h @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gfxlib.h" +#include "libs/gfxlib.h" #include "tfb_draw.h" diff --git a/sc2/src/sc2code/libs/graphics/widgets.c b/sc2/src/sc2code/libs/graphics/widgets.c index 5fb150e97..b87a04a68 100644 --- a/sc2/src/sc2code/libs/graphics/widgets.c +++ b/sc2/src/sc2code/libs/graphics/widgets.c @@ -14,10 +14,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "graphics/gfx_common.h" -#include "graphics/widgets.h" +#include "gfx_common.h" +#include "widgets.h" #include "colors.h" -#include "strlib.h" +#include "libs/strlib.h" #include "setup.h" #include "units.h" diff --git a/sc2/src/sc2code/libs/inplib.h b/sc2/src/sc2code/libs/inplib.h index 84fd0e115..418ace3fd 100644 --- a/sc2/src/sc2code/libs/inplib.h +++ b/sc2/src/sc2code/libs/inplib.h @@ -20,7 +20,7 @@ #define _INPLIB_H #include -#include "compiler.h" +#include "libs/compiler.h" #include "libs/uio.h" typedef DWORD INPUT_STATE; diff --git a/sc2/src/sc2code/libs/input/inpintrn.h b/sc2/src/sc2code/libs/input/inpintrn.h index dd2e5da08..78859302d 100644 --- a/sc2/src/sc2code/libs/input/inpintrn.h +++ b/sc2/src/sc2code/libs/input/inpintrn.h @@ -19,7 +19,7 @@ #ifndef _INPINTRN_H #define _INPINTRN_H -#include "inplib.h" +#include "libs/inplib.h" #endif /* _INPINTRN_H */ diff --git a/sc2/src/sc2code/libs/input/sdl/input.c b/sc2/src/sc2code/libs/input/sdl/input.c index 86fd83cbb..1c68e77c7 100644 --- a/sc2/src/sc2code/libs/input/sdl/input.c +++ b/sc2/src/sc2code/libs/input/sdl/input.c @@ -24,7 +24,7 @@ #include "libs/input/input_common.h" #include "libs/input/sdl/vcontrol.h" #include "libs/input/sdl/keynames.h" -#include "misc.h" +#include "libs/misc.h" #include "controls.h" #include "libs/file.h" #include "libs/log.h" diff --git a/sc2/src/sc2code/libs/input/sdl/vcontrol.c b/sc2/src/sc2code/libs/input/sdl/vcontrol.c index 95fb9a13f..fe73d7dfe 100644 --- a/sc2/src/sc2code/libs/input/sdl/vcontrol.c +++ b/sc2/src/sc2code/libs/input/sdl/vcontrol.c @@ -20,7 +20,7 @@ #include #include #include "vcontrol.h" -#include "misc.h" +#include "libs/misc.h" #include "keynames.h" #include "libs/log.h" #include "libs/reslib.h" diff --git a/sc2/src/sc2code/libs/list/list.c b/sc2/src/sc2code/libs/list/list.c index 76c921c0e..87ca168a3 100644 --- a/sc2/src/sc2code/libs/list/list.c +++ b/sc2/src/sc2code/libs/list/list.c @@ -25,7 +25,7 @@ # include "list.h" #endif -#include "misc.h" +#include "libs/misc.h" #define malloc HMalloc #define free HFree #define realloc HRealloc diff --git a/sc2/src/sc2code/libs/math/mthintrn.h b/sc2/src/sc2code/libs/math/mthintrn.h index 0cd02a3e6..fbf9e801d 100644 --- a/sc2/src/sc2code/libs/math/mthintrn.h +++ b/sc2/src/sc2code/libs/math/mthintrn.h @@ -19,7 +19,7 @@ #ifndef _MTHINTRN_H #define _MTHINTRN_H -#include "mathlib.h" +#include "libs/mathlib.h" #endif /* _MTHINTRN_H */ diff --git a/sc2/src/sc2code/libs/mathlib.h b/sc2/src/sc2code/libs/mathlib.h index ef11b166d..fca48fdd4 100644 --- a/sc2/src/sc2code/libs/mathlib.h +++ b/sc2/src/sc2code/libs/mathlib.h @@ -19,7 +19,7 @@ #ifndef _MATHLIB_H #define _MATHLIB_H -#include "compiler.h" +#include "libs/compiler.h" #include "math/random.h" extern COUNT square_root (DWORD value); diff --git a/sc2/src/sc2code/libs/memlib.h b/sc2/src/sc2code/libs/memlib.h index d8d2761e9..d64b98076 100644 --- a/sc2/src/sc2code/libs/memlib.h +++ b/sc2/src/sc2code/libs/memlib.h @@ -19,7 +19,7 @@ #ifndef _MEMLIB_H #define _MEMLIB_H -#include "compiler.h" +#include "libs/compiler.h" extern BOOLEAN mem_init (void); extern BOOLEAN mem_uninit (void); diff --git a/sc2/src/sc2code/libs/memory/w_memlib.c b/sc2/src/sc2code/libs/memory/w_memlib.c index 83e4c4127..f0faf0475 100644 --- a/sc2/src/sc2code/libs/memory/w_memlib.c +++ b/sc2/src/sc2code/libs/memory/w_memlib.c @@ -24,7 +24,7 @@ //#include "tool.h" //#include "utils.h" //#include "pcwin.h" -#include "compiler.h" +#include "libs/compiler.h" #ifdef LEGACY_HANDLE_ALLOCATOR #include "libs/threadlib.h" #endif diff --git a/sc2/src/sc2code/libs/reslib.h b/sc2/src/sc2code/libs/reslib.h index f69e3128b..53e041765 100644 --- a/sc2/src/sc2code/libs/reslib.h +++ b/sc2/src/sc2code/libs/reslib.h @@ -20,9 +20,9 @@ #define _RESLIB_H //#include -#include "compiler.h" +#include "libs/compiler.h" #include "port.h" -#include "misc.h" +#include "libs/misc.h" #include "libs/uio.h" typedef struct resource_index_desc RESOURCE_INDEX_DESC; @@ -59,6 +59,7 @@ long LengthResFile (uio_Stream *fp); BOOLEAN res_CloseResFile (uio_Stream *fp); BOOLEAN DeleteResFile (uio_DirHandle *dir, const char *filename); +RESOURCE_INDEX InitResourceSystem (void); void UninitResourceSystem (void); BOOLEAN InstallResTypeVectors (const char *res_type, ResourceLoadFun *loadFun, ResourceFreeFun *freeFun, ResourceStringFun *stringFun); void *res_GetResource (RESOURCE res); diff --git a/sc2/src/sc2code/libs/resource/direct.c b/sc2/src/sc2code/libs/resource/direct.c index 35e4830c5..17b2d7e8a 100644 --- a/sc2/src/sc2code/libs/resource/direct.c +++ b/sc2/src/sc2code/libs/resource/direct.c @@ -17,7 +17,7 @@ */ #include "libs/strings/strintrn.h" -#include "misc.h" +#include "libs/misc.h" #include "port.h" #include "libs/uio.h" #include diff --git a/sc2/src/sc2code/libs/resource/index.h b/sc2/src/sc2code/libs/resource/index.h index b72b23f70..f563c0a01 100644 --- a/sc2/src/sc2code/libs/resource/index.h +++ b/sc2/src/sc2code/libs/resource/index.h @@ -20,7 +20,7 @@ #define _INDEX_H #include -#include "reslib.h" +#include "libs/reslib.h" #include "libs/uio/charhashtable.h" typedef struct resource_handlers diff --git a/sc2/src/sc2code/libs/resource/loadres.c b/sc2/src/sc2code/libs/resource/loadres.c index 163fa1a9e..99d0925ae 100644 --- a/sc2/src/sc2code/libs/resource/loadres.c +++ b/sc2/src/sc2code/libs/resource/loadres.c @@ -17,7 +17,7 @@ */ #include "resintrn.h" -#include "declib.h" +#include "libs/declib.h" void * GetResourceData (uio_Stream *fp, DWORD length) diff --git a/sc2/src/sc2code/libs/resource/propfile.c b/sc2/src/sc2code/libs/resource/propfile.c index ed09ce2f3..b6bf377a9 100644 --- a/sc2/src/sc2code/libs/resource/propfile.c +++ b/sc2/src/sc2code/libs/resource/propfile.c @@ -21,7 +21,7 @@ #include #include "libs/log.h" #include "propfile.h" -#include "reslib.h" +#include "libs/reslib.h" void PropFile_from_string (char *d, PROPERTY_HANDLER handler, const char *prefix) diff --git a/sc2/src/sc2code/libs/resource/propfile.h b/sc2/src/sc2code/libs/resource/propfile.h index 8da250676..edc8c3641 100644 --- a/sc2/src/sc2code/libs/resource/propfile.h +++ b/sc2/src/sc2code/libs/resource/propfile.h @@ -19,7 +19,7 @@ #ifndef PROPFILE_H_ #define PROPFILE_H_ -#include "uio.h" +#include "libs/uio.h" typedef void (*PROPERTY_HANDLER) (const char *, const char *); diff --git a/sc2/src/sc2code/libs/resource/resinit.c b/sc2/src/sc2code/libs/resource/resinit.c index 2afd800cd..541d08a8f 100644 --- a/sc2/src/sc2code/libs/resource/resinit.c +++ b/sc2/src/sc2code/libs/resource/resinit.c @@ -17,7 +17,7 @@ */ #include "resintrn.h" -#include "misc.h" +#include "libs/misc.h" #include "options.h" #include "nameref.h" #include "types.h" diff --git a/sc2/src/sc2code/libs/resource/resintrn.h b/sc2/src/sc2code/libs/resource/resintrn.h index cd14776c2..35ddb2c3b 100644 --- a/sc2/src/sc2code/libs/resource/resintrn.h +++ b/sc2/src/sc2code/libs/resource/resintrn.h @@ -20,7 +20,7 @@ #define _RESINTRN_H #include -#include "reslib.h" +#include "libs/reslib.h" #include "index.h" ResourceDesc *lookupResourceDesc (RESOURCE_INDEX idx, RESOURCE res); diff --git a/sc2/src/sc2code/libs/sndlib.h b/sc2/src/sc2code/libs/sndlib.h index a60d2439d..6fcb60c3f 100644 --- a/sc2/src/sc2code/libs/sndlib.h +++ b/sc2/src/sc2code/libs/sndlib.h @@ -19,7 +19,7 @@ #ifndef _SNDLIB_H #define _SNDLIB_H -#include "strlib.h" +#include "libs/strlib.h" typedef STRING_TABLE SOUND_REF; typedef STRING SOUND; diff --git a/sc2/src/sc2code/libs/sound/decoders/aiffaud.c b/sc2/src/sc2code/libs/sound/decoders/aiffaud.c index d11807bd9..ae4574c57 100644 --- a/sc2/src/sc2code/libs/sound/decoders/aiffaud.c +++ b/sc2/src/sc2code/libs/sound/decoders/aiffaud.c @@ -31,7 +31,7 @@ #include #include "port.h" #include "types.h" -#include "uio.h" +#include "libs/uio.h" #include "endian_uqm.h" #include "libs/misc.h" #include "libs/log.h" diff --git a/sc2/src/sc2code/libs/sound/decoders/decoder.h b/sc2/src/sc2code/libs/sound/decoders/decoder.h index 6dc76b741..2d6983c9c 100644 --- a/sc2/src/sc2code/libs/sound/decoders/decoder.h +++ b/sc2/src/sc2code/libs/sound/decoders/decoder.h @@ -23,7 +23,7 @@ #include "port.h" #include "types.h" -#include "uio.h" +#include "libs/uio.h" #ifndef OVCODEC_NONE # ifdef _MSC_VER diff --git a/sc2/src/sc2code/libs/sound/decoders/dukaud.c b/sc2/src/sc2code/libs/sound/decoders/dukaud.c index 449bf7b84..78f5c1069 100644 --- a/sc2/src/sc2code/libs/sound/decoders/dukaud.c +++ b/sc2/src/sc2code/libs/sound/decoders/dukaud.c @@ -23,7 +23,7 @@ #include "libs/misc.h" #include "port.h" #include "types.h" -#include "uio.h" +#include "libs/uio.h" #include "dukaud.h" #include "decoder.h" #include "endian_uqm.h" diff --git a/sc2/src/sc2code/libs/sound/decoders/modaud.c b/sc2/src/sc2code/libs/sound/decoders/modaud.c index 31ada3901..a335579f4 100644 --- a/sc2/src/sc2code/libs/sound/decoders/modaud.c +++ b/sc2/src/sc2code/libs/sound/decoders/modaud.c @@ -24,7 +24,7 @@ #include "port.h" #include "types.h" #include "endian_uqm.h" -#include "uio.h" +#include "libs/uio.h" #include "decoder.h" #include "libs/sound/audiocore.h" #include "libs/log.h" diff --git a/sc2/src/sc2code/libs/sound/decoders/oggaud.c b/sc2/src/sc2code/libs/sound/decoders/oggaud.c index a4920091c..3bdc044a2 100644 --- a/sc2/src/sc2code/libs/sound/decoders/oggaud.c +++ b/sc2/src/sc2code/libs/sound/decoders/oggaud.c @@ -24,7 +24,7 @@ #include "libs/log.h" #include "port.h" #include "types.h" -#include "uio.h" +#include "libs/uio.h" #include "decoder.h" #ifdef OVCODEC_TREMOR # include diff --git a/sc2/src/sc2code/libs/sound/decoders/wav.c b/sc2/src/sc2code/libs/sound/decoders/wav.c index cae46b988..f1e376eb4 100644 --- a/sc2/src/sc2code/libs/sound/decoders/wav.c +++ b/sc2/src/sc2code/libs/sound/decoders/wav.c @@ -22,7 +22,7 @@ #include #include "port.h" #include "types.h" -#include "uio.h" +#include "libs/uio.h" #include "endian_uqm.h" #include "libs/misc.h" #include "libs/log.h" diff --git a/sc2/src/sc2code/libs/sound/fileinst.c b/sc2/src/sc2code/libs/sound/fileinst.c index e9de214f4..0ab7644da 100644 --- a/sc2/src/sc2code/libs/sound/fileinst.c +++ b/sc2/src/sc2code/libs/sound/fileinst.c @@ -18,7 +18,7 @@ #include "sndintrn.h" #include "options.h" -#include "reslib.h" +#include "libs/reslib.h" #include diff --git a/sc2/src/sc2code/libs/sound/music.c b/sc2/src/sc2code/libs/sound/music.c index dc7c3c860..9e1535ebb 100644 --- a/sc2/src/sc2code/libs/sound/music.c +++ b/sc2/src/sc2code/libs/sound/music.c @@ -15,7 +15,7 @@ */ #include -#include "file.h" +#include "libs/file.h" #include "options.h" #include "sound.h" #include "libs/reslib.h" diff --git a/sc2/src/sc2code/libs/sound/sndintrn.h b/sc2/src/sc2code/libs/sound/sndintrn.h index 56d5b86be..f01cd3a71 100644 --- a/sc2/src/sc2code/libs/sound/sndintrn.h +++ b/sc2/src/sc2code/libs/sound/sndintrn.h @@ -20,8 +20,8 @@ #define _SNDINTRN_H #include -#include "sndlib.h" -#include "reslib.h" +#include "libs/sndlib.h" +#include "libs/reslib.h" extern void *_GetMusicData (uio_Stream *fp, DWORD length); extern BOOLEAN _ReleaseMusicData (void *handle); diff --git a/sc2/src/sc2code/libs/sound/sound.h b/sc2/src/sc2code/libs/sound/sound.h index f91307659..505a8c2fc 100644 --- a/sc2/src/sc2code/libs/sound/sound.h +++ b/sc2/src/sc2code/libs/sound/sound.h @@ -17,7 +17,7 @@ #ifndef _UQM_SOUND_H // try avoiding collisions on id #define _UQM_SOUND_H -#include "misc.h" +#include "libs/misc.h" #include "sndintrn.h" #include "audiocore.h" #include "decoders/decoder.h" diff --git a/sc2/src/sc2code/libs/sound/trackplayer.h b/sc2/src/sc2code/libs/sound/trackplayer.h index 81b32fa38..026634a39 100644 --- a/sc2/src/sc2code/libs/sound/trackplayer.h +++ b/sc2/src/sc2code/libs/sound/trackplayer.h @@ -19,7 +19,7 @@ #ifndef TRACKPLAYER_H #define TRACKPLAYER_H -#include "compiler.h" +#include "libs/compiler.h" typedef void (*TFB_TrackCB) (void); diff --git a/sc2/src/sc2code/libs/strings/sfileins.c b/sc2/src/sc2code/libs/strings/sfileins.c index 38733c9a9..6ff442251 100644 --- a/sc2/src/sc2code/libs/strings/sfileins.c +++ b/sc2/src/sc2code/libs/strings/sfileins.c @@ -18,7 +18,7 @@ #include "port.h" #include "strintrn.h" -#include "uio.h" +#include "libs/uio.h" #include "libs/reslib.h" diff --git a/sc2/src/sc2code/libs/strings/strings.c b/sc2/src/sc2code/libs/strings/strings.c index f2cab595b..1e68ebdb1 100644 --- a/sc2/src/sc2code/libs/strings/strings.c +++ b/sc2/src/sc2code/libs/strings/strings.c @@ -17,7 +17,7 @@ */ #include "strintrn.h" -#include "misc.h" +#include "libs/misc.h" STRING_TABLE AllocStringTable (int num_entries, int flags) diff --git a/sc2/src/sc2code/libs/strings/strintrn.h b/sc2/src/sc2code/libs/strings/strintrn.h index 14b68005e..11cf0ed69 100644 --- a/sc2/src/sc2code/libs/strings/strintrn.h +++ b/sc2/src/sc2code/libs/strings/strintrn.h @@ -21,8 +21,8 @@ #include #include -#include "strlib.h" -#include "reslib.h" +#include "libs/strlib.h" +#include "libs/reslib.h" struct string_table_entry { diff --git a/sc2/src/sc2code/libs/strings/unicode.c b/sc2/src/sc2code/libs/strings/unicode.c index 6f34a4454..b82430668 100644 --- a/sc2/src/sc2code/libs/strings/unicode.c +++ b/sc2/src/sc2code/libs/strings/unicode.c @@ -20,7 +20,7 @@ #include #include #include -#include "strlib.h" +#include "libs/strlib.h" #include "libs/log.h" diff --git a/sc2/src/sc2code/libs/strlib.h b/sc2/src/sc2code/libs/strlib.h index 51f8af18a..a43e76325 100644 --- a/sc2/src/sc2code/libs/strlib.h +++ b/sc2/src/sc2code/libs/strlib.h @@ -19,7 +19,7 @@ #ifndef _STRLIB_H #define _STRLIB_H -#include "compiler.h" +#include "libs/compiler.h" #include "port.h" #include "libs/uio.h" diff --git a/sc2/src/sc2code/libs/threads/sdl/sdlthreads.c b/sc2/src/sc2code/libs/threads/sdl/sdlthreads.c index a3274b0ad..fe8cb4c3b 100644 --- a/sc2/src/sc2code/libs/threads/sdl/sdlthreads.c +++ b/sc2/src/sc2code/libs/threads/sdl/sdlthreads.c @@ -15,7 +15,7 @@ */ #include -#include "misc.h" +#include "libs/misc.h" #include "sdlthreads.h" #ifdef PROFILE_THREADS #include diff --git a/sc2/src/sc2code/libs/video/vfileins.c b/sc2/src/sc2code/libs/video/vfileins.c index 6e249f764..26cb7c17e 100644 --- a/sc2/src/sc2code/libs/video/vfileins.c +++ b/sc2/src/sc2code/libs/video/vfileins.c @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "vidlib.h" +#include "libs/vidlib.h" #include "video.h" VIDEO_REF diff --git a/sc2/src/sc2code/libs/video/video.h b/sc2/src/sc2code/libs/video/video.h index 19fee01df..faadbc249 100644 --- a/sc2/src/sc2code/libs/video/video.h +++ b/sc2/src/sc2code/libs/video/video.h @@ -18,8 +18,8 @@ #define _UQM_VIDEO_H #include "options.h" -#include "misc.h" -#include "vidlib.h" +#include "libs/misc.h" +#include "libs/vidlib.h" #include "libs/graphics/tfb_draw.h" #include "types.h" #include "videodec.h" diff --git a/sc2/src/sc2code/libs/video/videodec.h b/sc2/src/sc2code/libs/video/videodec.h index f209cdc09..9f2c741ac 100644 --- a/sc2/src/sc2code/libs/video/videodec.h +++ b/sc2/src/sc2code/libs/video/videodec.h @@ -17,9 +17,9 @@ #ifndef _VIDEODEC_H #define _VIDEODEC_H -#include "vidlib.h" +#include "libs/vidlib.h" #include "libs/video/video.h" -#include "reslib.h" +#include "libs/reslib.h" // forward-declare typedef struct tfb_videodecoder TFB_VideoDecoder; diff --git a/sc2/src/sc2code/load.c b/sc2/src/sc2code/load.c index bf5b8f2d0..4aeeb5508 100644 --- a/sc2/src/sc2code/load.c +++ b/sc2/src/sc2code/load.c @@ -21,9 +21,9 @@ #include "load.h" #include "build.h" -#include "declib.h" +#include "libs/declib.h" #include "encount.h" -#include "file.h" +#include "libs/file.h" #include "globdata.h" #include "load.h" #include "options.h" diff --git a/sc2/src/sc2code/loadship.c b/sc2/src/sc2code/loadship.c index 331280424..ba4d9c671 100644 --- a/sc2/src/sc2code/loadship.c +++ b/sc2/src/sc2code/loadship.c @@ -22,6 +22,7 @@ #include "globdata.h" #include "nameref.h" #include "races.h" +#include "init.h" static RESOURCE code_resources[] = { NULL_RESOURCE, diff --git a/sc2/src/sc2code/melee.c b/sc2/src/sc2code/melee.c index 2c08aef31..7191c43b0 100644 --- a/sc2/src/sc2code/melee.c +++ b/sc2/src/sc2code/melee.c @@ -19,12 +19,13 @@ #include "melee.h" #include "build.h" +#include "status.h" #include "colors.h" #include "comm.h" // for getLineWithinWidth #include "cons_res.h" #include "controls.h" -#include "file.h" +#include "libs/file.h" #include "fmv.h" #include "gamestr.h" #include "globdata.h" diff --git a/sc2/src/sc2code/misc.c b/sc2/src/sc2code/misc.c index ac62931c9..141055dc0 100644 --- a/sc2/src/sc2code/misc.c +++ b/sc2/src/sc2code/misc.c @@ -19,6 +19,8 @@ #include "element.h" #include "init.h" #include "races.h" +#include "ship.h" +#include "status.h" #include "setup.h" #include "sounds.h" #include "weapon.h" diff --git a/sc2/src/sc2code/nameref.h b/sc2/src/sc2code/nameref.h index bdb5ea0e0..5f8143580 100644 --- a/sc2/src/sc2code/nameref.h +++ b/sc2/src/sc2code/nameref.h @@ -19,7 +19,7 @@ #ifndef _NAMEREF_H #define _NAMEREF_H -#include "reslib.h" +#include "libs/reslib.h" #define LoadCodeRes LoadCodeResInstance #define LoadGraphic (DRAWABLE)LoadGraphicInstance diff --git a/sc2/src/sc2code/netplay/checksum.c b/sc2/src/sc2code/netplay/checksum.c index 672f2333e..a5a628888 100644 --- a/sc2/src/sc2code/netplay/checksum.c +++ b/sc2/src/sc2code/netplay/checksum.c @@ -28,6 +28,8 @@ // for DUMP_CRC_OPS #include "netconnection.h" #include "netmelee.h" +#include "tactrans.h" + // for new_ship #include "libs/log.h" #include "libs/mathlib.h" #include "libs/misc.h" @@ -125,7 +127,6 @@ crc_processELEMENT(crc_State *state, const ELEMENT *val) { // the side this ship is on. This must be excluded from the checksum // as this does not have to be the same for both sides. { - extern void new_ship(ELEMENT *ElementPtr); BYTE turn_wait = val->turn_wait; if (val->preprocess_func == new_ship) diff --git a/sc2/src/sc2code/netplay/netmisc.h b/sc2/src/sc2code/netplay/netmisc.h index fb21bc82c..623ff15de 100644 --- a/sc2/src/sc2code/netplay/netmisc.h +++ b/sc2/src/sc2code/netplay/netmisc.h @@ -26,7 +26,7 @@ typedef struct BattleStateData BattleStateData; #include "types.h" #include "battle.h" - // for BattleFrameCounter + // for BattleFrameCounter, BATTLE_FRAME_RATE struct BattleStateData { NETCONNECTION_STATE_DATA_COMMON diff --git a/sc2/src/sc2code/pickmele.c b/sc2/src/sc2code/pickmele.c index 959589fb2..18c7b5078 100644 --- a/sc2/src/sc2code/pickmele.c +++ b/sc2/src/sc2code/pickmele.c @@ -23,6 +23,7 @@ #include "controls.h" #include "flash.h" #include "intel.h" +#include "battle.h" #include "melee.h" #ifdef NETPLAY # include "netplay/netmelee.h" diff --git a/sc2/src/sc2code/pickmele.h b/sc2/src/sc2code/pickmele.h index 996ac3a55..78fefda9b 100644 --- a/sc2/src/sc2code/pickmele.h +++ b/sc2/src/sc2code/pickmele.h @@ -41,6 +41,7 @@ BOOLEAN selectShipNetwork (NetworkInputContext *context, GETMELEE_STATE *gms); #include "flash.h" #include "libs/timelib.h" +#include "init.h" struct getmelee_struct { BOOLEAN (*InputFunc) (struct getmelee_struct *pInputState); diff --git a/sc2/src/sc2code/pickship.c b/sc2/src/sc2code/pickship.c index 3824acd72..a00afe39a 100644 --- a/sc2/src/sc2code/pickship.c +++ b/sc2/src/sc2code/pickship.c @@ -16,10 +16,13 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include "pickship.h" + #include "build.h" #include "colors.h" #include "controls.h" #include "pickmele.h" +#include "battle.h" #include "races.h" #include "resinst.h" #include "nameref.h" diff --git a/sc2/src/sc2code/pickship.h b/sc2/src/sc2code/pickship.h new file mode 100644 index 000000000..b52540187 --- /dev/null +++ b/sc2/src/sc2code/pickship.h @@ -0,0 +1,27 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef UQM_PICKSHIP_H_INCL_ +#define UQM_PICKSHIP_H_INCL_ + +#include "libs/compiler.h" +#include "races.h" + +extern HSTARSHIP GetEncounterStarShip (STARSHIP *LastStarShipPtr, + COUNT which_player); +extern void DrawArmadaPickShip (BOOLEAN draw_salvage_frame, RECT *pPickRect); + +#endif /* UQM_PICKSHIP_H_INCL_ */ diff --git a/sc2/src/sc2code/planets/devices.c b/sc2/src/sc2code/planets/devices.c index eee21914f..90d1440b5 100644 --- a/sc2/src/sc2code/planets/devices.c +++ b/sc2/src/sc2code/planets/devices.c @@ -28,7 +28,7 @@ #include "grpinfo.h" #include "sounds.h" #include "util.h" -#include "strlib.h" +#include "libs/strlib.h" // If DEBUG_DEVICES is defined, the device list shown in the game will diff --git a/sc2/src/sc2code/planets/gendru.c b/sc2/src/sc2code/planets/gendru.c index b5dace24f..d84ad0f85 100644 --- a/sc2/src/sc2code/planets/gendru.c +++ b/sc2/src/sc2code/planets/gendru.c @@ -20,6 +20,7 @@ #include "encount.h" #include "globdata.h" #include "lander.h" +#include "ipdisp.h" #include "nameref.h" #include "resinst.h" #include "state.h" diff --git a/sc2/src/sc2code/planets/genilw.c b/sc2/src/sc2code/planets/genilw.c index f9ff4b43c..95737f65a 100644 --- a/sc2/src/sc2code/planets/genilw.c +++ b/sc2/src/sc2code/planets/genilw.c @@ -19,6 +19,7 @@ #include "build.h" #include "encount.h" #include "globdata.h" +#include "ipdisp.h" #include "nameref.h" #include "resinst.h" #include "state.h" diff --git a/sc2/src/sc2code/planets/genmyc.c b/sc2/src/sc2code/planets/genmyc.c index 92d6307c0..7d6432acf 100644 --- a/sc2/src/sc2code/planets/genmyc.c +++ b/sc2/src/sc2code/planets/genmyc.c @@ -19,6 +19,7 @@ #include "build.h" #include "encount.h" #include "globdata.h" +#include "ipdisp.h" #include "nameref.h" #include "resinst.h" #include "setup.h" diff --git a/sc2/src/sc2code/planets/genorz.c b/sc2/src/sc2code/planets/genorz.c index f7a333b10..d286f2082 100644 --- a/sc2/src/sc2code/planets/genorz.c +++ b/sc2/src/sc2code/planets/genorz.c @@ -20,6 +20,7 @@ #include "encount.h" #include "globdata.h" #include "lander.h" +#include "ipdisp.h" #include "nameref.h" #include "resinst.h" #include "setup.h" diff --git a/sc2/src/sc2code/planets/genpet.c b/sc2/src/sc2code/planets/genpet.c index dacf0d331..8d3a78819 100644 --- a/sc2/src/sc2code/planets/genpet.c +++ b/sc2/src/sc2code/planets/genpet.c @@ -19,6 +19,7 @@ #include "build.h" #include "encount.h" #include "globdata.h" +#include "ipdisp.h" #include "nameref.h" #include "resinst.h" #include "setup.h" diff --git a/sc2/src/sc2code/planets/genpku.c b/sc2/src/sc2code/planets/genpku.c index 01838470e..6729b8b24 100644 --- a/sc2/src/sc2code/planets/genpku.c +++ b/sc2/src/sc2code/planets/genpku.c @@ -20,6 +20,7 @@ #include "encount.h" #include "globdata.h" #include "lander.h" +#include "ipdisp.h" #include "nameref.h" #include "resinst.h" #include "state.h" diff --git a/sc2/src/sc2code/planets/genspa.c b/sc2/src/sc2code/planets/genspa.c index c6386a855..320e49c5b 100644 --- a/sc2/src/sc2code/planets/genspa.c +++ b/sc2/src/sc2code/planets/genspa.c @@ -19,6 +19,7 @@ #include "build.h" #include "encount.h" #include "globdata.h" +#include "ipdisp.h" #include "lifeform.h" #include "nameref.h" #include "resinst.h" diff --git a/sc2/src/sc2code/planets/gensup.c b/sc2/src/sc2code/planets/gensup.c index f4e4cacee..23343d5f6 100644 --- a/sc2/src/sc2code/planets/gensup.c +++ b/sc2/src/sc2code/planets/gensup.c @@ -20,6 +20,7 @@ #include "encount.h" #include "globdata.h" #include "lander.h" +#include "ipdisp.h" #include "nameref.h" #include "resinst.h" #include "state.h" diff --git a/sc2/src/sc2code/planets/genthrad.c b/sc2/src/sc2code/planets/genthrad.c index 7eb2dc11a..d54f8778a 100644 --- a/sc2/src/sc2code/planets/genthrad.c +++ b/sc2/src/sc2code/planets/genthrad.c @@ -19,6 +19,7 @@ #include "build.h" #include "encount.h" #include "globdata.h" +#include "ipdisp.h" #include "nameref.h" #include "resinst.h" #include "setup.h" diff --git a/sc2/src/sc2code/planets/gentopo.c b/sc2/src/sc2code/planets/gentopo.c index 4495c67f7..f7c336b03 100644 --- a/sc2/src/sc2code/planets/gentopo.c +++ b/sc2/src/sc2code/planets/gentopo.c @@ -18,8 +18,8 @@ // See doc/devel/planettopo for details. -#include "gfxlib.h" -#include "mathlib.h" +#include "libs/gfxlib.h" +#include "libs/mathlib.h" #include "planets.h" void diff --git a/sc2/src/sc2code/planets/genutw.c b/sc2/src/sc2code/planets/genutw.c index 65f0cba5a..5b995565a 100644 --- a/sc2/src/sc2code/planets/genutw.c +++ b/sc2/src/sc2code/planets/genutw.c @@ -19,6 +19,7 @@ #include "build.h" #include "encount.h" #include "globdata.h" +#include "ipdisp.h" #include "nameref.h" #include "resinst.h" #include "setup.h" diff --git a/sc2/src/sc2code/planets/genvux.c b/sc2/src/sc2code/planets/genvux.c index 24945ca4b..703a9aeb6 100644 --- a/sc2/src/sc2code/planets/genvux.c +++ b/sc2/src/sc2code/planets/genvux.c @@ -20,6 +20,7 @@ #include "encount.h" #include "globdata.h" #include "lander.h" +#include "ipdisp.h" #include "lifeform.h" #include "nameref.h" #include "resinst.h" diff --git a/sc2/src/sc2code/planets/genyeh.c b/sc2/src/sc2code/planets/genyeh.c index b02ce8e3a..78453902b 100644 --- a/sc2/src/sc2code/planets/genyeh.c +++ b/sc2/src/sc2code/planets/genyeh.c @@ -19,6 +19,7 @@ #include "build.h" #include "encount.h" #include "globdata.h" +#include "ipdisp.h" #include "nameref.h" #include "resinst.h" #include "state.h" diff --git a/sc2/src/sc2code/planets/lander.c b/sc2/src/sc2code/planets/lander.c index 888367ab6..d6658c9ea 100644 --- a/sc2/src/sc2code/planets/lander.c +++ b/sc2/src/sc2code/planets/lander.c @@ -16,12 +16,14 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include "lander.h" + #include "cons_res.h" #include "controls.h" #include "colors.h" #include "encount.h" +#include "process.h" #include "gamestr.h" -#include "lander.h" #include "lifeform.h" #include "scan.h" #include "nameref.h" diff --git a/sc2/src/sc2code/planets/lander.h b/sc2/src/sc2code/planets/lander.h index e75119d7c..d44505b21 100644 --- a/sc2/src/sc2code/planets/lander.h +++ b/sc2/src/sc2code/planets/lander.h @@ -24,6 +24,7 @@ #include "libs/gfxlib.h" #include "libs/sndlib.h" #include "menustat.h" +#include "element.h" #define NUM_TEXT_FRAMES 32 @@ -58,6 +59,8 @@ extern void SetPlanetMusic (BYTE planet_type); extern void LoadLanderData (void); extern void FreeLanderData (void); +extern void object_animation (ELEMENT *ElementPtr); + #endif /* _LANDER_H */ diff --git a/sc2/src/sc2code/planets/oval.c b/sc2/src/sc2code/planets/oval.c index 29caf6816..f5bdcd6d6 100644 --- a/sc2/src/sc2code/planets/oval.c +++ b/sc2/src/sc2code/planets/oval.c @@ -18,8 +18,8 @@ #include "units.h" #include "libs/gfxlib.h" -#include "graphics/context.h" -#include "graphics/drawable.h" +#include "libs/graphics/context.h" +#include "libs/graphics/drawable.h" #define NUM_QUADS 4 diff --git a/sc2/src/sc2code/planets/planets.h b/sc2/src/sc2code/planets/planets.h index f6a1a94eb..a49b1cca4 100644 --- a/sc2/src/sc2code/planets/planets.h +++ b/sc2/src/sc2code/planets/planets.h @@ -234,7 +234,6 @@ 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 DrawFilledOval (RECT *pRect); -extern void DoMissions (void); extern void FillOrbits (SOLARSYS_STATE *system, BYTE NumPlanets, PLANET_DESC *pBaseDesc, BOOLEAN TypesDefined); extern void ScanSystem (void); diff --git a/sc2/src/sc2code/planets/scan.c b/sc2/src/sc2code/planets/scan.c index 5d5810c0a..66519dcc7 100644 --- a/sc2/src/sc2code/planets/scan.c +++ b/sc2/src/sc2code/planets/scan.c @@ -29,6 +29,7 @@ #include "load.h" #include "util.h" #include "lander.h" +#include "process.h" #include "setup.h" #include "sounds.h" #include "state.h" @@ -1252,8 +1253,6 @@ GeneratePlanetSide (void) } else { - extern void object_animation (ELEMENT *ElementPtr); - NodeElementPtr->current.image.frame = f; NodeElementPtr->next.image.frame = SetRelFrameIndex ( f, NUM_SCANDOT_TRANSITIONS - 1); diff --git a/sc2/src/sc2code/planets/solarsys.c b/sc2/src/sc2code/planets/solarsys.c index 7e091ecbe..b1e279f1c 100644 --- a/sc2/src/sc2code/planets/solarsys.c +++ b/sc2/src/sc2code/planets/solarsys.c @@ -26,6 +26,8 @@ #include "resinst.h" #include "settings.h" #include "lander.h" +#include "ipdisp.h" +#include "process.h" #include "load.h" #include "setup.h" #include "sounds.h" diff --git a/sc2/src/sc2code/process.c b/sc2/src/sc2code/process.c index 2f99cdc6d..8a2e3159e 100644 --- a/sc2/src/sc2code/process.c +++ b/sc2/src/sc2code/process.c @@ -16,13 +16,16 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "build.h" +#include "process.h" + +#include "races.h" #include "collide.h" #include "options.h" #include "settings.h" #include "setup.h" #include "sounds.h" #include "element.h" +#include "battle.h" #include "weapon.h" #include "libs/graphics/drawable.h" #include "libs/graphics/drawcmd.h" diff --git a/sc2/src/sc2code/process.h b/sc2/src/sc2code/process.h new file mode 100644 index 000000000..80618749d --- /dev/null +++ b/sc2/src/sc2code/process.h @@ -0,0 +1,29 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef UQM_PROCESS_H_INCL_ +#define UQM_PROCESS_H_INCL_ + +#include "libs/compiler.h" +#include "libs/gfxlib.h" +#include "element.h" + +extern void RedrawQueue (BOOLEAN clear); +extern void InitDisplayList (void); +extern void SetUpElement (ELEMENT *ElementPtr); +extern void InsertPrim (PRIM_LINKS *pLinks, COUNT primIndex, COUNT iPI); + +#endif /* UQM_PROCESS_H_INCL_ */ diff --git a/sc2/src/sc2code/races.h b/sc2/src/sc2code/races.h index f92f5e061..a728daab7 100644 --- a/sc2/src/sc2code/races.h +++ b/sc2/src/sc2code/races.h @@ -55,6 +55,20 @@ typedef HLINK HSTARSHIP; #define PLAYER_CAPTAIN (1 << 13) /* The protagonist himself is on board. He gets a different color. */ +typedef UWORD STATUS_FLAGS; + +/* STATUS_FLAGS - heat of battle specific flags */ +#define LEFT (1 << 0) +#define RIGHT (1 << 1) +#define THRUST (1 << 2) +#define WEAPON (1 << 3) +#define SPECIAL (1 << 4) +#define LOW_ON_ENERGY (1 << 5) +#define SHIP_BEYOND_MAX_SPEED (1 << 6) +#define SHIP_AT_MAX_SPEED (1 << 7) +#define SHIP_IN_GRAVITY_WELL (1 << 8) +#define PLAY_VICTORY_DITTY (1 << 9) + /* These track the old resource package orderings for the ship resource indices */ typedef enum { @@ -656,20 +670,5 @@ enum #define SOL_X 1752 #define SOL_Y 1450 -extern BOOLEAN InitKernel (void); - -extern void DrawCaptainsWindow (STARSHIP *StarShipPtr); -extern BOOLEAN GetNextStarShip (STARSHIP *LastStarShipPtr, - COUNT which_side); -extern BOOLEAN GetInitialStarShips (void); -extern HSTARSHIP GetEncounterStarShip (STARSHIP *LastStarShipPtr, - COUNT which_player); -extern void DrawArmadaPickShip (BOOLEAN draw_salvage_frame, RECT *pPickRect); - -extern BOOLEAN load_animation (FRAME *pixarray, RESOURCE big_res, - RESOURCE med_res, RESOURCE sml_res); -extern BOOLEAN free_image (FRAME *pixarray); -extern void NotifyOthers (COUNT which_race, BYTE target_loc); - #endif /* _RACES_H */ diff --git a/sc2/src/sc2code/save.c b/sc2/src/sc2code/save.c index 25bea847a..f2bb74030 100644 --- a/sc2/src/sc2code/save.c +++ b/sc2/src/sc2code/save.c @@ -21,10 +21,10 @@ #include "save.h" #include "build.h" -#include "declib.h" +#include "libs/declib.h" #include "controls.h" #include "encount.h" -#include "file.h" +#include "libs/file.h" #include "gamestr.h" #include "globdata.h" #include "options.h" diff --git a/sc2/src/sc2code/setup.c b/sc2/src/sc2code/setup.c index ec749adfa..2cd43426d 100644 --- a/sc2/src/sc2code/setup.c +++ b/sc2/src/sc2code/setup.c @@ -65,6 +65,7 @@ FRAME MiscDataFrame; FRAME FontGradFrame; Mutex GraphicsLock; STRING GameStrings; +QUEUE disp_q; uio_Repository *repository; uio_DirHandle *rootDir; @@ -178,7 +179,7 @@ InitContexts (void) return TRUE; } -BOOLEAN +static BOOLEAN InitKernel (void) { COUNT counter; diff --git a/sc2/src/sc2code/setup.h b/sc2/src/sc2code/setup.h index 727f66748..6c2ee6cc2 100644 --- a/sc2/src/sc2code/setup.h +++ b/sc2/src/sc2code/setup.h @@ -61,6 +61,9 @@ BOOLEAN InitContexts (void); void UninitPlayerInput (void); BOOLEAN InitGameKernel (void); +extern BOOLEAN LoadKernel (int argc, char *argv[]); +extern void FreeKernel (void); + int initIO (void); void uninitIO (void); diff --git a/sc2/src/sc2code/ship.c b/sc2/src/sc2code/ship.c index 7dba8e892..09b865125 100644 --- a/sc2/src/sc2code/ship.c +++ b/sc2/src/sc2code/ship.c @@ -16,11 +16,19 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include "ship.h" + #include "build.h" #include "collide.h" #include "colors.h" #include "globdata.h" +#include "status.h" +#include "hyper.h" +#include "tactrans.h" +#include "pickship.h" #include "intel.h" +#include "init.h" +#include "battle.h" #include "pickmele.h" #include "races.h" #include "setup.h" @@ -186,14 +194,10 @@ ship_preprocess (ELEMENT *ElementPtr) if (ElementPtr->hTarget == 0) { - extern void ship_transition (ELEMENT *ElementPtr); - ship_transition (ElementPtr); } else { - extern BOOLEAN OpponentAlive (STARSHIP *TestStarShipPtr); - ElementPtr->hTarget = 0; if (!PLRPlaying ((MUSIC_REF)~0) && OpponentAlive (StarShipPtr)) BattleSong (TRUE); @@ -268,8 +272,6 @@ ship_preprocess (ELEMENT *ElementPtr) if (!OBJECT_CLOAKED (ElementPtr) && LOBYTE (GLOBAL (CurrentActivity)) <= IN_ENCOUNTER) { - extern void spawn_ion_trail (ELEMENT *ElementPtr); - spawn_ion_trail (ElementPtr); } } diff --git a/sc2/src/sc2code/ship.h b/sc2/src/sc2code/ship.h new file mode 100644 index 000000000..5cfc31889 --- /dev/null +++ b/sc2/src/sc2code/ship.h @@ -0,0 +1,35 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef UQM_SHIP_H_INCL_ +#define UQM_SHIP_H_INCL_ + +#include "libs/compiler.h" +#include "races.h" +#include "element.h" + +extern BOOLEAN GetNextStarShip (STARSHIP *LastStarShipPtr, COUNT which_side); +extern BOOLEAN GetInitialStarShips (void); + +extern void animation_preprocess (ELEMENT *ElementPtr); +extern void ship_preprocess (ELEMENT *ElementPtr); +extern void ship_postprocess (ELEMENT *ElementPtr); +extern void collision (ELEMENT *ElementPtr0, POINT *pPt0, + ELEMENT *ElementPtr1, POINT *pPt1); + +extern STATUS_FLAGS inertial_thrust (ELEMENT *ElementPtr); + +#endif /* UQM_SHIP_H_INCL_ */ diff --git a/sc2/src/sc2code/ships/androsyn/androsyn.c b/sc2/src/sc2code/ships/androsyn/androsyn.c index 33aff3b60..f5904ae0d 100644 --- a/sc2/src/sc2code/ships/androsyn/androsyn.c +++ b/sc2/src/sc2code/ships/androsyn/androsyn.c @@ -18,6 +18,7 @@ #include "ships/ship.h" #include "ships/androsyn/resinst.h" +#include "ship.h" #include "libs/mathlib.h" diff --git a/sc2/src/sc2code/ships/chenjesu/chenjesu.c b/sc2/src/sc2code/ships/chenjesu/chenjesu.c index 85c2d424f..b0213677d 100644 --- a/sc2/src/sc2code/ships/chenjesu/chenjesu.c +++ b/sc2/src/sc2code/ships/chenjesu/chenjesu.c @@ -18,6 +18,7 @@ #include "ships/ship.h" #include "ships/chenjesu/resinst.h" +#include "ship.h" #include "globdata.h" #include "libs/mathlib.h" diff --git a/sc2/src/sc2code/ships/ilwrath/ilwrath.c b/sc2/src/sc2code/ships/ilwrath/ilwrath.c index 788c28d9c..53531d73e 100644 --- a/sc2/src/sc2code/ships/ilwrath/ilwrath.c +++ b/sc2/src/sc2code/ships/ilwrath/ilwrath.c @@ -18,6 +18,7 @@ #include "ships/ship.h" #include "ships/ilwrath/resinst.h" +#include "ship.h" #include "colors.h" #include "globdata.h" diff --git a/sc2/src/sc2code/ships/lastbat/lastbat.c b/sc2/src/sc2code/ships/lastbat/lastbat.c index 008168624..ac43a9d6e 100644 --- a/sc2/src/sc2code/ships/lastbat/lastbat.c +++ b/sc2/src/sc2code/ships/lastbat/lastbat.c @@ -21,6 +21,8 @@ #include "colors.h" #include "globdata.h" +#include "battle.h" + // For BATTLE_FRAME_RATE #include "libs/mathlib.h" #include "libs/timelib.h" diff --git a/sc2/src/sc2code/ships/orz/orz.c b/sc2/src/sc2code/ships/orz/orz.c index 0a0a9cb91..2aa7e1114 100644 --- a/sc2/src/sc2code/ships/orz/orz.c +++ b/sc2/src/sc2code/ships/orz/orz.c @@ -18,6 +18,7 @@ #include "ships/ship.h" #include "ships/orz/resinst.h" +#include "ship.h" #include "colors.h" #include "globdata.h" diff --git a/sc2/src/sc2code/ships/ship.h b/sc2/src/sc2code/ships/ship.h index 0c03373c4..9a398e0f6 100644 --- a/sc2/src/sc2code/ships/ship.h +++ b/sc2/src/sc2code/ships/ship.h @@ -27,6 +27,7 @@ //#include "reslib.h" #include "intel.h" #include "races.h" +#include "status.h" #include "sounds.h" #include "weapon.h" diff --git a/sc2/src/sc2code/ships/supox/supox.c b/sc2/src/sc2code/ships/supox/supox.c index 2809c4e1a..300533f91 100644 --- a/sc2/src/sc2code/ships/supox/supox.c +++ b/sc2/src/sc2code/ships/supox/supox.c @@ -18,6 +18,7 @@ #include "ships/ship.h" #include "ships/supox/resinst.h" +#include "ship.h" #include "libs/mathlib.h" diff --git a/sc2/src/sc2code/ships/thradd/thradd.c b/sc2/src/sc2code/ships/thradd/thradd.c index e8c1af143..75c14e0be 100644 --- a/sc2/src/sc2code/ships/thradd/thradd.c +++ b/sc2/src/sc2code/ships/thradd/thradd.c @@ -18,6 +18,7 @@ #include "ships/ship.h" #include "ships/thradd/resinst.h" +#include "ship.h" #include "globdata.h" diff --git a/sc2/src/sc2code/ships/utwig/utwig.c b/sc2/src/sc2code/ships/utwig/utwig.c index 707459e94..90b16293b 100644 --- a/sc2/src/sc2code/ships/utwig/utwig.c +++ b/sc2/src/sc2code/ships/utwig/utwig.c @@ -18,6 +18,7 @@ #include "ships/ship.h" #include "ships/utwig/resinst.h" +#include "ship.h" #include "globdata.h" #include "libs/mathlib.h" diff --git a/sc2/src/sc2code/shipstat.c b/sc2/src/sc2code/shipstat.c index 8948357b9..ba3c8dbce 100644 --- a/sc2/src/sc2code/shipstat.c +++ b/sc2/src/sc2code/shipstat.c @@ -19,7 +19,7 @@ #include "colors.h" #include "globdata.h" #include "options.h" -#include "build.h" +#include "status.h" #include "setup.h" #include "libs/gfxlib.h" diff --git a/sc2/src/sc2code/sis.c b/sc2/src/sc2code/sis.c index f83140b75..e9caa2517 100644 --- a/sc2/src/sc2code/sis.c +++ b/sc2/src/sc2code/sis.c @@ -22,6 +22,9 @@ #include "gamestr.h" #include "options.h" #include "starbase.h" +#include "battle.h" + // For BATTLE_FRAME_RATE +#include "element.h" #include "setup.h" #include "state.h" #include "libs/graphics/gfx_common.h" diff --git a/sc2/src/sc2code/starcon.c b/sc2/src/sc2code/starcon.c index a82e43dbc..f74da4050 100644 --- a/sc2/src/sc2code/starcon.c +++ b/sc2/src/sc2code/starcon.c @@ -19,7 +19,7 @@ #include #include "encount.h" -#include "element.h" +#include "battle.h" #include "fmv.h" #include "gameev.h" #include "types.h" diff --git a/sc2/src/sc2code/status.c b/sc2/src/sc2code/status.c index cb0475d54..abba30638 100644 --- a/sc2/src/sc2code/status.c +++ b/sc2/src/sc2code/status.c @@ -16,10 +16,11 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "build.h" +#include "status.h" #include "colors.h" #include "globdata.h" #include "races.h" +#include "ship.h" #include "setup.h" #include "options.h" @@ -410,8 +411,6 @@ PostProcessStatus (ELEMENT *ShipPtr) if (StarShipPtr->RaceDescPtr->ship_info.crew_level == 0) { -#define CAPTAIN_WIDTH 55 -#define CAPTAIN_HEIGHT 30 BYTE i; COLOR c; RECT r; diff --git a/sc2/src/sc2code/status.h b/sc2/src/sc2code/status.h new file mode 100644 index 000000000..81231f0c0 --- /dev/null +++ b/sc2/src/sc2code/status.h @@ -0,0 +1,62 @@ +//Copyright Paul Reiche, Fred Ford. 1992-2002 + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef UQM_STATUS_H_INCL_ +#define UQM_STATUS_H_INCL_ + +#include "races.h" +#include "libs/compiler.h" + +#define CREW_XOFFS 4 +#define ENERGY_XOFFS 52 +#define GAUGE_YOFFS (SHIP_INFO_HEIGHT - 10) +#define UNIT_WIDTH 2 +#define UNIT_HEIGHT 1 +#define STAT_WIDTH (1 + UNIT_WIDTH + 1 + UNIT_WIDTH + 1) + +#define SHIP_INFO_HEIGHT 65 +#define CAPTAIN_XOFFS 4 +#define CAPTAIN_YOFFS (SHIP_INFO_HEIGHT + 4) +#define CAPTAIN_WIDTH 55 +#define CAPTAIN_HEIGHT 30 +#define SHIP_STATUS_HEIGHT (STATUS_HEIGHT >> 1) +#define BAD_GUY_YOFFS 0 +#define GOOD_GUY_YOFFS SHIP_STATUS_HEIGHT +#define STARCON_TEXT_HEIGHT 7 +#define TINY_TEXT_HEIGHT 9 + +#define BATTLE_CREW_X 10 +#define BATTLE_CREW_Y (64 - SAFE_Y) + +extern void DrawCrewFuelString (COORD y, SIZE state); +extern void ClearShipStatus (COORD y); +extern void OutlineShipStatus (COORD y); +extern void InitShipStatus (SHIP_INFO *ShipInfoPtr, BYTE captains_name_index, + RECT *pClipRect); +extern void DeltaStatistics (SHIP_INFO *ShipInfoPtr, SIZE crew_delta, + SIZE energy_delta); +extern void DrawBattleCrewAmount (SHIP_INFO *ShipInfoPtr); + +extern void DrawCaptainsWindow (STARSHIP *StarShipPtr); +extern BOOLEAN DeltaEnergy (ELEMENT *ElementPtr, SIZE energy_delta); +extern BOOLEAN DeltaCrew (ELEMENT *ElementPtr, SIZE crew_delta); + +extern void PreProcessStatus (ELEMENT *ShipPtr); +extern void PostProcessStatus (ELEMENT *ShipPtr); + +#endif /* UQM_STATUS_H_INCL_ */ diff --git a/sc2/src/sc2code/tactrans.c b/sc2/src/sc2code/tactrans.c index e0e04faa0..131b5c16c 100644 --- a/sc2/src/sc2code/tactrans.c +++ b/sc2/src/sc2code/tactrans.c @@ -16,10 +16,16 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include "tactrans.h" + #include "battlecontrols.h" #include "build.h" #include "collide.h" #include "globdata.h" +#include "element.h" +#include "ship.h" +#include "status.h" +#include "battle.h" #include "init.h" #ifdef NETPLAY # include "netplay/netmelee.h" diff --git a/sc2/src/sc2code/tactrans.h b/sc2/src/sc2code/tactrans.h index 84fbcdc71..a09dbb641 100644 --- a/sc2/src/sc2code/tactrans.h +++ b/sc2/src/sc2code/tactrans.h @@ -19,12 +19,24 @@ #ifndef _TACTRANS_H #define _TACTRANS_H +#include "libs/compiler.h" +#include "races.h" +#include "element.h" +#include "battlecontrols.h" + bool battleEndReadyHuman (HumanInputContext *context); bool battleEndReadyComputer (ComputerInputContext *context); #ifdef NETPLAY bool battleEndReadyNetwork (NetworkInputContext *context); #endif +extern void ship_transition (ELEMENT *ElementPtr); +extern BOOLEAN OpponentAlive (STARSHIP *TestStarShipPtr); +extern void new_ship (ELEMENT *ElementPtr); +extern void ship_death (ELEMENT *ShipPtr); +extern void spawn_ion_trail (ELEMENT *ElementPtr); +extern void flee_preprocess (ELEMENT *ElementPtr); + #endif /* _TACTRANS_H */ diff --git a/sc2/src/sc2code/uqmdebug.c b/sc2/src/sc2code/uqmdebug.c index a1e417024..866dcc65a 100644 --- a/sc2/src/sc2code/uqmdebug.c +++ b/sc2/src/sc2code/uqmdebug.c @@ -22,6 +22,8 @@ #include "colors.h" #include "clock.h" #include "encount.h" +#include "element.h" +#include "status.h" #include "gamestr.h" #include "gameev.h" #include "globdata.h" diff --git a/sc2/src/sc2code/weapon.c b/sc2/src/sc2code/weapon.c index 29e390e5c..4cd290d76 100644 --- a/sc2/src/sc2code/weapon.c +++ b/sc2/src/sc2code/weapon.c @@ -18,11 +18,12 @@ #include "weapon.h" -#include "build.h" #include "colors.h" #include "globdata.h" +#include "status.h" #include "init.h" #include "races.h" +#include "ship.h" #include "setup.h" #include "sounds.h" #include "units.h" diff --git a/sc2/src/starcon2.c b/sc2/src/starcon2.c index 0895ee828..8b1f6f30b 100644 --- a/sc2/src/starcon2.c +++ b/sc2/src/starcon2.c @@ -32,9 +32,9 @@ #include "libs/inplib.h" #include "libs/tasklib.h" #include "controls.h" -#include "element.h" +#include "battle.h" // For BATTLE_FRAME_RATE -#include "file.h" +#include "libs/file.h" #include "port.h" #include "libs/memlib.h" #include "libs/platform.h"