cvar_t r_track_sprites_flags = {CVAR_SAVE, "r_track_sprites_flags", "1", "1: Rotate sprites accodringly, 2: Make it a continuous rotation"};
cvar_t r_track_sprites_scalew = {CVAR_SAVE, "r_track_sprites_scalew", "1", "width scaling of tracked sprites"};
cvar_t r_track_sprites_scaleh = {CVAR_SAVE, "r_track_sprites_scaleh", "1", "height scaling of tracked sprites"};
+cvar_t r_overheadsprites_perspective = {CVAR_SAVE, "r_overheadsprites_perspective", "0.15", "fake perspective effect for SPR_OVERHEAD sprites"};
+cvar_t r_overheadsprites_pushback = {CVAR_SAVE, "r_overheadsprites_pushback", "16", "how far to pull the SPR_OVERHEAD sprites toward the eye (used to avoid intersections with 3D models)"};
+
cvar_t r_glsl_saturation = {CVAR_SAVE, "r_glsl_saturation", "1", "saturation multiplier (only working in glsl!)"};
cvar_t r_framedatasize = {CVAR_SAVE, "r_framedatasize", "1", "size of renderer data cache used during one frame (for skeletal animation caching, light processing, etc)"};
Cvar_RegisterVariable(&r_track_sprites_flags);
Cvar_RegisterVariable(&r_track_sprites_scalew);
Cvar_RegisterVariable(&r_track_sprites_scaleh);
+ Cvar_RegisterVariable(&r_overheadsprites_perspective);
+ Cvar_RegisterVariable(&r_overheadsprites_pushback);
}
extern void R_Textures_Init(void);
extern cvar_t r_track_sprites_flags;
extern cvar_t r_track_sprites_scalew;
extern cvar_t r_track_sprites_scaleh;
+extern cvar_t r_overheadsprites_perspective;
+extern cvar_t r_overheadsprites_pushback;
#define TSF_ROTATE 1
#define TSF_ROTATE_CONTINOUSLY 2
VectorScale(r_refdef.view.left, ent->scale, left);
VectorScale(r_refdef.view.up, ent->scale, up);
// offset
+ VectorCopy(r_refdef.view.up, up);
+ up[2] = up[2] + r_overheadsprites_perspective.value; VectorNormalize(up); // some rotation
+ VectorScale(up, ent->scale, up);
+ // offset (move nearer to player, yz is camera plane)
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;
+ org[0] = org[0] + middle[0]*r_overheadsprites_pushback.value;
+ org[1] = org[1] + middle[1]*r_overheadsprites_pushback.value;
+ org[2] = org[2] + middle[2]*r_overheadsprites_pushback.value;
+ // simlulate a bit of perspective effect
+ up[2] = up[2] + r_overheadsprites_perspective.value;
break;
}