diff --git a/source/core/actorlist.cpp b/source/core/actorlist.cpp index ff4123ba5..150990351 100644 --- a/source/core/actorlist.cpp +++ b/source/core/actorlist.cpp @@ -510,8 +510,7 @@ DEFINE_FIELD_NAMED(DCoreActor, spr.pal, pal) DEFINE_FIELD_NAMED(DCoreActor, spr.clipdist, intclipdist) DEFINE_FIELD_NAMED(DCoreActor, clipdist, clipdist) DEFINE_FIELD_NAMED(DCoreActor, spr.blend, blend) -DEFINE_FIELD_NAMED(DCoreActor, spr.xrepeat, xrepeat) -DEFINE_FIELD_NAMED(DCoreActor, spr.yrepeat, yrepeat) +DEFINE_FIELD_NAMED(DCoreActor, spr.scale, scale) DEFINE_FIELD_NAMED(DCoreActor, spr.xoffset, xoffset) DEFINE_FIELD_NAMED(DCoreActor, spr.yoffset, yoffset) DEFINE_FIELD_NAMED(DCoreActor, spr.intowner, owner) diff --git a/source/core/maptypes.h b/source/core/maptypes.h index 61e727806..90a66688a 100644 --- a/source/core/maptypes.h +++ b/source/core/maptypes.h @@ -450,6 +450,7 @@ struct spritetypebase sectortype* sectp; DAngle angle; + DVector2 scale; ESpriteFlags cstat; int16_t picnum; @@ -468,8 +469,6 @@ struct spritetypebase uint8_t pal; uint8_t clipdist; uint8_t blend; - uint8_t xrepeat; - uint8_t yrepeat; int8_t xoffset; int8_t yoffset; @@ -480,71 +479,58 @@ struct spritetypebase void SetScale(double x, double y) { - xrepeat = uint8_t(x * scaletoint); - yrepeat = uint8_t(y * scaletoint); + scale = { x, y }; } void SetScale(const DVector2& p) { - xrepeat = uint8_t(p.X * scaletoint); - yrepeat = uint8_t(p.Y * scaletoint); + scale = p; } void SetScaleX(double x) { - xrepeat = uint8_t(x * scaletoint); + scale.X = x; } void SetScaleY(double y) { - yrepeat = uint8_t(y * scaletoint); + scale.Y = y; } void AddScaleX(double x) { - xrepeat += uint8_t(x * scaletoint); + scale.X += x; } void AddScaleY(double y) { - yrepeat += uint8_t(y * scaletoint); + scale.Y += y; } void MultScale(double x) { - xrepeat = uint8_t(xrepeat * x); - yrepeat = uint8_t(yrepeat * x); + scale *= x; } - void MultScaleX(double x) - { - xrepeat = uint8_t(xrepeat * x); - } - - void MultScaleY(double y) - { - yrepeat = uint8_t(yrepeat * y); - } void CopyScale(const spritetypebase* other) { - xrepeat = other->xrepeat; - yrepeat = other->yrepeat; + scale = other->scale; } DVector2 Scale() const { - return DVector2(ScaleX(), ScaleY()); + return scale; } double ScaleX() const { - return xrepeat * inttoscale; + return scale.X; } double ScaleY() const { - return yrepeat * inttoscale; + return scale.Y; } }; diff --git a/source/core/savegamehelp.cpp b/source/core/savegamehelp.cpp index 27a51a96a..5eb46d064 100644 --- a/source/core/savegamehelp.cpp +++ b/source/core/savegamehelp.cpp @@ -455,8 +455,8 @@ FSerializer &Serialize(FSerializer &arc, const char *key, spritetype &c, spritet ("pal", c.pal, def->pal) ("clipdist", c.clipdist, def->clipdist) ("blend", c.blend, def->blend) - ("xrepeat", c.xrepeat, def->xrepeat) - ("yrepeat", c.yrepeat, def->yrepeat) + ("xrepeat", c.scale.X, def->scale.X) + ("yrepeat", c.scale.Y, def->scale.Y) ("xoffset", c.xoffset, def->xoffset) ("yoffset", c.yoffset, def->yoffset) ("statnum", c.statnum) diff --git a/source/core/vmexports.cpp b/source/core/vmexports.cpp index 4f11dc7d9..723121181 100644 --- a/source/core/vmexports.cpp +++ b/source/core/vmexports.cpp @@ -96,8 +96,7 @@ DEFINE_FIELD_X(tspritetype, tspritetype, shade) DEFINE_FIELD_X(tspritetype, tspritetype, pal) DEFINE_FIELD_X(tspritetype, tspritetype, clipdist) DEFINE_FIELD_X(tspritetype, tspritetype, blend) -DEFINE_FIELD_X(tspritetype, tspritetype, xrepeat) -DEFINE_FIELD_X(tspritetype, tspritetype, yrepeat) +DEFINE_FIELD_X(tspritetype, tspritetype, scale) DEFINE_FIELD_X(tspritetype, tspritetype, xoffset) DEFINE_FIELD_X(tspritetype, tspritetype, yoffset) DEFINE_FIELD_X(tspritetype, tspritetype, ownerActor) diff --git a/source/games/blood/src/animatesprite.cpp b/source/games/blood/src/animatesprite.cpp index 4abaa8f9b..13ced7dc4 100644 --- a/source/games/blood/src/animatesprite.cpp +++ b/source/games/blood/src/animatesprite.cpp @@ -384,8 +384,8 @@ static tspritetype* viewAddEffect(tspriteArray& tsprites, int nTSprite, VIEW_EFF } pNSprite->shade = 127; pNSprite->cstat |= CSTAT_SPRITE_TRANSLUCENT; - pNSprite->xrepeat = pTSprite->xrepeat; - pNSprite->yrepeat = pTSprite->yrepeat>>2; + pNSprite->scale.X = pTSprite->scale.X; + pNSprite->scale.Y = pTSprite->scale.Y * 0.25; pNSprite->picnum = pTSprite->picnum; if (!VanillaMode() && (pTSprite->type == kThingDroppedLifeLeech)) // fix shadow for thrown lifeleech pNSprite->picnum = 800; diff --git a/wadsrc/static/zscript/coreactor.zs b/wadsrc/static/zscript/coreactor.zs index 498232ab0..0625a0ce3 100644 --- a/wadsrc/static/zscript/coreactor.zs +++ b/wadsrc/static/zscript/coreactor.zs @@ -20,8 +20,7 @@ class CoreActor native native uint8 pal; native uint8 intclipdist; native uint8 blend; - //native uint8 xrepeat; - //native uint8 yrepeat; + native Vector2 scale; native int8 xoffset; native int8 yoffset; native int16 owner; diff --git a/wadsrc/static/zscript/maptypes.zs b/wadsrc/static/zscript/maptypes.zs index e725b6104..594ff4ec7 100644 --- a/wadsrc/static/zscript/maptypes.zs +++ b/wadsrc/static/zscript/maptypes.zs @@ -291,8 +291,7 @@ struct tspritetype native native uint8 pal; native uint8 clipdist; native uint8 blend; - //native uint8 xrepeat; - //native uint8 yrepeat; + native Vector2 scale; native int8 xoffset; native int8 yoffset; native CoreActor ownerActor;