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"
|
|
|
|
#include "cache1d.h"
|
|
|
|
|
2019-08-26 03:59:14 +00:00
|
|
|
#define kTimerTicks 120
|
|
|
|
|
|
|
|
#ifdef __WATCOMC__
|
|
|
|
void handleevents();
|
|
|
|
#endif
|
|
|
|
|
2019-08-27 06:08:18 +00:00
|
|
|
#ifndef APPNAME
|
2019-11-20 16:33:06 +00:00
|
|
|
#define APPNAME "PCExhumed"
|
2019-08-27 06:08:18 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef APPBASENAME
|
2019-11-20 16:33:06 +00:00
|
|
|
#define APPBASENAME "pcexhumed"
|
2019-08-27 06:08:18 +00:00
|
|
|
#endif
|
|
|
|
|
2019-08-31 09:08:38 +00:00
|
|
|
// TODO:
|
|
|
|
#define OSDTEXT_DEFAULT "^00"
|
|
|
|
#define OSDTEXT_DARKRED "^00"
|
|
|
|
#define OSDTEXT_GREEN "^00"
|
|
|
|
#define OSDTEXT_RED "^00"
|
|
|
|
#define OSDTEXT_YELLOW "^00"
|
|
|
|
|
|
|
|
#define OSDTEXT_BRIGHT "^S0"
|
|
|
|
|
|
|
|
#define OSD_ERROR OSDTEXT_DARKRED OSDTEXT_BRIGHT
|
|
|
|
|
2019-10-12 21:09:55 +00:00
|
|
|
enum basepal_t {
|
|
|
|
BASEPAL = 0,
|
|
|
|
ANIMPAL,
|
|
|
|
BASEPALCOUNT
|
|
|
|
};
|
|
|
|
|
2019-08-27 06:08:18 +00:00
|
|
|
void ShutDown(void);
|
2019-08-26 03:59:14 +00:00
|
|
|
void DebugOut(const char *fmt, ...);
|
|
|
|
void bail2dos(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();
|
|
|
|
|
|
|
|
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-26 03:59:14 +00:00
|
|
|
extern buildvfs_kfd kopen4loadfrommod(const char* filename, char searchfirst);
|
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 short nCDTrackLength;
|
|
|
|
|
|
|
|
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 bNoCDCheck;
|
|
|
|
|
|
|
|
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 short nGamma;
|
|
|
|
|
|
|
|
extern int lCountDown;
|
|
|
|
|
|
|
|
extern short bSlipMode;
|
|
|
|
|
|
|
|
extern short nItemTextIndex;
|
|
|
|
extern const char *gString[];
|
|
|
|
|
2019-09-18 16:11:06 +00:00
|
|
|
extern short bNoSound;
|
|
|
|
|
2019-10-27 16:36:25 +00:00
|
|
|
extern int bVanilla;
|
|
|
|
|
2019-10-29 17:35:22 +00:00
|
|
|
extern int mouseaiming, aimmode, mouseflip;
|
|
|
|
extern int runkey_mode, auto_run;
|
2019-11-03 17:20:05 +00:00
|
|
|
extern int32_t r_maxfps;
|
|
|
|
extern int32_t r_maxfpsoffset;
|
|
|
|
extern double g_frameDelay;
|
|
|
|
|
|
|
|
static inline double calcFrameDelay(int const maxFPS) { return maxFPS > 0 ? (timerGetFreqU64()/(double)maxFPS) : 0.0; }
|
2019-10-29 17:35:22 +00:00
|
|
|
|
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];
|
2019-11-15 06:48:40 +00:00
|
|
|
extern int r_showfps;
|
2019-10-31 17:22:12 +00:00
|
|
|
|
|
|
|
extern struct grpfile_t const* g_selectedGrp;
|
|
|
|
|
|
|
|
extern int loaddefinitions_game(const char* fn, int32_t preload);
|
|
|
|
void G_LoadGroupsInDir(const char* dirname);
|
|
|
|
void G_DoAutoload(const char* dirname);
|
|
|
|
|
2019-08-26 03:59:14 +00:00
|
|
|
#endif
|