mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-12 16:18:01 +00:00
ref: add R_GammaChanged function that engine calls on every gamma change
This commit is contained in:
parent
c0757bd84c
commit
a0c31120d9
@ -463,6 +463,7 @@ typedef struct ref_interface_s
|
|||||||
void (*GL_ClearExtensions)( void );
|
void (*GL_ClearExtensions)( void );
|
||||||
|
|
||||||
// scene rendering
|
// scene rendering
|
||||||
|
void (*R_GammaChanged)( qboolean do_reset_gamma );
|
||||||
void (*R_BeginFrame)( qboolean clearScene );
|
void (*R_BeginFrame)( qboolean clearScene );
|
||||||
void (*R_RenderScene)( void );
|
void (*R_RenderScene)( void );
|
||||||
void (*R_EndFrame)( void );
|
void (*R_EndFrame)( void );
|
||||||
|
@ -372,6 +372,7 @@ ref_interface_t gReffuncs =
|
|||||||
GL_InitExtensions,
|
GL_InitExtensions,
|
||||||
GL_ClearExtensions,
|
GL_ClearExtensions,
|
||||||
|
|
||||||
|
R_GammaChanged,
|
||||||
R_BeginFrame,
|
R_BeginFrame,
|
||||||
R_RenderScene,
|
R_RenderScene,
|
||||||
R_EndFrame,
|
R_EndFrame,
|
||||||
|
@ -402,7 +402,6 @@ void R_AllowFog( qboolean allowed );
|
|||||||
qboolean R_OpaqueEntity( cl_entity_t *ent );
|
qboolean R_OpaqueEntity( cl_entity_t *ent );
|
||||||
void R_SetupFrustum( void );
|
void R_SetupFrustum( void );
|
||||||
void R_FindViewLeaf( void );
|
void R_FindViewLeaf( void );
|
||||||
void R_CheckGamma( void );
|
|
||||||
void R_PushScene( void );
|
void R_PushScene( void );
|
||||||
void R_PopScene( void );
|
void R_PopScene( void );
|
||||||
void R_DrawFog( void );
|
void R_DrawFog( void );
|
||||||
@ -534,6 +533,7 @@ int GL_LoadTexture( const char *name, const byte *buf, size_t size, int flags );
|
|||||||
void GL_FreeImage( const char *name );
|
void GL_FreeImage( const char *name );
|
||||||
qboolean VID_ScreenShot( const char *filename, int shot_type );
|
qboolean VID_ScreenShot( const char *filename, int shot_type );
|
||||||
qboolean VID_CubemapShot( const char *base, uint size, const float *vieworg, qboolean skyshot );
|
qboolean VID_CubemapShot( const char *base, uint size, const float *vieworg, qboolean skyshot );
|
||||||
|
void R_GammaChanged( qboolean do_reset_gamma );
|
||||||
void R_BeginFrame( qboolean clearScene );
|
void R_BeginFrame( qboolean clearScene );
|
||||||
void R_RenderFrame( const struct ref_viewpass_s *vp );
|
void R_RenderFrame( const struct ref_viewpass_s *vp );
|
||||||
void R_EndFrame( void );
|
void R_EndFrame( void );
|
||||||
|
@ -985,6 +985,22 @@ void R_RenderScene( void )
|
|||||||
R_EndGL();
|
R_EndGL();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void R_GammaChanged( qboolean do_reset_gamma )
|
||||||
|
{
|
||||||
|
if( do_reset_gamma )
|
||||||
|
{
|
||||||
|
// paranoia cubemap rendering
|
||||||
|
if( gEngfuncs.drawFuncs->GL_BuildLightmaps )
|
||||||
|
gEngfuncs.drawFuncs->GL_BuildLightmaps( );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
glConfig.softwareGammaUpdate = true;
|
||||||
|
GL_RebuildLightmaps();
|
||||||
|
glConfig.softwareGammaUpdate = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
===============
|
===============
|
||||||
R_BeginFrame
|
R_BeginFrame
|
||||||
|
@ -418,6 +418,7 @@ ref_interface_t gReffuncs =
|
|||||||
GL_InitExtensions,
|
GL_InitExtensions,
|
||||||
GL_ClearExtensions,
|
GL_ClearExtensions,
|
||||||
|
|
||||||
|
R_GammaChanged,
|
||||||
R_BeginFrame,
|
R_BeginFrame,
|
||||||
R_RenderScene,
|
R_RenderScene,
|
||||||
R_EndFrame,
|
R_EndFrame,
|
||||||
|
@ -607,6 +607,7 @@ int GL_LoadTexture( const char *name, const byte *buf, size_t size, int flags );
|
|||||||
void GL_FreeImage( const char *name );
|
void GL_FreeImage( const char *name );
|
||||||
qboolean VID_ScreenShot( const char *filename, int shot_type );
|
qboolean VID_ScreenShot( const char *filename, int shot_type );
|
||||||
qboolean VID_CubemapShot( const char *base, uint size, const float *vieworg, qboolean skyshot );
|
qboolean VID_CubemapShot( const char *base, uint size, const float *vieworg, qboolean skyshot );
|
||||||
|
void R_GammaChanged( qboolean do_reset_gamma );
|
||||||
void R_BeginFrame( qboolean clearScene );
|
void R_BeginFrame( qboolean clearScene );
|
||||||
void R_RenderFrame( const struct ref_viewpass_s *vp );
|
void R_RenderFrame( const struct ref_viewpass_s *vp );
|
||||||
void R_EndFrame( void );
|
void R_EndFrame( void );
|
||||||
|
@ -1636,6 +1636,14 @@ qboolean R_DoResetGamma( void )
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void R_GammaChanged( qboolean do_reset_gamma )
|
||||||
|
{
|
||||||
|
if( do_reset_gamma ) // unused
|
||||||
|
return;
|
||||||
|
|
||||||
|
D_FlushCaches( );
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
===============
|
===============
|
||||||
R_BeginFrame
|
R_BeginFrame
|
||||||
|
Loading…
Reference in New Issue
Block a user