mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-25 11:10:47 +00:00
Correctly (I hope) handle the zoom argument of rotatesprite when drawing HUD models in Polymer.
git-svn-id: https://svn.eduke32.com/eduke32@1703 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
3d31f645fb
commit
1d28272c4a
2 changed files with 8 additions and 1 deletions
|
@ -3524,15 +3524,20 @@ static void polymer_drawmdsprite(spritetype *tspr)
|
||||||
scale *= m->bscale;
|
scale *= m->bscale;
|
||||||
|
|
||||||
if (tspriteptr[MAXSPRITESONSCREEN] == tspr) {
|
if (tspriteptr[MAXSPRITESONSCREEN] == tspr) {
|
||||||
float radplayerang, cosminusradplayerang, sinminusradplayerang;
|
float playerang, radplayerang, cosminusradplayerang, sinminusradplayerang, hudzoom;
|
||||||
|
|
||||||
|
playerang = (globalang & 2047) / (2048.0f / 360.0f) - 90.0f;
|
||||||
radplayerang = (globalang & 2047) * 2.0f * PI / 2048.0f;
|
radplayerang = (globalang & 2047) * 2.0f * PI / 2048.0f;
|
||||||
cosminusradplayerang = cos(-radplayerang);
|
cosminusradplayerang = cos(-radplayerang);
|
||||||
sinminusradplayerang = sin(-radplayerang);
|
sinminusradplayerang = sin(-radplayerang);
|
||||||
|
hudzoom = 65536.0 / spriteext[tspr->owner].zoff;
|
||||||
|
|
||||||
bglTranslatef(spos[0], spos[1], spos[2]);
|
bglTranslatef(spos[0], spos[1], spos[2]);
|
||||||
bglRotatef(horizang, -cosminusradplayerang, 0.0f, sinminusradplayerang);
|
bglRotatef(horizang, -cosminusradplayerang, 0.0f, sinminusradplayerang);
|
||||||
bglRotatef(spriteext[tspr->owner].roll / (2048.0f / 360.0f), sinminusradplayerang, 0.0f, cosminusradplayerang);
|
bglRotatef(spriteext[tspr->owner].roll / (2048.0f / 360.0f), sinminusradplayerang, 0.0f, cosminusradplayerang);
|
||||||
|
bglRotatef(-playerang, 0.0f, 1.0f, 0.0f);
|
||||||
|
bglScalef(hudzoom, 1.0f, 1.0f);
|
||||||
|
bglRotatef(playerang, 0.0f, 1.0f, 0.0f);
|
||||||
bglTranslatef(spos2[0], spos2[1], spos2[2]);
|
bglTranslatef(spos2[0], spos2[1], spos2[2]);
|
||||||
bglRotatef(-ang, 0.0f, 1.0f, 0.0f);
|
bglRotatef(-ang, 0.0f, 1.0f, 0.0f);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -5339,9 +5339,11 @@ void polymost_dorotatesprite(int32_t sx, int32_t sy, int32_t z, int16_t a, int16
|
||||||
bglEnable(GL_BLEND);
|
bglEnable(GL_BLEND);
|
||||||
|
|
||||||
spriteext[tspr.owner].roll = a;
|
spriteext[tspr.owner].roll = a;
|
||||||
|
spriteext[tspr.owner].zoff = z;
|
||||||
|
|
||||||
polymer_drawsprite(MAXSPRITESONSCREEN);
|
polymer_drawsprite(MAXSPRITESONSCREEN);
|
||||||
|
|
||||||
|
spriteext[tspr.owner].zoff = 0;
|
||||||
spriteext[tspr.owner].roll = 0;
|
spriteext[tspr.owner].roll = 0;
|
||||||
|
|
||||||
bglDisable(GL_BLEND);
|
bglDisable(GL_BLEND);
|
||||||
|
|
Loading…
Reference in a new issue