3 // =============================================================================
7 _QERFuncTable_1 g_FuncTable;
8 _QERShadersTable g_ShadersTable;
9 _QEREntityTable g_EntityTable;
10 _QERBrushTable g_BrushTable;
11 _QERPatchTable g_PatchTable;
13 // =============================================================================
16 CSynapseServer* g_pSynapseServer = NULL;
17 CSynapseClientXMap g_SynapseClient;
19 static const XMLConfigEntry_t entries[] =
21 { SHADERS_MAJOR, SYN_REQUIRE, sizeof( g_ShadersTable ), &g_ShadersTable },
22 { NULL, SYN_UNKNOWN, 0, NULL }
26 #pragma GCC visibility push(default)
28 extern "C" CSynapseClient * SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces( const char *version, CSynapseServer *pServer ) {
30 #pragma GCC visibility pop
32 if ( strcmp( version, SYNAPSE_VERSION ) ) {
33 Syn_Printf( "ERROR: synapse API version mismatch: should be '" SYNAPSE_VERSION "', got '%s'\n", version );
36 g_pSynapseServer = pServer;
37 g_pSynapseServer->IncRef();
38 Set_Syn_Printf( g_pSynapseServer->Get_Syn_Printf() );
40 g_SynapseClient.AddAPI( MAP_MAJOR, "mapxml", sizeof( _QERPlugMapTable ) );
41 g_SynapseClient.AddAPI( RADIANT_MAJOR, NULL, sizeof( _QERFuncTable_1 ), SYN_REQUIRE, &g_FuncTable );
42 g_SynapseClient.AddAPI( ENTITY_MAJOR, NULL, sizeof( g_EntityTable ), SYN_REQUIRE, &g_EntityTable );
43 g_SynapseClient.AddAPI( BRUSH_MAJOR, NULL, sizeof( g_BrushTable ), SYN_REQUIRE, &g_BrushTable );
44 g_SynapseClient.AddAPI( PATCH_MAJOR, NULL, sizeof( g_PatchTable ), SYN_REQUIRE, &g_PatchTable );
46 if ( !g_SynapseClient.ConfigXML( pServer, NULL, entries ) ) {
50 return &g_SynapseClient;
53 bool CSynapseClientXMap::RequestAPI( APIDescriptor_t *pAPI ){
54 if ( !strcmp( pAPI->major_name, MAP_MAJOR ) ) {
55 _QERPlugMapTable* pTable = static_cast<_QERPlugMapTable*>( pAPI->mpTable );
56 pTable->m_pfnMap_Read = &Map_Read;
57 pTable->m_pfnMap_Write = &Map_Write;
62 Syn_Printf( "ERROR: RequestAPI( '%s' ) not found in '%s'\n", pAPI->major_name, GetInfo() );
68 const char* CSynapseClientXMap::GetInfo(){
69 return "XMAP module built " __DATE__ " " RADIANT_VERSION;
72 const char* CSynapseClientXMap::GetName(){