- moved all indirect precaching info to external definition files.

This commit is contained in:
Christoph Oelckers 2022-12-31 18:32:05 +01:00
parent 6924869895
commit 1c7ca7b63a
17 changed files with 55 additions and 1 deletions

View file

@ -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;

View file

@ -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

View file

@ -47,6 +47,8 @@ struct gameinfo_t
FName mSliderBackColor;
FString mBackButton;
FString TitlePage;
TArray<FName> precacheClasses;
TArray<FName> precacheTextures;
};

View file

@ -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);
}
}

View file

@ -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
{

View file

@ -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"
}

View file

@ -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"
}

View file

@ -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"
}

View file

@ -253,6 +253,7 @@ class DukeHydrant : DukeActor
Default
{
spriteset "HYDRENT", "BROKEFIREHYDRENT";
precacheclass "DukeToiletWater";
+INFLAME;
+DOUBLEDMGTHRUST;
+BREAKMIRRORS;

View file

@ -4,6 +4,7 @@ class DukeStall : DukeActor
default
{
spriteset "STALL", "STALLBROKE";
precacheclass "DukeToiletWater";
}
override void Initialize()

View file

@ -10,6 +10,7 @@ class DukeLizMan : DukeActor
+GREENSLIMEFOOD;
+DONTENTERWATER;
+RANDOMANGLEONWATER;
precacheclass "DukeLizmanHead", "DukeLizmanArm", "DukeLizmanLeg"
Strength LIZSTRENGTH;
}

View file

@ -7,6 +7,7 @@ class DukeLizTrooper : DukeActor
{
pic "LIZTROOP";
Strength TROOPSTRENGTH;
precacheclass "DukeHeadJib1", "DukeArmJib1", "DukeLegJib1";
+INTERNAL_BADGUY;
+KILLCOUNT;

View file

@ -47,6 +47,7 @@ class DukeWoodenHorse : DukeSimpleItem
default
{
pic "WOODENHORSE";
precacheClass "DukeHorseOnSide";
Strength WEAKEST;
}

View file

@ -7,6 +7,7 @@ class RedneckBillyRay : DukeActor
pic "BILLYRAY";
+INTERNAL_BADGUY;
+KILLCOUNT;
precacheclass "RedneckBillyJibA", "RedneckBillyJibB";
Strength BILLYRAYSTRENGTH;
}

View file

@ -8,6 +8,7 @@ class RedneckCoot : DukeActor
{
pic "COOT";
Strength COOTSTRENGTH;
precacheclass "RedneckCootJibA", "RedneckCootJibB", "RedneckCootJibC";
+INTERNAL_BADGUY;
+KILLCOUNT;
+DESTRUCTOIMMUNE;

View file

@ -15,6 +15,7 @@ class RedneckHulk : DukeActor
+KILLCOUNT;
+NORADIUSPUSH;
ProjectileSpread -5.625;
precacheclass "RedneckHulkJibA", "RedneckHulkJibB", "RedneckHulkJibC";
Strength HULKSTRENGTH;
}

View file

@ -6,6 +6,8 @@ class RedneckMinion : DukeActor
default
{
pic "MINION";
strength MINIONSTRENGTH;
precacheclass "RedneckMinJibA", "RedneckMinJibB", "RedneckMinJibC";
+INTERNAL_BADGUY;
+KILLCOUNT;
+LOOKALLAROUNDWITHPAL8;