2020-10-11 09:41:49 +00:00
|
|
|
#pragma once
|
2020-06-11 07:22:16 +00:00
|
|
|
|
|
|
|
#include "build.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"
|
2021-11-07 15:46:23 +00:00
|
|
|
#include "gamefuncs.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;
|
2022-12-05 19:04:31 +00:00
|
|
|
void loadPalette() override;
|
2022-12-07 16:10:27 +00:00
|
|
|
void SetupSpecialTextures(TilesetBuildInfo& info) 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-07-18 19:28:57 +00:00
|
|
|
void ExitFromMenu() override;
|
2020-08-24 17:31:43 +00:00
|
|
|
void DrawPlayerSprite(const DVector2& origin, bool onteam) override;
|
2023-03-17 09:58:11 +00:00
|
|
|
void GetInput(const double scaleAdjust, InputPacket* packet = nullptr) 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;
|
2022-09-07 09:37:50 +00:00
|
|
|
bool DrawAutomapPlayer(const DVector2& mxy, const DVector2& cpos, const DAngle cang, const DVector2& xydim, const double czoom, double const interpfrac) override;
|
2023-03-17 06:28:04 +00:00
|
|
|
DCoreActor* getConsoleActor() override;
|
2020-11-29 11:23:31 +00:00
|
|
|
void ToggleThirdPerson() override;
|
|
|
|
void SwitchCoopView() override;
|
|
|
|
void ToggleShowWeapon() override;
|
2022-09-16 17:20:35 +00:00
|
|
|
void processSprites(tspriteArray& tsprites, const DVector3& view, DAngle viewang, double interpfrac) override;
|
2021-03-28 17:22:51 +00:00
|
|
|
void UpdateCameras(double smoothratio) override;
|
2021-12-22 22:27:32 +00:00
|
|
|
void EnterPortal(DCoreActor* viewer, int type) override;
|
|
|
|
void LeavePortal(DCoreActor* viewer, int type) override;
|
2021-11-18 18:33:32 +00:00
|
|
|
bool GetGeoEffect(GeoEffect* eff, sectortype* viewsector) override;
|
2021-11-14 21:56:49 +00:00
|
|
|
void AddExcludedEpisode(const FString& episode) override;
|
2021-07-20 08:50:46 +00:00
|
|
|
int GetCurrentSkill() override;
|
2022-11-19 17:26:17 +00:00
|
|
|
bool WantEscape() override;
|
2022-11-24 20:27:08 +00:00
|
|
|
void StartSoundEngine() 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)();
|
2022-10-11 01:16:59 +00:00
|
|
|
void (*movetransports)();
|
2020-07-06 16:08:31 +00:00
|
|
|
void (*initactorflags)();
|
2022-12-11 14:42:33 +00:00
|
|
|
bool (*checkaccessswitch)(int snum, int switchpal, DDukeActor* act, walltype* w);
|
2021-11-18 17:51:19 +00:00
|
|
|
void (*activatebysector)(sectortype* sect, DDukeActor* j);
|
2020-10-24 05:15:10 +00:00
|
|
|
void (*checkhitsprite)(DDukeActor* i, DDukeActor* sn);
|
2022-01-20 07:31:08 +00:00
|
|
|
void (*checkhitdefault)(DDukeActor* i, DDukeActor* sn);
|
2020-07-06 16:08:31 +00:00
|
|
|
void (*checksectors)(int low);
|
2021-12-04 12:02:38 +00:00
|
|
|
DDukeActor* (*spawninit)(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>* actors);
|
2020-07-06 16:08:31 +00:00
|
|
|
|
2022-11-12 08:33:33 +00:00
|
|
|
void (*addweapon)(player_struct *p, int weapon, bool wswitch);
|
2020-10-21 20:04:39 +00:00
|
|
|
void (*hitradius)(DDukeActor* i, int r, int hp1, int hp2, int hp3, int hp4);
|
2021-11-07 13:07:08 +00:00
|
|
|
void (*lotsofmoney)(DDukeActor *s, int n);
|
|
|
|
void (*lotsofmail)(DDukeActor *s, int n);
|
|
|
|
void (*lotsofpaper)(DDukeActor *s, int n);
|
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);
|
2022-11-14 22:55:46 +00:00
|
|
|
bool (*spawnweapondebris)(int picnum);
|
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
|
2022-02-07 10:04:19 +00:00
|
|
|
void (*incur_damage)(player_struct* p);
|
2022-11-29 12:06:42 +00:00
|
|
|
void (*shoot)(DDukeActor*, int, PClass* cls);
|
2020-07-20 21:21:27 +00:00
|
|
|
void (*selectweapon)(int snum, int j);
|
2022-02-07 10:04:19 +00:00
|
|
|
int (*doincrements)(player_struct* p);
|
|
|
|
void (*checkweapons)(player_struct* p);
|
2020-07-20 21:21:27 +00:00
|
|
|
void (*processinput)(int snum);
|
2022-09-07 05:34:55 +00:00
|
|
|
void (*displayweapon)(int snum, double interpfrac);
|
|
|
|
void (*displaymasks)(int snum, int p, double interpfrac);
|
2020-07-20 21:21:27 +00:00
|
|
|
|
2022-09-15 17:06:41 +00:00
|
|
|
void (*animatesprites)(tspriteArray& tsprites, const DVector2& viewVec, DAngle viewang, double interpfrac);
|
2020-07-06 16:08:31 +00:00
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
extern Dispatcher fi;
|
|
|
|
|
2022-02-20 23:19:26 +00:00
|
|
|
void CallInitialize(DDukeActor* actor);
|
|
|
|
void CallTick(DDukeActor* actor);
|
2022-01-21 00:04:08 +00:00
|
|
|
bool CallOperate(DDukeActor* actor, int plnum);
|
2022-02-20 23:19:26 +00:00
|
|
|
void CallAction(DDukeActor* actor);
|
2022-01-17 23:30:43 +00:00
|
|
|
void CallOnHit(DDukeActor* actor, DDukeActor* hitter);
|
2022-11-15 09:17:23 +00:00
|
|
|
void CallOnHurt(DDukeActor* actor, player_struct* hitter);
|
2022-11-21 20:33:27 +00:00
|
|
|
void CallOnTouch(DDukeActor* actor, player_struct* hitter);
|
2022-01-21 00:04:08 +00:00
|
|
|
bool CallOnUse(DDukeActor* actor, player_struct* user);
|
2022-11-22 16:53:46 +00:00
|
|
|
void CallOnMotoSmash(DDukeActor* actor, player_struct* hitter);
|
2022-11-20 10:58:19 +00:00
|
|
|
void CallOnRespawn(DDukeActor* actor, int low);
|
2022-01-19 17:52:52 +00:00
|
|
|
bool CallAnimate(DDukeActor* actor, tspritetype* hitter);
|
2022-11-29 12:06:42 +00:00
|
|
|
bool CallShootThis(DDukeActor* clsdef, DDukeActor* actor, int pn, const DVector3& spos, DAngle sang);
|
2022-11-20 12:57:51 +00:00
|
|
|
void CallStaticSetup(DDukeActor* actor);
|
2022-11-30 18:39:06 +00:00
|
|
|
void CallPlayFTASound(DDukeActor* actor);
|
2022-12-02 22:26:55 +00:00
|
|
|
void CallStandingOn(DDukeActor* actor, player_struct* p);
|
2022-12-03 16:09:40 +00:00
|
|
|
void CallRunState(DDukeActor* actor);
|
2022-12-29 12:55:59 +00:00
|
|
|
int CallTriggerSwitch(DDukeActor* actor, player_struct* p);
|
2022-02-20 23:19:26 +00:00
|
|
|
|
2022-12-08 22:09:46 +00:00
|
|
|
extern FTextureID mirrortex, foftex;
|
2022-02-20 23:19:26 +00:00
|
|
|
|
2020-06-11 07:22:16 +00:00
|
|
|
END_DUKE_NS
|
|
|
|
|