2020-06-20 17:52:10 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
bool System_WantGuiCapture(); // During playing this tells us whether the game must be paused due to active GUI elememts.
|
|
|
|
|
|
|
|
#include <stdint.h>
|
2020-07-04 15:51:02 +02:00
|
|
|
#include "vectors.h"
|
2020-07-18 21:28:57 +02:00
|
|
|
#include "engineerrors.h"
|
2020-08-28 17:07:36 +10:00
|
|
|
#include "stats.h"
|
2020-08-29 21:20:10 +02:00
|
|
|
#include "packet.h"
|
2021-02-16 21:48:59 +11:00
|
|
|
#include "binaryangle.h"
|
2020-09-06 20:17:54 +10:00
|
|
|
#include "inputstate.h"
|
2020-06-20 17:52:10 +02:00
|
|
|
|
2020-09-03 00:29:17 +02:00
|
|
|
class FSerializer;
|
2021-03-25 16:45:40 +01:00
|
|
|
struct FRenderViewpoint;
|
2021-03-29 21:48:23 +02:00
|
|
|
struct spritetype;
|
2021-11-18 19:33:32 +01:00
|
|
|
struct sectortype;
|
2020-09-03 00:29:17 +02:00
|
|
|
|
2020-06-20 17:52:10 +02:00
|
|
|
struct GameStats
|
|
|
|
{
|
|
|
|
int kill, tkill;
|
|
|
|
int secret, tsecret;
|
|
|
|
int timesecnd;
|
|
|
|
int frags;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct FNewGameStartup
|
|
|
|
{
|
|
|
|
int Episode;
|
|
|
|
int Level;
|
|
|
|
int Skill;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct FSavegameInfo
|
|
|
|
{
|
|
|
|
const char *savesig;
|
|
|
|
int minsavever;
|
|
|
|
int currentsavever;
|
|
|
|
};
|
|
|
|
|
2020-08-16 02:55:50 +02:00
|
|
|
struct ReservedSpace
|
|
|
|
{
|
|
|
|
int top;
|
|
|
|
int statusbar;
|
|
|
|
};
|
2020-06-20 17:52:10 +02:00
|
|
|
|
|
|
|
enum EMenuSounds : int;
|
2020-09-03 23:10:28 +02:00
|
|
|
struct MapRecord;
|
2020-06-20 17:52:10 +02:00
|
|
|
|
2020-08-31 00:09:56 +02:00
|
|
|
extern cycle_t drawtime, actortime, thinktime, gameupdatetime;
|
2020-08-28 17:07:36 +10:00
|
|
|
|
2021-04-02 22:52:46 +02:00
|
|
|
struct GeoEffect
|
|
|
|
{
|
|
|
|
int* geosectorwarp;
|
|
|
|
int* geosectorwarp2;
|
|
|
|
int* geosector;
|
|
|
|
int* geox;
|
|
|
|
int* geoy;
|
|
|
|
int* geox2;
|
|
|
|
int* geoy2;
|
|
|
|
int geocnt;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2020-06-20 17:52:10 +02:00
|
|
|
struct GameInterface
|
|
|
|
{
|
|
|
|
virtual const char* Name() { return "$"; }
|
|
|
|
virtual ~GameInterface() {}
|
|
|
|
virtual bool GenerateSavePic() { return false; }
|
2020-08-23 17:47:05 +02:00
|
|
|
virtual void app_init() = 0;
|
2021-06-01 11:05:26 +02:00
|
|
|
virtual void LoadGameTextures() {}
|
2020-11-10 22:07:45 +01:00
|
|
|
virtual void loadPalette();
|
2020-07-17 20:56:10 +02:00
|
|
|
virtual void clearlocalinputstate() {}
|
2020-06-20 17:52:10 +02:00
|
|
|
virtual void UpdateScreenSize() {}
|
2020-09-03 23:10:28 +02:00
|
|
|
virtual void FreeLevelData();
|
2020-06-20 17:52:10 +02:00
|
|
|
virtual void FreeGameData() {}
|
2020-07-15 19:48:04 +02:00
|
|
|
virtual void PlayHudSound() {}
|
2020-06-20 17:52:10 +02:00
|
|
|
virtual GameStats getStats() { return {}; }
|
|
|
|
virtual void MainMenuOpened() {}
|
|
|
|
virtual void MenuOpened() {}
|
|
|
|
virtual void MenuClosed() {}
|
|
|
|
virtual void MenuSound(EMenuSounds snd) {}
|
|
|
|
virtual bool CanSave() { return true; }
|
|
|
|
virtual void CustomMenuSelection(int menu, int item) {}
|
2021-05-02 00:58:54 +02:00
|
|
|
virtual bool StartGame(FNewGameStartup& gs) { return true; }
|
2020-06-20 17:52:10 +02:00
|
|
|
virtual FSavegameInfo GetSaveSig() { return { "", 0, 0}; }
|
2020-07-02 10:59:22 +02:00
|
|
|
virtual double SmallFontScale() { return 1; }
|
2020-07-21 00:07:02 +02:00
|
|
|
virtual void SerializeGameState(FSerializer& arc) {}
|
2020-06-20 17:52:10 +02:00
|
|
|
virtual void DrawPlayerSprite(const DVector2& origin, bool onteam) {}
|
|
|
|
virtual void SetAmbience(bool on) {}
|
|
|
|
virtual FString GetCoordString() { return "'stat coord' not implemented"; }
|
2020-07-18 21:28:57 +02:00
|
|
|
virtual void ExitFromMenu() { throw CExitEvent(0); }
|
2020-08-16 02:55:50 +02:00
|
|
|
virtual ReservedSpace GetReservedScreenSpace(int viewsize) { return { 0, 0 }; }
|
2021-11-12 18:59:52 +11:00
|
|
|
virtual void GetInput(ControlInfo* const hidInput, double const scaleAdjust, InputPacket* packet = nullptr) {}
|
2020-08-30 00:55:49 +02:00
|
|
|
virtual void UpdateSounds() {}
|
|
|
|
virtual void ErrorCleanup() {}
|
2020-08-30 09:32:34 +02:00
|
|
|
virtual void Startup() {}
|
|
|
|
virtual void DrawBackground() {}
|
2020-08-30 00:55:49 +02:00
|
|
|
virtual void Render() {}
|
2020-08-30 08:03:03 +02:00
|
|
|
virtual void Ticker() {}
|
2020-08-30 09:32:34 +02:00
|
|
|
virtual int GetPlayerChecksum(int pnum) { return 0x12345678 + pnum; }
|
2020-09-03 00:29:17 +02:00
|
|
|
virtual const char *CheckCheatMode() { return nullptr; }
|
|
|
|
virtual const char* GenericCheat(int player, int cheat) = 0;
|
2020-09-03 23:10:28 +02:00
|
|
|
virtual void NextLevel(MapRecord* map, int skill) {}
|
2021-04-15 18:50:48 +02:00
|
|
|
virtual void NewGame(MapRecord* map, int skill, bool special = false) {}
|
2020-09-03 23:10:28 +02:00
|
|
|
virtual void LevelCompleted(MapRecord* map, int skill) {}
|
2021-11-26 23:11:59 +01:00
|
|
|
virtual bool DrawAutomapPlayer(int mx, int my, int x, int y, int z, int a, double const smoothratio) { return false; }
|
2020-09-15 01:27:24 +02:00
|
|
|
virtual void SetTileProps(int tile, int surf, int vox, int shade) {}
|
2020-10-07 13:28:38 +11:00
|
|
|
virtual fixed_t playerHorizMin() { return IntToFixed(-200); }
|
|
|
|
virtual fixed_t playerHorizMax() { return IntToFixed(200); }
|
2020-09-24 22:32:37 +10:00
|
|
|
virtual int playerKeyMove() { return 0; }
|
2020-11-29 12:23:31 +01:00
|
|
|
virtual void WarpToCoords(int x, int y, int z, int a, int h) {}
|
|
|
|
virtual void ToggleThirdPerson() { }
|
|
|
|
virtual void SwitchCoopView() { Printf("Unsupported command\n"); }
|
|
|
|
virtual void ToggleShowWeapon() { Printf("Unsupported command\n"); }
|
2021-02-16 21:48:59 +11:00
|
|
|
virtual int chaseCamX(binangle ang) { return 0; }
|
|
|
|
virtual int chaseCamY(binangle ang) { return 0; }
|
|
|
|
virtual int chaseCamZ(fixedhoriz horiz) { return 0; }
|
2021-04-02 10:28:40 +02:00
|
|
|
virtual void processSprites(spritetype* tsprite, int& spritesortcnt, int viewx, int viewy, int viewz, binangle viewang, double smoothRatio) = 0;
|
2021-03-28 19:22:51 +02:00
|
|
|
virtual void UpdateCameras(double smoothratio) {}
|
2021-03-29 21:48:23 +02:00
|
|
|
virtual void EnterPortal(spritetype* viewer, int type) {}
|
|
|
|
virtual void LeavePortal(spritetype* viewer, int type) {}
|
2021-11-18 19:33:32 +01:00
|
|
|
virtual bool GetGeoEffect(GeoEffect* eff, sectortype* viewsector) { return false; }
|
2021-04-11 13:38:23 +02:00
|
|
|
virtual int Voxelize(int sprnum) { return -1; }
|
2021-11-15 08:56:49 +11:00
|
|
|
virtual void AddExcludedEpisode(const FString& episode) {}
|
2021-07-20 18:50:46 +10:00
|
|
|
virtual int GetCurrentSkill() { return -1; }
|
2021-08-23 09:00:30 +10:00
|
|
|
virtual bool IsQAVInterpTypeValid(const FString& type) { return false; }
|
2021-11-15 08:52:20 +11:00
|
|
|
virtual void AddQAVInterpProps(const int res_id, const FString& interptype, const bool loopable, const TMap<int, TArray<int>>&& ignoredata) { }
|
|
|
|
virtual void RemoveQAVInterpProps(const int res_id) { }
|
2020-08-24 20:20:15 +02:00
|
|
|
|
2020-08-28 17:07:36 +10:00
|
|
|
virtual FString statFPS()
|
|
|
|
{
|
|
|
|
FString output;
|
|
|
|
|
|
|
|
output.AppendFormat("Actor think time: %.3f ms\n", actortime.TimeMS());
|
|
|
|
output.AppendFormat("Total think time: %.3f ms\n", thinktime.TimeMS());
|
|
|
|
output.AppendFormat("Game Update: %.3f ms\n", gameupdatetime.TimeMS());
|
|
|
|
output.AppendFormat("Draw time: %.3f ms\n", drawtime.TimeMS());
|
|
|
|
|
|
|
|
return output;
|
|
|
|
}
|
2020-08-24 20:20:15 +02:00
|
|
|
|
2020-06-20 17:52:10 +02:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
extern GameInterface* gi;
|
|
|
|
|
|
|
|
|
|
|
|
void ImGui_Begin_Frame();
|
|
|
|
|