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);
|
2020-11-02 18:54:20 +00:00
|
|
|
void (*operateforcefields)(DDukeActor* act, int low);
|
2020-10-26 06:30:34 +00:00
|
|
|
bool (*checkhitswitch)(int snum, int w, DDukeActor* act);
|
2020-11-02 18:28:59 +00:00
|
|
|
void (*activatebysector)(int sect, DDukeActor* j);
|
2020-10-24 05:22:44 +00:00
|
|
|
void (*checkhitwall)(DDukeActor* spr, int dawallnum, int x, int y, int z, int atwith);
|
2020-07-06 16:08:31 +00:00
|
|
|
bool (*checkhitceiling)(int sn);
|
2020-10-24 05:15:10 +00:00
|
|
|
void (*checkhitsprite)(DDukeActor* i, DDukeActor* sn);
|
2020-07-06 16:08:31 +00:00
|
|
|
void (*checksectors)(int low);
|
|
|
|
|
|
|
|
bool (*ceilingspace)(int sectnum);
|
|
|
|
bool (*floorspace)(int sectnum);
|
|
|
|
void (*addweapon)(struct player_struct *p, int weapon);
|
2020-10-21 20:04:39 +00:00
|
|
|
void (*hitradius)(DDukeActor* i, int r, int hp1, int hp2, int hp3, int hp4);
|
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-10-22 17:21:21 +00:00
|
|
|
void (*guts)(DDukeActor* s, short gtype, short n, short p);
|
2020-10-22 17:27:59 +00:00
|
|
|
DDukeActor* (*ifhitsectors)(int sectnum);
|
2020-10-21 19:41:14 +00:00
|
|
|
int (*ifhitbyweapon)(DDukeActor* sectnum);
|
2020-11-01 16:57:40 +00:00
|
|
|
void (*fall)(DDukeActor* actor, int g_p);
|
2020-07-20 21:21:27 +00:00
|
|
|
bool (*spawnweapondebris)(int picnum, int dnum);
|
2020-10-22 21:45:49 +00:00
|
|
|
void (*respawnhitag)(DDukeActor* g_sp);
|
2020-11-01 16:57:40 +00:00
|
|
|
void (*checktimetosleep)(DDukeActor* actor);
|
2020-10-22 21:45:49 +00:00
|
|
|
void (*move)(DDukeActor* i, int g_p, int g_x);
|
2020-07-20 21:21:27 +00:00
|
|
|
|
|
|
|
// player
|
|
|
|
void (*incur_damage)(struct player_struct* p);
|
2020-10-24 05:34:39 +00:00
|
|
|
void (*shoot)(DDukeActor*, int);
|
2020-07-20 21:21:27 +00:00
|
|
|
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
|
|
|
|
|