diff --git a/source/exhumed/CMakeLists.txt b/source/exhumed/CMakeLists.txt index 845f6d19a..cb150ade3 100644 --- a/source/exhumed/CMakeLists.txt +++ b/source/exhumed/CMakeLists.txt @@ -22,7 +22,6 @@ set( PCH_SOURCES src/move.cpp src/movie.cpp src/mummy.cpp - src/network.cpp src/object.cpp src/osdcmds.cpp src/player.cpp diff --git a/source/exhumed/src/anims.cpp b/source/exhumed/src/anims.cpp index b2636b0e7..63d23fe5a 100644 --- a/source/exhumed/src/anims.cpp +++ b/source/exhumed/src/anims.cpp @@ -21,8 +21,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "sequence.h" #include "exhumed.h" #include "sound.h" -#include "random.h" -#include "init.h" #include BEGIN_PS_NS diff --git a/source/exhumed/src/anubis.cpp b/source/exhumed/src/anubis.cpp index bfdc244e4..e9f171b03 100644 --- a/source/exhumed/src/anubis.cpp +++ b/source/exhumed/src/anubis.cpp @@ -20,9 +20,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "aistuff.h" #include "engine.h" #include "sequence.h" -#include "random.h" #include "sound.h" -#include "trigdat.h" #include BEGIN_PS_NS diff --git a/source/exhumed/src/bubbles.cpp b/source/exhumed/src/bubbles.cpp index 16fdbbccf..d6cc1bc63 100644 --- a/source/exhumed/src/bubbles.cpp +++ b/source/exhumed/src/bubbles.cpp @@ -18,11 +18,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "ns.h" #include "aistuff.h" #include "exhumed.h" -#include "random.h" #include "engine.h" #include "sequence.h" -#include "init.h" -#include "init.h" #include BEGIN_PS_NS diff --git a/source/exhumed/src/bullet.cpp b/source/exhumed/src/bullet.cpp index de76c20e8..2281b58c8 100644 --- a/source/exhumed/src/bullet.cpp +++ b/source/exhumed/src/bullet.cpp @@ -21,10 +21,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "sequence.h" #include "exhumed.h" #include "sound.h" -#include "init.h" #include "player.h" -#include "trigdat.h" -#include "random.h" #include "names.h" #include #include @@ -439,7 +436,7 @@ HITSPRITE: short nPlayer = GetPlayerFromSprite(hitsprite); if (!PlayerList[nPlayer].bIsMummified) { - PlayerList[nPlayer].bIsMummified = kTrue; + PlayerList[nPlayer].bIsMummified = true; SetNewWeapon(nPlayer, kWeaponMummified); } } diff --git a/source/exhumed/src/cd.cpp b/source/exhumed/src/cd.cpp index 4ef0f7864..7fe5d7b06 100644 --- a/source/exhumed/src/cd.cpp +++ b/source/exhumed/src/cd.cpp @@ -19,7 +19,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "build.h" #include "compat.h" #include "baselayer.h" -#include "cd.h" +#include "engine.h" #include "sound.h" #include "exhumed.h" #include diff --git a/source/exhumed/src/cd.h b/source/exhumed/src/cd.h deleted file mode 100644 index 811730e35..000000000 --- a/source/exhumed/src/cd.h +++ /dev/null @@ -1,31 +0,0 @@ -//------------------------------------------------------------------------- -/* -Copyright (C) 2010-2019 EDuke32 developers and contributors -Copyright (C) 2019 sirlemonhead, Nuke.YKT -This file is part of PCExhumed. -PCExhumed is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License version 2 -as published by the Free Software Foundation. -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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ -//------------------------------------------------------------------------- - -#ifndef __cd_h__ -#define __cd_h__ - -BEGIN_PS_NS -bool playCDtrack(int nTrack, bool bLoop); -void StartfadeCDaudio(); -int StepFadeCDaudio(); -bool CDplaying(); -void StopCD(); - -END_PS_NS - -#endif diff --git a/source/exhumed/src/engine.h b/source/exhumed/src/engine.h index b49858aef..9864655e8 100644 --- a/source/exhumed/src/engine.h +++ b/source/exhumed/src/engine.h @@ -22,16 +22,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "compat.h" #include "build.h" #include "pragmas.h" -#include "typedefs.h" -#include "trigdat.h" BEGIN_PS_NS -#define kMaxTiles 6144 #define kMaxSprites 4096 #define kMaxSectors 1024 #define kMaxWalls 8192 -#define kMaxTiles 6144 #define kMaxVoxels 4096 enum @@ -39,12 +35,123 @@ enum kStatIgnited = 404 }; -#define kMaxSpritesOnscreen 1024 #define kMaxPalookups 256 #define kMaxStatus 1024 //#define MAXPSKYTILES 256 + +int movesprite(short spritenum, int dx, int dy, int dz, int ceildist, int flordist, unsigned int clipmask); +void overwritesprite(int thex, int they, short tilenum, signed char shade, char stat, char dapalnum, int basepal = 0); +void precache(); +void resettiming(); +void printext(int x, int y, const char* buffer, short tilenum, char invisiblecol); + +// cd + +bool playCDtrack(int nTrack, bool bLoop); +void StartfadeCDaudio(); +int StepFadeCDaudio(); +bool CDplaying(); +void StopCD(); + +// init +#define kMap20 20 + +enum { + kSectUnderwater = 0x2000, + kSectLava = 0x4000, +}; + +extern ClockTicks ototalclock; + +extern int initx; +extern int inity; +extern int initz; +extern short inita; +extern short initsect; + +extern short nCurChunkNum; +extern short nBodyGunSprite[50]; +extern int movefifoend; +extern int movefifopos; +extern short nCurBodyGunNum; + +void SnapSectors(short nSectorA, short nSectorB, short b); + +extern short SectSound[]; +extern short SectDamage[]; +extern short SectSpeed[]; +extern int SectBelow[]; +extern short SectFlag[]; +extern int SectDepth[]; +extern short SectSoundSect[]; +extern int SectAbove[]; + +uint8_t LoadLevel(int nMap); +void LoadObjects(); + +// light + +int LoadPaletteLookups(); +void WaitVBL(); +void SetGreenPal(); +void RestoreGreenPal(); +void FixPalette(); +void FadeToWhite(); +int HavePLURemap(); +uint8_t RemapPLU(uint8_t pal); + +//extern unsigned char kenpal[]; +extern short overscanindex; + +extern char *origpalookup[]; + +extern short nPalDiff; + +// map + +extern short bShowTowers; +extern int ldMapZoom; +extern int lMapZoom; + +void InitMap(); +void GrabMap(); +void UpdateMap(); +void DrawMap(); + +// movie + +void PlayMovie(const char *fileName); + +// network + +extern short nNetMoveFrames; + +// random + +void InitRandom(); +int RandomBit(); +char RandomByte(); +uint16_t RandomWord(); +int RandomLong(); +int RandomSize(int nSize); + +// record + +extern short record_mode; + +// save + +// trigdat + +#define kAngleMask 0x7FF + +int GetMyAngle(int x, int y); + +int AngleDiff(short a, short b); +int AngleDelta(int a, int b, int c); + inline int Sin(int angle) { return sintable[angle & kAngleMask]; @@ -55,12 +162,6 @@ inline int Cos(int angle) return sintable[(angle + 512) & kAngleMask]; } -int movesprite(short spritenum, int dx, int dy, int dz, int ceildist, int flordist, unsigned int clipmask); -void overwritesprite(int thex, int they, short tilenum, signed char shade, char stat, char dapalnum, int basepal = 0); -void precache(); -void resettiming(); -void printext(int x, int y, const char* buffer, short tilenum, char invisiblecol); - END_PS_NS #endif diff --git a/source/exhumed/src/exhumed.cpp b/source/exhumed/src/exhumed.cpp index 8136538b3..10df82f41 100644 --- a/source/exhumed/src/exhumed.cpp +++ b/source/exhumed/src/exhumed.cpp @@ -18,31 +18,19 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "ns.h" #include "compat.h" #include "baselayer.h" -#include "typedefs.h" #include "common.h" #include "engine.h" #include "exhumed.h" -#include "osdcmds.h" -#include "map.h" #include "sequence.h" -#include "movie.h" #include "names.h" #include "menu.h" #include "player.h" -#include "network.h" #include "ps_input.h" #include "sound.h" -#include "cd.h" #include "view.h" #include "status.h" -#include "init.h" #include "version.h" -#include "light.h" #include "aistuff.h" -#include "network.h" -#include "random.h" -#include "trigdat.h" -#include "record.h" #include "mapinfo.h" #include #include // for printf @@ -66,6 +54,7 @@ BEGIN_PS_NS void FinishLevel(); void uploadCinemaPalettes(); +int32_t registerosdcommands(void); int htimer = 0; @@ -600,7 +589,7 @@ void InstallEngine() //nScreenWidth *= 2; //nScreenHeight *= 2; - bHiRes = kTrue; + bHiRes = true; // TEMP if (engineInit()) @@ -696,7 +685,7 @@ short nButtonColor; short nEnergyChan; -short bModemPlay = kFalse; +short bModemPlay = false; int lCountDown = 0; short nEnergyTowers = 0; @@ -712,8 +701,8 @@ short forcelevel = -1; int lLocalButtons = 0; int lLocalCodes = 0; -short bHiRes = kFalse; -short bCoordinates = kFalse; +short bHiRes = false; +short bCoordinates = false; int nNetTime = -1; @@ -737,7 +726,7 @@ short textpages; short lastfps; short nMapMode = 0; -short bNoCreatures = kFalse; +short bNoCreatures = false; short nTotalPlayers = 1; // TODO: Rename this (or make it static) so it doesn't conflict with library function @@ -749,13 +738,13 @@ short nPasswordCount = 0; short screensize; -short bSnakeCam = kFalse; -short bRecord = kFalse; -short bPlayback = kFalse; -short bInDemo = kFalse; -short bSlipMode = kFalse; -short bDoFlashes = kTrue; -short bHolly = kFalse; +short bSnakeCam = false; +short bRecord = false; +short bPlayback = false; +short bInDemo = false; +short bSlipMode = false; +short bDoFlashes = true; +short bHolly = false; short nItemTextIndex; @@ -784,7 +773,6 @@ void ShutDown(void) StopCD(); RemoveEngine(); - UnInitNet(); //UnInitFX(); } @@ -867,7 +855,7 @@ void DoPassword(int nPassword) case 0: { if (!nNetPlayerCount) { - bHolly = kTrue; + bHolly = true; } break; } @@ -891,12 +879,12 @@ void DoPassword(int nPassword) case 4: // LOBOLITE { - if (bDoFlashes == kFalse) + if (bDoFlashes == false) { - bDoFlashes = kTrue; + bDoFlashes = true; } else { - bDoFlashes = kFalse; + bDoFlashes = false; } break; } @@ -911,13 +899,13 @@ void DoPassword(int nPassword) { if (!nNetPlayerCount) { - if (bSlipMode == kFalse) + if (bSlipMode == false) { - bSlipMode = kTrue; + bSlipMode = true; StatusMessage(300, "Slip mode ON"); } else { - bSlipMode = kFalse; + bSlipMode = false; StatusMessage(300, "Slip mode OFF"); } } @@ -928,14 +916,14 @@ void DoPassword(int nPassword) { if (!nNetPlayerCount) { - if (bSnakeCam == kFalse) + if (bSnakeCam == false) { - bSnakeCam = kTrue; + bSnakeCam = true; StatusMessage(750, "SNAKE CAM ENABLED"); } else { - bSnakeCam = kFalse; + bSnakeCam = false; StatusMessage(750, "SNAKE CAM DISABLED"); } } @@ -945,7 +933,7 @@ void DoPassword(int nPassword) case 8: // LOBOSPHERE { GrabMap(); - bShowTowers = kTrue; + bShowTowers = true; break; } @@ -957,11 +945,11 @@ void DoPassword(int nPassword) case 10: // LOBOXY { - if (bCoordinates == kFalse) { - bCoordinates = kTrue; + if (bCoordinates == false) { + bCoordinates = true; } else { - bCoordinates = kFalse; + bCoordinates = false; } break; } @@ -1004,10 +992,10 @@ void CheckKeys() if (!nFreeze) { if (bCamera) { - bCamera = kFalse; + bCamera = false; } else { - bCamera = kTrue; + bCamera = true; } if (bCamera) @@ -1082,7 +1070,7 @@ void CheckKeys() { // TODO - enums? case 0: - BuildAnubis(-1, initx, inity, sector[initsect].floorz, initsect, inita, kFalse); + BuildAnubis(-1, initx, inity, sector[initsect].floorz, initsect, inita, false); break; case 1: BuildSpider(-1, initx, inity, sector[initsect].floorz, initsect, inita); @@ -1132,7 +1120,7 @@ void CheckKeys() { if (nStringLen == 0) { - bHolly = kFalse; + bHolly = false; StatusMessage(1, " "); } else @@ -1294,7 +1282,7 @@ void FinishLevel() StopAllSounds(); - bCamera = kFalse; + bCamera = false; nMapMode = 0; if (levelnum != kMap20) @@ -1357,14 +1345,14 @@ uint8_t ReadPlaybackInputs() besttarget = sPlayerInput[nLocalPlayer].nTarget; Ra[nLocalPlayer].nTarget = besttarget; - return kTrue; + return true; } else { fclose(vcrfp); vcrfp = NULL; - bPlayback = kFalse; - return kFalse; + bPlayback = false; + return false; } } @@ -1372,7 +1360,7 @@ void SetHiRes() { //nScreenWidth = 640; //nScreenHeight = 400; - bHiRes = kTrue; + bHiRes = true; } void DoClockBeep() @@ -1619,12 +1607,6 @@ void ExitGame() fclose(vcrfp); } - { - if (nNetPlayerCount != 0) { - SendGoodbye(); - } - } - ShutDown(); throw CExitEvent(0); } @@ -1644,7 +1626,7 @@ void CheckCommandLine(int argc, char const* const* argv, int &doTitle) //strlwr(pChar); if (Bstrcasecmp(pChar, "nocreatures") == 0) { - bNoCreatures = kTrue; + bNoCreatures = true; } else if (Bstrcasecmp(pChar, "record") == 0) { @@ -1652,7 +1634,7 @@ void CheckCommandLine(int argc, char const* const* argv, int &doTitle) { vcrfp = fopen("data.vcr", "wb+"); if (vcrfp != NULL) { - bRecord = kTrue; + bRecord = true; } else { DebugOut("Can't open data file for recording\n"); @@ -1665,8 +1647,8 @@ void CheckCommandLine(int argc, char const* const* argv, int &doTitle) { vcrfp = fopen("data.vcr", "rb"); if (vcrfp != NULL) { - bPlayback = kTrue; - doTitle = kFalse; + bPlayback = true; + doTitle = false; } else { DebugOut("Can't open data file 'data.vcr' for reading\n"); @@ -1677,9 +1659,9 @@ void CheckCommandLine(int argc, char const* const* argv, int &doTitle) { nNetPlayerCount = -1; forcelevel = levelnew; - bModemPlay = kFalse; + bModemPlay = false; - doTitle = kFalse; + doTitle = false; } else { @@ -1715,7 +1697,7 @@ void CheckCommandLine(int argc, char const* const* argv, int &doTitle) levelnew = atoi(pChar); forcelevel = levelnew; - doTitle = kFalse; + doTitle = false; Printf("Jumping to level %d...\n", levelnew); } @@ -1798,8 +1780,8 @@ int GameInterface::app_main() int i; //int esi = 1; //int edi = esi; - int doTitle = kTrue; // REVERT kTrue; - int stopTitle = kFalse; + int doTitle = true; // REVERT true; + int stopTitle = false; levelnew = 1; buttonMap.SetButtons(actions, NUM_ACTIONS); @@ -1818,8 +1800,8 @@ int GameInterface::app_main() mi->cdSongId = (nTrack % 8) + 11; } - // REVERT - change back to kTrue -// short bDoTitle = kFalse; + // REVERT - change back to true +// short bDoTitle = false; wConsoleNode = 0; @@ -1891,7 +1873,6 @@ int GameInterface::app_main() enginePostInit(); InitView(); - myloadconfig(); InitFX(); seq_LoadSequences(); InitStatus(); @@ -1917,7 +1898,7 @@ int GameInterface::app_main() while (!stopTitle) { DoTitle(); - stopTitle = kTrue; + stopTitle = true; } } // loc_11811: @@ -1952,8 +1933,8 @@ MENU: } InitRandom(); - bInDemo = kTrue; - bPlayback = kTrue; + bInDemo = true; + bPlayback = true; inputState.ClearAllInput(); break; @@ -1966,7 +1947,7 @@ STARTGAME1: } STARTGAME2: - bCamera = kFalse; + bCamera = false; ClearCinemaSeen(); PlayerCount = 0; lastlevel = -1; @@ -2095,7 +2076,7 @@ LOOP3: GrabPalette(); ResetMoveFifo(); moveframes = 0; - bInMove = kFalse; + bInMove = false; tclocks = totalclock; nPlayerDAng = 0; lPlayerXVel = 0; @@ -2135,7 +2116,7 @@ GAMELOOP: if (bRecord || bPlayback) { - bInMove = kTrue; + bInMove = true; moveframes = ((int)totalclock - (int)tclocks2) / 4; @@ -2152,8 +2133,8 @@ GAMELOOP: { inputState.ClearAllInput(); - bPlayback = kFalse; - bInDemo = kFalse; + bPlayback = false; + bInDemo = false; if (vcrfp) { fclose(vcrfp); @@ -2225,7 +2206,7 @@ GAMELOOP: // } } - bInMove = kFalse; + bInMove = false; // END YELLOW SECTION @@ -2243,7 +2224,7 @@ GAMELOOP: } else { - bInMove = kTrue; + bInMove = true; if (paused) { @@ -2292,7 +2273,7 @@ GAMELOOP: } } } - bInMove = kFalse; + bInMove = false; PlayerInterruptKeys(); @@ -2308,7 +2289,7 @@ GAMELOOP: { MenuExitCondition = -2; // MENU2: - bInMove = kTrue; + bInMove = true; switch (nMenu) { @@ -2332,7 +2313,7 @@ GAMELOOP: } totalclock = ototalclock = tclocks; - bInMove = kFalse; + bInMove = false; RefreshStatus(); } else if (buttonMap.ButtonDown(gamefunc_Map)) // e.g. TAB (to show 2D map) diff --git a/source/exhumed/src/exhumed.h b/source/exhumed/src/exhumed.h index e1d330b27..8629a14d6 100644 --- a/source/exhumed/src/exhumed.h +++ b/source/exhumed/src/exhumed.h @@ -29,7 +29,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "c_buttons.h" #include #include "tarray.h" -#include "save.h" #include "zstring.h" #include "filesystem.h" @@ -330,6 +329,26 @@ extern int loaddefinitions_game(const char* fn, int32_t preload); void G_LoadGroupsInDir(const char* dirname); void G_DoAutoload(const char* dirname); +// savegame. + +int savegame(int nSlot); +int loadgame(int nSlot); + + +struct SavegameHelper +{ + FString Name; + TArray> Elements; + SavegameHelper(const char* name, ...); + void Load(); + void Save(); +}; + +#define SV(v) &v, sizeof(v) +#define SA(a) &a, sizeof(a) + + + struct GameInterface : ::GameInterface { const char* Name() override { return "Exhumed"; } diff --git a/source/exhumed/src/fish.cpp b/source/exhumed/src/fish.cpp index ad1c8a9b7..967c3910b 100644 --- a/source/exhumed/src/fish.cpp +++ b/source/exhumed/src/fish.cpp @@ -19,10 +19,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "aistuff.h" #include "engine.h" #include "sequence.h" -#include "random.h" #include "exhumed.h" -#include "trigdat.h" -#include "init.h" #include "sound.h" #include diff --git a/source/exhumed/src/grenade.cpp b/source/exhumed/src/grenade.cpp index aa10e6d81..bfa9b17bf 100644 --- a/source/exhumed/src/grenade.cpp +++ b/source/exhumed/src/grenade.cpp @@ -21,9 +21,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "player.h" #include "exhumed.h" #include "sound.h" -#include "init.h" #include "sequence.h" -#include "random.h" #include BEGIN_PS_NS @@ -317,7 +315,7 @@ void FuncGrenade(int a, int UNUSED(nDamage), int nRun) if (PlayerList[nPlayer].nAmmo[kWeaponGrenade]) { - PlayerList[nPlayer].bIsFiring = kFalse; + PlayerList[nPlayer].bIsFiring = false; } else { diff --git a/source/exhumed/src/gun.cpp b/source/exhumed/src/gun.cpp index 94d648776..31b54de16 100644 --- a/source/exhumed/src/gun.cpp +++ b/source/exhumed/src/gun.cpp @@ -18,17 +18,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "ns.h" #include "aistuff.h" #include "engine.h" -#include "init.h" #include "player.h" #include "exhumed.h" #include "view.h" #include "status.h" -#include "typedefs.h" #include "sound.h" -#include "light.h" #include "ps_input.h" -#include "util.h" -#include "trigdat.h" #include #include #include "v_2ddrawer.h" @@ -49,17 +44,17 @@ struct Weapon */ Weapon WeaponInfo[] = { - { kSeqSword, { 0, 1, 3, 7, -1, 2, 4, 5, 6, 8, 9, 10 }, 0, 0, 0, kTrue }, - { kSeqPistol, { 0, 3, 2, 4, -1, 1, 0, 0, 0, 0, 0, 0 }, 1, 0, 1, kFalse }, - { kSeqM60, { 0, 5, 6, 16, -1, 21, 0, 0, 0, 0, 0, 0 }, 2, 0, 1, kFalse }, - { kSeqFlamer, { 0, 2, 5, 5, 6, 1, 0, 0, 0, 0, 0, 0 }, 3, 4, 1, kFalse }, - { kSeqGrenade, { 0, 2, 3, 4, -1, 1, 0, 0, 0, 0, 0, 0 }, 4, 0, 1, kTrue }, - { kSeqCobra, { 0, 1, 2, 2, -1, 4, 0, 0, 0, 0, 0, 0 }, 5, 0, 1, kTrue }, - { kSeqRavolt, { 0, 1, 2, 3, -1, 4, 0, 0, 0, 0, 0, 0 }, 6, 0, 1, kTrue }, - { kSeqRothands,{ 0, 1, 2, -1, -1, -1, 0, 0, 0, 0, 0, 0 }, 7, 0, 0, kTrue }, - { kSeqDead, { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, 0, 1, 0, kFalse }, - { kSeqDeadEx, { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, 0, 1, 0, kFalse }, - { kSeqDeadBrn, { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, 0, 1, 0, kFalse } + { kSeqSword, { 0, 1, 3, 7, -1, 2, 4, 5, 6, 8, 9, 10 }, 0, 0, 0, true }, + { kSeqPistol, { 0, 3, 2, 4, -1, 1, 0, 0, 0, 0, 0, 0 }, 1, 0, 1, false }, + { kSeqM60, { 0, 5, 6, 16, -1, 21, 0, 0, 0, 0, 0, 0 }, 2, 0, 1, false }, + { kSeqFlamer, { 0, 2, 5, 5, 6, 1, 0, 0, 0, 0, 0, 0 }, 3, 4, 1, false }, + { kSeqGrenade, { 0, 2, 3, 4, -1, 1, 0, 0, 0, 0, 0, 0 }, 4, 0, 1, true }, + { kSeqCobra, { 0, 1, 2, 2, -1, 4, 0, 0, 0, 0, 0, 0 }, 5, 0, 1, true }, + { kSeqRavolt, { 0, 1, 2, 3, -1, 4, 0, 0, 0, 0, 0, 0 }, 6, 0, 1, true }, + { kSeqRothands,{ 0, 1, 2, -1, -1, -1, 0, 0, 0, 0, 0, 0 }, 7, 0, 0, true }, + { kSeqDead, { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, 0, 1, 0, false }, + { kSeqDeadEx, { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, 0, 1, 0, false }, + { kSeqDeadBrn, { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, 0, 1, 0, false } }; short nTemperature[kMaxPlayers]; @@ -137,9 +132,9 @@ void SetNewWeapon(short nPlayer, short nWeapon) if (nWeapon == kWeaponMummified) { PlayerList[nPlayer].field_3C = PlayerList[nPlayer].nCurrentWeapon; - PlayerList[nPlayer].bIsFiring = kFalse; + PlayerList[nPlayer].bIsFiring = false; PlayerList[nPlayer].field_3A = 5; - SetPlayerMummified(nPlayer, kTrue); + SetPlayerMummified(nPlayer, true); PlayerList[nPlayer].field_3FOUR = 0; } @@ -227,20 +222,20 @@ void SelectNewWeapon(short nPlayer) if (nWeapon < 0) nWeapon = kWeaponSword; - PlayerList[nPlayer].bIsFiring = kFalse; + PlayerList[nPlayer].bIsFiring = false; SetNewWeapon(nPlayer, nWeapon); } void StopFiringWeapon(short nPlayer) { - PlayerList[nPlayer].bIsFiring = kFalse; + PlayerList[nPlayer].bIsFiring = false; } void FireWeapon(short nPlayer) { if (!PlayerList[nPlayer].bIsFiring) { - PlayerList[nPlayer].bIsFiring = kTrue; + PlayerList[nPlayer].bIsFiring = true; } } @@ -273,11 +268,11 @@ uint8_t WeaponCanFire(short nPlayer) short nAmmoType = WeaponInfo[nWeapon].nAmmoType; if (WeaponInfo[nWeapon].d <= PlayerList[nPlayer].nAmmo[nAmmoType]) { - return kTrue; + return true; } } - return kFalse; + return false; } // UNUSED @@ -460,7 +455,7 @@ void MoveWeapons(short nPlayer) PlayerList[nPlayer].field_3A = 3; PlayerList[nPlayer].field_3FOUR = 0; - nPistolClip[nPlayer] = Min(6, PlayerList[nPlayer].nAmmo[kWeaponPistol]); + nPistolClip[nPlayer] = std::min(6, PlayerList[nPlayer].nAmmo[kWeaponPistol]); break; } else if (nWeapon == kWeaponGrenade) @@ -483,7 +478,7 @@ void MoveWeapons(short nPlayer) nWeapon = PlayerList[nPlayer].nCurrentWeapon; - SetPlayerMummified(nPlayer, kFalse); + SetPlayerMummified(nPlayer, false); break; } else diff --git a/source/exhumed/src/init.cpp b/source/exhumed/src/init.cpp index 7bed14df2..9905a1757 100644 --- a/source/exhumed/src/init.cpp +++ b/source/exhumed/src/init.cpp @@ -17,18 +17,14 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //------------------------------------------------------------------------- #include "ns.h" #include "compat.h" -#include "init.h" #include "aistuff.h" #include "player.h" #include "view.h" #include "engine.h" #include "sound.h" #include "exhumed.h" -#include "light.h" -#include "map.h" #include "menu.h" #include "ps_input.h" -#include "util.h" #include "mapinfo.h" #include "gamecontrol.h" #include "v_video.h" @@ -65,7 +61,7 @@ short SectSpeed[kMaxSectors] = { 0 }; int SectBelow[kMaxSectors] = { 0 }; -uint8_t bIsVersion6 = kTrue; +uint8_t bIsVersion6 = true; @@ -131,7 +127,7 @@ uint8_t LoadLevel(int nMap) } if (nMap < 0) { - return kFalse; + return false; } vec3_t startPos; @@ -168,7 +164,7 @@ uint8_t LoadLevel(int nMap) levelnum = nMap; - return kTrue; + return true; } void SetBelow(short nCurSector, short nBelowSector) @@ -856,16 +852,6 @@ void LoadObjects() nCameraz = initz; } -int myloadconfig() -{ - - return 1; -} - -int mysaveconfig() -{ - return 1; -} static SavegameHelper sgh("init", SV(initx), diff --git a/source/exhumed/src/init.h b/source/exhumed/src/init.h deleted file mode 100644 index 92f295940..000000000 --- a/source/exhumed/src/init.h +++ /dev/null @@ -1,66 +0,0 @@ -//------------------------------------------------------------------------- -/* -Copyright (C) 2010-2019 EDuke32 developers and contributors -Copyright (C) 2019 sirlemonhead, Nuke.YKT -This file is part of PCExhumed. -PCExhumed is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License version 2 -as published by the Free Software Foundation. -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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ -//------------------------------------------------------------------------- - -#ifndef __init_h__ -#define __init_h__ - -#include "compat.h" - -BEGIN_PS_NS - -#define kMap20 20 - -enum { - kSectUnderwater = 0x2000, - kSectLava = 0x4000, -}; - -extern ClockTicks ototalclock; - -extern int initx; -extern int inity; -extern int initz; -extern short inita; -extern short initsect; - -extern short nCurChunkNum; -extern short nBodyGunSprite[50]; -extern int movefifoend; -extern int movefifopos; -extern short nCurBodyGunNum; - -void SnapSectors(short nSectorA, short nSectorB, short b); - -extern short SectSound[]; -extern short SectDamage[]; -extern short SectSpeed[]; -extern int SectBelow[]; -extern short SectFlag[]; -extern int SectDepth[]; -extern short SectSoundSect[]; -extern int SectAbove[]; - -uint8_t LoadLevel(int nMap); -void LoadObjects(); - -int myloadconfig(); -int mysaveconfig(); - -END_PS_NS - -#endif diff --git a/source/exhumed/src/input.cpp b/source/exhumed/src/input.cpp index 9ffb1433d..a3eeaf558 100644 --- a/source/exhumed/src/input.cpp +++ b/source/exhumed/src/input.cpp @@ -20,7 +20,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "engine.h" #include "exhumed.h" #include "player.h" -#include "network.h" #include BEGIN_PS_NS @@ -129,13 +128,15 @@ void LogoffPlayer(int nPlayer) nNetPlayerCount--; } +short nNetMoveFrames = 0; + void UpdateInputs() { nNetMoveFrames = moveframes; if (nNetPlayerCount) { - UpdateNetInputs(); + //UpdateNetInputs(); nNetMoves++; diff --git a/source/exhumed/src/items.cpp b/source/exhumed/src/items.cpp index 3224b22c2..954297699 100644 --- a/source/exhumed/src/items.cpp +++ b/source/exhumed/src/items.cpp @@ -22,8 +22,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "sound.h" #include "status.h" #include "engine.h" -#include "random.h" -#include "init.h" #include "ps_input.h" BEGIN_PS_NS diff --git a/source/exhumed/src/lavadude.cpp b/source/exhumed/src/lavadude.cpp index 83fa93044..f5ce40a0b 100644 --- a/source/exhumed/src/lavadude.cpp +++ b/source/exhumed/src/lavadude.cpp @@ -18,10 +18,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "ns.h" #include "engine.h" #include "aistuff.h" -#include "random.h" #include "sequence.h" #include "exhumed.h" -#include "trigdat.h" #include "sound.h" #include diff --git a/source/exhumed/src/light.cpp b/source/exhumed/src/light.cpp index 5aeca1014..c129104ad 100644 --- a/source/exhumed/src/light.cpp +++ b/source/exhumed/src/light.cpp @@ -16,11 +16,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- #include "ns.h" -#include "light.h" #include "engine.h" #include "exhumed.h" #include "view.h" -#include "cd.h" #include "aistuff.h" #include "../glbackend/glbackend.h" #include diff --git a/source/exhumed/src/light.h b/source/exhumed/src/light.h deleted file mode 100644 index b1bc2f74b..000000000 --- a/source/exhumed/src/light.h +++ /dev/null @@ -1,44 +0,0 @@ -//------------------------------------------------------------------------- -/* -Copyright (C) 2010-2019 EDuke32 developers and contributors -Copyright (C) 2019 sirlemonhead, Nuke.YKT -This file is part of PCExhumed. -PCExhumed is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License version 2 -as published by the Free Software Foundation. -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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ -//------------------------------------------------------------------------- - -#ifndef __light_h__ -#define __light_h__ - -#include "compat.h" - -BEGIN_PS_NS - -int LoadPaletteLookups(); -void WaitVBL(); -void SetGreenPal(); -void RestoreGreenPal(); -void FixPalette(); -void FadeToWhite(); -int HavePLURemap(); -uint8_t RemapPLU(uint8_t pal); - -//extern unsigned char kenpal[]; -extern short overscanindex; - -extern char *origpalookup[]; - -extern short nPalDiff; - -END_PS_NS - -#endif diff --git a/source/exhumed/src/lighting.cpp b/source/exhumed/src/lighting.cpp index d7928750a..fb589fe31 100644 --- a/source/exhumed/src/lighting.cpp +++ b/source/exhumed/src/lighting.cpp @@ -16,14 +16,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- #include "ns.h" -#include "typedefs.h" #include "aistuff.h" #include "player.h" #include "engine.h" #include "exhumed.h" #include "sound.h" -#include "light.h" -#include "random.h" #include #include @@ -150,8 +147,8 @@ void InitLights() nGlowCount = 0; nFlowCount = 0; nFlashes = 0; - bDoFlicks = kFalse; - bDoGlows = kFalse; + bDoFlicks = false; + bDoGlows = false; for (i = 0; i < kMaxFlashes; i++) { nFreeFlash[i] = i; diff --git a/source/exhumed/src/lion.cpp b/source/exhumed/src/lion.cpp index c02c6af64..4a7db7980 100644 --- a/source/exhumed/src/lion.cpp +++ b/source/exhumed/src/lion.cpp @@ -21,8 +21,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "exhumed.h" #include "sequence.h" #include "sound.h" -#include "random.h" -#include "trigdat.h" #include BEGIN_PS_NS diff --git a/source/exhumed/src/map.cpp b/source/exhumed/src/map.cpp index fd7c92538..2db16f23c 100644 --- a/source/exhumed/src/map.cpp +++ b/source/exhumed/src/map.cpp @@ -16,10 +16,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- #include "ns.h" -#include "typedefs.h" #include #include "player.h" -#include "init.h" #include "engine.h" #include "exhumed.h" #include "view.h" @@ -28,7 +26,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. BEGIN_PS_NS -short bShowTowers = kFalse; +short bShowTowers = false; int ldMapZoom; int lMapZoom; diff --git a/source/exhumed/src/map.h b/source/exhumed/src/map.h deleted file mode 100644 index 359dca0ca..000000000 --- a/source/exhumed/src/map.h +++ /dev/null @@ -1,37 +0,0 @@ -//------------------------------------------------------------------------- -/* -Copyright (C) 2010-2019 EDuke32 developers and contributors -Copyright (C) 2019 sirlemonhead, Nuke.YKT -This file is part of PCExhumed. -PCExhumed is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License version 2 -as published by the Free Software Foundation. -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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ -//------------------------------------------------------------------------- - -#ifndef __map_h__ -#define __map_h__ - -#include "compat.h" - -BEGIN_PS_NS - -extern short bShowTowers; -extern int ldMapZoom; -extern int lMapZoom; - -void InitMap(); -void GrabMap(); -void UpdateMap(); -void DrawMap(); - -END_PS_NS - -#endif diff --git a/source/exhumed/src/menu.cpp b/source/exhumed/src/menu.cpp index 510db3694..ff4db6b9f 100644 --- a/source/exhumed/src/menu.cpp +++ b/source/exhumed/src/menu.cpp @@ -19,7 +19,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "compat.h" #include "build.h" #include "exhumed.h" -#include "typedefs.h" #include "aistuff.h" #include "player.h" #include "sequence.h" @@ -28,14 +27,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "engine.h" #include "c_bind.h" #include "status.h" -#include "random.h" #include "sound.h" #include "names.h" -#include "init.h" #include "ps_input.h" #include "view.h" -#include "light.h" -#include "cd.h" #include "raze_sound.h" #include "menu.h" #include "v_2ddrawer.h" @@ -626,7 +621,7 @@ int menu_DrawTheMap(int nLevel, int nLevelNew, int nLevelBest) int x = 0; int var_2C = 0; int nIdleSeconds = 0; - int bFadeDone = kFalse; + int bFadeDone = false; int startTime = (int)totalclock; @@ -756,7 +751,7 @@ int menu_DrawTheMap(int nLevel, int nLevelNew, int nLevelBest) videoNextPage(); if (!bFadeDone) { - bFadeDone = kTrue; + bFadeDone = true; FadeIn(); } @@ -1227,7 +1222,7 @@ void GoToTheCinema(int nVal) } #endif - FadeOut(kFalse); + FadeOut(false); StopAllSounds(); NoClip(); @@ -1299,7 +1294,7 @@ void GoToTheCinema(int nVal) DoCinemaText(ebx); } - FadeOut(kTrue); + FadeOut(true); overwritesprite(0, 0, kMovieTile, 100, 2, kPalNormal, currentCinemaPalette); videoNextPage(); diff --git a/source/exhumed/src/menu.h b/source/exhumed/src/menu.h index b5e759e5b..e9cffe387 100644 --- a/source/exhumed/src/menu.h +++ b/source/exhumed/src/menu.h @@ -20,7 +20,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #define __menu_h__ #include "player.h" -#include "typedefs.h" #include BEGIN_PS_NS diff --git a/source/exhumed/src/move.cpp b/source/exhumed/src/move.cpp index c0b6bbe08..0c95b182d 100644 --- a/source/exhumed/src/move.cpp +++ b/source/exhumed/src/move.cpp @@ -19,21 +19,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "engine.h" #include "exhumed.h" #include "aistuff.h" -#include "init.h" #include "player.h" #include "view.h" #include "status.h" #include "sound.h" -#include "trigdat.h" -#include "random.h" #include #include -#ifndef __WATCOMC__ -//#include -#else -#include -//#include -#endif + BEGIN_PS_NS @@ -312,7 +304,7 @@ int BelowNear(short nSprite) overridesect = nSector; sprite[nSprite].zvel = 0; - bTouchFloor = kTrue; + bTouchFloor = true; return var_24; } @@ -402,7 +394,7 @@ int movespritez(short nSprite, int z, int height, int UNUSED(flordist), int clip { if (z > 0) { - bTouchFloor = kTrue; + bTouchFloor = true; if ((lohit & 0xC000) == 0xC000) { @@ -503,7 +495,7 @@ int GetSpriteHeight(int nSprite) int movesprite(short nSprite, int dx, int dy, int dz, int UNUSED(ceildist), int flordist, unsigned int clipmask) { spritetype *pSprite = &sprite[nSprite]; - bTouchFloor = kFalse; + bTouchFloor = false; int x = pSprite->x; int y = pSprite->y; diff --git a/source/exhumed/src/movie.cpp b/source/exhumed/src/movie.cpp index 34ddd81da..1de4a4b8d 100644 --- a/source/exhumed/src/movie.cpp +++ b/source/exhumed/src/movie.cpp @@ -19,12 +19,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "engine.h" #include "exhumed.h" #include "names.h" -#include "movie.h" -#include "light.h" #include #include #include "baselayer.h" -#include "typedefs.h" #include "c_bind.h" #include "sound.h" #include "v_2ddrawer.h" @@ -192,7 +189,7 @@ void PlayMovie(const char* fileName) TArray f(64000, true); CurFrame = f.Data(); - int bDoFade = kTrue; + int bDoFade = true; int hFx = -1; auto fp = fileSystem.OpenFileReader(fileName); if (!fp.isOpen()) diff --git a/source/exhumed/src/movie.h b/source/exhumed/src/movie.h deleted file mode 100644 index cad9d61cd..000000000 --- a/source/exhumed/src/movie.h +++ /dev/null @@ -1,28 +0,0 @@ -//------------------------------------------------------------------------- -/* -Copyright (C) 2010-2019 EDuke32 developers and contributors -Copyright (C) 2019 sirlemonhead, Nuke.YKT -This file is part of PCExhumed. -PCExhumed is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License version 2 -as published by the Free Software Foundation. -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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ -//------------------------------------------------------------------------- - -#ifndef __movie_h__ -#define __movie_h__ - -BEGIN_PS_NS - -void PlayMovie(const char *fileName); - -END_PS_NS - -#endif diff --git a/source/exhumed/src/mummy.cpp b/source/exhumed/src/mummy.cpp index 0152e1c91..603cbd1ed 100644 --- a/source/exhumed/src/mummy.cpp +++ b/source/exhumed/src/mummy.cpp @@ -18,11 +18,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "ns.h" #include "aistuff.h" #include "sequence.h" -#include "map.h" #include "sound.h" #include "exhumed.h" -#include "random.h" -#include "trigdat.h" #include #include "engine.h" diff --git a/source/exhumed/src/network.cpp b/source/exhumed/src/network.cpp deleted file mode 100644 index ac2ba6ec9..000000000 --- a/source/exhumed/src/network.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//------------------------------------------------------------------------- -/* -Copyright (C) 2010-2019 EDuke32 developers and contributors -Copyright (C) 2019 sirlemonhead, Nuke.YKT -This file is part of PCExhumed. -PCExhumed is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License version 2 -as published by the Free Software Foundation. -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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ -//------------------------------------------------------------------------- -#include "ns.h" -// this is net.c in the original code - -#include "typedefs.h" -#include "network.h" -#include "ps_input.h" - -BEGIN_PS_NS - -short nNetMoveFrames = 0; - - -void SendGoodbye() -{ - UpdateInputs(); -} - -void UpdateNetInputs() -{ - -} -/* -int InitNet(short nSocket, int nPlayers) -{ - return 0; -} -*/ - -void AbortNetworkPlay() -{ - -} - -void UnInitNet() -{ - -} -END_PS_NS diff --git a/source/exhumed/src/network.h b/source/exhumed/src/network.h deleted file mode 100644 index 3c3db3c04..000000000 --- a/source/exhumed/src/network.h +++ /dev/null @@ -1,34 +0,0 @@ -//------------------------------------------------------------------------- -/* -Copyright (C) 2010-2019 EDuke32 developers and contributors -Copyright (C) 2019 sirlemonhead, Nuke.YKT -This file is part of PCExhumed. -PCExhumed is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License version 2 -as published by the Free Software Foundation. -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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ -//------------------------------------------------------------------------- - -#ifndef __network_h__ -#define __network_h__ - -BEGIN_PS_NS - -extern short nNetMoveFrames; - -void SendGoodbye(); -void UpdateNetInputs(); -int InitNet(short nSocket, int nPlayers); -void AbortNetworkPlay(); -void UnInitNet(); - -END_PS_NS - -#endif diff --git a/source/exhumed/src/object.cpp b/source/exhumed/src/object.cpp index bf93300b3..f2db9d14a 100644 --- a/source/exhumed/src/object.cpp +++ b/source/exhumed/src/object.cpp @@ -19,14 +19,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "engine.h" #include "aistuff.h" #include "exhumed.h" -#include "random.h" #include "view.h" #include "sound.h" -#include "init.h" #include "names.h" #include "sequence.h" #include "player.h" -#include "trigdat.h" #include #include diff --git a/source/exhumed/src/osdcmds.cpp b/source/exhumed/src/osdcmds.cpp index db6c0f62b..70383cea3 100644 --- a/source/exhumed/src/osdcmds.cpp +++ b/source/exhumed/src/osdcmds.cpp @@ -25,7 +25,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "common.h" #include "exhumed.h" #include "player.h" -#include "osdcmds.h" #include "view.h" #include "mapinfo.h" diff --git a/source/exhumed/src/osdcmds.h b/source/exhumed/src/osdcmds.h deleted file mode 100644 index e45295bcb..000000000 --- a/source/exhumed/src/osdcmds.h +++ /dev/null @@ -1,40 +0,0 @@ -//------------------------------------------------------------------------- -/* -Copyright (C) 2010 EDuke32 developers and contributors - -This file is part of EDuke32. - -EDuke32 is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License version 2 -as published by the Free Software Foundation. - -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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ -//------------------------------------------------------------------------- - -#ifndef osdcmds_h_ -#define osdcmds_h_ - -BEGIN_PS_NS - - -int32_t registerosdcommands(void); -void GAME_onshowosd(int shown); -void GAME_clearbackground(int numcols, int numrows); - -extern const char *const ConsoleButtons[]; - -//extern uint32_t cl_cheatmask; - -END_PS_NS - -#endif // osdcmds_h_ - diff --git a/source/exhumed/src/player.cpp b/source/exhumed/src/player.cpp index 39d834622..884b7c1d5 100644 --- a/source/exhumed/src/player.cpp +++ b/source/exhumed/src/player.cpp @@ -24,16 +24,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "engine.h" #include "sequence.h" #include "view.h" -#include "random.h" #include "ps_input.h" -#include "light.h" #include "status.h" #include "sound.h" -#include "init.h" -#include "trigdat.h" #include "menu.h" -#include "cd.h" -#include "map.h" #include "sound.h" #include "buildtiles.h" #include @@ -278,39 +272,39 @@ void PlayerInterruptKeys() // Look/aim up/down functions. if (buttonMap.ButtonDown(gamefunc_Look_Up) || buttonMap.ButtonDown(gamefunc_Aim_Up)) { - bLockPan = kFalse; + bLockPan = false; if (PlayerList[nLocalPlayer].q16horiz < fix16_from_int(180)) { PlayerList[nLocalPlayer].q16horiz = fix16_sadd(PlayerList[nLocalPlayer].q16horiz, fix16_from_dbl(scaleAdjustmentToInterval(4))); } - bPlayerPan = kTrue; + bPlayerPan = true; nDestVertPan[nLocalPlayer] = PlayerList[nLocalPlayer].q16horiz; } else if (buttonMap.ButtonDown(gamefunc_Look_Down) || buttonMap.ButtonDown(gamefunc_Aim_Down)) { - bLockPan = kFalse; + bLockPan = false; if (PlayerList[nLocalPlayer].q16horiz > fix16_from_int(4)) { PlayerList[nLocalPlayer].q16horiz = fix16_ssub(PlayerList[nLocalPlayer].q16horiz, fix16_from_dbl(scaleAdjustmentToInterval(4))); } - bPlayerPan = kTrue; + bPlayerPan = true; nDestVertPan[nLocalPlayer] = PlayerList[nLocalPlayer].q16horiz; } else if (buttonMap.ButtonDown(gamefunc_Center_View)) { - bLockPan = kFalse; - bPlayerPan = kFalse; + bLockPan = false; + bPlayerPan = false; PlayerList[nLocalPlayer].q16horiz = fix16_from_int(92); nDestVertPan[nLocalPlayer] = fix16_from_int(92); } // loc_1C048: if (totalvel[nLocalPlayer] > 20) { - bPlayerPan = kFalse; + bPlayerPan = false; } if (g_MyAimMode) - bLockPan = kTrue; + bLockPan = true; // loc_1C05E fix16_t ecx = nDestVertPan[nLocalPlayer] - PlayerList[nLocalPlayer].q16horiz; @@ -605,7 +599,7 @@ void RestartPlayer(short nPlayer) PlayerList[nPlayer].field_2 = 0; PlayerList[nPlayer].nSprite = nSprite; - PlayerList[nPlayer].bIsMummified = kFalse; + PlayerList[nPlayer].bIsMummified = false; if (PlayerList[nPlayer].invincibility >= 0) { PlayerList[nPlayer].invincibility = 0; diff --git a/source/exhumed/src/queen.cpp b/source/exhumed/src/queen.cpp index 736fe3763..7e145e21c 100644 --- a/source/exhumed/src/queen.cpp +++ b/source/exhumed/src/queen.cpp @@ -20,8 +20,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "exhumed.h" #include "engine.h" #include "sequence.h" -#include "random.h" -#include "trigdat.h" #include "player.h" #include "sound.h" #include "names.h" diff --git a/source/exhumed/src/random.cpp b/source/exhumed/src/random.cpp index 8aa19b126..da65e5059 100644 --- a/source/exhumed/src/random.cpp +++ b/source/exhumed/src/random.cpp @@ -16,7 +16,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- #include "ns.h" -#include "random.h" +#include "engine.h" #include "exhumed.h" BEGIN_PS_NS diff --git a/source/exhumed/src/random.h b/source/exhumed/src/random.h deleted file mode 100644 index cec5a7abf..000000000 --- a/source/exhumed/src/random.h +++ /dev/null @@ -1,34 +0,0 @@ -//------------------------------------------------------------------------- -/* -Copyright (C) 2010-2019 EDuke32 developers and contributors -Copyright (C) 2019 sirlemonhead, Nuke.YKT -This file is part of PCExhumed. -PCExhumed is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License version 2 -as published by the Free Software Foundation. -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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ -//------------------------------------------------------------------------- - -#ifndef __random_h__ -#define __random_h__ -#include "compat.h" - -BEGIN_PS_NS - -void InitRandom(); -int RandomBit(); -char RandomByte(); -uint16_t RandomWord(); -int RandomLong(); -int RandomSize(int nSize); - -END_PS_NS - -#endif diff --git a/source/exhumed/src/rat.cpp b/source/exhumed/src/rat.cpp index 792bbe897..3bcac8886 100644 --- a/source/exhumed/src/rat.cpp +++ b/source/exhumed/src/rat.cpp @@ -19,9 +19,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "aistuff.h" #include "engine.h" #include "sequence.h" -#include "random.h" #include "view.h" -#include "init.h" #include "exhumed.h" #include diff --git a/source/exhumed/src/record.cpp b/source/exhumed/src/record.cpp index 2aca7a446..bc70d3387 100644 --- a/source/exhumed/src/record.cpp +++ b/source/exhumed/src/record.cpp @@ -17,9 +17,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //------------------------------------------------------------------------- #include "ns.h" #include "compat.h" -#include "record.h" -#include "typedefs.h" -#include "save.h" +#include "engine.h" #include #include diff --git a/source/exhumed/src/record.h b/source/exhumed/src/record.h deleted file mode 100644 index 8e12f12ad..000000000 --- a/source/exhumed/src/record.h +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------- -/* -Copyright (C) 2010-2019 EDuke32 developers and contributors -Copyright (C) 2019 sirlemonhead, Nuke.YKT -This file is part of PCExhumed. -PCExhumed is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License version 2 -as published by the Free Software Foundation. -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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ -//------------------------------------------------------------------------- - -#ifndef __record_h__ -#define __record_h__ - -BEGIN_PS_NS - - -extern short record_mode; - - -END_PS_NS - -#endif diff --git a/source/exhumed/src/rex.cpp b/source/exhumed/src/rex.cpp index 06acf1124..081051f29 100644 --- a/source/exhumed/src/rex.cpp +++ b/source/exhumed/src/rex.cpp @@ -21,8 +21,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "engine.h" #include "sequence.h" #include "sound.h" -#include "random.h" -#include "trigdat.h" #include "player.h" #include diff --git a/source/exhumed/src/roach.cpp b/source/exhumed/src/roach.cpp index c71e2b795..ce91c1cf8 100644 --- a/source/exhumed/src/roach.cpp +++ b/source/exhumed/src/roach.cpp @@ -19,10 +19,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "aistuff.h" #include "exhumed.h" #include "engine.h" -#include "typedefs.h" #include "sequence.h" -#include "random.h" -#include "trigdat.h" #include BEGIN_PS_NS diff --git a/source/exhumed/src/runlist.cpp b/source/exhumed/src/runlist.cpp index ef0e8754d..f11499ddd 100644 --- a/source/exhumed/src/runlist.cpp +++ b/source/exhumed/src/runlist.cpp @@ -20,10 +20,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "engine.h" #include "aistuff.h" #include "player.h" -#include "trigdat.h" -#include "random.h" #include "sound.h" -#include "init.h" #include BEGIN_PS_NS diff --git a/source/exhumed/src/save.cpp b/source/exhumed/src/save.cpp index ceb06359c..0f1e86b45 100644 --- a/source/exhumed/src/save.cpp +++ b/source/exhumed/src/save.cpp @@ -16,14 +16,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- #include "ns.h" -#include "save.h" #include #include -#include "init.h" +#include "build.h" #include "raze_music.h" -//#include -//#include -//#include #include "engine.h" #include "exhumed.h" #include "mmulti.h" diff --git a/source/exhumed/src/save.h b/source/exhumed/src/save.h deleted file mode 100644 index d200e887f..000000000 --- a/source/exhumed/src/save.h +++ /dev/null @@ -1,44 +0,0 @@ -//------------------------------------------------------------------------- -/* -Copyright (C) 2010-2019 EDuke32 developers and contributors -Copyright (C) 2019 sirlemonhead, Nuke.YKT -This file is part of PCExhumed. -PCExhumed is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License version 2 -as published by the Free Software Foundation. -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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ -//------------------------------------------------------------------------- - -#ifndef __save_h__ -#define __save_h__ -#include "zstring.h" - -BEGIN_PS_NS - -int savegame(int nSlot); -int loadgame(int nSlot); - - -struct SavegameHelper -{ - FString Name; - TArray> Elements; - SavegameHelper(const char* name, ...); - void Load(); - void Save(); -}; - -#define SV(v) &v, sizeof(v) -#define SA(a) &a, sizeof(a) - - -END_PS_NS - -#endif diff --git a/source/exhumed/src/scorp.cpp b/source/exhumed/src/scorp.cpp index 84d9dbcc0..fde62c1cc 100644 --- a/source/exhumed/src/scorp.cpp +++ b/source/exhumed/src/scorp.cpp @@ -21,8 +21,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "exhumed.h" #include "sequence.h" #include "sound.h" -#include "random.h" -#include "trigdat.h" #include BEGIN_PS_NS diff --git a/source/exhumed/src/sequence.cpp b/source/exhumed/src/sequence.cpp index 9ec5e2be8..1afc45aa3 100644 --- a/source/exhumed/src/sequence.cpp +++ b/source/exhumed/src/sequence.cpp @@ -16,17 +16,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- #include "ns.h" -#include "typedefs.h" #include "sequence.h" #include "engine.h" #include "exhumed.h" #include "sound.h" #include "player.h" -#include "trigdat.h" #include "aistuff.h" #include "view.h" -#include "init.h" -#include "light.h" #include #include diff --git a/source/exhumed/src/set.cpp b/source/exhumed/src/set.cpp index 1f369a611..70c23e08b 100644 --- a/source/exhumed/src/set.cpp +++ b/source/exhumed/src/set.cpp @@ -20,8 +20,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "engine.h" #include "exhumed.h" #include "sequence.h" -#include "random.h" -#include "trigdat.h" #include BEGIN_PS_NS diff --git a/source/exhumed/src/snake.cpp b/source/exhumed/src/snake.cpp index 52ddfb6f7..57f79e061 100644 --- a/source/exhumed/src/snake.cpp +++ b/source/exhumed/src/snake.cpp @@ -24,7 +24,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "sequence.h" #include "ps_input.h" #include "sound.h" -#include "trigdat.h" #include #include diff --git a/source/exhumed/src/sound.cpp b/source/exhumed/src/sound.cpp index 9bfd219e5..844b2ee4a 100644 --- a/source/exhumed/src/sound.cpp +++ b/source/exhumed/src/sound.cpp @@ -22,13 +22,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "engine.h" #include "exhumed.h" #include "sound.h" -#include "init.h" #include "aistuff.h" #include "player.h" -#include "random.h" -#include "trigdat.h" #include "sequence.h" -#include "cd.h" #include "raze_sound.h" BEGIN_PS_NS diff --git a/source/exhumed/src/spider.cpp b/source/exhumed/src/spider.cpp index b7f29e9b0..89fa0a0eb 100644 --- a/source/exhumed/src/spider.cpp +++ b/source/exhumed/src/spider.cpp @@ -20,9 +20,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "exhumed.h" #include "engine.h" #include "sequence.h" -#include "random.h" #include "sound.h" -#include "trigdat.h" #include BEGIN_PS_NS diff --git a/source/exhumed/src/status.cpp b/source/exhumed/src/status.cpp index 746c57f1b..c065b9677 100644 --- a/source/exhumed/src/status.cpp +++ b/source/exhumed/src/status.cpp @@ -22,15 +22,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "status.h" #include "exhumed.h" #include "sequence.h" -#include "init.h" #include "names.h" #include "view.h" -#include "trigdat.h" #include #include #include #include -#include "typedefs.h" BEGIN_PS_NS diff --git a/source/exhumed/src/trigdat.cpp b/source/exhumed/src/trigdat.cpp index 68fbf25cc..f5f31d951 100644 --- a/source/exhumed/src/trigdat.cpp +++ b/source/exhumed/src/trigdat.cpp @@ -16,7 +16,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- #include "ns.h" -#include "trigdat.h" +#include "engine.h" #ifndef __WATCOMC__ #include #include diff --git a/source/exhumed/src/trigdat.h b/source/exhumed/src/trigdat.h deleted file mode 100644 index b7a9923ce..000000000 --- a/source/exhumed/src/trigdat.h +++ /dev/null @@ -1,33 +0,0 @@ -//------------------------------------------------------------------------- -/* -Copyright (C) 2010-2019 EDuke32 developers and contributors -Copyright (C) 2019 sirlemonhead, Nuke.YKT -This file is part of PCExhumed. -PCExhumed is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License version 2 -as published by the Free Software Foundation. -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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ -//------------------------------------------------------------------------- - -#ifndef __trigdat_h__ -#define __trigdat_h__ - -BEGIN_PS_NS - -#define kAngleMask 0x7FF - -int GetMyAngle(int x, int y); - -int AngleDiff(short a, short b); -int AngleDelta(int a, int b, int c); - -END_PS_NS - -#endif diff --git a/source/exhumed/src/typedefs.h b/source/exhumed/src/typedefs.h deleted file mode 100644 index 0c54c9c4d..000000000 --- a/source/exhumed/src/typedefs.h +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------- -/* -Copyright (C) 2010-2019 EDuke32 developers and contributors -Copyright (C) 2019 sirlemonhead, Nuke.YKT -This file is part of PCExhumed. -PCExhumed is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License version 2 -as published by the Free Software Foundation. -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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ -//------------------------------------------------------------------------- - -#ifndef __typedefs_h__ -#define __typedefs_h__ - -#define kTrue (0 == 0) -#define kFalse (0 != 0) - -#endif diff --git a/source/exhumed/src/util.h b/source/exhumed/src/util.h deleted file mode 100644 index efafe308e..000000000 --- a/source/exhumed/src/util.h +++ /dev/null @@ -1,43 +0,0 @@ -//------------------------------------------------------------------------- -/* -Copyright (C) 2010-2019 EDuke32 developers and contributors -Copyright (C) 2019 sirlemonhead, Nuke.YKT -This file is part of PCExhumed. -PCExhumed is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License version 2 -as published by the Free Software Foundation. -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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ -//------------------------------------------------------------------------- - -#ifndef __util_h__ -#define __util_h__ - -BEGIN_PS_NS - - -inline int Min(int a, int b) -{ - if (a < b) - return a; - else - return b; -} - -inline int Max(int a, int b) -{ - if (a < b) - return b; - else - return a; -} - -END_PS_NS - -#endif diff --git a/source/exhumed/src/view.cpp b/source/exhumed/src/view.cpp index 52d553ff2..bd2e9e773 100644 --- a/source/exhumed/src/view.cpp +++ b/source/exhumed/src/view.cpp @@ -24,21 +24,15 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "exhumed.h" #include "player.h" #include "aistuff.h" -#include "light.h" -#include "init.h" #include "menu.h" -#include "cd.h" -#include "typedefs.h" -#include "map.h" #include "sound.h" -#include "trigdat.h" #include "v_video.h" #include "glbackend/glbackend.h" #include BEGIN_PS_NS -short bSubTitles = kTrue; +short bSubTitles = true; int zbob; @@ -57,12 +51,12 @@ short nChunkTotal = 0; fix16_t nCameraa; fix16_t nCamerapan; short nViewTop; -short bClip = kFalse; +short bClip = false; short nViewBottom; short nViewRight; short besttarget; short nViewLeft; -short bCamera = kFalse; +short bCamera = false; short nViewy; @@ -605,7 +599,7 @@ void NoClip() { videoSetViewableArea(0, 0, xdim - 1, ydim - 1); - bClip = kFalse; + bClip = false; } void Clip() @@ -615,7 +609,7 @@ void Clip() MaskStatus(); } - bClip = kTrue; + bClip = true; } diff --git a/source/exhumed/src/wasp.cpp b/source/exhumed/src/wasp.cpp index bbdef5ec7..2db18d862 100644 --- a/source/exhumed/src/wasp.cpp +++ b/source/exhumed/src/wasp.cpp @@ -18,11 +18,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "ns.h" #include "aistuff.h" #include "engine.h" -#include "random.h" #include "exhumed.h" #include "sequence.h" -#include "init.h" -#include "trigdat.h" #include BEGIN_PS_NS @@ -95,9 +92,9 @@ int BuildWasp(short nSprite, int x, int y, int z, short nSector, short nAngle) short nWasp = nWaspCount; nWaspCount++; - uint8_t bEggWasp = kFalse; + uint8_t bEggWasp = false; if (nSprite == -2) { - bEggWasp = kTrue; + bEggWasp = true; } if (nSprite < 0)