2019-11-20 16:21:32 +00:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
/*
|
|
|
|
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.
|
|
|
|
*/
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
|
2019-08-26 03:59:14 +00:00
|
|
|
#ifndef __exhumed_h__
|
|
|
|
#define __exhumed_h__
|
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
#include "compat.h"
|
2019-12-25 22:37:16 +00:00
|
|
|
#include "baselayer.h"
|
2019-11-24 09:03:19 +00:00
|
|
|
#include "v_text.h"
|
|
|
|
#include "printf.h"
|
|
|
|
#include "gamecvars.h"
|
|
|
|
#include "m_argv.h"
|
|
|
|
#include "gamecontrol.h"
|
|
|
|
#include "c_buttons.h"
|
2019-12-26 21:00:04 +00:00
|
|
|
#include <algorithm>
|
|
|
|
#include "tarray.h"
|
|
|
|
#include "save.h"
|
|
|
|
#include "zstring.h"
|
2020-04-11 21:54:33 +00:00
|
|
|
#include "filesystem.h"
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2019-11-22 23:11:37 +00:00
|
|
|
BEGIN_PS_NS
|
|
|
|
|
2019-08-26 03:59:14 +00:00
|
|
|
#define kTimerTicks 120
|
|
|
|
|
|
|
|
#ifdef __WATCOMC__
|
|
|
|
void handleevents();
|
|
|
|
#endif
|
|
|
|
|
2019-10-12 21:09:55 +00:00
|
|
|
enum basepal_t {
|
|
|
|
BASEPAL = 0,
|
|
|
|
ANIMPAL,
|
|
|
|
BASEPALCOUNT
|
|
|
|
};
|
|
|
|
|
2019-12-02 19:28:02 +00:00
|
|
|
#pragma pack(push, 1)
|
|
|
|
struct demo_header
|
|
|
|
{
|
|
|
|
uint8_t nMap;
|
|
|
|
int16_t nWeapons;
|
|
|
|
int16_t nCurrentWeapon;
|
|
|
|
int16_t clip;
|
|
|
|
int16_t items;
|
|
|
|
|
|
|
|
int16_t nHealth;
|
|
|
|
int16_t field_2;
|
|
|
|
int16_t nAction;
|
|
|
|
int16_t nSprite;
|
|
|
|
int16_t bIsMummified;
|
|
|
|
int16_t someNetVal;
|
|
|
|
int16_t invincibility;
|
|
|
|
int16_t nAir;
|
|
|
|
int16_t nSeq;
|
|
|
|
int16_t nMaskAmount;
|
|
|
|
uint16_t keys;
|
|
|
|
int16_t nMagic;
|
|
|
|
uint8_t item[8];
|
|
|
|
int16_t nAmmo[7]; // TODO - kMaxWeapons?
|
|
|
|
int16_t pad[2];
|
|
|
|
int16_t nCurrentWeapon2;
|
|
|
|
int16_t field_3FOUR;
|
|
|
|
int16_t bIsFiring;
|
|
|
|
int16_t field_38;
|
|
|
|
int16_t field_3A;
|
|
|
|
int16_t field_3C;
|
|
|
|
int16_t nRun;
|
|
|
|
|
|
|
|
int16_t nLives;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct demo_input
|
|
|
|
{
|
|
|
|
int32_t moveframes;
|
|
|
|
|
|
|
|
int32_t xVel;
|
|
|
|
int32_t yVel;
|
|
|
|
int16_t nAngle;
|
|
|
|
uint16_t buttons;
|
|
|
|
int16_t nTarget;
|
|
|
|
uint8_t horizon;
|
|
|
|
int8_t nItem;
|
|
|
|
int32_t h;
|
|
|
|
uint8_t i;
|
|
|
|
uint8_t pad[11];
|
|
|
|
};
|
|
|
|
#pragma pack(pop)
|
|
|
|
|
2019-12-14 00:33:26 +00:00
|
|
|
void ExitGame();
|
2019-08-27 06:08:18 +00:00
|
|
|
void ShutDown(void);
|
2019-08-26 03:59:14 +00:00
|
|
|
void DebugOut(const char *fmt, ...);
|
|
|
|
int ExhumedMain(int argc, char *argv[]);
|
|
|
|
|
|
|
|
void FinishLevel();
|
|
|
|
|
|
|
|
void SetHiRes();
|
|
|
|
|
|
|
|
void BlackOut();
|
|
|
|
|
|
|
|
void DoGameOverScene();
|
|
|
|
|
|
|
|
int Query(short n, short l, ...);
|
|
|
|
|
|
|
|
extern unsigned char curpal[];
|
|
|
|
|
|
|
|
void TintPalette(int a, int b, int c);
|
2019-10-12 21:09:55 +00:00
|
|
|
//void MySetPalette(unsigned char *palette);
|
|
|
|
//void GetCurPal(unsigned char *palette);
|
2019-08-26 03:59:14 +00:00
|
|
|
|
|
|
|
void EraseScreen(int eax);
|
|
|
|
|
|
|
|
void RestorePalette();
|
|
|
|
|
|
|
|
int FindGString(const char *str);
|
|
|
|
|
|
|
|
void WaitTicks(int nTicks);
|
|
|
|
|
|
|
|
void FadeIn();
|
|
|
|
void FadeOut(int bFadeMusic);
|
|
|
|
|
|
|
|
int myprintext(int x, int y, const char *str, int shade);
|
|
|
|
int MyGetStringWidth(const char *str);
|
|
|
|
|
|
|
|
void mychangespritesect(int nSprite, int nSector);
|
|
|
|
void mydeletesprite(int nSprite);
|
|
|
|
|
|
|
|
void GrabPalette();
|
|
|
|
|
|
|
|
void mysetbrightness(char nBrightness);
|
|
|
|
|
|
|
|
void StartFadeIn();
|
|
|
|
int DoFadeIn();
|
2020-01-06 21:03:16 +00:00
|
|
|
void DoPassword(int nPassword);
|
2019-08-26 03:59:14 +00:00
|
|
|
|
|
|
|
void InitSpiritHead();
|
|
|
|
|
|
|
|
int CopyCharToBitmap(char nChar, int nTile, int xPos, int yPos);
|
|
|
|
|
|
|
|
// TODO - relocate
|
|
|
|
void StatusMessage(int messageTime, const char *fmt, ...);
|
|
|
|
|
|
|
|
int DoSpiritHead();
|
|
|
|
|
2019-08-27 06:08:18 +00:00
|
|
|
void UpdateScreenSize();
|
|
|
|
|
2019-08-31 15:04:06 +00:00
|
|
|
void HandleAsync();
|
|
|
|
|
2019-08-31 09:08:38 +00:00
|
|
|
extern int32_t g_commandSetup;
|
|
|
|
extern int32_t g_noSetup;
|
2019-08-26 03:59:14 +00:00
|
|
|
|
|
|
|
extern char sHollyStr[];
|
|
|
|
|
|
|
|
extern int localclock;
|
|
|
|
|
|
|
|
extern int moveframes;
|
|
|
|
|
|
|
|
extern short bSerialPlay;
|
|
|
|
|
|
|
|
extern int nNetPlayerCount;
|
|
|
|
|
|
|
|
extern int htimer;
|
|
|
|
|
|
|
|
extern int nNetTime;
|
|
|
|
|
|
|
|
extern short nTotalPlayers;
|
|
|
|
|
|
|
|
extern short nFontFirstChar;
|
|
|
|
extern short nBackgroundPic;
|
|
|
|
extern short nShadowPic;
|
|
|
|
|
|
|
|
extern short nCreaturesLeft;
|
|
|
|
|
|
|
|
extern int lLocalButtons;
|
|
|
|
|
|
|
|
extern short nEnergyTowers;
|
|
|
|
|
|
|
|
extern short nEnergyChan;
|
|
|
|
|
|
|
|
extern short nSpiritSprite;
|
|
|
|
|
|
|
|
extern short bInDemo;
|
|
|
|
|
|
|
|
extern short nFreeze;
|
|
|
|
|
|
|
|
extern short nCurBodyNum;
|
|
|
|
extern short nBodyTotal;
|
|
|
|
|
|
|
|
extern short bSnakeCam;
|
|
|
|
|
|
|
|
extern short levelnum;
|
2019-08-27 06:08:18 +00:00
|
|
|
//extern short nScreenWidth;
|
|
|
|
//extern short nScreenHeight;
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-11-18 20:31:08 +00:00
|
|
|
extern short nMapMode;
|
2019-08-26 03:59:14 +00:00
|
|
|
|
|
|
|
extern short nButtonColor;
|
|
|
|
|
|
|
|
extern short nHeadStage;
|
|
|
|
|
|
|
|
extern short lastfps;
|
|
|
|
|
|
|
|
extern int flash;
|
|
|
|
|
|
|
|
extern short bNoCreatures;
|
|
|
|
|
|
|
|
extern short nLocalSpr;
|
|
|
|
extern short levelnew;
|
|
|
|
|
|
|
|
extern short textpages;
|
|
|
|
|
|
|
|
extern short nSnakeCam;
|
|
|
|
|
|
|
|
extern short bHiRes;
|
|
|
|
extern short bCoordinates;
|
|
|
|
extern short bFullScreen;
|
|
|
|
|
|
|
|
extern short bHolly;
|
|
|
|
|
|
|
|
extern short screensize;
|
|
|
|
|
|
|
|
extern int totalmoves;
|
|
|
|
|
|
|
|
extern int lCountDown;
|
|
|
|
|
|
|
|
extern short bSlipMode;
|
|
|
|
|
|
|
|
extern short nItemTextIndex;
|
2019-12-14 00:33:26 +00:00
|
|
|
extern const char* gString[];
|
|
|
|
extern const char* gPSDemoString[];
|
|
|
|
extern const char* gEXDemoString[];
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-10-27 16:36:25 +00:00
|
|
|
extern int bVanilla;
|
|
|
|
|
2019-11-20 18:46:57 +00:00
|
|
|
#define POWERSLAVE (g_gameType & GAMEFLAG_POWERSLAVE)
|
|
|
|
#define EXHUMED (g_gameType & GAMEFLAG_EXHUMED)
|
2019-12-14 08:48:04 +00:00
|
|
|
#define ISDEMOVER (g_gameType & GAMEFLAG_SHAREWARE)
|
2019-11-20 18:46:57 +00:00
|
|
|
|
2019-11-03 17:20:05 +00:00
|
|
|
extern double g_frameDelay;
|
|
|
|
|
2019-08-26 03:59:14 +00:00
|
|
|
enum {
|
2019-08-27 06:08:18 +00:00
|
|
|
kPalNormal = 0,
|
|
|
|
kPalNoDim,
|
|
|
|
kPalTorch,
|
|
|
|
kPalNoTorch,
|
|
|
|
kPalBrite,
|
|
|
|
kPalRedBrite,
|
|
|
|
kPalGreenBrite,
|
|
|
|
kPalNormal2,
|
|
|
|
kPalNoDim2,
|
|
|
|
kPalTorch2,
|
|
|
|
kPalNoTorch2,
|
|
|
|
kPalBrite2
|
2019-08-26 03:59:14 +00:00
|
|
|
};
|
|
|
|
|
2019-10-31 17:22:12 +00:00
|
|
|
extern char g_modDir[BMAX_PATH];
|
|
|
|
|
|
|
|
extern int loaddefinitions_game(const char* fn, int32_t preload);
|
|
|
|
void G_LoadGroupsInDir(const char* dirname);
|
|
|
|
void G_DoAutoload(const char* dirname);
|
|
|
|
|
2019-12-12 23:19:34 +00:00
|
|
|
struct GameInterface : ::GameInterface
|
|
|
|
{
|
2020-02-12 19:25:59 +00:00
|
|
|
const char* Name() override { return "Exhumed"; }
|
2019-12-12 23:19:34 +00:00
|
|
|
int app_main() override;
|
2020-01-01 08:49:06 +00:00
|
|
|
void UpdateScreenSize() override;
|
2020-01-14 20:48:01 +00:00
|
|
|
bool GenerateSavePic() override;
|
2019-12-12 23:19:34 +00:00
|
|
|
bool validate_hud(int) override { return true; }
|
2020-01-22 15:14:01 +00:00
|
|
|
void set_hud_layout(int size) override;
|
2019-12-12 23:19:34 +00:00
|
|
|
void set_hud_scale(int size) override {}
|
2019-12-14 11:39:18 +00:00
|
|
|
void DrawNativeMenuText(int fontnum, int state, double xpos, double ypos, float fontscale, const char* text, int flags) override;
|
|
|
|
void MenuOpened() override;
|
|
|
|
void MenuSound(EMenuSounds snd) override;
|
|
|
|
void MenuClosed() override;
|
|
|
|
void StartGame(FGameStartup& gs) override;
|
|
|
|
FSavegameInfo GetSaveSig() override;
|
2019-12-26 16:42:45 +00:00
|
|
|
void DrawCenteredTextScreen(const DVector2& origin, const char* text, int position, bool bg) override;
|
|
|
|
void DrawMenuCaption(const DVector2& origin, const char* text) override;
|
2019-12-27 09:52:40 +00:00
|
|
|
bool LoadGame(FSaveGameNode* sv) override;
|
|
|
|
bool SaveGame(FSaveGameNode* sv) override;
|
|
|
|
bool CanSave() override;
|
2019-12-14 11:39:18 +00:00
|
|
|
|
2019-12-25 23:21:04 +00:00
|
|
|
FString statFPS() override;
|
2019-12-12 23:19:34 +00:00
|
|
|
//GameStats getStats() override;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2019-11-22 23:11:37 +00:00
|
|
|
END_PS_NS
|
|
|
|
|
2019-08-26 03:59:14 +00:00
|
|
|
#endif
|