mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-10 14:51:46 +00:00
- moved definition of games' default armor icons into gameinfo definition.
SVN r1806 (trunk)
This commit is contained in:
parent
8e4ba47c98
commit
57a2e0ab73
10 changed files with 46 additions and 36 deletions
|
@ -1,4 +1,5 @@
|
|||
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
|
||||
the IDAT id when reading the image.
|
||||
|
||||
|
|
|
@ -1961,29 +1961,27 @@ void D_DoomMain (void)
|
|||
// [RH] Try adding .deh and .bex files on the command line.
|
||||
// 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") &&
|
||||
!ConsiderPatches ("-bex", ".bex") &&
|
||||
(gameinfo.gametype == GAME_Doom) &&
|
||||
GameConfig->SetSection ("Doom.DefaultDehacked"))
|
||||
{
|
||||
const char *key;
|
||||
const char *value;
|
||||
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 ();
|
||||
|
||||
|
||||
|
|
|
@ -40,24 +40,13 @@ void ABasicArmor::Tick ()
|
|||
AbsorbCount = 0;
|
||||
if (!Icon.isValid())
|
||||
{
|
||||
switch (gameinfo.gametype)
|
||||
{
|
||||
case GAME_Chex:
|
||||
case GAME_Doom:
|
||||
Icon = TexMan.CheckForTexture (SavePercent == FRACUNIT/3 ? "ARM1A0" : "ARM2A0", FTexture::TEX_Any);
|
||||
break;
|
||||
const char *icon = gameinfo.ArmorIcon1;
|
||||
|
||||
case GAME_Heretic:
|
||||
Icon = TexMan.CheckForTexture (SavePercent == FRACUNIT/2 ? "SHLDA0" : "SHD2A0", FTexture::TEX_Any);
|
||||
break;
|
||||
if (SavePercent >= gameinfo.Armor2Percent && gameinfo.ArmorIcon2[0] != 0)
|
||||
icon = gameinfo.ArmorIcon2;
|
||||
|
||||
case GAME_Strife:
|
||||
Icon = TexMan.CheckForTexture (SavePercent == FRACUNIT/3 ? "I_ARM2" : "I_ARM1", FTexture::TEX_Any);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (icon[0] != 0)
|
||||
Icon = TexMan.CheckForTexture (icon, FTexture::TEX_Any);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
15
src/gi.cpp
15
src/gi.cpp
|
@ -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.
|
||||
GAMEINFOKEY_CSTRING(titlePage, "titlePage", 8)
|
||||
GAMEINFOKEY_STRINGARRAY(creditPages, "creditPage", 8)
|
||||
|
|
7
src/gi.h
7
src/gi.h
|
@ -82,12 +82,15 @@ struct gameinfo_t
|
|||
FString chatSound;
|
||||
FString finaleMusic;
|
||||
char finaleFlat[9];
|
||||
FString quitSound;
|
||||
char borderFlat[9];
|
||||
char SkyFlatName[9];
|
||||
char ArmorIcon1[9];
|
||||
char ArmorIcon2[9];
|
||||
fixed_t Armor2Percent;
|
||||
FString quitSound;
|
||||
gameborder_t *border;
|
||||
int telefogheight;
|
||||
int defKickback;
|
||||
char SkyFlatName[9];
|
||||
FString translator;
|
||||
DWORD defaultbloodcolor;
|
||||
DWORD defaultbloodparticlecolor;
|
||||
|
|
|
@ -688,7 +688,7 @@ void cht_Give (player_t *player, const char *name, int amount)
|
|||
{
|
||||
ABasicArmorPickup *armor = Spawn<ABasicArmorPickup> (0,0,0, NO_REPLACE);
|
||||
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))
|
||||
{
|
||||
armor->Destroy ();
|
||||
|
|
|
@ -23,6 +23,7 @@ gameinfo
|
|||
defaultbloodcolor = "3f 7d 39"
|
||||
defaultbloodparticlecolor = "5f af 57"
|
||||
backpacktype = "ZorchPack"
|
||||
armoricons = "ARM1A0", 0.5, "ARM2A0"
|
||||
statusbar = "sbarinfo/doom.txt"
|
||||
intermissionmusic = "$MUSIC_INTER"
|
||||
intermissioncounter = true
|
||||
|
|
|
@ -22,6 +22,7 @@ gameinfo
|
|||
defaultbloodcolor = "68 00 00"
|
||||
defaultbloodparticlecolor = "ff 00 00"
|
||||
backpacktype = "Backpack"
|
||||
armoricons = "ARM1A0", 0.5, "ARM2A0"
|
||||
statusbar = "sbarinfo/doom.txt"
|
||||
intermissionmusic = "$MUSIC_DM2INT"
|
||||
intermissioncounter = true
|
||||
|
|
|
@ -23,6 +23,7 @@ gameinfo
|
|||
defaultbloodcolor = "68 00 00"
|
||||
defaultbloodparticlecolor = "ff 00 00"
|
||||
backpacktype = "BagOfHolding"
|
||||
armoricons = "SHLDA0", 0.75, "SHD2A0"
|
||||
statusbar = ""
|
||||
intermissionmusic = "mus_intr"
|
||||
intermissioncounter = false
|
||||
|
|
|
@ -23,6 +23,7 @@ gameinfo
|
|||
defaultbloodcolor = "68 00 00"
|
||||
defaultbloodparticlecolor = "ff 00 00"
|
||||
backpacktype = "AmmoSatchel"
|
||||
armoricons = "I_ARM2", 0.5, "I_ARM1"
|
||||
statusbar = ""
|
||||
intermissionmusic = "d_slide"
|
||||
intermissioncounter = false
|
||||
|
|
Loading…
Reference in a new issue