3 // =============================================================================
\r
7 _QERFuncTable_1 g_FuncTable;
\r
8 _QERShadersTable g_ShadersTable;
\r
9 _QEREntityTable g_EntityTable;
\r
10 _QERBrushTable g_BrushTable;
\r
11 _QERPatchTable g_PatchTable;
\r
13 // =============================================================================
\r
16 CSynapseServer* g_pSynapseServer = NULL;
\r
17 CSynapseClientXMap g_SynapseClient;
\r
19 static const XMLConfigEntry_t entries[] =
\r
21 { SHADERS_MAJOR, SYN_REQUIRE, sizeof(g_ShadersTable), &g_ShadersTable },
\r
22 { NULL, SYN_UNKNOWN, 0, NULL } };
\r
24 extern "C" CSynapseClient* SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces (const char *version, CSynapseServer *pServer)
\r
26 if (strcmp(version, SYNAPSE_VERSION))
\r
28 Syn_Printf("ERROR: synapse API version mismatch: should be '" SYNAPSE_VERSION "', got '%s'\n", version);
\r
31 g_pSynapseServer = pServer;
\r
32 g_pSynapseServer->IncRef();
\r
33 Set_Syn_Printf(g_pSynapseServer->Get_Syn_Printf());
\r
35 g_SynapseClient.AddAPI(MAP_MAJOR, "mapxml", sizeof(_QERPlugMapTable));
\r
36 g_SynapseClient.AddAPI(RADIANT_MAJOR, NULL, sizeof(_QERFuncTable_1), SYN_REQUIRE, &g_FuncTable);
\r
37 g_SynapseClient.AddAPI(ENTITY_MAJOR, NULL, sizeof(g_EntityTable), SYN_REQUIRE, &g_EntityTable);
\r
38 g_SynapseClient.AddAPI(BRUSH_MAJOR, NULL, sizeof(g_BrushTable), SYN_REQUIRE, &g_BrushTable);
\r
39 g_SynapseClient.AddAPI(PATCH_MAJOR, NULL, sizeof(g_PatchTable), SYN_REQUIRE, &g_PatchTable);
\r
41 if ( !g_SynapseClient.ConfigXML( pServer, NULL, entries ) ) {
\r
45 return &g_SynapseClient;
\r
48 bool CSynapseClientXMap::RequestAPI(APIDescriptor_t *pAPI)
\r
50 if (!strcmp(pAPI->major_name, MAP_MAJOR))
\r
52 _QERPlugMapTable* pTable= static_cast<_QERPlugMapTable*>(pAPI->mpTable);
\r
53 pTable->m_pfnMap_Read = &Map_Read;
\r
54 pTable->m_pfnMap_Write = &Map_Write;
\r
59 Syn_Printf("ERROR: RequestAPI( '%s' ) not found in '%s'\n", pAPI->major_name, GetInfo());
\r
63 #include "version.h"
\r
65 const char* CSynapseClientXMap::GetInfo()
\r
67 return "XMAP module built " __DATE__ " " RADIANT_VERSION;
\r
70 const char* CSynapseClientXMap::GetName()
\r