- more header consolidation and cleanup.

In particular, this removes the pointless kTrue and kFalse constants.
This commit is contained in:
Christoph Oelckers 2020-08-18 10:28:19 +02:00
parent 4ea93ebccc
commit aa5f42e5f4
60 changed files with 253 additions and 818 deletions

View file

@ -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

View file

@ -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 <assert.h>
BEGIN_PS_NS

View file

@ -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 <assert.h>
BEGIN_PS_NS

View file

@ -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 <assert.h>
BEGIN_PS_NS

View file

@ -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 <string.h>
#include <assert.h>
@ -439,7 +436,7 @@ HITSPRITE:
short nPlayer = GetPlayerFromSprite(hitsprite);
if (!PlayerList[nPlayer].bIsMummified)
{
PlayerList[nPlayer].bIsMummified = kTrue;
PlayerList[nPlayer].bIsMummified = true;
SetNewWeapon(nPlayer, kWeaponMummified);
}
}

View file

@ -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 <stdio.h>

View file

@ -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

View file

@ -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

View file

@ -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 <string.h>
#include <cstdio> // 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)

View file

@ -29,7 +29,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "c_buttons.h"
#include <algorithm>
#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<std::pair<void*, size_t>> 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"; }

View file

@ -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 <assert.h>

View file

@ -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 <assert.h>
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
{

View file

@ -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 <string.h>
#include <assert.h>
#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<int>(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

View file

@ -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),

View file

@ -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

View file

@ -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 <string.h>
BEGIN_PS_NS
@ -129,13 +128,15 @@ void LogoffPlayer(int nPlayer)
nNetPlayerCount--;
}
short nNetMoveFrames = 0;
void UpdateInputs()
{
nNetMoveFrames = moveframes;
if (nNetPlayerCount)
{
UpdateNetInputs();
//UpdateNetInputs();
nNetMoves++;

View file

@ -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

View file

@ -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 <assert.h>

View file

@ -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 <stdio.h>

View file

@ -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

View file

@ -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 <string.h>
#include <assert.h>
@ -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;

View file

@ -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 <assert.h>
BEGIN_PS_NS

View file

@ -16,10 +16,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
//-------------------------------------------------------------------------
#include "ns.h"
#include "typedefs.h"
#include <string.h>
#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;

View file

@ -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

View file

@ -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();

View file

@ -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 <stdio.h>
BEGIN_PS_NS

View file

@ -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 <string.h>
#include <assert.h>
#ifndef __WATCOMC__
//#include <cmath>
#else
#include <stdlib.h>
//#include <math.h>
#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;

View file

@ -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 <cstdio>
#include <cstring>
#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<uint8_t> f(64000, true);
CurFrame = f.Data();
int bDoFade = kTrue;
int bDoFade = true;
int hFx = -1;
auto fp = fileSystem.OpenFileReader(fileName);
if (!fp.isOpen())

View file

@ -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

View file

@ -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 <assert.h>
#include "engine.h"

View file

@ -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

View file

@ -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

View file

@ -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 <string.h>
#include <assert.h>

View file

@ -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"

View file

@ -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_

View file

@ -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 <assert.h>
@ -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;

View file

@ -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"

View file

@ -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

View file

@ -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

View file

@ -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 <assert.h>

View file

@ -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 <stdio.h>
#include <string.h>

View file

@ -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

View file

@ -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 <assert.h>

View file

@ -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 <assert.h>
BEGIN_PS_NS

View file

@ -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 <assert.h>
BEGIN_PS_NS

View file

@ -16,14 +16,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
//-------------------------------------------------------------------------
#include "ns.h"
#include "save.h"
#include <stdio.h>
#include <stdarg.h>
#include "init.h"
#include "build.h"
#include "raze_music.h"
//#include <fcntl.h>
//#include <sys/stat.h>
//#include <io.h>
#include "engine.h"
#include "exhumed.h"
#include "mmulti.h"

View file

@ -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<std::pair<void*, size_t>> 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

View file

@ -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 <assert.h>
BEGIN_PS_NS

View file

@ -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 <string.h>
#include <stdio.h>

View file

@ -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 <assert.h>
BEGIN_PS_NS

View file

@ -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 <string.h>
#include <assert.h>

View file

@ -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

View file

@ -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 <assert.h>
BEGIN_PS_NS

View file

@ -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 <string.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include "typedefs.h"
BEGIN_PS_NS

View file

@ -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 <cstdlib>
#include <cmath>

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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 <string.h>
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;
}

View file

@ -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 <assert.h>
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)