소스 검색

Merge pull request #2240 from GarageGames/Release_3_10_1

Release 3.10.1
Areloch 7 년 전
부모
커밋
ff03c78fcc

+ 10 - 0
Engine/source/console/engineFunctions.h

@@ -108,7 +108,17 @@ private:
       std::tie(std::get<I + (sizeof...(ArgTs) - sizeof...(TailTs))>(args)...) = defaultArgs;
    }
    
+#ifdef _MSC_VER == 1910
+   template<typename ...TailTs>
+   struct DodgyVCHelper
+   {
+      using type = typename std::enable_if<sizeof...(TailTs) <= sizeof...(ArgTs), decltype(mArgs)>::type;
+   };
+
+   template<typename ...TailTs> using MaybeSelfEnabled = typename DodgyVCHelper<TailTs...>::type;
+#else
    template<typename ...TailTs> using MaybeSelfEnabled = typename std::enable_if<sizeof...(TailTs) <= sizeof...(ArgTs), decltype(mArgs)>::type;
+#endif
    
    template<typename ...TailTs> static MaybeSelfEnabled<TailTs...> tailInit(TailTs ...tail) {
       std::tuple<DefVST<ArgTs>...> argsT;

+ 4 - 5
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();
 

+ 1 - 1
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();

+ 20 - 4
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;
 }

+ 2 - 2
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

+ 1 - 1
Templates/Empty/game/tools/forestEditor/forestEditorGui.cs

@@ -50,7 +50,7 @@ function ForestEditorGui::onActiveForestUpdated( %this, %forest, %createNew )
 /// 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 ) )
    {

+ 2 - 2
Templates/Empty/game/tools/forestEditor/main.cs

@@ -143,7 +143,7 @@ function ForestEditorPlugin::onActivated( %this )
    //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 ForestEditorPlugin::onSaveMission( %this, %missionFile )
    ForestDataManager.saveDirty();
 
    //First, find out if we have an existing forest object
-   %forestObject = parseMissionGroupForIds("Forest", "");
+   %forestObject = trim(parseMissionGroupForIds("Forest", ""));
  
    if ( isObject( %forestObject ) )
    {

+ 1 - 1
Templates/Full/game/tools/forestEditor/forestEditorGui.cs

@@ -50,7 +50,7 @@ function ForestEditorGui::onActiveForestUpdated( %this, %forest, %createNew )
 /// 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 ) )
    {

+ 2 - 2
Templates/Full/game/tools/forestEditor/main.cs

@@ -143,7 +143,7 @@ function ForestEditorPlugin::onActivated( %this )
    //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 ForestEditorPlugin::onSaveMission( %this, %missionFile )
    ForestDataManager.saveDirty();
 
    //First, find out if we have an existing forest object
-   %forestObject = parseMissionGroupForIds("Forest", "");
+   %forestObject = trim(parseMissionGroupForIds("Forest", ""));
  
    if ( isObject( %forestObject ) )
    {

+ 1 - 1
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()