mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 08:52:00 +00:00
- fixed startup.
This commit is contained in:
parent
266dc9e04e
commit
5b1036093c
4 changed files with 13 additions and 12 deletions
|
@ -475,9 +475,10 @@ GameInterface *CheckFrontend()
|
||||||
|
|
||||||
void ChooseGame()
|
void ChooseGame()
|
||||||
{
|
{
|
||||||
|
#if 0
|
||||||
gi = CheckFrontend();
|
gi = CheckFrontend();
|
||||||
return;
|
return;
|
||||||
#if 0
|
#else
|
||||||
auto dir = Args->CheckValue("-game");
|
auto dir = Args->CheckValue("-game");
|
||||||
if (dir && !chdir(dir))
|
if (dir && !chdir(dir))
|
||||||
{
|
{
|
||||||
|
@ -646,20 +647,21 @@ int main(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
std::unique_ptr<FResourceFile> engine_res;
|
static std::unique_ptr<FResourceFile> demolition_pk3;
|
||||||
|
|
||||||
// The resourge manager in cache1d is far too broken to add some arbitrary file without some adjustment.
|
// 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.
|
// For now, keep this file here, until the resource management can be redone in a more workable fashion.
|
||||||
extern FString progdir;
|
extern FString progdir;
|
||||||
|
extern FString LumpFilter;
|
||||||
|
|
||||||
void InitBaseRes()
|
void InitBaseRes()
|
||||||
{
|
{
|
||||||
if (!engine_res)
|
if (!demolition_pk3)
|
||||||
{
|
{
|
||||||
// If we get here for the first time, load the engine-internal data.
|
// If we get here for the first time, load the engine-internal data.
|
||||||
FString baseres = progdir + "demolition.pk3";
|
FString baseres = progdir + "demolition.pk3";
|
||||||
engine_res.reset(FResourceFile::OpenResourceFile(baseres, true, true));
|
demolition_pk3.reset(FResourceFile::OpenResourceFile(baseres, true, true));
|
||||||
if (!engine_res)
|
if (!demolition_pk3)
|
||||||
{
|
{
|
||||||
I_Error("Engine resources (%s) not found", baseres.GetChars());
|
I_Error("Engine resources (%s) not found", baseres.GetChars());
|
||||||
}
|
}
|
||||||
|
@ -669,11 +671,11 @@ void InitBaseRes()
|
||||||
FileReader openFromBaseResource(const char* fn)
|
FileReader openFromBaseResource(const char* fn)
|
||||||
{
|
{
|
||||||
InitBaseRes();
|
InitBaseRes();
|
||||||
auto lump = engine_res->FindLump(fn);
|
auto lump = demolition_pk3->FindLump(fn);
|
||||||
if (lump) return lump->NewReader();
|
if (lump) return lump->NewReader();
|
||||||
// Also look in game filtered directories.
|
// Also look in game filtered directories.
|
||||||
FStringf filtername("filter/game-%s/%s", currentGame.GetChars(), fn);
|
FStringf filtername("filter/%s/%s", LumpFilter.GetChars(), fn);
|
||||||
lump = engine_res->FindLump(filtername);
|
lump = demolition_pk3->FindLump(filtername);
|
||||||
if (lump) return lump->NewReader();
|
if (lump) return lump->NewReader();
|
||||||
return FileReader(nullptr);
|
return FileReader(nullptr);
|
||||||
|
|
||||||
|
|
|
@ -218,7 +218,6 @@ bool FZipFile::Open(bool quiet)
|
||||||
|
|
||||||
int len = LittleShort(zip_fh->NameLength);
|
int len = LittleShort(zip_fh->NameLength);
|
||||||
FString name(dirptr + sizeof(FZipCentralDirectoryInfo), len);
|
FString name(dirptr + sizeof(FZipCentralDirectoryInfo), len);
|
||||||
if (name.IsNotEmpty()) name = name.Mid(name.Len());
|
|
||||||
dirptr += sizeof(FZipCentralDirectoryInfo) +
|
dirptr += sizeof(FZipCentralDirectoryInfo) +
|
||||||
LittleShort(zip_fh->NameLength) +
|
LittleShort(zip_fh->NameLength) +
|
||||||
LittleShort(zip_fh->ExtraLength) +
|
LittleShort(zip_fh->ExtraLength) +
|
||||||
|
|
|
@ -190,7 +190,7 @@ FResourceFile *FResourceFile::DoOpenResourceFile(const char *filename, FileReade
|
||||||
for(size_t i = 0; i < countof(funcs) - containeronly; i++)
|
for(size_t i = 0; i < countof(funcs) - containeronly; i++)
|
||||||
{
|
{
|
||||||
FResourceFile *resfile = funcs[i](filename, file, quiet);
|
FResourceFile *resfile = funcs[i](filename, file, quiet);
|
||||||
if (resfile != NULL) return resfile;
|
if (resfile != NULL && resfile->Open(quiet)) return resfile;
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -318,7 +318,8 @@ void CONFIG_Init()
|
||||||
if (LumpFilter.Compare("Redneck") == 0) LumpFilter = "Redneck.Redneck";
|
if (LumpFilter.Compare("Redneck") == 0) LumpFilter = "Redneck.Redneck";
|
||||||
else if (LumpFilter.Compare("RedneckRides") == 0) LumpFilter = "Redneck.RidesAgain";
|
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);
|
G_ReadConfig(currentGame);
|
||||||
|
|
||||||
|
|
||||||
|
@ -344,7 +345,6 @@ void CONFIG_Init()
|
||||||
}
|
}
|
||||||
SetupButtonFunctions();
|
SetupButtonFunctions();
|
||||||
CONTROL_ClearAssignments();
|
CONTROL_ClearAssignments();
|
||||||
CONFIG_SetDefaultKeys(cl_defaultconfiguration == 1 ? "demolition/origbinds.txt" : cl_defaultconfiguration == 2 ? "demolition/leftbinds.txt" : "demolition/defbinds.txt");
|
|
||||||
CONFIG_InitMouseAndController();
|
CONFIG_InitMouseAndController();
|
||||||
CONFIG_SetGameControllerDefaultsStandard();
|
CONFIG_SetGameControllerDefaultsStandard();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue