2020-10-11 09:41:49 +00:00
|
|
|
#pragma once
|
2020-06-11 07:22:16 +00:00
|
|
|
|
|
|
|
#include "build.h"
|
|
|
|
|
|
|
|
#include "compat.h"
|
|
|
|
|
|
|
|
#include "pragmas.h"
|
|
|
|
|
|
|
|
#include "polymost.h"
|
|
|
|
#include "gamecvars.h"
|
2020-10-04 16:31:48 +00:00
|
|
|
#include "razemenu.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-10-21 17:14:41 +00:00
|
|
|
#include "funct.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-10-04 16:31:48 +00:00
|
|
|
#include "gamestruct.h"
|
|
|
|
#include "v_draw.h"
|
2020-07-06 16:08:31 +00:00
|
|
|
|
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-08-16 00:55:50 +00:00
|
|
|
struct GameInterface : public ::GameInterface
|
2020-06-11 07:22:16 +00:00
|
|
|
{
|
2020-07-01 23:24:46 +00:00
|
|
|
const char* Name() override { return "Duke"; }
|
2020-08-23 15:47:05 +00:00
|
|
|
void app_init() override;
|
2020-07-17 18:56:10 +00:00
|
|
|
void clearlocalinputstate() override;
|
2020-06-11 07:22:16 +00:00
|
|
|
bool GenerateSavePic() override;
|
2020-07-15 17:48:04 +00:00
|
|
|
void PlayHudSound() override;
|
2020-06-11 07:22:16 +00:00
|
|
|
GameStats getStats() override;
|
|
|
|
void MenuOpened() override;
|
|
|
|
void MenuSound(EMenuSounds snd) override;
|
|
|
|
bool CanSave() override;
|
2020-09-25 17:36:50 +00:00
|
|
|
bool StartGame(FNewGameStartup& gs) override;
|
2020-06-11 07:22:16 +00:00
|
|
|
FSavegameInfo GetSaveSig() override;
|
2020-07-02 08:59:22 +00:00
|
|
|
double SmallFontScale() override { return isRR() ? 0.5 : 1.; }
|
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-18 19:28:57 +00:00
|
|
|
void ExitFromMenu() override;
|
2020-08-16 00:55:50 +00:00
|
|
|
ReservedSpace GetReservedScreenSpace(int viewsize) override;
|
2020-08-24 17:31:43 +00:00
|
|
|
void DrawPlayerSprite(const DVector2& origin, bool onteam) override;
|
2020-09-06 10:17:54 +00:00
|
|
|
void GetInput(InputPacket* packet, ControlInfo* const hidInput) override;
|
2020-08-29 22:55:49 +00:00
|
|
|
void UpdateSounds() override;
|
2020-08-30 08:42:44 +00:00
|
|
|
void Startup() override;
|
|
|
|
void DrawBackground() override;
|
|
|
|
void Render() override;
|
|
|
|
void Ticker() override;
|
2020-09-02 22:29:17 +00:00
|
|
|
const char* GenericCheat(int player, int cheat) override;
|
2020-09-03 21:10:28 +00:00
|
|
|
const char* CheckCheatMode() override;
|
|
|
|
void NextLevel(MapRecord* map, int skill) override;
|
|
|
|
void NewGame(MapRecord* map, int skill) override;
|
|
|
|
void LevelCompleted(MapRecord* map, int skill) override;
|
2020-09-06 19:31:05 +00:00
|
|
|
bool DrawAutomapPlayer(int x, int y, int z, int a) override;
|
2020-09-24 12:32:37 +00:00
|
|
|
int playerKeyMove() override { return 40; }
|
2020-08-24 17:31:43 +00:00
|
|
|
|
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);
|
2020-10-24 07:31:15 +00:00
|
|
|
int (*movesprite)(int spritenum, int xchange, int ychange, int zchange, unsigned int cliptype);
|
2020-10-24 07:35:43 +00:00
|
|
|
void (*lotsofmoney)(DDukeActor *s, short n);
|
|
|
|
void (*lotsofmail)(DDukeActor *s, short n);
|
|
|
|
void (*lotsofpaper)(DDukeActor *s, short n);
|
2020-07-06 16:08:31 +00:00
|
|
|
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);
|
2020-08-02 03:43:45 +00:00
|
|
|
void (*displayweapon)(int snum, double smoothratio);
|
2020-08-31 17:06:53 +00:00
|
|
|
void (*displaymasks)(int snum, double smoothratio);
|
2020-07-20 21:21:27 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
|