mirror of
https://github.com/TTimo/GtkRadiant.git
synced 2025-01-10 03:51:18 +00:00
Merge pull request #238 from jdolan/master
Restore quake2 game description flag as idTech2 flag, fix launching legacy games.
This commit is contained in:
commit
9c75082063
6 changed files with 54 additions and 44 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -50,6 +50,9 @@ typedef char* LPCSTR;
|
|||
|
||||
#include "isurfaceplugin.h"
|
||||
|
||||
#define SURFACEDIALOG_MINOR "idtech2"
|
||||
#define SHADERS_MINOR "idtech2"
|
||||
|
||||
class SurfaceDialog : public IPluginTexdef
|
||||
{
|
||||
int refCount;
|
||||
|
|
|
@ -757,6 +757,15 @@ CGameDescription::CGameDescription( xmlDocPtr pDoc, const Str &GameFile ){
|
|||
|
||||
mGameFile = GameFile;
|
||||
|
||||
prop = (char*)xmlGetProp( pNode, (xmlChar*)"idtech2" );
|
||||
if ( prop == NULL ) {
|
||||
// default
|
||||
idTech2 = false;
|
||||
} else {
|
||||
idTech2 = true;
|
||||
xmlFree( prop );
|
||||
}
|
||||
|
||||
// if this is set, the open maps dialoge will open the engine path not the
|
||||
// home dir for map loading and saving
|
||||
prop = (char*)xmlGetProp( pNode, (xmlChar*)"no_maps_in_home" );
|
||||
|
@ -2998,10 +3007,6 @@ void PrefsDlg::LoadPrefs(){
|
|||
|
||||
// Texture subset on by default (HL specific really, because of halflife.wad's size)
|
||||
mLocalPrefs.GetPref( TEXTURE_KEY, &m_bTextureWindow, TRUE );
|
||||
} else if ( g_pGameDescription->mGameFile == "q2.game" || g_pGameDescription->mGameFile == "q2w.game" ) {
|
||||
// BSP monitoring is implemented in Quake2 and Heretic2 tools
|
||||
mLocalPrefs.GetPref( WATCHBSP_KEY, &m_bWatchBSP, FALSE );
|
||||
mLocalPrefs.GetPref( TEXTURE_KEY, &m_bTextureWindow, TRUE );
|
||||
} else {
|
||||
mLocalPrefs.GetPref( WATCHBSP_KEY, &m_bWatchBSP, TRUE );
|
||||
mLocalPrefs.GetPref( TEXTURE_KEY, &m_bTextureWindow, FALSE );
|
||||
|
@ -3593,6 +3598,7 @@ void CGameInstall::Run() {
|
|||
|
||||
switch ( m_availGames[ m_nComboSelect ] ) {
|
||||
case GAME_Q2: {
|
||||
fprintf( fg, " idtech2=\"true\"\n" );
|
||||
fprintf( fg, " prefix=\".quake2\"\n" );
|
||||
fprintf( fg, " basegame=\"baseq2\"\n" );
|
||||
fprintf( fg, " no_patch=\"true\"\n" );
|
||||
|
@ -3625,8 +3631,14 @@ void CGameInstall::Run() {
|
|||
break;
|
||||
}
|
||||
case GAME_Q2W: {
|
||||
fprintf( fg, " prefix=\".quake2world\"\n" );
|
||||
fprintf( fg, " prefix_win32=\"Quake2World\"\n");
|
||||
#if defined( __APPLE__ ) || defined( __linux__ )
|
||||
fprintf( fg, " " ENGINE_ATTRIBUTE "=\"quake2world\"\n" );
|
||||
fprintf( fg, " " PREFIX_ATTRIBUTE "=\".quake2world\"\n" );
|
||||
#elif _WIN32
|
||||
fprintf( fg, " " ENGINE_ATTRIBUTE "=\"quake2world.exe\"\n" );
|
||||
fprintf( fg, " " PREFIX_ATTRIBUTE "=\"Quake2World\"\n" );
|
||||
#endif
|
||||
fprintf( fg, " idtech2=\"true\"\n" );
|
||||
fprintf( fg, " basegame=\"default\"\n" );
|
||||
fprintf( fg, " no_patch=\"true\"\n" );
|
||||
fprintf( fg, " default_scale=\"0.25\"\n" );
|
||||
|
|
|
@ -184,6 +184,7 @@ bool mEClassSingleLoad; ///< only load a single eclass definition file
|
|||
bool mNoPatch; ///< this game doesn't support patch technology
|
||||
Str mCaulkShader; ///< the shader to use for caulking
|
||||
bool noMapsInHome; ///< set this if you want to open the engine path/base dir/maps dir for map open/save dialoges */
|
||||
bool idTech2; // set this to true for idTech2 games
|
||||
|
||||
CGameDescription() { mpDoc = NULL; }
|
||||
/*!
|
||||
|
|
|
@ -436,7 +436,7 @@ xmlDocPtr ParseXMLFile( const char* filename, bool validate = false ){
|
|||
|
||||
// copy a string r to a buffer w
|
||||
// replace $string as appropriate
|
||||
void ReplaceTemplates( char* w, const char* r ){
|
||||
static void ReplaceTemplates( char* w, const char* r ){
|
||||
const char *p;
|
||||
const char *__ENGINEPATH = "TEMPLATEenginepath";
|
||||
const char *__USERHOMEPATH = "TEMPLATEuserhomepath";
|
||||
|
|
|
@ -461,7 +461,7 @@ void CWatchBSP::RoutineProcessing(){
|
|||
Sys_Printf( "Running engine...\n" );
|
||||
Str cmd;
|
||||
// build the command line
|
||||
cmd = g_pGameDescription->mEnginePath.GetBuffer();
|
||||
cmd = g_pGameDescription->mExecutablesPath.GetBuffer();
|
||||
// this is game dependant
|
||||
if ( !strcmp( ValueForKey( g_qeglobals.d_project_entity, "gamemode" ),"mp" ) ) {
|
||||
// MP
|
||||
|
@ -478,6 +478,11 @@ void CWatchBSP::RoutineProcessing(){
|
|||
FindReplace( cmd, "/", "\\" );
|
||||
#endif
|
||||
Str cmdline;
|
||||
if ( g_pGameDescription->idTech2 ) {
|
||||
cmdline = "+exec radiant.cfg +map ";
|
||||
cmdline += m_sBSPName;
|
||||
}
|
||||
else
|
||||
// NOTE: idTech3 specific - there used to be some logic depending on engine breed here
|
||||
{
|
||||
cmdline = "+set sv_pure 0 ";
|
||||
|
|
Loading…
Reference in a new issue