- WIP for a default scale property.

For now a NOP, we need to get a little further with the scriptification work before this can be made operational.
This commit is contained in:
Christoph Oelckers 2023-04-08 09:38:46 +02:00
parent e2db4a834e
commit 307276a276
3 changed files with 19 additions and 1 deletions

View file

@ -15,6 +15,7 @@ enum EDefaultFlags
{ {
DEFF_PICNUM = 1, DEFF_PICNUM = 1,
DEFF_STATNUM = 2, DEFF_STATNUM = 2,
DEFF_SCALE = 4,
}; };
struct FActorInfo struct FActorInfo
@ -23,6 +24,7 @@ struct FActorInfo
TArray<int> SpriteSet; TArray<int> SpriteSet;
PClassActor *Replacement = nullptr; PClassActor *Replacement = nullptr;
PClassActor *Replacee = nullptr; PClassActor *Replacee = nullptr;
DVector2 DefaultScale = { 0, 0 };
int TypeNum = -1; int TypeNum = -1;
int DefaultFlags = 0; int DefaultFlags = 0;
int DefaultCstat = 0; int DefaultCstat = 0;
@ -40,6 +42,7 @@ struct FActorInfo
DefaultFlags = other.DefaultFlags; DefaultFlags = other.DefaultFlags;
DefaultCstat = other.DefaultCstat; DefaultCstat = other.DefaultCstat;
SpriteSetNames = other.SpriteSetNames; SpriteSetNames = other.SpriteSetNames;
DefaultScale = other.DefaultScale;
} }
void ResolveTextures(const char* clsname, DCoreActor *defaults); void ResolveTextures(const char* clsname, DCoreActor *defaults);

View file

@ -329,6 +329,21 @@ DEFINE_PROPERTY(statnum, I, CoreActor)
bag.Info->ActorInfo()->DefaultFlags |= DEFF_STATNUM; bag.Info->ActorInfo()->DefaultFlags |= DEFF_STATNUM;
} }
//==========================================================================
//
//==========================================================================
DEFINE_PROPERTY(scale, Ff, CoreActor)
{
PROP_FLOAT_PARM(x, 0);
bag.Info->ActorInfo()->DefaultScale = { x,x };
if (PROP_PARM_COUNT > 1)
{
PROP_FLOAT_PARM(y, 0);
bag.Info->ActorInfo()->DefaultScale.Y = y;
}
bag.Info->ActorInfo()->DefaultFlags |= DEFF_SCALE;
}
//========================================================================== //==========================================================================
// //
//========================================================================== //==========================================================================

View file

@ -9,7 +9,7 @@ class DukeRecon : DukeActor
Sound PainSnd; Sound PainSnd;
Sound RoamSnd; Sound RoamSnd;
int shift; int shift;
class<DukeActor> spawntype; // should be 'class<DukeActor>' but the spawned types have not all been converted yet. class<DukeActor> spawntype;
override void initialize() override void initialize()
{ {