From 9c4a0d2397d9343fef7322d6acbe6781f3989274 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Thu, 10 Oct 2019 05:03:37 +0300 Subject: [PATCH] ref_soft: context: upgrade to latest RefAPI --- r_context.c | 12 +++++++++++- r_image.c | 6 +++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/r_context.c b/r_context.c index e219d62c..da1fe085 100644 --- a/r_context.c +++ b/r_context.c @@ -446,10 +446,16 @@ void GAME_EXPORT GL_SetupAttributes( int safegl ) gEngfuncs.GL_SetAttribute( REF_GL_BLUE_SIZE, 5 ); } +const char *R_GetConfigName( void ) +{ + return "ref_soft"; // software specific cvars will go to ref_soft.cfg +} + ref_interface_t gReffuncs = { R_Init, R_Shutdown, + R_GetConfigName, GL_SetupAttributes, GL_InitExtensions, @@ -472,7 +478,6 @@ ref_interface_t gReffuncs = R_ProcessEntData, R_ShowTextures, - R_ShowTree, R_GetTextureOriginalBuffer, GL_LoadTextureFromBuffer, @@ -604,3 +609,8 @@ int EXPORT GAME_EXPORT GetRefAPI( int version, ref_interface_t *funcs, ref_api_t return REF_API_VERSION; } + +void EXPORT GetRefHumanReadableName( char *out, size_t size ) +{ + Q_strncpy( out, "Software", size ); +} diff --git a/r_image.c b/r_image.c index 90e9e6e6..c512a07a 100644 --- a/r_image.c +++ b/r_image.c @@ -829,7 +829,7 @@ static image_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 = r_imagesHashTable[hash]; tex != NULL; tex = tex->nextHash ) { @@ -870,7 +870,7 @@ static image_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 = r_imagesHashTable[tex->hashValue]; r_imagesHashTable[tex->hashValue] = tex; @@ -1380,7 +1380,7 @@ void R_InitImages( void ) // create unused 0-entry Q_strncpy( r_images->name, "*unused*", sizeof( r_images->name )); - r_images->hashValue = gEngfuncs.COM_HashKey( r_images->name, TEXTURES_HASH_SIZE ); + r_images->hashValue = COM_HashKey( r_images->name, TEXTURES_HASH_SIZE ); r_images->nextHash = r_imagesHashTable[r_images->hashValue]; r_imagesHashTable[r_images->hashValue] = r_images; r_numImages = 1;