mirror of
https://github.com/DrBeef/ioq3quest.git
synced 2024-11-10 06:41:58 +00:00
Optimize vignette rendering
This commit is contained in:
parent
950f36de85
commit
2d0f0a3330
3 changed files with 9 additions and 6 deletions
|
@ -2623,14 +2623,19 @@ static void CG_DrawVignette( void )
|
|||
int y = (int)(0 + currentComfortVignetteValue * cg.refdef.height / 3.5f);
|
||||
int h = (int)(cg.refdef.height - 2 * y);
|
||||
|
||||
vec4_t black = {0.0, 0.0, 0.0, 1};
|
||||
trap_R_SetColor( black );
|
||||
|
||||
// sides
|
||||
trap_R_DrawStretchPic( 0, 0, x, cg.refdef.height, 0, 0, 1, 1, cgs.media.maskShader );
|
||||
trap_R_DrawStretchPic( cg.refdef.width - x, 0, x, cg.refdef.height, 0, 0, 1, 1, cgs.media.maskShader );
|
||||
trap_R_DrawStretchPic( 0, 0, x, cg.refdef.height, 0, 0, 1, 1, cgs.media.whiteShader );
|
||||
trap_R_DrawStretchPic( cg.refdef.width - x, 0, x, cg.refdef.height, 0, 0, 1, 1, cgs.media.whiteShader );
|
||||
// top/bottom
|
||||
trap_R_DrawStretchPic( x, 0, cg.refdef.width - x, y, 0, 0, 1, 1, cgs.media.maskShader );
|
||||
trap_R_DrawStretchPic( x, cg.refdef.height - y, cg.refdef.width - x, y, 0, 0, 1, 1, cgs.media.maskShader );
|
||||
trap_R_DrawStretchPic( x, 0, cg.refdef.width - x, y, 0, 0, 1, 1, cgs.media.whiteShader );
|
||||
trap_R_DrawStretchPic( x, cg.refdef.height - y, cg.refdef.width - x, y, 0, 0, 1, 1, cgs.media.whiteShader );
|
||||
// vignette
|
||||
trap_R_DrawStretchPic( x, y, w, h, 0, 0, 1, 1, cgs.media.vignetteShader );
|
||||
|
||||
trap_R_SetColor( NULL );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1012,7 +1012,6 @@ typedef struct {
|
|||
|
||||
// comfort vignette
|
||||
qhandle_t vignetteShader;
|
||||
qhandle_t maskShader;
|
||||
} cgMedia_t;
|
||||
|
||||
|
||||
|
|
|
@ -1052,7 +1052,6 @@ static void CG_RegisterGraphics( void ) {
|
|||
//Load from pakQ3Q
|
||||
cgs.media.reticleShader = trap_R_RegisterShader( "gfx/weapon/scope" );
|
||||
cgs.media.vignetteShader = trap_R_RegisterShader( "gfx/vignette" );
|
||||
cgs.media.maskShader = trap_R_RegisterShader( "gfx/mask" );
|
||||
|
||||
//Used for the weapon selector
|
||||
cgs.media.smallSphereModel = trap_R_RegisterModel("models/powerups/health/small_sphere.md3");
|
||||
|
|
Loading…
Reference in a new issue