From 763504f2756867cf807a9cc9b407729518b2e77a Mon Sep 17 00:00:00 2001 From: Areloch Date: Wed, 5 Jul 2017 22:29:23 -0500 Subject: [PATCH 1/7] Merge pull request #2030 from Areloch/2017TemplateFix VS2017 compiler workaround --- Engine/source/console/engineFunctions.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Engine/source/console/engineFunctions.h b/Engine/source/console/engineFunctions.h index cbe5b19717..5c773da4ae 100644 --- a/Engine/source/console/engineFunctions.h +++ b/Engine/source/console/engineFunctions.h @@ -108,7 +108,17 @@ struct _EngineFunctionDefaultArguments< void(ArgTs...) > : public EngineFunction std::tie(std::get(args)...) = defaultArgs; } +#ifdef _MSC_VER == 1910 + template + struct DodgyVCHelper + { + using type = typename std::enable_if::type; + }; + + template using MaybeSelfEnabled = typename DodgyVCHelper::type; +#else template using MaybeSelfEnabled = typename std::enable_if::type; +#endif template static MaybeSelfEnabled tailInit(TailTs ...tail) { std::tuple...> argsT; From f2640544053788becedfc2ce14c3650f71f0d648 Mon Sep 17 00:00:00 2001 From: Areloch Date: Mon, 27 Nov 2017 01:18:19 -0600 Subject: [PATCH 2/7] Merge pull request #2123 from nev7n/forestEditorFix Fix forest editor failing to load forest --- Templates/Empty/game/tools/forestEditor/forestEditorGui.cs | 2 +- Templates/Empty/game/tools/forestEditor/main.cs | 4 ++-- Templates/Full/game/tools/forestEditor/forestEditorGui.cs | 2 +- Templates/Full/game/tools/forestEditor/main.cs | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Templates/Empty/game/tools/forestEditor/forestEditorGui.cs b/Templates/Empty/game/tools/forestEditor/forestEditorGui.cs index e0e9f1ce44..5916e84d72 100644 --- a/Templates/Empty/game/tools/forestEditor/forestEditorGui.cs +++ b/Templates/Empty/game/tools/forestEditor/forestEditorGui.cs @@ -50,7 +50,7 @@ /// Called from a message box when a forest is not found. function ForestEditorGui::createForest( %this ) { - %forestObject = parseMissionGroupForIds("Forest", ""); + %forestObject = trim(parseMissionGroupForIds("Forest", "")); if ( isObject( %forestObject ) ) { diff --git a/Templates/Empty/game/tools/forestEditor/main.cs b/Templates/Empty/game/tools/forestEditor/main.cs index 6a7dbf9947..813c744eb0 100644 --- a/Templates/Empty/game/tools/forestEditor/main.cs +++ b/Templates/Empty/game/tools/forestEditor/main.cs @@ -143,7 +143,7 @@ function reinitForest() //ForestEditToolbar.setVisible( true ); //Get our existing forest object in our current mission if we have one - %forestObject = parseMissionGroupForIds("Forest", ""); + %forestObject = trim(parseMissionGroupForIds("Forest", "")); if(isObject(%forestObject)) { ForestEditorGui.setActiveForest(%forestObject.getName()); @@ -241,7 +241,7 @@ function reinitForest() ForestDataManager.saveDirty(); //First, find out if we have an existing forest object - %forestObject = parseMissionGroupForIds("Forest", ""); + %forestObject = trim(parseMissionGroupForIds("Forest", "")); if ( isObject( %forestObject ) ) { diff --git a/Templates/Full/game/tools/forestEditor/forestEditorGui.cs b/Templates/Full/game/tools/forestEditor/forestEditorGui.cs index e0e9f1ce44..5916e84d72 100644 --- a/Templates/Full/game/tools/forestEditor/forestEditorGui.cs +++ b/Templates/Full/game/tools/forestEditor/forestEditorGui.cs @@ -50,7 +50,7 @@ /// Called from a message box when a forest is not found. function ForestEditorGui::createForest( %this ) { - %forestObject = parseMissionGroupForIds("Forest", ""); + %forestObject = trim(parseMissionGroupForIds("Forest", "")); if ( isObject( %forestObject ) ) { diff --git a/Templates/Full/game/tools/forestEditor/main.cs b/Templates/Full/game/tools/forestEditor/main.cs index 6a7dbf9947..813c744eb0 100644 --- a/Templates/Full/game/tools/forestEditor/main.cs +++ b/Templates/Full/game/tools/forestEditor/main.cs @@ -143,7 +143,7 @@ function reinitForest() //ForestEditToolbar.setVisible( true ); //Get our existing forest object in our current mission if we have one - %forestObject = parseMissionGroupForIds("Forest", ""); + %forestObject = trim(parseMissionGroupForIds("Forest", "")); if(isObject(%forestObject)) { ForestEditorGui.setActiveForest(%forestObject.getName()); @@ -241,7 +241,7 @@ function reinitForest() ForestDataManager.saveDirty(); //First, find out if we have an existing forest object - %forestObject = parseMissionGroupForIds("Forest", ""); + %forestObject = trim(parseMissionGroupForIds("Forest", "")); if ( isObject( %forestObject ) ) { From e149024b8f347acc45c75535aca0e19519881078 Mon Sep 17 00:00:00 2001 From: Areloch Date: Mon, 15 May 2017 00:45:43 -0500 Subject: [PATCH 3/7] Merge pull request #2002 from OTHGMars/VolFogLeak VolumetricFog memory leak fix --- Engine/source/environment/VolumetricFog.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Engine/source/environment/VolumetricFog.cpp b/Engine/source/environment/VolumetricFog.cpp index c4f895fe9d..49b79a30a4 100644 --- a/Engine/source/environment/VolumetricFog.cpp +++ b/Engine/source/environment/VolumetricFog.cpp @@ -142,7 +142,7 @@ VolumetricFog::VolumetricFog() VolumetricFog::~VolumetricFog() { - if (isClientObject()) + if (!isClientObject()) return; for (S32 i = 0; i < det_size.size(); i++) @@ -152,12 +152,11 @@ VolumetricFog::~VolumetricFog() if (det_size[i].piArray != NULL) delete(det_size[i].piArray); if (det_size[i].verts != NULL) - delete(det_size[i].verts); + delete [] (det_size[i].verts); } det_size.clear(); - if (z_buf.isValid()) - SAFE_DELETE(z_buf); + z_buf = NULL; if (!mTexture.isNull()) mTexture.free(); @@ -365,7 +364,7 @@ bool VolumetricFog::LoadShape() if (det_size[i].piArray != NULL) delete(det_size[i].piArray); if (det_size[i].verts != NULL) - delete(det_size[i].verts); + delete [] (det_size[i].verts); } det_size.clear(); From 0f1d270411e3198e001e02387aad76ab7a84fe28 Mon Sep 17 00:00:00 2001 From: Areloch Date: Mon, 22 May 2017 01:26:40 -0500 Subject: [PATCH 4/7] Merge pull request #2014 from RichardsGameStudio/windows10-creator-DesktopRes Solves issue with getDesktopResolution and Windows 10 Creator update --- Engine/source/windowManager/win32/win32WindowMgr.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Engine/source/windowManager/win32/win32WindowMgr.cpp b/Engine/source/windowManager/win32/win32WindowMgr.cpp index 51beef6cc0..ff11f327a6 100644 --- a/Engine/source/windowManager/win32/win32WindowMgr.cpp +++ b/Engine/source/windowManager/win32/win32WindowMgr.cpp @@ -89,7 +89,7 @@ Point2I Win32WindowManager::getDesktopResolution() dMemset( &devMode, 0, sizeof( devMode ) ); devMode.dmSize = sizeof( devMode ); - if (!::EnumDisplaySettings(NULL, ENUM_REGISTRY_SETTINGS, &devMode)) + if (!::EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &devMode)) return Point2I(-1,-1); // Return Resolution @@ -102,7 +102,7 @@ S32 Win32WindowManager::getDesktopBitDepth() dMemset( &devMode, 0, sizeof( devMode ) ); devMode.dmSize = sizeof( devMode ); - if (!::EnumDisplaySettings(NULL, ENUM_REGISTRY_SETTINGS, &devMode)) + if (!::EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &devMode)) return -1; // Return Bits per Pixel From 840d53c28386a92821ce40880fd18fddfcc97e3f Mon Sep 17 00:00:00 2001 From: Areloch Date: Sun, 5 Mar 2017 02:06:22 -0600 Subject: [PATCH 5/7] Merge pull request #1959 from Areloch/SDLSplashScreenCleanupSanity Does better sanity checking on cleanup for the splash screen closing in SDL --- .../windowManager/sdl/sdlSplashScreen.cpp | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/Engine/source/windowManager/sdl/sdlSplashScreen.cpp b/Engine/source/windowManager/sdl/sdlSplashScreen.cpp index 1cf2440afd..08d095d5cb 100644 --- a/Engine/source/windowManager/sdl/sdlSplashScreen.cpp +++ b/Engine/source/windowManager/sdl/sdlSplashScreen.cpp @@ -103,10 +103,26 @@ bool Platform::displaySplashWindow( String path ) bool Platform::closeSplashWindow() { - SDL_DestroyTexture(gSplashTexture); - SDL_FreeSurface(gSplashImage); - SDL_DestroyRenderer(gSplashRenderer); - SDL_DestroyWindow(gSplashWindow); + if (gSplashTexture != nullptr) + { + SDL_DestroyTexture(gSplashTexture); + gSplashTexture = nullptr; + } + if (gSplashImage != nullptr) + { + SDL_FreeSurface(gSplashImage); + gSplashImage = nullptr; + } + if (gSplashRenderer != nullptr) + { + SDL_DestroyRenderer(gSplashRenderer); + gSplashRenderer = nullptr; + } + if (gSplashWindow != nullptr) + { + SDL_DestroyWindow(gSplashWindow); + gSplashWindow = nullptr; + } return true; } \ No newline at end of file From 27446b1d6a0773b2e5054e15f43679f342625325 Mon Sep 17 00:00:00 2001 From: Areloch Date: Sat, 28 Oct 2017 00:38:19 -0500 Subject: [PATCH 6/7] Merge pull request #2106 from block8437/development Fixed a typo where the value of outBytesWritten was being clamped incorrectly. --- Engine/source/platform/platformNet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Engine/source/platform/platformNet.cpp b/Engine/source/platform/platformNet.cpp index 4d5b6ca18e..3207303195 100644 --- a/Engine/source/platform/platformNet.cpp +++ b/Engine/source/platform/platformNet.cpp @@ -1706,7 +1706,7 @@ Net::Error Net::send(NetSocket handleFd, const U8 *buffer, S32 bufferSize, S32 * if (outBytesWritten) { - *outBytesWritten = outBytesWritten < 0 ? 0 : bytesWritten; + *outBytesWritten = *outBytesWritten < 0 ? 0 : bytesWritten; } return PlatformNetState::getLastError(); From 4b1f421df4d8bdef94182f903650583c441eefac Mon Sep 17 00:00:00 2001 From: Areloch Date: Thu, 5 Apr 2018 00:24:36 -0500 Subject: [PATCH 7/7] Merge pull request #2238 from Areloch/SDL_Install_Fixup Makes it so the SDL directory files aren't copied during a template install. --- Tools/CMake/torque3d.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tools/CMake/torque3d.cmake b/Tools/CMake/torque3d.cmake index e934e37b47..77a210b8e6 100644 --- a/Tools/CMake/torque3d.cmake +++ b/Tools/CMake/torque3d.cmake @@ -497,7 +497,7 @@ if(TORQUE_SDL) set(SDL_SHARED ON CACHE BOOL "Build a shared version of the library" FORCE) set(SDL_STATIC OFF CACHE BOOL "Build a static version of the library" FORCE) endif() - add_subdirectory( ${libDir}/sdl ${CMAKE_CURRENT_BINARY_DIR}/sdl2) + add_subdirectory( ${libDir}/sdl ${CMAKE_CURRENT_BINARY_DIR}/sdl2 EXCLUDE_FROM_ALL) link_directories( ${libDir}/sdl ${CMAKE_CURRENT_BINARY_DIR}/sdl2) endif()