From 1d28272c4aa23f1537fc119bd37ec20cb0514f18 Mon Sep 17 00:00:00 2001 From: plagman Date: Thu, 26 Aug 2010 15:27:16 +0000 Subject: [PATCH] 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 --- polymer/eduke32/build/src/polymer.c | 7 ++++++- polymer/eduke32/build/src/polymost.c | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/polymer/eduke32/build/src/polymer.c b/polymer/eduke32/build/src/polymer.c index 844ba0d1d..2a8bf116a 100644 --- a/polymer/eduke32/build/src/polymer.c +++ b/polymer/eduke32/build/src/polymer.c @@ -3524,15 +3524,20 @@ static void polymer_drawmdsprite(spritetype *tspr) scale *= m->bscale; 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; cosminusradplayerang = cos(-radplayerang); sinminusradplayerang = sin(-radplayerang); + hudzoom = 65536.0 / spriteext[tspr->owner].zoff; bglTranslatef(spos[0], spos[1], spos[2]); bglRotatef(horizang, -cosminusradplayerang, 0.0f, sinminusradplayerang); 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]); bglRotatef(-ang, 0.0f, 1.0f, 0.0f); } else { diff --git a/polymer/eduke32/build/src/polymost.c b/polymer/eduke32/build/src/polymost.c index 9f5c2ce32..ebb212665 100644 --- a/polymer/eduke32/build/src/polymost.c +++ b/polymer/eduke32/build/src/polymost.c @@ -5339,9 +5339,11 @@ void polymost_dorotatesprite(int32_t sx, int32_t sy, int32_t z, int16_t a, int16 bglEnable(GL_BLEND); spriteext[tspr.owner].roll = a; + spriteext[tspr.owner].zoff = z; polymer_drawsprite(MAXSPRITESONSCREEN); + spriteext[tspr.owner].zoff = 0; spriteext[tspr.owner].roll = 0; bglDisable(GL_BLEND);