2007-01-29 01:18:16 +00:00
|
|
|
// Base services interface declaration
|
|
|
|
// for the Build Engine
|
2012-03-12 04:47:04 +00:00
|
|
|
// by Jonathon Fowler (jf@jonof.id.au)
|
2007-01-29 01:18:16 +00:00
|
|
|
|
2016-03-14 00:07:44 +00:00
|
|
|
#pragma once
|
|
|
|
|
2014-11-22 12:32:56 +00:00
|
|
|
#ifndef baselayer_h_
|
|
|
|
#define baselayer_h_
|
2007-01-29 01:18:16 +00:00
|
|
|
|
2008-02-16 22:27:08 +00:00
|
|
|
#include "compat.h"
|
2008-07-24 11:16:20 +00:00
|
|
|
#include "osd.h"
|
2019-08-13 14:44:16 +00:00
|
|
|
#include "timer.h"
|
2019-10-27 08:53:09 +00:00
|
|
|
#include "c_cvars.h"
|
2019-10-28 00:12:31 +00:00
|
|
|
#include "inputstate.h"
|
2019-11-05 18:57:48 +00:00
|
|
|
#include "printf.h"
|
2019-11-10 10:42:25 +00:00
|
|
|
#include "zstring.h"
|
2019-11-28 18:35:35 +00:00
|
|
|
#include "vectors.h"
|
2008-02-16 22:27:08 +00:00
|
|
|
|
2016-06-21 00:33:39 +00:00
|
|
|
extern char modechange;
|
2007-01-29 01:18:16 +00:00
|
|
|
|
2019-09-21 11:02:17 +00:00
|
|
|
extern int32_t swapcomplete;
|
2019-11-09 18:15:03 +00:00
|
|
|
|
|
|
|
EXTERN_CVAR(Bool, r_usenewaspect)
|
2008-07-22 21:03:09 +00:00
|
|
|
|
2007-01-29 01:18:16 +00:00
|
|
|
// video
|
2019-11-09 18:15:03 +00:00
|
|
|
extern int32_t newaspect_enable;
|
2019-07-06 16:30:18 +00:00
|
|
|
extern int32_t r_fpgrouscan;
|
2012-08-16 21:48:56 +00:00
|
|
|
extern int32_t setaspect_new_use_dimen;
|
2020-01-01 11:36:48 +00:00
|
|
|
extern int32_t xres, yres, bpp, bytesperline, refreshfreq;
|
2008-02-16 22:27:08 +00:00
|
|
|
extern intptr_t frameplace;
|
2007-01-29 01:18:16 +00:00
|
|
|
extern char offscreenrendering;
|
|
|
|
|
2012-12-14 19:28:17 +00:00
|
|
|
void calc_ylookup(int32_t bpl, int32_t lastyidx);
|
|
|
|
|
2018-04-12 21:02:51 +00:00
|
|
|
int32_t videoCheckMode(int32_t *x, int32_t *y, int32_t c, int32_t fs, int32_t forced);
|
|
|
|
int32_t videoSetMode(int32_t x, int32_t y, int32_t c, int32_t fs);
|
|
|
|
void videoGetModes(void);
|
|
|
|
void videoEndDrawing(void);
|
|
|
|
void videoShowFrame(int32_t);
|
|
|
|
int32_t videoUpdatePalette(int32_t start, int32_t num);
|
|
|
|
|
|
|
|
void videoBeginDrawing(void);
|
2007-01-29 01:18:16 +00:00
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
extern int32_t qsetmode;
|
2007-01-29 01:18:16 +00:00
|
|
|
|
2013-08-24 22:55:49 +00:00
|
|
|
#define in3dmode() (qsetmode==200)
|
2013-05-30 09:13:32 +00:00
|
|
|
|
2018-04-12 21:02:31 +00:00
|
|
|
extern int32_t g_logFlushWindow;
|
2007-01-29 01:18:16 +00:00
|
|
|
|
2018-04-23 06:35:52 +00:00
|
|
|
void mouseGrabInput(bool grab);
|
2007-01-29 01:18:16 +00:00
|
|
|
|
2019-10-04 19:13:04 +00:00
|
|
|
void getScreen(uint8_t* imgBuf);
|
|
|
|
|
|
|
|
|
2017-06-05 10:05:07 +00:00
|
|
|
#include "print.h"
|
|
|
|
|
2019-11-12 21:00:33 +00:00
|
|
|
struct GameStats
|
|
|
|
{
|
|
|
|
int kill, tkill;
|
|
|
|
int secret, tsecret;
|
|
|
|
int timesecnd;
|
2019-12-08 23:55:30 +00:00
|
|
|
int frags;
|
2019-11-12 21:00:33 +00:00
|
|
|
};
|
|
|
|
|
2019-11-26 22:20:54 +00:00
|
|
|
struct FGameStartup
|
|
|
|
{
|
|
|
|
int Episode;
|
|
|
|
int Level;
|
|
|
|
int Skill;
|
|
|
|
int CustomLevel1;
|
|
|
|
int CustomLevel2;
|
|
|
|
};
|
|
|
|
|
2019-11-26 23:41:26 +00:00
|
|
|
struct FSavegameInfo
|
|
|
|
{
|
|
|
|
const char *savesig;
|
|
|
|
int minsavever;
|
|
|
|
int currentsavever;
|
|
|
|
};
|
|
|
|
|
2019-11-30 18:23:54 +00:00
|
|
|
struct FSaveGameNode
|
|
|
|
{
|
|
|
|
FString SaveTitle;
|
|
|
|
FString Filename;
|
|
|
|
bool bOldVersion = false;
|
|
|
|
bool bMissingWads = false;
|
|
|
|
bool bNoDelete = false;
|
|
|
|
bool bIsExt = false;
|
|
|
|
|
|
|
|
bool isValid() const
|
|
|
|
{
|
|
|
|
return Filename.IsNotEmpty() && !bOldVersion && !bMissingWads;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2019-11-29 00:28:13 +00:00
|
|
|
enum EMenuSounds : int;
|
|
|
|
|
2019-09-21 20:53:00 +00:00
|
|
|
struct GameInterface
|
|
|
|
{
|
2019-11-03 11:32:58 +00:00
|
|
|
virtual ~GameInterface() {}
|
2020-01-12 22:16:21 +00:00
|
|
|
virtual bool GenerateSavePic() { return false; }
|
2019-11-03 11:32:58 +00:00
|
|
|
virtual void faketimerhandler() {} // This is a remnant of older versions, but Blood backend has not updated yet.
|
|
|
|
virtual int app_main() = 0;
|
2020-01-01 08:49:06 +00:00
|
|
|
virtual void UpdateScreenSize() {}
|
2019-12-24 17:53:29 +00:00
|
|
|
virtual void FreeGameData() {}
|
2019-11-03 11:32:58 +00:00
|
|
|
virtual bool validate_hud(int) = 0;
|
|
|
|
virtual void set_hud_layout(int size) = 0;
|
|
|
|
virtual void set_hud_scale(int size) = 0;
|
2019-11-10 10:42:25 +00:00
|
|
|
virtual FString statFPS() { return "FPS display not available"; }
|
2019-11-12 21:00:33 +00:00
|
|
|
virtual GameStats getStats() { return {}; }
|
2019-12-01 14:31:08 +00:00
|
|
|
virtual void DrawNativeMenuText(int fontnum, int state, double xpos, double ypos, float fontscale, const char* text, int flags) {}
|
2019-11-23 22:05:24 +00:00
|
|
|
virtual void MainMenuOpened() {}
|
|
|
|
virtual void MenuOpened() {}
|
2019-11-26 22:20:54 +00:00
|
|
|
virtual void MenuClosed() {}
|
|
|
|
virtual void MenuSound(EMenuSounds snd) {}
|
2019-11-23 22:05:24 +00:00
|
|
|
virtual bool CanSave() { return true; }
|
2019-11-26 22:20:54 +00:00
|
|
|
virtual void CustomMenuSelection(int menu, int item) {}
|
|
|
|
virtual void StartGame(FGameStartup& gs) {}
|
2019-11-26 23:41:26 +00:00
|
|
|
virtual FSavegameInfo GetSaveSig() { return { "", 0, 0}; }
|
2019-11-28 00:02:45 +00:00
|
|
|
virtual bool DrawSpecialScreen(const DVector2 &origin, int tilenum) { return false; }
|
2019-12-05 22:17:55 +00:00
|
|
|
virtual void DrawCenteredTextScreen(const DVector2& origin, const char* text, int position, bool withbg = true) {}
|
2019-11-28 23:37:19 +00:00
|
|
|
virtual void DrawMenuCaption(const DVector2& origin, const char* text) {}
|
2019-11-30 18:23:54 +00:00
|
|
|
virtual bool SaveGame(FSaveGameNode*) { return false; }
|
|
|
|
virtual bool LoadGame(FSaveGameNode*) { return false; }
|
2019-12-13 20:01:14 +00:00
|
|
|
virtual void DoPrintMessage(int prio, const char*) {}
|
2019-12-04 20:35:35 +00:00
|
|
|
void PrintMessage(int prio, const char*fmt, ...)
|
|
|
|
{
|
|
|
|
va_list ap;
|
|
|
|
va_start(ap, fmt);
|
|
|
|
FString f;
|
|
|
|
f.VFormat(fmt, ap);
|
2019-12-04 22:07:02 +00:00
|
|
|
DoPrintMessage(prio, f);
|
2019-12-04 20:35:35 +00:00
|
|
|
}
|
2019-12-05 18:52:46 +00:00
|
|
|
virtual void DrawPlayerSprite(const DVector2& origin, bool onteam) {}
|
2019-12-06 17:36:49 +00:00
|
|
|
virtual void QuitToTitle() {}
|
2019-12-07 19:48:16 +00:00
|
|
|
virtual void SetAmbience(bool on) {}
|
2019-12-23 19:55:12 +00:00
|
|
|
virtual FString GetCoordString() { return "'stat coord' not implemented"; }
|
2019-12-06 17:36:49 +00:00
|
|
|
|
2019-09-21 20:53:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extern GameInterface* gi;
|
2019-11-10 10:42:25 +00:00
|
|
|
extern double g_beforeSwapTime;
|
|
|
|
|
2019-11-03 11:32:58 +00:00
|
|
|
|
2019-11-07 19:31:16 +00:00
|
|
|
void ImGui_Begin_Frame();
|
|
|
|
|
|
|
|
|
2014-11-22 12:32:56 +00:00
|
|
|
#endif // baselayer_h_
|
2007-01-29 01:18:16 +00:00
|
|
|
|