Browse Source

engine: patched to compile, moved gl_clear to engine

pull/2/head
Alibek Omarov 6 years ago
parent
commit
3ae7ecaeb3
  1. 2
      engine/client/ref_common.c
  2. 1
      engine/client/ref_common.h
  3. 41
      engine/common/mod_bmodel.c
  4. 6
      engine/common/model.c
  5. 2
      ref_gl/gl_image.c
  6. 2
      ref_gl/gl_opengl.c
  7. 8
      ref_gl/gl_rmain.c

2
engine/client/ref_common.c

@ -13,6 +13,7 @@ convar_t *gl_showtextures; @@ -13,6 +13,7 @@ convar_t *gl_showtextures;
convar_t *r_decals;
convar_t *r_adjust_fov;
convar_t *gl_wgl_msaa_samples;
convar_t *gl_clear;
void R_GetTextureParms( int *w, int *h, int texnum )
{
@ -540,6 +541,7 @@ qboolean R_Init( void ) @@ -540,6 +541,7 @@ qboolean R_Init( void )
r_adjust_fov = Cvar_Get( "r_adjust_fov", "1", FCVAR_ARCHIVE, "making FOV adjustment for wide-screens" );
r_decals = Cvar_Get( "r_decals", "4096", FCVAR_ARCHIVE, "sets the maximum number of decals" );
gl_wgl_msaa_samples = Cvar_Get( "gl_wgl_msaa_samples", "0", FCVAR_GLCONFIG, "samples number for multisample anti-aliasing" );
gl_clear = Cvar_Get( "gl_clear", "0", FCVAR_ARCHIVE, "clearing screen after each frame" );
if( !R_LoadProgs( refdll ))
{

1
engine/client/ref_common.h

@ -43,6 +43,7 @@ void GL_RenderFrame( const struct ref_viewpass_s *rvp ); @@ -43,6 +43,7 @@ void GL_RenderFrame( const struct ref_viewpass_s *rvp );
// common engine and renderer cvars
extern convar_t *r_decals;
extern convar_t *r_adjust_fov;
extern convar_t *gl_clear;
qboolean R_Init( void );
void R_Shutdown( void );

41
engine/common/mod_bmodel.c

@ -2928,47 +2928,6 @@ void Mod_LoadBrushModel( model_t *mod, const void *buffer, qboolean *loaded ) @@ -2928,47 +2928,6 @@ void Mod_LoadBrushModel( model_t *mod, const void *buffer, qboolean *loaded )
if( loaded ) *loaded = true; // all done
}
/*
=================
Mod_UnloadBrushModel
Release all uploaded textures
=================
*/
void Mod_UnloadBrushModel( model_t *mod )
{
texture_t *tx;
int i;
Assert( mod != NULL );
if( mod->type != mod_brush )
return; // not a bmodel
// invalidate pointers
if( FBitSet( mod->flags, MODEL_WORLD ))
{
world.deluxedata = NULL;
world.shadowdata = NULL;
}
if( mod->name[0] != '*' )
{
for( i = 0; i < mod->numtextures; i++ )
{
tx = mod->textures[i];
if( !tx || tx->gl_texturenum == tr.defaultTexture )
continue; // free slot
GL_FreeTexture( tx->gl_texturenum ); // main texture
GL_FreeTexture( tx->fb_texturenum ); // luma texture
}
Mem_FreePool( &mod->mempool );
}
memset( mod, 0, sizeof( *mod ));
}
/*
==================
Mod_CheckLump

6
engine/common/model.c

@ -110,6 +110,12 @@ void Mod_FreeModel( model_t *mod ) @@ -110,6 +110,12 @@ void Mod_FreeModel( model_t *mod )
Mem_FreePool( &mod->mempool );
}
if( mod->type == mod_brush && FBitSet( mod->flags, MODEL_WORLD ) )
{
world.shadowdata = NULL;
world.deluxedata = NULL;
}
memset( mod, 0, sizeof( *mod ));
}

2
ref_gl/gl_image.c

@ -75,7 +75,7 @@ void GL_Bind( GLint tmu, GLenum texnum ) @@ -75,7 +75,7 @@ void GL_Bind( GLint tmu, GLenum texnum )
if( texnum <= 0 || texnum >= MAX_TEXTURES )
{
if( texnum != 0 )
Con_DPrintf( S_ERROR "GL_Bind: invalid texturenum %d\n", texnum );
gEngfuncs.Con_DPrintf( S_ERROR "GL_Bind: invalid texturenum %d\n", texnum );
texnum = tr.defaultTexture;
}
if( tmu != GL_KEEP_UNIT )

2
ref_gl/gl_opengl.c

@ -809,7 +809,7 @@ void GL_InitCommands( void ) @@ -809,7 +809,7 @@ void GL_InitCommands( void )
gl_showtextures = gEngfuncs.pfnGetCvarPointer( "r_showtextures", 0 );
gl_finish = gEngfuncs.Cvar_Get( "gl_finish", "0", FCVAR_ARCHIVE, "use glFinish instead of glFlush" );
gl_nosort = gEngfuncs.Cvar_Get( "gl_nosort", "0", FCVAR_ARCHIVE, "disable sorting of translucent surfaces" );
gl_clear = gEngfuncs.Cvar_Get( "gl_clear", "0", FCVAR_ARCHIVE, "clearing screen after each frame" );
gl_clear = gEngfuncs.pfnGetCvarPointer( "gl_clear", 0 );
gl_test = gEngfuncs.Cvar_Get( "gl_test", "0", 0, "engine developer cvar for quick testing new features" );
gl_wireframe = gEngfuncs.Cvar_Get( "gl_wireframe", "0", FCVAR_ARCHIVE|FCVAR_SPONLY, "show wireframe overlay" );
gl_msaa = gEngfuncs.Cvar_Get( "gl_msaa", "1", FCVAR_ARCHIVE, "enable or disable multisample anti-aliasing" );

8
ref_gl/gl_rmain.c

@ -994,15 +994,15 @@ void R_CheckGamma( void ) @@ -994,15 +994,15 @@ void R_CheckGamma( void )
if( gEngfuncs.R_DoResetGamma( ))
{
// paranoia cubemaps uses this
BuildGammaTable( 1.8f, 0.0f );
gEngfuncs.BuildGammaTable( 1.8f, 0.0f );
// paranoia cubemap rendering
if( clgame.drawFuncs.GL_BuildLightmaps )
clgame.drawFuncs.GL_BuildLightmaps( );
if( gEngfuncs.drawFuncs->GL_BuildLightmaps )
gEngfuncs.drawFuncs->GL_BuildLightmaps( );
}
else if( FBitSet( vid_gamma->flags, FCVAR_CHANGED ) || FBitSet( vid_brightness->flags, FCVAR_CHANGED ))
{
BuildGammaTable( vid_gamma->value, vid_brightness->value );
gEngfuncs.BuildGammaTable( vid_gamma->value, vid_brightness->value );
glConfig.softwareGammaUpdate = true;
GL_RebuildLightmaps();
glConfig.softwareGammaUpdate = false;

Loading…
Cancel
Save