diff --git a/plugins/surface_idtech2/surfdlg_plugin.cpp b/plugins/surface_idtech2/surfdlg_plugin.cpp index 52b1c4f2..241ccc8a 100644 --- a/plugins/surface_idtech2/surfdlg_plugin.cpp +++ b/plugins/surface_idtech2/surfdlg_plugin.cpp @@ -34,22 +34,6 @@ #include "synapse.h" -class CSynapseClient_SurfDLG : public CSynapseClient -{ -public: -// CSynapseClient API -bool RequestAPI( APIDescriptor_t *pAPI ); -const char* GetInfo(); -const char* GetName(); -bool OnActivate(); - -CSynapseClient_SurfDLG() { } -virtual ~CSynapseClient_SurfDLG() { } -}; - -// ============================================================================= -// SYNAPSE - _QERFuncTable_1 g_FuncTable; _QERUndoTable g_UndoTable; _QERAppSurfaceTable g_AppSurfaceTable; @@ -58,6 +42,17 @@ _QERShadersTable g_ShadersTable; _QERAppShadersTable g_AppShadersTable; _QERAppDataTable g_AppDataTable; +class CSynapseClient_SurfDLG : public CSynapseClient +{ +public: +// CSynapseClient API +bool RequestAPI( APIDescriptor_t *pAPI ); +const char* GetInfo(); + +CSynapseClient_SurfDLG() { } +virtual ~CSynapseClient_SurfDLG() { } +}; + CSynapseServer* g_pSynapseServer = NULL; CSynapseClient_SurfDLG g_SynapseClient; @@ -76,27 +71,29 @@ extern "C" CSynapseClient * SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces( cons g_pSynapseServer->IncRef(); Set_Syn_Printf( g_pSynapseServer->Get_Syn_Printf() ); - g_SynapseClient.AddAPI( SURFACEDIALOG_MAJOR, "idtech2", sizeof( _QERPlugSurfaceTable ) ); + g_SynapseClient.AddAPI( SURFACEDIALOG_MAJOR, SURFACEDIALOG_MINOR, sizeof( _QERPlugSurfaceTable ) ); + g_SynapseClient.AddAPI( RADIANT_MAJOR, NULL, sizeof( _QERFuncTable_1 ), SYN_REQUIRE, &g_FuncTable ); g_SynapseClient.AddAPI( UNDO_MAJOR, NULL, sizeof( _QERUndoTable ), SYN_REQUIRE, &g_UndoTable ); g_SynapseClient.AddAPI( APPSURFACEDIALOG_MAJOR, NULL, sizeof( _QERAppSurfaceTable ), SYN_REQUIRE, &g_AppSurfaceTable ); g_SynapseClient.AddAPI( SELECTEDFACE_MAJOR, NULL, sizeof( _QERSelectedFaceTable ), SYN_REQUIRE, &g_SelectedFaceTable ); - g_SynapseClient.AddAPI( SHADERS_MAJOR, "idtech2", sizeof( _QERShadersTable ), SYN_REQUIRE, &g_ShadersTable ); + g_SynapseClient.AddAPI( SHADERS_MAJOR, SHADERS_MINOR, sizeof( _QERShadersTable ), SYN_REQUIRE, &g_ShadersTable ); g_SynapseClient.AddAPI( APPSHADERS_MAJOR, NULL, sizeof( _QERAppShadersTable ), SYN_REQUIRE, &g_AppShadersTable ); g_SynapseClient.AddAPI( DATA_MAJOR, NULL, sizeof( _QERAppDataTable ), SYN_REQUIRE, &g_AppDataTable ); return &g_SynapseClient; } -bool CSynapseClient_SurfDLG::RequestAPI( APIDescriptor_t *pAPI ){ +bool CSynapseClient_SurfDLG::RequestAPI( APIDescriptor_t *pAPI ) { + if ( !strcmp( pAPI->major_name, SURFACEDIALOG_MAJOR ) ) { - _QERPlugSurfaceTable* pSurfDialogTable = static_cast<_QERPlugSurfaceTable*>( pAPI->mpTable ); - if ( !strcmp( pAPI->minor_name, "idtech2" ) ) { - pSurfDialogTable->m_pfnToggleSurface = &ToggleSurface; - pSurfDialogTable->m_pfnDoSurface = &DoSurface; - pSurfDialogTable->m_pfnUpdateSurfaceDialog = &UpdateSurfaceDialog; - pSurfDialogTable->m_pfnSurfaceDlgFitAll = &SurfaceDlgFitAll; - pSurfDialogTable->m_pfnGet_SI_Module_Widget = &Get_SI_Module_Widget; + if ( !strcmp( pAPI->minor_name, SURFACEDIALOG_MINOR ) ) { + _QERPlugSurfaceTable* pSurfaceTable = static_cast<_QERPlugSurfaceTable*>( pAPI->mpTable ); + pSurfaceTable->m_pfnToggleSurface = &ToggleSurface; + pSurfaceTable->m_pfnDoSurface = &DoSurface; + pSurfaceTable->m_pfnUpdateSurfaceDialog = &UpdateSurfaceDialog; + pSurfaceTable->m_pfnSurfaceDlgFitAll = &SurfaceDlgFitAll; + pSurfaceTable->m_pfnGet_SI_Module_Widget = &Get_SI_Module_Widget; return true; } } @@ -107,14 +104,6 @@ bool CSynapseClient_SurfDLG::RequestAPI( APIDescriptor_t *pAPI ){ #include "version.h" -const char* CSynapseClient_SurfDLG::GetInfo(){ +const char *CSynapseClient_SurfDLG::GetInfo(){ return "Surface Dialog (idTech2) module built " __DATE__ " " RADIANT_VERSION; } - -const char* CSynapseClient_SurfDLG::GetName(){ - return "surface"; -} - -bool CSynapseClient_SurfDLG::OnActivate(){ - return true; -} diff --git a/plugins/surface_idtech2/surfdlg_plugin.h b/plugins/surface_idtech2/surfdlg_plugin.h index 6f65af77..03ddc6fe 100644 --- a/plugins/surface_idtech2/surfdlg_plugin.h +++ b/plugins/surface_idtech2/surfdlg_plugin.h @@ -50,6 +50,9 @@ typedef char* LPCSTR; #include "isurfaceplugin.h" +#define SURFACEDIALOG_MINOR "idtech2" +#define SHADERS_MINOR "idtech2" + class SurfaceDialog : public IPluginTexdef { int refCount;