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;
|
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;
|
2022-08-21 22:08:52 +00:00
|
|
|
std::pair<DVector3, DAngle> GetCoordinates() 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;
|
2021-11-12 07:59:52 +00:00
|
|
|
void GetInput(ControlInfo* const hidInput, double const 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;
|
2022-09-27 03:10:22 +00:00
|
|
|
void WarpToCoords(double x, double y, double z, DAngle ang) 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;
|
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);
|
2021-11-17 23:16:53 +00:00
|
|
|
bool (*checkhitswitch)(int snum, walltype* w, DDukeActor* act);
|
2021-11-18 17:51:19 +00:00
|
|
|
void (*activatebysector)(sectortype* sect, DDukeActor* j);
|
2022-08-23 20:39:07 +00:00
|
|
|
void (*checkhitwall)(DDukeActor* spr, walltype* dawall, const DVector3& pos, int atwith);
|
2021-11-18 16:55:08 +00:00
|
|
|
bool (*checkhitceiling)(sectortype* 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);
|
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
|
|
|
|
2021-11-06 21:57:26 +00:00
|
|
|
bool (*ceilingspace)(sectortype* sectp);
|
|
|
|
bool (*floorspace)(sectortype* sectp);
|
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);
|
|
|
|
void (*guts)(DDukeActor* s, int gtype, int n, int p);
|
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);
|
|
|
|
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);
|
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);
|
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);
|
|
|
|
void CallAction(DDukeActor* actor);
|
2022-01-17 23:30:43 +00:00
|
|
|
void CallOnHit(DDukeActor* actor, DDukeActor* hitter);
|
2022-11-14 09:22:22 +00:00
|
|
|
void CallOnUse(DDukeActor* actor, player_struct* user);
|
2022-01-19 17:52:52 +00:00
|
|
|
bool CallAnimate(DDukeActor* actor, tspritetype* hitter);
|
2022-02-20 23:19:26 +00:00
|
|
|
|
|
|
|
|
2020-06-11 07:22:16 +00:00
|
|
|
END_DUKE_NS
|
|
|
|
|