From ce4148f351a70fefcf48aa86cfac2b94d4581d00 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Mon, 30 Dec 2024 07:13:35 +0300 Subject: [PATCH] engine: client: vgui: deprecate VGUI_CreateTexture and VGUI_UploadTextureBlock 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. --- engine/client/vgui/vgui_draw.c | 31 ++++--------------------------- engine/vgui_api.h | 4 ++-- 2 files changed, 6 insertions(+), 29 deletions(-) diff --git a/engine/client/vgui/vgui_draw.c b/engine/client/vgui/vgui_draw.c index 462560f3d0..abbbea6997 100644 --- a/engine/client/vgui/vgui_draw.c +++ b/engine/client/vgui/vgui_draw.c @@ -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 ) diff --git a/engine/vgui_api.h b/engine/vgui_api.h index 2412d76d03..e5a6c21807 100644 --- a/engine/vgui_api.h +++ b/engine/vgui_api.h @@ -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 );