2020-06-11 07:22:16 +00:00
|
|
|
#ifndef duke3d_h_
|
|
|
|
#define duke3d_h_
|
|
|
|
|
|
|
|
// JBF
|
|
|
|
#include "baselayer.h"
|
|
|
|
#include "build.h"
|
|
|
|
|
|
|
|
#include "compat.h"
|
|
|
|
|
|
|
|
#include "pragmas.h"
|
|
|
|
|
|
|
|
#include "polymost.h"
|
|
|
|
#include "gamecvars.h"
|
|
|
|
#include "menu/menu.h"
|
2020-07-06 16:08:31 +00:00
|
|
|
#include "funct.h"
|
2020-06-11 07:22:16 +00:00
|
|
|
#include "gamecontrol.h"
|
2020-06-21 21:07:30 +00:00
|
|
|
#include "gamevar.h"
|
2020-06-11 07:22:16 +00:00
|
|
|
#include "global.h"
|
2020-07-03 21:56:14 +00:00
|
|
|
#include "names.h"
|
2020-07-06 11:26:26 +00:00
|
|
|
#include "quotemgr.h"
|
2020-06-11 07:22:16 +00:00
|
|
|
#include "rts.h"
|
|
|
|
#include "sounds.h"
|
2020-06-21 22:40:05 +00:00
|
|
|
#include "soundefs.h"
|
2020-07-06 16:08:31 +00:00
|
|
|
#include "stats.h"
|
2020-07-23 14:40:59 +00:00
|
|
|
#include "binaryangle.h"
|
2020-07-06 16:08:31 +00:00
|
|
|
|
|
|
|
extern glcycle_t drawtime, actortime, thinktime, gameupdatetime;
|
2020-06-11 07:22:16 +00:00
|
|
|
|
|
|
|
BEGIN_DUKE_NS
|
|
|
|
|
2020-06-23 22:40:22 +00:00
|
|
|
extern FFont* IndexFont;
|
|
|
|
extern FFont* DigiFont;
|
|
|
|
|
2020-06-11 07:22:16 +00:00
|
|
|
struct GameInterface : ::GameInterface
|
|
|
|
{
|
2020-07-01 23:24:46 +00:00
|
|
|
const char* Name() override { return "Duke"; }
|
2020-06-11 07:22:16 +00:00
|
|
|
int app_main() override;
|
2020-07-17 18:56:10 +00:00
|
|
|
void clearlocalinputstate() override;
|
2020-06-11 07:22:16 +00:00
|
|
|
void UpdateScreenSize() override;
|
|
|
|
bool GenerateSavePic() override;
|
|
|
|
bool validate_hud(int) override;
|
|
|
|
void set_hud_layout(int size) override;
|
|
|
|
void set_hud_scale(int size) override;
|
2020-07-15 17:48:04 +00:00
|
|
|
void PlayHudSound() override;
|
|
|
|
bool automapActive() override;
|
2020-06-11 07:22:16 +00:00
|
|
|
FString statFPS() override;
|
|
|
|
GameStats getStats() override;
|
|
|
|
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;
|
|
|
|
bool CanSave() override;
|
|
|
|
void StartGame(FNewGameStartup& gs) override;
|
|
|
|
FSavegameInfo GetSaveSig() override;
|
|
|
|
void DrawCenteredTextScreen(const DVector2& origin, const char* text, int position, bool bg) override;
|
2020-07-02 08:59:22 +00:00
|
|
|
double SmallFontScale() override { return isRR() ? 0.5 : 1.; }
|
2020-06-11 07:22:16 +00:00
|
|
|
void DrawMenuCaption(const DVector2& origin, const char* text) override;
|
2020-07-20 22:07:02 +00:00
|
|
|
void SerializeGameState(FSerializer& arc) override;
|
2020-06-11 07:22:16 +00:00
|
|
|
void QuitToTitle() override;
|
|
|
|
FString GetCoordString() override;
|
2020-07-04 13:51:02 +00:00
|
|
|
bool CheatAllowed(bool printmsg) override;
|
2020-07-18 19:28:57 +00:00
|
|
|
void ExitFromMenu() override;
|
2020-06-11 07:22:16 +00:00
|
|
|
};
|
|
|
|
|
2020-07-06 16:08:31 +00:00
|
|
|
struct Dispatcher
|
|
|
|
{
|
2020-07-20 21:21:27 +00:00
|
|
|
// global stuff
|
|
|
|
void (*ShowLogo)(const CompletionFunc& completion);
|
|
|
|
void (*InitFonts)();
|
2020-07-06 16:08:31 +00:00
|
|
|
void (*PrintPaused)();
|
|
|
|
|
|
|
|
// sectors_?.cpp
|
2020-07-20 21:21:27 +00:00
|
|
|
void (*think)();
|
2020-07-06 16:08:31 +00:00
|
|
|
void (*initactorflags)();
|
|
|
|
bool (*isadoorwall)(int dapic);
|
|
|
|
void (*animatewalls)();
|
|
|
|
void (*operaterespawns)(int low);
|
|
|
|
void (*operateforcefields)(int s, int low);
|
|
|
|
bool (*checkhitswitch)(int snum, int w, int switchtype);
|
|
|
|
void (*activatebysector)(int sect, int j);
|
|
|
|
void (*checkhitwall)(int spr, int dawallnum, int x, int y, int z, int atwith);
|
2020-07-20 21:21:27 +00:00
|
|
|
void (*checkplayerhurt)(struct player_struct* p, int j);
|
2020-07-06 16:08:31 +00:00
|
|
|
bool (*checkhitceiling)(int sn);
|
|
|
|
void (*checkhitsprite)(int i, int sn);
|
|
|
|
void (*checksectors)(int low);
|
|
|
|
|
|
|
|
bool (*ceilingspace)(int sectnum);
|
|
|
|
bool (*floorspace)(int sectnum);
|
|
|
|
void (*addweapon)(struct player_struct *p, int weapon);
|
|
|
|
void (*hitradius)(short i, int r, int hp1, int hp2, int hp3, int hp4);
|
|
|
|
int (*movesprite)(short spritenum, int xchange, int ychange, int zchange, unsigned int cliptype);
|
|
|
|
void (*lotsofmoney)(spritetype *s, short n);
|
|
|
|
void (*lotsofmail)(spritetype *s, short n);
|
|
|
|
void (*lotsofpaper)(spritetype *s, short n);
|
|
|
|
void (*guts)(spritetype* s, short gtype, short n, short p);
|
|
|
|
void (*gutsdir)(spritetype* s, short gtype, short n, short p);
|
|
|
|
int (*ifhitsectors)(int sectnum);
|
|
|
|
int (*ifhitbyweapon)(int sectnum);
|
|
|
|
void (*fall)(int g_i, int g_p);
|
2020-07-20 21:21:27 +00:00
|
|
|
bool (*spawnweapondebris)(int picnum, int dnum);
|
|
|
|
void (*respawnhitag)(spritetype* g_sp);
|
|
|
|
void (*checktimetosleep)(int g_i);
|
|
|
|
void (*move)(int g_i, int g_p, int g_x);
|
2020-07-06 16:08:31 +00:00
|
|
|
int (*spawn)(int j, int pn);
|
2020-07-20 21:21:27 +00:00
|
|
|
void (*check_fta_sounds)(int i);
|
|
|
|
|
|
|
|
// player
|
|
|
|
void (*incur_damage)(struct player_struct* p);
|
|
|
|
void (*shoot)(int, int);
|
|
|
|
void (*selectweapon)(int snum, int j);
|
|
|
|
int (*doincrements)(struct player_struct* p);
|
|
|
|
void (*checkweapons)(struct player_struct* p);
|
|
|
|
void (*processinput)(int snum);
|
|
|
|
void (*displayweapon)(int snum);
|
|
|
|
void (*displaymasks)(int snum);
|
|
|
|
|
|
|
|
void (*animatesprites)(int x, int y, int a, int smoothratio);
|
2020-07-06 16:08:31 +00:00
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
extern Dispatcher fi;
|
|
|
|
|
2020-06-11 07:22:16 +00:00
|
|
|
END_DUKE_NS
|
|
|
|
|
|
|
|
#endif
|