Skip to content

Commit

Permalink
engine: client: vgui: deprecate VGUI_CreateTexture and VGUI_UploadTex…
Browse files Browse the repository at this point in the history
…tureBlock functions, as they never used by vgui_support module

* vgui_support used them in old engine for font cache, but we don't have that anymore.
  • Loading branch information
a1batross committed Dec 30, 2024
1 parent 08c2632 commit ce4148f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 29 deletions.
31 changes: 4 additions & 27 deletions engine/client/vgui/vgui_draw.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,38 +96,15 @@ static void GAME_EXPORT VGUI_UploadTexture( int id, const char *buffer, int widt

static void GAME_EXPORT VGUI_CreateTexture( int id, int width, int height )
{
rgbdata_t r_image = { 0 };
char texName[32];

if( id <= 0 || id >= VGUI_MAX_TEXTURES )
{
Con_DPrintf( S_ERROR "%s: bad texture %i. Ignored\n", __func__, id );
return;
}

Q_snprintf( texName, sizeof( texName ), "*vgui%i", id );

r_image.width = width;
r_image.height = height;
r_image.type = PF_RGBA_32;
r_image.size = width * height * 4;
r_image.flags = IMAGE_HAS_COLOR|IMAGE_HAS_ALPHA;
r_image.buffer = NULL;
// nothing uses it, it can be removed
Host_Error( "%s: deprecated\n", __func__ );

vgui.textures[id] = GL_LoadTextureInternal( texName, &r_image, TF_IMAGE );
vgui.bound_texture = id;
}

static void GAME_EXPORT VGUI_UploadTextureBlock( int id, int drawX, int drawY, const byte *rgba, int blockWidth, int blockHeight )
{
if( id <= 0 || id >= VGUI_MAX_TEXTURES || vgui.textures[id] == 0 )
{
Con_DPrintf( S_ERROR "%s: bad texture %i. Ignored\n", __func__, id );
return;
}

ref.dllFuncs.VGUI_UploadTextureBlock( drawX, drawY, rgba, blockWidth, blockHeight );
vgui.bound_texture = id;
// nothing uses it, it can be removed
Host_Error( "%s: deprecated\n", __func__ );
}

static void GAME_EXPORT VGUI_BindTexture( int id )
Expand Down
4 changes: 2 additions & 2 deletions engine/vgui_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,9 @@ typedef struct vguiapi_s
void (*SetupDrawingImage)( int *pColor );
void (*BindTexture)( int id );
void (*EnableTexture)( qboolean enable );
void (*CreateTexture)( int id, int width, int height );
void (*Reserved0)( int id, int width, int height );
void (*UploadTexture)( int id, const char *buffer, int width, int height );
void (*UploadTextureBlock)( int id, int drawX, int drawY, const byte *rgba, int blockWidth, int blockHeight );
void (*Reserved1)( int id, int drawX, int drawY, const byte *rgba, int blockWidth, int blockHeight );
void (*DrawQuad)( const vpoint_t *ul, const vpoint_t *lr );
void (*GetTextureSizes)( int *width, int *height );
int (*GenerateTexture)( void );
Expand Down

0 comments on commit ce4148f

Please sign in to comment.