diff --git a/source/build/include/build.h b/source/build/include/build.h index 24f80e227..a257ba8db 100644 --- a/source/build/include/build.h +++ b/source/build/include/build.h @@ -344,7 +344,7 @@ int32_t lintersect(int32_t originX, int32_t originY, int32_t originZ, int32_t lineStartX, int32_t lineStartY, int32_t lineEndX, int32_t lineEndY, int32_t *intersectionX, int32_t *intersectionY, int32_t *intersectionZ); -int32_t spriteheightofsptr(uspriteptr_t spr, int32_t *height, int32_t alsotileyofs); +int32_t spriteheightofsptr(DCoreActor* spr, int32_t *height, int32_t alsotileyofs); int videoCaptureScreen(); diff --git a/source/build/src/clip.cpp b/source/build/src/clip.cpp index a74b61f05..ecd154116 100644 --- a/source/build/src/clip.cpp +++ b/source/build/src/clip.cpp @@ -607,7 +607,7 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect, case CSTAT_SPRITE_ALIGNMENT_FACING: if (p1.X >= clipMin.X && p1.X <= clipMax.X && p1.Y >= clipMin.Y && p1.Y <= clipMax.Y) { - int32_t height, daz = spr->pos.Z+spriteheightofsptr(spr, &height, 1); + int32_t height, daz = spr->pos.Z+spriteheightofsptr(actor, &height, 1); if (pos->Z > daz-height-flordist && pos->Z < daz+ceildist) { @@ -623,7 +623,7 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect, case CSTAT_SPRITE_ALIGNMENT_WALL: { - int32_t height, daz = spr->pos.Z+spriteheightofsptr(spr, &height, 1); + int32_t height, daz = spr->pos.Z+spriteheightofsptr(actor, &height, 1); if (pos->Z > daz-height-flordist && pos->Z < daz+ceildist) { @@ -1150,7 +1150,7 @@ void getzrange(const vec3_t& pos, sectortype* sect, int32_t* ceilz, CollisionBas int32_t k = walldist+(spr->clipdist<<2)+1; if ((abs(v1.X-pos.X) <= k) && (abs(v1.Y-pos.Y) <= k)) { - daz = spr->pos.Z + spriteheightofsptr(spr, &k, 1); + daz = spr->pos.Z + spriteheightofsptr(actor, &k, 1); daz2 = daz - k; clipyou = 1; } @@ -1165,7 +1165,7 @@ void getzrange(const vec3_t& pos, sectortype* sect, int32_t* ceilz, CollisionBas if (clipinsideboxline(pos.X,pos.Y,v1.X,v1.Y,v2.X,v2.Y,walldist+1) != 0) { int32_t k; - daz = spr->pos.Z + spriteheightofsptr(spr, &k, 1); + daz = spr->pos.Z + spriteheightofsptr(actor, &k, 1); daz2 = daz-k; clipyou = 1; } @@ -1235,7 +1235,7 @@ int32_t try_facespr_intersect(DCoreActor* spr, vec3_t const in, vec3_t newpos = { 0, 0, in.Z + Scale(vz, topt, bot) }; int32_t siz; - int32_t const z1 = sprpos.Z + spriteheightofsptr(&spr->spr, &siz, 1); + int32_t const z1 = sprpos.Z + spriteheightofsptr(spr, &siz, 1); if (newpos.Z < z1 - siz || newpos.Z > z1) return 0; @@ -1447,7 +1447,7 @@ int hitscan(const vec3_t& start, const sectortype* startsect, const vec3_t& dire if (abs(intx-sv->X)+abs(inty-sv->Y) > abs((hitinfo.hitpos.X)-sv->X)+abs((hitinfo.hitpos.Y)-sv->Y)) continue; - daz = spr->pos.Z + spriteheightofsptr(&actor->spr, &k, 1); + daz = spr->pos.Z + spriteheightofsptr(actor, &k, 1); if (intz > daz-k && intz < daz) { if (picanm[tilenum].sf&PICANM_TEXHITSCAN_BIT) diff --git a/source/build/src/engine.cpp b/source/build/src/engine.cpp index 8a4b5e946..76c74bdff 100644 --- a/source/build/src/engine.cpp +++ b/source/build/src/engine.cpp @@ -410,16 +410,16 @@ int32_t getangle(int32_t xvect, int32_t yvect) // Gets the BUILD unit height and z offset of a sprite. // Returns the z offset, 'height' may be NULL. -int32_t spriteheightofsptr(uspriteptr_t spr, int32_t *height, int32_t alsotileyofs) +int32_t spriteheightofsptr(DCoreActor* spr, int32_t *height, int32_t alsotileyofs) { int32_t hei, zofs=0; - const int32_t picnum=spr->picnum, yrepeat=spr->yrepeat; + const int32_t picnum=spr->spr.picnum, yrepeat=spr->spr.yrepeat; hei = (tileHeight(picnum)*yrepeat)<<2; if (height != NULL) *height = hei; - if (spr->cstat & CSTAT_SPRITE_YCENTER) + if (spr->spr.cstat & CSTAT_SPRITE_YCENTER) zofs = hei>>1; // NOTE: a positive per-tile yoffset translates the sprite into the