- changed sprite argument in spriteheightofsptr to DCoreActor.

This commit is contained in:
Christoph Oelckers 2021-12-30 11:31:45 +01:00
parent 7676958f40
commit 17736d1d5e
3 changed files with 10 additions and 10 deletions

View file

@ -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();

View file

@ -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)

View file

@ -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