Merging r45877 through r45927 from trunk into soc-2011-tomato

This commit is contained in:
Sergey Sharybin
2012-04-24 15:26:26 +00:00
104 changed files with 896 additions and 220 deletions

View File

@@ -194,12 +194,7 @@ option(WITH_IMAGE_REDCODE "Enable RedCode Image Support" OFF)
option(WITH_IMAGE_FRAMESERVER "Enable image FrameServer Support for rendering" ON)
# Audio/Video format support
if(MINGW)
set(PLATFORM_DEFAULT ON)
else()
set(PLATFORM_DEFAULT OFF)
endif()
option(WITH_CODEC_FFMPEG "Enable FFMPeg Support (http://ffmpeg.org)" ${PLATFORM_DEFAULT})
option(WITH_CODEC_FFMPEG "Enable FFMPeg Support (http://ffmpeg.org)" OFF)
unset(PLATFORM_DEFAULT)
option(WITH_CODEC_SNDFILE "Enable libsndfile Support (http://www.mega-nerd.com/libsndfile)" OFF)
@@ -233,6 +228,8 @@ if(UNIX AND NOT APPLE)
option(WITH_INSTALL_PORTABLE "Install redistributeable runtime, otherwise install into CMAKE_INSTALL_PREFIX" ON)
endif()
option(WITH_PYTHON_INSTALL "Copy system python into the blender install folder" ON)
option(WITH_MINGW64 "Use the 64-bit version of MinGW" OFF)
mark_as_advanced(WITH_MINGW64)
# Cycles
option(WITH_CYCLES "Enable cycles Render Engine" ON)
@@ -370,6 +367,10 @@ if(MINGW)
"because it is currently unsupported, remove this "
"line if youre a developer who wants to add support.")
endif()
if((WITH_MINGW64) AND (WITH_OPENCOLLADA OR WITH_CODEC_FFMPEG))
message(FATAL_ERROR "MINGW64 still doesn't support: WITH_OPENCOLLADA/WITH_CODEC_FFMPEG")
endif()
endif()
TEST_SSE_SUPPORT(COMPILER_SSE_FLAG COMPILER_SSE2_FLAG)
@@ -737,6 +738,12 @@ elseif(WIN32)
if(CMAKE_COMPILER_IS_GNUCC)
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/mingw32)
# Setup 64bit and 64bit windows systems
if(WITH_MINGW64)
message("Set 64 bit compiler for MinGW.")
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/mingw64)
endif()
else()
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/windows)
@@ -995,12 +1002,21 @@ elseif(WIN32)
set(PLATFORM_LINKFLAGS_DEBUG "/NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libc.lib")
elseif(CMAKE_COMPILER_IS_GNUCC)
# keep GCC specific stuff here
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/mingw32)
# keep GCC specific stuff here
set(PLATFORM_LINKLIBS "-lshell32 -lshfolder -lgdi32 -lmsvcrt -lwinmm -lmingw32 -lm -lws2_32 -lz -lstdc++ -lole32 -luuid -lwsock32 -lpsapi")
set(PLATFORM_CFLAGS "-pipe -funsigned-char -fno-strict-aliasing")
if(WITH_MINGW64)
#Yes, the point for MinGW64 is moar optimization by default :)
set(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -mmmx -msse -msse2")
set(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive")
set(PLATFORM_LINKLIBS "${PLATFORM_LINKLIBS} -lpthread")
add_definitions(-DFREE_WINDOWS64 -DMS_WIN64)
endif()
add_definitions(-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE)
@@ -1017,7 +1033,11 @@ elseif(WIN32)
set(PNG_INCLUDE_DIR "${PNG}/include")
set(PNG_LIBPATH ${PNG}/lib) # not cmake defined
set(JPEG_LIBRARIES libjpeg)
if(WITH_MINGW64)
set(JPEG_LIBRARIES jpeg)
else()
set(JPEG_LIBRARIES libjpeg)
endif()
set(PNG_LIBRARIES png)
set(ZLIB ${LIBDIR}/zlib)
@@ -1025,11 +1045,14 @@ elseif(WIN32)
set(ZLIB_LIBPATH ${ZLIB}/lib)
set(ZLIB_LIBRARIES z)
set(PTHREADS ${LIBDIR}/pthreads)
set(PTHREADS_INCLUDE_DIRS ${PTHREADS}/include)
set(PTHREADS_LIBPATH ${PTHREADS}/lib)
set(PTHREADS_LIBRARIES pthreadGC2)
#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)
@@ -1101,8 +1124,13 @@ elseif(WIN32)
if(WITH_BOOST)
set(BOOST ${LIBDIR}/boost)
set(BOOST_INCLUDE_DIR ${BOOST}/include)
set(BOOST_POSTFIX "mgw46-mt-s-1_47")
set(BOOST_DEBUG_POSTFIX "mgw46-mt-sd-1_47")
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_47")
set(BOOST_DEBUG_POSTFIX "mgw46-mt-sd-1_47")
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}

View File

@@ -170,7 +170,7 @@ if sys.platform=='win32':
if env['CC'] in ['cl', 'cl.exe']:
platform = 'win64-vc' if bitness == 64 else 'win32-vc'
elif env['CC'] in ['gcc']:
platform = 'win32-mingw'
platform = 'win64-mingw' if bitness == 64 else 'win32-mingw'
env.SConscriptChdir(0)
@@ -782,6 +782,34 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'):
windlls = env.Install(dir=env['BF_INSTALLDIR'], source = dllsources)
allinstall += windlls
if env['OURPLATFORM'] == 'win64-mingw':
dllsources = []
if env['WITH_BF_PYTHON']:
if env['BF_DEBUG']:
dllsources.append('${BF_PYTHON_LIBPATH}/${BF_PYTHON_DLL}_d.dll')
else:
dllsources.append('${BF_PYTHON_LIBPATH}/${BF_PYTHON_DLL}.dll')
if env['WITH_BF_FFMPEG']:
dllsources += env['BF_FFMPEG_DLL'].split()
if env['WITH_BF_OPENAL']:
dllsources.append('${LCGDIR}/openal/lib/OpenAL32.dll')
dllsources.append('${LCGDIR}/openal/lib/wrap_oal.dll')
if env['WITH_BF_SNDFILE']:
dllsources.append('${LCGDIR}/sndfile/lib/libsndfile-1.dll')
if env['WITH_BF_SDL']:
dllsources.append('${LCGDIR}/sdl/lib/SDL.dll')
dllsources.append('${LCGDIR}/thumbhandler/lib/BlendThumb64.dll')
dllsources.append('#source/icons/blender.exe.manifest')
windlls = env.Install(dir=env['BF_INSTALLDIR'], source = dllsources)
allinstall += windlls
installtarget = env.Alias('install', allinstall)
bininstalltarget = env.Alias('install-bin', blenderinstall)

View File

@@ -0,0 +1,207 @@
LCGDIR = '#../lib/mingw64'
LIBDIR = "${LCGDIR}"
BF_PYTHON = LIBDIR + '/python'
BF_PYTHON_VERSION = '3.2'
WITH_BF_STATICPYTHON = False
BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}'
BF_PYTHON_BINARY = 'python'
BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION[0]}${BF_PYTHON_VERSION[2]}mw'
BF_PYTHON_DLL = 'python32'
BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib'
WITH_BF_OPENAL = True
BF_OPENAL = LIBDIR + '/openal'
BF_OPENAL_INC = '${BF_OPENAL}/include'
BF_OPENAL_LIB = 'wrap_oal'
BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
WITH_BF_FFMPEG = False # TODO: FFmpeg gives linking errors, need to compile with MinGW-w64?
BF_FFMPEG_LIB = 'avformat-53 avcodec-53 avdevice-53 avutil-51 swscale-2'
BF_FFMPEG_LIBPATH = LIBDIR + '/ffmpeg/lib'
BF_FFMPEG_INC = LIBDIR + '/ffmpeg/include'
BF_FFMPEG_DLL = '${BF_FFMPEG_LIBPATH}/avformat-53.dll ${BF_FFMPEG_LIBPATH}/avcodec-53.dll ${BF_FFMPEG_LIBPATH}/avdevice-53.dll ${BF_FFMPEG_LIBPATH}/avutil-51.dll ${BF_FFMPEG_LIBPATH}/swscale-2.dll'
WITH_BF_JACK = False
BF_JACK = LIBDIR + '/jack'
BF_JACK_INC = '${BF_JACK}/include'
BF_JACK_LIB = 'libjack'
BF_JACK_LIBPATH = '${BF_JACK}/lib'
WITH_BF_SNDFILE = False
BF_SNDFILE = LIBDIR + '/sndfile'
BF_SNDFILE_INC = '${BF_SNDFILE}/include'
BF_SNDFILE_LIB = 'libsndfile-1'
BF_SNDFILE_LIBPATH = '${BF_SNDFILE}/lib'
WITH_BF_SDL = True
BF_SDL = LIBDIR + '/sdl'
BF_SDL_INC = '${BF_SDL}/include'
BF_SDL_LIB = 'SDL'
BF_SDL_LIBPATH = '${BF_SDL}/lib'
BF_PTHREADS = '' # Part of MinGW-w64
BF_PTHREADS_INC = ''
BF_PTHREADS_LIB = ''
BF_PTHREADS_LIBPATH = ''
WITH_BF_OPENEXR = True
WITH_BF_STATICOPENEXR = False
BF_OPENEXR = LIBDIR + '/openexr'
BF_OPENEXR_INC = '${BF_OPENEXR}/include ${BF_OPENEXR}/include/OpenEXR'
BF_OPENEXR_LIB = 'Half IlmImf Imath IlmThread Iex'
BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
WITH_BF_DDS = True
WITH_BF_JPEG = True
BF_JPEG = LIBDIR + '/jpeg'
BF_JPEG_INC = '${BF_JPEG}/include'
BF_JPEG_LIB = 'jpeg'
BF_JPEG_LIBPATH = '${BF_JPEG}/lib'
WITH_BF_PNG = True
BF_PNG = LIBDIR + '/png'
BF_PNG_INC = '${BF_PNG}/include'
BF_PNG_LIB = 'png'
BF_PNG_LIBPATH = '${BF_PNG}/lib'
WITH_BF_TIFF = True
BF_TIFF = LIBDIR + '/tiff'
BF_TIFF_INC = '${BF_TIFF}/include'
BF_TIFF_LIB = 'tiff'
BF_TIFF_LIBPATH = '${BF_TIFF}/lib'
WITH_BF_ZLIB = True
BF_ZLIB = LIBDIR + '/zlib'
BF_ZLIB_INC = '${BF_ZLIB}/include'
BF_ZLIB_LIB = 'z'
BF_ZLIB_LIBPATH = '${BF_ZLIB}/lib'
WITH_BF_INTERNATIONAL = True
BF_GETTEXT = LIBDIR + '/gettext'
BF_GETTEXT_INC = '${BF_GETTEXT}/include'
BF_GETTEXT_LIB = 'intl'
BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
WITH_BF_OPENJPEG = True
BF_OPENJPEG = '#extern/libopenjpeg'
BF_OPENJPEG_LIB = ''
BF_OPENJPEG_INC = '${BF_OPENJPEG}'
BF_OPENJPEG_LIBPATH='${BF_OPENJPEG}/lib'
WITH_BF_FFTW3 = True
BF_FFTW3 = LIBDIR + '/fftw3'
BF_FFTW3_INC = '${BF_FFTW3}/include'
BF_FFTW3_LIB = 'fftw3'
BF_FFTW3_LIBPATH = '${BF_FFTW3}/lib'
WITH_BF_GAMEENGINE = True
WITH_BF_OCEANSIM = True
WITH_BF_PLAYER = True
WITH_BF_LIBMV = True
WITH_BF_BULLET = True
BF_BULLET = '#extern/bullet2/src'
BF_BULLET_INC = '${BF_BULLET}'
BF_BULLET_LIB = 'extern_bullet'
BF_WINTAB = LIBDIR + '/wintab'
BF_WINTAB_INC = '${BF_WINTAB}/INCLUDE'
# enable freetype2 support for text objects
BF_FREETYPE = LIBDIR + '/freetype'
BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2/'
BF_FREETYPE_LIB = 'freetype'
BF_FREETYPE_LIBPATH = '${BF_FREETYPE}/lib'
WITH_BF_QUICKTIME = False
WITH_BF_ICONV = True
BF_ICONV = LIBDIR + "/iconv"
BF_ICONV_INC = '${BF_ICONV}/include'
BF_ICONV_LIB = 'iconv'
BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
WITH_BF_REDCODE = False
BF_REDCODE_INC = '#extern'
# Mesa Libs should go here if your using them as well....
WITH_BF_STATICOPENGL = False
BF_OPENGL = 'C:\\MingW'
BF_OPENGL_INC = '${BF_OPENGL}/include'
BF_OPENGL_LIBINC = '${BF_OPENGL}/lib'
BF_OPENGL_LIB = 'opengl32 glu32'
BF_OPENGL_LIB_STATIC = [ '${BF_OPENGL}/lib/libGL.a', '${BF_OPENGL}/lib/libGLU.a',
'${BF_OPENGL}/lib/libXmu.a', '${BF_OPENGL}/lib/libXext.a',
'${BF_OPENGL}/lib/libX11.a', '${BF_OPENGL}/lib/libXi.a' ]
WITH_BF_COLLADA = False # TODO: Compile Collada with MinGW-w64
BF_COLLADA = '#source/blender/collada'
BF_COLLADA_INC = '${BF_COLLADA}'
BF_COLLADA_LIB = 'bf_collada'
BF_OPENCOLLADA = LIBDIR + '/opencollada'
BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include'
BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver expat pcre buffer ftoa'
BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib'
#Cycles
WITH_BF_CYCLES = True
WITH_BF_CYCLES_CUDA_BINARIES = False
BF_CYCLES_CUDA_NVCC = "" # Path to the NVIDIA CUDA compiler
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_13', 'sm_20', 'sm_21']
WITH_BF_OIIO = True
BF_OIIO = LIBDIR + '/openimageio'
BF_OIIO_INC = '${BF_OIIO}/include'
BF_OIIO_LIB = 'OpenImageIO'
BF_OIIO_LIBPATH = '${BF_OIIO}/lib'
WITH_BF_BOOST = True
BF_BOOST = LIBDIR + '/boost'
BF_BOOST_INC = BF_BOOST + '/include'
BF_BOOST_LIB = 'boost_date_time-mgw47-mt-s-1_49 boost_date_time-mgw47-mt-sd-1_49 boost_filesystem-mgw47-mt-s-1_49 boost_filesystem-mgw47-mt-sd-1_49 boost_regex-mgw47-mt-s-1_49 boost_regex-mgw47-mt-sd-1_49 boost_system-mgw47-mt-s-1_49 boost_system-mgw47-mt-sd-1_49 boost_thread-mgw47-mt-s-1_49 boost_thread-mgw47-mt-sd-1_49'
BF_BOOST_LIBPATH = BF_BOOST + '/lib'
#Ray trace optimization
WITH_BF_RAYOPTIMIZATION = True
BF_RAYOPTIMIZATION_SSE_FLAGS = ['-mmmx', '-msse', '-msse2', '-ftree-vectorize']
WITH_BF_OPENMP = True
##
CC = 'gcc'
CXX = 'g++'
CCFLAGS = [ '-pipe', '-funsigned-char', '-fno-strict-aliasing' ]
#CXXFLAGS = [ '-fpermissive' ]
CPPFLAGS = ['-DWIN32', '-DMS_WIN64', '-DFREE_WINDOWS', '-DFREE_WINDOWS64', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE64_SOURCE', '-DBOOST_ALL_NO_LIB', '-DBOOST_THREAD_USE_LIB', '-DGLEW_STATIC', '-D_SSIZE_T_']
REL_CFLAGS = ['-O3', '-mmmx', '-msse', '-msse2']
REL_CXXFLAGS = ['-O3', '-mmmx', '-msse', '-msse2']
REL_CCFLAGS = ['-DNDEBUG', '-O3', '-mmmx', '-msse', '-msse2']
C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement', '-Wstrict-prototypes']
CC_WARN = [ '-Wall' ]
LLIBS = ['-lshell32', '-lshfolder', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lws2_32', '-lz', '-lstdc++','-lole32','-luuid', '-lwsock32', '-lpsapi', '-lpthread']
PLATFORM_LINKFLAGS = ['-Xlinker', '--stack=2097152']
## DISABLED, causes linking errors!
## for re-distrobution, so users dont need mingw installed
# PLATFORM_LINKFLAGS += ["-static-libgcc", "-static-libstdc++"]
BF_DEBUG = False
BF_DEBUG_CCFLAGS= ['-g', '-D_DEBUG']
BF_PROFILE_CCFLAGS = ['-pg', '-g']
BF_PROFILE_LINKFLAGS = ['-pg']
BF_PROFILE_FLAGS = BF_PROFILE_CCFLAGS
BF_PROFILE = False
BF_BUILDDIR = '..\\build\\win64-mingw'
BF_INSTALLDIR='..\\install\\win64-mingw'

View File

@@ -182,12 +182,12 @@ def setup_staticlibs(lenv):
if lenv['WITH_BF_SNDFILE'] and lenv['WITH_BF_STATICSNDFILE']:
statlibs += Split(lenv['BF_SNDFILE_LIB_STATIC'])
if lenv['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
if lenv['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
libincs += Split(lenv['BF_PTHREADS_LIBPATH'])
if lenv['WITH_BF_COLLADA']:
libincs += Split(lenv['BF_OPENCOLLADA_LIBPATH'])
if lenv['OURPLATFORM'] not in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
if lenv['OURPLATFORM'] not in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
libincs += Split(lenv['BF_PCRE_LIBPATH'])
libincs += Split(lenv['BF_EXPAT_LIBPATH'])
@@ -206,7 +206,7 @@ def setup_staticlibs(lenv):
statlibs += Split(lenv['BF_BOOST_LIB_STATIC'])
# setting this last so any overriding of manually libs could be handled
if lenv['OURPLATFORM'] not in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'):
if lenv['OURPLATFORM'] not in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross', 'win64-mingw'):
libincs.append('/usr/lib')
if lenv['WITH_BF_JEMALLOC']:
@@ -228,7 +228,7 @@ def setup_syslibs(lenv):
if not lenv['WITH_BF_FREETYPE_STATIC']:
syslibs += Split(lenv['BF_FREETYPE_LIB'])
if lenv['WITH_BF_PYTHON'] and not lenv['WITH_BF_STATICPYTHON']:
if lenv['BF_DEBUG'] and lenv['OURPLATFORM'] in ('win32-vc', 'win64-vc', 'win32-mingw'):
if lenv['BF_DEBUG'] and lenv['OURPLATFORM'] in ('win32-vc', 'win64-vc', 'win32-mingw', 'win64-mingw'):
syslibs.append(lenv['BF_PYTHON_LIB']+'_d')
else:
syslibs.append(lenv['BF_PYTHON_LIB'])
@@ -268,7 +268,7 @@ def setup_syslibs(lenv):
syslibs += Split(lenv['BF_SDL_LIB'])
if not lenv['WITH_BF_STATICOPENGL']:
syslibs += Split(lenv['BF_OPENGL_LIB'])
if lenv['OURPLATFORM'] in ('win32-vc', 'win32-mingw','linuxcross', 'win64-vc'):
if lenv['OURPLATFORM'] in ('win32-vc', 'win32-mingw','linuxcross', 'win64-vc', 'win64-mingw'):
syslibs += Split(lenv['BF_PTHREADS_LIB'])
if lenv['WITH_BF_COLLADA']:
syslibs.append(lenv['BF_PCRE_LIB'])
@@ -341,7 +341,7 @@ def creator(env):
if env['BF_DEBUG']:
defs.append('_DEBUG')
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
incs.append(env['BF_PTHREADS_INC'])
incs.append('#/intern/utfconv')
@@ -731,7 +731,7 @@ class BlenderEnvironment(SConsEnvironment):
if not self or not libname or not source:
print bc.FAIL+'Cannot continue. Missing argument for BlenderRes '+libname+bc.ENDC
self.Exit()
if self['OURPLATFORM'] not in ('win32-vc','win32-mingw','linuxcross', 'win64-vc'):
if self['OURPLATFORM'] not in ('win32-vc','win32-mingw','linuxcross', 'win64-vc', 'win64-mingw'):
print bc.FAIL+'BlenderRes is for windows only!'+bc.END
self.Exit()

View File

@@ -617,7 +617,7 @@ def buildslave(target=None, source=None, env=None):
Builder for buildbot integration. Used by buildslaves of http://builder.blender.org only.
"""
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc', 'win32-mingw', 'darwin'):
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc', 'win32-mingw', 'darwin', 'win64-mingw'):
extension = '.zip'
else:
extension = '.tar.bz2'
@@ -662,7 +662,7 @@ def NSIS_print(target, source, env):
def NSIS_Installer(target=None, source=None, env=None):
print "="*35
if env['OURPLATFORM'] not in ('win32-vc', 'win32-mingw', 'win64-vc'):
if env['OURPLATFORM'] not in ('win32-vc', 'win32-mingw', 'win64-vc', 'win64-mingw'):
print "NSIS installer is only available on Windows."
Exit()
if env['OURPLATFORM'] == 'win32-vc':

View File

@@ -0,0 +1,39 @@
Index: LinearMath/btSerializer.h
===================================================================
--- LinearMath/btSerializer.h (revision 45919)
+++ LinearMath/btSerializer.h (working copy)
@@ -25,8 +25,15 @@
#endif
#include <string.h>
+#if defined(_WIN64)
+# ifdef __MINGW64__
+# include <basetsd.h>
+# endif
+typedef __int64 int_ptr;
+#else
+typedef long int_ptr;
+#endif
-
///only the 32bit versions for now
extern unsigned char sBulletDNAstr[];
extern int sBulletDNAlen;
@@ -247,7 +254,7 @@
cp++;
}
{
- nr= (long)cp;
+ nr= (int_ptr)cp;
// long mask=3;
nr= ((nr+3)&~3)-nr;
while (nr--)
@@ -282,7 +289,7 @@
}
{
- nr= (long)cp;
+ nr= (int_ptr)cp;
// long mask=3;
nr= ((nr+3)&~3)-nr;
while (nr--)

View File

@@ -0,0 +1,13 @@
Index: SConscript
===================================================================
--- SConscript (revision 45919)
+++ SConscript (working copy)
@@ -11,7 +11,7 @@
defs += ' WIN32 NDEBUG _WINDOWS'
#cflags += ['/MT', '/W3', '/GX', '/O2', '/Op']
cflags += ['/MT', '/W3', '/GX', '/Og', '/Ot', '/Ob1', '/Op', '/G6', '/O3', '/EHcs']
-elif env['OURPLATFORM'] in ('win32-mingw', 'linuxcross'):
+elif env['OURPLATFORM'] in ('win32-mingw', 'linuxcross', 'win64-mingw'):
defs += ' NDEBUG'
cflags += ['-O2']
elif env['OURPLATFORM'] in ('linux', 'freebsd4', 'freebsd5'):

View File

@@ -78,8 +78,10 @@ ATTRIBUTE_ALIGNED16 (struct) btQuantizedBvhNode
int getTriangleIndex() const
{
btAssert(isLeafNode());
unsigned int x=0;
unsigned int y = (~(x&0))<<(31-MAX_NUM_PARTS_IN_BITS);
// Get only the lower bits where the triangle index is stored
return (m_escapeIndexOrTriangleIndex&~((~0)<<(31-MAX_NUM_PARTS_IN_BITS)));
return (m_escapeIndexOrTriangleIndex&~(y));
}
int getPartId() const
{

View File

@@ -45,7 +45,9 @@ struct btTriIndex
int getTriangleIndex() const
{
// Get only the lower bits where the triangle index is stored
return (m_PartIdTriangleIndex&~((~0)<<(31-MAX_NUM_PARTS_IN_BITS)));
unsigned int x = 0;
unsigned int y = (~(x&0))<<(31-MAX_NUM_PARTS_IN_BITS);
return (m_PartIdTriangleIndex&~(y));
}
int getPartId() const
{

View File

@@ -25,7 +25,14 @@ subject to the following restrictions:
#endif
#include <string.h>
#if defined(_WIN64)
# ifdef __MINGW64__
# include <basetsd.h>
# endif
typedef __int64 int_ptr;
#else
typedef long int_ptr;
#endif
///only the 32bit versions for now
extern unsigned char sBulletDNAstr[];
@@ -247,7 +254,7 @@ protected:
cp++;
}
{
nr= (long)cp;
nr= (int_ptr)cp;
// long mask=3;
nr= ((nr+3)&~3)-nr;
while (nr--)
@@ -282,7 +289,7 @@ protected:
}
{
nr= (long)cp;
nr= (int_ptr)cp;
// long mask=3;
nr= ((nr+3)&~3)-nr;
while (nr--)

View File

@@ -11,7 +11,7 @@ if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
defs += ' WIN32 NDEBUG _WINDOWS'
#cflags += ['/MT', '/W3', '/GX', '/O2', '/Op']
cflags += ['/MT', '/W3', '/GX', '/Og', '/Ot', '/Ob1', '/Op', '/G6', '/O3', '/EHcs']
elif env['OURPLATFORM'] in ('win32-mingw', 'linuxcross'):
elif env['OURPLATFORM'] in ('win32-mingw', 'linuxcross', 'win64-mingw'):
defs += ' NDEBUG'
cflags += ['-O2']
elif env['OURPLATFORM'] in ('linux', 'freebsd4', 'freebsd5'):

View File

@@ -14,7 +14,7 @@ incs = ['include']
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')

View File

@@ -114,7 +114,7 @@ incs = ['include']
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')

13
extern/carve/patches/mingw_w64.patch vendored Normal file
View File

@@ -0,0 +1,13 @@
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')

View File

@@ -34,7 +34,7 @@ incs = '. ../Eigen3'
incs += ' ' + env['BF_PNG_INC']
incs += ' ' + env['BF_ZLIB_INC']
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
incs += ' ./third_party/glog/src/windows ./third_party/glog/src/windows/glog'
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
incs += ' ./third_party/msinttypes'

View File

@@ -248,7 +248,7 @@ incs = '. ../Eigen3'
incs += ' ' + env['BF_PNG_INC']
incs += ' ' + env['BF_ZLIB_INC']
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
incs += ' ./third_party/glog/src/windows ./third_party/glog/src/windows/glog'
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
incs += ' ./third_party/msinttypes'

View File

@@ -33,7 +33,7 @@
#include <Eigen/QR>
#include <Eigen/SVD>
#if _WIN32 || __APPLE__ || __FreeBSD__
#if (defined(_WIN32) || defined(__APPLE__) || defined(__FreeBSD__)) && !defined(__MINGW64__)
void static sincos (double x, double *sinx, double *cosx) {
*sinx = sin(x);
*cosx = cos(x);

View File

@@ -0,0 +1,58 @@
Index: bundle.sh
===================================================================
--- bundle.sh (revision 45912)
+++ bundle.sh (working copy)
@@ -248,7 +248,7 @@
incs += ' ' + env['BF_PNG_INC']
incs += ' ' + env['BF_ZLIB_INC']
-if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
+if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
incs += ' ./third_party/glog/src/windows ./third_party/glog/src/windows/glog'
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
incs += ' ./third_party/msinttypes'
Index: libmv/numeric/numeric.h
===================================================================
--- libmv/numeric/numeric.h (revision 45912)
+++ libmv/numeric/numeric.h (working copy)
@@ -33,7 +33,7 @@
#include <Eigen/QR>
#include <Eigen/SVD>
-#if _WIN32 || __APPLE__ || __FreeBSD__
+#if (defined(_WIN32) || defined(__APPLE__) || defined(__FreeBSD__)) && !defined(__MINGW64__)
void static sincos (double x, double *sinx, double *cosx) {
*sinx = sin(x);
*cosx = cos(x);
Index: third_party/glog/src/windows/port.cc
===================================================================
--- third_party/glog/src/windows/port.cc (revision 45912)
+++ third_party/glog/src/windows/port.cc (working copy)
@@ -55,6 +55,8 @@
return _vsnprintf(str, size-1, format, ap);
}
+// MinGW64 defines
+#ifndef __MINGW64__
int snprintf(char *str, size_t size, const char *format, ...) {
va_list ap;
va_start(ap, format);
@@ -62,3 +64,4 @@
va_end(ap);
return r;
}
+#endif
Index: third_party/glog/src/windows/port.h
===================================================================
--- third_party/glog/src/windows/port.h (revision 45912)
+++ third_party/glog/src/windows/port.h (working copy)
@@ -120,7 +120,9 @@
#define DEFAULT_TEMPLATE_ROOTDIR ".."
// ----------------------------------- SYSTEM/PROCESS
+#ifndef __MINGW64__
typedef int pid_t;
+#endif
#define getpid _getpid
// ----------------------------------- THREADS

View File

@@ -55,6 +55,8 @@ int safe_vsnprintf(char *str, size_t size, const char *format, va_list ap) {
return _vsnprintf(str, size-1, format, ap);
}
// MinGW64 defines
#ifndef __MINGW64__
int snprintf(char *str, size_t size, const char *format, ...) {
va_list ap;
va_start(ap, format);
@@ -62,3 +64,4 @@ int snprintf(char *str, size_t size, const char *format, ...) {
va_end(ap);
return r;
}
#endif

View File

@@ -120,7 +120,9 @@ extern int safe_vsnprintf(char *str, size_t size,
#define DEFAULT_TEMPLATE_ROOTDIR ".."
// ----------------------------------- SYSTEM/PROCESS
#ifndef __MINGW64__
typedef int pid_t;
#endif
#define getpid _getpid
// ----------------------------------- THREADS

View File

@@ -36,5 +36,5 @@ if NEW_CSG == 'false':
else:
SConscript(['csg/SConscript'])
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-mingw', 'linuxcross', 'win64-vc'):
SConscript(['utfconv/SConscript'])

View File

@@ -41,7 +41,7 @@ if env['WITH_BF_PYTHON']:
incs += ' Python ' + env['BF_PYTHON_INC']
defs.append('WITH_PYTHON')
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
incs += ' ' + env['BF_PTHREADS_INC']
env.BlenderLib ('bf_intern_audaspace', sources, Split(incs), defs, libtype=['intern','player'], priority = [25,215] )

View File

@@ -33,7 +33,16 @@
#include <cstring>
#include <cstdlib>
#define AUD_ALIGN(a) (a + 16 - ((long)a & 15))
#if defined(_WIN64)
# ifdef __MINGW64__
# include <basetsd.h>
# endif
typedef unsigned __int64 uint_ptr;
#else
typedef unsigned long uint_ptr;
#endif
#define AUD_ALIGN(a) (a + 16 - ((uint_ptr)a & 15))
AUD_Buffer::AUD_Buffer(int size)
{

View File

@@ -0,0 +1,23 @@
Index: intern/AUD_Buffer.cpp
===================================================================
--- intern/AUD_Buffer.cpp (revision 45919)
+++ intern/AUD_Buffer.cpp (working copy)
@@ -33,8 +33,17 @@
#include <cstring>
#include <cstdlib>
-#define AUD_ALIGN(a) (a + 16 - ((long)a & 15))
+#if defined(_WIN64)
+# ifdef __MINGW64__
+# include <basetsd.h>
+# endif
+typedef unsigned __int64 uint_ptr;
+#else
+typedef unsigned long uint_ptr;
+#endif
+#define AUD_ALIGN(a) (a + 16 - ((uint_ptr)a & 15))
+
AUD_Buffer::AUD_Buffer(int size)
{
m_size = size;

View File

@@ -18,13 +18,13 @@ else:
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')
incs += ' ' + env['BF_BOOST_INC']
if (env['OURPLATFORM'] == 'win32-mingw'):
if (env['OURPLATFORM'] in ('win32-mingw', 'win64-mingw')):
env.BlenderLib ('bf_intern_bop', sources, Split(incs) , [], libtype='intern', priority = 5 )
else:
env.BlenderLib ('bf_intern_bop', sources, Split(incs) , defs, libtype='intern', priority = 5 )

View File

@@ -39,7 +39,7 @@ if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
else:
cxxflags.append('-ffast-math'.split())
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
incs.append(env['BF_PTHREADS_INC'])
# optimized kernel

View File

@@ -227,6 +227,7 @@ Mesh *BlenderSync::sync_mesh(BL::Object b_ob, bool holdout, bool object_updated)
/* test if we can instance or if the object is modified */
BL::ID b_ob_data = b_ob.data();
BL::ID key = (object_is_modified(b_ob) || holdout)? b_ob: b_ob_data;
BL::Material material_override = render_layer.material_override;
/* find shader indices */
vector<uint> used_shaders;
@@ -246,6 +247,8 @@ Mesh *BlenderSync::sync_mesh(BL::Object b_ob, bool holdout, bool object_updated)
if(used_shaders.size() == 0) {
if(holdout)
used_shaders.push_back(scene->default_holdout);
else if(material_override)
find_shader(material_override, used_shaders, scene->default_surface);
else
used_shaders.push_back(scene->default_surface);
}

View File

@@ -21,7 +21,14 @@
#endif
#endif // WIN32
#if defined(_WIN64)
# ifdef __MINGW64__
# include <basetsd.h>
# endif
typedef __int64 int_ptr;
#else
typedef long int_ptr;
#endif
/******************************************************************************
* Default Constructor
*****************************************************************************/
@@ -164,7 +171,7 @@ int ntlGeometryObjModel::initModel(int numVertices, float *vertices, int numTria
}
//fprintf(stderr,"initModel DEBUG %d \n",channelSize);
debMsgStd("ntlGeometryObjModel::initModel",DM_MSG, "Csize:"<<channelSize<<", Cvert:"<<(long)(channelVertices) ,10);
debMsgStd("ntlGeometryObjModel::initModel",DM_MSG, "Csize:"<<channelSize<<", Cvert:"<<(int_ptr)(channelVertices) ,10);
if(channelVertices && (channelSize>0)) {
vector<ntlSetVec3f> aniverts;
vector<ntlSetVec3f> aninorms;
@@ -174,7 +181,7 @@ int ntlGeometryObjModel::initModel(int numVertices, float *vertices, int numTria
anitimes.clear();
for(int frame=0; frame<channelSize; frame++) {
ntlSetVec3f averts; averts.mVerts.clear();
ntlSetVec3f anorms; averts.mVerts.clear();
ntlSetVec3f anorms; anorms.mVerts.clear();
int setsize = (3*numVertices+1);
ntlVec3Gfx p(0.),n(1.);

View File

@@ -390,7 +390,7 @@
#define DEFAULT_STREAM \
m[dC] = RAC(ccel,dC); \
\
if((!nbored & CFBnd)) { \
if(((!nbored) & CFBnd)) { \
\
m[dN ] = CSRC_N ; m[dS ] = CSRC_S ; \
m[dE ] = CSRC_E ; m[dW ] = CSRC_W ; \

View File

@@ -0,0 +1,29 @@
Index: intern/ntl_geometrymodel.cpp
===================================================================
--- intern/ntl_geometrymodel.cpp (revision 45919)
+++ intern/ntl_geometrymodel.cpp (working copy)
@@ -21,7 +21,14 @@
#endif
#endif // WIN32
-
+#if defined(_WIN64)
+# ifdef __MINGW64__
+# include <basetsd.h>
+# endif
+typedef __int64 int_ptr;
+#else
+typedef long int_ptr;
+#endif
/******************************************************************************
* Default Constructor
*****************************************************************************/
@@ -164,7 +171,7 @@
}
//fprintf(stderr,"initModel DEBUG %d \n",channelSize);
- debMsgStd("ntlGeometryObjModel::initModel",DM_MSG, "Csize:"<<channelSize<<", Cvert:"<<(long)(channelVertices) ,10);
+ debMsgStd("ntlGeometryObjModel::initModel",DM_MSG, "Csize:"<<channelSize<<", Cvert:"<<(int_ptr)(channelVertices) ,10);
if(channelVertices && (channelSize>0)) {
vector<ntlSetVec3f> aniverts;
vector<ntlSetVec3f> aninorms;

View File

@@ -49,7 +49,7 @@ elif window_system in ('linux', 'openbsd3', 'sunos5', 'freebsd7', 'freebsd8', 'f
else:
sources.remove('intern' + os.sep + 'GHOST_DropTargetX11.cpp')
elif window_system in ('win32-vc', 'win32-mingw', 'cygwin', 'linuxcross', 'win64-vc'):
elif window_system in ('win32-vc', 'win32-mingw', 'cygwin', 'linuxcross', 'win64-vc', 'win64-mingw'):
for f in pf:
try:
sources.remove('intern' + os.sep + f + 'X11.cpp')
@@ -98,7 +98,7 @@ if env['WITH_BF_3DMOUSE']:
else:
sources.remove('intern' + os.sep + 'GHOST_NDOFManager.cpp')
try:
if window_system in ('win32-vc', 'win32-mingw', 'cygwin', 'linuxcross', 'win64-vc'):
if window_system in ('win32-vc', 'win32-mingw', 'cygwin', 'linuxcross', 'win64-vc', 'win64-mingw'):
sources.remove('intern' + os.sep + 'GHOST_NDOFManagerWin32.cpp')
elif window_system=='darwin':
sources.remove('intern' + os.sep + 'GHOST_NDOFManagerCocoa.mm')
@@ -108,7 +108,7 @@ else:
pass
if window_system in ('win32-vc', 'win32-mingw', 'cygwin', 'linuxcross', 'win64-vc'):
if window_system in ('win32-vc', 'win32-mingw', 'cygwin', 'linuxcross', 'win64-vc', 'win64-mingw'):
incs = env['BF_WINTAB_INC'] + ' ' + incs
incs += ' ../utfconv'

View File

@@ -815,9 +815,10 @@ bool GHOST_SystemWin32::processNDOF(RAWINPUT const& raw)
// send motion. Mark as 'sent' so motion will always get dispatched.
eventSent = true;
#ifdef _MSC_VER
#if defined(_MSC_VER) || defined(FREE_WINDOWS64)
// using Microsoft compiler & header files
// they invented the RawInput API, so this version is (probably) correct
// 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;

View File

@@ -108,8 +108,10 @@ typedef uint64_t u_int64_t;
#include <inttypes.h>
#elif defined(FREE_WINDOWS)
#ifndef FREE_WINDOWS64
/* define htoln here, there must be a syntax error in winsock2.h in MinGW */
unsigned long __attribute__((__stdcall__)) htonl(unsigned long);
#endif
#include <stdint.h>
#else

View File

@@ -5,7 +5,7 @@ sources = env.Glob('intern/*.c') + env.Glob('superlu/*.c')
incs = 'extern superlu ../../extern/colamd/Include'
if (env['OURPLATFORM'] == 'win32-mingw'):
if (env['OURPLATFORM'] in ('win32-mingw', 'win64-mingw')):
env.BlenderLib ('bf_intern_opennl', sources, Split(incs), [], libtype=['core','intern'], priority=[1,80] )
else:
env.BlenderLib ('bf_intern_opennl', sources, Split(incs), [], libtype=['core'], priority=[55] )

View File

@@ -9,7 +9,7 @@ defs = ''
# This is odd but leave it for now...
# Why have win32 check here? - this is only used for windows.
# ... because one day we might want to use it on other platforms.
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-mingw', 'linuxcross', 'win64-vc'):
sources += ['utf_winfunc.c']
env.BlenderLib('bf_utfconv', sources, Split(incs), Split(defs), libtype=['intern','player'], priority=[0,0])

View File

@@ -1607,7 +1607,9 @@ class VIEW3D_MT_edit_mesh_specials(Menu):
layout.operator("mesh.select_all", text="Select Inverse").action = 'INVERT'
layout.operator("mesh.flip_normals")
layout.operator("mesh.vertices_smooth", text="Smooth")
layout.operator("mesh.inset")
layout.operator("mesh.bevel", text="Bevel")
layout.operator("mesh.bridge_edge_loops")
layout.operator("mesh.faces_shade_smooth")
layout.operator("mesh.faces_shade_flat")
layout.operator("mesh.blend_from_shape")

View File

@@ -9,5 +9,5 @@ if env['WITH_BF_GAMEENGINE']:
if env['WITH_BF_PLAYER']:
SConscript (['blenderplayer/bad_level_call_stubs/SConscript'])
if env['OURPLATFORM'] in ('win64-vc', 'win32-vc', 'win32-mingw', 'linuxcross'):
if env['OURPLATFORM'] in ('win64-vc', 'win32-vc', 'win32-mingw', 'linuxcross', 'win64-mingw'):
SConscript (['icons/SConscript'])

View File

@@ -89,7 +89,7 @@ int bone_autoside_name (char name[64], int strip_number, short axis, float head,
struct Bone *get_named_bone (struct bArmature *arm, const char *name);
float distfactor_to_bone(const float vec[3], const float b1[3], const float b2[3], float rad1, float rad2, float rdist);
float distfactor_to_bone(const float vec[3], const float b1[3], const float b2[3], float r1, float r2, float rdist);
void where_is_armature (struct bArmature *arm);
void where_is_armature_bone(struct Bone *bone, struct Bone *prevbone);

View File

@@ -68,6 +68,8 @@ char BKE_imtype_valid_depths(const char imtype);
char BKE_imtype_from_arg(const char *arg);
void BKE_imformat_defaults(struct ImageFormatData *im_format);
struct anim *openanim(const char *name, int flags, int streamindex);
void image_de_interlace(struct Image *ima, int odd);

View File

@@ -114,7 +114,7 @@ if env['WITH_BF_FFTW3']:
if env['WITH_BF_INTERNATIONAL']:
defs.append('WITH_INTERNATIONAL')
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
incs += ' ' + env['BF_PTHREADS_INC']
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):

View File

@@ -1577,14 +1577,14 @@ static struct DerivedMesh *dynamicPaint_Modifier_apply(DynamicPaintModifierData
if (pmd->canvas && !(pmd->canvas->flags & MOD_DPAINT_BAKING)) {
DynamicPaintSurface *surface = pmd->canvas->surfaces.first;
DynamicPaintSurface *surface;
int update_normals = 0;
/* loop through surfaces */
for (; surface; surface=surface->next) {
for (surface = pmd->canvas->surfaces.first; surface; surface=surface->next) {
PaintSurfaceData *sData = surface->data;
if (surface && surface->format != MOD_DPAINT_SURFACE_F_IMAGESEQ && sData) {
if (surface->format != MOD_DPAINT_SURFACE_F_IMAGESEQ && sData) {
if (!(surface->flags & (MOD_DPAINT_ACTIVE))) continue;
/* process vertex surface previews */

View File

@@ -1163,6 +1163,15 @@ int BKE_add_image_extension(char *string, const char imtype)
}
}
void BKE_imformat_defaults(ImageFormatData *im_format)
{
memset(im_format, 0, sizeof(*im_format));
im_format->planes = R_IMF_PLANES_RGB;
im_format->imtype = R_IMF_IMTYPE_PNG;
im_format->quality = 90;
im_format->compress = 90;
}
/* could allow access externally - 512 is for long names, 64 is for id names */
typedef struct StampData {
char file[512];

View File

@@ -1105,20 +1105,18 @@ static void fcurve_add_to_list (ListBase *groups, ListBase *list, FCurve *fcu, c
/* get the group to use */
agrp= action_groups_find_named(&tmp_act, grpname);
/* no matching group, so add one */
if (agrp == NULL) {
/* no matching group, so add one */
if (agrp == NULL) {
/* Add a new group, and make it active */
agrp= MEM_callocN(sizeof(bActionGroup), "bActionGroup");
agrp->flag = AGRP_SELECTED;
if (muteipo) agrp->flag |= AGRP_MUTED;
BLI_strncpy(agrp->name, grpname, sizeof(agrp->name));
BLI_addtail(&tmp_act.groups, agrp);
BLI_uniquename(&tmp_act.groups, agrp, "Group", '.', offsetof(bActionGroup, name), sizeof(agrp->name));
}
/* Add a new group, and make it active */
agrp= MEM_callocN(sizeof(bActionGroup), "bActionGroup");
agrp->flag = AGRP_SELECTED;
if (muteipo) agrp->flag |= AGRP_MUTED;
BLI_strncpy(agrp->name, grpname, sizeof(agrp->name));
BLI_addtail(&tmp_act.groups, agrp);
BLI_uniquename(&tmp_act.groups, agrp, "Group", '.', offsetof(bActionGroup, name), sizeof(agrp->name));
}
/* add F-Curve to group */

View File

@@ -228,6 +228,7 @@ void add_vn_vnvn(float *array_tar, const float *array_src_a, const float *array_
void sub_vn_vn(float *array_tar, const float *array_src, const int size);
void sub_vn_vnvn(float *array_tar, const float *array_src_a, const float *array_src_b, const int size);
void fill_vn_i(int *array_tar, const int size, const int val);
void fill_vn_ushort(unsigned short *array_tar, const int size, const unsigned short val);
void fill_vn_fl(float *array_tar, const int size, const float val);
#ifdef __cplusplus

View File

@@ -113,7 +113,9 @@ typedef unsigned int mode_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

View File

@@ -16,7 +16,7 @@ if env['WITH_BF_BINRELOC']:
incs += ' ../../../extern/binreloc/include'
defs.append('WITH_BINRELOC')
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
incs += ' ' + env['BF_PTHREADS_INC']
incs += ' ../../../intern/utfconv'

View File

@@ -209,7 +209,7 @@ FILE *BLI_fopen(const char *filename, const char *mode)
return ufopen(filename, mode);
}
gzFile BLI_gzopen(const char *filename, const char *mode)
void *BLI_gzopen(const char *filename, const char *mode)
{
gzFile gzfile;

View File

@@ -561,6 +561,15 @@ void fill_vn_i(int *array_tar, const int size, const int val)
}
}
void fill_vn_ushort(unsigned short *array_tar, const int size, const unsigned short val)
{
unsigned short *tar = array_tar + (size - 1);
int i = size;
while (i--) {
*(tar--) = val;
}
}
void fill_vn_fl(float *array_tar, const int size, const float val)
{
float *tar = array_tar + (size - 1);

View File

@@ -100,8 +100,10 @@ typedef uint64_t u_int64_t;
#include <inttypes.h>
#elif defined(FREE_WINDOWS)
#ifndef FREE_WINDOWS64
/* define htoln here, there must be a syntax error in winsock2.h in MinGW */
unsigned long __attribute__((__stdcall__)) htonl(unsigned long);
#endif
#include <stdint.h>
#else

View File

@@ -3810,6 +3810,14 @@ static void direct_link_customdata(FileData *fd, CustomData *data, int count)
int i = 0;
data->layers= newdataadr(fd, data->layers);
/* annoying workaround for bug [#31079] loading legacy files with
* no polygons _but_ have stale customdata */
if (UNLIKELY(count == 0 && data->layers == NULL && data->totlayer != 0)) {
memset(data, 0, sizeof(*data));
return;
}
data->external= newdataadr(fd, data->external);
while (i < data->totlayer) {

View File

@@ -17,7 +17,7 @@ if env['OURPLATFORM'] == 'linux':
cflags='-pthread'
incs += ' ../../../extern/binreloc/include'
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
incs += ' ' + env['BF_PTHREADS_INC']
env.BlenderLib ( libname = 'bf_blenpluginapi', sources = sources, includes = Split(incs), defines = defs, libtype=['core'], priority = [170] )

View File

@@ -484,12 +484,14 @@ static int bm_to_mesh_shape_layer_index_from_kb(BMesh *bm, KeyBlock *currkey)
BLI_INLINE void bmesh_quick_edgedraw_flag(MEdge *med, BMEdge *e)
{
/* this is a cheap way to set the edge draw, its not precise and will
* pick the first 2 faces an edge uses */
* pick the first 2 faces an edge uses.
* The dot comparison is a little arbitrary, but set so that a 5 subd
* IcoSphere won't vanish but subd 6 will (as with pre-bmesh blender) */
if ( /* (med->flag & ME_EDGEDRAW) && */ /* assume to be true */
(e->l && (e->l != e->l->radial_next)) &&
(dot_v3v3(e->l->f->no, e->l->radial_next->f->no) > 0.998f))
(dot_v3v3(e->l->f->no, e->l->radial_next->f->no) > 0.9995f))
{
med->flag &= ~ME_EDGEDRAW;
}

View File

@@ -109,7 +109,11 @@ static void alter_co(BMesh *bm, BMVert *v, BMEdge *UNUSED(origed), const SubDPar
copy_v3_v3(co, v->co);
copy_v3_v3(prev_co, co);
if (params->use_smooth) {
if (UNLIKELY(params->use_sphere)) { /* subdivide sphere */
normalize_v3(co);
mul_v3_fl(co, params->smooth);
}
else if (params->use_smooth) {
/* we calculate an offset vector vec1[], to be added to *co */
float len, nor[3], nor1[3], nor2[3], smooth = params->smooth;
@@ -134,10 +138,6 @@ static void alter_co(BMesh *bm, BMVert *v, BMEdge *UNUSED(origed), const SubDPar
add_v3_v3(co, tvec);
}
else if (params->use_sphere) { /* subdivide sphere */
normalize_v3(co);
mul_v3_fl(co, params->smooth);
}
if (params->use_fractal) {
float len = len_v3v3(vsta->co, vend->co);

View File

@@ -62,6 +62,9 @@
* so I need to decide what to do in these cases.
*/
/* BMESH_TODO - resolve this */
#define BMESH_263_VERT_BEVEL_WORKAROUND
/* ------- Bevel code starts here -------- */
BME_TransData_Head *BME_init_transdata(int bufsize)
@@ -360,8 +363,7 @@ static BMVert *BME_bevel_split_edge(BMesh *bm, BMVert *v, BMVert *v1, BMLoop *l,
is_edge = BME_bevel_get_vec(vec1, v, v1, td); /* get the vector we will be projecting onto */
BME_bevel_get_vec(vec2, v, v2, td); /* get the vector we will be projecting parallel to */
len = len_v3(vec1);
normalize_v3(vec1);
len = normalize_v3(vec1);
vtd = BME_get_transdata(td, sv);
vtd1 = BME_get_transdata(td, v);
@@ -399,8 +401,7 @@ static BMVert *BME_bevel_split_edge(BMesh *bm, BMVert *v, BMVert *v1, BMLoop *l,
}
madd_v3_v3v3fl(sv->co, v->co, vec1, dis);
sub_v3_v3v3(vec1, sv->co, vtd1->org);
dis = len_v3(vec1);
normalize_v3(vec1);
dis = normalize_v3(vec1);
BME_assign_transdata(td, bm, sv, vtd1->org, vtd1->org, vec1, sv->co, dis, scale, maxfactor, vtd->max);
return sv;
@@ -662,10 +663,15 @@ static BMFace *BME_bevel_poly(BMesh *bm, BMFace *f, float value, int options, BM
/* find a good normal for this face (there's better ways, I'm sure) */
BM_ITER_ELEM (l, &iter, f, BM_LOOPS_OF_FACE) {
#ifdef BMESH_263_VERT_BEVEL_WORKAROUND
add_newell_cross_v3_v3v3(up_vec, l->prev->v->co, l->v->co);
#else
BME_bevel_get_vec(vec1, l->v, l->next->v, td);
BME_bevel_get_vec(vec2, l->prev->v, l->v, td);
cross_v3_v3v3(vec3, vec2, vec1);
add_v3_v3(up_vec, vec3);
#endif
}
normalize_v3(up_vec);
@@ -779,28 +785,32 @@ static float BME_bevel_get_angle(BMEdge *e, BMVert *v)
return dot_v3v3(vec3, vec4);
}
static float UNUSED_FUNCTION(BME_bevel_get_angle_vert)(BMVert *v)
static float BME_bevel_get_angle_vert(BMVert *v)
{
BMIter iter;
BMLoop *l;
float n[3];
float n_tmp[3];
float angle_diff = 0.0f;
float tot_angle = 0.0f;
BM_ITER_ELEM (l, &iter, v, BM_LOOPS_OF_VERT) {
const float angle = BM_loop_calc_face_angle(l);
tot_angle += angle;
BM_loop_calc_face_normal(l, n_tmp);
madd_v3_v3fl(n, n_tmp, BM_loop_calc_face_angle(l));
madd_v3_v3fl(n, n_tmp, angle);
}
normalize_v3(n);
BM_ITER_ELEM (l, &iter, v, BM_LOOPS_OF_VERT) {
/* could cache from before */
BM_loop_calc_face_normal(l, n_tmp);
angle_diff += angle_normalized_v3v3(n, n_tmp) * (BM_loop_calc_face_angle(l) * (float)(M_PI * 0.5));
angle_diff += angle_normalized_v3v3(n, n_tmp) * BM_loop_calc_face_angle(l);
}
return angle_diff;
/* return cosf(angle_diff + 0.001f); */ /* compare with dot product */
return (angle_diff / tot_angle) * (M_PI / 2);
}
static void BME_bevel_add_vweight(BME_TransData_Head *td, BMesh *bm, BMVert *v, float weight, float factor, int options)
@@ -845,8 +855,7 @@ static void bevel_init_verts(BMesh *bm, int options, float angle, BME_TransData_
BMVert *v;
BMIter iter;
float weight;
// const float threshold = (options & BME_BEVEL_ANGLE) ? cosf(angle + 0.001) : 0.0f;
(void)angle;
/* const float threshold = (options & BME_BEVEL_ANGLE) ? cosf(angle + 0.001) : 0.0f; */ /* UNUSED */
BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) {
weight = 0.0f;
@@ -861,14 +870,12 @@ static void bevel_init_verts(BMesh *bm, int options, float angle, BME_TransData_
else if (options & BME_BEVEL_WEIGHT) {
weight = BM_elem_float_data_get(&bm->vdata, v, CD_BWEIGHT);
}
#if 0 // not working well
else if (options & BME_BEVEL_ANGLE) {
/* dont set weight_v1/weight_v2 here, add direct */
if (BME_bevel_get_angle_vert(bm, v) < threshold) {
if (BME_bevel_get_angle_vert(v) > angle) {
weight = 1.0f;
}
}
#endif
else {
weight = 1.0f;
}

View File

@@ -14,7 +14,7 @@ if env['OURPLATFORM'] == 'linux':
cflags='-pthread'
incs += ' ../../../extern/binreloc/include'
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
incs += ' ' + env['BF_PTHREADS_INC']
if env['WITH_BF_INTERNATIONAL']:

View File

@@ -2414,7 +2414,7 @@ float uiLayoutGetScaleX(uiLayout *layout)
float uiLayoutGetScaleY(uiLayout *layout)
{
return layout->scale[0];
return layout->scale[1];
}
/********************** Layout *******************/

View File

@@ -15,7 +15,7 @@ if env['OURPLATFORM'] == 'linux':
cflags='-pthread'
incs += ' ../../../extern/binreloc/include'
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
incs += ' ' + env['BF_PTHREADS_INC']
if env['WITH_BF_GAMEENGINE']:

View File

@@ -205,10 +205,10 @@ static void knife_input_ray_cast(KnifeTool_OpData *kcd, const int mval_i[2],
static void knife_update_header(bContext *C, KnifeTool_OpData *kcd)
{
#define HEADER_LENGTH 180
#define HEADER_LENGTH 190
char header[HEADER_LENGTH];
BLI_snprintf(header, HEADER_LENGTH, "LMB: define cut lines, Return: confirm, Esc or RMB: cancel, E: new cut, Ctrl: midpoint snap (%s), "
BLI_snprintf(header, HEADER_LENGTH, "LMB: define cut lines, Return/Spacebar: confirm, Esc or RMB: cancel, E: new cut, Ctrl: midpoint snap (%s), "
"Shift: ignore snap (%s), C: angle constrain (%s), Z: cut through (%s)",
kcd->snap_midpoints ? "On" : "Off",
kcd->ignore_edge_snapping ? "On" : "Off",
@@ -2918,6 +2918,7 @@ wmKeyMap *knifetool_modal_keymap(wmKeyConfig *keyconf)
WM_modalkeymap_add_item(keymap, RIGHTMOUSE, KM_PRESS, KM_ANY, 0, KNF_MODAL_CANCEL);
WM_modalkeymap_add_item(keymap, RETKEY, KM_PRESS, KM_ANY, 0, KNF_MODAL_CONFIRM);
WM_modalkeymap_add_item(keymap, PADENTER, KM_PRESS, KM_ANY, 0, KNF_MODAL_CONFIRM);
WM_modalkeymap_add_item(keymap, SPACEKEY, KM_PRESS, KM_ANY, 0, KNF_MODAL_CONFIRM);
WM_modalkeymap_add_item(keymap, EKEY, KM_PRESS, 0, 0, KNF_MODAL_NEW_CUT);
WM_modalkeymap_add_item(keymap, LEFTCTRLKEY, KM_PRESS, KM_ANY, 0, KNF_MODAL_MIDPOINT_ON);

View File

@@ -372,6 +372,7 @@ static int edbm_rip_invoke__vert(bContext *C, wmOperator *op, wmEvent *event)
BMLoop *l;
BMEdge *e, *e2;
BMVert *v, *ripvert = NULL;
const int totvert_orig = bm->totvert;
int i;
float projectMat[4][4], fmval[3] = {event->mval[0], event->mval[1]};
float dist = FLT_MAX;
@@ -432,9 +433,13 @@ static int edbm_rip_invoke__vert(bContext *C, wmOperator *op, wmEvent *event)
int vout_len;
BM_vert_select_set(bm, v, FALSE);
bmesh_vert_separate(bm, v, &vout, &vout_len);
if (vout_len < 2) {
if (bmesh_vert_separate(bm, v, &vout, &vout_len) == FALSE) {
BKE_report(op->reports, RPT_ERROR, "Error ripping vertex from faces");
return OPERATOR_CANCELLED;
}
else if (vout_len < 2) {
MEM_freeN(vout);
/* set selection back to avoid active-unselected vertex */
BM_vert_select_set(bm, v, TRUE);
/* should never happen */
@@ -573,6 +578,11 @@ static int edbm_rip_invoke__vert(bContext *C, wmOperator *op, wmEvent *event)
}
}
if (totvert_orig == bm->totvert) {
BKE_report(op->reports, RPT_ERROR, "No vertices could be ripped");
return OPERATOR_CANCELLED;
}
return OPERATOR_FINISHED;
}
@@ -590,6 +600,7 @@ static int edbm_rip_invoke__edge(bContext *C, wmOperator *op, wmEvent *event)
BMLoop *l;
BMEdge *e, *e2;
BMVert *v;
const int totedge_orig = bm->totedge;
int i;
float projectMat[4][4], fmval[3] = {event->mval[0], event->mval[1]};
@@ -641,11 +652,15 @@ static int edbm_rip_invoke__edge(bContext *C, wmOperator *op, wmEvent *event)
edbm_rip_edge_side_measure(e2, l_b, ar, projectMat, fmval)) ? l_a : l_b;
l = BM_face_other_edge_loop(l->f, e2, v);
l = l->radial_next;
l = BM_face_other_edge_loop(l->f, l->e, v);
/* important edge is manifold else we can be attempting to split off a fan that don't budge,
* not crashing but adds duplicate edge. */
if (BM_edge_is_manifold(l->e)) {
l = l->radial_next;
l = BM_face_other_edge_loop(l->f, l->e, v);
if (l) {
BM_elem_flag_enable(l->e, BM_ELEM_TAG);
if (l) {
BM_elem_flag_enable(l->e, BM_ELEM_TAG);
}
}
}
else {
@@ -671,6 +686,12 @@ static int edbm_rip_invoke__edge(bContext *C, wmOperator *op, wmEvent *event)
ar, projectMat, fmval);
MEM_freeN(eloop_pairs);
if (totedge_orig == bm->totedge) {
BKE_report(op->reports, RPT_ERROR, "No edges could be ripped");
return OPERATOR_CANCELLED;
}
EDBM_selectmode_flush(em);
return OPERATOR_FINISHED;
}
@@ -684,7 +705,6 @@ static int edbm_rip_invoke(bContext *C, wmOperator *op, wmEvent *event)
BMIter iter;
BMEdge *e;
int singlesel = (bm->totvertsel == 1 && bm->totedgesel == 0 && bm->totfacesel == 0);
const int totedge_orig = bm->totedge;
int ret;
/* running in face mode hardly makes sense, so convert to region loop and rip */
@@ -724,13 +744,6 @@ static int edbm_rip_invoke(bContext *C, wmOperator *op, wmEvent *event)
return OPERATOR_CANCELLED;
}
EDBM_selectmode_flush(em);
if (totedge_orig == bm->totedge) {
BKE_report(op->reports, RPT_ERROR, "No edges could be ripped");
return OPERATOR_CANCELLED;
}
BLI_assert(singlesel ? (bm->totvertsel > 0) : (bm->totedgesel > 0));
if (bm->totvertsel == 0) {

View File

@@ -4266,7 +4266,7 @@ void MESH_OT_inset(wmOperatorType *ot)
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
RNA_def_boolean(ot->srna, "use_boundary", TRUE, "Boundary", "Inset face boundries");
RNA_def_boolean(ot->srna, "use_boundary", TRUE, "Boundary", "Inset face boundaries");
RNA_def_boolean(ot->srna, "use_even_offset", TRUE, "Offset Even", "Scale the offset to give more even thickness");
RNA_def_boolean(ot->srna, "use_relative_offset", FALSE, "Offset Relative", "Scale the offset by surrounding geometry");

View File

@@ -15,7 +15,7 @@ if env['OURPLATFORM'] == 'linux':
cflags='-pthread'
incs += ' ../../../extern/binreloc/include'
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
incs += ' ' + env['BF_PTHREADS_INC']
if env['WITH_BF_PYTHON']:

View File

@@ -1569,7 +1569,7 @@ static void single_mat_users(Scene *scene, int flag, int do_textures)
tex->id.us--;
tex= copy_texture(tex);
BKE_copy_animdata_id_action(&tex->id);
ma->mtex[b]->tex= tex;
man->mtex[b]->tex= tex;
}
}
}

View File

@@ -1264,7 +1264,6 @@ static void vgroup_blend(Object *ob, const float fac)
if (BLI_findlink(&ob->defbase, def_nr)) {
const float ifac = 1.0f - fac;
int i1, i2;
BMEditMesh *em = BMEdit_FromObject(ob);
BMesh *bm = em ? em->bm : NULL;
@@ -1301,14 +1300,15 @@ static void vgroup_blend(Object *ob, const float fac)
sel2 = BM_elem_flag_test(eed->v2, BM_ELEM_SELECT);
if (sel1 != sel2) {
int i1 /* , i2 */;
/* i1 is always the selected one */
if (sel1) {
i1= BM_elem_index_get(eed->v1);
i2= BM_elem_index_get(eed->v2);
/* i2= BM_elem_index_get(eed->v2); */ /* UNUSED */
eve= eed->v2;
}
else {
i2= BM_elem_index_get(eed->v1);
/* i2= BM_elem_index_get(eed->v1); */ /* UNUSED */
i1= BM_elem_index_get(eed->v2);
eve= eed->v1;
}
@@ -1342,6 +1342,7 @@ static void vgroup_blend(Object *ob, const float fac)
sel2 = me->mvert[ed->v2].flag & SELECT;
if (sel1 != sel2) {
int i1, i2;
/* i1 is always the selected one */
if (sel1) {
i1 = ed->v1;

View File

@@ -14,7 +14,7 @@ if env['OURPLATFORM'] == 'linux':
cflags='-pthread'
incs += ' ../../../extern/binreloc/include'
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
incs += ' ' + env['BF_PTHREADS_INC']

View File

@@ -13,7 +13,7 @@ if env['OURPLATFORM'] == 'linux':
cflags='-pthread'
incs += ' ../../../extern/binreloc/include'
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
incs += ' ' + env['BF_PTHREADS_INC']

View File

@@ -358,7 +358,7 @@ static Scene *preview_prepare_scene(Scene *scene, ID *id, int id_type, ShaderPre
if (OB_TYPE_SUPPORT_MATERIAL(base->object->type)) {
/* don't use assign_material, it changed mat->id.us, which shows in the UI */
Material ***matar = give_matarar(base->object);
int actcol = MAX2(base->object->actcol > 0, 1) - 1;
int actcol = MAX2(base->object->actcol - 1, 0);
if (matar && actcol < base->object->totcol)
(*matar)[actcol] = mat;

View File

@@ -14,7 +14,7 @@ if env['OURPLATFORM'] == 'linux':
cflags='-pthread'
incs += ' ../../../extern/binreloc/include'
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
incs += ' ' + env['BF_PTHREADS_INC']
if env['WITH_BF_INTERNATIONAL']:

View File

@@ -56,6 +56,8 @@
#include "RNA_access.h"
#include "RNA_define.h"
#include "UI_interface.h"
#include "WM_types.h"
#include "WM_api.h"
@@ -69,6 +71,8 @@ typedef struct ScreenshotData {
unsigned int *dumprect;
int dumpsx, dumpsy;
rcti crop;
ImageFormatData im_format;
} ScreenshotData;
/* get shot from frontbuffer */
@@ -113,9 +117,13 @@ static int screenshot_data_create(bContext *C, wmOperator *op)
scd->dumpsx= dumpsx;
scd->dumpsy= dumpsy;
scd->dumprect= dumprect;
if (sa)
if (sa) {
scd->crop= sa->totrct;
op->customdata= scd;
}
BKE_imformat_defaults(&scd->im_format);
op->customdata = scd;
return TRUE;
}
@@ -164,20 +172,13 @@ static int screenshot_exec(bContext *C, wmOperator *op)
if (scd) {
if (scd->dumprect) {
Scene *scene= CTX_data_scene(C);
ImBuf *ibuf;
char path[FILE_MAX];
RNA_string_get(op->ptr, "filepath", path);
BLI_strncpy(G.ima, path, sizeof(G.ima));
BLI_path_abs(path, G.main->name);
/* BKE_add_image_extension() checks for if extension was already set */
if (scene->r.scemode & R_EXTENSION)
if (strlen(path)<FILE_MAX-5)
BKE_add_image_extension(path, scene->r.im_format.imtype);
/* operator ensures the extension */
ibuf= IMB_allocImBuf(scd->dumpsx, scd->dumpsy, 24, 0);
ibuf->rect= scd->dumprect;
@@ -185,7 +186,11 @@ static int screenshot_exec(bContext *C, wmOperator *op)
if (!RNA_boolean_get(op->ptr, "full"))
screenshot_crop(ibuf, scd->crop);
BKE_write_ibuf(ibuf, path, &scene->r.im_format);
if (scd->im_format.planes == R_IMF_PLANES_BW) {
/* bw screenshot? - users will notice if it fails! */
IMB_color_to_bw(ibuf);
}
BKE_write_ibuf(ibuf, path, &scd->im_format);
IMB_freeImBuf(ibuf);
}
@@ -200,8 +205,9 @@ static int screenshot_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)
if (screenshot_data_create(C, op)) {
if (RNA_struct_property_is_set(op->ptr, "filepath"))
return screenshot_exec(C, op);
RNA_string_set(op->ptr, "filepath", G.ima);
/* extension is added by 'screenshot_check' after */
RNA_string_set(op->ptr, "filepath", G.relbase_valid ? G.main->name : "//screen");
WM_event_add_fileselect(C, op);
@@ -210,21 +216,52 @@ static int screenshot_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)
return OPERATOR_CANCELLED;
}
static int screenshot_check(bContext *UNUSED(C), wmOperator *op)
{
ScreenshotData *scd = op->customdata;
return WM_operator_filesel_ensure_ext_imtype(op, scd->im_format.imtype);
}
static int screenshot_cancel(bContext *UNUSED(C), wmOperator *op)
{
screenshot_data_free(op);
return OPERATOR_CANCELLED;
}
static int screenshot_draw_check_prop(PointerRNA *UNUSED(ptr), PropertyRNA *prop)
{
const char *prop_id = RNA_property_identifier(prop);
return !(strcmp(prop_id, "filepath") == 0);
}
static void screenshot_draw(bContext *UNUSED(C), wmOperator *op)
{
uiLayout *layout = op->layout;
ScreenshotData *scd = op->customdata;
PointerRNA ptr;
/* image template */
RNA_pointer_create(NULL, &RNA_ImageFormatSettings, &scd->im_format, &ptr);
uiTemplateImageSettings(layout, &ptr);
/* main draw call */
RNA_pointer_create(NULL, op->type->srna, op->properties, &ptr);
uiDefAutoButsRNA(layout, &ptr, screenshot_draw_check_prop, '\0');
}
void SCREEN_OT_screenshot(wmOperatorType *ot)
{
ot->name = "Save Screenshot"; /* weak: opname starting with 'save' makes filewindow give save-over */
ot->idname = "SCREEN_OT_screenshot";
ot->invoke = screenshot_invoke;
ot->check = screenshot_check;
ot->exec = screenshot_exec;
ot->poll = WM_operator_winactive;
ot->cancel = screenshot_cancel;
ot->ui = screenshot_draw;
ot->poll = WM_operator_winactive;
ot->flag = 0;

View File

@@ -18,7 +18,7 @@ if env['OURPLATFORM'] == 'linuxcross':
if env['WITH_BF_OPENMP']:
incs += ' ' + env['BF_OPENMP_INC']
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
incs += ' ' + env['BF_PTHREADS_INC']
env.BlenderLib ( 'bf_editors_sculpt_paint', sources, Split(incs), defines=defs, libtype=['core'], priority=[40] )

View File

@@ -254,12 +254,18 @@ static int brush_select_exec(bContext *C, wmOperator *op)
size_t tool_offset;
if (paint_mode == OB_MODE_ACTIVE) {
/* select current paint mode */
paint_mode = CTX_data_active_object(C)->mode &
(OB_MODE_SCULPT |
OB_MODE_VERTEX_PAINT |
OB_MODE_WEIGHT_PAINT |
OB_MODE_TEXTURE_PAINT);
Object *ob = CTX_data_active_object(C);
if (ob) {
/* select current paint mode */
paint_mode = ob->mode &
(OB_MODE_SCULPT |
OB_MODE_VERTEX_PAINT |
OB_MODE_WEIGHT_PAINT |
OB_MODE_TEXTURE_PAINT);
}
else {
return OPERATOR_CANCELLED;
}
}
switch (paint_mode) {

View File

@@ -26,7 +26,7 @@ if env['OURPLATFORM'] == 'linux':
cflags='-pthread'
incs += ' ../../../extern/binreloc/include'
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
incs += ' ' + env['BF_PTHREADS_INC']
env.BlenderLib ( 'bf_editors_space_file', sources, Split(incs), defs, libtype=['core'], priority=[115] )

View File

@@ -18,7 +18,7 @@ if env['WITH_BF_TIFF']:
if env['WITH_BF_CINEON']:
defs.append('WITH_CINEON')
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
incs += ' ' + env['BF_PTHREADS_INC']
env.BlenderLib ( 'bf_editors_space_image', sources, Split(incs), defs, libtype=['core'], priority=[40] )

View File

@@ -1001,11 +1001,7 @@ typedef struct {
static void save_image_options_defaults(SaveImageOptions *simopts)
{
memset(&simopts->im_format, 0, sizeof(simopts->im_format));
simopts->im_format.planes = R_IMF_PLANES_RGB;
simopts->im_format.imtype = R_IMF_IMTYPE_PNG;
simopts->im_format.quality = 90;
simopts->im_format.compress = 90;
BKE_imformat_defaults(&simopts->im_format);
simopts->filepath[0] = '\0';
}
@@ -1246,13 +1242,7 @@ static int image_save_as_exec(bContext *C, wmOperator *op)
static int image_save_as_check(bContext *UNUSED(C), wmOperator *op)
{
ImageFormatData *imf = op->customdata;
char filepath[FILE_MAX];
RNA_string_get(op->ptr, "filepath", filepath);
if (BKE_add_image_extension(filepath, imf->imtype)) {
RNA_string_set(op->ptr, "filepath", filepath);
return TRUE;
}
return FALSE;
return WM_operator_filesel_ensure_ext_imtype(op, imf->imtype);
}
static int image_save_as_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))

View File

@@ -19,7 +19,7 @@ if env['OURPLATFORM'] == 'linux':
cflags='-pthread'
incs += ' ../../../extern/binreloc/include'
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
incs += ' ' + env['BF_PTHREADS_INC']
if env['WITH_BF_INTERNATIONAL']:

View File

@@ -8,7 +8,7 @@ incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
incs += ' ../../makesrna ../../blenloader'
incs += ' #/intern/audaspace/intern'
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
incs += ' ' + env['BF_PTHREADS_INC']
env.BlenderLib ( 'bf_editors_space_sequencer', sources, Split(incs), [], libtype=['core'], priority=[100] )

View File

@@ -13,7 +13,7 @@ incs += ' #source/gameengine/BlenderRoutines'
if env['WITH_BF_GAMEENGINE']:
defs.append('WITH_GAMEENGINE')
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
incs += ' ' + env['BF_PTHREADS_INC']
if env['WITH_BF_INTERNATIONAL']:

View File

@@ -98,7 +98,7 @@
static void star_stuff_init_func(void)
{
cpack(-1);
cpack(0xFFFFFF);
glPointSize(1.0);
glBegin(GL_POINTS);
}

View File

@@ -8,7 +8,7 @@ defs = [ 'GLEW_STATIC' ]
incs = '../blenlib ../blenkernel ../makesdna ../makesrna ../include ../blenloader ../nodes ../nodes/intern'
incs += ' #/extern/glew/include #intern/guardedalloc #intern/smoke/extern ../imbuf .'
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
incs += ' ' + env['BF_PTHREADS_INC']
incs += ' ' + env['BF_OPENGL_INC']

View File

@@ -15,7 +15,7 @@ incs += ' ' + env['BF_ZLIB_INC']
defs = []
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
incs += ' ' + env['BF_PTHREADS_INC']
incs += ' ../../../intern/utfconv'

View File

@@ -331,7 +331,7 @@ static int initialise_4K_poc(opj_poc_t *POC, int numres)
static void cinema_parameters(opj_cparameters_t *parameters)
{
parameters->tile_size_on = FALSE;
parameters->tile_size_on = 0; /* FALSE */
parameters->cp_tdx=1;
parameters->cp_tdy=1;

View File

@@ -439,7 +439,7 @@ static int imb_read_tiff_pixels(ImBuf *ibuf, TIFF *image, int premul)
if (bitspersample == 32) {
if (chan == 3 && spp == 3) /* fill alpha if only RGB TIFF */
memset(fbuf, 1.0, sizeof(fbuf));
fill_vn_fl(fbuf, ibuf->x, 1.0f);
else
success |= TIFFReadScanline(image, fbuf, row, chan);
scanline_separate_32bit(tmpibuf->rect_float+ib_offset, fbuf, ibuf->x, chan);
@@ -447,7 +447,7 @@ static int imb_read_tiff_pixels(ImBuf *ibuf, TIFF *image, int premul)
}
else if (bitspersample == 16) {
if (chan == 3 && spp == 3) /* fill alpha if only RGB TIFF */
memset(sbuf, 65535, sizeof(sbuf));
fill_vn_ushort(sbuf, ibuf->x, 65535);
else
success |= TIFFReadScanline(image, sbuf, row, chan);
scanline_separate_16bit(tmpibuf->rect_float+ib_offset, sbuf, ibuf->x, chan);

View File

@@ -251,7 +251,7 @@ typedef struct ImageFormatData {
char depth; /* bits per channel, R_IMF_CHAN_DEPTH_8 -> 32,
* not a flag, only set 1 at a time */
char planes ; /* - R_IMF_PLANES_BW, R_IMF_PLANES_RGB, R_IMF_PLANES_RGBA */
char planes; /* - R_IMF_PLANES_BW, R_IMF_PLANES_RGB, R_IMF_PLANES_RGBA */
char flag; /* generic options for all image types, alpha zbuffer */
char quality; /* (0 - 100), eg: jpeg quality */

View File

@@ -133,7 +133,7 @@ typedef struct Sequence {
char name[64]; /* SEQ_NAME_MAXSTR - name, set by default and needs to be unique, for RNA paths */
int flag, type; /*flags bitmap (see below) and the type of sequence*/
int len; /* the length of the contense of this strip - before handles are applied */
int len; /* the length of the contents of this strip - before handles are applied */
int start, startofs, endofs;
int startstill, endstill;
int machine, depth; /*machine - the strip channel, depth - the depth in the sequence when dealing with metastrips */

View File

@@ -57,7 +57,7 @@ dna.Depends ('dna.c', makesdna)
dna.Depends ('dna.c', header_files)
if env['OURPLATFORM'] != 'linuxcross':
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc', 'win32-mingw'):
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc', 'win32-mingw', 'win64-mingw'):
dna.Command ('dna.c', '', "\"" + root_build_dir+os.sep+"makesdna\" $TARGET")
else:
dna.Command ('dna.c', '', "\"" + root_build_dir+os.sep+"makesdna\" $TARGET")

View File

@@ -68,7 +68,7 @@ if env['OURPLATFORM'] == 'linux':
cflags='-pthread'
incs += ' ../../../extern/binreloc/include'
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
incs += ' ' + env['BF_PTHREADS_INC']
if env['WITH_BF_INTERNATIONAL']:

View File

@@ -96,7 +96,7 @@ if env['OURPLATFORM'] == 'linux':
cflags='-pthread'
incs += ' ../../../extern/binreloc/include'
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
incs += ' ' + env['BF_PTHREADS_INC']
if env['WITH_BF_INTERNATIONAL']:
@@ -160,7 +160,7 @@ rna.Depends (generated_files, makesrna)
build_dir = root_build_dir + os.sep +'source' + os.sep + 'blender' + os.sep + 'makesrna' + os.sep + 'intern' + os.sep
if env['OURPLATFORM'] != 'linuxcross':
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc', 'win32-mingw'):
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc', 'win32-mingw', 'win64-mingw'):
rna.Command (generated_files, '', "\"" + root_build_dir+os.sep+"makesrna.exe\" \"" + build_dir )
else:
rna.Command (generated_files, '', "\"" + root_build_dir+os.sep+"makesrna\" \"" + build_dir + '"' )

View File

@@ -1692,6 +1692,8 @@ static void rna_def_mtface(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Image", "");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
/* these are for editing only, access at loops now */
#if 0
prop = RNA_def_property(srna, "select_uv", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TF_SEL1);
RNA_def_property_array(prop, 4);
@@ -1703,6 +1705,7 @@ static void rna_def_mtface(BlenderRNA *brna)
RNA_def_property_array(prop, 4);
RNA_def_property_ui_text(prop, "UV Pinned", "");
RNA_def_property_update(prop, 0, "rna_Mesh_update_select");
#endif
prop = RNA_def_property(srna, "uv1", PROP_FLOAT, PROP_XYZ);
RNA_def_property_array(prop, 2);
@@ -1801,13 +1804,13 @@ static void rna_def_mtexpoly(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Image", "");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
#if 0 /* moved to MeshUVLoopLayer */
prop = RNA_def_property(srna, "select_uv", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TF_SEL1);
RNA_def_property_array(prop, 4);
RNA_def_property_ui_text(prop, "UV Selected", "");
RNA_def_property_update(prop, 0, "rna_Mesh_update_select");
#if 0 /* moved to MeshUVLoopLayer */
prop = RNA_def_property(srna, "pin_uv", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "unwrap", TF_PIN1);
RNA_def_property_array(prop, 4);

View File

@@ -603,7 +603,7 @@ void rna_object_vcollayer_name_set(PointerRNA *ptr, const char *value, char *res
static int rna_Object_active_material_index_get(PointerRNA *ptr)
{
Object *ob = (Object*)ptr->id.data;
return MAX2(ob->actcol-1, 0);
return MAX2(ob->actcol - 1, 0);
}
static void rna_Object_active_material_index_set(PointerRNA *ptr, int value)

View File

@@ -33,7 +33,7 @@ if env['OURPLATFORM'] == 'linux':
cflags='-pthread'
incs += ' ../../../extern/binreloc/include'
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
incs += ' ' + env['BF_PTHREADS_INC']
env.BlenderLib ( libname = 'bf_nodes', sources = sources, includes = Split(incs), defines = defs, libtype=['core','player'], priority = [190,105] )

View File

@@ -9,7 +9,7 @@ incs += ' ../imbuf ../blenloader ../bmesh ../gpu ../render/extern/include ../win
incs += ' #intern/guardedalloc #intern/memutil #extern/glew/include #intern/cycles/blender'
incs += ' #intern/audaspace/intern ' + env['BF_PYTHON_INC']
is_debug = (env['OURPLATFORM'] in ('win32-mingw', 'win32-vc','win64-vc') and env['BF_DEBUG'])
is_debug = (env['OURPLATFORM'] in ('win32-mingw', 'win32-vc','win64-vc', 'win64-mingw') and env['BF_DEBUG'])
# bmesh
defs = []
@@ -56,7 +56,7 @@ if env['WITH_BF_FFMPEG']:
defs.append('WITH_FFMPEG')
incs += ' ' + env['BF_FFMPEG_INC']
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-mingw', 'linuxcross', 'win64-vc'):
incs += ' ' + env['BF_PTHREADS_INC']
sources = env.Glob('intern/*.c')

View File

@@ -216,6 +216,82 @@ static PyGetSetDef bpy_bmlayeritem_getseters[] = {
/* BMLayerCollection
* ----------------- */
PyDoc_STRVAR(bpy_bmlayercollection_new_doc,
".. method:: new(name)\n"
"\n"
" Create a new layer\n"
"\n"
" :arg name: Optional name argument (will be made unique).\n"
" :type name: string\n"
" :return: The newly created layer.\n"
" :rtype: :class:`BMLayerItem`\n"
);
static PyObject *bpy_bmlayercollection_new(BPy_BMLayerCollection *self, PyObject *args)
{
const char *name = NULL;
int index;
CustomData *data;
BPY_BM_CHECK_OBJ(self);
if (!PyArg_ParseTuple(args, "|s:new", &name)) {
return NULL;
}
data = bpy_bm_customdata_get(self->bm, self->htype);
if (name) {
BM_data_layer_add_named(self->bm, data, self->type, name);
}
else {
BM_data_layer_add(self->bm, data, self->type);
}
index = CustomData_number_of_layers(data, self->type) - 1;
BLI_assert(index >= 0);
return BPy_BMLayerItem_CreatePyObject(self->bm, self->htype, self->type, index);
}
PyDoc_STRVAR(bpy_bmlayercollection_remove_doc,
".. method:: remove(layer)\n"
"\n"
" Remove a layer\n"
"\n"
" :arg layer: The layer to remove.\n"
" :type layer: :class:`BMLayerItem`\n"
);
static PyObject *bpy_bmlayercollection_remove(BPy_BMLayerCollection *self, BPy_BMLayerItem *value)
{
CustomData *data;
BPY_BM_CHECK_OBJ(self);
if (!BPy_BMLayerItem_Check(value)) {
PyErr_Format(PyExc_TypeError,
"layers.remove(x): expected BMLayerItem, not '%.200s'",
Py_TYPE(value)->tp_name);
return NULL;
}
BPY_BM_CHECK_OBJ(value);
if ((self->bm != value->bm) ||
(self->type != value->type) ||
(self->htype != value->htype))
{
PyErr_SetString(PyExc_ValueError,
"layers.remove(x): x not in layers");
}
data = bpy_bm_customdata_get(self->bm, self->htype);
BM_data_layer_free_n(self->bm, data, self->type, value->index);
Py_RETURN_NONE;
}
PyDoc_STRVAR(bpy_bmlayercollection_keys_doc,
".. method:: keys()\n"
"\n"
@@ -361,17 +437,13 @@ static PyObject *bpy_bmlayercollection_get(BPy_BMLayerCollection *self, PyObject
}
static struct PyMethodDef bpy_bmelemseq_methods[] = {
{"new", (PyCFunction)bpy_bmlayercollection_new, METH_VARARGS, bpy_bmlayercollection_new_doc},
{"remove", (PyCFunction)bpy_bmlayercollection_remove, METH_O, bpy_bmlayercollection_remove_doc},
{"keys", (PyCFunction)bpy_bmlayercollection_keys, METH_NOARGS, bpy_bmlayercollection_keys_doc},
{"values", (PyCFunction)bpy_bmlayercollection_values, METH_NOARGS, bpy_bmlayercollection_values_doc},
{"items", (PyCFunction)bpy_bmlayercollection_items, METH_NOARGS, bpy_bmlayercollection_items_doc},
{"get", (PyCFunction)bpy_bmlayercollection_get, METH_VARARGS, bpy_bmlayercollection_get_doc},
/* for later! */
#if 0
{"new", (PyCFunction)bpy_bmlayercollection_new, METH_O, bpy_bmlayercollection_new_doc},
{"remove", (PyCFunction)bpy_bmlayercollection_new, METH_O, bpy_bmlayercollection_remove_doc},
#endif
{NULL, NULL, 0, NULL}
};
@@ -439,8 +511,8 @@ static PyObject *bpy_bmlayercollection_subscript_slice(BPy_BMLayerCollection *se
BPY_BM_CHECK_OBJ(self);
if (start >= start) start = len - 1;
if (stop >= stop) stop = len - 1;
if (start >= len) start = len - 1;
if (stop >= len) stop = len - 1;
tuple = PyTuple_New(stop - start);

View File

@@ -29,7 +29,7 @@ if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
cflags_raytrace = env['CCFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS']
cxxflags_raytrace = env['CCFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS']
if env['OURPLATFORM'] == 'win32-mingw':
if env['OURPLATFORM'] in ('win32-mingw', 'win64-mingw'):
if env['WITH_BF_RAYOPTIMIZATION']:
cflags_raytrace = env['CCFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS']
cxxflags_raytrace = env['CXXFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS']
@@ -60,7 +60,7 @@ if env['WITH_BF_OPENEXR']:
if env['WITH_BF_GAMEENGINE']:
defs.append('WITH_GAMEENGINE')
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
incs += ' ' + env['BF_PTHREADS_INC']
#

View File

@@ -1782,9 +1782,10 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem
hasize = ma->hasize;
/* XXX 'tpsys' is alwyas NULL, this code won't run! */
/* get orco */
if (tpsys && part->phystype==PART_PHYS_NO) {
tpa=tpsys->particles+pa->num;
if (tpsys && part->phystype == PART_PHYS_NO) {
tpa = tpsys->particles + pa->num;
psys_particle_on_emitter(psmd,tpart->from,tpa->num,pa->num_dmcache,tpa->fuv,tpa->foffset,co,nor,0,0,sd.orco,0);
}
else

View File

@@ -30,7 +30,7 @@ if env['OURPLATFORM'] == 'linux':
cflags='-pthread'
incs += ' ../../../extern/binreloc/include'
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
incs += ' ' + env['BF_PTHREADS_INC']
incs += ' ../../intern/utfconv'

View File

@@ -166,6 +166,7 @@ int WM_enum_search_invoke(struct bContext *C, struct wmOperator *op, struct wm
int WM_operator_confirm (struct bContext *C, struct wmOperator *op, struct wmEvent *event);
/* invoke callback, file selector "filepath" unset + exec */
int WM_operator_filesel (struct bContext *C, struct wmOperator *op, struct wmEvent *event);
int WM_operator_filesel_ensure_ext_imtype(wmOperator *op, const char imtype);
/* poll callback, context checks */
int WM_operator_winactive (struct bContext *C);
/* invoke callback, exec + redo popup */

View File

@@ -65,6 +65,7 @@
#include "BKE_context.h"
#include "BKE_depsgraph.h"
#include "BKE_idprop.h"
#include "BKE_image.h"
#include "BKE_library.h"
#include "BKE_global.h"
#include "BKE_main.h"
@@ -808,6 +809,22 @@ int WM_operator_filesel(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
}
}
int WM_operator_filesel_ensure_ext_imtype(wmOperator *op, const char imtype)
{
PropertyRNA *prop;
char filepath[FILE_MAX];
/* dont NULL check prop, this can only run on ops with a 'filepath' */
prop = RNA_struct_find_property(op->ptr, "filepath");
RNA_property_string_get(op->ptr, prop, filepath);
if (BKE_add_image_extension(filepath, imtype)) {
RNA_property_string_set(op->ptr, prop, filepath);
/* note, we could check for and update 'filename' here,
* but so far nothing needs this. */
return TRUE;
}
return FALSE;
}
/* default properties for fileselect */
void WM_operator_properties_filesel(wmOperatorType *ot, int filter, short type, short action, short flag, short display)
{

View File

@@ -448,7 +448,7 @@ elseif(WIN32)
DESTINATION ${TARGETDIR}
)
if(WITH_INTERNATIONAL)
if(WITH_INTERNATIONAL AND (NOT WITH_MINGW64))
install(
FILES ${LIBDIR}/gettext/lib/gnu_gettext.dll
DESTINATION ${TARGETDIR}
@@ -523,11 +523,14 @@ elseif(WIN32)
DESTINATION ${TARGETDIR}
)
else()
install(
FILES
${LIBDIR}/zlib/lib/zlib.dll
DESTINATION ${TARGETDIR}
)
#not needed since we link statically, maybe also unneeded for MinGW?
if(NOT WITH_MINGW64)
install(
FILES
${LIBDIR}/zlib/lib/zlib.dll
DESTINATION ${TARGETDIR}
)
endif()
endif()
if(MSVC)
@@ -536,10 +539,13 @@ elseif(WIN32)
DESTINATION ${TARGETDIR}
)
else()
install(
FILES ${LIBDIR}/pthreads/lib/pthreadGC2.dll
DESTINATION ${TARGETDIR}
)
#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 ${TARGETDIR}
)
endif()
endif()
if(WITH_CODEC_FFMPEG)
@@ -593,12 +599,14 @@ elseif(WIN32)
)
if(WITH_OPENIMAGEIO)
set_lib_path(OIIOBIN "openimageio/bin")
install(
FILES
${OIIOBIN}/OpenImageIO.dll
DESTINATION ${TARGETDIR}
)
if(NOT MINGW)
set_lib_path(OIIOBIN "openimageio/bin")
install(
FILES
${OIIOBIN}/OpenImageIO.dll
DESTINATION ${TARGETDIR}
)
endif()
endif()
elseif(APPLE)

View File

@@ -26,7 +26,7 @@ incs += ' #extern/Eigen3'
incs += ' ' + env['BF_BULLET_INC']
if env['BF_DEBUG']:
if env['OURPLATFORM'] in ('win32-mingw', 'win32-vc', 'win64-vc'):
if env['OURPLATFORM'] in ('win32-mingw', 'win32-vc', 'win64-vc', 'win64-mingw'):
defs.append('_DEBUG')
if env['WITH_BF_PYTHON']:

View File

@@ -28,13 +28,15 @@
/** \file gameengine/Expressions/KX_HashedPtr.cpp
* \ingroup expressions
*/
#ifdef __MINGW64__
#include <basetsd.h>
#endif
#include "KX_HashedPtr.h"
unsigned int KX_Hash(void * inDWord)
{
#if defined(_WIN64)
#ifdef _WIN64
unsigned __int64 key = (unsigned __int64)inDWord;
#else
unsigned long key = (unsigned long)inDWord;

View File

@@ -32,6 +32,9 @@
#if defined(_WIN64)
# ifdef __MINGW64__
# include <basetsd.h>
# endif
typedef unsigned __int64 uint_ptr;
#else
typedef unsigned long uint_ptr;

View File

@@ -32,6 +32,9 @@
#if defined(_WIN64)
# ifdef __MINGW64__
# include <basetsd.h>
# endif
typedef unsigned __int64 uint_ptr;
#else
typedef unsigned long uint_ptr;

View File

@@ -36,7 +36,7 @@ if env['WITH_BF_PYTHON']:
if env['WITH_BF_FFMPEG']:
defs.append('WITH_FFMPEG')
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc', 'win32-mingw'):
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc', 'win32-mingw', 'win64-mingw'):
if env['BF_DEBUG']:
defs.append('_DEBUG') # for Python

View File

@@ -863,9 +863,9 @@ void CcdPhysicsController::RelativeRotate(const float rotval[9],bool local)
return;
}
btMatrix3x3 drotmat( rotval[0],rotval[4],rotval[8],
rotval[1],rotval[5],rotval[9],
rotval[2],rotval[6],rotval[10]);
btMatrix3x3 drotmat(rotval[0], rotval[3], rotval[6],
rotval[1], rotval[4], rotval[7],
rotval[2], rotval[5], rotval[8]);
btMatrix3x3 currentOrn;

View File

@@ -16,7 +16,7 @@ incs += ' #intern/guardedalloc #intern/container #extern/glew/include'
incs += ' #intern/ffmpeg'
defs = []
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc','win32-mingw'):
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc','win32-mingw', 'win64-mingw'):
if env['BF_DEBUG']:
defs.append('_DEBUG')