- changed storage of lump and texture names in gameinfo to allow long names (with the exception of view border elements.)

This commit is contained in:
Christoph Oelckers 2014-05-13 12:44:17 +02:00
parent e718a72b4d
commit a05e62f3f7
9 changed files with 29 additions and 31 deletions

View file

@ -303,7 +303,7 @@ void C_InitConback()
if (!conback.isValid())
{
conback = TexMan.GetTexture (gameinfo.titlePage, FTexture::TEX_MiscPatch);
conback = TexMan.GetTexture (gameinfo.TitlePage, FTexture::TEX_MiscPatch);
conshade = MAKEARGB(175,0,0,0);
conline = true;
}

View file

@ -1234,7 +1234,7 @@ void D_DoAdvanceDemo (void)
static char demoname[8] = "DEMO1";
static int democount = 0;
static int pagecount;
const char *pagename = NULL;
FString pagename;
advancedemo = false;
@ -1299,7 +1299,7 @@ void D_DoAdvanceDemo (void)
default:
case 0:
gamestate = GS_DEMOSCREEN;
pagename = gameinfo.titlePage;
pagename = gameinfo.TitlePage;
pagetic = (int)(gameinfo.titleTime * TICRATE);
S_ChangeMusic (gameinfo.titleMusic, gameinfo.titleOrder, false);
demosequence = 3;

View file

@ -42,9 +42,9 @@ void ABasicArmor::Tick ()
AbsorbCount = 0;
if (!Icon.isValid())
{
const char *icon = gameinfo.ArmorIcon1;
FString icon = gameinfo.ArmorIcon1;
if (SavePercent >= gameinfo.Armor2Percent && gameinfo.ArmorIcon2[0] != 0)
if (SavePercent >= gameinfo.Armor2Percent && gameinfo.ArmorIcon2.Len() != 0)
icon = gameinfo.ArmorIcon2;
if (icon[0] != 0)

View file

@ -271,16 +271,14 @@ void FMapInfoParser::ParseGameInfo()
else if(nextKey.CompareNoCase("armoricons") == 0)
{
sc.MustGetToken(TK_StringConst);
strncpy(gameinfo.ArmorIcon1, sc.String, 8);
gameinfo.ArmorIcon1[8] = 0;
gameinfo.ArmorIcon1 = sc.String;
if (sc.CheckToken(','))
{
sc.MustGetToken(TK_FloatConst);
gameinfo.Armor2Percent = FLOAT2FIXED(sc.Float);
sc.MustGetToken(',');
sc.MustGetToken(TK_StringConst);
strncpy(gameinfo.ArmorIcon2, sc.String, 8);
gameinfo.ArmorIcon2[8] = 0;
gameinfo.ArmorIcon2 = sc.String;
}
}
else if(nextKey.CompareNoCase("maparrow") == 0)
@ -295,7 +293,7 @@ void FMapInfoParser::ParseGameInfo()
else gameinfo.mCheatMapArrow = "";
}
// Insert valid keys here.
GAMEINFOKEY_CSTRING(titlePage, "titlePage", 8)
GAMEINFOKEY_STRING(TitlePage, "titlePage")
GAMEINFOKEY_STRINGARRAY(creditPages, "addcreditPage", 8, false)
GAMEINFOKEY_STRINGARRAY(creditPages, "CreditPage", 8, true)
GAMEINFOKEY_STRINGARRAY(PlayerClasses, "addplayerclasses", 0, false)
@ -306,17 +304,17 @@ void FMapInfoParser::ParseGameInfo()
GAMEINFOKEY_FLOAT(pageTime, "pageTime")
GAMEINFOKEY_STRING(chatSound, "chatSound")
GAMEINFOKEY_MUSIC(finaleMusic, finaleOrder, "finaleMusic")
GAMEINFOKEY_CSTRING(finaleFlat, "finaleFlat", 8)
GAMEINFOKEY_STRING(FinaleFlat, "finaleFlat")
GAMEINFOKEY_STRINGARRAY(finalePages, "finalePage", 8, true)
GAMEINFOKEY_STRINGARRAY(infoPages, "addinfoPage", 8, false)
GAMEINFOKEY_STRINGARRAY(infoPages, "infoPage", 8, true)
GAMEINFOKEY_CSTRING(PauseSign, "pausesign", 8)
GAMEINFOKEY_STRING(PauseSign, "pausesign")
GAMEINFOKEY_STRING(quitSound, "quitSound")
GAMEINFOKEY_CSTRING(borderFlat, "borderFlat", 8)
GAMEINFOKEY_STRING(BorderFlat, "borderFlat")
GAMEINFOKEY_FIXED(telefogheight, "telefogheight")
GAMEINFOKEY_FIXED(gibfactor, "gibfactor")
GAMEINFOKEY_INT(defKickback, "defKickback")
GAMEINFOKEY_CSTRING(SkyFlatName, "SkyFlatName", 8)
GAMEINFOKEY_STRING(SkyFlatName, "SkyFlatName")
GAMEINFOKEY_STRING(translator, "translator")
GAMEINFOKEY_COLOR(pickupcolor, "pickupcolor")
GAMEINFOKEY_COLOR(defaultbloodcolor, "defaultbloodcolor")
@ -336,7 +334,7 @@ void FMapInfoParser::ParseGameInfo()
GAMEINFOKEY_INT(defaultrespawntime, "defaultrespawntime")
GAMEINFOKEY_INT(defaultrespawntime, "defaultrespawntime")
GAMEINFOKEY_INT(defaultdropstyle, "defaultdropstyle")
GAMEINFOKEY_CSTRING(Endoom, "endoom", 8)
GAMEINFOKEY_STRING(Endoom, "endoom")
GAMEINFOKEY_INT(player5start, "player5start")
GAMEINFOKEY_STRINGARRAY(quitmessages, "addquitmessages", 0, false)
GAMEINFOKEY_STRINGARRAY(quitmessages, "quitmessages", 0, true)
@ -347,7 +345,7 @@ void FMapInfoParser::ParseGameInfo()
GAMEINFOKEY_STRING(mFontColorHeader, "menufontcolor_header")
GAMEINFOKEY_STRING(mFontColorHighlight, "menufontcolor_highlight")
GAMEINFOKEY_STRING(mFontColorSelection, "menufontcolor_selection")
GAMEINFOKEY_CSTRING(mBackButton, "menubackbutton", 8)
GAMEINFOKEY_STRING(mBackButton, "menubackbutton")
GAMEINFOKEY_INT(TextScreenX, "textscreenx")
GAMEINFOKEY_INT(TextScreenY, "textscreeny")
GAMEINFOKEY_STRING(DefaultEndSequence, "defaultendsequence")

View file

@ -78,7 +78,7 @@ struct gameinfo_t
EGameType gametype;
FString ConfigName;
char titlePage[9];
FString TitlePage;
bool drawreadthis;
bool noloopfinalemusic;
bool intermissioncounter;
@ -98,13 +98,13 @@ struct gameinfo_t
FString chatSound;
FString finaleMusic;
int finaleOrder;
char finaleFlat[9];
char borderFlat[9];
char SkyFlatName[9];
char ArmorIcon1[9];
char ArmorIcon2[9];
char PauseSign[9];
char Endoom[9];
FString FinaleFlat;
FString BorderFlat;
FString SkyFlatName;
FString ArmorIcon1;
FString ArmorIcon2;
FString PauseSign;
FString Endoom;
fixed_t Armor2Percent;
FString quitSound;
gameborder_t *border;
@ -133,7 +133,7 @@ struct gameinfo_t
FName mFontColorHeader;
FName mFontColorHighlight;
FName mFontColorSelection;
char mBackButton[9];
FString mBackButton;
fixed_t gibfactor;
int TextScreenX;
int TextScreenY;

View file

@ -104,7 +104,7 @@ void DIntermissionScreen::Init(FIntermissionAction *desc, bool first)
}
else
{
texname = gameinfo.titlePage;
texname = gameinfo.TitlePage.GetChars();
}
}
else if (*texname == '$')

View file

@ -1450,7 +1450,7 @@ void V_DrawBorder (int x1, int y1, int x2, int y2)
}
else
{
picnum = TexMan.CheckForTexture (gameinfo.borderFlat, FTexture::TEX_Flat);
picnum = TexMan.CheckForTexture (gameinfo.BorderFlat, FTexture::TEX_Flat);
}
if (picnum.isValid())

View file

@ -314,7 +314,7 @@ static bool IsExMy(const char * name)
void WI_LoadBackground(bool isenterpic)
{
const char * lumpname = NULL;
const char *lumpname;
char buffer[10];
in_anim_t an;
lnode_t pt;
@ -399,7 +399,7 @@ void WI_LoadBackground(bool isenterpic)
default:
// Strife doesn't have an intermission pic so choose something neutral.
if (isenterpic) return;
lumpname = gameinfo.borderFlat;
lumpname = gameinfo.BorderFlat;
break;
}
}

View file

@ -1086,12 +1086,12 @@ void ST_Endoom()
{
if (showendoom == 0) exit(0);
if (gameinfo.Endoom[0] == 0)
if (gameinfo.Endoom.Len() == 0)
{
exit(0);
}
int endoom_lump = Wads.CheckNumForName (gameinfo.Endoom);
int endoom_lump = Wads.CheckNumForFullName (gameinfo.Endoom, true);
BYTE endoom_screen[4000];
BYTE *font;