diff --git a/source/build/src/sdlayer.cpp b/source/build/src/sdlayer.cpp index 3d9ed8e71..4b4afb686 100644 --- a/source/build/src/sdlayer.cpp +++ b/source/build/src/sdlayer.cpp @@ -475,9 +475,10 @@ GameInterface *CheckFrontend() void ChooseGame() { +#if 0 gi = CheckFrontend(); return; -#if 0 +#else auto dir = Args->CheckValue("-game"); if (dir && !chdir(dir)) { @@ -646,20 +647,21 @@ int main(int argc, char *argv[]) } -std::unique_ptr engine_res; +static std::unique_ptr demolition_pk3; // The resourge manager in cache1d is far too broken to add some arbitrary file without some adjustment. // For now, keep this file here, until the resource management can be redone in a more workable fashion. extern FString progdir; +extern FString LumpFilter; void InitBaseRes() { - if (!engine_res) + if (!demolition_pk3) { // If we get here for the first time, load the engine-internal data. FString baseres = progdir + "demolition.pk3"; - engine_res.reset(FResourceFile::OpenResourceFile(baseres, true, true)); - if (!engine_res) + demolition_pk3.reset(FResourceFile::OpenResourceFile(baseres, true, true)); + if (!demolition_pk3) { I_Error("Engine resources (%s) not found", baseres.GetChars()); } @@ -669,11 +671,11 @@ void InitBaseRes() FileReader openFromBaseResource(const char* fn) { InitBaseRes(); - auto lump = engine_res->FindLump(fn); + auto lump = demolition_pk3->FindLump(fn); if (lump) return lump->NewReader(); // Also look in game filtered directories. - FStringf filtername("filter/game-%s/%s", currentGame.GetChars(), fn); - lump = engine_res->FindLump(filtername); + FStringf filtername("filter/%s/%s", LumpFilter.GetChars(), fn); + lump = demolition_pk3->FindLump(filtername); if (lump) return lump->NewReader(); return FileReader(nullptr); diff --git a/source/common/filesystem/file_zip.cpp b/source/common/filesystem/file_zip.cpp index c96ac90bd..f4814b435 100644 --- a/source/common/filesystem/file_zip.cpp +++ b/source/common/filesystem/file_zip.cpp @@ -218,7 +218,6 @@ bool FZipFile::Open(bool quiet) int len = LittleShort(zip_fh->NameLength); FString name(dirptr + sizeof(FZipCentralDirectoryInfo), len); - if (name.IsNotEmpty()) name = name.Mid(name.Len()); dirptr += sizeof(FZipCentralDirectoryInfo) + LittleShort(zip_fh->NameLength) + LittleShort(zip_fh->ExtraLength) + diff --git a/source/common/filesystem/resourcefile.cpp b/source/common/filesystem/resourcefile.cpp index 468383e3a..f3ce78c8f 100644 --- a/source/common/filesystem/resourcefile.cpp +++ b/source/common/filesystem/resourcefile.cpp @@ -190,7 +190,7 @@ FResourceFile *FResourceFile::DoOpenResourceFile(const char *filename, FileReade for(size_t i = 0; i < countof(funcs) - containeronly; i++) { FResourceFile *resfile = funcs[i](filename, file, quiet); - if (resfile != NULL) return resfile; + if (resfile != NULL && resfile->Open(quiet)) return resfile; } return NULL; } diff --git a/source/common/gamecontrol.cpp b/source/common/gamecontrol.cpp index 49dba9c6d..44fdc0c1d 100644 --- a/source/common/gamecontrol.cpp +++ b/source/common/gamecontrol.cpp @@ -318,7 +318,8 @@ void CONFIG_Init() if (LumpFilter.Compare("Redneck") == 0) LumpFilter = "Redneck.Redneck"; else if (LumpFilter.Compare("RedneckRides") == 0) LumpFilter = "Redneck.RidesAgain"; - CONFIG_ReadCombatMacros(); + //CONFIG_ReadCombatMacros(); + //CONFIG_SetDefaultKeys(cl_defaultconfiguration == 1 ? "demolition/origbinds.txt" : cl_defaultconfiguration == 2 ? "demolition/leftbinds.txt" : "demolition/defbinds.txt"); G_ReadConfig(currentGame); @@ -344,7 +345,6 @@ void CONFIG_Init() } SetupButtonFunctions(); CONTROL_ClearAssignments(); - CONFIG_SetDefaultKeys(cl_defaultconfiguration == 1 ? "demolition/origbinds.txt" : cl_defaultconfiguration == 2 ? "demolition/leftbinds.txt" : "demolition/defbinds.txt"); CONFIG_InitMouseAndController(); CONFIG_SetGameControllerDefaultsStandard(); }