- wrapped more clipdists

This commit is contained in:
Christoph Oelckers 2022-09-09 18:29:02 +02:00
parent f777e84c75
commit d664f50240
5 changed files with 12 additions and 12 deletions

View file

@ -530,7 +530,7 @@ BREAK_INFO* SetupSpriteForBreak(DSWActor* actor)
else else
actor->spr.extra |= (SPRX_BREAKABLE); actor->spr.extra |= (SPRX_BREAKABLE);
actor->spr.clipdist = ActorSizeX(actor); SetActorSizeX(actor);
actor->spr.cstat |= (CSTAT_SPRITE_BREAKABLE); actor->spr.cstat |= (CSTAT_SPRITE_BREAKABLE);
} }

View file

@ -2051,9 +2051,9 @@ inline double ActorSizeToTop(DSWActor* a)
return (ActorSizeZ(a) + tileTopOffset(a->spr.picnum)) * 0.5; return (ActorSizeZ(a) + tileTopOffset(a->spr.picnum)) * 0.5;
} }
inline int ActorSizeX(DSWActor* sp) inline void SetActorSizeX(DSWActor* sp)
{ {
return MulScale(tileWidth(sp->spr.picnum), sp->spr.xrepeat, 6); sp->spr.clipdist = MulScale(tileWidth(sp->spr.picnum), sp->spr.xrepeat, 6);
} }
inline bool Facing(DSWActor* actor1, DSWActor* actor2) inline bool Facing(DSWActor* actor1, DSWActor* actor2)

View file

@ -2486,7 +2486,7 @@ void SpawnPlayerUnderSprite(PLAYER* pp)
actor->user.ActorActionSet = plActor->user.ActorActionSet; actor->user.ActorActionSet = plActor->user.ActorActionSet;
actor->spr.picnum = plActor->spr.picnum; actor->spr.picnum = plActor->spr.picnum;
actor->spr.clipdist = plActor->spr.clipdist; actor->copy_clipdist(plActor);
actor->spr.xrepeat = plActor->spr.xrepeat; actor->spr.xrepeat = plActor->spr.xrepeat;
actor->spr.yrepeat = plActor->spr.yrepeat; actor->spr.yrepeat = plActor->spr.yrepeat;
} }

View file

@ -1682,7 +1682,7 @@ void SpriteSetup(void)
case BREAKABLE: case BREAKABLE:
// need something that tells missiles to hit them // need something that tells missiles to hit them
// but allows actors to move through them // but allows actors to move through them
actor->spr.clipdist = ActorSizeX(actor); SetActorSizeX(actor);
actor->spr.extra |= (SPRX_BREAKABLE); actor->spr.extra |= (SPRX_BREAKABLE);
actor->spr.cstat |= (CSTAT_SPRITE_BREAKABLE); actor->spr.cstat |= (CSTAT_SPRITE_BREAKABLE);
break; break;
@ -3466,7 +3466,7 @@ NUKE_REPLACEMENT:
SpawnUser(actor, actor->spr.picnum, nullptr); SpawnUser(actor, actor->spr.picnum, nullptr);
actor->spr.clipdist = ActorSizeX(actor); SetActorSizeX(actor);
actor->spr.cstat |= (CSTAT_SPRITE_BREAKABLE); actor->spr.cstat |= (CSTAT_SPRITE_BREAKABLE);
actor->spr.extra |= (SPRX_BREAKABLE); actor->spr.extra |= (SPRX_BREAKABLE);
break; break;

View file

@ -17016,7 +17016,7 @@ int InitEnemyMine(DSWActor* actor)
int HelpMissileLateral(DSWActor* actor, int dist) int HelpMissileLateral(DSWActor* actor, int dist)
{ {
auto old_xvel = actor->vel.X; auto old_xvel = actor->vel.X;
auto old_clipdist = actor->spr.clipdist; SAVE_CLIP;
actor->vel.X = dist * maptoworld; // not worth changing 28 call locations... actor->vel.X = dist * maptoworld; // not worth changing 28 call locations...
@ -17027,7 +17027,7 @@ int HelpMissileLateral(DSWActor* actor, int dist)
actor->user.coll = move_missile(actor, DVector3(vec, 0), 16, 16, 0, 1); actor->user.coll = move_missile(actor, DVector3(vec, 0), 16, 16, 0, 1);
actor->vel.X = old_xvel; actor->vel.X = old_xvel;
actor->spr.clipdist = old_clipdist; RESTORE_CLIP;
actor->backuppos(); actor->backuppos();
return 0; return 0;
@ -18698,7 +18698,7 @@ int ShrapKillSprite(DSWActor* actor)
break; break;
case GORE_Lung: case GORE_Lung:
if (RandomRange(1000) > 500) break; if (RandomRange(1000) > 500) break;
actor->spr.clipdist = ActorSizeX(actor); SetActorSizeX(actor);
SpawnFloorSplash(actor); SpawnFloorSplash(actor);
if (RandomRange(1000) < 500) if (RandomRange(1000) < 500)
PlaySound(DIGI_GIBS1, actor, v3df_none); PlaySound(DIGI_GIBS1, actor, v3df_none);
@ -18720,7 +18720,7 @@ int ShrapKillSprite(DSWActor* actor)
break; break;
case GORE_Liver: case GORE_Liver:
if (RandomRange(1000) > 500) break; if (RandomRange(1000) > 500) break;
actor->spr.clipdist = ActorSizeX(actor); SetActorSizeX(actor);
SpawnFloorSplash(actor); SpawnFloorSplash(actor);
if (RandomRange(1000) < 500) if (RandomRange(1000) < 500)
PlaySound(DIGI_GIBS1, actor, v3df_none); PlaySound(DIGI_GIBS1, actor, v3df_none);
@ -18742,7 +18742,7 @@ int ShrapKillSprite(DSWActor* actor)
break; break;
case GORE_SkullCap: case GORE_SkullCap:
if (RandomRange(1000) > 500) break; if (RandomRange(1000) > 500) break;
actor->spr.clipdist = ActorSizeX(actor); SetActorSizeX(actor);
SpawnFloorSplash(actor); SpawnFloorSplash(actor);
if (rnd_num > 683) if (rnd_num > 683)
{ {
@ -18760,7 +18760,7 @@ int ShrapKillSprite(DSWActor* actor)
break; break;
case GORE_Head: case GORE_Head:
if (RandomRange(1000) > 500) break; if (RandomRange(1000) > 500) break;
actor->spr.clipdist = ActorSizeX(actor); SetActorSizeX(actor);
QueueFloorBlood(actor); QueueFloorBlood(actor);
QueueGeneric(actor,GORE_Head); QueueGeneric(actor,GORE_Head);
return 0; return 0;