Skip to content

Commit

Permalink
- implemented 'deletelumps' feature and add Chex Quest 3 texts.
Browse files Browse the repository at this point in the history
The episode titles required a workaround because the CQ3 episodes do not contain names in text form: If this is the case, the patch name will be used as a string table identifier to get a matching text for localization.
  • Loading branch information
coelckers committed Apr 14, 2019
1 parent 5260352 commit a8c4740
Show file tree
Hide file tree
Showing 9 changed files with 286 additions and 29 deletions.
4 changes: 1 addition & 3 deletions src/d_iwad.cpp
Expand Up @@ -132,9 +132,7 @@ void FIWadManager::ParseIWadInfo(const char *fn, const char *data, int datasize,
do
{
sc.MustGetString();
if(sc.Compare("NoTextcolor")) iwad->flags |= GI_NOTEXTCOLOR;
else if (sc.Compare("NoBigFont")) iwad->flags |= GI_IGNOREBIGFONTLUMP;
else if(sc.Compare("Poly1")) iwad->flags |= GI_COMPATPOLY1;
if(sc.Compare("Poly1")) iwad->flags |= GI_COMPATPOLY1;
else if(sc.Compare("Poly2")) iwad->flags |= GI_COMPATPOLY2;
else if(sc.Compare("Shareware")) iwad->flags |= GI_SHAREWARE;
else if(sc.Compare("Teaser2")) iwad->flags |= GI_TEASER2;
Expand Down
2 changes: 1 addition & 1 deletion src/d_main.cpp
Expand Up @@ -2388,7 +2388,7 @@ void D_DoomMain (void)
}

if (!batchrun) Printf ("W_Init: Init WADfiles.\n");
Wads.InitMultipleFiles (allwads);
Wads.InitMultipleFiles (allwads, iwad_info->DeleteLumps);
allwads.Clear();
allwads.ShrinkToFit();
SetMapxxFlag();
Expand Down
9 changes: 0 additions & 9 deletions src/gamedata/fonts/v_font.cpp
Expand Up @@ -1169,15 +1169,6 @@ void V_InitFontColors ()

while ((lump = Wads.FindLump ("TEXTCOLO", &lastlump)) != -1)
{
if (gameinfo.flags & GI_NOTEXTCOLOR)
{
// Chex3 contains a bad TEXTCOLO lump, probably to force all text to be green.
// This renders the Gray, Gold, Red and Yellow color range inoperable, some of
// which are used by the menu. So we have no choice but to skip this lump so that
// all colors work properly.
// The text colors should be the end user's choice anyway.
if (Wads.GetLumpFile(lump) == Wads.GetIwadNum()) continue;
}
FScanner sc(lump);
while (sc.GetString())
{
Expand Down
2 changes: 2 additions & 0 deletions src/gamedata/g_mapinfo.cpp
Expand Up @@ -2059,6 +2059,8 @@ void FMapInfoParser::ParseEpisodeInfo ()
ParseAssign();
sc.MustGetString ();
pic = sc.String;
// If no name has been specified, synthesize a string table reference with the same name as the patch.
if (name.IsEmpty()) name.Format("$%s", sc.String);
}
else if (sc.Compare ("remove"))
{
Expand Down
2 changes: 0 additions & 2 deletions src/gamedata/gi.h
Expand Up @@ -48,9 +48,7 @@ enum
GI_COMPATSTAIRS = 0x00000020, // same for stairbuilding
GI_COMPATPOLY1 = 0x00000040, // Hexen's MAP36 needs old polyobject drawing
GI_COMPATPOLY2 = 0x00000080, // so does HEXDD's MAP47
GI_NOTEXTCOLOR = 0x00000100, // Chex Quest 3 would have everything green
GI_IGNORETITLEPATCHES = 0x00000200, // Ignore the map name graphics when not runnning in English language
GI_IGNOREBIGFONTLUMP = 0x00000400, // Needed for Chex Quest 3, so that the extended internal font can be used instead.
};

#include "gametype.h"
Expand Down
20 changes: 9 additions & 11 deletions src/gamedata/w_wad.cpp
Expand Up @@ -134,7 +134,7 @@ void FWadCollection::DeleteAll ()
//
//==========================================================================

void FWadCollection::InitMultipleFiles (TArray<FString> &filenames)
void FWadCollection::InitMultipleFiles (TArray<FString> &filenames, const TArray<FString> &deletelumps)
{
int numfiles;

Expand All @@ -154,7 +154,7 @@ void FWadCollection::InitMultipleFiles (TArray<FString> &filenames)
I_FatalError ("W_InitMultipleFiles: no files found");
}
RenameNerve();
RenameSprites();
RenameSprites(deletelumps);
FixMacHexen();

// [RH] Set up hash table
Expand Down Expand Up @@ -755,7 +755,7 @@ void FWadCollection::InitHashChains (void)
//
//==========================================================================

void FWadCollection::RenameSprites ()
void FWadCollection::RenameSprites (const TArray<FString> &deletelumps)
{
bool renameAll;
bool MNTRZfound = false;
Expand Down Expand Up @@ -894,16 +894,14 @@ void FWadCollection::RenameSprites ()
}
else if (LumpInfo[i].lump->Namespace == ns_global)
{
if (LumpInfo[i].wadnum == GetIwadNum() && deletelumps.Find(LumpInfo[i].lump->Name) < deletelumps.Size())
{
LumpInfo[i].lump->Name[0] = 0; // Lump must be deleted from directory.
}
// Rename the game specific big font lumps so that the font manager does not have to do problematic special checks for them.
if (!strcmp(LumpInfo[i].lump->Name, altbigfont))
strcpy(LumpInfo[i].lump->Name, "BIGFONT");

if (LumpInfo[i].wadnum == GetIwadNum() && gameinfo.flags & GI_IGNOREBIGFONTLUMP)
else if (!strcmp(LumpInfo[i].lump->Name, altbigfont))
{
if (!strcmp(LumpInfo[i].lump->Name, "BIGFONT"))
{
LumpInfo[i].lump->Name[0] = 0;
}
strcpy(LumpInfo[i].lump->Name, "BIGFONT");
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/gamedata/w_wad.h
Expand Up @@ -117,7 +117,7 @@ class FWadCollection
int GetIwadNum() { return IwadIndex; }
void SetIwadNum(int x) { IwadIndex = x; }

void InitMultipleFiles (TArray<FString> &filenames);
void InitMultipleFiles (TArray<FString> &filenames, const TArray<FString> &deletelumps);
void AddFile (const char *filename, FileReader *wadinfo = NULL);
int CheckIfWadLoaded (const char *name);

Expand Down Expand Up @@ -213,7 +213,7 @@ class FWadCollection
void InitHashChains (); // [RH] Set up the lumpinfo hashing

private:
void RenameSprites();
void RenameSprites(const TArray<FString> &deletelumps);
void RenameNerve();
void FixMacHexen();
void DeleteAll();
Expand Down
4 changes: 3 additions & 1 deletion wadsrc/static/iwadinfo.txt
Expand Up @@ -105,9 +105,10 @@ IWad
Config = "Chex"
IWADName = "chex3.wad"
Mapinfo = "mapinfo/chex.txt"
Compatibility = "NoTextcolor", "NoBigFont"
MustContain = "E1M1", "CYCLA1", "FLMBA1", "MAPINFO"
BannerColors = "ff ff 00", "00 c0 00"
IgnoreTitlePatches = 1
DeleteLumps = "LANGUAGE", "TEXTCOLO", "DBIGFONT"
}

IWad
Expand All @@ -120,6 +121,7 @@ IWad
Mapinfo = "mapinfo/chex.txt"
MustContain = "E1M1", "E4M1", "W94_1", "POSSH0M0"
BannerColors = "ff ff 00", "00 c0 00"
IgnoreTitlePatches = 1
}

IWad
Expand Down

0 comments on commit a8c4740

Please sign in to comment.