mirror of
https://github.com/ZDoom/Raze.git
synced 2025-02-17 09:11:25 +00:00
- animatesprites_r.cpp cleanup
This commit is contained in:
parent
f9e5f2c137
commit
0e169759d5
6 changed files with 59 additions and 96 deletions
|
@ -48,6 +48,9 @@ xx(RedneckFeather)
|
|||
xx(DukeSteamBase)
|
||||
xx(RedneckFire)
|
||||
xx(DukePlayerOnWater)
|
||||
xx(RedneckBillyRay)
|
||||
xx(RedneckBiker)
|
||||
xx(RedneckCheerleader)
|
||||
|
||||
xx(spawnstate)
|
||||
xx(brokenstate)
|
||||
|
|
|
@ -81,6 +81,32 @@ void drawshadows(tspriteArray& tsprites, tspritetype* t, DDukeActor* h)
|
|||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// some ugly stuff here: RRRA forces some animations fullbright,
|
||||
// but there is no good way to set this up for CON in any decent way.
|
||||
// These frames are being hacked in here. No need to make this configurable, though.
|
||||
// For our new format this can be done as a real feature.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
bool RRRAFullbrightHack(tspritetype* t, int k)
|
||||
{
|
||||
if (t->ownerActor->IsKindOf(NAME_RedneckBillyRay))
|
||||
{
|
||||
return k >= 102 && k <= 151;
|
||||
}
|
||||
else if (t->ownerActor->IsKindOf(NAME_RedneckBiker))
|
||||
{
|
||||
return (k >= 54 && k <= 58) || (k >= 84 && k <= 88);
|
||||
}
|
||||
else if (t->ownerActor->IsKindOf(NAME_RedneckCheerleader))
|
||||
{
|
||||
return k >= 102 && k <= 151;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void applyanimations(tspritetype* t, DDukeActor* h, const DVector2& viewVec, DAngle viewang)
|
||||
{
|
||||
if (gs.actorinfo[h->spr.picnum].scriptaddress && !actorflag(h, SFLAG2_DONTANIMATE))// && (t->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) != CSTAT_SPRITE_ALIGNMENT_SLAB)
|
||||
|
@ -160,12 +186,15 @@ void applyanimations(tspritetype* t, DDukeActor* h, const DVector2& viewVec, DAn
|
|||
}
|
||||
}
|
||||
|
||||
t->picnum += k + ScriptCode[t4] + l * h->temp_data[3];
|
||||
k += ScriptCode[t4] + l * h->temp_data[3];
|
||||
t->picnum += k;
|
||||
|
||||
if (isRRRA() && RRRAFullbrightHack(t, k)) t->shade = -127;
|
||||
|
||||
if (l > 0)
|
||||
{
|
||||
while (t->picnum >= 0 && t->picnum < MAXTILES && !tileGetTexture(t->picnum)->isValid())
|
||||
t->picnum -= l; //Hack, for actors
|
||||
t->picnum -= l; //back up one frame if this one is invald.
|
||||
}
|
||||
|
||||
if (t->picnum < 0 || t->picnum >= MAXTILES)
|
||||
|
|
|
@ -119,10 +119,8 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
|
|||
t3 = h->temp_data[3];
|
||||
t4 = h->temp_data[4];
|
||||
|
||||
switch (h->spr.picnum)
|
||||
if (h->spr.picnum == RTILE_APLAYER)
|
||||
{
|
||||
case RTILE_APLAYER:
|
||||
|
||||
p = h->PlayerIndex();
|
||||
|
||||
if (t->pal == 1) t->pos.Z -= 18;
|
||||
|
@ -186,16 +184,6 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
|
|||
newtspr->pal = 0;
|
||||
}
|
||||
|
||||
if (!h->GetOwner())
|
||||
{
|
||||
applyRotation1(h, t, viewang);
|
||||
|
||||
if (t->sectp->lotag == ST_2_UNDERWATER) t->picnum += RTILE_APLAYERSWIMMING - RTILE_APLAYER;
|
||||
else if ((h->floorz - h->spr.pos.Z) > 64) t->picnum += RTILE_APLAYERJUMP - RTILE_APLAYER;
|
||||
|
||||
t->pal = ps[p].palookup;
|
||||
continue;
|
||||
}
|
||||
if (ps[p].on_crane == nullptr && (h->sector()->lotag & 0x7ff) != 1)
|
||||
{
|
||||
double v = h->spr.pos.Z - ps[p].GetActor()->floorz + 3;
|
||||
|
@ -204,13 +192,6 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
|
|||
else h->spr.yoffset = 0;
|
||||
}
|
||||
|
||||
if (ps[p].newOwner != nullptr)
|
||||
{
|
||||
t4 = ScriptCode[gs.actorinfo[RTILE_APLAYER].scriptaddress + 1];
|
||||
t3 = 0;
|
||||
t1 = ScriptCode[gs.actorinfo[RTILE_APLAYER].scriptaddress + 2];
|
||||
}
|
||||
|
||||
if (ud.cameraactor == nullptr && ps[p].newOwner == nullptr)
|
||||
if (h->GetOwner() && display_mirror == 0 && ps[p].over_shoulder_on == 0)
|
||||
if (ud.multimode < 2 || (ud.multimode > 1 && p == screenpeek))
|
||||
|
@ -225,55 +206,35 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
|
|||
|
||||
if (ps[p].OnMotorcycle && p == screenpeek)
|
||||
{
|
||||
t->picnum = RTILE_RRTILE7219;
|
||||
t->picnum = RTILE_PLAYERONBIKEBACK;
|
||||
t->scale = DVector2(0.28125, 0.28125);
|
||||
t4 = 0;
|
||||
t3 = 0;
|
||||
t1 = 0;
|
||||
drawshadows(tsprites, t, h);
|
||||
continue;
|
||||
}
|
||||
else if (ps[p].OnMotorcycle)
|
||||
{
|
||||
k = angletorotation2(h->spr.Angles.Yaw, viewang);
|
||||
if (k > 6)
|
||||
{
|
||||
k = 12 - k;
|
||||
t->cstat |= CSTAT_SPRITE_XFLIP;
|
||||
}
|
||||
else t->cstat &= ~CSTAT_SPRITE_XFLIP;
|
||||
|
||||
t->picnum = RTILE_RRTILE7213 + k;
|
||||
t->picnum = RTILE_PLAYERONBIKE;
|
||||
applyRotation2(h, t, viewang);
|
||||
t->scale = DVector2(0.28125, 0.28125);
|
||||
t4 = 0;
|
||||
t3 = 0;
|
||||
t1 = 0;
|
||||
drawshadows(tsprites, t, h);
|
||||
continue;
|
||||
}
|
||||
else if (ps[p].OnBoat && p == screenpeek)
|
||||
{
|
||||
t->picnum = RTILE_RRTILE7190;
|
||||
t->picnum = RTILE_PLAYERONBOATBACK;
|
||||
t->scale = DVector2(0.5, 0.5);
|
||||
t4 = 0;
|
||||
t3 = 0;
|
||||
t1 = 0;
|
||||
drawshadows(tsprites, t, h);
|
||||
continue;
|
||||
}
|
||||
else if (ps[p].OnBoat)
|
||||
{
|
||||
t->picnum = RTILE_PLAYERONBOAT;
|
||||
k = angletorotation2(h->spr.Angles.Yaw, viewang);
|
||||
|
||||
if (k > 6)
|
||||
{
|
||||
k = 12 - k;
|
||||
t->cstat |= CSTAT_SPRITE_XFLIP;
|
||||
}
|
||||
else t->cstat &= ~CSTAT_SPRITE_XFLIP;
|
||||
|
||||
t->picnum = RTILE_RRTILE7184 + k;
|
||||
applyRotation2(h, t, viewang);
|
||||
t->scale = DVector2(0.5, 0.5);
|
||||
t4 = 0;
|
||||
t3 = 0;
|
||||
t1 = 0;
|
||||
drawshadows(tsprites, t, h);
|
||||
continue;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
applyanimations(t, h, viewVec, viewang);
|
||||
|
||||
|
@ -294,7 +255,6 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
|
|||
t->shade = -127;
|
||||
break;
|
||||
|
||||
case RTILE_CHAINGUN:
|
||||
case RTILE_EXPLOSION3:
|
||||
t->shade = -127;
|
||||
break;
|
||||
|
@ -307,24 +267,9 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
|
|||
case RTILE_DESTRUCTO:
|
||||
t->cstat |= CSTAT_SPRITE_INVISIBLE;
|
||||
break;
|
||||
case RTILE_CHEER:
|
||||
if (!isRRRA()) break;
|
||||
if (t->picnum >= RTILE_CHEER + 102 && t->picnum <= RTILE_CHEER + 151)
|
||||
t->shade = -127;
|
||||
break;
|
||||
case RTILE_BIKER:
|
||||
if (!isRRRA()) break;
|
||||
if (t->picnum >= RTILE_BIKER + 54 && t->picnum <= RTILE_BIKER + 58)
|
||||
t->shade = -127;
|
||||
else if (t->picnum >= RTILE_BIKER + 84 && t->picnum <= RTILE_BIKER + 88)
|
||||
t->shade = -127;
|
||||
break;
|
||||
case RTILE_RRTILE2034:
|
||||
t->picnum = RTILE_RRTILE2034 + ((PlayClock >> 2) & 1);
|
||||
break;
|
||||
case RTILE_RRTILE2944:
|
||||
t->shade = -127;
|
||||
t->picnum = RTILE_RRTILE2944 + ((PlayClock >> 2) & 4);
|
||||
|
||||
case RTILE_LETSBOWL:
|
||||
t->picnum = RTILE_LETSBOWL + ((PlayClock >> 2) & 1);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -674,7 +674,7 @@ x(BOWLINGLANE1, 2025)
|
|||
x(BOWLINGLANE2, 2026)
|
||||
x(BOWLINGLANE3, 2027)
|
||||
x(BOWLINGLANE4, 2028)
|
||||
y(RRTILE2034, 2034)
|
||||
y(LETSBOWL, 2034)
|
||||
y(RRTILE2050, 2050)
|
||||
y(RRTILE2052, 2052)
|
||||
y(RRTILE2053, 2053)
|
||||
|
@ -883,7 +883,7 @@ y(RRTILE2898, 2898)
|
|||
y(RRTILE2899, 2899)
|
||||
y(RRTILE2915, 2915)
|
||||
y(RRTILE2940, 2940)
|
||||
y(RRTILE2944, 2944)
|
||||
y(PULSELAMP, 2944)
|
||||
y(RRTILE2945, 2945)
|
||||
y(RRTILE2946, 2946)
|
||||
y(RRTILE2947, 2947)
|
||||
|
@ -1097,8 +1097,6 @@ x(APLAYERTOP, 3840)
|
|||
x(APLAYER, 3845)
|
||||
x(PLAYERWALK, 3846)
|
||||
x(PLAYERONWATER, 3860)
|
||||
x(APLAYERJUMP, 3905)
|
||||
x(APLAYERSWIMMING, 3845 + 390)
|
||||
x(DUKELYINGDEAD, 3998)
|
||||
x(DUKEGUN, 4041)
|
||||
x(DUKETORSO, 4046)
|
||||
|
@ -1194,11 +1192,11 @@ x(MOTOGUN, 7168)
|
|||
y(RRTILE7169, 7169)
|
||||
x(MOTOHIT, 7170)
|
||||
x(BOATHIT, 7175)
|
||||
y(RRTILE7184, 7184)
|
||||
y(RRTILE7190, 7190)
|
||||
y(PLAYERONBOAT, 7184)
|
||||
y(PLAYERONBOATBACK, 7190)
|
||||
y(RRTILE7191, 7191)
|
||||
y(RRTILE7213, 7213)
|
||||
y(RRTILE7219, 7219)
|
||||
y(PLAYERONBIKE, 7213)
|
||||
y(PLAYERONBIKEBACK, 7219)
|
||||
x(EMPTYBIKE, 7220)
|
||||
x(EMPTYBOAT, 7233)
|
||||
y(RABBITSPAWNER, 7424)
|
||||
|
|
|
@ -186,7 +186,7 @@ spawnclasses
|
|||
2876 = DukeGenericDestructible, "RRTILE2876", "RRTILE2990", "GLASS_BREAKING", spawnglass
|
||||
3152 = DukeGenericDestructible, "RRTILE3152", "RRTILE3218", "GLASS_BREAKING", spawnglass
|
||||
3153 = DukeGenericDestructible, "RRTILE3153", "RRTILE3219", "GLASS_BREAKING", spawnglass
|
||||
2030 = DukeGenericDestructible, "RRTILE2030", "RRTILE2034", "GLASS_BREAKING", spawnglass
|
||||
2030 = DukeGenericDestructible, "RRTILE2030", "LETSBOWL", "GLASS_BREAKING", spawnglass
|
||||
2915 = DukeGenericDestructible, "RRTILE2915", "RRTILE2977", "GLASS_BREAKING", spawnglass
|
||||
2893 = DukeGenericDestructible, "RRTILE2893", "RRTILE2978", "GLASS_BREAKING", spawnglass
|
||||
3115 = DukeGenericDestructible, "RRTILE3115", "RRTILE3116", "GLASS_BREAKING", spawnglass
|
||||
|
|
|
@ -16,18 +16,6 @@ class RedneckBillyRay : DukeActor
|
|||
self.scale = (0.390625, 0.328125);
|
||||
self.setClipDistFromTile();
|
||||
}
|
||||
|
||||
override bool animate(tspritetype t)
|
||||
{
|
||||
if (Raze.isRRRA())
|
||||
{
|
||||
/* todo: define this in the animation.
|
||||
if (t->picnum >= RTILE_BILLYRAY + 5 && t->picnum <= RTILE_BILLYRAY + 9)
|
||||
t->shade = -127;
|
||||
*/
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
class RedneckBillyRayStayput: RedneckBillyRay
|
||||
|
|
Loading…
Reference in a new issue