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 "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-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;
|
2021-06-01 09:05:26 +00:00
|
|
|
void loadPalette();
|
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
|
|
|
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;
|
2021-04-15 16:50:48 +00:00
|
|
|
void NewGame(MapRecord* map, int skill, bool) override;
|
2020-09-03 21:10:28 +00:00
|
|
|
void LevelCompleted(MapRecord* map, int skill) override;
|
2021-01-02 07:23:01 +00:00
|
|
|
bool DrawAutomapPlayer(int x, int y, int z, int a, double const smoothratio) override;
|
2020-09-24 12:32:37 +00:00
|
|
|
int playerKeyMove() override { return 40; }
|
2020-11-29 11:23:31 +00:00
|
|
|
void WarpToCoords(int x, int y, int z, int a, int h) override;
|
|
|
|
void ToggleThirdPerson() override;
|
|
|
|
void SwitchCoopView() override;
|
|
|
|
void ToggleShowWeapon() override;
|
2021-02-16 10:48:59 +00:00
|
|
|
int chaseCamX(binangle ang) { return -ang.bcos(-4); }
|
|
|
|
int chaseCamY(binangle ang) { return -ang.bsin(-4); }
|
|
|
|
int chaseCamZ(fixedhoriz horiz) { return horiz.asq16() >> 9; }
|
2021-04-02 08:28:40 +00:00
|
|
|
void processSprites(spritetype* tsprite, int& spritesortcnt, int viewx, int viewy, int viewz, binangle viewang, double smoothRatio) override;
|
2021-03-28 17:22:51 +00:00
|
|
|
void UpdateCameras(double smoothratio) override;
|
2021-03-29 19:48:23 +00:00
|
|
|
void EnterPortal(spritetype* viewer, int type) override;
|
|
|
|
void LeavePortal(spritetype* viewer, int type) override;
|
2021-04-02 20:52:46 +00:00
|
|
|
bool GetGeoEffect(GeoEffect* eff, int viewsector) override;
|
2021-07-19 02:24:47 +00:00
|
|
|
void AddExcludedEpisode(FString episode) override;
|
2021-07-20 08:50:46 +00:00
|
|
|
int GetCurrentSkill() override;
|
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
|
|
|
|
{
|
|
|
|
// 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);
|
2021-04-15 05:49:36 +00:00
|
|
|
void (*displaymasks)(int snum, int p, double smoothratio);
|
2020-07-20 21:21:27 +00:00
|
|
|
|
2021-04-02 08:28:40 +00:00
|
|
|
void (*animatesprites)(spritetype* tsprite, int& spritesortcnt, 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
|
|
|
|
|