- make the startup banner in the initial console window work.

This commit is contained in:
Christoph Oelckers 2021-04-10 19:14:30 +02:00
parent 02dedaad46
commit db5fbe3bbb
4 changed files with 99 additions and 3 deletions

View file

@ -717,9 +717,6 @@ static TArray<GrpEntry> SetupGame()
if (groupno == -1) return TArray<GrpEntry>(); if (groupno == -1) return TArray<GrpEntry>();
auto& group = groups[groupno]; auto& group = groups[groupno];
if (GameStartupInfo.Name.IsNotEmpty()) I_SetWindowTitle(GameStartupInfo.Name);
else I_SetWindowTitle(group.FileInfo.name);
// Now filter out the data we actually need and delete the rest. // Now filter out the data we actually need and delete the rest.
usedgroups.Push(group); usedgroups.Push(group);
@ -818,6 +815,8 @@ void CreateStatusBar()
int RunGame() int RunGame()
{ {
GameStartupInfo.FgColor = 0xffffff;
// Set up the console before anything else so that it can receive text. // Set up the console before anything else so that it can receive text.
C_InitConsole(1024, 768, true); C_InitConsole(1024, 768, true);
@ -836,6 +835,19 @@ int RunGame()
G_LoadConfig(); G_LoadConfig();
auto usedgroups = SetupGame(); auto usedgroups = SetupGame();
for (auto& grp : usedgroups)
{
if (grp.FileInfo.name.IsNotEmpty())
{
if (GameStartupInfo.Name.IsEmpty()) GameStartupInfo.Name = grp.FileInfo.name;
if (grp.FileInfo.FgColor != grp.FileInfo.BgColor && (GameStartupInfo.FgColor != 0 || GameStartupInfo.BkColor != 0))
{
GameStartupInfo.FgColor = grp.FileInfo.FgColor;
GameStartupInfo.BkColor = grp.FileInfo.BgColor;
}
}
}
I_SetIWADInfo();
InitFileSystem(usedgroups); InitFileSystem(usedgroups);
if (usedgroups.Size() == 0) return 0; if (usedgroups.Size() == 0) return 0;
@ -927,6 +939,7 @@ int RunGame()
lookups.postLoadTables(); lookups.postLoadTables();
PostLoadSetup(); PostLoadSetup();
videoInit(); videoInit();
if (GameStartupInfo.Name.IsNotEmpty()) I_SetWindowTitle(GameStartupInfo.Name);
D_CheckNetGame(); D_CheckNetGame();
UpdateGenericUI(ui_generic); UpdateGenericUI(ui_generic);

View file

@ -150,6 +150,7 @@ struct GrpInfo
TArray<FString> tobedeleted; TArray<FString> tobedeleted;
TArray<FString> loadfiles; TArray<FString> loadfiles;
TArray<FString> loadart; TArray<FString> loadart;
uint32_t FgColor = 0, BgColor = 0;
}; };

View file

@ -460,6 +460,16 @@ static TArray<GrpInfo> ParseGrpInfo(const char *fn, FileReader &fr, TMap<FString
sc.MustGetToken(TK_StringConst); sc.MustGetToken(TK_StringConst);
grp.gamefilter = sc.String; grp.gamefilter = sc.String;
} }
else if (sc.Compare("fgcolor"))
{
sc.MustGetToken(TK_IntConst);
grp.FgColor = sc.Number;
}
else if (sc.Compare("bkcolor"))
{
sc.MustGetToken(TK_IntConst);
grp.BgColor = sc.Number;
}
else if (sc.Compare("crc")) else if (sc.Compare("crc"))
{ {
sc.MustGetAnyToken(); sc.MustGetAnyToken();

View file

@ -52,6 +52,8 @@ grpinfo
flags GAMEFLAG_DUKE flags GAMEFLAG_DUKE
gamefilter "Duke.Duke" gamefilter "Duke.Duke"
dependency 0 dependency 0
FgColor 0xffff00
BkColor 0xff6f00
} }
grpinfo grpinfo
@ -62,6 +64,8 @@ grpinfo
flags GAMEFLAG_DUKE flags GAMEFLAG_DUKE
gamefilter "Duke.Duke" gamefilter "Duke.Duke"
dependency 0 dependency 0
FgColor 0xffff00
BkColor 0xff6f00
} }
grpinfo grpinfo
@ -72,6 +76,8 @@ grpinfo
flags GAMEFLAG_DUKE flags GAMEFLAG_DUKE
gamefilter "Duke.Duke" gamefilter "Duke.Duke"
dependency 0 dependency 0
FgColor 0xffff00
BkColor 0xff6f00
} }
grpinfo grpinfo
@ -82,6 +88,8 @@ grpinfo
flags GAMEFLAG_DUKE flags GAMEFLAG_DUKE
gamefilter "Duke.Duke" gamefilter "Duke.Duke"
dependency 0 dependency 0
FgColor 0xffff00
BkColor 0xff6f00
} }
grpinfo // another variant? I got this one, dated 2016-10-12 grpinfo // another variant? I got this one, dated 2016-10-12
@ -92,6 +100,8 @@ grpinfo // another variant? I got this one, dated 2016-10-12
flags GAMEFLAG_DUKE flags GAMEFLAG_DUKE
gamefilter "Duke.Duke" gamefilter "Duke.Duke"
dependency 0 dependency 0
FgColor 0xffff00
BkColor 0xff6f00
} }
grpinfo grpinfo
@ -102,6 +112,8 @@ grpinfo
flags GAMEFLAG_DUKE flags GAMEFLAG_DUKE
gamefilter "Duke.Duke" gamefilter "Duke.Duke"
dependency 0 dependency 0
FgColor 0xffff00
BkColor 0xff6f00
} }
grpinfo grpinfo
@ -112,6 +124,8 @@ grpinfo
flags GAMEFLAG_DUKE|GAMEFLAG_DUKEBETA flags GAMEFLAG_DUKE|GAMEFLAG_DUKEBETA
gamefilter "Duke.Shareware" gamefilter "Duke.Shareware"
dependency 0 dependency 0
FgColor 0xffff00
BkColor 0xff6f00
} }
grpinfo grpinfo
@ -122,6 +136,8 @@ grpinfo
flags GAMEFLAG_DUKE|GAMEFLAG_SHAREWARE flags GAMEFLAG_DUKE|GAMEFLAG_SHAREWARE
gamefilter "Duke.Shareware" gamefilter "Duke.Shareware"
dependency 0 dependency 0
FgColor 0xffff00
BkColor 0xff6f00
} }
grpinfo grpinfo
@ -132,6 +148,8 @@ grpinfo
flags GAMEFLAG_DUKE|GAMEFLAG_SHAREWARE flags GAMEFLAG_DUKE|GAMEFLAG_SHAREWARE
gamefilter "Duke.Shareware" gamefilter "Duke.Shareware"
dependency 0 dependency 0
FgColor 0xffff00
BkColor 0xff6f00
} }
grpinfo grpinfo
@ -142,6 +160,8 @@ grpinfo
flags GAMEFLAG_DUKE|GAMEFLAG_SHAREWARE flags GAMEFLAG_DUKE|GAMEFLAG_SHAREWARE
gamefilter "Duke.Shareware" gamefilter "Duke.Shareware"
dependency 0 dependency 0
FgColor 0xffff00
BkColor 0xff6f00
} }
grpinfo grpinfo
@ -152,6 +172,8 @@ grpinfo
flags GAMEFLAG_DUKE|GAMEFLAG_SHAREWARE flags GAMEFLAG_DUKE|GAMEFLAG_SHAREWARE
gamefilter "Duke.Shareware" gamefilter "Duke.Shareware"
dependency 0 dependency 0
FgColor 0xffff00
BkColor 0xff6f00
} }
grpinfo grpinfo
@ -162,6 +184,8 @@ grpinfo
flags GAMEFLAG_DUKE|GAMEFLAG_SHAREWARE flags GAMEFLAG_DUKE|GAMEFLAG_SHAREWARE
gamefilter "Duke.Shareware" gamefilter "Duke.Shareware"
dependency 0 dependency 0
FgColor 0xffff00
BkColor 0xff6f00
} }
grpinfo grpinfo
@ -218,6 +242,8 @@ grpinfo
flags GAMEFLAG_DUKE|GAMEFLAG_ADDON flags GAMEFLAG_DUKE|GAMEFLAG_ADDON
dependency DUKE15_CRC dependency DUKE15_CRC
gamefilter "Duke.Vacation" gamefilter "Duke.Vacation"
FgColor 0x00004f
BkColor 0x8f8fff
} }
grpinfo grpinfo
@ -229,6 +255,8 @@ grpinfo
flags GAMEFLAG_DUKE|GAMEFLAG_ADDON flags GAMEFLAG_DUKE|GAMEFLAG_ADDON
dependency DUKE15_CRC dependency DUKE15_CRC
gamefilter "Duke.Vacation" gamefilter "Duke.Vacation"
FgColor 0x00004f
BkColor 0x8f8fff
} }
grpinfo grpinfo
@ -240,6 +268,8 @@ grpinfo
flags GAMEFLAG_DUKE|GAMEFLAG_ADDON flags GAMEFLAG_DUKE|GAMEFLAG_ADDON
dependency DUKE15_CRC dependency DUKE15_CRC
gamefilter "Duke.NWinter" gamefilter "Duke.NWinter"
FgColor 0
BkColor 0x8f8f8f
} }
grpinfo grpinfo
@ -251,6 +281,8 @@ grpinfo
flags GAMEFLAG_DUKE|GAMEFLAG_ADDON flags GAMEFLAG_DUKE|GAMEFLAG_ADDON
dependency DUKE15_CRC dependency DUKE15_CRC
gamefilter "Duke.NWinter" gamefilter "Duke.NWinter"
FgColor 0
BkColor 0x8f8f8f
} }
grpinfo grpinfo
@ -297,6 +329,8 @@ grpinfo
dependency 0 dependency 0
loadgrp "SOUNDS.RFF", "GUI.RFF" loadgrp "SOUNDS.RFF", "GUI.RFF"
gamefilter "Blood.Blood" gamefilter "Blood.Blood"
FgColor 0
BkColor 0x7f003f
} }
grpinfo grpinfo
@ -310,6 +344,8 @@ grpinfo
dependency 0 dependency 0
loadgrp "SOUNDS.RFF", "GUI.RFF" loadgrp "SOUNDS.RFF", "GUI.RFF"
gamefilter "Blood.Blood" gamefilter "Blood.Blood"
FgColor 0
BkColor 0xaf0024
} }
grpinfo grpinfo
@ -323,6 +359,8 @@ grpinfo
dependency 0 dependency 0
loadgrp "SOUNDS.RFF", "GUI.RFF" loadgrp "SOUNDS.RFF", "GUI.RFF"
gamefilter "Blood.Blood" gamefilter "Blood.Blood"
FgColor 0
BkColor 0xaf0024
} }
grpinfo grpinfo
@ -336,6 +374,8 @@ grpinfo
dependency 0 dependency 0
loadgrp "SOUNDS.RFF", "GUI.RFF" loadgrp "SOUNDS.RFF", "GUI.RFF"
gamefilter "Blood.Blood" gamefilter "Blood.Blood"
FgColor 0
BkColor 0x7f002f
} }
/* this doesn't work with the current setup. /* this doesn't work with the current setup.
@ -410,6 +450,8 @@ grpinfo
size 47536148 size 47536148
defname "sw.def" defname "sw.def"
gamefilter "ShadowWarrior.ShadowWarrior" gamefilter "ShadowWarrior.ShadowWarrior"
FgColor 0
BkColor 0xaf0000
} }
grpinfo grpinfo
@ -420,6 +462,8 @@ grpinfo
size 47536148 size 47536148
defname "sw.def" defname "sw.def"
gamefilter "ShadowWarrior.ShadowWarrior" gamefilter "ShadowWarrior.ShadowWarrior"
FgColor 0
BkColor 0xaf0000
} }
grpinfo grpinfo
@ -430,6 +474,8 @@ grpinfo
size 47536148 size 47536148
defname "sw.def" defname "sw.def"
gamefilter "ShadowWarrior.ShadowWarrior" gamefilter "ShadowWarrior.ShadowWarrior"
FgColor 0
BkColor 0xaf0000
} }
grpinfo grpinfo
@ -440,6 +486,8 @@ grpinfo
size 47537951 size 47537951
defname "sw.def" defname "sw.def"
gamefilter "ShadowWarrior.ShadowWarrior" gamefilter "ShadowWarrior.ShadowWarrior"
FgColor 0
BkColor 0xaf0000
} }
grpinfo grpinfo
@ -450,6 +498,8 @@ grpinfo
size 25702245 size 25702245
defname "sw.def" defname "sw.def"
gamefilter "ShadowWarrior.Shareware" gamefilter "ShadowWarrior.Shareware"
FgColor 0
BkColor 0xaf0000
} }
grpinfo grpinfo
@ -460,6 +510,8 @@ grpinfo
size 25833456 size 25833456
defname "sw.def" defname "sw.def"
gamefilter "ShadowWarrior.Shareware" gamefilter "ShadowWarrior.Shareware"
FgColor 0
BkColor 0xaf0000
} }
grpinfo grpinfo
@ -470,6 +522,8 @@ grpinfo
size 26056769 size 26056769
defname "sw.def" defname "sw.def"
gamefilter "ShadowWarrior.Shareware" gamefilter "ShadowWarrior.Shareware"
FgColor 0
BkColor 0xaf0000
} }
grpinfo grpinfo
@ -480,6 +534,8 @@ grpinfo
size 26056769 size 26056769
defname "sw.def" defname "sw.def"
gamefilter "ShadowWarrior.Shareware" gamefilter "ShadowWarrior.Shareware"
FgColor 0
BkColor 0xaf0000
} }
grpinfo grpinfo
@ -559,6 +615,8 @@ grpinfo
flags GAMEFLAG_RR flags GAMEFLAG_RR
dependency 0 dependency 0
gamefilter "Redneck.Redneck" gamefilter "Redneck.Redneck"
FgColor 0xbc9e89
BkColor 0x7f3300
} }
grpinfo grpinfo
@ -570,6 +628,8 @@ grpinfo
flags GAMEFLAG_RRRA flags GAMEFLAG_RRRA
dependency 0 dependency 0
gamefilter "Redneck.RidesAgain" gamefilter "Redneck.RidesAgain"
FgColor 0xbc9e89
BkColor 0x7f3300
} }
grpinfo grpinfo
@ -606,6 +666,8 @@ grpinfo
flags GAMEFLAG_NAM flags GAMEFLAG_NAM
dependency 0 dependency 0
gamefilter "Nam.Nam" gamefilter "Nam.Nam"
FgColor 0
BkColor 0x78720d
} }
grpinfo grpinfo
@ -616,6 +678,8 @@ grpinfo
flags GAMEFLAG_NAM|GAMEFLAG_NAPALM flags GAMEFLAG_NAM|GAMEFLAG_NAPALM
dependency 0 dependency 0
gamefilter "Nam.Napalm" gamefilter "Nam.Napalm"
FgColor 0
BkColor 0x78720d
} }
grpinfo grpinfo
@ -626,6 +690,8 @@ grpinfo
flags GAMEFLAG_WW2GI flags GAMEFLAG_WW2GI
dependency 0 dependency 0
gamefilter "WW2GI.WW2GI" gamefilter "WW2GI.WW2GI"
FgColor 0
BkColor 0x78720d
} }
grpinfo grpinfo
@ -647,6 +713,8 @@ grpinfo
size 27020745 size 27020745
defname "exhumed.def" defname "exhumed.def"
gamefilter "Exhumed.Powerslave" gamefilter "Exhumed.Powerslave"
FgColor 0xff0000
BkColor 0xffff33
} }
grpinfo grpinfo
@ -657,6 +725,8 @@ grpinfo
size 27108170 size 27108170
defname "exhumed.def" defname "exhumed.def"
gamefilter "Exhumed.Exhumed" gamefilter "Exhumed.Exhumed"
FgColor 0xff0000
BkColor 0xffff33
} }
grpinfo grpinfo
@ -667,6 +737,8 @@ grpinfo
size 27020745 size 27020745
defname "exhumed.def" defname "exhumed.def"
gamefilter "Exhumed.Powerslave" gamefilter "Exhumed.Powerslave"
FgColor 0xff0000
BkColor 0xffff33
} }