- Backend update from Raze.

* voc loader fix.
* better prefix detection in Zip loader.
* SDL Vulkan init.
* disabling of shadowmap management when the feature is off.
This commit is contained in:
Christoph Oelckers 2021-08-03 12:52:21 +02:00
parent c1a8776a15
commit b82b5384a0
4 changed files with 31 additions and 24 deletions

View file

@ -367,7 +367,7 @@ SoundHandle SoundRenderer::LoadSoundVoc(uint8_t *sfxdata, int length)
i += 4; i += 4;
if (i + blocksize > length) if (i + blocksize > length)
{ {
okay = false; //okay = false;
break; break;
} }
@ -450,7 +450,7 @@ SoundHandle SoundRenderer::LoadSoundVoc(uint8_t *sfxdata, int length)
} }
// Second pass to write the data // Second pass to write the data
if (okay) if (okay && len > 0)
{ {
data = new uint8_t[len]; data = new uint8_t[len];
i = 26; i = 26;

View file

@ -208,8 +208,9 @@ bool FZipFile::Open(bool quiet, LumpFilterInfo* filter)
char *dirptr = (char*)directory; char *dirptr = (char*)directory;
FZipLump *lump_p = Lumps; FZipLump *lump_p = Lumps;
FString name0; FString name0, name1;
bool foundspeciallump = false; bool foundspeciallump = false;
bool foundprefix = false;
// Check if all files have the same prefix so that this can be stripped out. // Check if all files have the same prefix so that this can be stripped out.
// This will only be done if there is either a MAPINFO, ZMAPINFO or GAMEINFO lump in the subdirectory, denoting a ZDoom mod. // This will only be done if there is either a MAPINFO, ZMAPINFO or GAMEINFO lump in the subdirectory, denoting a ZDoom mod.
@ -234,31 +235,39 @@ bool FZipFile::Open(bool quiet, LumpFilterInfo* filter)
name.ToLower(); name.ToLower();
if (name.IndexOf("__macosx") == 0) if (name.IndexOf("__macosx") == 0)
continue; // skip Apple garbage. At this stage only the root folder matters, continue; // skip Apple garbage. At this stage only the root folder matters.
if (i == 0) if (!foundprefix)
{ {
// check for special names, if one of these gets found this must be treated as a normal zip. // check for special names, if one of these gets found this must be treated as a normal zip.
bool isspecial = name.IndexOf("/") < 0 || (filter && filter->reservedFolders.Find(name) < filter->reservedFolders.Size()); bool isspecial = name.IndexOf("/") < 0 || (filter && filter->reservedFolders.Find(name) < filter->reservedFolders.Size());
if (isspecial) break; if (isspecial) break;
name0 = name.Left(name.LastIndexOf("/")+1); name0 = name.Left(name.LastIndexOf("/")+1);
name1 = name.Left(name.IndexOf("/") + 1);
foundprefix = true;
} }
else
if (name.IndexOf(name0) != 0)
{ {
if (name.IndexOf(name0) != 0) if (name1.IsNotEmpty())
{ {
name0 = ""; name0 = name1;
break; if (name.IndexOf(name0) != 0)
{
name0 = "";
}
} }
else if (!foundspeciallump && filter) if (name0.IsEmpty())
{ break;
// at least one of the more common definition lumps must be present. }
for (auto &p : filter->requiredPrefixes) if (!foundspeciallump && filter)
{ {
if (name.IndexOf(name0 + p) == 0 || name.LastIndexOf(p) == name.Len() - strlen(p)) // at least one of the more common definition lumps must be present.
{ for (auto &p : filter->requiredPrefixes)
foundspeciallump = true; {
break; if (name.IndexOf(name0 + p) == 0 || name.LastIndexOf(p) == name.Len() - strlen(p))
} {
foundspeciallump = true;
break;
} }
} }
} }

View file

@ -115,8 +115,6 @@ CCMD(vid_list_sdl_render_drivers)
namespace Priv namespace Priv
{ {
static const uint32_t VulkanWindowFlag = SDL_WINDOW_VULKAN;
SDL_Window *window; SDL_Window *window;
bool vulkanEnabled; bool vulkanEnabled;
bool softpolyEnabled; bool softpolyEnabled;
@ -408,7 +406,7 @@ SDLVideo::SDLVideo ()
if (Priv::vulkanEnabled) if (Priv::vulkanEnabled)
{ {
Priv::CreateWindow(Priv::VulkanWindowFlag | SDL_WINDOW_HIDDEN); Priv::CreateWindow(SDL_WINDOW_VULKAN | SDL_WINDOW_HIDDEN | (vid_fullscreen ? SDL_WINDOW_FULLSCREEN_DESKTOP : 0));
if (Priv::window == nullptr) if (Priv::window == nullptr)
{ {

View file

@ -85,7 +85,7 @@ CUSTOM_CVAR(Int, gl_shadowmap_quality, 512, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
bool IShadowMap::ShadowTest(const DVector3 &lpos, const DVector3 &pos) bool IShadowMap::ShadowTest(const DVector3 &lpos, const DVector3 &pos)
{ {
if (mAABBTree) if (mAABBTree && gl_light_shadowmap)
return mAABBTree->RayTest(lpos, pos) >= 1.0f; return mAABBTree->RayTest(lpos, pos) >= 1.0f;
else else
return true; return true;
@ -98,7 +98,7 @@ bool IShadowMap::PerformUpdate()
LightsProcessed = 0; LightsProcessed = 0;
LightsShadowmapped = 0; LightsShadowmapped = 0;
if (CollectLights != nullptr) if (gl_light_shadowmap && (screen->hwcaps & RFL_SHADER_STORAGE_BUFFER) && CollectLights != nullptr)
{ {
UpdateCycles.Clock(); UpdateCycles.Clock();
UploadAABBTree(); UploadAABBTree();