diff options
70 files changed, 527 insertions, 848 deletions
diff --git a/build_files/buildbot/master_unpack.py b/build_files/buildbot/master_unpack.py index 67b628f668a..157e244e210 100644 --- a/build_files/buildbot/master_unpack.py +++ b/build_files/buildbot/master_unpack.py @@ -49,7 +49,7 @@ def get_platform(filename): tokens = filename.split("-") platforms = ('osx', 'mac', 'bsd', 'win', 'linux', 'source', - 'irix', 'solaris', 'mingw') + 'irix', 'solaris') platform_tokens = [] found = False diff --git a/build_files/cmake/config/blender_full.cmake b/build_files/cmake/config/blender_full.cmake index ecde50ff156..62e2ce1636d 100644 --- a/build_files/cmake/config/blender_full.cmake +++ b/build_files/cmake/config/blender_full.cmake @@ -63,17 +63,10 @@ if(UNIX AND NOT APPLE) set(WITH_OPENSUBDIV ON CACHE BOOL "" FORCE) elseif(WIN32) set(WITH_JACK OFF CACHE BOOL "" FORCE) - if(NOT CMAKE_COMPILER_IS_GNUCC) - set(WITH_OPENSUBDIV ON CACHE BOOL "" FORCE) - else() - # MinGW exceptions - set(WITH_OPENSUBDIV OFF CACHE BOOL "" FORCE) - set(WITH_CODEC_SNDFILE OFF CACHE BOOL "" FORCE) - set(WITH_CYCLES_OSL OFF CACHE BOOL "" FORCE) - endif() + set(WITH_OPENSUBDIV ON CACHE BOOL "" FORCE) elseif(APPLE) set(WITH_JACK ON CACHE BOOL "" FORCE) - set(WITH_CODEC_QUICKTIME OFF CACHE BOOL "" FORCE) + set(WITH_CODEC_QUICKTIME OFF CACHE BOOL "" FORCE) set(WITH_OPENSUBDIV OFF CACHE BOOL "" FORCE) # include("${CMAKE_CURRENT_SOURCE_DIR}/../platform/platform_apple_xcode.cmake") diff --git a/build_files/cmake/config/blender_release.cmake b/build_files/cmake/config/blender_release.cmake index f7239559fb8..3e2e26e6a44 100644 --- a/build_files/cmake/config/blender_release.cmake +++ b/build_files/cmake/config/blender_release.cmake @@ -64,17 +64,10 @@ if(UNIX AND NOT APPLE) set(WITH_OPENSUBDIV ON CACHE BOOL "" FORCE) elseif(WIN32) set(WITH_JACK OFF CACHE BOOL "" FORCE) - if(NOT CMAKE_COMPILER_IS_GNUCC) - set(WITH_OPENSUBDIV ON CACHE BOOL "" FORCE) - else() - # MinGW exceptions - set(WITH_OPENSUBDIV OFF CACHE BOOL "" FORCE) - set(WITH_CODEC_SNDFILE OFF CACHE BOOL "" FORCE) - set(WITH_CYCLES_OSL OFF CACHE BOOL "" FORCE) - endif() + set(WITH_OPENSUBDIV ON CACHE BOOL "" FORCE) elseif(APPLE) set(WITH_JACK ON CACHE BOOL "" FORCE) - set(WITH_CODEC_QUICKTIME OFF CACHE BOOL "" FORCE) + set(WITH_CODEC_QUICKTIME OFF CACHE BOOL "" FORCE) set(WITH_OPENSUBDIV OFF CACHE BOOL "" FORCE) # include("${CMAKE_CURRENT_SOURCE_DIR}/../platform/platform_apple_xcode.cmake") diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake index c7ada9c3cdf..bb356f51ab9 100644 --- a/build_files/cmake/macros.cmake +++ b/build_files/cmake/macros.cmake @@ -1249,17 +1249,6 @@ endfunction() # hacks to override initial project settings # these macros must be called directly before/after project(Blender) macro(blender_project_hack_pre) - # ---------------- - # MINGW HACK START - # ignore system set flag, use our own - # must be before project(...) - # if the user wants to add their own its ok after first run. - if(DEFINED CMAKE_C_STANDARD_LIBRARIES) - set(_reset_standard_libraries OFF) - else() - set(_reset_standard_libraries ON) - endif() - # ------------------ # GCC -O3 HACK START # needed because O3 can cause problems but @@ -1278,25 +1267,6 @@ endmacro() macro(blender_project_hack_post) - # -------------- - # MINGW HACK END - if(_reset_standard_libraries) - # Must come after projecINCt(...) - # - # MINGW workaround for -ladvapi32 being included which surprisingly causes - # string formatting of floats, eg: printf("%.*f", 3, value). to crash blender - # with a meaningless stack trace. by overriding this flag we ensure we only - # have libs we define. - set(CMAKE_C_STANDARD_LIBRARIES "" CACHE STRING "" FORCE) - set(CMAKE_CXX_STANDARD_LIBRARIES "" CACHE STRING "" FORCE) - mark_as_advanced( - CMAKE_C_STANDARD_LIBRARIES - CMAKE_CXX_STANDARD_LIBRARIES - ) - endif() - unset(_reset_standard_libraries) - - # ---------------- # GCC -O3 HACK END if(_reset_standard_cflags_rel) diff --git a/build_files/cmake/platform/platform_win32.cmake b/build_files/cmake/platform/platform_win32.cmake index 631973b758b..2f5d41dac32 100644 --- a/build_files/cmake/platform/platform_win32.cmake +++ b/build_files/cmake/platform/platform_win32.cmake @@ -27,12 +27,10 @@ add_definitions(-DWIN32) if(MSVC) include(platform_win32_msvc) -elseif(CMAKE_COMPILER_IS_GNUCC) - include(platform_win32_mingw) +else() + message(FATAL_ERROR "Compiler is unsupported") endif() -# Things common to both mingw and MSVC should go here - set(WINTAB_INC ${LIBDIR}/wintab/include) if(WITH_OPENAL) diff --git a/build_files/cmake/platform/platform_win32_mingw.cmake b/build_files/cmake/platform/platform_win32_mingw.cmake deleted file mode 100644 index 216568bd069..00000000000 --- a/build_files/cmake/platform/platform_win32_mingw.cmake +++ /dev/null @@ -1,302 +0,0 @@ -# ***** BEGIN GPL LICENSE BLOCK ***** -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# The Original Code is Copyright (C) 2016, Blender Foundation -# All rights reserved. -# -# Contributor(s): Sergey Sharybin. -# -# ***** END GPL LICENSE BLOCK ***** - -# Libraries configuration for Windows when compiling with MinGW. - -# keep GCC specific stuff here -include(CheckCSourceCompiles) -# Setup 64bit and 64bit windows systems -CHECK_C_SOURCE_COMPILES(" - #ifndef __MINGW64__ - #error - #endif - int main(void) { return 0; } - " - WITH_MINGW64 -) - -if(NOT DEFINED LIBDIR) - if(WITH_MINGW64) - message(STATUS "Compiling for 64 bit with MinGW-w64.") - set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/mingw64) - else() - message(STATUS "Compiling for 32 bit with MinGW-w32.") - set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/mingw32) - - if(WITH_RAYOPTIMIZATION) - message(WARNING "MinGW-w32 is known to be unstable with 'WITH_RAYOPTIMIZATION' option enabled.") - endif() - endif() -else() - message(STATUS "Using pre-compiled LIBDIR: ${LIBDIR}") -endif() -if(NOT EXISTS "${LIBDIR}/") - message(FATAL_ERROR "Windows requires pre-compiled libs at: '${LIBDIR}'") -endif() - -list(APPEND PLATFORM_LINKLIBS - -lshell32 -lshfolder -lgdi32 -lmsvcrt -lwinmm -lmingw32 -lm -lws2_32 - -lz -lstdc++ -lole32 -luuid -lwsock32 -lpsapi -ldbghelp -) - -if(WITH_INPUT_IME) - list(APPEND PLATFORM_LINKLIBS -limm32) -endif() - -set(PLATFORM_CFLAGS "-pipe -funsigned-char -fno-strict-aliasing") - -if(WITH_MINGW64) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive") - list(APPEND PLATFORM_LINKLIBS -lpthread) - - add_definitions(-DFREE_WINDOWS64 -DMS_WIN64) -endif() - -add_definitions(-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE) - -add_definitions(-DFREE_WINDOWS) - -set(PNG "${LIBDIR}/png") -set(PNG_INCLUDE_DIRS "${PNG}/include") -set(PNG_LIBPATH ${PNG}/lib) # not cmake defined - -if(WITH_MINGW64) - set(JPEG_LIBRARIES jpeg) -else() - set(JPEG_LIBRARIES libjpeg) -endif() -set(PNG_LIBRARIES png) - -set(ZLIB ${LIBDIR}/zlib) -set(ZLIB_INCLUDE_DIRS ${ZLIB}/include) -set(ZLIB_LIBPATH ${ZLIB}/lib) -set(ZLIB_LIBRARIES z) - -set(JPEG "${LIBDIR}/jpeg") -set(JPEG_INCLUDE_DIR "${JPEG}/include") -set(JPEG_LIBPATH ${JPEG}/lib) # not cmake defined - -# comes with own pthread library -if(NOT WITH_MINGW64) - set(PTHREADS ${LIBDIR}/pthreads) - #set(PTHREADS_INCLUDE_DIRS ${PTHREADS}/include) - set(PTHREADS_LIBPATH ${PTHREADS}/lib) - set(PTHREADS_LIBRARIES pthreadGC2) -endif() - -set(FREETYPE ${LIBDIR}/freetype) -set(FREETYPE_INCLUDE_DIRS ${FREETYPE}/include ${FREETYPE}/include/freetype2) -set(FREETYPE_LIBPATH ${FREETYPE}/lib) -set(FREETYPE_LIBRARY freetype) - -if(WITH_FFTW3) - set(FFTW3 ${LIBDIR}/fftw3) - set(FFTW3_LIBRARIES fftw3) - set(FFTW3_INCLUDE_DIRS ${FFTW3}/include) - set(FFTW3_LIBPATH ${FFTW3}/lib) -endif() - -if(WITH_OPENCOLLADA) - set(OPENCOLLADA ${LIBDIR}/opencollada) - set(OPENCOLLADA_INCLUDE_DIRS - ${OPENCOLLADA}/include/opencollada/COLLADAStreamWriter - ${OPENCOLLADA}/include/opencollada/COLLADABaseUtils - ${OPENCOLLADA}/include/opencollada/COLLADAFramework - ${OPENCOLLADA}/include/opencollada/COLLADASaxFrameworkLoader - ${OPENCOLLADA}/include/opencollada/GeneratedSaxParser - ) - set(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib/opencollada) - set(OPENCOLLADA_LIBRARIES - OpenCOLLADAStreamWriter - OpenCOLLADASaxFrameworkLoader - OpenCOLLADAFramework - OpenCOLLADABaseUtils - GeneratedSaxParser - UTF MathMLSolver buffer ftoa xml - ) - set(PCRE_LIBRARIES pcre) -endif() - -if(WITH_CODEC_FFMPEG) - set(FFMPEG ${LIBDIR}/ffmpeg) - set(FFMPEG_INCLUDE_DIRS ${FFMPEG}/include) - if(WITH_MINGW64) - set(FFMPEG_LIBRARIES avcodec.dll avformat.dll avdevice.dll avutil.dll swscale.dll swresample.dll) - else() - set(FFMPEG_LIBRARIES avcodec-55 avformat-55 avdevice-55 avutil-52 swscale-2) - endif() - set(FFMPEG_LIBPATH ${FFMPEG}/lib) -endif() - -if(WITH_IMAGE_OPENEXR) - set(OPENEXR ${LIBDIR}/openexr) - set(OPENEXR_INCLUDE_DIR ${OPENEXR}/include) - set(OPENEXR_INCLUDE_DIRS ${OPENEXR}/include/OpenEXR) - set(OPENEXR_LIBRARIES Half IlmImf Imath IlmThread Iex) - set(OPENEXR_LIBPATH ${OPENEXR}/lib) -endif() - -if(WITH_IMAGE_TIFF) - set(TIFF ${LIBDIR}/tiff) - set(TIFF_LIBRARY tiff) - set(TIFF_INCLUDE_DIR ${TIFF}/include) - set(TIFF_LIBPATH ${TIFF}/lib) -endif() - -if(WITH_JACK) - set(JACK ${LIBDIR}/jack) - set(JACK_INCLUDE_DIRS ${JACK}/include/jack ${JACK}/include) - set(JACK_LIBRARIES jack) - set(JACK_LIBPATH ${JACK}/lib) - - # TODO, gives linking errors, force off - set(WITH_JACK OFF) -endif() - -if(WITH_PYTHON) - # normally cached but not since we include them with blender - set(PYTHON_VERSION 3.5) # CACHE STRING) - string(REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${PYTHON_VERSION}) - set(PYTHON_INCLUDE_DIR "${LIBDIR}/python/include/python${PYTHON_VERSION}") # CACHE PATH) - set(PYTHON_LIBRARY "${LIBDIR}/python/lib/python${_PYTHON_VERSION_NO_DOTS}mw.lib") # CACHE FILEPATH) - unset(_PYTHON_VERSION_NO_DOTS) - - # uncached vars - set(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}") - set(PYTHON_LIBRARIES "${PYTHON_LIBRARY}") -endif() - -if(WITH_BOOST) - set(BOOST ${LIBDIR}/boost) - set(BOOST_INCLUDE_DIR ${BOOST}/include) - if(WITH_MINGW64) - set(BOOST_POSTFIX "mgw47-mt-s-1_49") - set(BOOST_DEBUG_POSTFIX "mgw47-mt-sd-1_49") - else() - set(BOOST_POSTFIX "mgw46-mt-s-1_49") - set(BOOST_DEBUG_POSTFIX "mgw46-mt-sd-1_49") - endif() - set(BOOST_LIBRARIES - optimized boost_date_time-${BOOST_POSTFIX} boost_filesystem-${BOOST_POSTFIX} - boost_regex-${BOOST_POSTFIX} - boost_system-${BOOST_POSTFIX} boost_thread-${BOOST_POSTFIX} - debug boost_date_time-${BOOST_DEBUG_POSTFIX} boost_filesystem-${BOOST_DEBUG_POSTFIX} - boost_regex-${BOOST_DEBUG_POSTFIX} - boost_system-${BOOST_DEBUG_POSTFIX} boost_thread-${BOOST_DEBUG_POSTFIX}) - if(WITH_INTERNATIONAL) - set(BOOST_LIBRARIES ${BOOST_LIBRARIES} - optimized boost_locale-${BOOST_POSTFIX} - debug boost_locale-${BOOST_DEBUG_POSTFIX} - ) - endif() - if(WITH_CYCLES_OSL) - set(BOOST_LIBRARIES ${BOOST_LIBRARIES} - optimized boost_wave-${BOOST_POSTFIX} - debug boost_wave-${BOOST_DEBUG_POSTFIX} - ) - endif() - set(BOOST_LIBPATH ${BOOST}/lib) - set(BOOST_DEFINITIONS "-DBOOST_ALL_NO_LIB -DBOOST_THREAD_USE_LIB ") -endif() - -if(WITH_OPENIMAGEIO) - set(OPENIMAGEIO ${LIBDIR}/openimageio) - set(OPENIMAGEIO_INCLUDE_DIRS ${OPENIMAGEIO}/include) - set(OPENIMAGEIO_LIBRARIES OpenImageIO) - set(OPENIMAGEIO_LIBPATH ${OPENIMAGEIO}/lib) - set(OPENIMAGEIO_DEFINITIONS "") - set(OPENIMAGEIO_IDIFF "${OPENIMAGEIO}/bin/idiff.exe") -endif() - -if(WITH_LLVM) - set(LLVM_ROOT_DIR ${LIBDIR}/llvm CACHE PATH "Path to the LLVM installation") - set(LLVM_LIBPATH ${LLVM_ROOT_DIR}/lib) - # Explicitly set llvm lib order. - #---- WARNING ON GCC ORDER OF LIBS IS IMPORTANT, DO NOT CHANGE! --------- - set(LLVM_LIBRARY LLVMSelectionDAG LLVMCodeGen LLVMScalarOpts LLVMAnalysis LLVMArchive - LLVMAsmParser LLVMAsmPrinter - LLVMBitReader LLVMBitWriter - LLVMDebugInfo LLVMExecutionEngine - LLVMInstCombine LLVMInstrumentation - LLVMInterpreter LLVMJIT - LLVMLinker LLVMMC - LLVMMCDisassembler LLVMMCJIT - LLVMMCParser LLVMObject - LLVMRuntimeDyld - LLVMSupport - LLVMTableGen LLVMTarget - LLVMTransformUtils LLVMVectorize - LLVMX86AsmParser LLVMX86AsmPrinter - LLVMX86CodeGen LLVMX86Desc - LLVMX86Disassembler LLVMX86Info - LLVMX86Utils LLVMipa - LLVMipo LLVMCore) - # imagehelp is needed by LLVM 3.1 on MinGW, check lib\Support\Windows\Signals.inc - list(APPEND PLATFORM_LINKLIBS -limagehlp) -endif() - -if(WITH_OPENCOLORIO) - set(OPENCOLORIO ${LIBDIR}/opencolorio) - set(OPENCOLORIO_INCLUDE_DIRS ${OPENCOLORIO}/include) - set(OPENCOLORIO_LIBRARIES OpenColorIO) - set(OPENCOLORIO_LIBPATH ${OPENCOLORIO}/lib) - set(OPENCOLORIO_DEFINITIONS) -endif() - -if(WITH_SDL) - set(SDL ${LIBDIR}/sdl) - set(SDL_INCLUDE_DIR ${SDL}/include) - set(SDL_LIBRARY SDL) - set(SDL_LIBPATH ${SDL}/lib) -endif() - -if(WITH_OPENVDB) - set(OPENVDB ${LIBDIR}/openvdb) - set(OPENVDB_INCLUDE_DIRS ${OPENVDB}/include) - set(OPENVDB_LIBRARIES openvdb ${TBB_LIBRARIES}) - set(OPENVDB_LIBPATH ${LIBDIR}/openvdb/lib) - set(OPENVDB_DEFINITIONS) -endif() - -if(WITH_ALEMBIC) - # TODO(sergey): For until someone drops by and compiles libraries for - # MinGW we allow users to compile their own Alembic library and use - # that via find_package(), - # - # Once precompiled libraries are there we'll use hardcoded locations. - find_package_wrapper(Alembic) - if(WITH_ALEMBIC_HDF5) - set(HDF5_ROOT_DIR ${LIBDIR}/hdf5) - find_package_wrapper(HDF5) - endif() - if(NOT ALEMBIC_FOUND OR (WITH_ALEMBIC_HDF5 AND NOT HDF5_FOUND)) - set(WITH_ALEMBIC OFF) - set(WITH_ALEMBIC_HDF5 OFF) - endif() -endif() - -set(PLATFORM_LINKFLAGS "-Xlinker --stack=2097152") - -## DISABLE - causes linking errors -## for re-distribution, so users dont need mingw installed -# set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -static-libgcc -static-libstdc++") diff --git a/build_files/cmake/platform/platform_win32_msvc.cmake b/build_files/cmake/platform/platform_win32_msvc.cmake index 6447559f62c..2055b164f6d 100644 --- a/build_files/cmake/platform/platform_win32_msvc.cmake +++ b/build_files/cmake/platform/platform_win32_msvc.cmake @@ -116,7 +116,6 @@ set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /NODEFAULTLIB:msvcrt.lib /NODEFAUL set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /ignore:4049 /ignore:4217 /ignore:4221") set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} /ignore:4221") -# MSVC only, Mingw doesnt need if(CMAKE_CL_64) set(PLATFORM_LINKFLAGS "/MACHINE:X64 ${PLATFORM_LINKFLAGS}") else() @@ -473,12 +472,7 @@ if(WITH_SDL) set(SDL ${LIBDIR}/sdl) set(SDL_INCLUDE_DIR ${SDL}/include) set(SDL_LIBPATH ${SDL}/lib) - # MinGW TODO: Update MinGW to SDL2 - if(NOT CMAKE_COMPILER_IS_GNUCC) - set(SDL_LIBRARY SDL2) - else() - set(SDL_LIBRARY SDL) - endif() + set(SDL_LIBRARY SDL2) endif() # Audio IO diff --git a/build_files/cmake/project_info.py b/build_files/cmake/project_info.py index deea844034c..3ac4c4c9480 100755 --- a/build_files/cmake/project_info.py +++ b/build_files/cmake/project_info.py @@ -145,7 +145,7 @@ def cmake_advanced_info(): def create_eclipse_project(): print("CMAKE_DIR %r" % CMAKE_DIR) if sys.platform == "win32": - cmd = 'cmake "%s" -G"Eclipse CDT4 - MinGW Makefiles"' % CMAKE_DIR + raise Exception("Error: win32 is not supported") else: if make_exe_basename.startswith(("make", "gmake")): cmd = 'cmake "%s" -G"Eclipse CDT4 - Unix Makefiles"' % CMAKE_DIR diff --git a/extern/carve/include/carve/win32.h b/extern/carve/include/carve/win32.h index 81b2ea4d6fa..78a101e6f98 100755 --- a/extern/carve/include/carve/win32.h +++ b/extern/carve/include/carve/win32.h @@ -8,11 +8,9 @@ #include <string.h> #include <stdlib.h> -#if !defined(__MINGW32__) inline int strcasecmp(const char *a, const char *b) { return _stricmp(a,b); } -#endif inline void srandom(unsigned long input) { srand(input); @@ -34,7 +32,7 @@ typedef unsigned long uintptr_t; # if _MSC_VER < 1600 // stdint.h is not available before VS2010 -#if defined(_WIN32) && !defined(__MINGW32__) +#if defined(_WIN32) /* The __intXX are built-in types of the visual complier! So we don't need to include anything else here. This typedefs should be in sync with types from MEM_sys_types.h */ diff --git a/extern/carve/patches/mingw.patch b/extern/carve/patches/mingw.patch deleted file mode 100644 index c237edf18e9..00000000000 --- a/extern/carve/patches/mingw.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff -r 525472fb477a include/carve/win32.h ---- a/include/carve/win32.h Sun Jan 15 23:07:40 2012 -0500 -+++ b/include/carve/win32.h Wed Jan 18 00:40:10 2012 +0600 -@@ -8,9 +8,11 @@ - #include <string.h> - #include <stdlib.h> - -+#if !defined(__MINGW32__) - inline int strcasecmp(const char *a, const char *b) { - return _stricmp(a,b); - } -+#endif - - inline void srandom(unsigned long input) { - srand(input); diff --git a/extern/carve/patches/mingw_w64.patch b/extern/carve/patches/mingw_w64.patch deleted file mode 100644 index 26a30be84c3..00000000000 --- a/extern/carve/patches/mingw_w64.patch +++ /dev/null @@ -1,13 +0,0 @@ -Index: bundle.sh -=================================================================== ---- bundle.sh (revision 45912) -+++ bundle.sh (working copy) -@@ -114,7 +114,7 @@ - if env['WITH_BF_BOOST']: - if env['OURPLATFORM'] not in ('win32-vc', 'win64-vc'): - # Boost is setting as preferred collections library in the Carve code when using MSVC compiler -- if env['OURPLATFORM'] != 'win32-mingw': -+ if env['OURPLATFORM'] not in ('win32-mingw', 'win64-mingw'): - defs.append('HAVE_BOOST_UNORDERED_COLLECTIONS') - - defs.append('CARVE_SYSTEM_BOOST') diff --git a/extern/carve/patches/series b/extern/carve/patches/series index b7e97d68c4c..c5c5fd766b8 100644 --- a/extern/carve/patches/series +++ b/extern/carve/patches/series @@ -1,7 +1,6 @@ includes.patch win32.patch mesh_iterator.patch -mingw.patch gcc46.patch clang_is_heap_fix.patch strict_flags.patch diff --git a/extern/carve/patches/win32.patch b/extern/carve/patches/win32.patch index 680bceb2421..1a5f9650532 100644 --- a/extern/carve/patches/win32.patch +++ b/extern/carve/patches/win32.patch @@ -8,7 +8,7 @@ diff -r e82d852e4fb0 include/carve/win32.h -typedef char int8_t; -typedef short int16_t; -typedef long int32_t; -+#if defined(_WIN32) && !defined(__MINGW32__) ++#if defined(_WIN32) +/* The __intXX are built-in types of the visual complier! So we don't + need to include anything else here. + This typedefs should be in sync with types from MEM_sys_types.h */ diff --git a/intern/dualcon/intern/Projections.h b/intern/dualcon/intern/Projections.h index 2d1eca55997..2d245a77d15 100644 --- a/intern/dualcon/intern/Projections.h +++ b/intern/dualcon/intern/Projections.h @@ -29,7 +29,7 @@ #define CONTAINS_INDEX #define GRID_DIMENSION 20 -#if defined(_WIN32) && !defined(__MINGW32__) && !(_MSC_VER >= 1900) +#if defined(_WIN32) && !(_MSC_VER >= 1900) #define isnan(n) _isnan(n) #define LONG __int64 #define int64_t __int64 diff --git a/intern/dualcon/intern/dualcon_c_api.cpp b/intern/dualcon/intern/dualcon_c_api.cpp index e55de2ed354..92f8b0cfd1a 100644 --- a/intern/dualcon/intern/dualcon_c_api.cpp +++ b/intern/dualcon/intern/dualcon_c_api.cpp @@ -28,7 +28,7 @@ #include <cstdio> #include <float.h> -#if defined(_WIN32) && !defined(__MINGW32__) +#if defined(_WIN32) #define isnan(n) _isnan(n) #endif diff --git a/intern/elbeem/intern/mvmcoords.h b/intern/elbeem/intern/mvmcoords.h index 56d991aac6e..deeedcf9dd4 100644 --- a/intern/elbeem/intern/mvmcoords.h +++ b/intern/elbeem/intern/mvmcoords.h @@ -23,12 +23,10 @@ #define mvmFloat double #ifdef WIN32 -#ifndef FREE_WINDOWS #include "float.h" #define isnan(n) _isnan(n) #define finite _finite #endif -#endif #ifdef sun #include "ieeefp.h" diff --git a/intern/ghost/intern/GHOST_Context.cpp b/intern/ghost/intern/GHOST_Context.cpp index fc7193ae99b..823a476d244 100644 --- a/intern/ghost/intern/GHOST_Context.cpp +++ b/intern/ghost/intern/GHOST_Context.cpp @@ -38,7 +38,7 @@ # include <tchar.h> # # ifndef ERROR_PROFILE_DOES_NOT_MATCH_DEVICE -# define ERROR_PROFILE_DOES_NOT_MATCH_DEVICE 0x7E7 // Mingw64 headers may have had this +# define ERROR_PROFILE_DOES_NOT_MATCH_DEVICE 0x7E7 # endif #endif diff --git a/intern/ghost/intern/GHOST_DisplayManagerWin32.cpp b/intern/ghost/intern/GHOST_DisplayManagerWin32.cpp index 252ea775329..7b9a897fe57 100644 --- a/intern/ghost/intern/GHOST_DisplayManagerWin32.cpp +++ b/intern/ghost/intern/GHOST_DisplayManagerWin32.cpp @@ -41,9 +41,7 @@ // We do not support multiple monitors at the moment #define COMPILE_MULTIMON_STUBS -#ifndef FREE_WINDOWS #include <multimon.h> -#endif GHOST_DisplayManagerWin32::GHOST_DisplayManagerWin32(void) diff --git a/intern/ghost/intern/GHOST_SystemPathsWin32.cpp b/intern/ghost/intern/GHOST_SystemPathsWin32.cpp index 7d0ce5158fe..8056bc76edb 100644 --- a/intern/ghost/intern/GHOST_SystemPathsWin32.cpp +++ b/intern/ghost/intern/GHOST_SystemPathsWin32.cpp @@ -37,30 +37,6 @@ #include <shlobj.h> #include "utfconv.h" -#ifdef __MINGW32__ - -#if !defined(SHARD_PIDL) -#define SHARD_PIDL 0x00000001L -#endif - -#if !defined(SHARD_PATHA) -#define SHARD_PATHA 0x00000002L -#endif - -#if !defined(SHARD_PATHW) -#define SHARD_PATHW 0x00000003L -#endif - -#if !defined(SHARD_PATH) -#ifdef UNICODE -#define SHARD_PATH SHARD_PATHW -#else -#define SHARD_PATH SHARD_PATHA -#endif -#endif - -#endif - GHOST_SystemPathsWin32::GHOST_SystemPathsWin32() { } diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp index 240d7ccd2fe..ca7118de7b0 100644 --- a/intern/ghost/intern/GHOST_SystemWin32.cpp +++ b/intern/ghost/intern/GHOST_SystemWin32.cpp @@ -890,25 +890,15 @@ bool GHOST_SystemWin32::processNDOF(RAWINPUT const &raw) // send motion. Mark as 'sent' so motion will always get dispatched. eventSent = true; -#if defined(_MSC_VER) || defined(FREE_WINDOWS64) +#if defined(_MSC_VER) // using Microsoft compiler & header files // they invented the RawInput API, so this version is (probably) correct. - // MinGW64 also works fine with this BYTE const *data = raw.data.hid.bRawData; // struct RAWHID { // DWORD dwSizeHid; // DWORD dwCount; // BYTE bRawData[1]; // }; -#else - // MinGW's definition (below) doesn't agree, so we need a slight - // workaround until it's fixed - BYTE const *data = &raw.data.hid.bRawData; - // struct RAWHID { - // DWORD dwSizeHid; - // DWORD dwCount; - // BYTE bRawData; // <== isn't this s'posed to be a BYTE*? - // }; #endif BYTE packetType = data[0]; diff --git a/intern/ghost/intern/GHOST_SystemWin32.h b/intern/ghost/intern/GHOST_SystemWin32.h index d534a300b35..099d14e68ae 100644 --- a/intern/ghost/intern/GHOST_SystemWin32.h +++ b/intern/ghost/intern/GHOST_SystemWin32.h @@ -37,10 +37,10 @@ #error WIN32 only! #endif // WIN32 -#ifndef __MINGW64__ -# undef _WIN32_WINNT -# define _WIN32_WINNT 0x501 // require Windows XP or newer -#endif +/* require Windows XP or newer */ +#undef _WIN32_WINNT +#define _WIN32_WINNT 0x501 + #define WIN32_LEAN_AND_MEAN #include <windows.h> #include <ole2.h> // for drag-n-drop diff --git a/intern/ghost/intern/GHOST_TaskbarWin32.h b/intern/ghost/intern/GHOST_TaskbarWin32.h index 6fcff297237..0ef71754717 100644 --- a/intern/ghost/intern/GHOST_TaskbarWin32.h +++ b/intern/ghost/intern/GHOST_TaskbarWin32.h @@ -8,10 +8,10 @@ #error WIN32 only! #endif // WIN32 -#ifndef __MINGW64__ -# undef _WIN32_WINNT -# define _WIN32_WINNT 0x501 // require Windows XP or newer -#endif +/* require Windows XP or newer */ +#undef _WIN32_WINNT +#define _WIN32_WINNT 0x501 + #define WIN32_LEAN_AND_MEAN #include <windows.h> #include <shlobj.h> diff --git a/intern/guardedalloc/intern/mallocn_intern.h b/intern/guardedalloc/intern/mallocn_intern.h index 3f7e462c1c7..a292a2eb5a0 100644 --- a/intern/guardedalloc/intern/mallocn_intern.h +++ b/intern/guardedalloc/intern/mallocn_intern.h @@ -89,14 +89,6 @@ #if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__NetBSD__) // Needed for memalign on Linux and _aligned_alloc on Windows. -# ifdef FREE_WINDOWS -/* make sure _aligned_malloc is included */ -# ifdef __MSVCRT_VERSION__ -# undef __MSVCRT_VERSION__ -# endif - -# define __MSVCRT_VERSION__ 0x0700 -# endif // FREE_WINDOWS # include <malloc.h> #else diff --git a/intern/libmv/intern/frame_accessor.cc b/intern/libmv/intern/frame_accessor.cc index 5d274d7ccca..e7fc0ab4883 100644 --- a/intern/libmv/intern/frame_accessor.cc +++ b/intern/libmv/intern/frame_accessor.cc @@ -40,10 +40,14 @@ using mv::Region; struct LibmvFrameAccessor : public FrameAccessor { LibmvFrameAccessor(libmv_FrameAccessorUserData* user_data, libmv_GetImageCallback get_image_callback, - libmv_ReleaseImageCallback release_image_callback) + libmv_ReleaseImageCallback release_image_callback, + libmv_GetMaskForTrackCallback get_mask_for_track_callback, + libmv_ReleaseMaskCallback release_mask_callback) : user_data_(user_data), get_image_callback_(get_image_callback), - release_image_callback_(release_image_callback) { } + release_image_callback_(release_image_callback), + get_mask_for_track_callback_(get_mask_for_track_callback), + release_mask_callback_(release_mask_callback) { } virtual ~LibmvFrameAccessor() { } @@ -109,6 +113,41 @@ struct LibmvFrameAccessor : public FrameAccessor { release_image_callback_(cache_key); } + Key GetMaskForTrack(int clip, + int frame, + int track, + const Region* region, + FloatImage* destination) { + float *float_buffer; + int width, height; + libmv_Region libmv_region; + if (region) { + get_libmv_region(*region, &libmv_region); + } + Key cache_key = get_mask_for_track_callback_( + user_data_, + clip, + frame, + track, + region != NULL ? &libmv_region : NULL, + &float_buffer, + &width, + &height); + + // TODO(sergey): Dumb code for until we can set data directly. + FloatImage temp_image(float_buffer, + height, + width, + 1); + destination->CopyFrom(temp_image); + + return cache_key; + } + + void ReleaseMask(Key key) { + release_mask_callback_(key); + } + bool GetClipDimensions(int /*clip*/, int * /*width*/, int * /*height*/) { return false; } @@ -124,6 +163,8 @@ struct LibmvFrameAccessor : public FrameAccessor { libmv_FrameAccessorUserData* user_data_; libmv_GetImageCallback get_image_callback_; libmv_ReleaseImageCallback release_image_callback_; + libmv_GetMaskForTrackCallback get_mask_for_track_callback_; + libmv_ReleaseMaskCallback release_mask_callback_; }; } // namespace @@ -131,11 +172,15 @@ struct LibmvFrameAccessor : public FrameAccessor { libmv_FrameAccessor* libmv_FrameAccessorNew( libmv_FrameAccessorUserData* user_data, libmv_GetImageCallback get_image_callback, - libmv_ReleaseImageCallback release_image_callback) { + libmv_ReleaseImageCallback release_image_callback, + libmv_GetMaskForTrackCallback get_mask_for_track_callback, + libmv_ReleaseMaskCallback release_mask_callback) { return (libmv_FrameAccessor*) LIBMV_OBJECT_NEW(LibmvFrameAccessor, user_data, get_image_callback, - release_image_callback); + release_image_callback, + get_mask_for_track_callback, + release_mask_callback); } void libmv_FrameAccessorDestroy(libmv_FrameAccessor* frame_accessor) { diff --git a/intern/libmv/intern/frame_accessor.h b/intern/libmv/intern/frame_accessor.h index 3e813fe7581..c041d67f56f 100644 --- a/intern/libmv/intern/frame_accessor.h +++ b/intern/libmv/intern/frame_accessor.h @@ -61,10 +61,23 @@ typedef libmv_CacheKey (*libmv_GetImageCallback) ( typedef void (*libmv_ReleaseImageCallback) (libmv_CacheKey cache_key); +typedef libmv_CacheKey (*libmv_GetMaskForTrackCallback) ( + libmv_FrameAccessorUserData* user_data, + int clip, + int frame, + int track, + const libmv_Region* region, + float** destination, + int* width, + int* height); +typedef void (*libmv_ReleaseMaskCallback) (libmv_CacheKey cache_key); + libmv_FrameAccessor* libmv_FrameAccessorNew( libmv_FrameAccessorUserData* user_data, libmv_GetImageCallback get_image_callback, - libmv_ReleaseImageCallback release_image_callback); + libmv_ReleaseImageCallback release_image_callback, + libmv_GetMaskForTrackCallback get_mask_for_track_callback, + libmv_ReleaseMaskCallback release_mask_callback); void libmv_FrameAccessorDestroy(libmv_FrameAccessor* frame_accessor); int64_t libmv_frameAccessorgetTransformKey(const libmv_FrameTransform *transform); diff --git a/intern/libmv/intern/stub.cc b/intern/libmv/intern/stub.cc index 47e1915e072..8603cc03153 100644 --- a/intern/libmv/intern/stub.cc +++ b/intern/libmv/intern/stub.cc @@ -375,7 +375,9 @@ int libmv_autoTrackGetMarker(libmv_AutoTrack* /*libmv_autotrack*/, libmv_FrameAccessor* libmv_FrameAccessorNew( libmv_FrameAccessorUserData* /*user_data**/, libmv_GetImageCallback /*get_image_callback*/, - libmv_ReleaseImageCallback /*release_image_callback*/) + libmv_ReleaseImageCallback /*release_image_callback*/, + libmv_GetMaskForTrackCallback /*get_mask_for_track_callback*/, + libmv_ReleaseMaskCallback /*release_mask_callback*/) { return NULL; } diff --git a/intern/libmv/intern/track_region.cc b/intern/libmv/intern/track_region.cc index 8989897e09f..d395b6457d7 100644 --- a/intern/libmv/intern/track_region.cc +++ b/intern/libmv/intern/track_region.cc @@ -36,7 +36,7 @@ /* define this to generate PNG images with content of search areas on every itteration of tracking */ -#undef DUMP_ALWAYS +#define DUMP_ALWAYS using libmv::FloatImage; using libmv::TrackRegionOptions; diff --git a/intern/libmv/libmv/autotrack/autotrack.cc b/intern/libmv/libmv/autotrack/autotrack.cc index 4c7bdf1fde8..00366e0f661 100644 --- a/intern/libmv/libmv/autotrack/autotrack.cc +++ b/intern/libmv/libmv/autotrack/autotrack.cc @@ -111,6 +111,17 @@ FrameAccessor::Key GetImageForMarker(const Marker& marker, image); } +FrameAccessor::Key GetMaskForMarker(const Marker& marker, + FrameAccessor* frame_accessor, + FloatImage* mask) { + Region region = marker.search_region.Rounded(); + return frame_accessor->GetMaskForTrack(marker.clip, + marker.frame, + marker.track, + ®ion, + mask); +} + } // namespace bool AutoTrack::TrackMarker(Marker* tracked_marker, @@ -149,6 +160,11 @@ bool AutoTrack::TrackMarker(Marker* tracked_marker, return false; } + FloatImage reference_mask; + FrameAccessor::Key reference_mask_key = GetMaskForMarker(reference_marker, + frame_accessor_, + &reference_mask); + FloatImage tracked_image; FrameAccessor::Key tracked_key = GetImageForMarker(*tracked_marker, frame_accessor_, @@ -167,6 +183,10 @@ bool AutoTrack::TrackMarker(Marker* tracked_marker, if (track_options) { local_track_region_options = *track_options; } + if (reference_mask_key != NULL) { + LG << "Using mask for reference marker: " << reference_marker; + local_track_region_options.image1_mask = &reference_mask; + } local_track_region_options.num_extra_points = 1; // For center point. local_track_region_options.attempt_refine_before_brute = predicted_position; TrackRegion(reference_image, @@ -191,9 +211,10 @@ bool AutoTrack::TrackMarker(Marker* tracked_marker, tracked_marker->reference_clip = reference_marker.clip; tracked_marker->reference_frame = reference_marker.frame; - // Release the images from the accessor cache. + // Release the images and masks from the accessor cache. frame_accessor_->ReleaseImage(reference_key); frame_accessor_->ReleaseImage(tracked_key); + frame_accessor_->ReleaseMask(reference_mask_key); // TODO(keir): Possibly the return here should get removed since the results // are part of TrackResult. However, eventually the autotrack stuff will have diff --git a/intern/libmv/libmv/autotrack/frame_accessor.h b/intern/libmv/libmv/autotrack/frame_accessor.h index 8de5d865cd7..32f6349963c 100644 --- a/intern/libmv/libmv/autotrack/frame_accessor.h +++ b/intern/libmv/libmv/autotrack/frame_accessor.h @@ -76,6 +76,25 @@ struct FrameAccessor { // free the image immediately; others may hold onto the image. virtual void ReleaseImage(Key) = 0; + // Get mask image for the given track. + // + // Implementation of this method should sample mask associated with the track + // within given region to the given destination. + // + // Result is supposed to be a single channel image. + // + // If region is NULL, it it assumed to be full-frame. + virtual Key GetMaskForTrack(int clip, + int frame, + int track, + const Region* region, + FloatImage* destination) = 0; + + // Release a specified mask. + // + // Non-caching implementation may free used memory immediately. + virtual void ReleaseMask(Key key) = 0; + virtual bool GetClipDimensions(int clip, int* width, int* height) = 0; virtual int NumClips() = 0; virtual int NumFrames(int clip) = 0; diff --git a/intern/opencolorio/CMakeLists.txt b/intern/opencolorio/CMakeLists.txt index d2dd8a3c419..2611477252a 100644 --- a/intern/opencolorio/CMakeLists.txt +++ b/intern/opencolorio/CMakeLists.txt @@ -60,7 +60,7 @@ if(WITH_OPENCOLORIO) ocio_impl_glsl.cc ) - if(WIN32 AND NOT MINGW) + if(WIN32) list(APPEND INC_SYS ${BOOST_INCLUDE_DIR} ) diff --git a/release/scripts/startup/bl_operators/object.py b/release/scripts/startup/bl_operators/object.py index 69649676666..566487d9d0e 100644 --- a/release/scripts/startup/bl_operators/object.py +++ b/release/scripts/startup/bl_operators/object.py @@ -866,7 +866,7 @@ class DupliOffsetFromCursor(Operator): """Set offset used for DupliGroup based on cursor position""" bl_idname = "object.dupli_offset_from_cursor" bl_label = "Set Offset From Cursor" - bl_options = {'REGISTER', 'UNDO'} + bl_options = {'INTERNAL', 'UNDO'} @classmethod def poll(cls, context): diff --git a/source/blender/blenkernel/BKE_global.h b/source/blender/blenkernel/BKE_global.h index 4bb2b950901..830518906ab 100644 --- a/source/blender/blenkernel/BKE_global.h +++ b/source/blender/blenkernel/BKE_global.h @@ -189,11 +189,6 @@ enum { # error Either __BIG_ENDIAN__ or __LITTLE_ENDIAN__ must be defined. #endif -/* there is really no good place for this */ -#if defined(FREE_WINDOWS) && ((__GNUC__ < 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ < 6))) -# error "Mingw requires GCC 4.6 minimum" -#endif - #define L_ENDIAN 1 #define B_ENDIAN 0 diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c index 18fe6d1deee..c743d1f7e11 100644 --- a/source/blender/blenkernel/intern/cdderivedmesh.c +++ b/source/blender/blenkernel/intern/cdderivedmesh.c @@ -2864,9 +2864,12 @@ DerivedMesh *CDDM_merge_verts(DerivedMesh *dm, const int *vtargetmap, const int STACK_DECLARE(mvert); STACK_DECLARE(oldv); - MEdge *med, *medge = MEM_mallocN(sizeof(*medge) * totedge, __func__); - int *olde = MEM_mallocN(sizeof(*olde) * totedge, __func__); - int *newe = MEM_mallocN(sizeof(*newe) * totedge, __func__); + /* Note: create (totedge + totloop) elements because partially invalid polys due to merge may require + * generating new edges, and while in 99% cases we'll still end with less final edges than totedge, + * cases can be forged that would end requiring more... */ + MEdge *med, *medge = MEM_mallocN(sizeof(*medge) * (totedge + totloop), __func__); + int *olde = MEM_mallocN(sizeof(*olde) * (totedge + totloop), __func__); + int *newe = MEM_mallocN(sizeof(*newe) * (totedge + totloop), __func__); STACK_DECLARE(medge); STACK_DECLARE(olde); @@ -2900,7 +2903,7 @@ DerivedMesh *CDDM_merge_verts(DerivedMesh *dm, const int *vtargetmap, const int STACK_INIT(mloop, totloop); STACK_INIT(mpoly, totpoly); - /* fill newl with destination vertex indices */ + /* fill newv with destination vertex indices */ mv = cddm->mvert; c = 0; for (i = 0; i < totvert; i++, mv++) { @@ -2989,83 +2992,80 @@ DerivedMesh *CDDM_merge_verts(DerivedMesh *dm, const int *vtargetmap, const int mp = cddm->mpoly; + mv = cddm->mvert; for (i = 0; i < totpoly; i++, mp++) { MPoly *mp_new; ml = cddm->mloop + mp->loopstart; /* check faces with all vertices merged */ - { - bool all_vertices_merged = true; + bool all_vertices_merged = true; - for (j = 0; j < mp->totloop; j++, ml++) { - if (vtargetmap[ml->v] == -1) { - all_vertices_merged = false; - break; - } + for (j = 0; j < mp->totloop; j++, ml++) { + if (vtargetmap[ml->v] == -1) { + all_vertices_merged = false; + /* This will be used to check for poly using several time the same vert. */ + mv[ml->v].flag &= ~ME_VERT_TMP_TAG; } + else { + /* This will be used to check for poly using several time the same vert. */ + mv[vtargetmap[ml->v]].flag &= ~ME_VERT_TMP_TAG; + } + } - if (UNLIKELY(all_vertices_merged)) { - if (merge_mode == CDDM_MERGE_VERTS_DUMP_IF_MAPPED) { - /* In this mode, all vertices merged is enough to dump face */ - continue; + if (UNLIKELY(all_vertices_merged)) { + if (merge_mode == CDDM_MERGE_VERTS_DUMP_IF_MAPPED) { + /* In this mode, all vertices merged is enough to dump face */ + continue; + } + else if (merge_mode == CDDM_MERGE_VERTS_DUMP_IF_EQUAL) { + /* Additional condition for face dump: target vertices must make up an identical face */ + /* The test has 2 steps: (1) first step is fast ghash lookup, but not failproof */ + /* (2) second step is thorough but more costly poly compare */ + int i_poly, v_target; + bool found = false; + PolyKey pkey; + + /* Use poly_gset for fast (although not 100% certain) identification of same poly */ + /* First, make up a poly_summary structure */ + ml = cddm->mloop + mp->loopstart; + pkey.hash_sum = pkey.hash_xor = 0; + pkey.totloops = 0; + for (j = 0; j < mp->totloop; j++, ml++) { + v_target = vtargetmap[ml->v]; /* Cannot be -1, they are all mapped */ + pkey.hash_sum += v_target; + pkey.hash_xor ^= v_target; + pkey.totloops++; } - else if (merge_mode == CDDM_MERGE_VERTS_DUMP_IF_EQUAL) { - /* Additional condition for face dump: target vertices must make up an identical face */ - /* The test has 2 steps: (1) first step is fast ghash lookup, but not failproof */ - /* (2) second step is thorough but more costly poly compare */ - int i_poly, v_target, v_prev; - bool found = false; - PolyKey pkey; - - /* Use poly_gset for fast (although not 100% certain) identification of same poly */ - /* First, make up a poly_summary structure */ + if (BLI_gset_haskey(poly_gset, &pkey)) { + + /* There might be a poly that matches this one. + * We could just leave it there and say there is, and do a "continue". + * ... but we are checking whether there is an exact poly match. + * It's not so costly in terms of CPU since it's very rare, just a lot of complex code. + */ + + /* Consider current loop again */ ml = cddm->mloop + mp->loopstart; - pkey.hash_sum = pkey.hash_xor = 0; - pkey.totloops = 0; - v_prev = vtargetmap[(ml + mp->totloop -1)->v]; /* since it loops around, the prev of first is the last */ - for (j = 0; j < mp->totloop; j++, ml++) { - v_target = vtargetmap[ml->v]; /* Cannot be -1, they are all mapped */ - if (v_target == v_prev) { - /* consecutive vertices in loop map to the same target: discard */ - /* but what about last to first ? */ - continue; + /* Consider the target of the loop's first vert */ + v_target = vtargetmap[ml->v]; + /* Now see if v_target belongs to a poly that shares all vertices with source poly, + * in same order, or reverse order */ + + for (i_poly = 0; i_poly < cddm->pmap[v_target].count; i_poly++) { + MPoly *target_poly = cddm->mpoly + *(cddm->pmap[v_target].indices + i_poly); + + if (cddm_poly_compare(cddm->mloop, mp, target_poly, vtargetmap, +1) || + cddm_poly_compare(cddm->mloop, mp, target_poly, vtargetmap, -1)) + { + found = true; + break; } - pkey.hash_sum += v_target; - pkey.hash_xor ^= v_target; - pkey.totloops++; - v_prev = v_target; } - if (BLI_gset_haskey(poly_gset, &pkey)) { - - /* There might be a poly that matches this one. - * We could just leave it there and say there is, and do a "continue". - * ... but we are checking whether there is an exact poly match. - * It's not so costly in terms of CPU since it's very rare, just a lot of complex code. - */ - - /* Consider current loop again */ - ml = cddm->mloop + mp->loopstart; - /* Consider the target of the loop's first vert */ - v_target = vtargetmap[ml->v]; - /* Now see if v_target belongs to a poly that shares all vertices with source poly, - * in same order, or reverse order */ - - for (i_poly = 0; i_poly < cddm->pmap[v_target].count; i_poly++) { - MPoly *target_poly = cddm->mpoly + *(cddm->pmap[v_target].indices + i_poly); - - if (cddm_poly_compare(cddm->mloop, mp, target_poly, vtargetmap, +1) || - cddm_poly_compare(cddm->mloop, mp, target_poly, vtargetmap, -1)) - { - found = true; - break; - } - } - if (found) { - /* Current poly's vertices are mapped to a poly that is strictly identical */ - /* Current poly is dumped */ - continue; - } + if (found) { + /* Current poly's vertices are mapped to a poly that is strictly identical */ + /* Current poly is dumped */ + continue; } } } @@ -3079,32 +3079,121 @@ DerivedMesh *CDDM_merge_verts(DerivedMesh *dm, const int *vtargetmap, const int ml = cddm->mloop + mp->loopstart; c = 0; + MLoop *last_valid_ml = NULL; + MLoop *first_valid_ml = NULL; + bool need_edge_from_last_valid_ml = false; + bool need_edge_to_first_valid_ml = false; + int created_edges = 0; for (j = 0; j < mp->totloop; j++, ml++) { - unsigned int v1, v2; + const uint mlv = (vtargetmap[ml->v] != -1) ? vtargetmap[ml->v] : ml->v; +#ifndef NDEBUG + { + MLoop *next_ml = cddm->mloop + mp->loopstart + ((j + 1) % mp->totloop); + uint next_mlv = (vtargetmap[next_ml->v] != -1) ? vtargetmap[next_ml->v] : next_ml->v; + med = cddm->medge + ml->e; + uint v1 = (vtargetmap[med->v1] != -1) ? vtargetmap[med->v1] : med->v1; + uint v2 = (vtargetmap[med->v2] != -1) ? vtargetmap[med->v2] : med->v2; + BLI_assert((mlv == v1 && next_mlv == v2) || (mlv == v2 && next_mlv == v1)); + } +#endif + /* A loop is only valid if its matching edge is, and it's not reusing a vertex already used by this poly. */ + if (LIKELY((newe[ml->e] != -1) && ((mv[mlv].flag & ME_VERT_TMP_TAG) == 0))) { + mv[mlv].flag |= ME_VERT_TMP_TAG; + + if (UNLIKELY(last_valid_ml != NULL && need_edge_from_last_valid_ml)) { + /* We need to create a new edge between last valid loop and this one! */ + void **val_p; + + uint v1 = (vtargetmap[last_valid_ml->v] != -1) ? vtargetmap[last_valid_ml->v] : last_valid_ml->v; + uint v2 = mlv; + BLI_assert(v1 != v2); + if (BLI_edgehash_ensure_p(ehash, v1, v2, &val_p)) { + last_valid_ml->e = GET_INT_FROM_POINTER(*val_p); + } + else { + const int new_eidx = STACK_SIZE(medge); + STACK_PUSH(olde, olde[last_valid_ml->e]); + STACK_PUSH(medge, cddm->medge[last_valid_ml->e]); + medge[new_eidx].v1 = last_valid_ml->v; + medge[new_eidx].v2 = ml->v; + /* DO NOT change newe mapping, could break actual values due to some deleted original edges. */ + *val_p = SET_INT_IN_POINTER(new_eidx); + created_edges++; + + last_valid_ml->e = new_eidx; + } + need_edge_from_last_valid_ml = false; + } - med = cddm->medge + ml->e; - v1 = (vtargetmap[med->v1] != -1) ? vtargetmap[med->v1] : med->v1; - v2 = (vtargetmap[med->v2] != -1) ? vtargetmap[med->v2] : med->v2; - if (LIKELY(v1 != v2)) { #ifdef USE_LOOPS newl[j + mp->loopstart] = STACK_SIZE(mloop); #endif STACK_PUSH(oldl, j + mp->loopstart); - STACK_PUSH(mloop, *ml); + last_valid_ml = STACK_PUSH_RET_PTR(mloop); + *last_valid_ml = *ml; + if (first_valid_ml == NULL) { + first_valid_ml = last_valid_ml; + } c++; + + /* We absolutely HAVE to handle edge index remapping here, otherwise potential newly created edges + * in that part of code make remapping later totally unreliable. */ + BLI_assert(newe[ml->e] != -1); + last_valid_ml->e = newe[ml->e]; + } + else { + if (last_valid_ml != NULL) { + need_edge_from_last_valid_ml = true; + } + else { + need_edge_to_first_valid_ml = true; + } } } + if (UNLIKELY(last_valid_ml != NULL && !ELEM(first_valid_ml, NULL, last_valid_ml) && + (need_edge_to_first_valid_ml || need_edge_from_last_valid_ml))) + { + /* We need to create a new edge between last valid loop and first valid one! */ + void **val_p; + + uint v1 = (vtargetmap[last_valid_ml->v] != -1) ? vtargetmap[last_valid_ml->v] : last_valid_ml->v; + uint v2 = (vtargetmap[first_valid_ml->v] != -1) ? vtargetmap[first_valid_ml->v] : first_valid_ml->v; + BLI_assert(v1 != v2); + if (BLI_edgehash_ensure_p(ehash, v1, v2, &val_p)) { + last_valid_ml->e = GET_INT_FROM_POINTER(*val_p); + } + else { + const int new_eidx = STACK_SIZE(medge); + STACK_PUSH(olde, olde[last_valid_ml->e]); + STACK_PUSH(medge, cddm->medge[last_valid_ml->e]); + medge[new_eidx].v1 = last_valid_ml->v; + medge[new_eidx].v2 = first_valid_ml->v; + /* DO NOT change newe mapping, could break actual values due to some deleted original edges. */ + *val_p = SET_INT_IN_POINTER(new_eidx); + created_edges++; + + last_valid_ml->e = new_eidx; + } + need_edge_to_first_valid_ml = need_edge_from_last_valid_ml = false; + } if (UNLIKELY(c == 0)) { + BLI_assert(created_edges == 0); continue; } else if (UNLIKELY(c < 3)) { STACK_DISCARD(oldl, c); STACK_DISCARD(mloop, c); + if (created_edges > 0) { + for (j = STACK_SIZE(medge) - created_edges; j < STACK_SIZE(medge); j++) { + BLI_edgehash_remove(ehash, medge[j].v1, medge[j].v2, NULL); + } + STACK_DISCARD(olde, created_edges); + STACK_DISCARD(medge, created_edges); + } continue; } - mp_new = STACK_PUSH_RET_PTR(mpoly); *mp_new = *mp; mp_new->totloop = c; @@ -3129,10 +3218,10 @@ DerivedMesh *CDDM_merge_verts(DerivedMesh *dm, const int *vtargetmap, const int /*update edge indices and copy customdata*/ med = medge; for (i = 0; i < cddm2->dm.numEdgeData; i++, med++) { - if (newv[med->v1] != -1) - med->v1 = newv[med->v1]; - if (newv[med->v2] != -1) - med->v2 = newv[med->v2]; + BLI_assert(newv[med->v1] != -1); + med->v1 = newv[med->v1]; + BLI_assert(newv[med->v2] != -1); + med->v2 = newv[med->v2]; /* Can happen in case vtargetmap contains some double chains, we do not support that. */ BLI_assert(med->v1 != med->v2); @@ -3143,11 +3232,10 @@ DerivedMesh *CDDM_merge_verts(DerivedMesh *dm, const int *vtargetmap, const int /*update loop indices and copy customdata*/ ml = mloop; for (i = 0; i < cddm2->dm.numLoopData; i++, ml++) { - if (newe[ml->e] != -1) - ml->e = newe[ml->e]; - if (newv[ml->v] != -1) - ml->v = newv[ml->v]; - + /* Edge remapping has already be done in main loop handling part above. */ + BLI_assert(newv[ml->v] != -1); + ml->v = newv[ml->v]; + CustomData_copy_data(&dm->loopData, &cddm2->dm.loopData, oldl[i], i, 1); } diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c index 65d96a3b9f6..f5b7c7de9c3 100644 --- a/source/blender/blenkernel/intern/customdata.c +++ b/source/blender/blenkernel/intern/customdata.c @@ -1925,17 +1925,16 @@ void *CustomData_add_layer_named(CustomData *data, int type, int alloctype, bool CustomData_free_layer(CustomData *data, int type, int totelem, int index) { - if (index < 0) { - return false; - } const int index_first = CustomData_get_layer_index(data, type); - if (index_first == -1) { - return false; - } - const int n = index - index_first; int i; + BLI_assert(index >= index_first); + if ((index_first == -1) || (n < 0)) { + return false; + } + BLI_assert(data->layers[index].type == type); + customData_free_layer__internal(&data->layers[index], totelem); for (i = index + 1; i < data->totlayer; ++i) diff --git a/source/blender/blenkernel/intern/mesh_validate.c b/source/blender/blenkernel/intern/mesh_validate.c index 215d2015d07..54de843bc64 100644 --- a/source/blender/blenkernel/intern/mesh_validate.c +++ b/source/blender/blenkernel/intern/mesh_validate.c @@ -585,8 +585,8 @@ bool BKE_mesh_validate_arrays(Mesh *mesh, int prev_e = ml->e; ml->e = GET_INT_FROM_POINTER(BLI_edgehash_lookup(edge_hash, v1, v2)); fix_flag.loops_edge = true; - PRINT_ERR("\tPoly %u has invalid edge reference (%d), fixed using edge %u\n", - sp->index, prev_e, ml->e); + PRINT_ERR("\tPoly %u has invalid edge reference (%d, is_removed: %d), fixed using edge %u\n", + sp->index, prev_e, IS_REMOVED_EDGE(me), ml->e); } else { PRINT_ERR("\tPoly %u has invalid edge reference (%u)\n", sp->index, ml->e); diff --git a/source/blender/blenkernel/intern/tracking.c b/source/blender/blenkernel/intern/tracking.c index 990d250b854..bfe8dcbb21e 100644 --- a/source/blender/blenkernel/intern/tracking.c +++ b/source/blender/blenkernel/intern/tracking.c @@ -974,8 +974,11 @@ static void track_mask_set_pixel_cb(int x, int x_end, int y, void *user_data) } static void track_mask_gpencil_layer_rasterize(int frame_width, int frame_height, - MovieTrackingMarker *marker, bGPDlayer *layer, - float *mask, int mask_width, int mask_height) + const float region_min[2], + bGPDlayer *layer, + float *mask, + int mask_width, + int mask_height) { bGPDframe *frame = layer->frames.first; TrackMaskSetPixelData data; @@ -994,8 +997,8 @@ static void track_mask_gpencil_layer_rasterize(int frame_width, int frame_height point = mask_points = MEM_callocN(2 * stroke->totpoints * sizeof(int), "track mask rasterization points"); for (int i = 0; i < stroke->totpoints; i++, point += 2) { - point[0] = (stroke_points[i].x - marker->search_min[0]) * frame_width; - point[1] = (stroke_points[i].y - marker->search_min[1]) * frame_height; + point[0] = stroke_points[i].x * frame_width - region_min[0]; + point[1] = stroke_points[i].y * frame_height - region_min[1]; } /* TODO: add an option to control whether AA is enabled or not */ BLI_bitmap_draw_2d_poly_v2i_n( @@ -1010,26 +1013,42 @@ static void track_mask_gpencil_layer_rasterize(int frame_width, int frame_height } } -float *BKE_tracking_track_get_mask(int frame_width, int frame_height, - MovieTrackingTrack *track, MovieTrackingMarker *marker) +/* Region is in pixel space, relative to marker's center. */ +float *tracking_track_get_mask_for_region(int frame_width, int frame_height, + const float region_min[2], + const float region_max[2], + MovieTrackingTrack *track) { float *mask = NULL; bGPDlayer *layer = track_mask_gpencil_layer_get(track); - int mask_width, mask_height; - - mask_width = (marker->search_max[0] - marker->search_min[0]) * frame_width; - mask_height = (marker->search_max[1] - marker->search_min[1]) * frame_height; - - if (layer) { + if (layer != NULL) { + const int mask_width = region_max[0] - region_min[0]; + const int mask_height = region_max[1] - region_min[1]; mask = MEM_callocN(mask_width * mask_height * sizeof(float), "track mask"); - - track_mask_gpencil_layer_rasterize(frame_width, frame_height, marker, layer, - mask, mask_width, mask_height); + track_mask_gpencil_layer_rasterize(frame_width, frame_height, + region_min, + layer, + mask, + mask_width, mask_height); } - return mask; } +float *BKE_tracking_track_get_mask(int frame_width, int frame_height, + MovieTrackingTrack *track, + MovieTrackingMarker *marker) +{ + /* Convert normalized space marker's search area to pixel-space region. */ + const float region_min[2] = {marker->search_min[0] * frame_width, + marker->search_min[1] * frame_height}; + const float region_max[2] = {marker->search_max[0] * frame_width, + marker->search_max[1] * frame_height}; + return tracking_track_get_mask_for_region(frame_width, frame_height, + region_min, + region_max, + track); +} + float BKE_tracking_track_get_weight_for_marker(MovieClip *clip, MovieTrackingTrack *track, MovieTrackingMarker *marker) { FCurve *weight_fcurve; diff --git a/source/blender/blenkernel/intern/tracking_auto.c b/source/blender/blenkernel/intern/tracking_auto.c index 3b56ea271d0..9475925cdda 100644 --- a/source/blender/blenkernel/intern/tracking_auto.c +++ b/source/blender/blenkernel/intern/tracking_auto.c @@ -36,8 +36,9 @@ #include "DNA_movieclip_types.h" #include "DNA_object_types.h" /* SELECT */ -#include "BLI_threads.h" #include "BLI_utildefines.h" +#include "BLI_listbase.h" +#include "BLI_threads.h" #include "BLI_math.h" #include "BKE_movieclip.h" @@ -76,6 +77,9 @@ typedef struct AutoTrackContext { int num_tracks; /* Number of tracks being tracked. */ AutoTrackOptions *options; /* Per-tracking track options. */ + /* Array of all tracks, indexed by track_index. */ + MovieTrackingTrack **tracks; + bool backwards; bool sequence; int first_frame; @@ -306,8 +310,15 @@ AutoTrackContext *BKE_autotrack_context_new(MovieClip *clip, BLI_spin_init(&context->spin_lock); + int num_total_tracks = BLI_listbase_count(tracksbase); + context->tracks = + MEM_callocN(sizeof(MovieTrackingTrack*) * num_total_tracks, + "auto track pointers"); + context->image_accessor = - tracking_image_accessor_new(context->clips, 1, user->framenr); + tracking_image_accessor_new(context->clips, 1, + context->tracks, num_total_tracks, + user->framenr); context->autotrack = libmv_autoTrackNew(context->image_accessor->libmv_accessor); @@ -361,6 +372,7 @@ AutoTrackContext *BKE_autotrack_context_new(MovieClip *clip, options->use_keyframe_match = track->pattern_match == TRACK_MATCH_KEYFRAME; } + context->tracks[track_index] = track; ++track_index; } @@ -565,6 +577,7 @@ void BKE_autotrack_context_free(AutoTrackContext *context) libmv_autoTrackDestroy(context->autotrack); tracking_image_accessor_destroy(context->image_accessor); MEM_freeN(context->options); + MEM_freeN(context->tracks); BLI_spin_end(&context->spin_lock); MEM_freeN(context); } diff --git a/source/blender/blenkernel/intern/tracking_util.c b/source/blender/blenkernel/intern/tracking_util.c index 1c056cda68d..a95399562d5 100644 --- a/source/blender/blenkernel/intern/tracking_util.c +++ b/source/blender/blenkernel/intern/tracking_util.c @@ -875,8 +875,64 @@ static void accessor_release_image_callback(libmv_CacheKey cache_key) IMB_freeImBuf(ibuf); } +static libmv_CacheKey accessor_get_mask_for_track_callback( + libmv_FrameAccessorUserData* user_data, + int clip_index, + int frame, + int track_index, + const libmv_Region *region, + float **r_destination, + int *r_width, + int *r_height) +{ + /* Perform sanity checks first. */ + TrackingImageAccessor *accessor = (TrackingImageAccessor *) user_data; + BLI_assert(clip_index < accessor->num_clips); + BLI_assert(track_index < accessor->num_tracks); + MovieTrackingTrack *track = accessor->tracks[track_index]; + /* Early output, track does not use mask. */ + if ((track->algorithm_flag & TRACK_ALGORITHM_FLAG_USE_MASK) == 0) { + return NULL; + } + MovieClip *clip = accessor->clips[clip_index]; + /* Construct fake user so we can access movie clip. */ + MovieClipUser user; + int scene_frame = BKE_movieclip_remap_clip_to_scene_frame(clip, frame); + BKE_movieclip_user_set_frame(&user, scene_frame); + user.render_size = MCLIP_PROXY_RENDER_SIZE_FULL; + user.render_flag = 0; + /* Get frame width and height so we can convert stroke coordinates + * and other things from normalized to pixel space. + */ + int frame_width, frame_height; + BKE_movieclip_get_size(clip, &user, &frame_width, &frame_height); + /* Actual mask sampling. */ + MovieTrackingMarker *marker = BKE_tracking_marker_get_exact(track, frame); + const float region_min[2] = {region->min[0] - marker->pos[0] * frame_width, + region->min[1] - marker->pos[1] * frame_height}; + const float region_max[2] = {region->max[0] - marker->pos[0] * frame_width, + region->max[1] - marker->pos[1] * frame_height}; + *r_destination = tracking_track_get_mask_for_region(frame_width, frame_height, + region_min, + region_max, + track); + *r_width = region->max[0] - region->min[0]; + *r_height = region->max[1] - region->min[1]; + return *r_destination; +} + +static void accessor_release_mask_callback(libmv_CacheKey cache_key) +{ + if (cache_key != NULL) { + float *mask = (float *)cache_key; + MEM_freeN(mask); + } +} + TrackingImageAccessor *tracking_image_accessor_new(MovieClip *clips[MAX_ACCESSOR_CLIP], int num_clips, + MovieTrackingTrack **tracks, + int num_tracks, int start_frame) { TrackingImageAccessor *accessor = @@ -891,12 +947,16 @@ TrackingImageAccessor *tracking_image_accessor_new(MovieClip *clips[MAX_ACCESSOR memcpy(accessor->clips, clips, num_clips * sizeof(MovieClip *)); accessor->num_clips = num_clips; + accessor->tracks = tracks; + accessor->num_tracks = num_tracks; accessor->start_frame = start_frame; accessor->libmv_accessor = libmv_FrameAccessorNew((libmv_FrameAccessorUserData *) accessor, accessor_get_image_callback, - accessor_release_image_callback); + accessor_release_image_callback, + accessor_get_mask_for_track_callback, + accessor_release_mask_callback); return accessor; } diff --git a/source/blender/blenkernel/intern/writeframeserver.c b/source/blender/blenkernel/intern/writeframeserver.c index 212af76a7e8..4757186f546 100644 --- a/source/blender/blenkernel/intern/writeframeserver.c +++ b/source/blender/blenkernel/intern/writeframeserver.c @@ -268,11 +268,7 @@ int BKE_frameserver_loop(void *context_v, RenderData *rd, ReportList *UNUSED(rep struct timeval tv; struct sockaddr_in addr; int len, rval; -#ifdef FREE_WINDOWS - int socklen; -#else unsigned int socklen; -#endif char buf[4096]; FrameserverContext *context = context_v; diff --git a/source/blender/blenkernel/tracking_private.h b/source/blender/blenkernel/tracking_private.h index 591ee4d0d01..1a68a1cac6a 100644 --- a/source/blender/blenkernel/tracking_private.h +++ b/source/blender/blenkernel/tracking_private.h @@ -105,6 +105,13 @@ struct MovieTrackingMarker *tracking_get_keyframed_marker( int current_frame, bool backwards); +/*********************** Masking *************************/ + +float *tracking_track_get_mask_for_region(int frame_width, int frame_height, + const float region_min[2], + const float region_max[2], + MovieTrackingTrack *track); + /*********************** Frame accessr *************************/ struct libmv_FrameAccessor; @@ -114,12 +121,16 @@ typedef struct TrackingImageAccessor { struct MovieCache *cache; struct MovieClip *clips[MAX_ACCESSOR_CLIP]; int num_clips; + struct MovieTrackingTrack **tracks; + int num_tracks; int start_frame; struct libmv_FrameAccessor *libmv_accessor; } TrackingImageAccessor; TrackingImageAccessor *tracking_image_accessor_new(MovieClip *clips[MAX_ACCESSOR_CLIP], int num_clips, + MovieTrackingTrack **tracks, + int num_tracks, int start_frame); void tracking_image_accessor_destroy(TrackingImageAccessor *accessor); diff --git a/source/blender/blenlib/BLI_alloca.h b/source/blender/blenlib/BLI_alloca.h index b44e6c66d2a..4fa69a24966 100644 --- a/source/blender/blenlib/BLI_alloca.h +++ b/source/blender/blenlib/BLI_alloca.h @@ -29,10 +29,6 @@ /* BLI_array_alloca / alloca */ -#if defined(__MINGW32__) -# include <malloc.h> /* mingw needs for alloca() */ -#endif - #if defined(__GNUC__) || defined(__clang__) #if defined(__cplusplus) && (__cplusplus > 199711L) #define BLI_array_alloca(arr, realsize) \ diff --git a/source/blender/blenlib/BLI_compiler_compat.h b/source/blender/blenlib/BLI_compiler_compat.h index 8edbc25bcbc..01fc9d70207 100644 --- a/source/blender/blenlib/BLI_compiler_compat.h +++ b/source/blender/blenlib/BLI_compiler_compat.h @@ -32,11 +32,6 @@ # define alloca _alloca #endif -/* alloca is defined here for MinGW32 */ -#ifdef __MINGW32__ -# include <malloc.h> -#endif - #if defined(__cplusplus) && ((__cplusplus >= 201103L) || defined(_MSC_VER)) # define HAS_CPP11_FEATURES #endif diff --git a/source/blender/blenlib/BLI_fileops.h b/source/blender/blenlib/BLI_fileops.h index 91d139c7085..5c1fa57886a 100644 --- a/source/blender/blenlib/BLI_fileops.h +++ b/source/blender/blenlib/BLI_fileops.h @@ -65,10 +65,8 @@ int BLI_create_symlink(const char *path, const char *to) ATTR_NONNULL(); /* keep in sync with the definition of struct direntry in BLI_fileops_types.h */ #ifdef WIN32 -# if defined(_MSC_VER) || defined(__MINGW64__) +# if defined(_MSC_VER) typedef struct _stat64 BLI_stat_t; -# elif defined(__MINGW32__) -typedef struct _stati64 BLI_stat_t; # else typedef struct _stat BLI_stat_t; # endif diff --git a/source/blender/blenlib/BLI_fileops_types.h b/source/blender/blenlib/BLI_fileops_types.h index 0cf8c8ddb4a..0ffa3276f1f 100644 --- a/source/blender/blenlib/BLI_fileops_types.h +++ b/source/blender/blenlib/BLI_fileops_types.h @@ -35,7 +35,7 @@ #include <sys/stat.h> -#if defined(WIN32) && !defined(FREE_WINDOWS) +#if defined(WIN32) typedef unsigned int mode_t; #endif @@ -50,10 +50,8 @@ struct direntry { const char *relname; const char *path; #ifdef WIN32 /* keep in sync with the definition of BLI_stat_t in BLI_fileops.h */ -# if defined(_MSC_VER) || defined(__MINGW64__) +# if defined(_MSC_VER) struct _stat64 s; -# elif defined(__MINGW32__) - struct _stati64 s; # else struct _stat s; # endif diff --git a/source/blender/blenlib/BLI_sys_types.h b/source/blender/blenlib/BLI_sys_types.h index 9d8222c575d..9477f61713c 100644 --- a/source/blender/blenlib/BLI_sys_types.h +++ b/source/blender/blenlib/BLI_sys_types.h @@ -65,8 +65,8 @@ typedef uint64_t u_int64_t; #include <inttypes.h> -/* MinGW and MSVC >= 2010 */ -#elif defined(FREE_WINDOWS) || defined(_MSC_VER) +/* MSVC >= 2010 */ +#elif defined(_MSC_VER) #include <stdint.h> #else diff --git a/source/blender/blenlib/BLI_winstuff.h b/source/blender/blenlib/BLI_winstuff.h index b421b7dbb90..6fbbed01400 100644 --- a/source/blender/blenlib/BLI_winstuff.h +++ b/source/blender/blenlib/BLI_winstuff.h @@ -37,15 +37,6 @@ # error "This include is for Windows only!" #endif -#ifdef FREE_WINDOWS -# ifdef WINVER -# undef WINVER -# endif - -/* Some stuff requires WINVER 0x500, but mingw's default is 0x400 */ -# define WINVER 0x0501 -#endif - #define WIN32_LEAN_AND_MEAN #ifndef WIN32_SKIP_HKEY_PROTECTION @@ -94,7 +85,7 @@ extern "C" { # define snprintf _snprintf #endif -#if defined(_MSC_VER) || (defined(FREE_WINDOWS) && !defined(FREE_WINDOWS64)) +#if defined(_MSC_VER) # define R_OK 4 # define W_OK 2 // not accepted by access() on windows @@ -102,28 +93,22 @@ extern "C" { # define F_OK 0 #endif -#ifndef FREE_WINDOWS typedef unsigned int mode_t; -#endif /* use functions that take a 64 bit offset for files larger than 4GB */ -#ifndef FREE_WINDOWS -# include <stdio.h> -# define fseek(stream, offset, origin) _fseeki64(stream, offset, origin) -# define ftell(stream) _ftelli64(stream) -# define lseek(fd, offset, origin) _lseeki64(fd, offset, origin) -# define tell(fd) _telli64(fd) -#endif +#include <stdio.h> +#define fseek(stream, offset, origin) _fseeki64(stream, offset, origin) +#define ftell(stream) _ftelli64(stream) +#define lseek(fd, offset, origin) _lseeki64(fd, offset, origin) +#define tell(fd) _telli64(fd) + -/* mingw using _SSIZE_T_ to declare ssize_t type */ #ifndef _SSIZE_T_ # define _SSIZE_T_ /* python uses HAVE_SSIZE_T */ # ifndef HAVE_SSIZE_T # define HAVE_SSIZE_T 1 -# ifndef FREE_WINDOWS64 typedef long ssize_t; -# endif # endif #endif diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c index db4b3bcf20c..1df7f6f81e4 100644 --- a/source/blender/blenlib/intern/fileops.c +++ b/source/blender/blenlib/intern/fileops.c @@ -42,9 +42,6 @@ #include "zlib.h" #ifdef WIN32 -# ifdef __MINGW32__ -# include <ctype.h> -# endif # include <io.h> # include "BLI_winstuff.h" # include "BLI_callbacks.h" @@ -265,7 +262,7 @@ void *BLI_gzopen(const char *filename, const char *mode) /* temporary #if until we update all libraries to 1.2.7 * for correct wide char path handling */ -#if ZLIB_VERNUM >= 0x1270 && !defined(FREE_WINDOWS) +#if ZLIB_VERNUM >= 0x1270 UTF16_ENCODE(filename); gzfile = gzopen_w(filename_16, mode); diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c index 40b6aaa18c1..4b3a74d02ae 100644 --- a/source/blender/blenlib/intern/path_util.c +++ b/source/blender/blenlib/intern/path_util.c @@ -1173,22 +1173,10 @@ bool BLI_path_program_search( void BLI_setenv(const char *env, const char *val) { /* free windows */ -#if (defined(WIN32) || defined(WIN64)) && defined(FREE_WINDOWS) - char *envstr; - if (val) - envstr = BLI_sprintfN("%s=%s", env, val); - else - envstr = BLI_sprintfN("%s=", env); - - putenv(envstr); - MEM_freeN(envstr); - - /* non-free windows */ -#elif (defined(WIN32) || defined(WIN64)) /* not free windows */ +#if (defined(WIN32) || defined(WIN64)) uputenv(env, val); - #else /* linux/osx/bsd */ if (val) diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c index 3edc00a8c1a..48280c14d7d 100644 --- a/source/blender/blenlib/intern/storage.c +++ b/source/blender/blenlib/intern/storage.c @@ -113,7 +113,7 @@ double BLI_dir_free_space(const char *dir) #ifdef WIN32 DWORD sectorspc, bytesps, freec, clusters; char tmp[4]; - + tmp[0] = '\\'; tmp[1] = 0; /* Just a failsafe */ if (dir[0] == '/' || dir[0] == '\\') { tmp[0] = '\\'; @@ -139,10 +139,10 @@ double BLI_dir_free_space(const char *dir) char name[FILE_MAXDIR], *slash; int len = strlen(dir); - + if (len >= FILE_MAXDIR) /* path too long */ return -1; - + strcpy(name, dir); if (len) { @@ -194,7 +194,7 @@ size_t BLI_file_size(const char *path) */ int BLI_exists(const char *name) { -#if defined(WIN32) +#if defined(WIN32) BLI_stat_t st; wchar_t *tmp_16 = alloc_utf16_from_8(name, 1); int len, res; @@ -253,10 +253,8 @@ int BLI_stat(const char *path, BLI_stat_t *buffer) int BLI_wstat(const wchar_t *path, BLI_stat_t *buffer) { -#if defined(_MSC_VER) || defined(__MINGW64__) +#if defined(_MSC_VER) return _wstat64(path, buffer); -#elif defined(__MINGW32__) - return _wstati64(path, buffer); #else return _wstat(path, buffer); #endif @@ -372,7 +370,7 @@ LinkNode *BLI_file_read_as_lines(const char *name) size_t size; if (!fp) return NULL; - + fseek(fp, 0, SEEK_END); size = (size_t)ftell(fp); fseek(fp, 0, SEEK_SET); @@ -385,7 +383,7 @@ LinkNode *BLI_file_read_as_lines(const char *name) buf = MEM_mallocN(size, "file_as_lines"); if (buf) { size_t i, last = 0; - + /* * size = because on win32 reading * all the bytes in the file will return @@ -403,10 +401,10 @@ LinkNode *BLI_file_read_as_lines(const char *name) last = i + 1; } } - + MEM_freeN(buf); } - + fclose(fp); return lines.list; @@ -424,23 +422,13 @@ void BLI_file_free_lines(LinkNode *lines) bool BLI_file_older(const char *file1, const char *file2) { #ifdef WIN32 -#ifndef __MINGW32__ - struct _stat st1, st2; -#else - struct _stati64 st1, st2; -#endif + struct _stat st1, st2; UTF16_ENCODE(file1); UTF16_ENCODE(file2); - -#ifndef __MINGW32__ - if (_wstat(file1_16, &st1)) return false; - if (_wstat(file2_16, &st2)) return false; -#else - if (_wstati64(file1_16, &st1)) return false; - if (_wstati64(file2_16, &st2)) return false; -#endif + if (_wstat(file1_16, &st1)) return false; + if (_wstat(file2_16, &st2)) return false; UTF16_UN_ENCODE(file2); UTF16_UN_ENCODE(file1); diff --git a/source/blender/blenlib/intern/winstuff.c b/source/blender/blenlib/intern/winstuff.c index 3b06b7df09a..d6834428376 100644 --- a/source/blender/blenlib/intern/winstuff.c +++ b/source/blender/blenlib/intern/winstuff.c @@ -160,8 +160,6 @@ void RegisterBlendExtension(void) GetSystemDirectory(SysDir, FILE_MAXDIR); #ifdef _WIN64 ThumbHandlerDLL = "BlendThumb64.dll"; -#elif defined(__MINGW32__) - ThumbHandlerDLL = "BlendThumb.dll"; #else IsWow64Process(GetCurrentProcess(), &IsWOW64); if (IsWOW64 == true) diff --git a/source/blender/collada/MeshImporter.cpp b/source/blender/collada/MeshImporter.cpp index 6af10425f50..616c254a6ea 100644 --- a/source/blender/collada/MeshImporter.cpp +++ b/source/blender/collada/MeshImporter.cpp @@ -27,7 +27,7 @@ #include <algorithm> -#if !defined(WIN32) || defined(FREE_WINDOWS) +#if !defined(WIN32) #include <iostream> #endif diff --git a/source/blender/collada/SkinInfo.cpp b/source/blender/collada/SkinInfo.cpp index 71875d6274a..c48c060dc95 100644 --- a/source/blender/collada/SkinInfo.cpp +++ b/source/blender/collada/SkinInfo.cpp @@ -27,7 +27,7 @@ #include <algorithm> -#if !defined(WIN32) || defined(FREE_WINDOWS) +#if !defined(WIN32) #include <stdint.h> #endif diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 576d82ccfac..077c0ca37bd 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -5237,8 +5237,10 @@ static int edbm_noise_exec(bContext *C, wmOperator *op) else { BM_ITER_MESH (eve, &iter, em->bm, BM_VERTS_OF_MESH) { if (BM_elem_flag_test(eve, BM_ELEM_SELECT)) { - float tin, dum; - externtex(ma->mtex[0], eve->co, &tin, &dum, &dum, &dum, &dum, 0, NULL, false, false); + float tin = 0.0f, dum; + if (ma->mtex[ma->texact] != NULL) { + externtex(ma->mtex[ma->texact], eve->co, &tin, &dum, &dum, &dum, &dum, 0, NULL, false, false); + } eve->co[2] += fac * tin; } } diff --git a/source/blender/editors/space_file/fsmenu.c b/source/blender/editors/space_file/fsmenu.c index 71d49e0dc2e..ee0ec3fda39 100644 --- a/source/blender/editors/space_file/fsmenu.c +++ b/source/blender/editors/space_file/fsmenu.c @@ -48,9 +48,6 @@ #ifdef WIN32 # include <windows.h> /* need to include windows.h so _WIN32_IE is defined */ -# ifndef _WIN32_IE -# define _WIN32_IE 0x0400 /* minimal requirements for SHGetSpecialFolderPath on MINGW MSVC has this defined already */ -# endif # include <shlobj.h> /* for SHGetSpecialFolderPath, has to be done before BLI_winstuff * because 'near' is disabled through BLI_windstuff */ # include "BLI_winstuff.h" diff --git a/source/blender/imbuf/intern/IMB_anim.h b/source/blender/imbuf/intern/IMB_anim.h index d89393b9903..6d7ad7985f9 100644 --- a/source/blender/imbuf/intern/IMB_anim.h +++ b/source/blender/imbuf/intern/IMB_anim.h @@ -40,10 +40,7 @@ # include <mmsystem.h> # include <memory.h> # include <commdlg.h> - -# ifndef FREE_WINDOWS -# include <vfw.h> -# endif +# include <vfw.h> # undef AVIIF_KEYFRAME // redefined in AVI_avi.h # undef AVIIF_LIST // redefined in AVI_avi.h @@ -130,7 +127,7 @@ struct anim { /* avi */ struct _AviMovie *avi; -#if defined(_WIN32) && !defined(FREE_WINDOWS) +#if defined(_WIN32) /* windows avi */ int avistreams; int firstvideo; diff --git a/source/blender/imbuf/intern/anim_movie.c b/source/blender/imbuf/intern/anim_movie.c index a40b257b75b..9806ff006d7 100644 --- a/source/blender/imbuf/intern/anim_movie.c +++ b/source/blender/imbuf/intern/anim_movie.c @@ -37,10 +37,7 @@ #include <mmsystem.h> #include <memory.h> #include <commdlg.h> - -#ifndef FREE_WINDOWS #include <vfw.h> -#endif #undef AVIIF_KEYFRAME /* redefined in AVI_avi.h */ #undef AVIIF_LIST /* redefined in AVI_avi.h */ @@ -173,7 +170,7 @@ static void an_stringenc(char *string, const char *head, const char *tail, unsig #ifdef WITH_AVI static void free_anim_avi(struct anim *anim) { -#if defined(_WIN32) && !defined(FREE_WINDOWS) +#if defined(_WIN32) int i; #endif @@ -184,7 +181,7 @@ static void free_anim_avi(struct anim *anim) MEM_freeN(anim->avi); anim->avi = NULL; -#if defined(_WIN32) && !defined(FREE_WINDOWS) +#if defined(_WIN32) if (anim->pgf) { AVIStreamGetFrameClose(anim->pgf); @@ -283,7 +280,7 @@ static int startavi(struct anim *anim) { AviError avierror; -#if defined(_WIN32) && !defined(FREE_WINDOWS) +#if defined(_WIN32) HRESULT hr; int i, firstvideo = -1; int streamcount; @@ -304,7 +301,7 @@ static int startavi(struct anim *anim) avierror = AVI_open_movie(anim->name, anim->avi); -#if defined(_WIN32) && !defined(FREE_WINDOWS) +#if defined(_WIN32) if (avierror == AVI_ERROR_COMPRESSION) { AVIFileInit(); hr = AVIFileOpen(&anim->pfile, anim->name, OF_READ, 0L); @@ -401,7 +398,7 @@ static ImBuf *avi_fetchibuf(struct anim *anim, int position) return NULL; } -#if defined(_WIN32) && !defined(FREE_WINDOWS) +#if defined(_WIN32) if (anim->avistreams) { LPBITMAPINFOHEADER lpbi; diff --git a/source/blender/imbuf/intern/dds/dds_api.cpp b/source/blender/imbuf/intern/dds/dds_api.cpp index 12e03f55450..67a0b0ffd00 100644 --- a/source/blender/imbuf/intern/dds/dds_api.cpp +++ b/source/blender/imbuf/intern/dds/dds_api.cpp @@ -37,7 +37,7 @@ extern "C" { #include <stdio.h> // printf #include <fstream> -#if defined (WIN32) && !defined(FREE_WINDOWS) +#if defined (WIN32) #include "utfconv.h" #endif @@ -62,7 +62,7 @@ int imb_save_dds(struct ImBuf *ibuf, const char *name, int /*flags*/) /* open file for writing */ std::ofstream fildes; -#if defined (WIN32) && !defined(FREE_WINDOWS) +#if defined (WIN32) wchar_t *wname = alloc_utf16_from_8(name, 0); fildes.open(wname); free(wname); diff --git a/source/blender/imbuf/intern/oiio/openimageio_api.cpp b/source/blender/imbuf/intern/oiio/openimageio_api.cpp index 224cf6347d2..b123d508f99 100644 --- a/source/blender/imbuf/intern/oiio/openimageio_api.cpp +++ b/source/blender/imbuf/intern/oiio/openimageio_api.cpp @@ -31,7 +31,7 @@ #include <set> -#if defined(WIN32) && !defined(FREE_WINDOWS) +#if defined(WIN32) #include "utfconv.h" #endif diff --git a/source/blender/imbuf/intern/openexr/openexr_api.cpp b/source/blender/imbuf/intern/openexr/openexr_api.cpp index 29332a5c899..ec544e65355 100644 --- a/source/blender/imbuf/intern/openexr/openexr_api.cpp +++ b/source/blender/imbuf/intern/openexr/openexr_api.cpp @@ -69,7 +69,7 @@ #include <openexr_api.h> -#if defined (WIN32) && !defined(FREE_WINDOWS) +#if defined (WIN32) #include "utfconv.h" #endif @@ -77,7 +77,7 @@ extern "C" { // The following prevents a linking error in debug mode for MSVC using the libs in CVS -#if defined(WITH_OPENEXR) && defined(_WIN32) && defined(DEBUG) && !defined(__MINGW32__) && _MSC_VER < 1900 +#if defined(WITH_OPENEXR) && defined(_WIN32) && defined(DEBUG) && _MSC_VER < 1900 _CRTIMP void __cdecl _invalid_parameter_noinfo(void) { } @@ -180,7 +180,7 @@ public: : IStream(filename) { /* utf-8 file path support on windows */ -#if defined (WIN32) && !defined(FREE_WINDOWS) +#if defined (WIN32) wchar_t *wfilename = alloc_utf16_from_8(filename, 0); ifs.open(wfilename, std::ios_base::binary); free(wfilename); @@ -243,7 +243,7 @@ public: : OStream(filename) { /* utf-8 file path support on windows */ -#if defined (WIN32) && !defined(FREE_WINDOWS) +#if defined (WIN32) wchar_t *wfilename = alloc_utf16_from_8(filename, 0); ofs.open(wfilename, std::ios_base::binary); free(wfilename); diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 2de3d472ce3..7eb9c77d76a 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -423,11 +423,7 @@ static void rna_Object_parent_set(PointerRNA *ptr, PointerRNA value) { Object *ob = (Object *)ptr->data; Object *par = (Object *)value.data; - -#ifdef FREE_WINDOWS - /* NOTE: this dummy check here prevents this method causing weird runtime errors on mingw 4.6.2 */ - if (ob) -#endif + { ED_object_parent(ob, par, ob->partype, ob->parsubstr); } diff --git a/source/blender/python/intern/bpy_app_handlers.c b/source/blender/python/intern/bpy_app_handlers.c index ee8a26f211e..5a309339e17 100644 --- a/source/blender/python/intern/bpy_app_handlers.c +++ b/source/blender/python/intern/bpy_app_handlers.c @@ -124,7 +124,7 @@ static PyObject *bpy_app_handlers_persistent_new(PyTypeObject *UNUSED(type), PyO /* dummy type because decorators can't be PyCFunctions */ static PyTypeObject BPyPersistent_Type = { -#if defined(_MSC_VER) || defined(FREE_WINDOWS) +#if defined(_MSC_VER) PyVarObject_HEAD_INIT(NULL, 0) #else PyVarObject_HEAD_INIT(&PyType_Type, 0) @@ -204,7 +204,7 @@ PyObject *BPY_app_handlers_struct(void) { PyObject *ret; -#if defined(_MSC_VER) || defined(FREE_WINDOWS) +#if defined(_MSC_VER) BPyPersistent_Type.ob_base.ob_base.ob_type = &PyType_Type; #endif diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 6613bb8a5f7..a0b76bd67ee 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -5692,7 +5692,7 @@ PyTypeObject pyrna_struct_meta_idprop_Type = { NULL, /* struct PyMethodDef *tp_methods; */ NULL, /* struct PyMemberDef *tp_members; */ NULL, /* struct PyGetSetDef *tp_getset; */ -#if defined(_MSC_VER) || defined(FREE_WINDOWS) +#if defined(_MSC_VER) NULL, /* defer assignment */ #else &PyType_Type, /* struct _typeobject *tp_base; */ @@ -6267,7 +6267,7 @@ static PyTypeObject pyrna_prop_collection_iter_Type = { NULL, /* reprfunc tp_str; */ /* will only use these if this is a subtype of a py class */ -#if defined(_MSC_VER) || defined(FREE_WINDOWS) +#if defined(_MSC_VER) NULL, /* defer assignment */ #else PyObject_GenericGetAttr, /* getattrofunc tp_getattro; */ @@ -6300,7 +6300,7 @@ static PyTypeObject pyrna_prop_collection_iter_Type = { #endif /*** Added in release 2.2 ***/ /* Iterators */ -#if defined(_MSC_VER) || defined(FREE_WINDOWS) +#if defined(_MSC_VER) NULL, /* defer assignment */ #else PyObject_SelfIter, /* getiterfunc tp_iter; */ @@ -6776,7 +6776,7 @@ void BPY_rna_init(void) #endif /* for some reason MSVC complains of these */ -#if defined(_MSC_VER) || defined(FREE_WINDOWS) +#if defined(_MSC_VER) pyrna_struct_meta_idprop_Type.tp_base = &PyType_Type; pyrna_prop_collection_iter_Type.tp_iter = PyObject_SelfIter; diff --git a/source/blenderplayer/CMakeLists.txt b/source/blenderplayer/CMakeLists.txt index 45a73cae26b..4f0e64b0955 100644 --- a/source/blenderplayer/CMakeLists.txt +++ b/source/blenderplayer/CMakeLists.txt @@ -35,24 +35,13 @@ if(WIN32 AND NOT UNIX) string(SUBSTRING ${BLENDER_VERSION} 0 1 bver1) string(SUBSTRING ${BLENDER_VERSION} 2 1 bver2) string(SUBSTRING ${BLENDER_VERSION} 3 1 bver3) - if(MINGW) - add_definitions( - -DWINDRES - -DBLEN_VER_RC_STR_M=${BLENDER_VERSION} - -DBLEN_VER_RC_1=${bver1} - -DBLEN_VER_RC_2=${bver2} - -DBLEN_VER_RC_3=${bver3} - -DBLEN_VER_RC_4=0 - ) - else() - add_definitions( - -DBLEN_VER_RC_STR=${BLENDER_VERSION} - -DBLEN_VER_RC_1=${bver1} - -DBLEN_VER_RC_2=${bver2} - -DBLEN_VER_RC_3=${bver3} - -DBLEN_VER_RC_4=0 - ) - endif() + add_definitions( + -DBLEN_VER_RC_STR=${BLENDER_VERSION} + -DBLEN_VER_RC_1=${bver1} + -DBLEN_VER_RC_2=${bver2} + -DBLEN_VER_RC_3=${bver3} + -DBLEN_VER_RC_4=0 + ) add_executable( blenderplayer ${EXETYPE} diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index 7a34f8bcb69..8f26e248424 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -113,24 +113,13 @@ if(WIN32 AND NOT UNIX) string(SUBSTRING ${BLENDER_VERSION} 0 1 bver1) string(SUBSTRING ${BLENDER_VERSION} 2 1 bver2) string(SUBSTRING ${BLENDER_VERSION} 3 1 bver3) - if(MINGW) - add_definitions( - -DWINDRES - -DBLEN_VER_RC_STR_M=${BLENDER_VERSION} - -DBLEN_VER_RC_1=${bver1} - -DBLEN_VER_RC_2=${bver2} - -DBLEN_VER_RC_3=${bver3} - -DBLEN_VER_RC_4=0 - ) - else() - add_definitions( - -DBLEN_VER_RC_STR=${BLENDER_VERSION} - -DBLEN_VER_RC_1=${bver1} - -DBLEN_VER_RC_2=${bver2} - -DBLEN_VER_RC_3=${bver3} - -DBLEN_VER_RC_4=0 - ) - endif() + add_definitions( + -DBLEN_VER_RC_STR=${BLENDER_VERSION} + -DBLEN_VER_RC_1=${bver1} + -DBLEN_VER_RC_2=${bver2} + -DBLEN_VER_RC_3=${bver3} + -DBLEN_VER_RC_4=0 + ) list(APPEND SRC @@ -652,7 +641,6 @@ elseif(WIN32) if(WITH_PYTHON) string(REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${PYTHON_VERSION}) - # MinGW TODO: This bit of Python configuration diverges from MSVC if(NOT CMAKE_COMPILER_IS_GNUCC) install( FILES ${LIBDIR}/python/lib/python${_PYTHON_VERSION_NO_DOTS}.dll @@ -749,20 +737,6 @@ elseif(WIN32) DESTINATION ${BLENDER_VERSION}/python/bin CONFIGURATIONS Debug ) - - # MinGW needs Python DLL - if(MINGW) - install( - FILES ${LIBDIR}/python/lib/python${_PYTHON_VERSION_NO_DOTS}.dll - DESTINATION "." - CONFIGURATIONS Release;RelWithDebInfo;MinSizeRel - ) - install( - FILES ${LIBDIR}/python/lib/python${_PYTHON_VERSION_NO_DOTS}_d.dll - DESTINATION "." - CONFIGURATIONS Debug - ) - endif() endif() unset(_PYTHON_VERSION_NO_DOTS) @@ -785,57 +759,19 @@ elseif(WIN32) FILES ${LIBDIR}/pthreads/lib/pthreadVC2.dll DESTINATION "." ) - else() - #MinGW64 comes with own version. For portable builds it will probaly have to be copied to work - if(NOT WITH_MINGW64) - install( - FILES ${LIBDIR}/pthreads/lib/pthreadGC2.dll - DESTINATION "." - ) - elseif(WITH_MINGW64) - install( - FILES - ${LIBDIR}/binaries/libgcc_s_sjlj-1.dll - ${LIBDIR}/binaries/libwinpthread-1.dll - ${LIBDIR}/binaries/libstdc++-6.dll - DESTINATION "." - ) - - if(WITH_OPENMP) - install( - FILES - ${LIBDIR}/binaries/libgomp-1.dll - DESTINATION "." - ) - endif() - endif() endif() if(WITH_CODEC_FFMPEG) - if(WITH_MINGW64) - install( - FILES - ${LIBDIR}/ffmpeg/lib/avcodec-53.dll - ${LIBDIR}/ffmpeg/lib/avformat-53.dll - ${LIBDIR}/ffmpeg/lib/avdevice-53.dll - ${LIBDIR}/ffmpeg/lib/avutil-51.dll - ${LIBDIR}/ffmpeg/lib/swscale-2.dll - ${LIBDIR}/ffmpeg/lib/swresample-0.dll - ${LIBDIR}/ffmpeg/lib/xvidcore.dll - DESTINATION "." - ) - else() - install( - FILES - ${LIBDIR}/ffmpeg/lib/avcodec-57.dll - ${LIBDIR}/ffmpeg/lib/avformat-57.dll - ${LIBDIR}/ffmpeg/lib/avdevice-57.dll - ${LIBDIR}/ffmpeg/lib/avutil-55.dll - ${LIBDIR}/ffmpeg/lib/swscale-4.dll - ${LIBDIR}/ffmpeg/lib/swresample-2.dll - DESTINATION "." - ) - endif() + install( + FILES + ${LIBDIR}/ffmpeg/lib/avcodec-57.dll + ${LIBDIR}/ffmpeg/lib/avformat-57.dll + ${LIBDIR}/ffmpeg/lib/avdevice-57.dll + ${LIBDIR}/ffmpeg/lib/avutil-55.dll + ${LIBDIR}/ffmpeg/lib/swscale-4.dll + ${LIBDIR}/ffmpeg/lib/swresample-2.dll + DESTINATION "." + ) endif() if(WITH_CODEC_SNDFILE) @@ -851,30 +787,13 @@ elseif(WIN32) ${LIBDIR}/openal/lib/OpenAL32.dll DESTINATION "." ) - # MinGW TODO: Need to update to a newer OpenAL version - # which does not depend on wrap_oal.dll - if(CMAKE_COMPILER_IS_GNUCC) - install( - FILES - ${LIBDIR}/openal/lib/wrap_oal.dll - DESTINATION "." - ) - endif() endif() if(WITH_SDL) - #MinGW TODO: Update to SDL2 - if(NOT CMAKE_COMPILER_IS_GNUCC) - install( - FILES ${LIBDIR}/sdl/lib/SDL2.dll - DESTINATION "." - ) - else() - install( - FILES ${LIBDIR}/sdl/lib/SDL.dll - DESTINATION "." - ) - endif() + install( + FILES ${LIBDIR}/sdl/lib/SDL2.dll + DESTINATION "." + ) endif() if(WITH_SYSTEM_AUDASPACE) @@ -901,19 +820,11 @@ elseif(WIN32) if(WITH_OPENCOLORIO) set(OCIOBIN ${LIBDIR}/opencolorio/bin) - if(NOT MINGW) install( FILES ${OCIOBIN}/OpenColorIO.dll DESTINATION "." ) - else() - install( - FILES - ${OCIOBIN}/libOpenColorIO.dll - DESTINATION "." - ) - endif() endif() elseif(APPLE) diff --git a/source/gameengine/Expressions/intern/HashedPtr.cpp b/source/gameengine/Expressions/intern/HashedPtr.cpp index 005ac16b231..11d9482f993 100644 --- a/source/gameengine/Expressions/intern/HashedPtr.cpp +++ b/source/gameengine/Expressions/intern/HashedPtr.cpp @@ -40,10 +40,8 @@ CHashedPtr::CHashedPtr(void* val) : m_valptr(val) unsigned int CHashedPtr::hash() const { -#if defined(_WIN64) && !defined(FREE_WINDOWS64) +#if defined(_WIN64) unsigned __int64 key = (unsigned __int64)m_valptr; -#elif defined(FREE_WINDOWS64) - unsigned long long key = (unsigned long long)m_valptr; #else unsigned long key = (unsigned long)m_valptr; #endif diff --git a/source/gameengine/Expressions/intern/InputParser.cpp b/source/gameengine/Expressions/intern/InputParser.cpp index e8cc7fba284..583d8da63cb 100644 --- a/source/gameengine/Expressions/intern/InputParser.cpp +++ b/source/gameengine/Expressions/intern/InputParser.cpp @@ -37,7 +37,7 @@ // cool things like (IF(LOD==1,CCurvedValue,IF(LOD==2,CCurvedValue2)) etc... #include "EXP_IfExpr.h" -#if (defined(WIN32) || defined(WIN64)) && !defined(FREE_WINDOWS) +#if defined(WIN32) || defined(WIN64) #define strcasecmp _stricmp #ifndef strtoll diff --git a/source/gameengine/Ketsji/KX_IPO_SGController.cpp b/source/gameengine/Ketsji/KX_IPO_SGController.cpp index f3947fdd710..be1a4b4ef3a 100644 --- a/source/gameengine/Ketsji/KX_IPO_SGController.cpp +++ b/source/gameengine/Ketsji/KX_IPO_SGController.cpp @@ -31,10 +31,8 @@ */ -#if defined(_WIN64) && !defined(FREE_WINDOWS64) +#if defined(_WIN64) typedef unsigned __int64 uint_ptr; -#elif defined(FREE_WINDOWS64) -typedef unsigned long long uint_ptr; #else typedef unsigned long uint_ptr; #endif diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp index b0a8e376eb6..d82a0fd533b 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp @@ -80,12 +80,6 @@ #define DEFAULT_LOGIC_TIC_RATE 60.0 //#define DEFAULT_PHYSICS_TIC_RATE 60.0 -#ifdef FREE_WINDOWS /* XXX mingw64 (gcc 4.7.0) defines a macro for DrawText that translates to DrawTextA. Not good */ -#ifdef DrawText -#undef DrawText -#endif -#endif - const char KX_KetsjiEngine::m_profileLabels[tc_numCategories][15] = { "Physics:", // tc_physics "Logic:", // tc_logic diff --git a/source/gameengine/VideoTexture/ImageBase.cpp b/source/gameengine/VideoTexture/ImageBase.cpp index 0db1fa293da..b91a312a5d7 100644 --- a/source/gameengine/VideoTexture/ImageBase.cpp +++ b/source/gameengine/VideoTexture/ImageBase.cpp @@ -43,7 +43,7 @@ extern "C" { #include "Exception.h" -#if (defined(WIN32) || defined(WIN64)) && !defined(FREE_WINDOWS) +#if (defined(WIN32) || defined(WIN64)) #define strcasecmp _stricmp #endif diff --git a/tests/python/CMakeLists.txt b/tests/python/CMakeLists.txt index 5240a4144c9..65e348336b4 100644 --- a/tests/python/CMakeLists.txt +++ b/tests/python/CMakeLists.txt @@ -108,6 +108,13 @@ add_test(split_faces ${TEST_BLENDER_EXE} ) # ------------------------------------------------------------------------------ +# MODIFIERS TESTS +add_test(modifier_array ${TEST_BLENDER_EXE} + ${TEST_SRC_DIR}/modifier_stack/array_test.blend + --python-text run_tests +) + +# ------------------------------------------------------------------------------ # IO TESTS # OBJ Import tests |