add new SPR_OVERHEAD (ident 7), a derivative of SPR_VP_PARALLEL with couple of hacks...
authorvortex <vortex@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 11 Jan 2010 20:17:06 +0000 (20:17 +0000)
committervortex <vortex@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 11 Jan 2010 20:17:06 +0000 (20:17 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9826 d7cf8633-e32d-0410-b094-e92efae38249

r_sprites.c
spritegn.h

index 654d1b6..f848292 100644 (file)
@@ -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
index 26edb1a..b2d2e3b 100644 (file)
@@ -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