Browse Source

ref_soft: context: upgrade to latest RefAPI

pull/2/head
Alibek Omarov 5 years ago
parent
commit
9c4a0d2397
  1. 12
      r_context.c
  2. 6
      r_image.c

12
r_context.c

@ -446,10 +446,16 @@ void GAME_EXPORT GL_SetupAttributes( int safegl )
gEngfuncs.GL_SetAttribute( REF_GL_BLUE_SIZE, 5 ); 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 = ref_interface_t gReffuncs =
{ {
R_Init, R_Init,
R_Shutdown, R_Shutdown,
R_GetConfigName,
GL_SetupAttributes, GL_SetupAttributes,
GL_InitExtensions, GL_InitExtensions,
@ -472,7 +478,6 @@ ref_interface_t gReffuncs =
R_ProcessEntData, R_ProcessEntData,
R_ShowTextures, R_ShowTextures,
R_ShowTree,
R_GetTextureOriginalBuffer, R_GetTextureOriginalBuffer,
GL_LoadTextureFromBuffer, GL_LoadTextureFromBuffer,
@ -604,3 +609,8 @@ int EXPORT GAME_EXPORT GetRefAPI( int version, ref_interface_t *funcs, ref_api_t
return REF_API_VERSION; return REF_API_VERSION;
} }
void EXPORT GetRefHumanReadableName( char *out, size_t size )
{
Q_strncpy( out, "Software", size );
}

6
r_image.c

@ -829,7 +829,7 @@ static image_t *GL_TextureForName( const char *name )
uint hash; uint hash;
// find the texture in array // 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 ) 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; tex->flags = flags;
// add to hash table // 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]; tex->nextHash = r_imagesHashTable[tex->hashValue];
r_imagesHashTable[tex->hashValue] = tex; r_imagesHashTable[tex->hashValue] = tex;
@ -1380,7 +1380,7 @@ void R_InitImages( void )
// create unused 0-entry // create unused 0-entry
Q_strncpy( r_images->name, "*unused*", sizeof( r_images->name )); 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_images->nextHash = r_imagesHashTable[r_images->hashValue];
r_imagesHashTable[r_images->hashValue] = r_images; r_imagesHashTable[r_images->hashValue] = r_images;
r_numImages = 1; r_numImages = 1;

Loading…
Cancel
Save