- backend update from GZDoom.

Fixes:
* do not strip 'filter' as a directory prefix.
* proper spacing for scaled sheet fonts.
* fix of transparent color in BMF fonts.
* fix restart button on error pane in Windows.
* do not skip over empty 'if's with a condition that would error out.
This commit is contained in:
Christoph Oelckers 2021-08-11 10:28:21 +02:00
parent 888f8888bb
commit 8106d788f6
10 changed files with 34 additions and 13 deletions

View file

@ -234,6 +234,8 @@ bool FZipFile::Open(bool quiet, LumpFilterInfo* filter)
}
name.ToLower();
if (name.IndexOf("filter/") == 0)
continue; // 'filter' is a reserved name of the file system.
if (name.IndexOf("__macosx") == 0)
continue; // skip Apple garbage. At this stage only the root folder matters.
if (!foundprefix)

View file

@ -437,7 +437,7 @@ void FFont::ReadSheetFont(TArray<FolderEntry> &folderdata, int width, int height
Chars[i].OriginalPic->CopySize(*lump, true);
if (Chars[i].OriginalPic != *lump) TexMan.AddGameTexture(Chars[i].OriginalPic);
}
Chars[i].XMove = width;
Chars[i].XMove = int(width / Scale.X);
}
if (map1252)

View file

@ -407,6 +407,7 @@ void FSingleLumpFont::LoadBMF(int lump, const uint8_t *data)
count = LastChar - FirstChar + 1;
Chars.Resize(count);
// BMF palettes are only six bits per component. Fix that.
Palette[0] = 0;
for (i = 0; i < ActiveColors; ++i)
{
int r = (data[17 + i * 3] << 2) | (data[17 + i * 3] >> 4);

View file

@ -131,7 +131,7 @@ static bool ReadSystemVersionFromPlist(NSOperatingSystemVersion& version)
if (const char *patchVersionString = strstr(minorVersionString, "."))
{
patchVersionString++;
plistVersion.patchVersion = atoi(minorVersionString);
plistVersion.patchVersion = atoi(patchVersionString);
}
}
}

View file

@ -204,7 +204,7 @@ void I_PrintStr(const char *cp)
{ // gray
if (v < 0.33) attrib = 0x8;
else if (v < 0.90) attrib = 0x7;
else attrib = 0x15;
else attrib = 0xF;
}
printData.AppendFormat("\033[%um",((attrib & 0x8) ? 90 : 30) + (attrib & 0x7));

View file

@ -545,6 +545,20 @@ LRESULT CALLBACK LConProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
//
//==========================================================================
bool restartrequest;
void CheckForRestart()
{
if (restartrequest)
{
HMODULE hModule = GetModuleHandleW(NULL);
WCHAR path[MAX_PATH];
GetModuleFileNameW(hModule, path, MAX_PATH);
ShellExecuteW(NULL, L"open", path, GetCommandLineW(), NULL, SW_SHOWNORMAL);
}
restartrequest = false;
}
INT_PTR CALLBACK ErrorPaneProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg)
@ -559,11 +573,7 @@ INT_PTR CALLBACK ErrorPaneProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lPara
{
if (LOWORD(wParam) == IDC_BUTTON1) // we pressed the restart button, so run GZDoom again
{
HMODULE hModule = GetModuleHandleW(NULL);
WCHAR path[MAX_PATH];
GetModuleFileNameW(hModule, path, MAX_PATH);
ShellExecuteW(NULL, L"open", path, GetCommandLineW(), NULL, SW_SHOWNORMAL);
restartrequest = true;
}
PostQuitMessage (0);
return TRUE;
@ -969,6 +979,8 @@ int DoMain (HINSTANCE hInstance)
atexit (UnCOM);
int ret = GameMain ();
CheckForRestart();
DestroyCustomCursor();
if (ret == 1337) // special exit code for 'norun'.
{

View file

@ -25,6 +25,7 @@
#include "hw_dynlightdata.h"
#include "buffers.h"
#include "shaderuniforms.h"
#include "g_cvars.h"
#include "hwrenderer/postprocessing/hw_postprocess.h"
/*
@ -98,7 +99,7 @@ bool IShadowMap::PerformUpdate()
LightsProcessed = 0;
LightsShadowmapped = 0;
if (gl_light_shadowmap && (screen->hwcaps & RFL_SHADER_STORAGE_BUFFER) && CollectLights != nullptr)
if (gl_lights && gl_light_shadowmap && (screen->hwcaps & RFL_SHADER_STORAGE_BUFFER) && CollectLights != nullptr)
{
UpdateCycles.Clock();
UploadAABBTree();

View file

@ -57,6 +57,11 @@ public:
mLights[index + 3] = r;
}
bool Enabled() const
{
return mAABBTree != nullptr;
}
protected:
// Upload the AABB-tree to the GPU
void UploadAABBTree();

View file

@ -33,10 +33,10 @@
#include "i_interface.h"
// Set up 3D-specific console variables:
CVAR(Int, vr_mode, 0, CVAR_GLOBALCONFIG)
CVAR(Int, vr_mode, 0, CVAR_GLOBALCONFIG|CVAR_ARCHIVE)
// switch left and right eye views
CVAR(Bool, vr_swap_eyes, false, CVAR_GLOBALCONFIG)
CVAR(Bool, vr_swap_eyes, false, CVAR_GLOBALCONFIG | CVAR_ARCHIVE)
// intraocular distance in meters
CVAR(Float, vr_ipd, 0.062f, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) // METERS

View file

@ -9823,6 +9823,8 @@ FxExpression *FxIfStatement::Resolve(FCompileContext &ctx)
{
CHECKRESOLVED();
SAFE_RESOLVE(Condition, ctx);
if (WhenTrue == nullptr && WhenFalse == nullptr)
{ // We don't do anything either way, so disappear
delete this;
@ -9830,8 +9832,6 @@ FxExpression *FxIfStatement::Resolve(FCompileContext &ctx)
return new FxNop(ScriptPosition);
}
SAFE_RESOLVE(Condition, ctx);
if (Condition->ValueType != TypeBool)
{
Condition = new FxBoolCast(Condition, false);