From 4b69a181c31f20638d301db8bb70754b31a9e1a2 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 6 Aug 2020 20:08:04 +0200 Subject: [PATCH] - use symbolic constants for some statnums --- source/games/duke/src/animatesprites_d.cpp | 5 +++-- source/games/duke/src/animatesprites_r.cpp | 5 +++-- source/sw/src/actor.h | 11 ----------- 3 files changed, 6 insertions(+), 15 deletions(-) delete mode 100644 source/sw/src/actor.h diff --git a/source/games/duke/src/animatesprites_d.cpp b/source/games/duke/src/animatesprites_d.cpp index dce934fa6..a3e221525 100644 --- a/source/games/duke/src/animatesprites_d.cpp +++ b/source/games/duke/src/animatesprites_d.cpp @@ -166,14 +166,15 @@ void animatesprites_d(int x,int y,int a,int smoothratio) } if( t->statnum == 99 ) continue; - if( s->statnum != 1 && s->picnum == APLAYER && ps[s->yvel].newowner == -1 && s->owner >= 0 ) + if( s->statnum != STAT_ACTOR && s->picnum == APLAYER && ps[s->yvel].newowner == -1 && s->owner >= 0 ) { t->x -= mulscale16(MaxSmoothRatio-smoothratio,ps[s->yvel].posx-ps[s->yvel].oposx); t->y -= mulscale16(MaxSmoothRatio-smoothratio,ps[s->yvel].posy-ps[s->yvel].oposy); t->z = ps[s->yvel].oposz + mulscale16(smoothratio,ps[s->yvel].posz-ps[s->yvel].oposz); t->z += (40<<8); } - else if( ( s->statnum == 0 && s->picnum != CRANEPOLE) || s->statnum == 10 || s->statnum == 6 || s->statnum == 4 || s->statnum == 5 || s->statnum == 1 ) + else if( ( s->statnum == STAT_DEFAULT && s->picnum != CRANEPOLE) || s->statnum == STAT_PLAYER || + s->statnum == STAT_STANDABLE || s->statnum == STAT_PROJECTILE || s->statnum == STAT_MISC || s->statnum == STAT_ACTOR ) { t->x -= mulscale16(MaxSmoothRatio-smoothratio,s->x-hittype[i].bposx); t->y -= mulscale16(MaxSmoothRatio-smoothratio,s->y-hittype[i].bposy); diff --git a/source/games/duke/src/animatesprites_r.cpp b/source/games/duke/src/animatesprites_r.cpp index 5cece5bbc..50277d911 100644 --- a/source/games/duke/src/animatesprites_r.cpp +++ b/source/games/duke/src/animatesprites_r.cpp @@ -153,7 +153,7 @@ void animatesprites_r(int x,int y,int a,int smoothratio) } if( t->statnum == 99 ) continue; - if( s->statnum != 1 && s->picnum == APLAYER && ps[s->yvel].newowner == -1 && s->owner >= 0 ) + if( s->statnum != STAT_ACTOR && s->picnum == APLAYER && ps[s->yvel].newowner == -1 && s->owner >= 0 ) { t->x -= mulscale16(MaxSmoothRatio-smoothratio,ps[s->yvel].posx-ps[s->yvel].oposx); t->y -= mulscale16(MaxSmoothRatio-smoothratio,ps[s->yvel].posy-ps[s->yvel].oposy); @@ -162,7 +162,8 @@ void animatesprites_r(int x,int y,int a,int smoothratio) s->xrepeat = 24; s->yrepeat = 17; } - else if( ( s->statnum == 0 && s->picnum != CRANEPOLE) || s->statnum == 10 || s->statnum == 6 || s->statnum == 4 || s->statnum == 5 || s->statnum == 1 ) + else if ((s->statnum == STAT_DEFAULT && s->picnum != CRANEPOLE) || s->statnum == STAT_PLAYER || + s->statnum == STAT_STANDABLE || s->statnum == STAT_PROJECTILE || s->statnum == STAT_MISC || s->statnum == STAT_ACTOR) { t->x -= mulscale16(MaxSmoothRatio-smoothratio,s->x-hittype[i].bposx); t->y -= mulscale16(MaxSmoothRatio-smoothratio,s->y-hittype[i].bposy); diff --git a/source/sw/src/actor.h b/source/sw/src/actor.h deleted file mode 100644 index b6ba8a4c8..000000000 --- a/source/sw/src/actor.h +++ /dev/null @@ -1,11 +0,0 @@ -#pragma once -BEGIN_SW_NS -int DoBeginJump(short SpriteNum); -int DoJump(short SpriteNum); -int DoBeginFall(short SpriteNum); -int DoFall(short SpriteNum); -void KeepActorOnFloor(short SpriteNum); -int DoActorSlide(short SpriteNum); -int DoActorSectorDamage(short SpriteNum); -int DoScaleSprite(short SpriteNum); -END_SW_NS