From 76dae3595565f7b1a9c8c072345d148c84aec9fb Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Thu, 6 Jun 2019 04:34:28 +0300 Subject: [PATCH] ref: remove COM_HashKey API call --- engine/client/ref_common.c | 1 - engine/ref_api.h | 1 - ref_gl/gl_image.c | 8 ++++---- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/engine/client/ref_common.c b/engine/client/ref_common.c index 37948c21..6a49c315 100644 --- a/engine/client/ref_common.c +++ b/engine/client/ref_common.c @@ -271,7 +271,6 @@ static ref_api_t gEngfuncs = CL_UpdateRemapInfo, CL_ExtraUpdate, - COM_HashKey, Host_Error, COM_SetRandomSeed, COM_RandomFloat, diff --git a/engine/ref_api.h b/engine/ref_api.h index 21ea8c1a..9b0ec9e6 100644 --- a/engine/ref_api.h +++ b/engine/ref_api.h @@ -335,7 +335,6 @@ typedef struct ref_api_s // utils void (*CL_ExtraUpdate)( void ); - uint (*COM_HashKey)( const char *strings, uint hashSize ); void (*Host_Error)( const char *fmt, ... ); void (*COM_SetRandomSeed)( int lSeed ); float (*COM_RandomFloat)( float rmin, float rmax ); diff --git a/ref_gl/gl_image.c b/ref_gl/gl_image.c index 71bf502c..3e2271b2 100644 --- a/ref_gl/gl_image.c +++ b/ref_gl/gl_image.c @@ -14,7 +14,7 @@ GNU General Public License for more details. */ #include "gl_local.h" - +#include "crclib.h" #define TEXTURES_HASH_SIZE (MAX_TEXTURES >> 2) @@ -1310,7 +1310,7 @@ static gl_texture_t *GL_TextureForName( const char *name ) uint hash; // find the texture in array - hash = gEngfuncs.COM_HashKey( name, TEXTURES_HASH_SIZE ); + hash = COM_HashKey( name, TEXTURES_HASH_SIZE ); for( tex = gl_texturesHashTable[hash]; tex != NULL; tex = tex->nextHash ) { @@ -1352,7 +1352,7 @@ static gl_texture_t *GL_AllocTexture( const char *name, texFlags_t flags ) tex->flags = flags; // add to hash table - tex->hashValue = gEngfuncs.COM_HashKey( name, TEXTURES_HASH_SIZE ); + tex->hashValue = COM_HashKey( name, TEXTURES_HASH_SIZE ); tex->nextHash = gl_texturesHashTable[tex->hashValue]; gl_texturesHashTable[tex->hashValue] = tex; @@ -2207,7 +2207,7 @@ void R_InitImages( void ) // create unused 0-entry Q_strncpy( gl_textures->name, "*unused*", sizeof( gl_textures->name )); - gl_textures->hashValue = gEngfuncs.COM_HashKey( gl_textures->name, TEXTURES_HASH_SIZE ); + gl_textures->hashValue = COM_HashKey( gl_textures->name, TEXTURES_HASH_SIZE ); gl_textures->nextHash = gl_texturesHashTable[gl_textures->hashValue]; gl_texturesHashTable[gl_textures->hashValue] = gl_textures; gl_numTextures = 1;