mirror of
https://github.com/ZDoom/Raze.git
synced 2025-05-30 08:51:08 +00:00
Implement rotate parameter for voxel definitions
# Conflicts: # source/build/include/build.h # source/build/include/mdsprite.h # source/build/src/defs.cpp
This commit is contained in:
parent
433fd62de5
commit
81f78c24b7
6 changed files with 33 additions and 15 deletions
|
@ -881,6 +881,7 @@ voxmodel_t *voxload(const char *filnam)
|
|||
vm->siz.x = voxsiz.x; vm->siz.y = voxsiz.y; vm->siz.z = voxsiz.z;
|
||||
vm->piv.x = voxpiv.x; vm->piv.y = voxpiv.y; vm->piv.z = voxpiv.z;
|
||||
vm->is8bit = is8bit;
|
||||
vm->rotate = 0;
|
||||
|
||||
vm->texid = (FHardwareTexture * *)Xcalloc(MAXPALOOKUPS, sizeof(FHardwareTexture*));
|
||||
}
|
||||
|
@ -1028,13 +1029,15 @@ int32_t polymost_voxdraw(voxmodel_t *m, tspriteptr_t const tspr)
|
|||
vec3f_t m0 = { m->scale, m->scale, m->scale };
|
||||
vec3f_t a0 = { 0, 0, m->zadd*m->scale };
|
||||
|
||||
int32_t const rotateang = m->rotate ? (int32_t)totalclocklock<<3 : 0;
|
||||
|
||||
k0 = m->bscale / 64.f;
|
||||
f = (float) tspr->xrepeat * (256.f/320.f) * k0;
|
||||
if ((sprite[tspr->owner].cstat&48)==16)
|
||||
{
|
||||
f *= 1.25f;
|
||||
a0.y -= tspr->xoffset*sintable[(spriteext[tspr->owner].angoff+512)&2047]*(1.f/(64.f*16384.f));
|
||||
a0.x += tspr->xoffset*sintable[spriteext[tspr->owner].angoff&2047]*(1.f/(64.f*16384.f));
|
||||
a0.y -= tspr->xoffset*sintable[(spriteext[tspr->owner].angoff+rotateang+512)&2047]*(1.f/(64.f*16384.f));
|
||||
a0.x += tspr->xoffset*sintable[(spriteext[tspr->owner].angoff+rotateang)&2047]*(1.f/(64.f*16384.f));
|
||||
}
|
||||
|
||||
if (globalorientation&8) { m0.z = -m0.z; a0.z = -a0.z; } //y-flipping
|
||||
|
@ -1068,7 +1071,7 @@ int32_t polymost_voxdraw(voxmodel_t *m, tspriteptr_t const tspr)
|
|||
m0.z *= g; a0.z = (((float)(k0 -globalposz - shadowHack)) * -(1.f/16384.f) + a0.z) * g;
|
||||
|
||||
float mat[16];
|
||||
md3_vox_calcmat_common(tspr, &a0, f, mat);
|
||||
md3_vox_calcmat_common(tspr, &a0, f, mat, rotateang);
|
||||
|
||||
//Mirrors
|
||||
if (grhalfxdown10x < 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue