diff --git a/contrib/bobtoolz/DPatch.h b/contrib/bobtoolz/DPatch.h index 5a956f92..a10773d6 100644 --- a/contrib/bobtoolz/DPatch.h +++ b/contrib/bobtoolz/DPatch.h @@ -25,6 +25,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #define AFX_DPATCH_H__26C6B083_CE5B_420B_836B_1DDA733C04CE__INCLUDED_ #include +#include typedef struct { diff --git a/contrib/bobtoolz/DShape.h b/contrib/bobtoolz/DShape.h index 3c4ed75e..29bca7fc 100644 --- a/contrib/bobtoolz/DShape.h +++ b/contrib/bobtoolz/DShape.h @@ -28,6 +28,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #pragma once #endif // _MSC_VER > 1000 +#include #include "mathlib.h" #include "DMap.h" class DBrush; diff --git a/install-dylibs.sh b/install-dylibs.sh index 798a7d14..9f4e3e2b 100755 --- a/install-dylibs.sh +++ b/install-dylibs.sh @@ -24,19 +24,25 @@ finkgetdeps() finkgetdeps "$INSTALLDIR/radiant.$EXE" echo Warning: this only works if only ONE version of gtk-2.0 and pango is installed -for LIB in "$MACLIBDIR"/gtk-2.0/*/loaders/libpixbufloader-bmp.so; do +LAST= +for LIB in "$MACLIBDIR"/gtk-2.0/*/loaders/libpixbufloader-bmp.so "$MACLIBDIR"/gdk-pixbuf-2.0/*/loaders/libpixbufloader-bmp.so; do + [ -f "$LIB" ] || continue LAST=$LIB done cp -L "$LAST" "$INSTALLDIR" finkgetdeps "$LAST" +LAST= for LIB in "$MACLIBDIR"/pango/*/modules/pango-basic-fc.so; do + [ -f "$LIB" ] || continue LAST=$LIB done cp -L "$LAST" "$INSTALLDIR" finkgetdeps "$LAST" +LAST= for LIB in "$MACLIBDIR"/pango/*/modules/pango-basic-x.so; do + [ -f "$LIB" ] || continue LAST=$LIB done cp -L "$LAST" "$INSTALLDIR" diff --git a/libs/memory/allocator.h b/libs/memory/allocator.h index c513d708..ebaeeb5b 100644 --- a/libs/memory/allocator.h +++ b/libs/memory/allocator.h @@ -23,6 +23,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #define INCLUDED_MEMORY_ALLOCATOR_H #include +#include #if 0 diff --git a/radiant/mainframe.cpp b/radiant/mainframe.cpp index 4b580bc3..d168c77d 100644 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@ -186,59 +186,84 @@ void VFS_Destroy() #ifdef WIN32 #include +const GUID qFOLDERID_SavedGames = {0x4C5C32FF, 0xBB9D, 0x43b0, {0xB5, 0xB4, 0x2D, 0x72, 0xE5, 0x4E, 0xAA, 0xA4}}; +#define qREFKNOWNFOLDERID GUID +#define qKF_FLAG_CREATE 0x8000 +#define qKF_FLAG_NO_ALIAS 0x1000 +static HRESULT (WINAPI *qSHGetKnownFolderPath) (qREFKNOWNFOLDERID rfid, DWORD dwFlags, HANDLE hToken, PWSTR *ppszPath); #endif void HomePaths_Realise() { -#if defined(__APPLE__) - const char* prefix = g_pGameDescription->getKeyValue("prefix"); - if(!string_empty(prefix)) + do { - StringOutputStream path(256); - path << DirectoryCleaned(g_get_home_dir()) << "Library/Application Support" << (prefix+1) << "/"; - if(!file_is_directory(path.c_str())) + const char* prefix = g_pGameDescription->getKeyValue("prefix"); + if(!string_empty(prefix)) { + StringOutputStream path(256); + +#if defined(__APPLE__) + path.clear(); + path << DirectoryCleaned(g_get_home_dir()) << "Library/Application Support" << (prefix+1) << "/"; + if(file_is_directory(path.c_str())) + { + g_qeglobals.m_userEnginePath = path.c_str(); + break; + } +#endif + +#if defined(WIN32) + TCHAR mydocsdir[MAX_PATH + 1]; + wchar_t *mydocsdirw; + HMODULE shfolder = LoadLibrary("shfolder.dll"); + if(shfolder) + qSHGetKnownFolderPath = GetProcAddress("SHGetKnownFolderPath"); + else + qSHGetKnownFolderPath = NULL; + CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); + if(qSHGetKnownFolderPath && qSHGetKnownFolderPath(&qFOLDERID_SavedGames, qKF_FLAG_CREATE | qKF_FLAG_NO_ALIAS, NULL, &mydocsdirw) == S_OK) + { + memset(mydocsdir, 0, sizeof(mydocsdir)); + wctombs(mydocsdir, mydocsdirw, sizeof(mydocsdir)-1); + CoTaskMemFree(mydocsdirw); + path.clear(); + path << DirectoryCleaned(mydocsdir) << (prefix+1) << "/"; + if(file_is_directory(path.c_str())) + { + g_qeglobals.m_userEnginePath = path.c_str(); + CoUninitialize(); + FreeLibrary(shfolder); + break; + } + } + CoUninitialize(); + if(shfolder) + FreeLibrary(shfolder); + if(SHGetFolderPath(NULL, CSIDL_PERSONAL, NULL, 0, mydocsdir)) + { + path.clear(); + path << DirectoryCleaned(mydocsdir) << "My Games/" << (prefix+1) << "/"; + // win32: only add it if it already exists + if(file_is_directory(path.c_str())) + { + g_qeglobals.m_userEnginePath = path.c_str(); + break; + } + } +#endif + +#if defined(POSIX) path.clear(); path << DirectoryCleaned(g_get_home_dir()) << prefix << "/"; - } - g_qeglobals.m_userEnginePath = path.c_str(); - Q_mkdir(g_qeglobals.m_userEnginePath.c_str()); - } - else -#elif defined(POSIX) - const char* prefix = g_pGameDescription->getKeyValue("prefix"); - if(!string_empty(prefix)) - { - StringOutputStream path(256); - path << DirectoryCleaned(g_get_home_dir()) << prefix << "/"; - g_qeglobals.m_userEnginePath = path.c_str(); - Q_mkdir(g_qeglobals.m_userEnginePath.c_str()); - } - else -#elif defined(WIN32) - const char* prefix = g_pGameDescription->getKeyValue("prefix"); - if(!string_empty(prefix)) - { - StringOutputStream path(256); - TCHAR mydocsdir[MAX_PATH + 1]; - if(SHGetFolderPath(NULL, CSIDL_PERSONAL, NULL, 0, mydocsdir)) - { - path << DirectoryCleaned(mydocsdir) << "My Games/" << (prefix+1) << "/"; - // win32: only add it if it already exists - if(file_is_directory(path.c_str())) - g_qeglobals.m_userEnginePath = path.c_str(); - else - g_qeglobals.m_userEnginePath = EnginePath_get(); - } - else - { - g_qeglobals.m_userEnginePath = EnginePath_get(); - } - } - else + g_qeglobals.m_userEnginePath = path.c_str(); + break; #endif - { + } + g_qeglobals.m_userEnginePath = EnginePath_get(); } + while(0); + + Q_mkdir(g_qeglobals.m_userEnginePath.c_str()); { StringOutputStream path(256); diff --git a/radiant/selection.cpp b/radiant/selection.cpp index 3b477990..d2283d45 100644 --- a/radiant/selection.cpp +++ b/radiant/selection.cpp @@ -3872,7 +3872,9 @@ const ModifierFlags c_modifier_toggle_face = c_modifier_toggle | c_modifier_face const ModifierFlags c_modifier_replace_face = c_modifier_replace | c_modifier_face; const ButtonIdentifier c_button_texture = c_buttonMiddle; -const ModifierFlags c_modifier_apply_texture = c_modifierControl | c_modifierShift; +const ModifierFlags c_modifier_apply_texture1 = c_modifierControl | c_modifierShift; +const ModifierFlags c_modifier_apply_texture2 = c_modifierControl; +const ModifierFlags c_modifier_apply_texture3 = c_modifierShift; const ModifierFlags c_modifier_copy_texture = c_modifierNone; class Selector_ @@ -4094,7 +4096,7 @@ public: ConstructSelectionTest(scissored, SelectionBoxForPoint(&devicePosition[0], &m_selector.m_epsilon[0])); SelectionVolume volume(scissored); - if(modifiers == c_modifier_apply_texture) + if(modifiers == c_modifier_apply_texture1 || modifiers == c_modifier_apply_texture2 || modifiers == c_modifier_apply_texture3) { Scene_applyClosestTexture(volume); }