Browse Source

engine: client: GetRefAPI now must return REF_API_VERSION to prevent possible issue when ref library wasn't recompiled on version bump

pull/2/head
Alibek Omarov 7 months ago
parent
commit
1612e2d669
  1. 2
      engine/client/ref_common.c
  2. 1
      engine/ref_api.h

2
engine/client/ref_common.c

@ -425,7 +425,7 @@ static qboolean R_LoadProgs( const char *name ) @@ -425,7 +425,7 @@ static qboolean R_LoadProgs( const char *name )
// make local copy of engfuncs to prevent overwrite it with user dll
memcpy( &gpEngfuncs, &gEngfuncs, sizeof( gpEngfuncs ));
if( !GetRefAPI( REF_API_VERSION, &ref.dllFuncs, &gpEngfuncs, &refState ))
if( GetRefAPI( REF_API_VERSION, &ref.dllFuncs, &gpEngfuncs, &refState ) != REF_API_VERSION )
{
COM_FreeLibrary( ref.hInstance );
Con_Reportf( "R_LoadProgs: can't init renderer API: wrong version\n" );

1
engine/ref_api.h

@ -37,6 +37,7 @@ GNU General Public License for more details. @@ -37,6 +37,7 @@ GNU General Public License for more details.
// 5. Removed GetSomethingByIndex calls, renderers are supposed to cache pointer values
// Removed previously unused calls
// Simplified remapping calls
// GetRefAPI is now expected to return REF_API_VERSION
#define REF_API_VERSION 5

Loading…
Cancel
Save