mirror of
https://github.com/TTimo/GtkRadiant.git
synced 2025-01-09 19:41:04 +00:00
* removed a lot of HACKs for several games by merging the enginepath_win32, enginepath_linux and enginepath_macos from 1.5
to 1.6 (default for everything is quake3) * removed the hacks for q2.game and heretic2.game (just check whether the game config value quake2 is set - TODO: game dialog needs update - quake2 option should be given) git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@297 8a3a26a2-13c4-0310-b231-cf6edde360e5
This commit is contained in:
parent
5f6f117633
commit
f5b144e467
5 changed files with 141 additions and 245 deletions
|
@ -1340,7 +1340,7 @@ void GroupDlg::Create ()
|
|||
EntWidgets[EntCheck1+i] = check;
|
||||
}
|
||||
|
||||
if (g_pGameDescription->quake2 || ( g_pGameDescription->mGameFile == "q2.game" ) || ( g_pGameDescription->mGameFile == "heretic2.game" )) {
|
||||
if (g_pGameDescription->quake2) {
|
||||
GtkWidget *check = gtk_check_button_new_with_label (_("!Easy"));
|
||||
gtk_widget_show (check);
|
||||
gtk_signal_connect (GTK_OBJECT (check), "toggled", GTK_SIGNAL_FUNC (entity_check), NULL);
|
||||
|
|
|
@ -694,6 +694,31 @@ Games selection dialog
|
|||
=========================================================
|
||||
*/
|
||||
|
||||
#if defined(WIN32)
|
||||
#define ENGINE_ATTRIBUTE "engine_win32"
|
||||
#define MP_ENGINE_ATTRIBUTE "mp_engine_win32"
|
||||
#elif defined(__linux__) || defined (__FreeBSD__)
|
||||
#define ENGINE_ATTRIBUTE "engine_linux"
|
||||
#define MP_ENGINE_ATTRIBUTE "mp_engine_linux"
|
||||
#elif defined(__APPLE__)
|
||||
#define ENGINE_ATTRIBUTE "engine_macos"
|
||||
#define MP_ENGINE_ATTRIBUTE "mp_engine_macos"
|
||||
#else
|
||||
#error "unsupported platform"
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(WIN32)
|
||||
#define ENGINEPATH_ATTRIBUTE "enginepath_win32"
|
||||
#elif defined(__linux__) || defined (__FreeBSD__)
|
||||
#define ENGINEPATH_ATTRIBUTE "enginepath_linux"
|
||||
#elif defined(__APPLE__)
|
||||
#define ENGINEPATH_ATTRIBUTE "enginepath_macos"
|
||||
#else
|
||||
#error "unknown platform"
|
||||
#endif
|
||||
|
||||
|
||||
CGameDescription::CGameDescription(xmlDocPtr pDoc, const Str &GameFile)
|
||||
{
|
||||
char *p, *prop;
|
||||
|
@ -784,15 +809,51 @@ CGameDescription::CGameDescription(xmlDocPtr pDoc, const Str &GameFile)
|
|||
xmlFree(prop);
|
||||
}
|
||||
|
||||
|
||||
prop = (char*)xmlGetProp(pNode, (const xmlChar*)ENGINE_ATTRIBUTE);
|
||||
if (prop == NULL)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
mEngine = "quake3.exe";
|
||||
#elif __linux__
|
||||
mEngine = "quake3";
|
||||
#elif __APPLE__
|
||||
mEngine = "Quake3.app";
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
mEngine = prop;
|
||||
xmlFree(prop);
|
||||
}
|
||||
|
||||
prop = (char*)xmlGetProp(pNode, (const xmlChar*)MP_ENGINE_ATTRIBUTE);
|
||||
if (prop == NULL)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
mMultiplayerEngine = "quake3.exe";
|
||||
#elif __linux__
|
||||
mMultiplayerEngine = "quake3";
|
||||
#elif __APPLE__
|
||||
mMultiplayerEngine = "Quake3.app";
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
mMultiplayerEngine = prop;
|
||||
xmlFree(prop);
|
||||
}
|
||||
|
||||
{
|
||||
// on win32, engine path can now be specified relative to the exe's cwd
|
||||
prop = (char*)xmlGetProp(pNode, (const xmlChar *)"enginepath");
|
||||
prop = (char*)xmlGetProp(pNode, (const xmlChar *)ENGINEPATH_ATTRIBUTE);
|
||||
if ( prop != NULL ) {
|
||||
char full[PATH_MAX];
|
||||
#ifdef _WIN32
|
||||
#ifdef _WIN32
|
||||
_fullpath( full, prop, PATH_MAX );
|
||||
#else
|
||||
#else
|
||||
strncpy( full, prop, PATH_MAX );
|
||||
#endif
|
||||
#endif
|
||||
xmlFree( prop );
|
||||
prop = NULL;
|
||||
// process seperators
|
||||
|
@ -819,22 +880,6 @@ CGameDescription::CGameDescription(xmlDocPtr pDoc, const Str &GameFile)
|
|||
ExtractFilePath( aux_path, up_path );
|
||||
mEnginePath = up_path;
|
||||
}
|
||||
|
||||
prop = (char*)xmlGetProp(pNode, (xmlChar*)"engine");
|
||||
if (prop == NULL)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
mEngine = "quake3.exe";
|
||||
#elif __linux__
|
||||
mEngine = "quake3";
|
||||
#elif __APPLE__
|
||||
mEngine = "Quake3.app";
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
mEngine = prop;
|
||||
xmlFree(prop);
|
||||
}
|
||||
|
||||
#if defined (__linux__) || defined (__APPLE__)
|
||||
|
@ -2884,7 +2929,7 @@ 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->quake2 || ( g_pGameDescription->mGameFile == "q2.game" ) || ( g_pGameDescription->mGameFile == "heretic2.game" ))
|
||||
else if (g_pGameDescription->quake2)
|
||||
{
|
||||
// BSP monitoring is implemented in Quake2 and Heretic2 tools
|
||||
mLocalPrefs.GetPref(WATCHBSP_KEY, &m_bWatchBSP, TRUE);
|
||||
|
@ -3327,7 +3372,7 @@ void CGameInstall::Run() {
|
|||
}
|
||||
fprintf( fg, "<?xml version=\"1.0\" encoding=\"iso-8859-1\" standalone=\"yes\"?>\n<game\n" );
|
||||
fprintf( fg, " name=\"%s\"\n", m_strName.GetBuffer() );
|
||||
fprintf( fg, " enginepath=\"%s\"\n", m_strEngine.GetBuffer() );
|
||||
fprintf( fg, " "ENGINEPATH_ATTRIBUTE"=\"%s\"\n", m_strEngine.GetBuffer() );
|
||||
switch ( m_availGames[ m_nComboSelect ] ) {
|
||||
case GAME_Q2: {
|
||||
fprintf( fg, " gametools=\"%sinstalls/Quake2Pack/game\"\n", g_strAppPath.GetBuffer() );
|
||||
|
|
|
@ -171,6 +171,7 @@ public:
|
|||
Str mBaseGame; ///< basegame directory
|
||||
Str mEnginePath; ///< path to the engine
|
||||
Str mEngine; ///< engine name
|
||||
Str mMultiplayerEngine; ///< engine name
|
||||
#if defined (__linux__) || defined (__APPLE__)
|
||||
Str mUserPathPrefix; ///< prefix for ~/.q3a ~/.wolf init, only on *nix
|
||||
#endif
|
||||
|
|
|
@ -168,7 +168,7 @@ void SI_SetTexdef_FaceList(texdef_to_face_t* texdef_face_list, bool b_SetUndoPoi
|
|||
texdef_to_face_t* texdef_to_face;
|
||||
bool b_isQuake2;
|
||||
|
||||
if ( ( g_pGameDescription->quake2 ) || ( g_pGameDescription->mGameFile == "q2.game" ) || ( g_pGameDescription->mGameFile == "heretic2.game" ) )
|
||||
if (g_pGameDescription->quake2)
|
||||
b_isQuake2 = true;
|
||||
else
|
||||
b_isQuake2 = false;
|
||||
|
|
|
@ -503,173 +503,23 @@ void CWatchBSP::RoutineProcessing()
|
|||
// build the command line
|
||||
cmd = g_pGameDescription->mEnginePath.GetBuffer();
|
||||
// this is game dependant
|
||||
//!\todo Read the engine binary name from a config file.
|
||||
if (g_pGameDescription->mGameFile == "wolf.game")
|
||||
{
|
||||
if (!strcmp(ValueForKey(g_qeglobals.d_project_entity, "gamemode"),"mp"))
|
||||
{
|
||||
// MP
|
||||
#if defined(WIN32)
|
||||
cmd += "WolfMP.exe";
|
||||
#elif defined(__linux__)
|
||||
cmd += "wolfmp";
|
||||
#elif defined(__APPLE__)
|
||||
cmd += "wolfmp.app";
|
||||
#else
|
||||
#error "WTF are you compiling on"
|
||||
#endif
|
||||
cmd += g_pGameDescription->mMultiplayerEngine.GetBuffer();
|
||||
}
|
||||
else
|
||||
{
|
||||
// SP
|
||||
#if defined(WIN32)
|
||||
cmd += "WolfSP.exe";
|
||||
#elif defined(__linux__)
|
||||
cmd += "wolfsp";
|
||||
#elif defined(__APPLE__)
|
||||
cmd += "wolfsp.app";
|
||||
#else
|
||||
#error "WTF are you compiling on"
|
||||
#endif
|
||||
}
|
||||
} else if (g_pGameDescription->mGameFile == "et.game")
|
||||
{
|
||||
#if defined(WIN32)
|
||||
cmd += "et.exe";
|
||||
#elif defined(__linux__)
|
||||
cmd += "et";
|
||||
#elif defined(__APPLE__)
|
||||
cmd += "et.app";
|
||||
#else
|
||||
#error "WTF are you compiling on"
|
||||
#endif
|
||||
}
|
||||
// RIANT
|
||||
// JK2 HACK
|
||||
else if (g_pGameDescription->mGameFile == "jk2.game")
|
||||
{
|
||||
if (!strcmp(ValueForKey(g_qeglobals.d_project_entity, "gamemode"),"mp"))
|
||||
{
|
||||
// MP
|
||||
#if defined(WIN32)
|
||||
cmd += "jk2MP.exe";
|
||||
#elif defined(__linux__)
|
||||
cmd += "jk2mp";
|
||||
#elif defined(__APPLE__)
|
||||
cmd += "jk2mp.app";
|
||||
#else
|
||||
#error "WTF are you compiling on"
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
// SP
|
||||
#if defined(WIN32)
|
||||
cmd += "jk2SP.exe";
|
||||
#elif defined(__linux__)
|
||||
cmd += "jk2sp";
|
||||
#elif defined(__APPLE__)
|
||||
cmd += "jk2sp.app";
|
||||
#else
|
||||
#error "WTF are you compiling on"
|
||||
#endif
|
||||
}
|
||||
}
|
||||
// TTimo
|
||||
// JA HACK
|
||||
else if (g_pGameDescription->mGameFile == "ja.game")
|
||||
{
|
||||
if (!strcmp(ValueForKey(g_qeglobals.d_project_entity, "gamemode"),"mp"))
|
||||
{
|
||||
// MP
|
||||
#if defined(WIN32)
|
||||
cmd += "jamp.exe";
|
||||
#elif !defined(__linux__) && !defined(__APPLE__)
|
||||
#error "WTF are you compiling on"
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
// SP
|
||||
#if defined(WIN32)
|
||||
cmd += "jasp.exe";
|
||||
#elif !defined(__linux__) && !defined(__APPLE__)
|
||||
#error "WTF are you compiling on"
|
||||
#endif
|
||||
}
|
||||
}
|
||||
// RIANT
|
||||
// STVEF HACK
|
||||
else if (g_pGameDescription->mGameFile == "stvef.game")
|
||||
{
|
||||
if (!strcmp(ValueForKey(g_qeglobals.d_project_entity, "gamemode"),"mp"))
|
||||
{
|
||||
// MP
|
||||
#if defined(WIN32)
|
||||
cmd += "stvoyHM.exe";
|
||||
#elif defined(__linux__)
|
||||
cmd += "stvoyHM";
|
||||
#elif defined(__APPLE__)
|
||||
cmd += "stvoyHM.app";
|
||||
#else
|
||||
#error "WTF are you compiling on"
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
// SP
|
||||
#if defined(WIN32)
|
||||
cmd += "stvoy.exe";
|
||||
#elif defined(__linux__)
|
||||
cmd += "stvoy";
|
||||
#elif defined(__APPLE__)
|
||||
cmd += "stvoy.app";
|
||||
#else
|
||||
#error "WTF are you compiling on"
|
||||
#endif
|
||||
}
|
||||
}
|
||||
// RIANT
|
||||
// SOF2 HACK
|
||||
else if (g_pGameDescription->mGameFile == "sof2.game")
|
||||
{
|
||||
if (!strcmp(ValueForKey(g_qeglobals.d_project_entity, "gamemode"),"mp"))
|
||||
{
|
||||
// MP
|
||||
#if defined(WIN32)
|
||||
cmd += "sof2MP.exe";
|
||||
#elif defined(__linux__)
|
||||
cmd += "b00gus";
|
||||
#elif defined(__APPLE__)
|
||||
cmd += "sof2MP.app";
|
||||
#else
|
||||
#error "WTF are you compiling on"
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
// SP
|
||||
#if defined(WIN32)
|
||||
cmd += "sof2.exe";
|
||||
#elif defined(__linux__)
|
||||
cmd += "b00gus";
|
||||
#elif defined(__APPLE__)
|
||||
cmd += "sof2.app";
|
||||
#else
|
||||
#error "WTF are you compiling on"
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cmd += g_pGameDescription->mEngine.GetBuffer();
|
||||
}
|
||||
#ifdef _WIN32
|
||||
// NOTE: we are using unix pathnames and CreateProcess doesn't like / in the program path
|
||||
// FIXME: This isn't true anymore, doesn't it?
|
||||
FindReplace( cmd, "/", "\\" );
|
||||
#endif
|
||||
Str cmdline;
|
||||
if ( (g_pGameDescription->mGameFile == "q2.game") || (g_pGameDescription->mGameFile == "heretic2.game") )
|
||||
if ( g_pGameDescription->quake2 )
|
||||
{
|
||||
cmdline = ". +exec radiant.cfg +map ";
|
||||
cmdline += m_sBSPName;
|
||||
|
|
Loading…
Reference in a new issue