Corrects polymost rotation offset scale (didn't match build units before) and a bug in the polymer offset code (bug 2783065).

git-svn-id: https://svn.eduke32.com/eduke32@1376 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
plagman 2009-05-10 19:19:25 +00:00
parent 77e873b476
commit 1b948be858
2 changed files with 5 additions and 5 deletions

View file

@ -1733,15 +1733,15 @@ static int32_t md3draw(md3model_t *m, spritetype *tspr)
if (spriteext[tspr->owner].pitch || spriteext[tspr->owner].roll || m->head.flags == 1337) if (spriteext[tspr->owner].pitch || spriteext[tspr->owner].roll || m->head.flags == 1337)
{ {
if (spriteext[tspr->owner].xoff) if (spriteext[tspr->owner].xoff)
a0.x = (int32_t)(spriteext[tspr->owner].xoff / (2048 * (m0.x+m1.x))); a0.x = (int32_t)(spriteext[tspr->owner].xoff / (2560 * (m0.x+m1.x)));
else else
a0.x = 0; a0.x = 0;
if (spriteext[tspr->owner].yoff) if (spriteext[tspr->owner].yoff)
a0.y = (int32_t)(spriteext[tspr->owner].yoff / (2048 * (m0.x+m1.x))); a0.y = (int32_t)(spriteext[tspr->owner].yoff / (2560 * (m0.x+m1.x)));
else else
a0.y = 0; a0.y = 0;
if ((spriteext[tspr->owner].zoff) && !(tspr->cstat&1024)) if ((spriteext[tspr->owner].zoff) && !(tspr->cstat&1024))
a0.z = (int32_t)(spriteext[tspr->owner].zoff / (524288 * (m0.z+m1.z))); a0.z = (int32_t)(spriteext[tspr->owner].zoff / (655360 * (m0.z+m1.z)));
else else
a0.z = 0; a0.z = 0;
k0 = (float)sintable[(spriteext[tspr->owner].pitch+512)&2047] / 16384.0; k0 = (float)sintable[(spriteext[tspr->owner].pitch+512)&2047] / 16384.0;

View file

@ -3036,8 +3036,8 @@ static void polymer_drawmdsprite(spritetype *tspr)
pitchang = (float)(spriteext[tspr->owner].pitch) / (2048.0f / 360.0f); pitchang = (float)(spriteext[tspr->owner].pitch) / (2048.0f / 360.0f);
rollang = (float)(spriteext[tspr->owner].roll) / (2048.0f / 360.0f); rollang = (float)(spriteext[tspr->owner].roll) / (2048.0f / 360.0f);
offsets[0] = spriteext[tspr->owner].xoff / (scale * tspr->xrepeat); offsets[0] = -spriteext[tspr->owner].xoff / (scale * tspr->xrepeat);
offsets[1] = spriteext[tspr->owner].yoff / (scale * tspr->xrepeat); offsets[1] = -spriteext[tspr->owner].yoff / (scale * tspr->xrepeat);
offsets[2] = (float)(spriteext[tspr->owner].zoff) / 16.0f / (scale * tspr->yrepeat); offsets[2] = (float)(spriteext[tspr->owner].zoff) / 16.0f / (scale * tspr->yrepeat);
bglTranslatef(-offsets[0], -offsets[1], -offsets[2]); bglTranslatef(-offsets[0], -offsets[1], -offsets[2]);