- moved definition of games' default armor icons into gameinfo definition.

SVN r1806 (trunk)
This commit is contained in:
Christoph Oelckers 2009-09-07 19:46:54 +00:00
parent 8e4ba47c98
commit 57a2e0ab73
10 changed files with 46 additions and 36 deletions

View file

@ -1,4 +1,5 @@
September 7, 2009 (Changes by Graf Zahl) September 7, 2009 (Changes by Graf Zahl)
- moved definition of games' default armor icons into gameinfo definition.
- fixed: The PNG loader for true color textures overwrote the IDAT size with - fixed: The PNG loader for true color textures overwrote the IDAT size with
the IDAT id when reading the image. the IDAT id when reading the image.

View file

@ -1961,29 +1961,27 @@ void D_DoomMain (void)
// [RH] Try adding .deh and .bex files on the command line. // [RH] Try adding .deh and .bex files on the command line.
// If there are none, try adding any in the config file. // If there are none, try adding any in the config file.
//if (gameinfo.gametype == GAME_Doom) if (!ConsiderPatches ("-deh", ".deh") &&
!ConsiderPatches ("-bex", ".bex") &&
(gameinfo.gametype == GAME_Doom) &&
GameConfig->SetSection ("Doom.DefaultDehacked"))
{ {
if (!ConsiderPatches ("-deh", ".deh") && const char *key;
!ConsiderPatches ("-bex", ".bex") && const char *value;
(gameinfo.gametype == GAME_Doom) &&
GameConfig->SetSection ("Doom.DefaultDehacked"))
{
const char *key;
const char *value;
while (GameConfig->NextInSection (key, value)) while (GameConfig->NextInSection (key, value))
{
if (stricmp (key, "Path") == 0 && FileExists (value))
{ {
if (stricmp (key, "Path") == 0 && FileExists (value)) Printf ("Applying patch %s\n", value);
{ DoDehPatch (value, true);
Printf ("Applying patch %s\n", value);
DoDehPatch (value, true);
}
} }
} }
DoDehPatch (NULL, true); // See if there's a patch in a PWAD
FinishDehPatch (); // Create replacements for dehacked pickups
} }
DoDehPatch (NULL, true); // See if there's a patch in a PWAD
FinishDehPatch (); // Create replacements for dehacked pickups
FActorInfo::StaticSetActorNums (); FActorInfo::StaticSetActorNums ();

View file

@ -40,24 +40,13 @@ void ABasicArmor::Tick ()
AbsorbCount = 0; AbsorbCount = 0;
if (!Icon.isValid()) if (!Icon.isValid())
{ {
switch (gameinfo.gametype) const char *icon = gameinfo.ArmorIcon1;
{
case GAME_Chex:
case GAME_Doom:
Icon = TexMan.CheckForTexture (SavePercent == FRACUNIT/3 ? "ARM1A0" : "ARM2A0", FTexture::TEX_Any);
break;
case GAME_Heretic: if (SavePercent >= gameinfo.Armor2Percent && gameinfo.ArmorIcon2[0] != 0)
Icon = TexMan.CheckForTexture (SavePercent == FRACUNIT/2 ? "SHLDA0" : "SHD2A0", FTexture::TEX_Any); icon = gameinfo.ArmorIcon2;
break;
case GAME_Strife: if (icon[0] != 0)
Icon = TexMan.CheckForTexture (SavePercent == FRACUNIT/3 ? "I_ARM2" : "I_ARM1", FTexture::TEX_Any); Icon = TexMan.CheckForTexture (icon, FTexture::TEX_Any);
break;
default:
break;
}
} }
} }

View file

@ -233,6 +233,21 @@ void FMapInfoParser::ParseGameInfo()
} }
} }
} }
else if(nextKey.CompareNoCase("armoricons") == 0)
{
sc.MustGetToken(TK_StringConst);
strncpy(gameinfo.ArmorIcon1, sc.String, 8);
gameinfo.ArmorIcon1[8] = 0;
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;
}
}
// Insert valid keys here. // Insert valid keys here.
GAMEINFOKEY_CSTRING(titlePage, "titlePage", 8) GAMEINFOKEY_CSTRING(titlePage, "titlePage", 8)
GAMEINFOKEY_STRINGARRAY(creditPages, "creditPage", 8) GAMEINFOKEY_STRINGARRAY(creditPages, "creditPage", 8)

