From: vortex Date: Mon, 11 Jan 2010 20:17:06 +0000 (+0000) Subject: add new SPR_OVERHEAD (ident 7), a derivative of SPR_VP_PARALLEL with couple of hacks... X-Git-Tag: xonotic-v0.1.0preview~821 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=4f20cd1f4d6675d34547e00b228c3bfb6efe3561;p=xonotic%2Fdarkplaces.git add new SPR_OVERHEAD (ident 7), a derivative of SPR_VP_PARALLEL with couple of hacks for better use with overhead-mode sprite monsters. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9826 d7cf8633-e32d-0410-b094-e92efae38249 ::stable-branch::merge=1da037208c1b4182279a5ffa979a1fe23ee89fc3 --- diff --git a/r_sprites.c b/r_sprites.c index 654d1b63..f8482926 100644 --- a/r_sprites.c +++ b/r_sprites.c @@ -353,6 +353,21 @@ void R_Model_Sprite_Draw_TransparentCallback(const entity_render_t *ent, const r up[1] = mup[0] * r_refdef.view.forward[1] + mup[1] * r_refdef.view.left[1] + mup[2] * r_refdef.view.up[1]; up[2] = mup[0] * r_refdef.view.forward[2] + mup[1] * r_refdef.view.left[2] + mup[2] * r_refdef.view.up[2]; break; + case SPR_OVERHEAD: + VectorScale(r_refdef.view.left, ent->scale, left); + VectorScale(r_refdef.view.up, ent->scale, up); + Con_Printf("mup: %f %f %f\n", mup[0], mup[1], mup[2]); + Con_Printf("mleft: %f %f %f\n", mleft[0], mleft[1], mleft[2]); + Con_Printf("m_forward: %f %f %f\n", mforward[0], mforward[1], mforward[2]); + // offset + VectorSubtract(r_refdef.view.origin, org, middle); + VectorNormalize(middle); + org[0] = org[0] + middle[0]*17; + org[1] = org[1] + middle[1]*17; + org[2] = org[2] + middle[2]*17; + // simlulate a bit of perspective effect + up[2] = up[2] + 0.15; + break; } // LordHavoc: interpolated sprite rendering diff --git a/spritegn.h b/spritegn.h index 26edb1a4..b2d2e3b1 100644 --- a/spritegn.h +++ b/spritegn.h @@ -100,6 +100,7 @@ typedef struct dsprite2_s #define SPR_VP_PARALLEL_ORIENTED 4 #define SPR_LABEL 5 #define SPR_LABEL_SCALE 6 +#define SPR_OVERHEAD 7 #define SPRHL_OPAQUE 0 #define SPRHL_ADDITIVE 1