2
0
mirror of https://github.com/FWGS/xash3d-fwgs synced 2024-11-25 19:30:08 +01:00

ref: restore missing PARM_TEX_MEMORY RenderAPI parameter

This commit is contained in:
Alibek Omarov 2023-10-06 19:24:02 +03:00
parent 34fa1b5ec8
commit a738b2a50b
6 changed files with 42 additions and 1 deletions

View File

@ -212,6 +212,8 @@ static int GL_RefGetParm( int parm, int arg )
case PARM_TEX_FLAGS:
glt = R_GetTexture( arg );
return glt->flags;
case PARM_TEX_MEMORY:
return GL_TexMemory();
case PARM_ACTIVE_TMU:
return glState.activeTMU;
case PARM_LIGHTSTYLEVALUE:

View File

@ -1607,7 +1607,7 @@ int GL_LoadTextureArray( const char **names, int flags )
len += ret;
}
COM_FileBase( names[i], basename, sizeof( basename ));
ret = Q_snprintf( &name[len], sizeof( name ) - len, "%s[%i]", basename, numLayers );
@ -1943,6 +1943,23 @@ void GL_ProcessTexture( int texnum, float gamma, int topColor, int bottomColor )
gEngfuncs.FS_FreeImage( pic );
}
/*
================
GL_TexMemory
return size of all uploaded textures
================
*/
int GL_TexMemory( void )
{
int i, total = 0;
for( i = 0; i < gl_numTextures; i++ )
total += gl_textures[i].size;
return total;
}
/*
==============================================================================

View File

@ -366,6 +366,7 @@ void R_InitDlightTexture( void );
void R_TextureList_f( void );
void R_InitImages( void );
void R_ShutdownImages( void );
int GL_TexMemory( void );
//
// gl_rlight.c

View File

@ -147,6 +147,8 @@ static int GL_RefGetParm( int parm, int arg )
case PARM_TEX_FLAGS:
glt = R_GetTexture( arg );
return glt->flags;
case PARM_TEX_MEMORY:
return R_TexMemory();
case PARM_ACTIVE_TMU:
return 0; //glState.activeTMU;
case PARM_LIGHTSTYLEVALUE:

View File

@ -1199,6 +1199,23 @@ void GAME_EXPORT GL_ProcessTexture( int texnum, float gamma, int topColor, int b
gEngfuncs.FS_FreeImage( pic );
}
/*
================
R_TexMemory
return size of all uploaded textures
================
*/
int R_TexMemory( void )
{
int i, total = 0;
for( i = 0; i < r_numImages; i++ )
total += r_images[i].size;
return total;
}
/*
==============================================================================

View File

@ -448,6 +448,8 @@ void R_InitDlightTexture( void );
void R_TextureList_f( void );
void R_InitImages( void );
void R_ShutdownImages( void );
int R_TexMemory( void );
#if 1
//
// gl_rlight.c