mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 00:42:08 +00:00
- moved all indirect precaching info to external definition files.
This commit is contained in:
parent
6924869895
commit
1c7ca7b63a
17 changed files with 55 additions and 1 deletions
|
@ -29,6 +29,7 @@ struct FActorInfo
|
|||
int DefaultFlags = 0;
|
||||
int DefaultCstat = 0;
|
||||
FName DamageType = NAME_None; // damage type this item inflicts
|
||||
TArray<PClassActor*> precacheClasses;
|
||||
|
||||
// these are temporary. Due to how Build games handle their tiles, we cannot look up the textures when scripts are being parsed.
|
||||
TArray<FString> SpriteSetNames;
|
||||
|
|
|
@ -1578,6 +1578,26 @@ void FMapInfoParser::ParseGameInfo()
|
|||
sc.SetCMode(true);
|
||||
globalCutscenes.StatusBarClass = sc.String;
|
||||
}
|
||||
else if (sc.Compare("precacheclasses"))
|
||||
{
|
||||
ParseAssign();
|
||||
do
|
||||
{
|
||||
sc.MustGetString();
|
||||
gameinfo.precacheClasses.Push(FName(sc.String));
|
||||
} while (sc.CheckString(","));
|
||||
|
||||
}
|
||||
else if (sc.Compare("precachetextures"))
|
||||
{
|
||||
ParseAssign();
|
||||
do
|
||||
{
|
||||
sc.MustGetString();
|
||||
gameinfo.precacheTextures.Push(FName(sc.String));
|
||||
} while (sc.CheckString(","));
|
||||
|
||||
}
|
||||
else if (!ParseCloseBrace())
|
||||
{
|
||||
// Unknown
|
||||
|
|
|
@ -47,6 +47,8 @@ struct gameinfo_t
|
|||
FName mSliderBackColor;
|
||||
FString mBackButton;
|
||||
FString TitlePage;
|
||||
TArray<FName> precacheClasses;
|
||||
TArray<FName> precacheTextures;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -376,3 +376,18 @@ DEFINE_PROPERTY(spritesetindex, I, CoreActor)
|
|||
PROP_INT_PARM(i, 0);
|
||||
defaults->spritesetindex = i;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//==========================================================================
|
||||
DEFINE_PROPERTY(precacheclass, Sssssssssssssssssssssssssssssss, CoreActor)
|
||||
{
|
||||
for (int i = 0; i < PROP_PARM_COUNT; ++i)
|
||||
{
|
||||
PROP_STRING_PARM(n, i);
|
||||
auto cls = PClass::FindActor(n);
|
||||
if (n)
|
||||
info->ActorInfo()-> precacheClasses.Push(cls);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -449,7 +449,7 @@ void GameInterface::FinalizeSetup()
|
|||
newcls->InitializeDefaults();
|
||||
spawnMap.Insert(i, { newcls, FNullTextureID(), FNullTextureID(), NO_SOUND, int8_t(0), int8_t(0), int16_t(0x8000) });
|
||||
cls = newcls;
|
||||
GetDefaultByType(newcls)->spr.picnum = i; // make it show the right pic.
|
||||
GetDefaultByType(newcls)->spr.setspritetexture(tileGetTextureID(i)); // make it show the right pic.
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -112,4 +112,6 @@ gameinfo
|
|||
summaryscreen = DukeCutscenes.BuildSPSummary
|
||||
mpsummaryscreen = DukeCutscenes.BuildMPSummary
|
||||
statusbarclass = DukeStatusBar
|
||||
precacheclasses = "DukeFootprints", "DukeBurning", "DukeBurning2", "DukeExplosion2", "DukeExplosion2Bot", "DukeBulletHole",
|
||||
"DukeJibs1", "DukeJibs2", "DukeJibs3", "DukeJibs4", "DukeJibs5", "DukeJibs6", "DukeScrap", "DukeSmallSmoke"
|
||||
}
|
|
@ -72,4 +72,6 @@ gameinfo
|
|||
summaryscreen = DukeCutscenes.BuildSPSummary
|
||||
mpsummaryscreen = DukeCutscenes.BuildMPSummary
|
||||
statusbarclass = DukeStatusBar
|
||||
precacheclasses = "DukeFootprints", "DukeBurning", "DukeBurning2", "DukeExplosion2", "DukeExplosion2Bot", "DukeBulletHole",
|
||||
"DukeJibs1", "DukeJibs2", "DukeJibs3", "DukeJibs4", "DukeJibs5", "DukeJibs6", "DukeScrap", "DukeSmallSmoke"
|
||||
}
|
|
@ -127,4 +127,6 @@ gameinfo
|
|||
summaryscreen = RRCutscenes.BuildSPSummary
|
||||
mpsummaryscreen = DukeCutscenes.BuildMPSummary // identical with Duke's
|
||||
statusbarclass = RedneckStatusBar
|
||||
precacheclasses = "DukeFootprints", "DukeBurning", "DukeBurning2", "DukeExplosion2", "DukeBulletHole",
|
||||
"DukeJibs1", "DukeJibs2", "DukeJibs3", "DukeJibs4", "DukeJibs5", "DukeJibs6", "DukeScrap", "DukeSmallSmoke"
|
||||
}
|
||||
|
|
|
@ -253,6 +253,7 @@ class DukeHydrant : DukeActor
|
|||
Default
|
||||
{
|
||||
spriteset "HYDRENT", "BROKEFIREHYDRENT";
|
||||
precacheclass "DukeToiletWater";
|
||||
+INFLAME;
|
||||
+DOUBLEDMGTHRUST;
|
||||
+BREAKMIRRORS;
|
||||
|
|
|
@ -4,6 +4,7 @@ class DukeStall : DukeActor
|
|||
default
|
||||
{
|
||||
spriteset "STALL", "STALLBROKE";
|
||||
precacheclass "DukeToiletWater";
|
||||
}
|
||||
|
||||
override void Initialize()
|
||||
|
|
|
@ -10,6 +10,7 @@ class DukeLizMan : DukeActor
|
|||
+GREENSLIMEFOOD;
|
||||
+DONTENTERWATER;
|
||||
+RANDOMANGLEONWATER;
|
||||
precacheclass "DukeLizmanHead", "DukeLizmanArm", "DukeLizmanLeg"
|
||||
Strength LIZSTRENGTH;
|
||||
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ class DukeLizTrooper : DukeActor
|
|||
{
|
||||
pic "LIZTROOP";
|
||||
Strength TROOPSTRENGTH;
|
||||
precacheclass "DukeHeadJib1", "DukeArmJib1", "DukeLegJib1";
|
||||
|
||||
+INTERNAL_BADGUY;
|
||||
+KILLCOUNT;
|
||||
|
|
|
@ -47,6 +47,7 @@ class DukeWoodenHorse : DukeSimpleItem
|
|||
default
|
||||
{
|
||||
pic "WOODENHORSE";
|
||||
precacheClass "DukeHorseOnSide";
|
||||
Strength WEAKEST;
|
||||
}
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ class RedneckBillyRay : DukeActor
|
|||
pic "BILLYRAY";
|
||||
+INTERNAL_BADGUY;
|
||||
+KILLCOUNT;
|
||||
precacheclass "RedneckBillyJibA", "RedneckBillyJibB";
|
||||
Strength BILLYRAYSTRENGTH;
|
||||
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ class RedneckCoot : DukeActor
|
|||
{
|
||||
pic "COOT";
|
||||
Strength COOTSTRENGTH;
|
||||
precacheclass "RedneckCootJibA", "RedneckCootJibB", "RedneckCootJibC";
|
||||
+INTERNAL_BADGUY;
|
||||
+KILLCOUNT;
|
||||
+DESTRUCTOIMMUNE;
|
||||
|
|
|
@ -15,6 +15,7 @@ class RedneckHulk : DukeActor
|
|||
+KILLCOUNT;
|
||||
+NORADIUSPUSH;
|
||||
ProjectileSpread -5.625;
|
||||
precacheclass "RedneckHulkJibA", "RedneckHulkJibB", "RedneckHulkJibC";
|
||||
Strength HULKSTRENGTH;
|
||||
}
|
||||
|
||||
|
|
|
@ -6,6 +6,8 @@ class RedneckMinion : DukeActor
|
|||
default
|
||||
{
|
||||
pic "MINION";
|
||||
strength MINIONSTRENGTH;
|
||||
precacheclass "RedneckMinJibA", "RedneckMinJibB", "RedneckMinJibC";
|
||||
+INTERNAL_BADGUY;
|
||||
+KILLCOUNT;
|
||||
+LOOKALLAROUNDWITHPAL8;
|
||||
|
|
Loading…
Reference in a new issue