From 56d46ea561dab6c96dacd27e1212f276f54d2324 Mon Sep 17 00:00:00 2001 From: jdolan Date: Sun, 2 Jun 2013 10:12:14 -0400 Subject: [PATCH] #165 Add prefix_win32 support to game packs. --- radiant/preferences.cpp | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/radiant/preferences.cpp b/radiant/preferences.cpp index 8b74f29..a09b35b 100644 --- a/radiant/preferences.cpp +++ b/radiant/preferences.cpp @@ -853,13 +853,15 @@ CGameDescription::CGameDescription( xmlDocPtr pDoc, const Str &GameFile ){ } #if defined ( __linux__ ) || defined ( __APPLE__ ) - // *nix specific prop = (char*)xmlGetProp( pNode, (const xmlChar *)"prefix" ); +#elif defined ( __WIN32 ) + prop = (char*)xmlGetProp( pNode, (const xmlChar *)"prefix_win32" ); +#endif if ( prop != NULL ) { mUserPathPrefix = prop; xmlFree( prop ); } -#endif + mShaderPath = xmlGetProp( pNode, (const xmlChar *)"shaderpath" ); if ( !mShaderPath.GetLength() ) { mShaderPath = "scripts/"; @@ -918,10 +920,8 @@ void CGameDescription::Dump(){ Sys_Printf( "engine path : '%s'\n", mEnginePath.GetBuffer() ); Sys_Printf( "engine : '%s'\n", mEngine.GetBuffer() ); Sys_Printf( "shaderlist : '%s'\n", mShaderlist.GetBuffer() ); - Sys_Printf( "caulk shader: '%s'\n", mCaulkShader.GetBuffer() ); -#if defined ( __linux__ ) || defined ( __APPLE__ ) + Sys_Printf( "caulk shader : '%s'\n", mCaulkShader.GetBuffer() ); Sys_Printf( "prefix : '%s'\n", mUserPathPrefix.GetBuffer() ); -#endif Sys_Printf( "default texture scale: %g\n", mTextureDefaultScale ); Sys_Printf( "single eclass load : %s\n", mEClassSingleLoad ? "Yes" : "No" ); Sys_Printf( "patches supported : %s\n", mNoPatch ? "No" : "Yes" ); @@ -1301,17 +1301,22 @@ void CGameDialog::Init(){ g_strGameToolsPath = g_pGameDescription->mGameToolsPath; - // NOTE TTimo: this is moved from QE_LoadProject in 1.2 - // (probably broken) - // NOTE Hydra: was broken for win32, we don't use m_strHomeGame or m_strFSBasePath + // Add the per-user game path on all platforms + if (m_pCurrentGameDescription->mUserPathPrefix.GetLength()) { #if defined ( __linux__ ) || defined ( __APPLE__ ) - g_qeglobals.m_strHomeGame = g_get_home_dir(); - g_qeglobals.m_strHomeGame += "/"; - g_qeglobals.m_strHomeGame += m_pCurrentGameDescription->mUserPathPrefix.GetBuffer(); - g_qeglobals.m_strHomeGame += "/"; -#else - g_qeglobals.m_strHomeGame = g_pGameDescription->mEnginePath.GetBuffer(); + g_qeglobals.m_strHomeGame = g_get_home_dir(); + g_qeglobals.m_strHomeGame += "/"; + g_qeglobals.m_strHomeGame += m_pCurrentGameDescription->mUserPathPrefix.GetBuffer(); + g_qeglobals.m_strHomeGame += "/"; +#elif defined ( _WIN32 ) + g_qeglobals.m_strHomeGame = g_get_home_dir(); + g_qeglobals.m_strHomeGame += "\\My Games\\"; + g_qeglobals.m_strHomeGame += m_pCurrentGameDescription->mUserPathPrefix.GetBuffer(); + g_qeglobals.m_strHomeGame += "\\"; #endif + } else { + g_qeglobals.m_strHomeGame = g_pGameDescription->mEnginePath.GetBuffer(); + } g_pGameDescription->Dump(); }