mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-26 17:00:56 +00:00
- backend update.
This commit is contained in:
parent
89d5d18b9e
commit
f8caf88089
25 changed files with 67 additions and 39 deletions
|
@ -150,6 +150,11 @@ const char *FBaseCVar::GetHumanString(int precision) const
|
|||
return GetGenericRep(CVAR_String).String;
|
||||
}
|
||||
|
||||
const char *FBaseCVar::GetHumanStringDefault(int precision) const
|
||||
{
|
||||
return GetGenericRepDefault(CVAR_String).String;
|
||||
}
|
||||
|
||||
void FBaseCVar::ForceSet (UCVarValue value, ECVarType type, bool nouserinfosend)
|
||||
{
|
||||
DoSet (value, type);
|
||||
|
@ -653,6 +658,16 @@ const char *FFloatCVar::GetHumanString(int precision) const
|
|||
return cstrbuf;
|
||||
}
|
||||
|
||||
const char *FFloatCVar::GetHumanStringDefault(int precision) const
|
||||
{
|
||||
if (precision < 0)
|
||||
{
|
||||
precision = 6;
|
||||
}
|
||||
mysnprintf(cstrbuf, countof(cstrbuf), "%.*g", precision, DefaultValue);
|
||||
return cstrbuf;
|
||||
}
|
||||
|
||||
UCVarValue FFloatCVar::GetGenericRep (ECVarType type) const
|
||||
{
|
||||
return FromFloat (Value, type);
|
||||
|
|
|
@ -161,6 +161,7 @@ public:
|
|||
virtual UCVarValue GetGenericRep (ECVarType type) const = 0;
|
||||
virtual UCVarValue GetFavoriteRep (ECVarType *type) const = 0;
|
||||
|
||||
virtual const char *GetHumanStringDefault(int precision = -1) const;
|
||||
virtual UCVarValue GetGenericRepDefault (ECVarType type) const = 0;
|
||||
virtual UCVarValue GetFavoriteRepDefault (ECVarType *type) const = 0;
|
||||
virtual void SetGenericRepDefault (UCVarValue value, ECVarType type) = 0;
|
||||
|
@ -339,6 +340,7 @@ public:
|
|||
virtual UCVarValue GetFavoriteRepDefault (ECVarType *type) const override;
|
||||
virtual void SetGenericRepDefault (UCVarValue value, ECVarType type) override;
|
||||
const char *GetHumanString(int precision) const override;
|
||||
const char *GetHumanStringDefault(int precision) const override;
|
||||
|
||||
float operator= (float floatval)
|
||||
{ UCVarValue val; val.Float = floatval; SetGenericRep (val, CVAR_Float); return floatval; }
|
||||
|
|
|
@ -302,7 +302,8 @@ void C_DoCommand (const char *cmd, int keynum)
|
|||
else
|
||||
{ // Get the variable's value
|
||||
if (var->GetDescription().Len()) Printf("%s\n", GStrings.localize(var->GetDescription()));
|
||||
Printf ("\"%s\" is \"%s\"\n", var->GetName(), var->GetHumanString());
|
||||
Printf ("\"%s\" is \"%s\" ", var->GetName(), var->GetHumanString());
|
||||
Printf ("(default: \"%s\")\n", var->GetHumanStringDefault());
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -137,7 +137,7 @@ void D_PostEvent(event_t* ev)
|
|||
{
|
||||
return;
|
||||
}
|
||||
if (sysCallbacks && sysCallbacks->DispatchEvent && sysCallbacks->DispatchEvent(ev))
|
||||
if (sysCallbacks.DispatchEvent && sysCallbacks.DispatchEvent(ev))
|
||||
return;
|
||||
|
||||
events[eventhead] = *ev;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include "i_interface.h"
|
||||
|
||||
// Some global engine variables taken out of the backend code.
|
||||
SystemCallbacks *sysCallbacks;
|
||||
SystemCallbacks sysCallbacks;
|
||||
FString endoomName;
|
||||
bool batchrun;
|
||||
float menuBlurAmount;
|
||||
|
|
|
@ -24,7 +24,7 @@ struct SystemCallbacks
|
|||
bool (*DispatchEvent)(event_t* ev);
|
||||
};
|
||||
|
||||
extern SystemCallbacks *sysCallbacks;
|
||||
extern SystemCallbacks sysCallbacks;
|
||||
|
||||
struct WadStuff
|
||||
{
|
||||
|
|
|
@ -162,7 +162,7 @@ uint8_t TransmitBuffer[TRANSMIT_SIZE];
|
|||
|
||||
FString GetPlayerName(int num)
|
||||
{
|
||||
if (sysCallbacks && sysCallbacks->GetPlayerName) return sysCallbacks->GetPlayerName(sendplayer[num]);
|
||||
if (sysCallbacks.GetPlayerName) return sysCallbacks.GetPlayerName(sendplayer[num]);
|
||||
else return FStringf("Player %d", sendplayer[num] + 1);
|
||||
}
|
||||
|
||||
|
|
|
@ -660,7 +660,10 @@ xx(Static)
|
|||
xx(Staticconst)
|
||||
xx(DeathmatchStatusScreen)
|
||||
xx(CoopStatusScreen)
|
||||
xx(DoomStatusScreen)
|
||||
xx(RavenStatusScreen)
|
||||
xx(DoomStatusScreenSized)
|
||||
xx(RavenStatusScreenSized)
|
||||
xx(StatusbarWidget)
|
||||
xx(StatusbarHead)
|
||||
xx(StatusbarCondition)
|
||||
|
@ -1076,3 +1079,10 @@ xx(NewPlayerMenu)
|
|||
xx(AltHud)
|
||||
xx(GameScreen)
|
||||
|
||||
// summary
|
||||
xx(cwidth)
|
||||
xx(cheight)
|
||||
xx(wrapwidth)
|
||||
xx(scalefactorx)
|
||||
xx(scalefactory)
|
||||
xx(scalemode)
|
||||
|
|
|
@ -265,7 +265,8 @@ inline FSerializer &Serialize(FSerializer &arc, const char *key, DVector2 &p, DV
|
|||
return arc.Array<double>(key, &p[0], def? &(*def)[0] : nullptr, 2, true);
|
||||
}
|
||||
|
||||
inline FSerializer &Serialize(FSerializer &arc, const char *key, DAngle &p, DAngle *def)
|
||||
template<class T>
|
||||
inline FSerializer &Serialize(FSerializer &arc, const char *key, TAngle<T> &p, TAngle<T> *def)
|
||||
{
|
||||
return Serialize(arc, key, p.Degrees, def? &def->Degrees : nullptr);
|
||||
}
|
||||
|
|
|
@ -73,7 +73,7 @@ size_t s_skipMouseMoves;
|
|||
|
||||
void CheckGUICapture()
|
||||
{
|
||||
bool wantCapt = sysCallbacks && sysCallbacks->WantGuiCapture && sysCallbacks->WantGuiCapture();
|
||||
bool wantCapt = sysCallbacks.WantGuiCapture && sysCallbacks.WantGuiCapture();
|
||||
|
||||
if (wantCapt != GUICapture)
|
||||
{
|
||||
|
@ -149,7 +149,7 @@ void CheckNativeMouse()
|
|||
}
|
||||
else
|
||||
{
|
||||
bool captureModeInGame = sysCallbacks && sysCallbacks->CaptureModeInGame && sysCallbacks->CaptureModeInGame();
|
||||
bool captureModeInGame = sysCallbacks.CaptureModeInGame && sysCallbacks.CaptureModeInGame();
|
||||
wantNative = (!m_use_mouse || MENU_WaitKey != menuactive)
|
||||
&& (!captureModeInGame || GUICapture);
|
||||
}
|
||||
|
@ -161,7 +161,7 @@ void CheckNativeMouse()
|
|||
&& (MENU_On == menuactive || MENU_OnNoPause == menuactive);
|
||||
}
|
||||
|
||||
if (!wantNative && sysCallbacks && sysCallbacks->WantNativeMouse && sysCallbacks->WantNativeMouse())
|
||||
if (!wantNative && sysCallbacks.WantNativeMouse && sysCallbacks.WantNativeMouse())
|
||||
wantNative = true;
|
||||
|
||||
I_SetNativeMouse(wantNative);
|
||||
|
|
|
@ -66,8 +66,8 @@ static const char* const tableHeaders[NUM_COLUMNS] = { "IWAD", "Game" };
|
|||
- (void)dealloc;
|
||||
- (IWADTableData *)init:(WadStuff *) wads num:(int) numwads;
|
||||
|
||||
- (int)numberOfRowsInTableView:(NSTableView *)aTableView;
|
||||
- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex;
|
||||
- (NSInteger)numberOfRowsInTableView:(NSTableView *)aTableView;
|
||||
- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex;
|
||||
@end
|
||||
|
||||
@implementation IWADTableData
|
||||
|
@ -100,12 +100,12 @@ static const char* const tableHeaders[NUM_COLUMNS] = { "IWAD", "Game" };
|
|||
return self;
|
||||
}
|
||||
|
||||
- (int)numberOfRowsInTableView:(NSTableView *)aTableView
|
||||
- (NSInteger)numberOfRowsInTableView:(NSTableView *)aTableView
|
||||
{
|
||||
return [data count];
|
||||
}
|
||||
|
||||
- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex
|
||||
- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex
|
||||
{
|
||||
NSParameterAssert(rowIndex >= 0 && (unsigned int) rowIndex < [data count]);
|
||||
NSMutableDictionary *record = [data objectAtIndex:rowIndex];
|
||||
|
|
|
@ -165,7 +165,7 @@ static const TMap<SDL_Scancode, uint8_t> KeyScanToDIK(InitKeyScanMap());
|
|||
|
||||
static void I_CheckGUICapture ()
|
||||
{
|
||||
bool wantCapt = sysCallbacks && sysCallbacks->WantGuiCapture && sysCallbacks->WantGuiCapture();
|
||||
bool wantCapt = sysCallbacks.WantGuiCapture && sysCallbacks.WantGuiCapture();
|
||||
|
||||
if (wantCapt != GUICapture)
|
||||
{
|
||||
|
@ -206,10 +206,10 @@ static void I_CheckNativeMouse ()
|
|||
{
|
||||
bool focus = SDL_GetKeyboardFocus() != NULL;
|
||||
|
||||
bool captureModeInGame = sysCallbacks && sysCallbacks->CaptureModeInGame && sysCallbacks->CaptureModeInGame();
|
||||
bool captureModeInGame = sysCallbacks.CaptureModeInGame && sysCallbacks.CaptureModeInGame();
|
||||
bool wantNative = !focus || (!use_mouse || GUICapture || !captureModeInGame);
|
||||
|
||||
if (!wantNative && sysCallbacks && sysCallbacks->WantNativeMouse && sysCallbacks->WantNativeMouse())
|
||||
if (!wantNative && sysCallbacks.WantNativeMouse && sysCallbacks.WantNativeMouse())
|
||||
wantNative = true;
|
||||
|
||||
if (wantNative != NativeMouse)
|
||||
|
|
|
@ -87,7 +87,7 @@ FArgs *Args;
|
|||
|
||||
static int GetCrashInfo (char *buffer, char *end)
|
||||
{
|
||||
if (sysCallbacks && sysCallbacks->CrashInfo) sysCallbacks->CrashInfo(buffer, end - buffer, "\n");
|
||||
if (sysCallbacks.CrashInfo) sysCallbacks.CrashInfo(buffer, end - buffer, "\n");
|
||||
return strlen(buffer);
|
||||
}
|
||||
|
||||
|
|
|
@ -147,7 +147,7 @@ extern int chatmodeon;
|
|||
|
||||
static void I_CheckGUICapture ()
|
||||
{
|
||||
bool wantCapt = sysCallbacks && sysCallbacks->WantGuiCapture && sysCallbacks->WantGuiCapture();
|
||||
bool wantCapt = sysCallbacks.WantGuiCapture && sysCallbacks.WantGuiCapture();
|
||||
|
||||
if (wantCapt != GUICapture)
|
||||
{
|
||||
|
@ -394,7 +394,7 @@ LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
return result;
|
||||
}
|
||||
|
||||
if (message == WM_LBUTTONDOWN && sysCallbacks && sysCallbacks->WantLeftButton() && sysCallbacks->WantLeftButton())
|
||||
if (message == WM_LBUTTONDOWN && sysCallbacks.WantLeftButton() && sysCallbacks.WantLeftButton())
|
||||
{
|
||||
if (GUIWndProcHook(hWnd, message, wParam, lParam, &result))
|
||||
{
|
||||
|
@ -504,7 +504,7 @@ LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
{
|
||||
SetPriorityClass (GetCurrentProcess (), INGAME_PRIORITY_CLASS);
|
||||
}
|
||||
else if (!noidle && !(sysCallbacks && sysCallbacks->NetGame && sysCallbacks->NetGame()))
|
||||
else if (!noidle && !(sysCallbacks.NetGame && sysCallbacks.NetGame()))
|
||||
{
|
||||
SetPriorityClass (GetCurrentProcess (), IDLE_PRIORITY_CLASS);
|
||||
}
|
||||
|
@ -749,7 +749,7 @@ void I_StartTic ()
|
|||
BlockMouseMove--;
|
||||
buttonMap.ResetButtonTriggers ();
|
||||
I_CheckGUICapture ();
|
||||
EventHandlerResultForNativeMouse = sysCallbacks && sysCallbacks->WantNativeMouse && sysCallbacks->WantNativeMouse();
|
||||
EventHandlerResultForNativeMouse = sysCallbacks.WantNativeMouse && sysCallbacks.WantNativeMouse();
|
||||
I_CheckNativeMouse (false, EventHandlerResultForNativeMouse);
|
||||
I_GetEvent ();
|
||||
}
|
||||
|
|
|
@ -1108,7 +1108,7 @@ LONG WINAPI CatchAllExceptions (LPEXCEPTION_POINTERS info)
|
|||
char *custominfo = (char *)HeapAlloc (GetProcessHeap(), 0, 16384);
|
||||
|
||||
CrashPointers = *info;
|
||||
if (sysCallbacks && sysCallbacks->CrashInfo && custominfo) sysCallbacks->CrashInfo(custominfo, 16384, "\r\n");
|
||||
if (sysCallbacks.CrashInfo && custominfo) sysCallbacks.CrashInfo(custominfo, 16384, "\r\n");
|
||||
CreateCrashLog (custominfo, (DWORD)strlen(custominfo), ConWindow);
|
||||
|
||||
// If the main thread crashed, then make it clean up after itself.
|
||||
|
|
|
@ -269,7 +269,7 @@ void I_CheckNativeMouse(bool preferNative, bool eventhandlerresult)
|
|||
else
|
||||
{
|
||||
bool pauseState = false;
|
||||
bool captureModeInGame = sysCallbacks && sysCallbacks->CaptureModeInGame && sysCallbacks->CaptureModeInGame();
|
||||
bool captureModeInGame = sysCallbacks.CaptureModeInGame && sysCallbacks.CaptureModeInGame();
|
||||
want_native = ((!m_use_mouse || menuactive != MENU_WaitKey) &&
|
||||
(!captureModeInGame || GUICapture));
|
||||
}
|
||||
|
|
|
@ -396,8 +396,8 @@ static const int StrifeStartupPicSizes[4 + 2 + 1] =
|
|||
|
||||
static void ST_Sound(const char* sndname)
|
||||
{
|
||||
if (sysCallbacks && sysCallbacks->PlayStartupSound)
|
||||
sysCallbacks->PlayStartupSound(sndname);
|
||||
if (sysCallbacks.PlayStartupSound)
|
||||
sysCallbacks.PlayStartupSound(sndname);
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
|
@ -119,7 +119,7 @@ void FSamplerManager::SetTextureFilterMode()
|
|||
glBindSampler(i, 0);
|
||||
}
|
||||
|
||||
int filter = sysCallbacks && sysCallbacks->DisableTextureFilter && sysCallbacks->DisableTextureFilter() ? 0 : gl_texture_filter;
|
||||
int filter = sysCallbacks.DisableTextureFilter && sysCallbacks.DisableTextureFilter() ? 0 : gl_texture_filter;
|
||||
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
|
|
|
@ -166,7 +166,7 @@ void CheckBench()
|
|||
|
||||
FString compose;
|
||||
|
||||
if (sysCallbacks && sysCallbacks->GetLocationDescription) compose = sysCallbacks->GetLocationDescription();
|
||||
if (sysCallbacks.GetLocationDescription) compose = sysCallbacks.GetLocationDescription();
|
||||
|
||||
AppendRenderStats(compose);
|
||||
AppendRenderTimes(compose);
|
||||
|
|
|
@ -61,7 +61,7 @@ static VRMode vrmi_checker = { 2, isqrt2, isqrt2, 1.f,{ { -.5f, 1.f },{ .5f, 1.f
|
|||
const VRMode *VRMode::GetVRMode(bool toscreen)
|
||||
{
|
||||
#ifdef VR3D_ENABLED
|
||||
int mode = !toscreen || (sysCallbacks && sysCallbacks->DisableTextureFilter && sysCallbacks->DisableTextureFilter()) ? 0 : vr_mode;
|
||||
int mode = !toscreen || (sysCallbacks.DisableTextureFilter && sysCallbacks.DisableTextureFilter()) ? 0 : vr_mode;
|
||||
|
||||
switch (mode)
|
||||
{
|
||||
|
|
|
@ -107,7 +107,7 @@ namespace
|
|||
static bool lastspecialUI = false;
|
||||
bool isInActualMenu = false;
|
||||
|
||||
bool specialUI = sysCallbacks && (!sysCallbacks->IsSpecialUI || sysCallbacks->IsSpecialUI());
|
||||
bool specialUI = (!sysCallbacks.IsSpecialUI || sysCallbacks.IsSpecialUI());
|
||||
|
||||
if (specialUI == lastspecialUI)
|
||||
return;
|
||||
|
|
|
@ -200,7 +200,7 @@ void DFrameBuffer::SetViewportRects(IntRect *bounds)
|
|||
mScreenViewport.height = screenHeight;
|
||||
|
||||
// Viewport for the 3D scene
|
||||
if (sysCallbacks && sysCallbacks->GetSceneRect) mSceneViewport = sysCallbacks->GetSceneRect();
|
||||
if (sysCallbacks.GetSceneRect) mSceneViewport = sysCallbacks.GetSceneRect();
|
||||
else mSceneViewport = mScreenViewport;
|
||||
|
||||
// Scale viewports to fit letterbox
|
||||
|
|
|
@ -116,8 +116,8 @@ CUSTOM_CVAR(Int, uiscale, 0, CVAR_ARCHIVE | CVAR_NOINITCALL)
|
|||
self = 0;
|
||||
return;
|
||||
}
|
||||
if (sysCallbacks && sysCallbacks->OnScreenSizeChanged)
|
||||
sysCallbacks->OnScreenSizeChanged();
|
||||
if (sysCallbacks.OnScreenSizeChanged)
|
||||
sysCallbacks.OnScreenSizeChanged();
|
||||
setsizeneeded = true;
|
||||
}
|
||||
|
||||
|
@ -294,8 +294,8 @@ void V_OutputResized (int width, int height)
|
|||
twod->End();
|
||||
setsizeneeded = true;
|
||||
C_NewModeAdjust();
|
||||
if (sysCallbacks && sysCallbacks->OnScreenSizeChanged)
|
||||
sysCallbacks->OnScreenSizeChanged();
|
||||
if (sysCallbacks.OnScreenSizeChanged)
|
||||
sysCallbacks.OnScreenSizeChanged();
|
||||
}
|
||||
|
||||
bool IVideo::SetResolution ()
|
||||
|
@ -392,8 +392,8 @@ void V_Init2()
|
|||
CUSTOM_CVAR (Int, vid_aspect, 0, CVAR_GLOBALCONFIG|CVAR_ARCHIVE)
|
||||
{
|
||||
setsizeneeded = true;
|
||||
if (sysCallbacks && sysCallbacks->OnScreenSizeChanged)
|
||||
sysCallbacks->OnScreenSizeChanged();
|
||||
if (sysCallbacks.OnScreenSizeChanged)
|
||||
sysCallbacks.OnScreenSizeChanged();
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(_Screen, GetAspectRatio)
|
||||
|
|
|
@ -81,7 +81,7 @@ void VkSamplerManager::SetTextureFilterMode()
|
|||
|
||||
void VkSamplerManager::Create()
|
||||
{
|
||||
int filter = sysCallbacks && sysCallbacks->DisableTextureFilter && sysCallbacks->DisableTextureFilter()? 0 : gl_texture_filter;
|
||||
int filter = sysCallbacks.DisableTextureFilter && sysCallbacks.DisableTextureFilter()? 0 : gl_texture_filter;
|
||||
|
||||
for (int i = CLAMP_NONE; i <= CLAMP_XY; i++)
|
||||
{
|
||||
|
|
|
@ -498,7 +498,7 @@ int GameMain()
|
|||
{
|
||||
int r;
|
||||
|
||||
static SystemCallbacks syscb =
|
||||
sysCallbacks =
|
||||
{
|
||||
System_WantGuiCapture,
|
||||
System_WantLeftButton,
|
||||
|
@ -516,7 +516,6 @@ int GameMain()
|
|||
nullptr,
|
||||
System_DispatchEvent,
|
||||
};
|
||||
sysCallbacks = &syscb;
|
||||
|
||||
try
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue