diff --git a/src/c_console.cpp b/src/c_console.cpp index b21c8c3a6..396b2dfce 100644 --- a/src/c_console.cpp +++ b/src/c_console.cpp @@ -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; } diff --git a/src/d_main.cpp b/src/d_main.cpp index 9f332c68d..93e6368c1 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -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; diff --git a/src/g_shared/a_armor.cpp b/src/g_shared/a_armor.cpp index 664a56307..6b90a6a78 100644 --- a/src/g_shared/a_armor.cpp +++ b/src/g_shared/a_armor.cpp @@ -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) diff --git a/src/gi.cpp b/src/gi.cpp index d9d58dc9e..851a61fb8 100644 --- a/src/gi.cpp +++ b/src/gi.cpp @@ -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") diff --git a/src/gi.h b/src/gi.h index 6b887e1dd..9965b1dd1 100644 --- a/src/gi.h +++ b/src/gi.h @@ -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; diff --git a/src/intermission/intermission.cpp b/src/intermission/intermission.cpp index 91090e432..2a52df58a 100644 --- a/src/intermission/intermission.cpp +++ b/src/intermission/intermission.cpp @@ -104,7 +104,7 @@ void DIntermissionScreen::Init(FIntermissionAction *desc, bool first) } else { - texname = gameinfo.titlePage; + texname = gameinfo.TitlePage.GetChars(); } } else if (*texname == '$') diff --git a/src/v_draw.cpp b/src/v_draw.cpp index 8472637a2..ecd50ec73 100644 --- a/src/v_draw.cpp +++ b/src/v_draw.cpp @@ -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()) diff --git a/src/wi_stuff.cpp b/src/wi_stuff.cpp index 7aef939b1..0cf5e7b77 100644 --- a/src/wi_stuff.cpp +++ b/src/wi_stuff.cpp @@ -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; } } diff --git a/src/win32/st_start.cpp b/src/win32/st_start.cpp index 7ffe846e6..04b52925e 100644 --- a/src/win32/st_start.cpp +++ b/src/win32/st_start.cpp @@ -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;