- fixed some issues with RR's Route66 add-on.

The new movies weren't played because the names did not match.
Transition from the last level of Ep1 to the first one of Ep2 did not work.
Selection with command line switch wasn't reliable.
This commit is contained in:
Christoph Oelckers 2020-01-10 21:36:46 +01:00
parent 1ddcc41ed8
commit 6305714493
6 changed files with 33 additions and 16 deletions

View file

@ -151,19 +151,27 @@ void FileSystem::DeleteStuff(const TArray<FString>& deletelumps, int numgamefile
{
// This must account for the game directory being inserted at index 2.
// Deletion may only occur in the main game file, the directory and the add-on, there are no secondary dependencies, i.e. more than two game files.
numgamefiles++;
if (deletelumps.Size())
for (uint32_t i = 0; i < FileInfo.Size(); i++)
numgamefiles++;
for (auto str : deletelumps)
{
if (FileInfo[i].rfnum >= 1 && FileInfo[i].rfnum <= numgamefiles)
{
auto cmp = FileInfo[i].lump->LumpName[FResourceLump::FullNameType].GetChars();
for (auto &str : deletelumps)
FString renameTo;
auto ndx = str.IndexOf("*");
if (ndx >= 0)
{
renameTo = FName(str.Mid(ndx + 1));
str.Truncate(ndx);
}
FName check = FName(str);
for (uint32_t i = 0; i < FileInfo.Size(); i++)
{
if (FileInfo[i].rfnum >= 1 && FileInfo[i].rfnum <= numgamefiles && check == FileInfo[i].lump->LumpName[FResourceLump::FullNameType])
{
if (!str.CompareNoCase(cmp))
if (renameTo.IsEmpty())
{
for (auto& n : FileInfo[i].lump->LumpName) n = NAME_None;
}
else FileInfo[i].lump->LumpNameSetup(renameTo);
}
}
}

View file

@ -156,6 +156,10 @@ void UserConfig::ProcessOptions()
DefaultCon = "GAME66.CON";
const char* argv[] = { "tilesa66.art" , "tilesb66.art" };
AddArt.reset(new FArgs(2, argv));
toBeDeleted.Push("turd66.anm*turdmov.anm");
toBeDeleted.Push("turd66.voc*turdmov.voc");
toBeDeleted.Push("end66.anm*rr_outro.anm");
toBeDeleted.Push("end66.voc*rr_outro.voc");
}
else if (Args->CheckParm("-cryptic"))
{
@ -191,9 +195,13 @@ void UserConfig::ProcessOptions()
Args->CollectFiles("-def", defs, ".def");
DefaultDef = Args->CheckValue("-def");
static const char* cons[] = { "-con", "-x", nullptr };
Args->CollectFiles("-con", cons, ".con");
DefaultCon = Args->CheckValue("-con");
if (DefaultCon.IsEmpty())
{
static const char* cons[] = { "-con", "-x", nullptr };
Args->CollectFiles("-con", cons, ".con");
DefaultCon = Args->CheckValue("-con");
if (DefaultCon.IsEmpty()) DefaultCon = Args->CheckValue("-ini");
}
static const char* demos[] = { "-playback", "-d", "-demo", nullptr };
Args->CollectFiles("-demo", demos, ".dmo");
@ -218,8 +226,6 @@ void UserConfig::ProcessOptions()
Args->CollectFiles("-art", ".art");
AddArt.reset(Args->GatherFiles("-art"));
CommandIni = Args->CheckValue("-ini");
nologo = Args->CheckParm("-nologo") || Args->CheckParm("-quick");
nomusic = Args->CheckParm("-nomusic");
nosound = Args->CheckParm("-nosfx");

View file

@ -63,6 +63,7 @@ struct UserConfig
std::unique_ptr<FArgs> AddFiles;
std::unique_ptr<FArgs> AddFilesPre; //To be added before the main directory. Only for legacy options.
std::unique_ptr<FArgs> AddArt;
TArray<FString> toBeDeleted;
bool nomonsters = false;
bool nosound = false;
@ -109,7 +110,7 @@ enum
GAMEFLAG_EXHUMED = 0x00002000,
GAMEFLAG_PSEXHUMED = 0x00003000, // the two games really are the same, except for the name and the publisher.
GAMEFLAG_STANDALONE = 0x00004000,
GAMEFLAGMASK = 0x00000FFF, // flags allowed from grpinfo
GAMEFLAGMASK = 0x00003FFF, // flags allowed from grpinfo
};

View file

@ -383,6 +383,7 @@ void InitFileSystem(TArray<GrpEntry>& groups)
{
todelete.Append(g.FileInfo.tobedeleted);
}
todelete.Append(userConfig.toBeDeleted);
fileSystem.InitMultipleFiles(Files, todelete, groups.Size());
FILE* f = fopen("filesystem.dir", "wb");

View file

@ -1509,8 +1509,8 @@ static void G_BonusCutscenes(void)
videoClearScreen(0L);
videoNextPage();
}
ud.level_number = 0;
ud.volume_number = 1;
m_level_number = ud.level_number = 0;
ud.m_volume_number = ud.volume_number = 1;
ud.eog = 0;
fadepal(0, 0, 0, 0, 252, 4);
inputState.ClearAllInput();

View file

@ -345,6 +345,7 @@ grpinfo
dependency RR_CRC
loadart "TILESA66.ART", "TILESB66.ART" // replaces TILES009 and TILES023.
gamefilter "Redneck.Route66"
deletecontent "turd66.anm*turdmov.anm", "turd66.voc*turdmov.voc", "end66.anm*rr_outro.anm", "end66.voc*rr_outro.voc" // This renames instead of deleting
}
grpinfo