View file

@ -82,12 +82,15 @@ struct gameinfo_t
FString chatSound; FString chatSound;
FString finaleMusic; FString finaleMusic;
char finaleFlat[9]; char finaleFlat[9];
FString quitSound;
char borderFlat[9]; char borderFlat[9];
char SkyFlatName[9];
char ArmorIcon1[9];
char ArmorIcon2[9];
fixed_t Armor2Percent;
FString quitSound;
gameborder_t *border; gameborder_t *border;
int telefogheight; int telefogheight;
int defKickback; int defKickback;
char SkyFlatName[9];
FString translator; FString translator;
DWORD defaultbloodcolor; DWORD defaultbloodcolor;
DWORD defaultbloodparticlecolor; DWORD defaultbloodparticlecolor;

View file

@ -688,7 +688,7 @@ void cht_Give (player_t *player, const char *name, int amount)
{ {
ABasicArmorPickup *armor = Spawn<ABasicArmorPickup> (0,0,0, NO_REPLACE); ABasicArmorPickup *armor = Spawn<ABasicArmorPickup> (0,0,0, NO_REPLACE);
armor->SaveAmount = 100*deh.BlueAC; armor->SaveAmount = 100*deh.BlueAC;
armor->SavePercent = gameinfo.gametype != GAME_Heretic ? FRACUNIT/2 : FRACUNIT*3/4; armor->SavePercent = gameinfo.Armor2Percent > 0? gameinfo.Armor2Percent : FRACUNIT/2;
if (!armor->CallTryPickup (player->mo)) if (!armor->CallTryPickup (player->mo))
{ {
armor->Destroy (); armor->Destroy ();

View file

@ -23,6 +23,7 @@ gameinfo
defaultbloodcolor = "3f 7d 39" defaultbloodcolor = "3f 7d 39"
defaultbloodparticlecolor = "5f af 57" defaultbloodparticlecolor = "5f af 57"
backpacktype = "ZorchPack" backpacktype = "ZorchPack"
armoricons = "ARM1A0", 0.5, "ARM2A0"
statusbar = "sbarinfo/doom.txt" statusbar = "sbarinfo/doom.txt"
intermissionmusic = "$MUSIC_INTER" intermissionmusic = "$MUSIC_INTER"
intermissioncounter = true intermissioncounter = true

View file

@ -22,6 +22,7 @@ gameinfo
defaultbloodcolor = "68 00 00" defaultbloodcolor = "68 00 00"
defaultbloodparticlecolor = "ff 00 00" defaultbloodparticlecolor = "ff 00 00"
backpacktype = "Backpack" backpacktype = "Backpack"
armoricons = "ARM1A0", 0.5, "ARM2A0"
statusbar = "sbarinfo/doom.txt" statusbar = "sbarinfo/doom.txt"
intermissionmusic = "$MUSIC_DM2INT" intermissionmusic = "$MUSIC_DM2INT"
intermissioncounter = true intermissioncounter = true

View file

@ -23,6 +23,7 @@ gameinfo
defaultbloodcolor = "68 00 00" defaultbloodcolor = "68 00 00"
defaultbloodparticlecolor = "ff 00 00" defaultbloodparticlecolor = "ff 00 00"
backpacktype = "BagOfHolding" backpacktype = "BagOfHolding"
armoricons = "SHLDA0", 0.75, "SHD2A0"
statusbar = "" statusbar = ""
intermissionmusic = "mus_intr" intermissionmusic = "mus_intr"
intermissioncounter = false intermissioncounter = false

View file

@ -23,6 +23,7 @@ gameinfo
defaultbloodcolor = "68 00 00" defaultbloodcolor = "68 00 00"
defaultbloodparticlecolor = "ff 00 00" defaultbloodparticlecolor = "ff 00 00"
backpacktype = "AmmoSatchel" backpacktype = "AmmoSatchel"
armoricons = "I_ARM2", 0.5, "I_ARM1"
statusbar = "" statusbar = ""
intermissionmusic = "d_slide" intermissionmusic = "d_slide"
intermissioncounter = false intermissioncounter = false