ref: implement API interface for ref_gl, get rid of RenderAPI, RenderInterface and vgui_support API references

This commit is contained in:
Alibek Omarov
2019-03-15 21:23:59 +03:00
parent 234507b7f1
commit 97aba69ed0
27 changed files with 733 additions and 249 deletions

View File

@@ -617,10 +617,19 @@ void SV_RestartDecals( void )
// g-cont. add space for studiodecals if present
host.decalList = (decallist_t *)Z_Calloc( sizeof( decallist_t ) * MAX_RENDER_DECALS * 2 );
host.numdecals = ref.dllFuncs.R_CreateDecalList( host.decalList );
// remove decals from map
ref.dllFuncs.R_ClearAllDecals();
if( ref.dllFuncs.R_CreateDecalList )
{
host.numdecals = ref.dllFuncs.R_CreateDecalList( host.decalList );
// remove decals from map
ref.dllFuncs.R_ClearAllDecals();
}
else
{
// we probably running a dedicated server
host.numdecals = 0;
}
// write decals into reliable datagram
msg = SV_GetReliableDatagram();

View File

@@ -2005,7 +2005,7 @@ const char* pfnGetModelName( int modelindex )
static const byte *GL_TextureData( unsigned int texnum )
{
return RefRenderAPI->GL_TextureData( texnum );
return ref.dllFuncs.GL_TextureData( texnum );
}
static server_physics_api_t gPhysicsAPI =

View File

@@ -1130,7 +1130,15 @@ static void SaveClientState( SAVERESTOREDATA *pSaveData, const char *level, int
decalList = (decallist_t *)Z_Calloc( sizeof( decallist_t ) * MAX_RENDER_DECALS * 2 );
// initialize client header
header.decalCount = ref.dllFuncs.R_CreateDecalList( decalList );
if( ref.dllFuncs.R_CreateDecalList )
{
header.decalCount = ref.dllFuncs.R_CreateDecalList( decalList );
}
else
{
// we probably running a dedicated server
header.decalCount = 0;
}
header.entityCount = sv.num_static_entities;
if( !changelevel )