part 1 of merge from trunk at r30358; it compiles, but doesn't link quite yet :)

This commit is contained in:
Joseph Eagar 2010-07-19 04:44:37 +00:00
commit c11c196efa
1714 changed files with 119636 additions and 84178 deletions

View File

@ -1,172 +0,0 @@
MACRO(BLENDERLIB_NOLIST
name
sources
includes)
# Gather all headers
FILE(GLOB_RECURSE INC_ALL *.h)
INCLUDE_DIRECTORIES(${includes})
ADD_LIBRARY(${name} ${INC_ALL} ${sources})
# Group by location on disk
SOURCE_GROUP(Files FILES CMakeLists.txt)
SET(ALL_FILES ${sources} ${INC_ALL})
FOREACH(SRC ${ALL_FILES})
STRING(REGEX REPLACE ${CMAKE_CURRENT_SOURCE_DIR} "Files" REL_DIR "${SRC}")
STRING(REGEX REPLACE "[\\\\/][^\\\\/]*$" "" REL_DIR "${REL_DIR}")
STRING(REGEX REPLACE "^[\\\\/]" "" REL_DIR "${REL_DIR}")
IF(REL_DIR)
SOURCE_GROUP(${REL_DIR} FILES ${SRC})
ELSE(REL_DIR)
SOURCE_GROUP(Files FILES ${SRC})
ENDIF(REL_DIR)
ENDFOREACH(SRC)
MESSAGE(STATUS "Configuring library ${name}")
ENDMACRO(BLENDERLIB_NOLIST)
MACRO(BLENDERLIB
name
sources
includes)
BLENDERLIB_NOLIST(${name} "${sources}" "${includes}")
# Add to blender's list of libraries
FILE(APPEND ${CMAKE_BINARY_DIR}/cmake_blender_libs.txt "${name};")
ENDMACRO(BLENDERLIB)
MACRO(SETUP_LIBDIRS)
# see "cmake --help-policy CMP0003"
if(COMMAND cmake_policy)
CMAKE_POLICY(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
LINK_DIRECTORIES(${JPEG_LIBPATH} ${PNG_LIBPATH} ${ZLIB_LIBPATH} ${FREETYPE_LIBPATH} ${LIBSAMPLERATE_LIBPATH})
IF(WITH_PYTHON)
LINK_DIRECTORIES(${PYTHON_LIBPATH})
ENDIF(WITH_PYTHON)
IF(WITH_INTERNATIONAL)
LINK_DIRECTORIES(${ICONV_LIBPATH})
LINK_DIRECTORIES(${GETTEXT_LIBPATH})
ENDIF(WITH_INTERNATIONAL)
IF(WITH_SDL)
LINK_DIRECTORIES(${SDL_LIBPATH})
ENDIF(WITH_SDL)
IF(WITH_FFMPEG)
LINK_DIRECTORIES(${FFMPEG_LIBPATH})
ENDIF(WITH_FFMPEG)
IF(WITH_OPENEXR)
LINK_DIRECTORIES(${OPENEXR_LIBPATH})
ENDIF(WITH_OPENEXR)
IF(WITH_QUICKTIME)
LINK_DIRECTORIES(${QUICKTIME_LIBPATH})
ENDIF(WITH_QUICKTIME)
IF(WITH_OPENAL)
LINK_DIRECTORIES(${OPENAL_LIBPATH})
ENDIF(WITH_OPENAL)
IF(WITH_JACK)
LINK_DIRECTORIES(${JACK_LIBPATH})
ENDIF(WITH_JACK)
IF(WITH_SNDFILE)
LINK_DIRECTORIES(${SNDFILE_LIBPATH})
ENDIF(WITH_SNDFILE)
IF(WITH_FFTW3)
LINK_DIRECTORIES(${FFTW3_LIBPATH})
ENDIF(WITH_FFTW3)
IF(WITH_OPENCOLLADA)
LINK_DIRECTORIES(${OPENCOLLADA_LIBPATH})
LINK_DIRECTORIES(${PCRE_LIBPATH})
LINK_DIRECTORIES(${EXPAT_LIBPATH})
ENDIF(WITH_OPENCOLLADA)
IF(WIN32)
LINK_DIRECTORIES(${PTHREADS_LIBPATH})
ENDIF(WIN32)
ENDMACRO(SETUP_LIBDIRS)
MACRO(SETUP_LIBLINKS
target)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS} ")
TARGET_LINK_LIBRARIES(${target} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${JPEG_LIBRARY} ${PNG_LIBRARIES} ${ZLIB_LIBRARIES} ${LLIBS})
# since we are using the local libs for python when compiling msvc projects, we need to add _d when compiling debug versions
IF(WITH_PYTHON)
TARGET_LINK_LIBRARIES(${target} ${PYTHON_LINKFLAGS})
IF(WIN32)
TARGET_LINK_LIBRARIES(${target} debug ${PYTHON_LIB}_d)
TARGET_LINK_LIBRARIES(${target} optimized ${PYTHON_LIB})
ELSE(WIN32)
TARGET_LINK_LIBRARIES(${target} ${PYTHON_LIB})
ENDIF(WIN32)
ENDIF(WITH_PYTHON)
TARGET_LINK_LIBRARIES(${target} ${OPENGL_glu_LIBRARY} ${JPEG_LIB} ${PNG_LIB} ${ZLIB_LIB})
TARGET_LINK_LIBRARIES(${target} ${FREETYPE_LIBRARY} ${LIBSAMPLERATE_LIB})
IF(WITH_INTERNATIONAL)
TARGET_LINK_LIBRARIES(${target} ${GETTEXT_LIB})
IF(WIN32)
TARGET_LINK_LIBRARIES(${target} ${ICONV_LIB})
ENDIF(WIN32)
ENDIF(WITH_INTERNATIONAL)
IF(WITH_OPENAL)
TARGET_LINK_LIBRARIES(${target} ${OPENAL_LIBRARY})
ENDIF(WITH_OPENAL)
IF(WITH_FFTW3)
TARGET_LINK_LIBRARIES(${target} ${FFTW3_LIB})
ENDIF(WITH_FFTW3)
IF(WITH_JACK)
TARGET_LINK_LIBRARIES(${target} ${JACK_LIB})
ENDIF(WITH_JACK)
IF(WITH_SNDFILE)
TARGET_LINK_LIBRARIES(${target} ${SNDFILE_LIB})
ENDIF(WITH_SNDFILE)
IF(WITH_SDL)
TARGET_LINK_LIBRARIES(${target} ${SDL_LIBRARY})
ENDIF(WITH_SDL)
IF(WITH_QUICKTIME)
TARGET_LINK_LIBRARIES(${target} ${QUICKTIME_LIB})
ENDIF(WITH_QUICKTIME)
IF(WITH_OPENEXR)
IF(WIN32)
FOREACH(loop_var ${OPENEXR_LIB})
TARGET_LINK_LIBRARIES(${target} debug ${loop_var}_d)
TARGET_LINK_LIBRARIES(${target} optimized ${loop_var})
ENDFOREACH(loop_var)
ELSE(WIN32)
TARGET_LINK_LIBRARIES(${target} ${OPENEXR_LIB})
ENDIF(WIN32)
ENDIF(WITH_OPENEXR)
IF(WITH_FFMPEG)
TARGET_LINK_LIBRARIES(${target} ${FFMPEG_LIB})
ENDIF(WITH_FFMPEG)
IF(WITH_OPENCOLLADA)
IF(WIN32)
FOREACH(loop_var ${OPENCOLLADA_LIB})
TARGET_LINK_LIBRARIES(${target} debug ${loop_var}_d)
TARGET_LINK_LIBRARIES(${target} optimized ${loop_var})
ENDFOREACH(loop_var)
TARGET_LINK_LIBRARIES(${target} debug ${PCRE_LIB}_d)
TARGET_LINK_LIBRARIES(${target} optimized ${PCRE_LIB})
IF(EXPAT_LIB)
TARGET_LINK_LIBRARIES(${target} debug ${EXPAT_LIB}_d)
TARGET_LINK_LIBRARIES(${target} optimized ${EXPAT_LIB})
ENDIF(EXPAT_LIB)
ELSE(WIN32)
TARGET_LINK_LIBRARIES(${target} ${OPENCOLLADA_LIB})
TARGET_LINK_LIBRARIES(${target} ${PCRE_LIB})
TARGET_LINK_LIBRARIES(${target} ${EXPAT_LIB})
ENDIF(WIN32)
ENDIF(WITH_OPENCOLLADA)
IF(WIN32)
TARGET_LINK_LIBRARIES(${target} ${PTHREADS_LIB})
ENDIF(WIN32)
ENDMACRO(SETUP_LIBLINKS)

View File

@ -1,4 +1,4 @@
# $Id$
# $Id$
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
@ -42,7 +42,11 @@ Remove the CMakeCache.txt file and try again from another folder, e.g.:
")
ENDIF(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
# quiet output for Makefiles, 'make -s' helps too
# SET_PROPERTY(GLOBAL PROPERTY RULE_MESSAGES OFF)
PROJECT(Blender)
#-----------------------------------------------------------------------------
@ -51,80 +55,104 @@ PROJECT(Blender)
SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib)
# Note! - Could create this from the blender version string
# ...but thats quite involved, make sure this matches the blender version.
SET(BLENDER_VERSION 2.5)
#-----------------------------------------------------------------------------
# Load some macros.
INCLUDE(build_files/cmake/macros.cmake)
#-----------------------------------------------------------------------------
# Set default config options
OPTION(WITH_PLAYER "Build Player" OFF)
OPTION(WITH_GAMEENGINE "Enable Game Engine" ON)
OPTION(WITH_BULLET "Enable Bullet (Physics Engine)" ON)
OPTION(WITH_INTERNATIONAL "Enable I18N (International fonts and text)" ON)
OPTION(WITH_ELBEEM "Enable Elbeem (Fluid Simulation)" ON)
OPTION(WITH_QUICKTIME "Enable Quicktime Support" OFF)
OPTION(WITH_OPENEXR "Enable OpenEXR Support (http://www.openexr.com)" ON)
OPTION(WITH_DDS "Enable DDS Support" ON)
OPTION(WITH_FFMPEG "Enable FFMPeg Support (http://ffmpeg.mplayerhq.hu/)" OFF)
OPTION(WITH_PYTHON "Enable Embedded Python API" ON)
OPTION(WITH_SDL "Enable SDL for sound and joystick support" ON)
OPTION(WITH_OPENJPEG "Enable OpenJpeg Support (http://www.openjpeg.org/)" OFF)
OPTION(WITH_OPENAL "Enable OpenAL Support (http://www.openal.org)" ON)
OPTION(WITH_WEBPLUGIN "Enable Web Plugin (Unix only)" OFF)
OPTION(WITH_FFTW3 "Enable FFTW3 support" OFF)
OPTION(WITH_JACK "Enable Jack Support (http://www.jackaudio.org)" OFF)
OPTION(WITH_SNDFILE "Enable libsndfile Support (http://www.mega-nerd.com/libsndfile)" OFF)
OPTION(WITH_LZO "Enable fast LZO compression, used for pointcache" ON)
OPTION(WITH_LZMA "Enable best LZMA compression, used for pointcache" ON)
OPTION(WITH_CXX_GUARDEDALLOC "Enable GuardedAlloc for C++ memory allocation" OFF)
OPTION(WITH_BUILDINFO "Include extra build details" ON)
OPTION(WITH_INSTALL "Install accompanying scripts and language files needed to run blender" ON)
OPTION(WITH_OPENCOLLADA "Enable OpenCollada Support (http://www.opencollada.org/)" ON)
# Unix defaults to OpenMP On
GET_BLENDER_VERSION()
# Blender internal features
OPTION(WITH_INTERNATIONAL "Enable I18N (International fonts and text)" ON)
OPTION(WITH_LCMS "Enable color correction with lcms" OFF)
OPTION(WITH_PYTHON "Enable Embedded Python API" ON)
OPTION(WITH_BUILDINFO "Include extra build details" ON)
OPTION(WITH_ELBEEM "Enable Elbeem (Fluid Simulation)" ON)
OPTION(WITH_FFTW3 "Enable FFTW3 support (Used for smoke and audio effects)" OFF)
OPTION(WITH_BULLET "Enable Bullet (Physics Engine)" ON)
OPTION(WITH_GAMEENGINE "Enable Game Engine" ON)
OPTION(WITH_PLAYER "Build Player" OFF)
# (unix defaults to OpenMP On)
IF(UNIX AND NOT APPLE)
OPTION(WITH_OPENMP "Enable OpenMP (has to be supported by the compiler)" ON)
ELSE()
OPTION(WITH_OPENMP "Enable OpenMP (has to be supported by the compiler)" OFF)
ENDIF()
OPTION(WITH_RAYOPTIMIZATION "Enable use of SIMD (SSE) optimizations for the raytracer" OFF)
# Image format support
OPTION(WITH_OPENEXR "Enable OpenEXR Support (http://www.openexr.com)" ON)
OPTION(WITH_OPENJPEG "Enable OpenJpeg Support (http://www.openjpeg.org/)" OFF)
OPTION(WITH_TIFF "Enable LibTIFF Support" ON)
OPTION(WITH_DDS "Enable DDS Support" ON)
IF (APPLE)
# Audio format support
OPTION(WITH_FFMPEG "Enable FFMPeg Support (http://ffmpeg.mplayerhq.hu/)" OFF)
OPTION(WITH_SNDFILE "Enable libsndfile Support (http://www.mega-nerd.com/libsndfile)" OFF)
IF(APPLE OR WIN32)
OPTION(WITH_QUICKTIME "Enable Quicktime Support" OFF)
ENDIF(APPLE OR WIN32)
# 3D format support
# disable opencollada on non-apple unix because opencollada has no package for debian
IF(UNIX AND NOT APPLE)
OPTION(WITH_OPENCOLLADA "Enable OpenCollada Support (http://www.opencollada.org/)" OFF)
ELSE()
OPTION(WITH_OPENCOLLADA "Enable OpenCollada Support (http://www.opencollada.org/)" OFF)
ENDIF()
# Sound output
OPTION(WITH_SDL "Enable SDL for sound and joystick support" ON)
OPTION(WITH_OPENAL "Enable OpenAL Support (http://www.openal.org)" ON)
OPTION(WITH_JACK "Enable Jack Support (http://www.jackaudio.org)" OFF)
# Compression
OPTION(WITH_LZO "Enable fast LZO compression (used for pointcache)" ON)
OPTION(WITH_LZMA "Enable best LZMA compression, (used for pointcache)" ON)
# Misc
OPTION(WITH_RAYOPTIMIZATION "Enable use of SIMD (SSE) optimizations for the raytracer" ON)
OPTION(WITH_CXX_GUARDEDALLOC "Enable GuardedAlloc for C++ memory allocation tracking" OFF)
OPTION(WITH_INSTALL "Install accompanying scripts and language files needed to run blender" ON)
IF(APPLE)
OPTION(WITH_COCOA "Use Cocoa framework instead of deprecated Carbon" ON)
OPTION(USE_QTKIT "Use QtKit instead of Carbon quicktime (needed for having partial quicktime for 64bit)" OFF)
OPTION(WITH_LIBS10.5 "Use 10.5 libs (needed for 64bit builds)" OFF)
ENDIF (APPLE)
ENDIF(APPLE)
IF(NOT WITH_BULLET AND WITH_GAMEENGINE)
MESSAGE("WARNING: WITH_GAMEENGINE needs WITH_BULLET")
ENDIF(NOT WITH_BULLET AND WITH_GAMEENGINE)
IF(NOT WITH_GAMEENGINE AND WITH_PLAYER)
MESSAGE("WARNING: WITH_PLAYER needs WITH_GAMEENGINE")
ENDIF(NOT WITH_GAMEENGINE AND WITH_PLAYER)
TEST_SSE_SUPPORT()
# disabled for now, not supported
# OPTION(WITH_WEBPLUGIN "Enable Web Plugin (Unix only)" OFF)
# For alternate Python locations the commandline can be used to override detected/default cache settings, e.g:
# On Unix:
# cmake -D PYTHON_LIB=/usr/local/lib/python2.3/config/libpython2.3.so -D PYTHON_INC=/usr/local/include/python2.3 -D PYTHON_BINARY=/usr/local/bin/python2.3 -G "Unix Makefiles" ../blender
# cmake -D PYTHON_LIB=/usr/local/lib/python3.1/config/libpython3.1.so -D PYTHON_INC=/usr/local/include/python3.1 -G "Unix Makefiles" ../blender
# On Macs:
# cmake -D PYTHON_INC=/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -D PYTHON_LIBPATH=/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/config -D PYTHON_BINARY=/System/Library/Frameworks/Python.framework/Versions/2.5/bin/python2.5 -G Xcode ../blender
# cmake -D PYTHON_INC=/System/Library/Frameworks/Python.framework/Versions/3.1/include/python3.1 -D PYTHON_LIBPATH=/System/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/config -G Xcode ../blender
#
# When changing any of this remember to update the notes in doc/blender-cmake.txt
#-----------------------------------------------------------------------------
# Load some macros.
INCLUDE(CMake/macros.cmake)
#-----------------------------------------------------------------------------
#Platform specifics
IF(UNIX AND NOT APPLE)
IF(WITH_OPENAL)
FIND_PACKAGE(OpenAL)
IF(OPENAL_FOUND)
SET(WITH_OPENAL ON)
ELSE(OPENAL_FOUND)
IF(NOT OPENAL_FOUND)
SET(WITH_OPENAL OFF)
ENDIF(OPENAL_FOUND)
ENDIF(NOT OPENAL_FOUND)
ENDIF(WITH_OPENAL)
IF(WITH_JACK)
@ -141,37 +169,43 @@ IF(UNIX AND NOT APPLE)
SET(SNDFILE_LIBPATH ${SNDFILE}/lib)
ENDIF(WITH_SNDFILE)
FIND_LIBRARY(INTL_LIBRARY
NAMES intl
PATHS
/sw/lib
)
FIND_LIBRARY(ICONV_LIBRARY
NAMES iconv
PATHS
/sw/lib
)
IF(INTL_LIBRARY AND ICONV_LIBRARY)
SET(GETTEXT_LIB ${INTL_LIBRARY} ${ICONV_LIBRARY})
ENDIF(INTL_LIBRARY AND ICONV_LIBRARY)
IF(WITH_INTERNATIONAL)
FIND_LIBRARY(INTL_LIBRARY
NAMES intl
PATHS
/sw/lib
)
FIND_LIBRARY(ICONV_LIBRARY
NAMES iconv
PATHS
/sw/lib
)
IF(INTL_LIBRARY AND ICONV_LIBRARY)
SET(GETTEXT_LIB ${INTL_LIBRARY} ${ICONV_LIBRARY})
ENDIF(INTL_LIBRARY AND ICONV_LIBRARY)
ENDIF(WITH_INTERNATIONAL)
FIND_PACKAGE(Freetype)
# UNSET(FREETYPE_INCLUDE_DIRS CACHE) # cant use
# No way to set py31. remove for now.
# FIND_PACKAGE(PythonLibs)
SET(PYTHON /usr)
SET(PYTHON_VERSION 3.1)
SET(PYTHON_INC "${PYTHON}/include/python${PYTHON_VERSION}" CACHE STRING "")
# SET(PYTHON_BINARY python) # not used yet
SET(PYTHON_LIB python${PYTHON_VERSION} CACHE STRING "")
SET(PYTHON_LIBPATH ${PYTHON}/lib CACHE STRING "")
# FIND_PACKAGE(PythonInterp) # not used yet
# SET(PYTHON_BINARY ${PYTHON_EXECUTABLE} CACHE STRING "")
SET(PYTHON_LINKFLAGS "-Xlinker -export-dynamic")
IF(WITH_PYTHON)
# No way to set py31. remove for now.
# FIND_PACKAGE(PythonLibs)
SET(PYTHON /usr)
SET(PYTHON_VERSION 3.1)
SET(PYTHON_INC "${PYTHON}/include/python${PYTHON_VERSION}" CACHE STRING "")
# SET(PYTHON_BINARY python) # not used yet
SET(PYTHON_LIB python${PYTHON_VERSION} CACHE STRING "")
SET(PYTHON_LIBPATH ${PYTHON}/lib CACHE STRING "")
# FIND_PACKAGE(PythonInterp) # not used yet
# SET(PYTHON_BINARY ${PYTHON_EXECUTABLE} CACHE STRING "")
SET(PYTHON_LINKFLAGS "-Xlinker -export-dynamic")
ENDIF(WITH_PYTHON)
IF(WITH_SDL)
FIND_PACKAGE(SDL)
@ -181,23 +215,53 @@ IF(UNIX AND NOT APPLE)
ENDIF(NOT SDL_FOUND)
ENDIF(WITH_SDL)
FIND_PATH(OPENEXR_INC
ImfXdr.h
PATHS
/usr/local/include/OpenEXR
/usr/include/OpenEXR
/sw/include/OpenEXR
/opt/local/include/OpenEXR
/opt/csw/include/OpenEXR
/opt/include/OpenEXR
)
SET(OPENEXR_LIB Half IlmImf Iex Imath)
IF(WITH_OPENEXR)
SET(OPENEXR /usr CACHE FILEPATH "OPENEXR Directory")
FIND_PATH(OPENEXR_INC
ImfXdr.h
PATHS
${OPENEXR}/include/OpenEXR
/usr/local/include/OpenEXR
/sw/include/OpenEXR
/opt/local/include/OpenEXR
/opt/csw/include/OpenEXR
/opt/include/OpenEXR
)
SET(OPENEXR_LIB Half IlmImf Iex Imath)
IF(NOT OPENEXR_INC)
SET(WITH_OPENEXR OFF)
ENDIF(NOT OPENEXR_INC)
ENDIF(WITH_OPENEXR)
IF(WITH_TIFF)
FIND_PACKAGE(TIFF)
IF(NOT TIFF_FOUND)
SET(WITH_TIFF OFF)
ENDIF(NOT TIFF_FOUND)
ENDIF(WITH_TIFF)
FIND_PACKAGE(JPEG REQUIRED)
FIND_PACKAGE(PNG REQUIRED)
FIND_PACKAGE(ZLIB REQUIRED)
IF(WITH_LCMS)
SET(LCMS /usr CACHE FILEPATH "LCMS directory")
SET(LCMS_INCLUDE_DIR ${LCMS}/include)
SET(LCMS_LIBRARY lcms)
SET(LCMS_LIBPATH ${LCMS}/lib)
ENDIF(WITH_LCMS)
IF(WITH_FFMPEG)
SET(FFMPEG /usr CACHE FILEPATH "FFMPEG Directory")
SET(FFMPEG_INC ${FFMPEG}/include)
SET(FFMPEG_LIB avformat avcodec avutil avdevice swscale CACHE STRING "FFMPEG Libraries")
SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__STDC_CONSTANT_MACROS")
ENDIF(WITH_FFMPEG)
SET(FFMPEG /usr)
SET(FFMPEG_INC ${FFMPEG}/include)
SET(FFMPEG_LIB avformat avcodec avutil avdevice swscale)
SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
IF(WITH_FFTW3)
SET(FFTW3 /usr)
SET(FFTW3_INC ${FFTW3}/include)
@ -210,12 +274,6 @@ IF(UNIX AND NOT APPLE)
SET(LIBSAMPLERATE_LIB samplerate)
SET(LIBSAMPLERATE_LIBPATH ${LIBSAMPLERATE}/lib)
FIND_PACKAGE(JPEG REQUIRED)
FIND_PACKAGE(PNG REQUIRED)
FIND_PACKAGE(ZLIB REQUIRED)
IF (WITH_OPENCOLLADA)
SET(OPENCOLLADA /usr/local/opencollada CACHE FILEPATH "OpenCollada Directory")
SET(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib)
@ -236,6 +294,10 @@ IF(UNIX AND NOT APPLE)
IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
# BSD's dont use libdl.so
SET(LLIBS "${LLIBS} -ldl")
# binreloc is linux only
SET(BINRELOC ${CMAKE_SOURCE_DIR}/extern/binreloc)
SET(BINRELOC_INC ${BINRELOC}/include)
ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
IF(WITH_OPENMP)
@ -247,6 +309,12 @@ IF(UNIX AND NOT APPLE)
SET(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing -Wno-char-subscripts")
IF(WITH_RAYOPTIMIZATION AND SUPPORT_SSE_BUILD)
SET(PLATFORM_CFLAGS " -msse -msse2 ${PLATFORM_CFLAGS}")
ADD_DEFINITIONS(-D__SSE__)
ADD_DEFINITIONS(-D__MMX__)
ENDIF(WITH_RAYOPTIMIZATION AND SUPPORT_SSE_BUILD)
SET(PLATFORM_LINKFLAGS "-pthread")
# Better warnings
@ -256,6 +324,7 @@ IF(UNIX AND NOT APPLE)
INCLUDE_DIRECTORIES(${JPEG_INCLUDE_DIR} ${PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} )
ENDIF(UNIX AND NOT APPLE)
IF(WIN32)
# this file is included anyway when building under Windows with cl.exe
@ -268,133 +337,21 @@ IF(WIN32)
message("64 bit compiler detected.")
SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/win64)
ENDIF(CMAKE_CL_64)
ADD_DEFINITIONS(-DWIN32)
SET(PYTHON ${LIBDIR}/python)
SET(PYTHON_VERSION 3.1)
SET(PYTHON_INC "${PYTHON}/include/python${PYTHON_VERSION}")
# SET(PYTHON_BINARY python) # not used yet
SET(PYTHON_LIB python31)
SET(PYTHON_LIBPATH ${PYTHON}/lib)
SET(OPENAL ${LIBDIR}/openal)
SET(OPENAL_INCLUDE_DIR ${OPENAL}/include)
SET(OPENAL_LIBRARY wrap_oal)
SET(OPENAL_LIBPATH ${OPENAL}/lib)
IF(WITH_JACK)
SET(JACK ${LIBDIR}/jack)
SET(JACK_INC ${JACK}/include/jack ${JACK}/include)
SET(JACK_LIB libjack)
SET(JACK_LIBPATH ${JACK}/lib)
ENDIF(WITH_JACK)
IF(WITH_SNDFILE)
SET(SNDFILE ${LIBDIR}/sndfile)
SET(SNDFILE_INC ${SNDFILE}/include)
SET(SNDFILE_LIB libsndfile-1)
SET(SNDFILE_LIBPATH ${SNDFILE}/lib)
ENDIF(WITH_SNDFILE)
IF(CMAKE_CL_64)
SET(PNG_LIBRARIES libpng)
ELSE(CMAKE_CL_64)
SET(PNG_LIBRARIES libpng_st)
ENDIF(CMAKE_CL_64)
SET(JPEG_LIBRARY libjpeg)
SET(ZLIB ${LIBDIR}/zlib)
SET(ZLIB_INC ${ZLIB}/include)
IF(CMAKE_CL_64)
SET(ZLIB_LIBRARIES libz)
ELSE(CMAKE_CL_64)
SET(ZLIB_LIBRARIES zlib)
ENDIF(CMAKE_CL_64)
SET(ZLIB_LIBPATH ${ZLIB}/lib)
SET(PTHREADS ${LIBDIR}/pthreads)
SET(PTHREADS_INC ${PTHREADS}/include)
SET(PTHREADS_LIB pthreadVC2)
SET(PTHREADS_LIBPATH ${PTHREADS}/lib)
SET(ICONV ${LIBDIR}/iconv)
SET(ICONV_INC ${ICONV}/include)
SET(ICONV_LIB iconv)
SET(ICONV_LIBPATH ${ICONV}/lib)
IF(WITH_FFTW3)
SET(FFTW3 ${LIBDIR}/fftw3)
SET(FFTW3_INC ${FFTW3}/include)
SET(FFTW3_LIB libfftw)
SET(FFTW3_LIBPATH ${FFTW3}/lib)
ENDIF(WITH_FFTW3)
SET(GETTEXT ${LIBDIR}/gettext)
SET(GETTEXT_INC ${GETTEXT}/include)
IF(CMAKE_CL_64)
SET(GETTEXT_LIB gettext)
ELSE(CMAKE_CL_64)
SET(GETTEXT_LIB gnu_gettext)
ENDIF(CMAKE_CL_64)
SET(GETTEXT_LIBPATH ${GETTEXT}/lib)
SET(FREETYPE ${LIBDIR}/freetype)
SET(FREETYPE_INCLUDE_DIRS ${FREETYPE}/include ${FREETYPE}/include/freetype2)
SET(FREETYPE_LIBPATH ${FREETYPE}/lib)
SET(FREETYPE_LIBRARY freetype2ST)
SET(OPENEXR ${LIBDIR}/openexr)
SET(OPENEXR_INC ${OPENEXR}/include ${OPENEXR}/include/IlmImf ${OPENEXR}/include/Iex ${OPENEXR}/include/Imath)
SET(OPENEXR_LIB Iex Half IlmImf Imath IlmThread)
IF (MSVC80)
SET(OPENEXR_LIBPATH ${OPENEXR}/lib_vs2005)
ELSE (MSVC80)
SET(OPENEXR_LIBPATH ${OPENEXR}/lib_msvc)
ENDIF(MSVC80)
IF (MSVC90)
SET(OPENEXR_LIBPATH ${OPENEXR}/lib_vs2008)
ENDIF(MSVC90)
SET(QUICKTIME ${LIBDIR}/QTDevWin)
SET(QUICKTIME_INC ${QUICKTIME}/CIncludes)
SET(QUICKTIME_LIB qtmlClient)
SET(QUICKTIME_LIBPATH ${QUICKTIME}/Libraries)
SET(FFMPEG ${LIBDIR}/ffmpeg)
SET(FFMPEG_INC ${FFMPEG}/include ${FFMPEG}/include/msvc)
SET(FFMPEG_LIB avcodec-52 avformat-52 avdevice-52 avutil-50 swscale-0)
SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
IF(WITH_INTERNATIONAL)
SET(ICONV ${LIBDIR}/iconv)
SET(ICONV_INC ${ICONV}/include)
SET(ICONV_LIB iconv)
SET(ICONV_LIBPATH ${ICONV}/lib)
ENDIF(WITH_INTERNATIONAL)
SET(LIBSAMPLERATE ${LIBDIR}/samplerate)
SET(LIBSAMPLERATE_INC ${LIBSAMPLERATE}/include)
SET(LIBSAMPLERATE_LIB libsamplerate)
SET(LIBSAMPLERATE_LIBPATH ${LIBSAMPLERATE}/lib)
IF(CMAKE_CL_64)
SET(LLIBS kernel32 user32 vfw32 winmm ws2_32 )
ELSE(CMAKE_CL_64)
SET(LLIBS kernel32 user32 gdi32 comdlg32 advapi32 shell32 ole32 oleaut32 uuid ws2_32 vfw32 winmm)
ENDIF(CMAKE_CL_64)
SET(CMAKE_CXX_FLAGS_DEBUG "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /D_DEBUG /Od /Gm /EHsc /RTC1 /MTd /W3 /nologo /ZI /J" CACHE STRING "MSVC MT flags " FORCE)
SET(CMAKE_CXX_FLAGS_RELEASE "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /O2 /Ob2 /DNDEBUG /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE)
SET(CMAKE_CXX_FLAGS_MINSIZEREL "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /O1 /Ob1 /DNDEBUG /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE)
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /O2 /Ob1 /DNDEBUG /EHsc /MT /W3 /nologo /Zi /J" CACHE STRING "MSVC MT flags " FORCE)
SET(CMAKE_C_FLAGS_DEBUG "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /D_DEBUG /Od /Gm /EHsc /RTC1 /MTd /W3 /nologo /ZI /J" CACHE STRING "MSVC MT flags " FORCE)
SET(CMAKE_C_FLAGS_RELEASE "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /O2 /Ob2 /DNDEBUG /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE)
SET(CMAKE_C_FLAGS_MINSIZEREL "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /O1 /Ob1 /DNDEBUG /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE)
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /O2 /Ob1 /DNDEBUG /EHsc /MT /W3 /nologo /Zi /J" CACHE STRING "MSVC MT flags " FORCE)
IF(WITH_OPENMP)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /openmp ")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /openmp ")
ENDIF(WITH_OPENMP)
SET(SDL ${LIBDIR}/sdl)
SET(SDL_INCLUDE_DIR ${SDL}/include)
SET(SDL_LIBRARY SDL)
SET(SDL_LIBPATH ${SDL}/lib)
SET(PNG "${LIBDIR}/png")
SET(PNG_INC "${PNG}/include")
SET(PNG_LIBPATH ${PNG}/lib)
@ -403,30 +360,283 @@ IF(WIN32)
SET(JPEG_INC "${JPEG}/include")
SET(JPEG_LIBPATH ${JPEG}/lib)
SET(TIFF ${LIBDIR}/tiff)
SET(TIFF_INC ${TIFF}/include)
SET(WINTAB_INC ${LIBDIR}/wintab/include)
SET(OPENCOLLADA ${LIBDIR}/opencollada)
SET(OPENCOLLADA_INC ${OPENCOLLADA}/include)
SET(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib)
SET(OPENCOLLADA_LIB OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils OpenCOLLADAStreamWriter MathMLSolver GeneratedSaxParser UTF xml2 buffer ftoa)
#pcre is bundled with openCollada
#SET(PCRE ${LIBDIR}/pcre)
#SET(PCRE_LIBPATH ${PCRE}/lib)
SET(PCRE_LIB pcre)
IF(WITH_PYTHON)
SET(PYTHON ${LIBDIR}/python)
SET(PYTHON_VERSION 3.1)
SET(PYTHON_INC "${PYTHON}/include/python${PYTHON_VERSION}")
# SET(PYTHON_BINARY python) # not used yet
SET(PYTHON_LIB python31)
SET(PYTHON_LIBPATH ${PYTHON}/lib)
ENDIF(WITH_PYTHON)
IF(WITH_OPENAL)
SET(OPENAL ${LIBDIR}/openal)
SET(OPENAL_INCLUDE_DIR ${OPENAL}/include)
SET(OPENAL_LIBRARY wrap_oal)
SET(OPENAL_LIBPATH ${OPENAL}/lib)
ENDIF(WITH_OPENAL)
IF(WITH_SNDFILE)
SET(SNDFILE ${LIBDIR}/sndfile)
SET(SNDFILE_INC ${SNDFILE}/include)
SET(SNDFILE_LIB libsndfile-1)
SET(SNDFILE_LIBPATH ${SNDFILE}/lib)
ENDIF(WITH_SNDFILE)
IF(WITH_SDL)
SET(SDL ${LIBDIR}/sdl)
SET(SDL_INCLUDE_DIR ${SDL}/include)
SET(SDL_LIBRARY SDL)
SET(SDL_LIBPATH ${SDL}/lib)
ENDIF(WITH_SDL)
IF(WITH_QUICKTIME)
SET(QUICKTIME ${LIBDIR}/QTDevWin)
SET(QUICKTIME_INC ${QUICKTIME}/CIncludes)
SET(QUICKTIME_LIB qtmlClient)
SET(QUICKTIME_LIBPATH ${QUICKTIME}/Libraries)
ENDIF(WITH_QUICKTIME)
IF(WITH_RAYOPTIMIZATION AND SUPPORT_SSE_BUILD)
ADD_DEFINITIONS(-D__SSE__)
ADD_DEFINITIONS(-D__MMX__)
ENDIF(WITH_RAYOPTIMIZATION AND SUPPORT_SSE_BUILD)
IF(MSVC)
IF(CMAKE_CL_64)
SET(LLIBS kernel32 user32 vfw32 winmm ws2_32 )
ELSE(CMAKE_CL_64)
SET(LLIBS kernel32 user32 gdi32 comdlg32 advapi32 shell32 ole32 oleaut32 uuid ws2_32 vfw32 winmm)
ENDIF(CMAKE_CL_64)
SET(CMAKE_CXX_FLAGS "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305" CACHE STRING "MSVC MT C++ flags " FORCE)
SET(CMAKE_C_FLAGS "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305" CACHE STRING "MSVC MT C++ flags " FORCE)
SET(CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /Od /Gm /EHsc /RTC1 /MTd /W3 /nologo /ZI /J" CACHE STRING "MSVC MT flags " FORCE)
SET(CMAKE_CXX_FLAGS_RELEASE "/O2 /Ob2 /DNDEBUG /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE)
SET(CMAKE_CXX_FLAGS_MINSIZEREL "/O1 /Ob1 /DNDEBUG /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE)
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/O2 /Ob1 /DNDEBUG /EHsc /MT /W3 /nologo /Zi /J" CACHE STRING "MSVC MT flags " FORCE)
SET(CMAKE_C_FLAGS_DEBUG "/D_DEBUG /Od /Gm /EHsc /RTC1 /MTd /W3 /nologo /ZI /J" CACHE STRING "MSVC MT flags " FORCE)
SET(CMAKE_C_FLAGS_RELEASE "/O2 /Ob2 /DNDEBUG /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE)
SET(CMAKE_C_FLAGS_MINSIZEREL "/O1 /Ob1 /DNDEBUG /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE)
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "/O2 /Ob1 /DNDEBUG /EHsc /MT /W3 /nologo /Zi /J" CACHE STRING "MSVC MT flags " FORCE)
IF(WITH_OPENMP)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /openmp ")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /openmp ")
ENDIF(WITH_OPENMP)
IF(WITH_INTERNATIONAL)
SET(GETTEXT ${LIBDIR}/gettext)
SET(GETTEXT_INC ${GETTEXT}/include)
SET(GETTEXT_LIBPATH ${GETTEXT}/lib)
IF(CMAKE_CL_64)
SET(GETTEXT_LIB gettext)
ELSE(CMAKE_CL_64)
SET(GETTEXT_LIB gnu_gettext)
ENDIF(CMAKE_CL_64)
ENDIF(WITH_INTERNATIONAL)
IF(CMAKE_CL_64)
SET(PNG_LIBRARIES libpng)
ELSE(CMAKE_CL_64)
SET(PNG_LIBRARIES libpng_st)
ENDIF(CMAKE_CL_64)
SET(JPEG_LIBRARY libjpeg)
SET(ZLIB ${LIBDIR}/zlib)
SET(ZLIB_INC ${ZLIB}/include)
SET(ZLIB_LIBPATH ${ZLIB}/lib)
IF(CMAKE_CL_64)
SET(ZLIB_LIBRARIES libz)
ELSE(CMAKE_CL_64)
SET(ZLIB_LIBRARIES zlib)
ENDIF(CMAKE_CL_64)
SET(PTHREADS ${LIBDIR}/pthreads)
SET(PTHREADS_INC ${PTHREADS}/include)
SET(PTHREADS_LIBPATH ${PTHREADS}/lib)
SET(PTHREADS_LIB pthreadVC2)
SET(FREETYPE ${LIBDIR}/freetype)
SET(FREETYPE_INCLUDE_DIRS ${FREETYPE}/include ${FREETYPE}/include/freetype2)
SET(FREETYPE_LIBPATH ${FREETYPE}/lib)
SET(FREETYPE_LIBRARY freetype2ST)
IF(WITH_FFTW3)
SET(FFTW3 ${LIBDIR}/fftw3)
SET(FFTW3_LIB libfftw)
SET(FFTW3_INC ${FFTW3}/include)
SET(FFTW3_LIBPATH ${FFTW3}/lib)
ENDIF(WITH_FFTW3)
IF(WITH_OPENCOLLADA)
SET(OPENCOLLADA ${LIBDIR}/opencollada)
SET(OPENCOLLADA_INC ${OPENCOLLADA}/include)
SET(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib)
SET(OPENCOLLADA_LIB OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils OpenCOLLADAStreamWriter MathMLSolver GeneratedSaxParser xml2 buffer ftoa)
#pcre is bundled with openCollada
#SET(PCRE ${LIBDIR}/pcre)
#SET(PCRE_LIBPATH ${PCRE}/lib)
SET(PCRE_LIB pcre)
ENDIF(WITH_OPENCOLLADA)
# TODO: IF(WITH_LCMS)
IF(WITH_FFMPEG)
SET(FFMPEG ${LIBDIR}/ffmpeg)
SET(FFMPEG_INC ${FFMPEG}/include ${FFMPEG}/include/msvc)
SET(FFMPEG_LIB avcodec-52 avformat-52 avdevice-52 avutil-50 swscale-0)
SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
ENDIF(WITH_FFMPEG)
IF(WITH_OPENEXR)
SET(OPENEXR ${LIBDIR}/openexr)
SET(OPENEXR_INC ${OPENEXR}/include ${OPENEXR}/include/IlmImf ${OPENEXR}/include/Iex ${OPENEXR}/include/Imath)
SET(OPENEXR_LIB Iex Half IlmImf Imath IlmThread)
IF (MSVC80)
SET(OPENEXR_LIBPATH ${OPENEXR}/lib_vs2005)
ELSE (MSVC80)
SET(OPENEXR_LIBPATH ${OPENEXR}/lib_msvc)
ENDIF(MSVC80)
IF (MSVC90)
SET(OPENEXR_LIBPATH ${OPENEXR}/lib_vs2008)
ENDIF(MSVC90)
ENDIF(WITH_OPENEXR)
IF(WITH_TIFF)
SET(TIFF ${LIBDIR}/tiff)
SET(TIFF_LIBRARY libtiff)
SET(TIFF_INCLUDE_DIR ${TIFF}/include)
SET(TIFF_LIBPATH ${TIFF}/lib)
ENDIF(WITH_TIFF)
IF(WITH_JACK)
SET(JACK ${LIBDIR}/jack)
SET(JACK_INC ${JACK}/include/jack ${JACK}/include)
SET(JACK_LIB libjack)
SET(JACK_LIBPATH ${JACK}/lib)
ENDIF(WITH_JACK)
# MSVC only, Mingw doesnt need
IF(CMAKE_CL_64)
SET(PLATFORM_LINKFLAGS "/MACHINE:X64 /NODEFAULTLIB:libc.lib;MSVCRT.lib ")
ELSE(CMAKE_CL_64)
SET(PLATFORM_LINKFLAGS "/NODEFAULTLIB:libc.lib ")
ENDIF(CMAKE_CL_64)
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:libcmt.lib;libc.lib ")
ELSE(MSVC) # MINGW
SET(LLIBS "-lshell32 -lshfolder -lgdi32 -lmsvcrt -lwinmm -lmingw32 -lm -lws2_32 -lz -lstdc++ -lole32 -luuid")
SET(CMAKE_CXX_FLAGS "-pipe -funsigned-char -fno-strict-aliasing" CACHE STRING "Mingw C++ flags ")
SET(CMAKE_C_FLAGS "-pipe -funsigned-char -fno-strict-aliasing" CACHE STRING "Mingw C flags ")
SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g" CACHE STRING "Mingw debug C++ flags ")
SET(CMAKE_CXX_FLAGS_RELEASE " -O2" CACHE STRING "Mingw release C++ flags ")
SET(CMAKE_CXX_FLAGS_MINSIZEREL " -Os" CACHE STRING "Mingw minsize release C++ flags ")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g" CACHE STRING "Mingw release, debug C++ flags ")
SET(CMAKE_C_FLAGS_DEBUG "-O0 -g" CACHE STRING "Mingw debug C flags ")
SET(CMAKE_C_FLAGS_RELEASE "-O2" CACHE STRING "Mingw release C flags ")
SET(CMAKE_C_FLAGS_MINSIZEREL "-Os" CACHE STRING "Mingw minsize release C flags ")
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g" CACHE STRING "Mingw release, debug C++ flags ")
ADD_DEFINITIONS(-DFREE_WINDOWS)
IF(WITH_OPENMP)
SET(LLIBS "${LLIBS} -lgomp")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
ENDIF(WITH_OPENMP)
IF(WITH_INTERNATIONAL)
SET(GETTEXT ${LIBDIR}/gcc/gettext)
SET(GETTEXT_INC ${GETTEXT}/include)
SET(GETTEXT_LIBPATH ${GETTEXT}/lib)
SET(GETTEXT_LIB intl)
ENDIF(WITH_INTERNATIONAL)
SET(JPEG_LIBRARY libjpeg)
SET(PNG_LIBRARIES png)
SET(ZLIB ${LIBDIR}/zlib)
SET(ZLIB_INC ${ZLIB}/include)
SET(ZLIB_LIBPATH ${ZLIB}/lib)
SET(ZLIB_LIBRARIES z)
SET(PTHREADS ${LIBDIR}/pthreads)
SET(PTHREADS_INC ${PTHREADS}/include)
SET(PTHREADS_LIBPATH ${PTHREADS}/lib)
SET(PTHREADS_LIB pthreadGC2)
SET(FREETYPE ${LIBDIR}/gcc/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}/gcc/fftw3)
SET(FFTW3_LIB fftw3)
SET(FFTW3_INC ${FFTW3}/include)
SET(FFTW3_LIBPATH ${FFTW3}/lib)
ENDIF(WITH_FFTW3)
IF(WITH_OPENCOLLADA)
SET(OPENCOLLADA ${LIBDIR}/gcc/opencollada)
SET(OPENCOLLADA_INC ${OPENCOLLADA}/include)
SET(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib ${OPENCOLLADA}/lib)
SET(OPENCOLLADA_LIB OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver expat pcre buffer ftoa)
#pcre is bundled with openCollada
#SET(PCRE ${LIBDIR}/pcre)
#SET(PCRE_LIBPATH ${PCRE}/lib)
SET(PCRE_LIB pcre)
ENDIF(WITH_OPENCOLLADA)
IF(WITH_FFMPEG)
SET(FFMPEG ${LIBDIR}/ffmpeg)
SET(FFMPEG_INC ${FFMPEG}/include ${FFMPEG}/include)
SET(FFMPEG_LIB avcodec-52 avformat-52 avdevice-52 avutil-50 swscale-0)
SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
ENDIF(WITH_FFMPEG)
IF(WITH_OPENEXR)
SET(OPENEXR ${LIBDIR}/gcc/openexr)
SET(OPENEXR_INC ${OPENEXR}/include ${OPENEXR}/include/OpenEXR)
SET(OPENEXR_LIB Half IlmImf Imath IlmThread)
SET(OPENEXR_LIBPATH ${OPENEXR}/lib)
ENDIF(WITH_OPENEXR)
IF(WITH_TIFF)
SET(TIFF ${LIBDIR}/gcc/tiff)
SET(TIFF_LIBRARY tiff)
SET(TIFF_INCLUDE_DIR ${TIFF}/include)
SET(TIFF_LIBPATH ${TIFF}/lib)
ENDIF(WITH_TIFF)
IF(WITH_JACK)
SET(JACK ${LIBDIR}/jack)
SET(JACK_INC ${JACK}/include/jack ${JACK}/include)
SET(JACK_LIB jack)
SET(JACK_LIBPATH ${JACK}/lib)
# TODO, gives linking errors, force off
SET(WITH_JACK OFF)
ENDIF(WITH_JACK)
IF(WITH_RAYOPTIMIZATION AND SUPPORT_SSE_BUILD)
SET(PLATFORM_CFLAGS " -msse -msse2 ${PLATFORM_CFLAGS}")
ADD_DEFINITIONS(-D__SSE__)
ADD_DEFINITIONS(-D__MMX__)
ENDIF(WITH_RAYOPTIMIZATION AND SUPPORT_SSE_BUILD)
ENDIF(MSVC)
IF(CMAKE_CL_64)
SET(PLATFORM_LINKFLAGS "/MACHINE:X64 /NODEFAULTLIB:libc.lib;MSVCRT.lib ")
ELSE(CMAKE_CL_64)
SET(PLATFORM_LINKFLAGS "/NODEFAULTLIB:libc.lib ")
ENDIF(CMAKE_CL_64)
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:libcmt.lib;libc.lib ")
ENDIF(WIN32)
IF(APPLE)
IF(WITH_LIBS10.5)
SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin-9.x.universal)
@ -459,8 +669,8 @@ IF(APPLE)
IF(WITH_SNDFILE)
SET(SNDFILE ${LIBDIR}/sndfile)
SET(SNDFILE_INC ${SNDFILE}/include)
SET(SNDFILE_LIB sndfile)
SET(SNDFILE_LIBPATH ${SNDFILE}/lib)
SET(SNDFILE_LIB sndfile FLAC ogg vorbis vorbisenc)
SET(SNDFILE_LIBPATH ${SNDFILE}/lib ${FFMPEG}/lib)
ENDIF(WITH_SNDFILE)
SET(PYTHON_VERSION 3.1)
@ -473,12 +683,12 @@ IF(APPLE)
# SET(PYTHON_BINARY "${PYTHON}/bin/python${PYTHON_VERSION}") # not used yet
SET(PYTHON_LIB python${PYTHON_VERSION})
SET(PYTHON_LIBPATH "${PYTHON}/lib/python${PYTHON_VERSION}")
# SET(PYTHON_LINKFLAGS "-u _PyMac_Error") # won't build with this enabled
# SET(PYTHON_LINKFLAGS "-u _PyMac_Error") # won't build with this enabled
ELSE(PYTHON_VERSION MATCHES 3.1)
# otherwise, use custom system framework
SET(PYTHON /System/Library/Frameworks/Python.framework/Versions/)
SET(PYTHON_VERSION 2.5)
SET(PYTHON_VERSION 3.1)
SET(PYTHON_INC "${PYTHON}${PYTHON_VERSION}/include/python${PYTHON_VERSION}")
# SET(PYTHON_BINARY ${PYTHON}${PYTHON_VERSION}/bin/python${PYTHON_VERSION}) # not used yet
SET(PYTHON_LIB "")
@ -486,10 +696,12 @@ IF(APPLE)
SET(PYTHON_LINKFLAGS "-u _PyMac_Error -framework System -framework Python")
ENDIF(PYTHON_VERSION MATCHES 3.1)
SET(GETTEXT ${LIBDIR}/gettext)
SET(GETTEXT_INC "${GETTEXT}/include")
SET(GETTEXT_LIB intl iconv)
SET(GETTEXT_LIBPATH ${GETTEXT}/lib)
IF(WITH_INTERNATIONAL)
SET(GETTEXT ${LIBDIR}/gettext)
SET(GETTEXT_INC "${GETTEXT}/include")
SET(GETTEXT_LIB intl iconv)
SET(GETTEXT_LIBPATH ${GETTEXT}/lib)
ENDIF(WITH_INTERNATIONAL)
IF(WITH_FFTW3)
SET(FFTW3 ${LIBDIR}/fftw3)
@ -510,15 +722,27 @@ IF(APPLE)
SET(FREETYPE_LIBPATH ${FREETYPE}/lib)
SET(FREETYPE_LIBRARY freetype)
SET(OPENEXR ${LIBDIR}/openexr)
SET(OPENEXR_INC ${OPENEXR}/include/OpenEXR ${OPENEXR}/include)
SET(OPENEXR_LIB Iex Half IlmImf Imath IlmThread)
SET(OPENEXR_LIBPATH ${OPENEXR}/lib)
IF(WITH_OPENEXR)
SET(OPENEXR ${LIBDIR}/openexr)
SET(OPENEXR_INC ${OPENEXR}/include/OpenEXR ${OPENEXR}/include)
SET(OPENEXR_LIB Iex Half IlmImf Imath IlmThread)
SET(OPENEXR_LIBPATH ${OPENEXR}/lib)
ENDIF(WITH_OPENEXR)
SET(FFMPEG ${LIBDIR}/ffmpeg)
SET(FFMPEG_INC ${FFMPEG}/include)
SET(FFMPEG_LIB avcodec avdevice avformat avutil mp3lame swscale x264 xvidcore theora theoradec theoraenc vorbis vorbisenc vorbisfile ogg)
SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
IF(WITH_LCMS)
SET(LCMS ${LIBDIR}/lcms)
SET(LCMS_INCLUDE_DIR ${LCMS}/include)
SET(LCMS_LIBRARY lcms)
SET(LCMS_LIBPATH ${LCMS}/lib)
ENDIF(WITH_LCMS)
IF(WITH_FFMPEG)
SET(FFMPEG ${LIBDIR}/ffmpeg)
SET(FFMPEG_INC ${FFMPEG}/include)
SET(FFMPEG_LIB avcodec avdevice avformat avutil mp3lame swscale x264 xvidcore theora theoradec theoraenc vorbis vorbisenc vorbisfile ogg)
SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__STDC_CONSTANT_MACROS")
ENDIF(WITH_FFMPEG)
SET(LIBSAMPLERATE ${LIBDIR}/samplerate)
SET(LIBSAMPLERATE_INC ${LIBSAMPLERATE}/include)
@ -566,10 +790,12 @@ IF(APPLE)
SET(EXPAT_LIB)
ENDIF (WITH_OPENCOLLADA)
SET(SDL ${LIBDIR}/sdl)
SET(SDL_INCLUDE_DIR ${SDL}/include)
SET(SDL_LIBRARY SDL)
SET(SDL_LIBPATH ${SDL}/lib)
IF(WITH_SDL)
SET(SDL ${LIBDIR}/sdl)
SET(SDL_INCLUDE_DIR ${SDL}/include)
SET(SDL_LIBRARY SDL)
SET(SDL_LIBPATH ${SDL}/lib)
ENDIF(WITH_SDL)
SET(PNG "${LIBDIR}/png")
SET(PNG_INC "${PNG}/include")
@ -579,8 +805,18 @@ IF(APPLE)
SET(JPEG_INC "${JPEG}/include")
SET(JPEG_LIBPATH ${JPEG}/lib)
SET(TIFF ${LIBDIR}/tiff)
SET(TIFF_INC ${TIFF}/include)
IF(WITH_TIFF)
SET(TIFF ${LIBDIR}/tiff)
SET(TIFF_INCLUDE_DIR ${TIFF}/include)
SET(TIFF_LIBRARY tiff)
SET(TIFF_LIBPATH ${TIFF}/lib)
ENDIF(WITH_TIFF)
IF(WITH_RAYOPTIMIZATION AND SUPPORT_SSE_BUILD)
SET(PLATFORM_CFLAGS " -msse -msse2 ${PLATFORM_CFLAGS}")
ADD_DEFINITIONS(-D__SSE__)
ADD_DEFINITIONS(-D__MMX__)
ENDIF(WITH_RAYOPTIMIZATION AND SUPPORT_SSE_BUILD)
SET(EXETYPE MACOSX_BUNDLE)
@ -603,11 +839,6 @@ IF(APPLE)
ENDIF(APPLE)
IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
SET(BINRELOC ${CMAKE_SOURCE_DIR}/extern/binreloc)
SET(BINRELOC_INC ${BINRELOC}/include)
ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
# buildinfo
IF(WITH_BUILDINFO)
@ -633,10 +864,11 @@ ENDIF(WITH_BUILDINFO)
#-----------------------------------------------------------------------------
# Common.
set(OPENJPEG ${CMAKE_SOURCE_DIR}/extern/libopenjpeg)
set(OPENJPEG_INC ${OPENJPEG})
set(OPENJPEG_LIb extern_libopenjpeg)
IF(WITH_OPENJPEG)
set(OPENJPEG ${CMAKE_SOURCE_DIR}/extern/libopenjpeg)
set(OPENJPEG_INC ${OPENJPEG})
set(OPENJPEG_LIb extern_libopenjpeg)
ENDIF(WITH_OPENJPEG)
#-----------------------------------------------------------------------------
# Blender WebPlugin

12
COPYING
View File

@ -1,3 +1,11 @@
Please read over both of the following files:
Blender uses the GNU General Public License, which describes the rights
to distribute or change the code.
Please read this file for the full license.
doc/GPL-license.txt
doc/BL-license.txt
Apart from the GNU GPL, Blender is not available under other licenses.
2010, Blender Foundation
foundation@blender.org

View File

@ -41,7 +41,7 @@ sinclude user-def.mk
# export NAN_NO_OPENAL=true
export NANBLENDERHOME=$(shell pwd)
MAKEFLAGS=-I$(NANBLENDERHOME)/source --no-print-directory
MAKEFLAGS=-I$(NANBLENDERHOME)/build_files/make --no-print-directory
SOURCEDIR =
ifeq ($(FREE_WINDOWS),true)
@ -50,7 +50,7 @@ else
DIRS ?= extern intern source po
endif
include source/nan_subdirs.mk
include build_files/make/nan_subdirs.mk
.PHONY: release
release:

45
README
View File

@ -1,45 +0,0 @@
Welcome to the fun world of open source.
For instructions on building and installing Blender, please see the file named
INSTALL.
---------------------.Blanguages and the .blender directory---------------------
The .blender directory holds various data files for Blender.
In the 2.28a release those are the .Blanguages file containing a list of
translations, the translations themselves and a default ttf font.
Blender checks for the presence of this directory in several locations:
- the current directory
- your home directory
- On OSX, the blender bundle is also checked
- On Windows, the installation dir is checked.
If you get a 'File ".Blanguages" not found' warning, try to copy the .blender
dir to one of these locations (your home directory being recommended).
-------------------------------------Links--------------------------------------
Getting Involved:
http://www.blender.org/community/get-involved
Community:
http://www.blender.org/Community
Main blender development site:
http://www.blender.org
The Blender project homepage:
http://projects.blender.org/projects/bf-blender
Documentation:
http://www.blender.org/education-help
Bug tracker:
http://www.blender.org/development/report-a-bug
Feature request tracker:
http://wiki.blender.org/index.php/Requests

View File

@ -46,15 +46,19 @@ import glob
import re
from tempfile import mkdtemp
import tools.Blender
import tools.btools
import tools.bcolors
# needed for importing tools
sys.path.append(os.path.join(".", "build_files", "scons", "tools"))
import Blender
import btools
import bcolors
EnsureSConsVersion(1,0,0)
BlenderEnvironment = tools.Blender.BlenderEnvironment
btools = tools.btools
B = tools.Blender
BlenderEnvironment = Blender.BlenderEnvironment
B = Blender
VERSION = btools.VERSION # This is used in creating the local config directories
### globals ###
platform = sys.platform
@ -157,7 +161,7 @@ if crossbuild and platform not in ('win32-vc', 'win64-vc'):
env['OURPLATFORM'] = platform
configfile = 'config'+os.sep+platform+'-config.py'
configfile = os.path.join("build_files", "scons", "config", platform + "-config.py")
if os.path.exists(configfile):
print B.bc.OKGREEN + "Using config file: " + B.bc.ENDC + configfile
@ -182,7 +186,7 @@ if os.path.exists(userconfig):
else:
print B.bc.WARNING + userconfig + " not found, no user overrides" + B.bc.ENDC
opts = btools.read_opts(optfiles, B.arguments)
opts = btools.read_opts(env, optfiles, B.arguments)
opts.Update(env)
if not env['BF_FANCY']:
@ -193,7 +197,7 @@ if not env['BF_FANCY']:
# NOTE: only do the scripts directory for now, otherwise is too disruptive for developers
# TODO: perhaps we need an option (off by default) to not do this altogether...
if not env['WITHOUT_BF_INSTALL'] and not env['WITHOUT_BF_OVERWRITE_INSTALL']:
scriptsDir = env['BF_INSTALLDIR'] + os.sep + '.blender' + os.sep + 'scripts'
scriptsDir = os.path.join(env['BF_INSTALLDIR'], VERSION, 'scripts')
if os.path.isdir(scriptsDir):
print B.bc.OKGREEN + "Clearing installation directory%s: %s" % (B.bc.ENDC, os.path.abspath(scriptsDir))
shutil.rmtree(scriptsDir)
@ -201,6 +205,7 @@ if not env['WITHOUT_BF_INSTALL'] and not env['WITHOUT_BF_OVERWRITE_INSTALL']:
SetOption('num_jobs', int(env['BF_NUMJOBS']))
print B.bc.OKGREEN + "Build with parallel jobs%s: %s" % (B.bc.ENDC, GetOption('num_jobs'))
print B.bc.OKGREEN + "Build with debug symbols%s: %s" % (B.bc.ENDC, env['BF_DEBUG'])
# BLENDERPATH is a unix only option to enable typical style paths this is
# spesifically a data-dir, which is used a lot but cant replace BF_INSTALLDIR
@ -268,6 +273,7 @@ if 'blenderlite' in B.targets:
target_env_defs['WITH_BF_GAMEENGINE'] = False
target_env_defs['WITH_BF_OPENAL'] = False
target_env_defs['WITH_BF_OPENEXR'] = False
target_env_defs['WITH_BF_OPENMP'] = False
target_env_defs['WITH_BF_ICONV'] = False
target_env_defs['WITH_BF_INTERNATIONAL'] = False
target_env_defs['WITH_BF_OPENJPEG'] = False
@ -402,7 +408,7 @@ thestatlibs, thelibincs = B.setup_staticlibs(env)
thesyslibs = B.setup_syslibs(env)
if 'blender' in B.targets or not env['WITH_BF_NOBLENDER']:
env.BlenderProg(B.root_build_dir, "blender", dobj + mainlist, [], thestatlibs + thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blender')
env.BlenderProg(B.root_build_dir, "blender", dobj + mainlist + thestatlibs, [], thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blender')
if env['WITH_BF_PLAYER']:
playerlist = B.create_blender_liblist(env, 'player')
playerlist += B.create_blender_liblist(env, 'intern')
@ -432,9 +438,11 @@ else:
blenderinstall = env.Install(dir=dir, source=B.program_list)
#-- .blender
#- dont do .blender and scripts for darwin, it is already in the bundle
#-- local path = config files in install dir: installdir\VERSION
#- dont do config and scripts for darwin, it is already in the bundle
dotblendlist = []
datafileslist = []
datafilestargetlist = []
dottargetlist = []
scriptinstall = []
@ -453,22 +461,29 @@ if env['OURPLATFORM']!='darwin':
if f.endswith('.ttf'):
continue
dotblendlist.append(os.path.join(dp, f))
if env['WITH_BF_FHS']: dir= os.path.join(*([BLENDERPATH] + dp.split(os.sep)[2:])) # skip bin/.blender
else: dir= os.path.join(*([BLENDERPATH] + dp.split(os.sep)[1:])) # skip bin
# print dir+ os.sep + f
print dir
dottargetlist.append(dir + os.sep + f)
if 'locale' in dp:
datafileslist.append(os.path.join(dp,f))
if env['WITH_BF_FHS']: dir= os.path.join(*([BLENDERPATH] + ['datafiles'] + dp.split(os.sep)[2:])) # skip bin/.blender
else: dir= os.path.join(*([BLENDERPATH] + [VERSION] + ['datafiles'] + dp.split(os.sep)[1:])) # skip bin
datafilestargetlist.append(dir + os.sep + f)
else:
dotblendlist.append(os.path.join(dp, f))
if env['WITH_BF_FHS']: dir= os.path.join(*([BLENDERPATH] + ['config'] + dp.split(os.sep)[2:])) # skip bin/.blender
else: dir= os.path.join(*([BLENDERPATH] + [VERSION] + ['config'] + dp.split(os.sep)[1:])) # skip bin
dottargetlist.append(dir + os.sep + f)
dotblenderinstall = []
for targetdir,srcfile in zip(dottargetlist, dotblendlist):
td, tf = os.path.split(targetdir)
dotblenderinstall.append(env.Install(dir=td, source=srcfile))
for targetdir,srcfile in zip(datafilestargetlist, datafileslist):
td, tf = os.path.split(targetdir)
dotblenderinstall.append(env.Install(dir=td, source=srcfile))
if env['WITH_BF_PYTHON']:
#-- .blender/scripts
#-- local/VERSION/scripts
scriptpaths=['release/scripts']
for scriptpath in scriptpaths:
for dp, dn, df in os.walk(scriptpath):
@ -476,7 +491,7 @@ if env['OURPLATFORM']!='darwin':
dn.remove('.svn')
if env['WITH_BF_FHS']: dir = BLENDERPATH
else: dir = os.path.join(env['BF_INSTALLDIR'], '.blender')
else: dir = os.path.join(env['BF_INSTALLDIR'], VERSION)
dir += os.sep + os.path.basename(scriptpath) + dp[len(scriptpath):]
source=[os.path.join(dp, f) for f in df if f[-3:]!='pyc']
@ -569,10 +584,12 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'):
#currently win64-vc doesn't appear to have libpng.dll
if env['OURPLATFORM'] != 'win64-vc':
dllsources += ['${BF_PNG_LIBPATH}/libpng.dll',
'${BF_ZLIB_LIBPATH}/zlib.dll']
dllsources += ['${BF_PNG_LIBPATH}/libpng.dll']
dllsources += ['${BF_TIFF_LIBPATH}/${BF_TIFF_LIB}.dll']
dllsources += ['${BF_ZLIB_LIBPATH}/zlib.dll']
# Used when linking to libtiff was dynamic
# keep it here until compilation on all platform would be ok
# dllsources += ['${BF_TIFF_LIBPATH}/${BF_TIFF_LIB}.dll']
if env['OURPLATFORM'] != 'linuxcross':
# pthreads library is already added

View File

@ -0,0 +1,233 @@
MACRO(BLENDERLIB_NOLIST
name
sources
includes)
# Gather all headers
FILE(GLOB_RECURSE INC_ALL *.h)
INCLUDE_DIRECTORIES(${includes})
ADD_LIBRARY(${name} ${INC_ALL} ${sources})
# Group by location on disk
SOURCE_GROUP(Files FILES CMakeLists.txt)
SET(ALL_FILES ${sources} ${INC_ALL})
FOREACH(SRC ${ALL_FILES})
STRING(REGEX REPLACE ${CMAKE_CURRENT_SOURCE_DIR} "Files" REL_DIR "${SRC}")
STRING(REGEX REPLACE "[\\\\/][^\\\\/]*$" "" REL_DIR "${REL_DIR}")
STRING(REGEX REPLACE "^[\\\\/]" "" REL_DIR "${REL_DIR}")
IF(REL_DIR)
SOURCE_GROUP(${REL_DIR} FILES ${SRC})
ELSE(REL_DIR)
SOURCE_GROUP(Files FILES ${SRC})
ENDIF(REL_DIR)
ENDFOREACH(SRC)
MESSAGE(STATUS "Configuring library ${name}")
ENDMACRO(BLENDERLIB_NOLIST)
MACRO(BLENDERLIB
name
sources
includes)
BLENDERLIB_NOLIST(${name} "${sources}" "${includes}")
# Add to blender's list of libraries
FILE(APPEND ${CMAKE_BINARY_DIR}/cmake_blender_libs.txt "${name};")
ENDMACRO(BLENDERLIB)
MACRO(SETUP_LIBDIRS)
# see "cmake --help-policy CMP0003"
if(COMMAND cmake_policy)
CMAKE_POLICY(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
LINK_DIRECTORIES(${JPEG_LIBPATH} ${PNG_LIBPATH} ${ZLIB_LIBPATH} ${FREETYPE_LIBPATH} ${LIBSAMPLERATE_LIBPATH})
IF(WITH_PYTHON)
LINK_DIRECTORIES(${PYTHON_LIBPATH})
ENDIF(WITH_PYTHON)
IF(WITH_INTERNATIONAL)
LINK_DIRECTORIES(${ICONV_LIBPATH})
LINK_DIRECTORIES(${GETTEXT_LIBPATH})
ENDIF(WITH_INTERNATIONAL)
IF(WITH_SDL)
LINK_DIRECTORIES(${SDL_LIBPATH})
ENDIF(WITH_SDL)
IF(WITH_FFMPEG)
LINK_DIRECTORIES(${FFMPEG_LIBPATH})
ENDIF(WITH_FFMPEG)
IF(WITH_OPENEXR)
LINK_DIRECTORIES(${OPENEXR_LIBPATH})
ENDIF(WITH_OPENEXR)
IF(WITH_TIFF)
LINK_DIRECTORIES(${TIFF_LIBPATH})
ENDIF(WITH_TIFF)
IF(WITH_LCMS)
LINK_DIRECTORIES(${LCMS_LIBPATH})
ENDIF(WITH_LCMS)
IF(WITH_QUICKTIME)
LINK_DIRECTORIES(${QUICKTIME_LIBPATH})
ENDIF(WITH_QUICKTIME)
IF(WITH_OPENAL)
LINK_DIRECTORIES(${OPENAL_LIBPATH})
ENDIF(WITH_OPENAL)
IF(WITH_JACK)
LINK_DIRECTORIES(${JACK_LIBPATH})
ENDIF(WITH_JACK)
IF(WITH_SNDFILE)
LINK_DIRECTORIES(${SNDFILE_LIBPATH})
ENDIF(WITH_SNDFILE)
IF(WITH_FFTW3)
LINK_DIRECTORIES(${FFTW3_LIBPATH})
ENDIF(WITH_FFTW3)
IF(WITH_OPENCOLLADA)
LINK_DIRECTORIES(${OPENCOLLADA_LIBPATH})
LINK_DIRECTORIES(${PCRE_LIBPATH})
LINK_DIRECTORIES(${EXPAT_LIBPATH})
ENDIF(WITH_OPENCOLLADA)
IF(WIN32)
LINK_DIRECTORIES(${PTHREADS_LIBPATH})
ENDIF(WIN32)
ENDMACRO(SETUP_LIBDIRS)
MACRO(SETUP_LIBLINKS
target)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS} ")
TARGET_LINK_LIBRARIES(${target} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${JPEG_LIBRARY} ${PNG_LIBRARIES} ${ZLIB_LIBRARIES} ${LLIBS})
# since we are using the local libs for python when compiling msvc projects, we need to add _d when compiling debug versions
IF(WITH_PYTHON)
TARGET_LINK_LIBRARIES(${target} ${PYTHON_LINKFLAGS})
IF(WIN32)
TARGET_LINK_LIBRARIES(${target} debug ${PYTHON_LIB}_d)
TARGET_LINK_LIBRARIES(${target} optimized ${PYTHON_LIB})
ELSE(WIN32)
TARGET_LINK_LIBRARIES(${target} ${PYTHON_LIB})
ENDIF(WIN32)
ENDIF(WITH_PYTHON)
TARGET_LINK_LIBRARIES(${target} ${OPENGL_glu_LIBRARY} ${JPEG_LIB} ${PNG_LIB} ${ZLIB_LIB})
TARGET_LINK_LIBRARIES(${target} ${FREETYPE_LIBRARY} ${LIBSAMPLERATE_LIB})
IF(WITH_INTERNATIONAL)
TARGET_LINK_LIBRARIES(${target} ${GETTEXT_LIB})
IF(WIN32)
TARGET_LINK_LIBRARIES(${target} ${ICONV_LIB})
ENDIF(WIN32)
ENDIF(WITH_INTERNATIONAL)
IF(WITH_OPENAL)
TARGET_LINK_LIBRARIES(${target} ${OPENAL_LIBRARY})
ENDIF(WITH_OPENAL)
IF(WITH_FFTW3)
TARGET_LINK_LIBRARIES(${target} ${FFTW3_LIB})
ENDIF(WITH_FFTW3)
IF(WITH_JACK)
TARGET_LINK_LIBRARIES(${target} ${JACK_LIB})
ENDIF(WITH_JACK)
IF(WITH_SNDFILE)
TARGET_LINK_LIBRARIES(${target} ${SNDFILE_LIB})
ENDIF(WITH_SNDFILE)
IF(WITH_SDL)
TARGET_LINK_LIBRARIES(${target} ${SDL_LIBRARY})
ENDIF(WITH_SDL)
IF(WITH_QUICKTIME)
TARGET_LINK_LIBRARIES(${target} ${QUICKTIME_LIB})
ENDIF(WITH_QUICKTIME)
IF(WITH_TIFF)
TARGET_LINK_LIBRARIES(${target} ${TIFF_LIBRARY})
ENDIF(WITH_TIFF)
IF(WITH_OPENEXR)
IF(WIN32)
FOREACH(loop_var ${OPENEXR_LIB})
TARGET_LINK_LIBRARIES(${target} debug ${loop_var}_d)
TARGET_LINK_LIBRARIES(${target} optimized ${loop_var})
ENDFOREACH(loop_var)
ELSE(WIN32)
TARGET_LINK_LIBRARIES(${target} ${OPENEXR_LIB})
ENDIF(WIN32)
ENDIF(WITH_OPENEXR)
IF(WITH_LCMS)
TARGET_LINK_LIBRARIES(${target} ${LCMS_LIBRARY})
ENDIF(WITH_LCMS)
IF(WITH_FFMPEG)
TARGET_LINK_LIBRARIES(${target} ${FFMPEG_LIB})
ENDIF(WITH_FFMPEG)
IF(WITH_OPENCOLLADA)
IF(WIN32)
FOREACH(loop_var ${OPENCOLLADA_LIB})
TARGET_LINK_LIBRARIES(${target} debug ${loop_var}_d)
TARGET_LINK_LIBRARIES(${target} optimized ${loop_var})
ENDFOREACH(loop_var)
TARGET_LINK_LIBRARIES(${target} debug ${PCRE_LIB}_d)
TARGET_LINK_LIBRARIES(${target} optimized ${PCRE_LIB})
IF(EXPAT_LIB)
TARGET_LINK_LIBRARIES(${target} debug ${EXPAT_LIB}_d)
TARGET_LINK_LIBRARIES(${target} optimized ${EXPAT_LIB})
ENDIF(EXPAT_LIB)
ELSE(WIN32)
TARGET_LINK_LIBRARIES(${target} ${OPENCOLLADA_LIB})
TARGET_LINK_LIBRARIES(${target} ${PCRE_LIB})
TARGET_LINK_LIBRARIES(${target} ${EXPAT_LIB})
ENDIF(WIN32)
ENDIF(WITH_OPENCOLLADA)
IF(WIN32)
TARGET_LINK_LIBRARIES(${target} ${PTHREADS_LIB})
ENDIF(WIN32)
ENDMACRO(SETUP_LIBLINKS)
MACRO(TEST_SSE_SUPPORT)
INCLUDE(CheckCXXSourceCompiles)
MESSAGE(STATUS "Detecting SSE support")
IF(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
SET(CMAKE_REQUIRED_FLAGS "-msse -msse2")
ELSEIF(MSVC)
SET(CMAKE_REQUIRED_FLAGS "/arch:SSE2")
ENDIF()
CHECK_CXX_SOURCE_COMPILES("
#include <xmmintrin.h>
int main() { __m128 v = _mm_setzero_ps(); return 0; }"
SUPPORT_SSE_BUILD)
ENDMACRO(TEST_SSE_SUPPORT)
MACRO(GET_BLENDER_VERSION)
FILE(READ ${CMAKE_SOURCE_DIR}/source/blender/blenkernel/BKE_blender.h CONTENT)
STRING(REGEX REPLACE "\n" ";" CONTENT "${CONTENT}")
STRING(REGEX REPLACE "\t" ";" CONTENT "${CONTENT}")
STRING(REGEX REPLACE " " ";" CONTENT "${CONTENT}")
FOREACH(ITEM ${CONTENT})
IF(LASTITEM MATCHES "BLENDER_VERSION")
MATH(EXPR BLENDER_VERSION_MAJOR "${ITEM} / 100")
MATH(EXPR BLENDER_VERSION_MINOR "${ITEM} % 100")
SET(BLENDER_VERSION "${BLENDER_VERSION_MAJOR}.${BLENDER_VERSION_MINOR}")
ENDIF(LASTITEM MATCHES "BLENDER_VERSION")
IF(LASTITEM MATCHES "BLENDER_SUBVERSION")
SET(BLENDER_SUBVERSION ${ITEM})
ENDIF(LASTITEM MATCHES "BLENDER_SUBVERSION")
IF(LASTITEM MATCHES "BLENDER_MINVERSION")
MATH(EXPR BLENDER_MINVERSION_MAJOR "${ITEM} / 100")
MATH(EXPR BLENDER_MINVERSION_MINOR "${ITEM} % 100")
SET(BLENDER_MINVERSION "${BLENDER_MINVERSION_MAJOR}.${BLENDER_MINVERSION_MINOR}")
ENDIF(LASTITEM MATCHES "BLENDER_MINVERSION")
IF(LASTITEM MATCHES "BLENDER_MINSUBVERSION")
SET(BLENDER_MINSUBVERSION ${ITEM})
ENDIF(LASTITEM MATCHES "BLENDER_MINSUBVERSION")
SET(LASTITEM ${ITEM})
ENDFOREACH(ITEM ${CONTENT})
MESSAGE(STATUS "Version major: ${BLENDER_VERSION_MAJOR}, Version minor: ${BLENDER_VERSION_MINOR}, Subversion: ${BLENDER_SUBVERSION}, Version: ${BLENDER_VERSION}")
MESSAGE(STATUS "Minversion major: ${BLENDER_MINVERSION_MAJOR}, Minversion minor: ${BLENDER_MINVERSION_MINOR}, MinSubversion: ${BLENDER_MINSUBVERSION}, Minversion: ${BLENDER_MINVERSION}")
ENDMACRO(GET_BLENDER_VERSION)

View File

@ -0,0 +1,38 @@
#!/bin/sh
#
# This is an example script to build things with the Nan Makefiles
#
#
rm -f /tmp/.nanguess
export MAKE=make
export NANBLENDERHOME=`pwd`
export MAKEFLAGS="-w -I $NANBLENDERHOME/source --no-print-directory"
export HMAKE="$NANBLENDERHOME/source/tools/hmake/hmake"
export NAN_PYTHON=/soft/python-2.2.2b1/progeny1
export NAN_PYTHON_VERSION=2.2
export NAN_OPENAL=/usr/local
export NAN_JPEG=/usr/local
export NAN_PNG=/usr/local
export NAN_SDL=/usr/local
export NAN_ODE=/usr/local
export NAN_ZLIB=/usr/local
export NAN_FREETYPE=/usr/local
export NAN_MOZILLA_INC=/usr/local/include/mozilla-1.0.1/
export NAN_MOZILLA_LIB=/usr/local/lib/mozilla-1.0.1/
#export NAN_NSPR=/scratch/irulan/mein/nspr-4.2.2/mozilla/nsprpub/dist/
export CPPFLAGS="$CPPFLAGS"
export CFLAGS="$CFLAGS"
export INTERNATIONAL=true
$HMAKE -C intern/
if [ $? -eq 0 ]; then
$HMAKE -C source/
fi
$HMAKE -C release
#cd release
#make

View File

@ -0,0 +1,18 @@
#!/bin/bash
rm -f /tmp/.nanguess
export MAKE=make
export NANBLENDERHOME=`pwd`
export MAKEFLAGS="-w -I $NANBLENDERHOME/source --no-print-directory"
export HMAKE="$NANBLENDERHOME/source/tools/hmake/hmake"
echo
echo NANBLENDERHOME : ${NANBLENDERHOME}
export NAN_PYTHON=/sw
$HMAKE -C intern/
if [ $? -eq 0 ]; then
$HMAKE -C source/
fi
cd release
make

View File

@ -0,0 +1,35 @@
#!/bin/sh
# This is an example build script for SunOS5.8
rm -f /tmp/.nanguess
export MAKE=make
export NANBLENDERHOME=`pwd`
export MAKEFLAGS="-w -I $NANBLENDERHOME/source --no-print-directory"
export HMAKE="$NANBLENDERHOME/source/tools/hmake/hmake"
export NAN_PYTHON=/soft/python-2.2.2b1/SunOS5.8
export NAN_PYTHON_VERSION=2.2
export NAN_OPENAL=/usr/local
export NAN_JPEG=/usr/local
export NAN_PNG=/usr/local
export NAN_SDL=/usr/local
export NAN_ODE=/usr/local
export NAN_OPENSSL=/soft/ssl/openssl-0.9.6e
export NAN_ZLIB=/usr/local
export NAN_FREETYPE=/usr/local
export NAN_MOZILLA_INC=/usr/local/include/mozilla-1.0.1/
export NAN_MOZILLA_LIB=/usr/local/lib/mozilla-1.0.1/
export NAN_NSPR=/scratch/irulan/mein/nspr-4.2.2/mozilla/nsprpub/dist/
export CPPFLAGS="$CPPFLAGS"
export CFLAGS="$CFLAGS"
export INTERNATIONAL=true
$HMAKE -C intern/
if [ $? -eq 0 ]; then
$HMAKE -C source/
fi
$HMAKE -C release
#cd release
#make

View File

@ -82,10 +82,10 @@ ifeq ($(OS),darwin)
endif
endif
ifeq ($(CPU),powerpc)
CFLAGS += -pipe -fPIC -ffast-math -mcpu=7450 -mtune=G5 -funsigned-char -fno-strict-aliasing
CCFLAGS += -pipe -fPIC -funsigned-char -fno-strict-aliasing
CFLAGS += -pipe -fPIC -mcpu=7450 -mtune=G5 -funsigned-char -fno-strict-aliasing
CCFLAGS += -pipe -fPIC -funsigned-char -fno-strict-aliasing
else
CFLAGS += -pipe -fPIC -ffast-math -funsigned-char
CFLAGS += -pipe -fPIC -funsigned-char
CCFLAGS += -pipe -fPIC -funsigned-char
endif
@ -94,16 +94,14 @@ ifeq ($(OS),darwin)
CCFLAGS += -arch $(MACOSX_ARCHITECTURE) #-isysroot $(MACOSX_SDK) -mmacosx-version-min=$(MACOSX_MIN_VERS)
ifeq ($(MACOSX_ARCHITECTURE), $(findstring $(MACOSX_ARCHITECTURE), "i386 x86_64"))
REL_CFLAGS += -ftree-vectorize -msse -msse2 -msse3
REL_CCFLAGS += -ftree-vectorize -msse -msse2 -msse3
REL_CFLAGS += -O2 -ftree-vectorize -msse -msse2 -msse3
REL_CCFLAGS += -O2 -ftree-vectorize -msse -msse2 -msse3
else
REL_CFLAGS += -O2
REL_CCFLAGS += -O2
endif
ifeq ($(MACOSX_ARCHITECTURE), x86_64)
REL_CFLAGS += -mssse3
REL_CCFLAGS += -mssse3
endif
CPPFLAGS += -D_THREAD_SAFE -fpascal-strings
CPPFLAGS += -D_THREAD_SAFE
ifeq ($(WITH_COCOA), true)
CPPFLAGS += -DGHOST_COCOA
@ -174,8 +172,8 @@ ifeq ($(OS),linux)
CCC ?= g++
# CFLAGS += -pipe
# CCFLAGS += -pipe
CFLAGS += -pipe -fPIC -funsigned-char -fno-strict-aliasing
CCFLAGS += -pipe -fPIC -funsigned-char -fno-strict-aliasing
CFLAGS += -pipe -fPIC -funsigned-char -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
CCFLAGS += -pipe -fPIC -funsigned-char -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
REL_CFLAGS += -O2
REL_CCFLAGS += -O2
NAN_DEPEND = true
@ -214,7 +212,7 @@ ifeq ($(OS),solaris)
#CC ?= cc
#CCC ?= CC
endif
JAVAC = javac
JAVAH = javah
CFLAGS += -pipe -fPIC -funsigned-char -fno-strict-aliasing

View File

@ -31,7 +31,7 @@
# set some defaults when these are not overruled (?=) by environment variables
#
sinclude ../user-def.mk
sinclude ../../user-def.mk
# This warning only takes place once in source/
ifeq (debug, $(findstring debug, $(MAKECMDGOALS)))
@ -133,13 +133,13 @@ ifndef CONFIG_GUESS
endif
ifeq ($(WITH_JACK), true)
export NAN_JACK ?= /usr
export NAN_JACK ?= $(LCGDIR)/jack
export NAN_JACKCFLAGS ?= -I$(NAN_JACK)/include/jack
export NAN_JACKLIBS ?= $(NAN_JACK)/lib/libjack.a
endif
ifeq ($(WITH_SNDFILE),true)
export NAN_SNDFILE ?= /usr
export NAN_SNDFILE ?= $(LCGDIR)/sndfile
export NAN_SNDFILECFLAGS ?= -I$(NAN_SNDFILE)/include
export NAN_SNDFILELIBS ?= $(NAN_SNDFILE)/lib/libsndfile.a $(NAN_SNDFILE)/lib/libFLAC.a $(NAN_SNDFILE)/lib/libogg.a
endif
@ -158,7 +158,8 @@ ifndef CONFIG_GUESS
export BF_PCRE_LIBS ?= $(BF_PCRE)/lib/libpcre.a
endif
export WITH_TIFF ?= true
# Compare recreated .mo files with committed ones
export BF_VERIFY_MO_FILES ?= true
@ -207,8 +208,8 @@ ifndef CONFIG_GUESS
else
export PY_FRAMEWORK ?= 1
ifdef PY_FRAMEWORK
export NAN_PYTHON ?= /System/Library/Frameworks/Python.framework/Versions/2.5
export NAN_PYTHON_VERSION ?= 2.5
export NAN_PYTHON_VERSION ?= 3.1
export NAN_PYTHON ?= /System/Library/Frameworks/Python.framework/Versions/$(NAN_PYTHON_VERSION)
export NAN_PYTHON_BINARY ?= $(NAN_PYTHON)/bin/python$(NAN_PYTHON_VERSION)
export NAN_PYTHON_LIB ?= -framework Python
else
@ -275,6 +276,7 @@ ifndef CONFIG_GUESS
endif
export BF_PCRE = $(LCGDIR)/opencollada
export BF_OPENCOLLADA_LIBS = $(BF_OPENCOLLADA)/lib/libOpenCOLLADASaxFrameworkLoader.a $(BF_OPENCOLLADA)/lib/libOpenCOLLADAFramework.a $(BF_OPENCOLLADA)/lib/libOpenCOLLADABaseUtils.a $(BF_OPENCOLLADA)/lib/libOpenCOLLADAStreamWriter.a $(BF_OPENCOLLADA)/lib/libMathMLSolver.a $(BF_OPENCOLLADA)/lib/libGeneratedSaxParser.a $(BF_OPENCOLLADA)/lib/libUTF.a $(BF_OPENCOLLADA)/lib/libftoa.a $(BF_OPENCOLLADA)/lib/libbuffer.a -lxml2
else
ifeq ($(OS),freebsd)
@ -369,7 +371,7 @@ ifndef CONFIG_GUESS
# enable l10n
export INTERNATIONAL ?= true
# Different endianess will make it fail, rely on other plataforms for checks
# Different endianess will make it fail, rely on other platforms for checks
export BF_VERIFY_MO_FILES = false
else
@ -411,12 +413,6 @@ ifndef CONFIG_GUESS
export BF_FFTW3_LIBS ?= $(shell pkg-config --libs fftw3 )
endif
ifeq ($(WITH_OPENJPEG), true)
export BF_OPENJPEG ?= /usr
export BF_OPENJPEG_INC ?= /usr/include
export BF_OPENJPEG_LIBS ?= -lopenjpeg
endif
# Uncomment the following line to use Mozilla inplace of netscape
# Location of MOZILLA/Netscape header files...
@ -439,6 +435,11 @@ ifndef CONFIG_GUESS
export WITH_FFMPEG ?= true
endif
ifeq ($(CPU), powerpc)
# Different endianess will make it fail, rely on other platforms for checks
export BF_VERIFY_MO_FILES = false
endif
else
ifeq ($(OS),openbsd)
@ -538,7 +539,7 @@ ifndef CONFIG_GUESS
ifeq ($(FREE_WINDOWS), true)
export NAN_GETTEXT_LIB ?= $(NAN_GETTEXT)/lib/freegettext.a $(NAN_ICONV)/lib/freeiconv.a
export NAN_PYTHON_BINARY ?= $(NAN_PYTHON)/bin/python$(NAN_PYTHON_VERSION)
export NAN_PYTHON_LIB ?= $(NAN_PYTHON)/lib/lib25_vs2005/libpython25.a
export NAN_PYTHON_LIB ?= $(NAN_PYTHON)/lib/lib25_vs2005/libpython31.a # NOT TESTED, PROBABLY BROKEN
export NAN_FREETYPE ?= $(LCGDIR)/gcc/freetype
export NAN_SDL ?= $(LCGDIR)/gcc/sdl
export NAN_OPENEXR ?= $(LCGDIR)/gcc/openexr
@ -548,7 +549,7 @@ ifndef CONFIG_GUESS
else
export NAN_GETTEXT_LIB ?= $(NAN_GETTEXT)/lib/gnu_gettext.lib $(NAN_ICONV)/lib/iconv.lib
export NAN_PYTHON_BINARY ?= python
export NAN_PYTHON_LIB ?= $(NAN_PYTHON)/lib/python23.lib
export NAN_PYTHON_LIB ?= $(NAN_PYTHON)/lib/python31.lib # NOT TESTED, PROBABLY BROKEN
export NAN_FREETYPE ?= $(LCGDIR)/freetype
export NAN_SDL ?= $(LCGDIR)/sdl
export NAN_OPENEXR ?= $(LCGDIR)/openexr
@ -618,6 +619,9 @@ ifndef CONFIG_GUESS
endif # freebsd
endif # darwin
# default tiff libs
export NAN_TIFF_LIBS ?= $(NAN_TIFF)/lib/libtiff.a
endif # CONFIG_GUESS
# Don't want to build the gameengine?

View File

@ -108,7 +108,7 @@ ifeq ($(OS),linux)
endif
ifeq ($(CPU),$(findstring $(CPU), "i386 x86_64 ia64 parisc64 powerpc sparc64"))
COMMENT = "MESA 3.1"
LLIBS = -L$(NAN_MESA)/lib -L/usr/X11R6/lib -lXmu -lXext -lX11 -lXi
LLIBS = -L$(NAN_MESA)/lib -L/usr/X11R6/lib -lXext -lX11 -lXi
LLIBS += -lutil -lc -lm -ldl -lpthread
LLIBS += -L$(NAN_PYTHON)/lib -Wl,-rpath -Wl,$(NAN_PYTHON)/lib -lpython$(NAN_PYTHON_VERSION)
LOPTS = -export-dynamic
@ -155,7 +155,7 @@ ifeq ($(OS),windows)
LOPTS += /NODEFAULTLIB:"libcd"
LOPTS += /NODEFAULTLIB:"libcp"
LOPTS += /NODEFAULTLIB:"libcpd"
LOPTS += /NODEFAULTLIB:"python20"
LOPTS += /NODEFAULTLIB:"python31"
LOPTS += /NODEFAULTLIB:"msvcrt"
LOPTS += /SUBSYSTEM:CONSOLE
LDFLAGS += /MT
@ -191,4 +191,8 @@ ifeq ($(WITH_OPENCOLLADA),true)
LLIBS += $(BF_OPENCOLLADA_LIBS)
endif
ifeq ($(WITH_TIFF),true)
LLIBS += $(NAN_TIFF_LIBS)
endif
LLIBS += $(NAN_PYTHON_LIB)

View File

@ -14,7 +14,7 @@ BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}'
BF_PYTHON_BINARY = '${BF_PYTHON}/bin/python${BF_PYTHON_VERSION}'
BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION}' #BF_PYTHON+'/lib/python'+BF_PYTHON_VERSION+'/config/libpython'+BF_PYTHON_VERSION+'.a'
BF_PYTHON_LINKFLAGS = ['-Xlinker', '-export-dynamic']
BF_PYTHON_LIB_STATIC = '${BF_PYTHON}/lib/python2.5/config/libpython${BF_PYTHON_VERSION}.a'
BF_PYTHON_LIB_STATIC = '${BF_PYTHON}/lib/python${BF_PYTHON_VERSION}/config/libpython${BF_PYTHON_VERSION}.a'
WITH_BF_OPENAL = 'false'
WITH_BF_STATICOPENAL = 'false'
@ -83,22 +83,11 @@ BF_FTGL_LIB = 'extern_ftgl'
WITH_BF_GAMEENGINE='false'
WITH_BF_ODE = 'false'
BF_ODE = LIBDIR + '/ode'
BF_ODE_INC = BF_ODE + '/include'
BF_ODE_LIB = BF_ODE + '/lib/libode.a'
WITH_BF_BULLET = 'true'
BF_BULLET = '#extern/bullet2/src'
BF_BULLET_INC = '${BF_BULLET}'
BF_BULLET_LIB = 'extern_bullet'
BF_SOLID = '#extern/solid'
BF_SOLID_INC = '${BF_SOLID}'
BF_SOLID_LIB = 'extern_solid'
WITH_BF_YAFRAY = 'true'
#WITH_BF_NSPR = 'true'
#BF_NSPR = $(LIBDIR)/nspr
#BF_NSPR_INC = -I$(BF_NSPR)/include -I$(BF_NSPR)/include/nspr

View File

@ -131,8 +131,8 @@ BF_JACK_LIBPATH = '${BF_JACK}/lib'
WITH_BF_SNDFILE = True
BF_SNDFILE = LIBDIR + '/sndfile'
BF_SNDFILE_INC = '${BF_SNDFILE}/include'
BF_SNDFILE_LIB = 'sndfile'
BF_SNDFILE_LIBPATH = '${BF_SNDFILE}/lib'
BF_SNDFILE_LIB = 'sndfile FLAC ogg vorbis vorbisenc'
BF_SNDFILE_LIBPATH = '${BF_SNDFILE}/lib ${BF_FFMPEG}/lib' #ogg libs are stored in ffmpeg dir
WITH_BF_SDL = True
BF_SDL = LIBDIR + '/sdl' #$(shell sdl-config --prefix)
@ -151,6 +151,13 @@ BF_OPENEXR_LIB_STATIC = '${BF_OPENEXR}/lib/libHalf.a ${BF_OPENEXR}/lib/libIlmImf
WITH_BF_DDS = True
#Color Management System
WITH_BF_LCMS = False
BF_LCMS = LIBDIR + '/lcms'
BF_LCMS_INC = '${BF_LCMS}/include'
BF_LCMS_LIB = 'lcms'
BF_LCMS_LIBPATH = '${BF_LCMS}/lib'
WITH_BF_JPEG = True
BF_JPEG = LIBDIR + '/jpeg'
BF_JPEG_INC = '${BF_JPEG}/include'
@ -163,8 +170,11 @@ 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 = '/usr'
@ -269,9 +279,9 @@ else:
CFLAGS = ['-pipe','-funsigned-char']+ARCH_FLAGS
CPPFLAGS = ['-fpascal-strings']+ARCH_FLAGS
CCFLAGS = ['-pipe','-funsigned-char','-fpascal-strings']+ARCH_FLAGS
CXXFLAGS = ['-pipe','-funsigned-char', '-fpascal-strings']+ARCH_FLAGS
CPPFLAGS = []+ARCH_FLAGS
CCFLAGS = ['-pipe','-funsigned-char']+ARCH_FLAGS
CXXFLAGS = ['-pipe','-funsigned-char']+ARCH_FLAGS
if WITH_GHOST_COCOA==True:
PLATFORM_LINKFLAGS = ['-fexceptions','-framework','CoreServices','-framework','Foundation','-framework','IOKit','-framework','AppKit','-framework','Cocoa','-framework','Carbon','-framework','AudioUnit','-framework','AudioToolbox','-framework','CoreAudio','-framework','OpenAL']+ARCH_FLAGS

View File

@ -10,7 +10,7 @@ BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}'
BF_PYTHON_BINARY = '${BF_PYTHON}/bin/python${BF_PYTHON_VERSION}'
BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION}' #BF_PYTHON+'/lib/python'+BF_PYTHON_VERSION+'/config/libpython'+BF_PYTHON_VERSION+'.a'
BF_PYTHON_LINKFLAGS = ['-Xlinker', '-export-dynamic']
BF_PYTHON_LIB_STATIC = '${BF_PYTHON}/lib/python2.5/config/libpython${BF_PYTHON_VERSION}.a'
BF_PYTHON_LIB_STATIC = '${BF_PYTHON}/lib/python${BF_PYTHON_VERSION}/config/libpython${BF_PYTHON_VERSION}.a'
WITH_BF_OPENAL = 'true'
WITH_BF_STATICOPENAL = 'true'

View File

@ -68,8 +68,10 @@ BF_PNG = '/usr'
BF_PNG_INC = '${BF_PNG}/include'
BF_PNG_LIB = 'png'
WITH_BF_TIFF = True
BF_TIFF = '/usr'
BF_TIFF_INC = '${BF_TIFF}/include'
BF_TIFF_LIB = 'tiff'
WITH_BF_ZLIB = True
BF_ZLIB = '/usr'
@ -166,7 +168,7 @@ BF_EXPAT_LIBPATH = '/usr/lib'
WITH_BF_OPENMP = True
#Ray trace optimization
WITH_BF_RAYOPTIMIZATION = False
WITH_BF_RAYOPTIMIZATION = True
BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse','-pthread']
##
@ -175,10 +177,13 @@ CXX = 'g++'
##ifeq ($CPU),alpha)
## CFLAGS += -pipe -fPIC -funsigned-char -fno-strict-aliasing -mieee
CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing']
CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64']
CPPFLAGS = []
CXXFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing']
CXXFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64']
if WITH_BF_FFMPEG:
# libavutil needs UINT64_C()
CXXFLAGS += ['-D__STDC_CONSTANT_MACROS', ]
REL_CFLAGS = ['-O2']
REL_CCFLAGS = ['-O2']
##BF_DEPEND = True

View File

@ -55,7 +55,7 @@ WITH_BF_OPENEXR = True
WITH_BF_STATICOPENEXR = False
BF_OPENEXR = LIBDIR + '/gcc/openexr'
BF_OPENEXR_INC = '${BF_OPENEXR}/include ${BF_OPENEXR}/include/OpenEXR'
BF_OPENEXR_LIB = ' Half IlmImf Iex '
BF_OPENEXR_LIB = ' Half IlmImf Iex IlmThread '
BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
# Warning, this static lib configuration is untested! users of this OS please confirm.
BF_OPENEXR_LIB_STATIC = '${BF_OPENEXR}/lib/libHalf.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_OPENEXR}/lib/libIex.a ${BF_OPENEXR}/lib/libImath.a ${BF_OPENEXR}/lib/libIlmThread.a'
@ -65,7 +65,7 @@ WITH_BF_DDS = True
WITH_BF_JPEG = True
BF_JPEG = LIBDIR + '/jpeg'
BF_JPEG_INC = '${BF_JPEG}/include'
BF_JPEG_LIB = 'jpeg'
BF_JPEG_LIB = 'libjpeg'
BF_JPEG_LIBPATH = '${BF_JPEG}/lib'
WITH_BF_PNG = True
@ -75,15 +75,15 @@ BF_PNG_LIB = 'png'
BF_PNG_LIBPATH = '${BF_PNG}/lib'
WITH_BF_TIFF = True
BF_TIFF = LIBDIR + '/tiff'
BF_TIFF = LIBDIR + '/gcc/tiff'
BF_TIFF_INC = '${BF_TIFF}/include'
BF_TIFF_LIB = 'libtiff'
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_LIB = 'libz'
BF_ZLIB_LIBPATH = '${BF_ZLIB}/lib'
WITH_BF_INTERNATIONAL = True
@ -151,11 +151,9 @@ 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' ]
BF_OPENGL_LIB_STATIC = [ '${BF_OPENGL}/lib/libGL.a', '${BF_OPENGL}/lib/libGLU.a']
WITH_BF_OPENMP = True
WITH_BF_OPENMP = False
BF_OPENMP = LIBDIR + '/gcc/gomp'
BF_OPENMP_INC = '${BF_OPENMP}/include'
BF_OPENMP_LIBPATH = '${BF_OPENMP}/lib'
@ -171,12 +169,9 @@ BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader Open
BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib ${BF_ICONV_LIBPATH}'
#Ray trace optimization
WITH_BF_RAYOPTIMIZATION = False
WITH_BF_RAYOPTIMIZATION = True
BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse']
CC = 'i586-mingw32msvc-gcc'
CXX = 'i586-mingw32msvc-g++'
CCFLAGS = [ '-pipe', '-funsigned-char', '-fno-strict-aliasing' ]
CPPFLAGS = ['-DWIN32', '-DFREE_WINDOWS']

View File

@ -54,7 +54,7 @@ WITH_BF_OPENEXR = True
WITH_BF_STATICOPENEXR = False
BF_OPENEXR = LIBDIR + '/gcc/openexr'
BF_OPENEXR_INC = '${BF_OPENEXR}/include ${BF_OPENEXR}/include/OpenEXR'
BF_OPENEXR_LIB = ' Half IlmImf Iex '
BF_OPENEXR_LIB = ' Half IlmImf Iex IlmThread '
BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
# Warning, this static lib configuration is untested! users of this OS please confirm.
BF_OPENEXR_LIB_STATIC = '${BF_OPENEXR}/lib/libHalf.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_OPENEXR}/lib/libIex.a ${BF_OPENEXR}/lib/libImath.a ${BF_OPENEXR}/lib/libIlmThread.a'
@ -64,7 +64,7 @@ WITH_BF_DDS = True
WITH_BF_JPEG = True
BF_JPEG = LIBDIR + '/jpeg'
BF_JPEG_INC = '${BF_JPEG}/include'
BF_JPEG_LIB = 'jpeg'
BF_JPEG_LIB = 'liblibjpeg'
BF_JPEG_LIBPATH = '${BF_JPEG}/lib'
WITH_BF_PNG = True
@ -73,14 +73,16 @@ BF_PNG_INC = '${BF_PNG}/include'
BF_PNG_LIB = 'png'
BF_PNG_LIBPATH = '${BF_PNG}/lib'
BF_TIFF = LIBDIR + '/tiff'
WITH_BF_TIFF = True
BF_TIFF = LIBDIR + '/gcc/tiff'
BF_TIFF_INC = '${BF_TIFF}/include'
BF_TIFF_LIB = 'libtiff'
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 = 'libz'
BF_ZLIB_LIBPATH = '${BF_ZLIB}/lib'
WITH_BF_INTERNATIONAL = True

View File

@ -79,6 +79,7 @@ BF_PNG_INC = '${BF_PNG}/include'
BF_PNG_LIB = 'libpng_st'
BF_PNG_LIBPATH = '${BF_PNG}/lib'
WITH_BF_TIFF = True
BF_TIFF = LIBDIR + '/tiff'
BF_TIFF_INC = '${BF_TIFF}/include'
BF_TIFF_LIB = 'libtiff'
@ -138,18 +139,18 @@ BF_FFTW3_LIBPATH = '${BF_FFTW3}/lib'
WITH_BF_REDCODE = False
BF_REDCODE_INC = '#extern'
WITH_BF_COLLADA = False
WITH_BF_COLLADA = True
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 xml2 pcre buffer ftoa'
BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser MathMLSolver xml2 pcre buffer ftoa'
BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib'
#Ray trace optimization
WITH_BF_RAYOPTIMIZATION = False
WITH_BF_RAYOPTIMIZATION = True
BF_RAYOPTIMIZATION_SSE_FLAGS = ['/arch:SSE']
WITH_BF_STATICOPENGL = False
@ -164,7 +165,6 @@ CC = 'cl.exe'
CXX = 'cl.exe'
CCFLAGS = ['/nologo', '/Ob1', '/J', '/W3', '/Gd', '/wd4244', '/wd4305', '/wd4800', '/wd4065', '/wd4267']
#CCFLAGS += ['/GL']
CXXFLAGS = ['/EHsc']
BGE_CXXFLAGS = ['/O2', '/EHsc', '/GR', '/fp:fast', '/arch:SSE']
@ -181,12 +181,15 @@ CXX_WARN = []
LLIBS = ['ws2_32', 'vfw32', 'winmm', 'kernel32', 'user32', 'gdi32', 'comdlg32', 'advapi32', 'shfolder', 'shell32', 'ole32', 'oleaut32', 'uuid']
PLATFORM_LINKFLAGS = ['/SUBSYSTEM:CONSOLE','/MACHINE:IX86','/INCREMENTAL:YES','/NODEFAULTLIB:"msvcprt.lib"','/NODEFAULTLIB:"msvcprtd.lib"','/NODEFAULTLIB:"glut32.lib"','/NODEFAULTLIB:"libc.lib"','/NODEFAULTLIB:"libcd.lib"','/NODEFAULTLIB:"libcpd.lib"','/NODEFAULTLIB:"libcp.lib"','/NODEFAULTLIB:"msvcrt.lib"', '/NODEFAULTLIB:"msvcrtd.lib"', '/NODEFAULTLIB:"msvcmrt.lib"', '/NODEFAULTLIB:"msvcurt.lib"', '/LARGEADDRESSAWARE']
#PLATFORM_LINKFLAGS += ['/LTCG']
PLATFORM_LINKFLAGS = ['/SUBSYSTEM:CONSOLE','/MACHINE:IX86','/INCREMENTAL:NO','/NODEFAULTLIB:"msvcprt.lib"','/NODEFAULTLIB:"msvcprtd.lib"','/NODEFAULTLIB:"glut32.lib"','/NODEFAULTLIB:"libc.lib"','/NODEFAULTLIB:"libcd.lib"','/NODEFAULTLIB:"libcpd.lib"','/NODEFAULTLIB:"libcp.lib"','/NODEFAULTLIB:"msvcrt.lib"', '/NODEFAULTLIB:"msvcrtd.lib"', '/NODEFAULTLIB:"msvcmrt.lib"', '/NODEFAULTLIB:"msvcurt.lib"', '/LARGEADDRESSAWARE']
# # Todo
# BF_PROFILE_CCFLAGS = ['-pg', '-g ']
# BF_PROFILE_LINKFLAGS = ['-pg']
# BF_PROFILE = False
#turn off makebsc by default ( as 64 bit version does ) .. takes ages to build .. for nothing ( well some M$ addicts may disagree )
BF_BSC=False
BF_BUILDDIR = '..\\build\\win32-vc'
BF_INSTALLDIR='..\\install\\win32-vc'

View File

@ -75,6 +75,7 @@ BF_PNG_INC = '${BF_PNG}/include'
BF_PNG_LIB = 'libpng'
BF_PNG_LIBPATH = '${BF_PNG}/lib'
WITH_BF_TIFF = True
BF_TIFF = LIBDIR + '/tiff'
BF_TIFF_INC = '${BF_TIFF}/include'
BF_TIFF_LIB = 'libtiff'
@ -151,18 +152,18 @@ BF_FFTW3_LIBPATH = '${BF_FFTW3}/lib'
WITH_BF_REDCODE = False
BF_REDCODE_INC = '#extern'
WITH_BF_COLLADA = False
WITH_BF_COLLADA = True
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 xml2 pcre'
BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser MathMLSolver xml2 pcre buffer ftoa'
BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib'
#Ray trace optimization
WITH_BF_RAYOPTIMIZATION = False
WITH_BF_RAYOPTIMIZATION = True
BF_RAYOPTIMIZATION_SSE_FLAGS = ['/arch:SSE','/arch:SSE2']
WITH_BF_STATICOPENGL = False

View File

@ -14,6 +14,7 @@ to kill any code duplication
"""
import os
import os.path
import string
import glob
@ -30,6 +31,8 @@ import SCons.Builder
import SCons.Tool
import bcolors
bc = bcolors.bcolors()
import btools
VERSION = btools.VERSION
Split = SCons.Util.Split
Action = SCons.Action.Action
@ -118,8 +121,9 @@ def setup_staticlibs(lenv):
]
libincs = []
if lenv['OURPLATFORM'] != 'linuxcross':
libincs.append('/usr/lib')
if lenv['WITH_BF_FFMPEG']:
libincs += Split(lenv['BF_FFMPEG_LIBPATH'])
libincs.extend([
lenv['BF_OPENGL_LIBPATH'],
@ -135,8 +139,6 @@ def setup_staticlibs(lenv):
libincs += Split(lenv['BF_PYTHON_LIBPATH'])
if lenv['WITH_BF_SDL']:
libincs += Split(lenv['BF_SDL_LIBPATH'])
if lenv['WITH_BF_FFMPEG']:
libincs += Split(lenv['BF_FFMPEG_LIBPATH'])
if lenv['WITH_BF_JACK']:
libincs += Split(lenv['BF_JACK_LIBPATH'])
if lenv['WITH_BF_SNDFILE']:
@ -145,6 +147,10 @@ def setup_staticlibs(lenv):
libincs += Split(lenv['BF_OPENEXR_LIBPATH'])
if lenv['WITH_BF_STATICOPENEXR']:
statlibs += Split(lenv['BF_OPENEXR_LIB_STATIC'])
if lenv['WITH_BF_LCMS']:
libincs += Split(lenv['BF_LCMS_LIBPATH'])
if lenv['WITH_BF_TIFF']:
libincs += Split(lenv['BF_TIFF_LIBPATH'])
if lenv['WITH_BF_FFTW3']:
libincs += Split(lenv['BF_FFTW3_LIBPATH'])
if lenv['WITH_BF_INTERNATIONAL']:
@ -161,7 +167,7 @@ def setup_staticlibs(lenv):
if lenv['WITH_BF_PYTHON'] and lenv['WITH_BF_STATICPYTHON']:
statlibs += Split(lenv['BF_PYTHON_LIB_STATIC'])
if lenv['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross'):
if lenv['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
libincs += Split(lenv['BF_PTHREADS_LIBPATH'])
if lenv['WITH_BF_COLLADA']:
@ -174,6 +180,9 @@ def setup_staticlibs(lenv):
if lenv['OURPLATFORM'] == 'linuxcross':
libincs += Split(lenv['BF_OPENMP_LIBPATH'])
# setting this last so any overriding of manually libs could be handled
if lenv['OURPLATFORM'] not in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'):
libincs.append('/usr/lib')
return statlibs, libincs
@ -188,12 +197,10 @@ def setup_syslibs(lenv):
syslibs += Split(lenv['BF_FREETYPE_LIB'])
if lenv['WITH_BF_PYTHON'] and not lenv['WITH_BF_STATICPYTHON']:
if not lenv['BF_NO_PYDEBUG'] and lenv['BF_DEBUG'] and lenv['OURPLATFORM'] in ('win32-vc'):
print "using debug py"
if lenv['BF_DEBUG'] and lenv['OURPLATFORM'] in ('win32-vc', 'win64-vc', 'win32-mingw'):
syslibs.append(lenv['BF_PYTHON_LIB']+'_d')
else:
print "not using debug py"
syslibs.append(lenv['BF_PYTHON_LIB'])
syslibs.append(lenv['BF_PYTHON_LIB'])
if lenv['WITH_BF_INTERNATIONAL']:
syslibs += Split(lenv['BF_GETTEXT_LIB'])
if lenv['WITH_BF_OPENAL']:
@ -209,6 +216,8 @@ def setup_syslibs(lenv):
if lenv['WITH_BF_OPENEXR']:
if not lenv['WITH_BF_STATICOPENEXR']:
syslibs += Split(lenv['BF_OPENEXR_LIB'])
if lenv['WITH_BF_TIFF']:
syslibs += Split(lenv['BF_TIFF_LIB'])
if lenv['WITH_BF_FFMPEG']:
syslibs += Split(lenv['BF_FFMPEG_LIB'])
if lenv['WITH_BF_OGG']:
@ -223,7 +232,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'):
if lenv['OURPLATFORM'] in ('win32-vc', 'win32-mingw','linuxcross', 'win64-vc'):
syslibs += Split(lenv['BF_PTHREADS_LIB'])
if lenv['WITH_BF_LCMS']:
syslibs.append(lenv['BF_LCMS_LIB'])
@ -353,7 +362,11 @@ class CompZipFile(zipfile.ZipFile):
"""Partial copy of python2.6's zipfile.ZipFile (see http://www.python.org)
to get a extractall() that works on py2.5 and probably earlier distributions."""
def __init__(self, file, mode="r", compression=zipfile.ZIP_STORED, allowZip64=False):
zipfile.ZipFile.__init__(self, file, mode, compression, allowZip64)
if sys.version_info < (2, 6):
zipfile.ZipFile.__init__(self, file, mode, compression)
else:
zipfile.ZipFile.__init__(self, file, mode, compression, allowZip64)
if not hasattr(self,"extractall"): # use our method
print "Debug: Using comp_extractall!"
self.extractall= self.comp_extractall
@ -455,7 +468,7 @@ def WinPyBundle(target=None, source=None, env=None):
py_target = env.subst( env['BF_INSTALLDIR'] )
if py_target[0]=='#':
py_target=py_target[1:]
py_target+= '/.blender/python/lib/'
py_target = os.path.join(py_target, VERSION, 'python', 'lib')
def printexception(func,path,ex):
if os.path.exists(path): #do not report if path does not exist. eg on a fresh build.
print str(func) + ' failed on ' + str(path)
@ -485,7 +498,9 @@ def AppIt(target=None, source=None, env=None):
builddir, b = os.path.split(a)
libdir = env['LCGDIR'][1:]
osxarch = env['MACOSX_ARCHITECTURE']
installdir = env['BF_INSTALLDIR']
print("compiled architecture: %s"%(osxarch))
print("Installing to %s"%(installdir))
if libdir == '../lib/darwin-9.x.universal':
python_zip = 'python_' + osxarch + '.zip' # set specific python_arch.zip
else:
@ -500,45 +515,45 @@ def AppIt(target=None, source=None, env=None):
sourcedir = bldroot + '/source/darwin/%s.app'%binary
sourceinfo = bldroot + "/source/darwin/%s.app/Contents/Info.plist"%binary
targetinfo = builddir +'/' + "%s.app/Contents/Info.plist"%binary
cmd = builddir + '/' +'%s.app'%binary
targetinfo = installdir +'/' + "%s.app/Contents/Info.plist"%binary
cmd = installdir + '/' +'%s.app'%binary
if os.path.isdir(cmd):
shutil.rmtree(cmd)
shutil.copytree(sourcedir, cmd)
cmd = "cat %s | sed s/VERSION/`cat release/VERSION`/ | sed s/DATE/`date +'%%Y-%%b-%%d'`/ > %s"%(sourceinfo,targetinfo)
commands.getoutput(cmd)
cmd = 'cp %s/%s %s/%s.app/Contents/MacOS/%s'%(builddir, binary,builddir, binary, binary)
cmd = 'cp %s/%s %s/%s.app/Contents/MacOS/%s'%(builddir, binary,installdir, binary, binary)
commands.getoutput(cmd)
cmd = 'mkdir %s/%s.app/Contents/MacOS/.blender/'%(builddir, binary)
cmd = 'mkdir %s/%s.app/Contents/MacOS/%s/'%(installdir, binary, VERSION)
# print cmd
commands.getoutput(cmd)
cmd = builddir + '/%s.app/Contents/MacOS/.blender'%binary
cmd = installdir + '/%s.app/Contents/MacOS/%s'%(binary,VERSION)
shutil.copy(bldroot + '/bin/.blender/.bfont.ttf', cmd)
shutil.copy(bldroot + '/bin/.blender/.Blanguages', cmd)
cmd = 'cp -R %s/bin/.blender/locale %s/%s.app/Contents/Resources/'%(bldroot,builddir,binary)
cmd = 'cp -R %s/bin/%s/locale %s/%s.app/Contents/Resources/'%(bldroot,VERSION,installdir,binary)
commands.getoutput(cmd)
cmd = 'cp -R %s/bin/%s/locale %s/%s.app/Contents/MacOS/%s/'%(bldroot,VERSION,installdir,binary,VERSION)
commands.getoutput(cmd)
cmd = 'cp %s/bin/%s/.Blanguages %s/%s.app/Contents/Resources/'%(bldroot,VERSION,installdir,binary)
commands.getoutput(cmd)
cmd = 'mkdir %s/%s.app/Contents/MacOS/%s/python/'%(installdir,binary, VERSION)
commands.getoutput(cmd)
cmd = 'unzip -q %s/release/%s -d %s/%s.app/Contents/MacOS/%s/python/'%(libdir,python_zip,installdir,binary,VERSION)
commands.getoutput(cmd)
cmd = 'cp -R %s/bin/.blender/locale %s/%s.app/Contents/MacOS/.blender/'%(bldroot,builddir,binary)
commands.getoutput(cmd)
cmd = 'cp %s/bin/.blender/.Blanguages %s/%s.app/Contents/Resources/'%(bldroot,builddir,binary)
commands.getoutput(cmd)
cmd = 'mkdir %s/%s.app/Contents/MacOS/.blender/python/'%(builddir,binary)
commands.getoutput(cmd)
cmd = 'unzip -q %s/release/%s -d %s/%s.app/Contents/MacOS/.blender/python/'%(libdir,python_zip,builddir,binary)
commands.getoutput(cmd)
cmd = 'cp -R %s/release/scripts %s/%s.app/Contents/MacOS/.blender/'%(bldroot,builddir,binary)
cmd = 'cp -R %s/release/scripts %s/%s.app/Contents/MacOS/%s/'%(bldroot,installdir,binary,VERSION)
commands.getoutput(cmd)
cmd = 'cp -R %s/release/ui %s/%s.app/Contents/MacOS/.blender/'%(bldroot,builddir,binary)
cmd = 'cp -R %s/release/ui %s/%s.app/Contents/MacOS/%s/'%(bldroot,installdir,binary,VERSION)
commands.getoutput(cmd)
cmd = 'cp -R %s/release/io %s/%s.app/Contents/MacOS/.blender/'%(bldroot,builddir,binary)
cmd = 'cp -R %s/release/io %s/%s.app/Contents/MacOS/%s/'%(bldroot,installdir,binary,VERSION)
commands.getoutput(cmd)
cmd = 'chmod +x %s/%s.app/Contents/MacOS/%s'%(builddir,binary, binary)
cmd = 'chmod +x %s/%s.app/Contents/MacOS/%s'%(installdir,binary, binary)
commands.getoutput(cmd)
cmd = 'find %s/%s.app -name .svn -prune -exec rm -rf {} \;'%(builddir, binary)
cmd = 'find %s/%s.app -name .svn -prune -exec rm -rf {} \;'%(installdir, binary)
commands.getoutput(cmd)
cmd = 'find %s/%s.app -name .DS_Store -exec rm -rf {} \;'%(builddir, binary)
cmd = 'find %s/%s.app -name .DS_Store -exec rm -rf {} \;'%(installdir, binary)
commands.getoutput(cmd)
cmd = 'find %s/%s.app -name __MACOSX -exec rm -rf {} \;'%(builddir, binary)
cmd = 'find %s/%s.app -name __MACOSX -exec rm -rf {} \;'%(installdir, binary)
commands.getoutput(cmd)
# extract copy system python, be sure to update other build systems
@ -548,7 +563,7 @@ def my_unixpybundle_print(target, source, env):
def UnixPyBundle(target=None, source=None, env=None):
# Any Unix except osx
#-- .blender/python/lib/python3.1
#-- VERSION/python/lib/python3.1
import commands
@ -557,7 +572,7 @@ def UnixPyBundle(target=None, source=None, env=None):
commands.getoutput(cmd)
if env['WITH_BF_FHS']: dir = os.path.join(env['BF_INSTALLDIR'], 'share', 'blender', env['BF_VERSION']) # BLENDERPATH
else: dir = os.path.join(env['BF_INSTALLDIR'], '.blender')
else: dir = os.path.join(env['BF_INSTALLDIR'], VERSION)
py_src = env.subst( env['BF_PYTHON_LIBPATH'] + '/python'+env['BF_PYTHON_VERSION'] )
py_target = env.subst( dir + '/python/lib/python'+env['BF_PYTHON_VERSION'] )
@ -624,7 +639,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'):
if self['OURPLATFORM'] not in ('win32-vc','win32-mingw','linuxcross', 'win64-vc'):
print bc.FAIL+'BlenderRes is for windows only!'+bc.END
self.Exit()
@ -715,7 +730,7 @@ class BlenderEnvironment(SConsEnvironment):
global vcp
print bc.HEADER+'Configuring program '+bc.ENDC+bc.OKGREEN+progname+bc.ENDC
lenv = self.Clone()
if lenv['OURPLATFORM'] in ['win32-vc', 'cygwin']:
if lenv['OURPLATFORM'] in ('win32-vc', 'cygwin', 'win64-vc'):
lenv.Append(LINKFLAGS = lenv['PLATFORM_LINKFLAGS'])
lenv.Append(LINKFLAGS = ['/FORCE:MULTIPLE'])
if lenv['BF_DEBUG']:
@ -746,11 +761,7 @@ class BlenderEnvironment(SConsEnvironment):
lenv.Append(LIBS = lenv['BF_QUICKTIME_LIB'])
lenv.Append(LIBPATH = lenv['BF_QUICKTIME_LIBPATH'])
prog = lenv.Program(target=builddir+'bin/'+progname, source=sources)
#needed for incremental linking
if lenv['OURPLATFORM'] == 'win32-vc': prog = lenv.Precious(prog)
if lenv['BF_DEBUG'] and lenv['OURPLATFORM']=='win32-vc' and lenv['BF_BSC']:
if lenv['BF_DEBUG'] and lenv['OURPLATFORM'] in ('win32-vc', 'win64-vc') and lenv['BF_BSC']:
f = lenv.File(progname + '.bsc', builddir)
brs = lenv.Command(f, prog, [bsc])
SConsEnvironment.Default(self, brs)

View File

@ -1,4 +1,3 @@
import os
import os.path
import SCons.Options
@ -16,6 +15,8 @@ import sys
Variables = SCons.Variables
BoolVariable = SCons.Variables.BoolVariable
VERSION = '2.52' # This is used in creating the local config directories
def print_arguments(args, bc):
if len(args):
for k,v in args.iteritems():
@ -27,7 +28,7 @@ def print_arguments(args, bc):
def validate_arguments(args, bc):
opts_list = [
'WITH_BF_PYTHON', 'BF_PYTHON', 'BF_NO_PYDEBUG', 'BF_PYTHON_VERSION', 'BF_PYTHON_INC', 'BF_PYTHON_BINARY', 'BF_PYTHON_LIB', 'BF_PYTHON_LIBPATH', 'WITH_BF_STATICPYTHON', 'BF_PYTHON_LIB_STATIC', 'BF_PYTHON_DLL',
'WITH_BF_PYTHON', 'BF_PYTHON', 'BF_PYTHON_VERSION', 'BF_PYTHON_INC', 'BF_PYTHON_BINARY', 'BF_PYTHON_LIB', 'BF_PYTHON_LIBPATH', 'WITH_BF_STATICPYTHON', 'BF_PYTHON_LIB_STATIC', 'BF_PYTHON_DLL',
'WITH_BF_OPENAL', 'BF_OPENAL', 'BF_OPENAL_INC', 'BF_OPENAL_LIB', 'BF_OPENAL_LIBPATH', 'WITH_BF_STATICOPENAL', 'BF_OPENAL_LIB_STATIC',
'WITH_BF_SDL', 'BF_SDL', 'BF_SDL_INC', 'BF_SDL_LIB', 'BF_SDL_LIBPATH',
'BF_LIBSAMPLERATE', 'BF_LIBSAMPLERATE_INC', 'BF_LIBSAMPLERATE_LIB', 'BF_LIBSAMPLERATE_LIBPATH',
@ -42,7 +43,7 @@ def validate_arguments(args, bc):
'WITH_BF_OPENJPEG', 'BF_OPENJPEG', 'BF_OPENJPEG_INC', 'BF_OPENJPEG_LIB', 'BF_OPENJPEG_LIBPATH',
'WITH_BF_REDCODE', 'BF_REDCODE', 'BF_REDCODE_INC', 'BF_REDCODE_LIB', 'BF_REDCODE_LIBPATH',
'WITH_BF_PNG', 'BF_PNG', 'BF_PNG_INC', 'BF_PNG_LIB', 'BF_PNG_LIBPATH',
'BF_TIFF', 'BF_TIFF_INC', 'BF_TIFF_LIB', 'BF_TIFF_LIBPATH',
'WITH_BF_TIFF', 'BF_TIFF', 'BF_TIFF_INC', 'BF_TIFF_LIB', 'BF_TIFF_LIBPATH',
'WITH_BF_ZLIB', 'BF_ZLIB', 'BF_ZLIB_INC', 'BF_ZLIB_LIB', 'BF_ZLIB_LIBPATH',
'WITH_BF_INTERNATIONAL',
'BF_GETTEXT', 'BF_GETTEXT_INC', 'BF_GETTEXT_LIB', 'BF_GETTEXT_LIBPATH',
@ -73,7 +74,7 @@ def validate_arguments(args, bc):
'BF_FANCY', 'BF_QUIET', 'BF_LINE_OVERWRITE',
'BF_X264_CONFIG',
'BF_XVIDCORE_CONFIG',
'WITH_BF_LCMS', 'BF_LCMS_LIB',
'WITH_BF_LCMS', 'BF_LCMS', 'BF_LCMS_INC', 'BF_LCMS_LIB', 'BF_LCMS_LIBPATH',
'WITH_BF_DOCS',
'BF_NUMJOBS',
'BF_MSVS',
@ -82,12 +83,13 @@ def validate_arguments(args, bc):
'BF_GHOST_DEBUG',
'WITH_BF_RAYOPTIMIZATION',
'BF_RAYOPTIMIZATION_SSE_FLAGS',
'BF_NO_ELBEEM'
'BF_NO_ELBEEM',
'BF_VCREDIST' # Windows-only, and useful only when creating installer
]
# Have options here that scons expects to be lists
opts_list_split = [
'BF_PYTHON_LINKFLAGS', 'BF_NO_PYDEBUG',
'BF_PYTHON_LINKFLAGS',
'BF_OPENGL_LINKFLAGS',
'CFLAGS', 'CCFLAGS', 'CXXFLAGS', 'CPPFLAGS',
'REL_CFLAGS', 'REL_CCFLAGS', 'REL_CXXFLAGS',
@ -160,7 +162,7 @@ def SetupSpawn( env ):
env['SPAWN'] = buf.ourspawn
def read_opts(cfg, args):
def read_opts(env, cfg, args):
localopts = Variables.Variables(cfg, args)
localopts.AddVariables(
('LCGDIR', 'location of cvs lib dir'),
@ -174,7 +176,6 @@ def read_opts(cfg, args):
('BF_PYTHON_LIB_STATIC', 'Python static libraries', ''),
('BF_PYTHON_LIBPATH', 'Library path', ''),
('BF_PYTHON_LINKFLAGS', 'Python link flags', ''),
(BoolVariable('BF_NO_PYDEBUG', 'Don\'t Use Python Debug Lib', False)),
(BoolVariable('WITH_BF_STATICPYTHON', 'Staticly link to python', False)),
(BoolVariable('BF_NO_ELBEEM', 'Disable Fluid Sim', False)),
@ -262,11 +263,18 @@ def read_opts(cfg, args):
('BF_PNG_LIB', 'PNG library', ''),
('BF_PNG_LIBPATH', 'PNG library path', ''),
(BoolVariable('WITH_BF_TIFF', 'Use TIFF if true', True)),
('BF_TIFF', 'TIFF base path', ''),
('BF_TIFF_INC', 'TIFF include path', ''),
('BF_TIFF_LIB', 'TIFF library', ''),
('BF_TIFF_LIBPATH', 'TIFF library path', ''),
(BoolVariable('WITH_BF_LCMS', 'Enable color correction with lcms', False)),
('BF_LCMS', 'LCMS base path', ''),
('BF_LCMS_INC', 'LCMS include path', ''),
('BF_LCMS_LIB', 'LCMS library', ''),
('BF_LCMS_LIBPATH', 'LCMS library path', ''),
(BoolVariable('WITH_BF_ZLIB', 'Use ZLib if true', True)),
('BF_ZLIB', 'ZLib base path', ''),
('BF_ZLIB_INC', 'ZLib include path', ''),
@ -400,8 +408,8 @@ def read_opts(cfg, args):
('BF_BUILDDIR', 'Build dir', ''),
('BF_INSTALLDIR', 'Installation dir', ''),
('CC', 'C compiler to use', ''),
('CXX', 'C++ compiler to use', ''),
('CC', 'C compiler to use', env['CC']),
('CXX', 'C++ compiler to use', env['CXX']),
(BoolVariable('BF_BUILDINFO', 'Buildtime in splash if true', True)),
@ -418,9 +426,6 @@ def read_opts(cfg, args):
(BoolVariable('WITH_BF_LZO', 'Enable fast LZO pointcache compression', True)),
(BoolVariable('WITH_BF_LZMA', 'Enable best LZMA pointcache compression', True)),
(BoolVariable('WITH_BF_LCMS', 'Enable color correction with lcms', False)),
('BF_LCMS_LIB', 'LCMSlibrary', 'lcms'),
('BF_X264_CONFIG', 'configuration flags for x264', ''),
('BF_XVIDCORE_CONFIG', 'configuration flags for xvidcore', ''),
(BoolVariable('WITH_BF_DOCS', 'Generate API documentation', False)),
@ -437,36 +442,60 @@ def read_opts(cfg, args):
(BoolVariable('BF_GHOST_DEBUG', 'Make GHOST print events and info to stdout. (very verbose)', False)),
(BoolVariable('WITH_BF_RAYOPTIMIZATION', 'Enable raytracer SSE/SIMD optimization.', False)),
('BF_RAYOPTIMIZATION_SSE_FLAGS', 'SSE flags', '')
('BF_RAYOPTIMIZATION_SSE_FLAGS', 'SSE flags', ''),
('BF_VCREDIST', 'Full path to vcredist', '')
) # end of opts.AddOptions()
return localopts
def NSIS_print(target, source, env):
return "Creating NSIS installer for Blender 3D"
return "Creating NSIS installer for Blender"
def NSIS_Installer(target=None, source=None, env=None):
print "="*35
if env['OURPLATFORM'] != 'win32-vc' and env['OURPLATFORM'] != 'win32-mingw':
if env['OURPLATFORM'] not in ('win32-vc', 'win32-mingw', 'win64-vc'):
print "NSIS installer is only available on Windows."
Exit()
start_dir = os.getcwd()
rel_dir = start_dir + "\\release\\windows\\installer\\"
install_base_dir = start_dir + "\\"
if not os.path.exists(install_base_dir+env['BF_INSTALLDIR']+'/plugins/include'):
os.mkdir(install_base_dir+env['BF_INSTALLDIR']+'/plugins/include')
for f in glob.glob('source/blender/blenpluginapi/*.h'):
shutil.copy(f,install_base_dir+env['BF_INSTALLDIR']+'/plugins/include')
if env['OURPLATFORM'] == 'win32-vc':
bitness = '32'
elif env['OURPLATFORM'] == 'win64-vc':
bitness = '64'
else:
bitness = '-mingw'
shutil.copy('source/blender/blenpluginapi/plugin.def',install_base_dir+env['BF_INSTALLDIR']+'/plugins/include/')
start_dir = os.getcwd()
rel_dir = os.path.join(start_dir,'release','windows','installer')
install_base_dir = start_dir + os.sep
bf_installdir = os.path.join(os.getcwd(),env['BF_INSTALLDIR'])
bf_installdir = os.path.normpath(bf_installdir)
doneroot = False
rootdirconts = []
datafiles = ''
l = len(bf_installdir)
for dp,dn,df in os.walk(bf_installdir):
if not doneroot:
for f in df:
rootdirconts.append(os.path.join(dp,f))
doneroot = True
else:
if len(df)>0:
dp_tmp = dp[l:]
if dp_tmp.find('python\\lib') > -1:
datafiles += "\n" +r'SetOutPath $INSTDIR'+dp[l:]+"\n\n"
else:
datafiles += "\n"+r'SetOutPath $BLENDERHOME'+dp[l:]+"\n\n"
for f in df:
outfile = os.path.join(dp,f)
datafiles += ' File '+outfile + "\n"
os.chdir("release")
v = open("VERSION")
version = v.read()[:-1]
shortver = version.split('.')[0] + version.split('.')[1]
v.close()
#### change to suit install dir ####
@ -476,149 +505,50 @@ def NSIS_Installer(target=None, source=None, env=None):
ns = open("00.sconsblender.nsi","r")
ns_cnt = str(ns.read())
ns.close()
# set Python version we compile against
ns_cnt = string.replace(ns_cnt, "[PYTHON_VERSION]", env['BF_PYTHON_VERSION'])
# var replacements
ns_cnt = string.replace(ns_cnt, "[DISTDIR]", os.path.normpath(inst_dir+os.sep))
ns_cnt = string.replace(ns_cnt, "[VERSION]", version)
ns_cnt = string.replace(ns_cnt, "[SHORTVERSION]", VERSION)
ns_cnt = string.replace(ns_cnt, "[RELDIR]", os.path.normpath(rel_dir))
ns_cnt = string.replace(ns_cnt, "[BITNESS]", bitness)
# do root
rootlist = []
rootdir = os.listdir(inst_dir+"\\")
for rootitem in rootdir:
if os.path.isdir(inst_dir+"\\"+ rootitem) == 0:
rootlist.append("File \"" + os.path.normpath(inst_dir) + "\\" + rootitem+"\"")
for rootitem in rootdirconts:
rootlist.append("File \"" + rootitem + "\"")
rootstring = string.join(rootlist, "\n ")
rootstring = rootstring
rootstring += "\n\n"
ns_cnt = string.replace(ns_cnt, "[ROOTDIRCONTS]", rootstring)
# do delete items
delrootlist = []
for rootitem in rootdir:
if os.path.isdir(inst_dir + rootitem) == 0:
delrootlist.append("Delete $INSTDIR\\" + rootitem)
for rootitem in rootdirconts:
delrootlist.append("Delete $INSTDIR\\" + rootitem[l+1:])
delrootstring = string.join(delrootlist, "\n ")
delrootstring += "\n"
ns_cnt = string.replace(ns_cnt, "[DELROOTDIRCONTS]", delrootstring)
# do scripts
scriptlist = []
scriptpath = "%s%s" % (inst_dir, "\\.blender\\scripts")
scriptdir = os.listdir(scriptpath)
for scriptitem in scriptdir:
scriptfile = "%s\\%s" % (scriptpath, scriptitem)
if os.path.isdir(scriptfile) == 0:
scriptfile = os.path.normpath(scriptfile)
scriptlist.append("File \"%s\"" % scriptfile)
scriptstring = string.join(scriptlist, "\n ")
scriptstring += "\n\n"
ns_cnt = string.replace(ns_cnt, "[SCRIPTCONTS]", scriptstring)
ns_cnt = string.replace(ns_cnt, "[DODATAFILES]", datafiles)
# do scripts\bpymodules
bpymodlist = []
bpymodpath = "%s%s" % (inst_dir, "\\.blender\\scripts\\bpymodules")
bpymoddir = os.listdir(bpymodpath)
for bpymoditem in bpymoddir:
bpymodfile = "%s\\%s" % (bpymodpath, bpymoditem)
if os.path.isdir(bpymodfile) == 0:
bpymodfile = os.path.normpath(bpymodfile)
bpymodlist.append("File \"%s\"" % bpymodfile)
bpymodstring = string.join(bpymodlist, "\n ")
bpymodstring += "\n\n"
ns_cnt = string.replace(ns_cnt, "[SCRIPTMODCONTS]", bpymodstring)
# do scripts\bpymodules\colladaimex
colladalist = []
bpymodpath = "%s%s" % (inst_dir, "\\.blender\\scripts\\bpymodules\\ColladaImEx")
bpymoddir = os.listdir(bpymodpath)
for bpymoditem in bpymoddir:
bpymodfile = "%s\\%s" % (bpymodpath, bpymoditem)
if os.path.isdir(bpymodfile) == 0:
bpymodfile=os.path.normpath(bpymodfile)
colladalist.append("File \"%s\"" % bpymodfile)
bpymodstring = string.join(colladalist, "\n ")
bpymodstring += "\n\n"
ns_cnt = string.replace(ns_cnt, "[SCRIPTMODCOLLADACONT]", bpymodstring)
# do scripts\bpydata
bpydatalist = []
bpydatapath = "%s%s" % (inst_dir, "\\.blender\\scripts\\bpydata")
bpydatadir = os.listdir(bpydatapath)
for bpydataitem in bpydatadir:
bpydatafile = "%s\\%s" % (bpydatapath, bpydataitem)
if os.path.isdir(bpydatafile) == 0:
bpydatalist.append("File \"%s\"" % bpydatafile)
bpydatastring = string.join(bpydatalist, "\n ")
bpydatastring += "\n\n"
ns_cnt = string.replace(ns_cnt, "[SCRIPTDATACONTS]", bpydatastring)
# do plugins\include
plugincludelist = []
plugincludepath = "%s%s" % (inst_dir, "\\plugins\\include")
plugincludedir = os.listdir(plugincludepath)
for plugincludeitem in plugincludedir:
plugincludefile = "%s\\%s" % (plugincludepath, plugincludeitem)
if os.path.isdir(plugincludefile) == 0:
if plugincludefile.find('.h') or plugincludefile.find('.DEF'):
plugincludefile = os.path.normpath(plugincludefile)
plugincludelist.append("File \"%s\"" % plugincludefile)
plugincludestring = string.join(plugincludelist, "\n ")
plugincludestring += "\n\n"
ns_cnt = string.replace(ns_cnt, "[PLUGINCONTS]", plugincludestring)
# do scripts\bpydata\config
cfglist = []
cfgpath = "%s%s" % (inst_dir, "\\.blender\\scripts\\bpydata\\config")
cfgdir = os.listdir(cfgpath)
for cfgitem in cfgdir:
cfgfile = "%s\\%s" % (cfgpath, cfgitem)
if os.path.isdir(cfgfile) == 0:
cfglist.append("File \"%s\"" % cfgfile)
cfgstring = string.join(cfglist, "\n ")
cfgstring += "\n\n"
ns_cnt = string.replace(ns_cnt, "[SCRIPTDATACFGCONTS]", cfgstring)
# do dotblender
dotblendlist = []
dotblenddir = os.listdir(inst_dir+"\\.blender")
for dotblenditem in dotblenddir:
if os.path.isdir(inst_dir + "\\.blender\\" + dotblenditem) == 0:
dotblendlist.append("File \"" + os.path.normpath(inst_dir) + "\\.blender\\" +
dotblenditem+"\"")
dotblendstring = string.join(dotblendlist, "\n ")
dotblendstring += "\n\n"
ns_cnt = string.replace(ns_cnt, "[DOTBLENDERCONTS]", dotblendstring)
# do language files
langlist = []
langfiles = []
langdir = os.listdir(inst_dir + "\\.blender\\locale")
for langitem in langdir:
if os.path.isdir(inst_dir + "\\.blender\\locale\\" + langitem) == 1:
langfiles.append("SetOutPath $BLENDERHOME\\.blender\\locale\\" + langitem + "\\LC_MESSAGES")
langfiles.append("File \"" + os.path.normpath(inst_dir) + "\\.blender\\locale\\"
+ langitem + "\\LC_MESSAGES\\blender.mo\"")
langstring = string.join(langfiles, "\n ")
langstring += "\n\n"
ns_cnt = string.replace(ns_cnt, "[LANGUAGECONTS]", langstring)
# var replacements
ns_cnt = string.replace(ns_cnt, "DISTDIR", os.path.normpath(inst_dir+"\\"))
ns_cnt = string.replace(ns_cnt, "SHORTVER", shortver)
ns_cnt = string.replace(ns_cnt, "VERSION", version)
ns_cnt = string.replace(ns_cnt, "RELDIR", os.path.normpath(rel_dir))
# Setup vcredist part
vcredist = "File \""+env['BF_VCREDIST'] + "\"\n"
vcredist += " ExecWait '\"$TEMP\\" + os.path.basename(env['BF_VCREDIST']) + "\" /q'\n"
vcredist += " Delete \"$TEMP\\" + os.path.basename(env['BF_VCREDIST'])+"\""
ns_cnt = string.replace(ns_cnt, "[VCREDIST]", vcredist)
tmpnsi = os.path.normpath(install_base_dir+os.sep+env['BF_BUILDDIR']+os.sep+"00.blender_tmp.nsi")
new_nsis = open(tmpnsi, 'w')
new_nsis.write(ns_cnt)
new_nsis.close()
print "Preparing nsis file looks ok\n"
print "NSIS Installer script created"
os.chdir(start_dir)
print "try to launch 'makensis' ...make sure it is on the path \n"
print "Launching 'makensis'"
cmdline = "makensis " + "\""+tmpnsi+"\""

View File

@ -50,6 +50,7 @@ prefixes = SCons.Util.Split("""
i486-mingw32msvc-
i586-mingw32msvc-
i686-mingw32msvc-
i686-pc-mingw32-
""")
def find(env):

View File

View File

@ -132,9 +132,9 @@ $Id$
The commandline can be used to override detected/default settings, e.g:
On Unix:
cmake -D PYTHON_LIB=/usr/local/lib/python2.3/config/libpython2.3.so -D PYTHON_INC=/usr/local/include/python2.3 -D PYTHON_BINARY=/usr/local/bin/python2.3 -G "Unix Makefiles" ../blender
cmake -D PYTHON_LIB=/usr/local/lib/python3.1/config/libpython3.1.so -D PYTHON_INC=/usr/local/include/python3.1 -G "Unix Makefiles" ../blender
On Macs:
cmake -D PYTHON_INC=/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -D PYTHON_LIBPATH=/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/config -D PYTHON_BINARY=/System/Library/Frameworks/Python.framework/Versions/2.5/bin/python2.5 -G Xcode ../blender
cmake -D PYTHON_INC=/System/Library/Frameworks/Python.framework/Versions/3.1/include/python3.1 -G Xcode ../blender
Mote that this should only be needed once per build directory generation because it will keep the overrides in CMakeCache.txt for subsequent runs.

338
doc/blender.1 Normal file
View File

@ -0,0 +1,338 @@
.TH "BLENDER" "1" "June 27, 2010" "Blender Blender 2\&.52 (sub 5) "
.SH NAME
blender \- a 3D modelling and rendering package
.SH SYNOPSIS
.B blender [args ...] [file] [args ...]
.br
.SH DESCRIPTION
.PP
.B blender
is a 3D modelling and rendering package. It is the in-house software of a high quality animation studio, Blender has proven to be an extremely fast and versatile design instrument. The software has a personal touch, offering a unique approach to the world of Three Dimensions.
Use Blender to create TV commercials, to make technical visualizations, business graphics, to do some morphing, or design user interfaces. You can easy build and manage complex environments. The renderer is versatile and extremely fast. All basic animation principles (curves & keys) are well implemented.
http://www.blender.org
.SH OPTIONS
Blender 2.52 (sub 5) Build
Usage: blender [args ...] [file] [args ...]
.br
.SS "Render Options:"
.TP
.B \-b or \-\-background <file>
.br
Load <file> in background (often used for UI\-less rendering)
.br
.TP
.B \-a or \-\-render\-anim
.br
Render frames from start to end (inclusive)
.br
.TP
.B \-S or \-\-scene <name>
.br
Set the active scene <name> for rendering
.br
.TP
.B \-f or \-\-render\-frame <frame>
.br
Render frame <frame> and save it.
.br
+<frame> start frame relative, \-<frame> end frame relative.
.br
.TP
.B \-s or \-\-frame\-start <frame>
.br
Set start to frame <frame> (use before the \-a argument)
.br
.TP
.B \-e or \-\-frame\-end <frame>
.br
Set end to frame <frame> (use before the \-a argument)
.br
.TP
.B \-j or \-\-frame\-jump <frames>
.br
Set number of frames to step forward after each rendered frame
.br
.TP
.B \-o or \-\-render\-output <path>
.br
Set the render path and file name.
.br
Use // at the start of the path to
.br
render relative to the blend file.
.br
The # characters are replaced by the frame number, and used to define zero padding.
.br
ani_##_test.png becomes ani_01_test.png
.br
test\-######.png becomes test\-000001.png
.br
When the filename does not contain #, The suffix #### is added to the filename
.br
The frame number will be added at the end of the filename.
.br
eg: blender \-b foobar.blend \-o //render_ \-F PNG \-x 1 \-a
.br
//render_ becomes //render_####, writing frames as //render_0001.png//
.br
.TP
.B \-E or \-\-engine <engine>
.br
Specify the render engine
.br
use \-E help to list available engines
.br
.IP
.SS "Format Options:"
.TP
.B \-F or \-\-render\-format <format>
.br
Set the render format, Valid options are...
.br
TGA IRIS JPEG MOVIE IRIZ RAWTGA
.br
AVIRAW AVIJPEG PNG BMP FRAMESERVER
.br
(formats that can be compiled into blender, not available on all systems)
.br
HDR TIFF EXR MULTILAYER MPEG AVICODEC QUICKTIME CINEON DPX DDS
.br
.TP
.B \-x or \-\-use\-extension <bool>
.br
Set option to add the file extension to the end of the file
.br
.TP
.B \-t or \-\-threads <threads>
.br
Use amount of <threads> for rendering in background
.br
[1\-BLENDER_MAX_THREADS], 0 for systems processor count.
.br
.IP
.SS "Animation Playback Options:"
.TP
.B \-a <options> <file(s)>
.br
Playback <file(s)>, only operates this way when not running in background.
.br
\-p <sx> <sy> Open with lower left corner at <sx>, <sy>
.br
\-m Read from disk (Don't buffer)
.br
\-f <fps> <fps\-base> Specify FPS to start with
.br
\-j <frame> Set frame step to <frame>
.br
.IP
.SS "Window Options:"
.TP
.B \-w or \-\-window\-border
.br
Force opening with borders (default)
.br
.TP
.B \-W or \-\-window\-borderless
.br
Force opening with without borders
.br
.TP
.B \-p or \-\-window\-geometry <sx> <sy> <w> <h>
.br
Open with lower left corner at <sx>, <sy> and width and height as <w>, <h>
.br
.IP
.SS "Game Engine Specific Options:"
.TP
.B \-g Game Engine specific options
.br
\-g fixedtime Run on 50 hertz without dropping frames
.br
\-g vertexarrays Use Vertex Arrays for rendering (usually faster)
.br
\-g nomipmap No Texture Mipmapping
.br
\-g linearmipmap Linear Texture Mipmapping instead of Nearest (default)
.br
.IP
.SS "Misc Options:"
.TP
.B \-d or \-\-debug
.br
Turn debugging on
.br
.IP
* Prints every operator call and their arguments
.br
* Disables mouse grab (to interact with a debugger in some cases)
.br
* Keeps python sys.stdin rather then setting it to None
.br
.TP
.B \-\-debug\-fpe
.br
Enable floating point exceptions
.br
.IP
.TP
.B \-nojoystick
.br
Disable joystick support
.br
.TP
.B \-noglsl
.br
Disable GLSL shading
.br
.TP
.B \-noaudio
.br
Force sound system to None
.br
.TP
.B \-setaudio
.br
Force sound system to a specific device
.br
NULL SDL OPENAL JACK
.br
.IP
.TP
.B \-h or \-\-help
.br
Print this help text and exit
.br
.IP
.TP
.B \-y or \-\-enable\-autoexec
.br
Enable automatic python script execution (default)
.br
.TP
.B \-Y or \-\-disable\-autoexec
.br
Disable automatic python script execution (pydrivers, pyconstraints, pynodes)
.br
.IP
.TP
.B \-P or \-\-python <filename>
.br
Run the given Python script (filename or Blender Text)
.br
.TP
.B \-\-python\-console
.br
Run blender with an interactive console
.br
.TP
.B \-v or \-\-version
.br
Print Blender version and exit
.br
.TP
.B \-\-
.br
Ends option processing, following arguments passed unchanged. Access via python's sys.argv
.br
.SS "Other Options:"
.TP
.B /?
.br
Print this help text and exit (windows only)
.br
.TP
.B \-R
.br
Register .blend extension (windows only)
.br
.SS "Argument Parsing:"
arguments must be separated by white space. eg
"blender \-ba test.blend"
...will ignore the 'a'
"blender \-b test.blend \-f8"
...will ignore 8 because there is no space between the \-f and the frame value
.br
.SS "Argument Order:"
Arguments are executed in the order they are given. eg
"blender \-\-background test.blend \-\-render\-frame 1 \-\-render\-output /tmp"
...will not render to /tmp because '\-\-render\-frame 1' renders before the output path is set
"blender \-\-background \-\-render\-output /tmp test.blend \-\-render\-frame 1"
...will not render to /tmp because loading the blend file overwrites the render output that was set
"blender \-\-background test.blend \-\-render\-output /tmp \-\-render\-frame 1" works as expected.
.br
.br
.SH "ENVIRONMENT VARIABLES"
\fIHOME\fR Store files such as .blender/ .B.blend .Bfs .Blog here.
\fIBLENDERPATH\fR System directory to use for data files and scripts.
For this build of blender the default \fIBLENDERPATH\fR is...
"/usr/local/share/blender/2.5"
setting the \fIBLENDERPATH\fR will override this
\fITMP\fR or \fITMPDIR\fR Store temporary files here.
\fIPYTHONHOME\fR Path to the python directory, eg. /usr/lib/python.
.br
.br
.br
.SH SEE ALSO
.B yafaray(1)
.br
.SH AUTHORS
This manpage was written for a Debian GNU/Linux system by Daniel Mester
<mester@uni-bremen.de> and updated by Cyril Brulebois
<cyril.brulebois@enst-bretagne.fr> and Dan Eicher <dan@trollwerks.org>.

134
doc/blender.1.py Normal file
View File

@ -0,0 +1,134 @@
#!/usr/bin/python
# ##### 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.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
import subprocess
import os
import time
import datetime
def man_format(data):
data = data.replace("-", "\\-")
data = data.replace("\t", " ")
# data = data.replace("$", "\\fI")
data_ls = []
for w in data.split():
if w.startswith("$"):
w = "\\fI" + w[1:] + "\\fR"
data_ls.append(w)
data = data[:len(data) - len(data.lstrip())] + " ".join(data_ls)
return data
blender_bin = os.path.join(os.path.dirname(__file__), "../blender")
blender_help = subprocess.Popen([blender_bin, "--help"], stdout=subprocess.PIPE).communicate()[0].decode()
blender_version = subprocess.Popen([blender_bin, "--version"], stdout=subprocess.PIPE).communicate()[0].decode().strip()
blender_version = blender_version.split("Build")[0]
date_string = datetime.date.fromtimestamp(time.time()).strftime("%B %d, %Y")
filepath = os.path.splitext(__file__)[0] + ".1"
file = open(filepath, "w")
fw = file.write
fw('.TH "BLENDER" "1" "%s" "Blender %s"\n' % (date_string, blender_version.replace(".", "\\&.")))
fw('''
.SH NAME
blender \- a 3D modelling and rendering package''')
fw('''
.SH SYNOPSIS
.B blender [args ...] [file] [args ...]''')
fw('''
.br
.SH DESCRIPTION
.PP
.B blender
is a 3D modelling and rendering package. It is the in-house software of a high quality animation studio, Blender has proven to be an extremely fast and versatile design instrument. The software has a personal touch, offering a unique approach to the world of Three Dimensions.
Use Blender to create TV commercials, to make technical visualizations, business graphics, to do some morphing, or design user interfaces. You can easy build and manage complex environments. The renderer is versatile and extremely fast. All basic animation principles (curves & keys) are well implemented.
http://www.blender.org''')
fw('''
.SH OPTIONS''')
fw("\n\n")
lines = [line.rstrip() for line in blender_help.split("\n")]
while lines:
l = lines.pop(0)
if l.startswith("Environment Variables:"):
fw('.SH "ENVIRONMENT VARIABLES"\n')
elif l.endswith(":"): # one line
fw('.SS "%s"\n\n' % l)
elif l.startswith("-") or l.startswith("/"): # can be multi line
fw('.TP\n')
fw('.B %s\n' % man_format(l))
while lines:
# line with no
if lines[0].strip() and len(lines[0].lstrip()) == len(lines[0]): # no white space
break
if not l: # second blank line
fw('.IP\n')
else:
fw('.br\n')
l = lines.pop(0)
l = l[1:] # remove first whitespace (tab)
fw('%s\n' % man_format(l))
else:
if not l.strip():
fw('.br\n')
else:
fw('%s\n' % man_format(l))
# footer
fw('''
.br
.SH SEE ALSO
.B yafaray(1)
.br
.SH AUTHORS
This manpage was written for a Debian GNU/Linux system by Daniel Mester
<mester@uni-bremen.de> and updated by Cyril Brulebois
<cyril.brulebois@enst-bretagne.fr> and Dan Eicher <dan@trollwerks.org>.
''')

View File

@ -2702,7 +2702,7 @@ typedef GLenum (GLAPIENTRY * PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target);
typedef void (GLAPIENTRY * PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint* framebuffers);
typedef void (GLAPIENTRY * PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint* renderbuffers);
typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURLAYERPROC) (GLenum target,GLenum attachment, GLuint texture,GLint level,GLint layer);
typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target,GLenum attachment, GLuint texture,GLint level,GLint layer);
typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE1DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE3DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint layer);
@ -2723,7 +2723,7 @@ typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum targ
#define glDeleteFramebuffers GLEW_GET_FUN(__glewDeleteFramebuffers)
#define glDeleteRenderbuffers GLEW_GET_FUN(__glewDeleteRenderbuffers)
#define glFramebufferRenderbuffer GLEW_GET_FUN(__glewFramebufferRenderbuffer)
#define glFramebufferTexturLayer GLEW_GET_FUN(__glewFramebufferTexturLayer)
#define glFramebufferTextureLayer GLEW_GET_FUN(__glewFramebufferTextureLayer)
#define glFramebufferTexture1D GLEW_GET_FUN(__glewFramebufferTexture1D)
#define glFramebufferTexture2D GLEW_GET_FUN(__glewFramebufferTexture2D)
#define glFramebufferTexture3D GLEW_GET_FUN(__glewFramebufferTexture3D)
@ -8288,7 +8288,6 @@ typedef void (GLAPIENTRY * PFNGLGETVIDEOUI64VNVPROC) (GLuint video_slot, GLenum
typedef void (GLAPIENTRY * PFNGLGETVIDEOUIVNVPROC) (GLuint video_slot, GLenum pname, GLuint* params);
typedef void (GLAPIENTRY * PFNGLPRESENTFRAMEDUALFILLNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3);
typedef void (GLAPIENTRY * PFNGLPRESENTFRAMEKEYEDNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1);
typedef void (GLAPIENTRY * PFNGLVIDEOPARAMETERIVNVPROC) (GLuint video_slot, GLenum pname, const GLint* params);
#define glGetVideoi64vNV GLEW_GET_FUN(__glewGetVideoi64vNV)
#define glGetVideoivNV GLEW_GET_FUN(__glewGetVideoivNV)
@ -10563,7 +10562,7 @@ GLEW_FUN_EXPORT PFNGLCHECKFRAMEBUFFERSTATUSPROC __glewCheckFramebufferStatus;
GLEW_FUN_EXPORT PFNGLDELETEFRAMEBUFFERSPROC __glewDeleteFramebuffers;
GLEW_FUN_EXPORT PFNGLDELETERENDERBUFFERSPROC __glewDeleteRenderbuffers;
GLEW_FUN_EXPORT PFNGLFRAMEBUFFERRENDERBUFFERPROC __glewFramebufferRenderbuffer;
GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURLAYERPROC __glewFramebufferTexturLayer;
GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYERPROC __glewFramebufferTextureLayer;
GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE1DPROC __glewFramebufferTexture1D;
GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE2DPROC __glewFramebufferTexture2D;
GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE3DPROC __glewFramebufferTexture3D;
@ -11612,7 +11611,6 @@ GLEW_FUN_EXPORT PFNGLGETVIDEOUI64VNVPROC __glewGetVideoui64vNV;
GLEW_FUN_EXPORT PFNGLGETVIDEOUIVNVPROC __glewGetVideouivNV;
GLEW_FUN_EXPORT PFNGLPRESENTFRAMEDUALFILLNVPROC __glewPresentFrameDualFillNV;
GLEW_FUN_EXPORT PFNGLPRESENTFRAMEKEYEDNVPROC __glewPresentFrameKeyedNV;
GLEW_FUN_EXPORT PFNGLVIDEOPARAMETERIVNVPROC __glewVideoParameterivNV;
GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTINDEXNVPROC __glewPrimitiveRestartIndexNV;
GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTNVPROC __glewPrimitiveRestartNV;

View File

@ -547,7 +547,7 @@ PFNGLCHECKFRAMEBUFFERSTATUSPROC __glewCheckFramebufferStatus = NULL;
PFNGLDELETEFRAMEBUFFERSPROC __glewDeleteFramebuffers = NULL;
PFNGLDELETERENDERBUFFERSPROC __glewDeleteRenderbuffers = NULL;
PFNGLFRAMEBUFFERRENDERBUFFERPROC __glewFramebufferRenderbuffer = NULL;
PFNGLFRAMEBUFFERTEXTURLAYERPROC __glewFramebufferTexturLayer = NULL;
PFNGLFRAMEBUFFERTEXTURELAYERPROC __glewFramebufferTextureLayer = NULL;
PFNGLFRAMEBUFFERTEXTURE1DPROC __glewFramebufferTexture1D = NULL;
PFNGLFRAMEBUFFERTEXTURE2DPROC __glewFramebufferTexture2D = NULL;
PFNGLFRAMEBUFFERTEXTURE3DPROC __glewFramebufferTexture3D = NULL;
@ -1596,7 +1596,6 @@ PFNGLGETVIDEOUI64VNVPROC __glewGetVideoui64vNV = NULL;
PFNGLGETVIDEOUIVNVPROC __glewGetVideouivNV = NULL;
PFNGLPRESENTFRAMEDUALFILLNVPROC __glewPresentFrameDualFillNV = NULL;
PFNGLPRESENTFRAMEKEYEDNVPROC __glewPresentFrameKeyedNV = NULL;
PFNGLVIDEOPARAMETERIVNVPROC __glewVideoParameterivNV = NULL;
PFNGLPRIMITIVERESTARTINDEXNVPROC __glewPrimitiveRestartIndexNV = NULL;
PFNGLPRIMITIVERESTARTNVPROC __glewPrimitiveRestartNV = NULL;
@ -2739,7 +2738,7 @@ static GLboolean _glewInit_GL_ARB_framebuffer_object (GLEW_CONTEXT_ARG_DEF_INIT)
r = ((glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glDeleteFramebuffers")) == NULL) || r;
r = ((glDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glDeleteRenderbuffers")) == NULL) || r;
r = ((glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC)glewGetProcAddress((const GLubyte*)"glFramebufferRenderbuffer")) == NULL) || r;
r = ((glFramebufferTexturLayer = (PFNGLFRAMEBUFFERTEXTURLAYERPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexturLayer")) == NULL) || r;
r = ((glFramebufferTextureLayer = (PFNGLFRAMEBUFFERTEXTURELAYERPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureLayer")) == NULL) || r;
r = ((glFramebufferTexture1D = (PFNGLFRAMEBUFFERTEXTURE1DPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture1D")) == NULL) || r;
r = ((glFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture2D")) == NULL) || r;
r = ((glFramebufferTexture3D = (PFNGLFRAMEBUFFERTEXTURE3DPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture3D")) == NULL) || r;
@ -5303,7 +5302,6 @@ static GLboolean _glewInit_GL_NV_present_video (GLEW_CONTEXT_ARG_DEF_INIT)
r = ((glGetVideouivNV = (PFNGLGETVIDEOUIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideouivNV")) == NULL) || r;
r = ((glPresentFrameDualFillNV = (PFNGLPRESENTFRAMEDUALFILLNVPROC)glewGetProcAddress((const GLubyte*)"glPresentFrameDualFillNV")) == NULL) || r;
r = ((glPresentFrameKeyedNV = (PFNGLPRESENTFRAMEKEYEDNVPROC)glewGetProcAddress((const GLubyte*)"glPresentFrameKeyedNV")) == NULL) || r;
r = ((glVideoParameterivNV = (PFNGLVIDEOPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glVideoParameterivNV")) == NULL) || r;
return r;
}

View File

@ -610,7 +610,7 @@ static void v4dwt_decode_step1_sse(v4* w, int count, const __m128 c){
int i;
for(i = 0; i < count; ++i){
__m128 tmp = vw[i*2];
vw[i*2] = tmp * c;
vw[i*2] = _mm_mul_ps(tmp, c);
}
}
@ -622,18 +622,18 @@ static void v4dwt_decode_step2_sse(v4* l, v4* w, int k, int m, __m128 c){
__m128 tmp1 = vl[ 0];
__m128 tmp2 = vw[-1];
__m128 tmp3 = vw[ 0];
vw[-1] = tmp2 + ((tmp1 + tmp3) * c);
vw[-1] = _mm_add_ps(tmp2, _mm_mul_ps(_mm_add_ps(tmp1, tmp3), c));
vl = vw;
vw += 2;
}
if(m >= k){
return;
}
c += c;
c *= vl[0];
c = _mm_add_ps(c, c);
c = _mm_mul_ps(c, vl[0]);
for(; m < k; ++m){
__m128 tmp = vw[-1];
vw[-1] = tmp + c;
vw[-1] = _mm_add_ps(tmp, c);
vw += 2;
}
}

View File

@ -76,7 +76,7 @@ Allocate memory aligned to a 16 byte boundry
#if defined(__sun)
#define HAVE_MEMALIGN
#elif defined(__GNUC__)
#ifndef __APPLE__
#if !defined(__APPLE__) && !defined(__FreeBSD__)
#define HAVE_MEMALIGN
#include <malloc.h>
#endif

13
extern/libopenjpeg/patches/fbsd.patch vendored Normal file
View File

@ -0,0 +1,13 @@
Index: extern/libopenjpeg/opj_malloc.h
===================================================================
--- extern/libopenjpeg/opj_malloc.h (revision 27736)
+++ extern/libopenjpeg/opj_malloc.h (working copy)
@@ -76,7 +76,7 @@
#if defined(__sun)
#define HAVE_MEMALIGN
#elif defined(__GNUC__)
- #ifndef __APPLE__
+ #if !defined(__APPLE__) && !defined(__FreeBSD__)
#define HAVE_MEMALIGN
#include <malloc.h>
#endif

View File

@ -1,5 +1,5 @@
#
# $Id:
# $Id$
#
# ***** BEGIN GPL LICENSE BLOCK *****
#

View File

@ -23,6 +23,9 @@
* ***** END LGPL LICENSE BLOCK *****
*/
// needed for INT64_C
#define __STDC_CONSTANT_MACROS
#include "AUD_FFMPEGFactory.h"
#include "AUD_FFMPEGReader.h"
#include "AUD_Buffer.h"

View File

@ -67,12 +67,12 @@ int AUD_FFMPEGReader::decode(AVPacket* packet, AUD_Buffer* buffer)
audio_pkg_data,
audio_pkg_size);
buf_pos += data_size;
// read error, next packet!
if(read_length < 0)
break;
buf_pos += data_size;
// move packet parameters
audio_pkg_data += read_length;
audio_pkg_size -= read_length;

View File

@ -27,6 +27,11 @@
#include <cstring>
#include <cmath>
#ifdef WITH_FFMPEG
// needed for INT64_C
#define __STDC_CONSTANT_MACROS
#endif
#include "AUD_NULLDevice.h"
#include "AUD_I3DDevice.h"
#include "AUD_FileFactory.h"
@ -62,6 +67,7 @@
#include "AUD_JackDevice.h"
#endif
#ifdef WITH_FFMPEG
extern "C" {
#include <libavformat/avformat.h>
@ -84,11 +90,15 @@ static AUD_IDevice* AUD_device = NULL;
static int AUD_available_devices[4];
static AUD_I3DDevice* AUD_3ddevice = NULL;
int AUD_init(AUD_DeviceType device, AUD_DeviceSpecs specs, int buffersize)
void AUD_initOnce()
{
#ifdef WITH_FFMPEG
av_register_all();
#endif
}
int AUD_init(AUD_DeviceType device, AUD_DeviceSpecs specs, int buffersize)
{
AUD_IDevice* dev = NULL;
if(AUD_device)

View File

@ -55,6 +55,11 @@ typedef struct
typedef void (*AUD_syncFunction)(void*, int, float);
#endif
/**
* Initializes FFMPEG if it is enabled.
*/
extern void AUD_initOnce();
/**
* Initializes an audio device.
* \param device The device type that should be used.

View File

@ -29,6 +29,9 @@
#include <cstring>
#ifdef WITH_FFMPEG
// needed for INT64_C
#define __STDC_CONSTANT_MACROS
#include "AUD_FFMPEGReader.h"
#endif
#ifdef WITH_SNDFILE

View File

@ -23,6 +23,8 @@
* ***** END LGPL LICENSE BLOCK *****
*/
#include <limits>
#include "AUD_NULLDevice.h"
#include "AUD_IReader.h"
#include "AUD_IFactory.h"
@ -76,7 +78,7 @@ bool AUD_NULLDevice::seek(AUD_Handle* handle, float position)
float AUD_NULLDevice::getPosition(AUD_Handle* handle)
{
return 0.0f;
return std::numeric_limits<float>::quiet_NaN();
}
AUD_Status AUD_NULLDevice::getStatus(AUD_Handle* handle)

View File

@ -26,10 +26,6 @@
* ***** END GPL LICENSE BLOCK *****
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "BSP_MeshPrimitives.h"
#include "MT_assert.h"

View File

@ -30,10 +30,6 @@
* Implementation of external api for CSG part of BSP lib interface.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "../extern/CSG_BooleanOps.h"
#include "BSP_CSGMesh_CFIterator.h"
#include "MEM_RefCountPtr.h"

View File

@ -31,10 +31,6 @@
* $Id$
* Copyright (C) 2001 NaN Technologies B.V.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#if defined(WIN32) || defined(__APPLE__)
# ifdef WIN32
# include <windows.h>

View File

@ -26,10 +26,6 @@
* ***** END GPL LICENSE BLOCK *****
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "BSP_MeshDrawer.h"
#include "BSP_TMesh.h"

View File

@ -26,10 +26,6 @@
* ***** END GPL LICENSE BLOCK *****
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "BSP_PlyLoader.h"
#include "MT_Vector3.h"

View File

@ -26,10 +26,6 @@
* ***** END GPL LICENSE BLOCK *****
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "BSP_GhostTest3D.h"
#include "BSP_TMesh.h"

View File

@ -67,10 +67,6 @@ WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
#include <string.h>
#include "ply.h"
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
char *type_names[] = {
"invalid",
"char", "short", "int",

View File

@ -26,10 +26,6 @@
* ***** END GPL LICENSE BLOCK *****
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "CTR_List.h"

View File

@ -26,10 +26,6 @@
* ***** END GPL LICENSE BLOCK *****
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "LOD_EdgeCollapser.h"
#include "LOD_ManMesh2.h"

View File

@ -29,10 +29,6 @@
#include "LOD_ExternNormalEditor.h"
#include <vector>
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
using namespace std;

View File

@ -29,10 +29,6 @@
// implementation of LOD_FaceNormalEditor.h
///////////////////////////////////////
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "LOD_FaceNormalEditor.h"
using namespace std;

View File

@ -26,10 +26,6 @@
* ***** END GPL LICENSE BLOCK *****
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "LOD_ManMesh2.h"
#include "MT_assert.h"

View File

@ -26,10 +26,6 @@
* ***** END GPL LICENSE BLOCK *****
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "LOD_MeshPrimitives.h"
#include "MT_assert.h"

View File

@ -26,10 +26,6 @@
* ***** END GPL LICENSE BLOCK *****
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "LOD_QSDecimator.h"
#include "LOD_ExternBufferEditor.h"

View File

@ -26,10 +26,6 @@
* ***** END GPL LICENSE BLOCK *****
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "LOD_QuadricEditor.h"
#include "LOD_ExternNormalEditor.h"

View File

@ -27,10 +27,6 @@
*/
// implementation of external c api
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "../extern/LOD_decimation.h"
#include "LOD_DecimationClass.h"

View File

@ -24,7 +24,7 @@
#
# ***** END GPL LICENSE BLOCK *****
SET(INC ${ZLIB_INC} ${PNG_INC} extern)
SET(INC ${PNG_INC} ${ZLIB_INC} extern)
FILE(GLOB SRC intern/*.cpp)

View File

@ -24,57 +24,68 @@
#
# ***** END GPL LICENSE BLOCK *****
SET(INC . ../string ../../extern/glew/include ../../source/blender/imbuf ../../source/blender/makesdna)
SET(INC
.
../string
../../extern/glew/include
../../source/blender/imbuf
../../source/blender/makesdna
)
FILE(GLOB SRC intern/*.cpp intern/*.mm)
SET(SRC
${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_Buttons.cpp
${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_CallbackEventConsumer.cpp
${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_C-api.cpp
${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DisplayManager.cpp
${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_EventManager.cpp
${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_EventPrinter.cpp
${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_ISystem.cpp
${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_ModifierKeys.cpp
${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_NDOFManager.cpp
${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_Path-api.cpp
${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_Rect.cpp
${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_System.cpp
${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_TimerManager.cpp
${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_Window.cpp
${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowManager.cpp
)
IF(APPLE)
IF(WITH_COCOA)
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DisplayManagerCarbon.cpp")
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_SystemCarbon.cpp")
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowCarbon.cpp")
SET(SRC ${SRC}
${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DisplayManagerCocoa.mm
${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_SystemCocoa.mm
${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowCocoa.mm
)
ELSE(WITH_COCOA)
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DisplayManagerCocoa.mm")
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_SystemCocoa.mm")
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowCocoa.mm")
SET(SRC ${SRC}
${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DisplayManagerCarbon.cpp
${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_SystemCarbon.cpp
${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowCarbon.cpp
)
ENDIF(WITH_COCOA)
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DisplayManagerWin32.cpp")
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_SystemWin32.cpp")
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowWin32.cpp")
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DropTargetWin32.cpp")
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DisplayManagerX11.cpp")
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_SystemX11.cpp")
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowX11.cpp")
IF(WITH_QUICKTIME)
ADD_DEFINITIONS(-DWITH_QUICKTIME)
ENDIF(WITH_QUICKTIME)
ELSE(APPLE)
IF(WIN32)
SET(INC ${INC} ${WINTAB_INC})
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DisplayManagerCarbon.cpp")
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_SystemCarbon.cpp")
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowCarbon.cpp")
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DisplayManagerCocoa.mm")
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_SystemCocoa.mm")
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowCocoa.mm")
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DisplayManagerX11.cpp")
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_SystemX11.cpp")
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowX11.cpp")
ELSE(WIN32)
SET(INC ${INC} ${X11_X11_INCLUDE_PATH})
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DisplayManagerWin32.cpp")
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DropTargetWin32.cpp")
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_SystemWin32.cpp")
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowWin32.cpp")
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DisplayManagerCarbon.cpp")
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_SystemCarbon.cpp")
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowCarbon.cpp")
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DisplayManagerCocoa.mm")
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_SystemCocoa.mm")
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowCocoa.mm")
ENDIF(WIN32)
ELSEIF(WIN32)
SET(INC ${INC} ${WINTAB_INC})
SET(SRC ${SRC}
${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DisplayManagerWin32.cpp
${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_SystemWin32.cpp
${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowWin32.cpp
${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DropTargetWin32.cpp
)
ELSEIF(UNIX)
SET(INC ${INC} ${X11_X11_INCLUDE_PATH})
SET(SRC ${SRC}
${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DisplayManagerX11.cpp
${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_SystemX11.cpp
${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowX11.cpp
)
ENDIF(APPLE)
BLENDERLIB(bf_ghost "${SRC}" "${INC}")
#, libtype=['core','player'], priority = [25,15] )

View File

@ -264,7 +264,24 @@ extern int GHOST_DispatchEvents(GHOST_SystemHandle systemhandle);
extern GHOST_TSuccess GHOST_AddEventConsumer(GHOST_SystemHandle systemhandle,
GHOST_EventConsumerHandle consumerhandle);
/***************************************************************************************
** Progress bar functionality
***************************************************************************************/
/**
* Sets the progress bar value displayed in the window/application icon
* @param windowhandle The handle to the window
* @param progress The progress % (0.0 to 1.0)
*/
extern GHOST_TSuccess GHOST_SetProgressBar(GHOST_WindowHandle windowhandle, float progress);
/**
* Hides the progress bar in the icon
* @param windowhandle The handle to the window
*/
extern GHOST_TSuccess GHOST_EndProgressBar(GHOST_WindowHandle windowhandle);
/***************************************************************************************
** N-degree of freedom device management functionality
***************************************************************************************/
@ -819,20 +836,6 @@ extern GHOST_TUns8* GHOST_getClipboard(int selection);
*/
extern void GHOST_putClipboard(GHOST_TInt8 *buffer, int selection);
/**
* Determine the base dir in which shared resources are located. It will first try to use
* "unpack and run" path, then look for properly installed path, not including versioning.
* @return Unsigned char string pointing to system dir (eg /usr/share/blender/).
*/
extern const GHOST_TUns8* GHOST_getSystemDir();
/**
* Determine the base dir in which user configuration is stored, not including versioning.
* If needed, it will create the base directory.
* @return Unsigned char string pointing to user dir (eg ~/.blender/).
*/
extern const GHOST_TUns8* GHOST_getUserDir();
#ifdef __cplusplus
}

View File

@ -331,7 +331,7 @@ public:
* @param y The y-coordinate of the cursor.
* @return Indication of success.
*/
virtual GHOST_TSuccess setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y) const = 0;
virtual GHOST_TSuccess setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y) = 0;
/***************************************************************************************
** Access to mouse button and keyboard states.
@ -370,12 +370,7 @@ public:
*/
virtual void putClipboard(GHOST_TInt8 *buffer, bool selection) const = 0;
/***************************************************************************************
** Determine special paths.
***************************************************************************************/
/**
/**
* Determine the base dir in which shared resources are located. It will first try to use
* "unpack and run" path, then look for properly installed path, not including versioning.
* @return Unsigned char string pointing to system dir (eg /usr/share/blender/).
@ -389,6 +384,11 @@ public:
*/
virtual const GHOST_TUns8* getUserDir() const = 0;
/**
* Determine the directory of the current binary
* @return Unsigned char string pointing to the binary dir
*/
virtual const GHOST_TUns8* getBinaryDir() const = 0;
protected:
/**
* Initialize the system.

View File

@ -234,6 +234,21 @@ public:
*/
virtual const GHOST_TabletData* GetTabletData() = 0;
/***************************************************************************************
** Progress bar functionality
***************************************************************************************/
/**
* Sets the progress bar value displayed in the window/application icon
* @param progress The progress %
*/
virtual GHOST_TSuccess setProgressBar(float progress) = 0;
/**
* Hides the progress bar in the icon
*/
virtual GHOST_TSuccess endProgressBar() = 0;
/***************************************************************************************
** Cursor management functionality
***************************************************************************************/

View File

@ -1,6 +1,4 @@
/*
* IMB_bitplanes.h
*
/**
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
@ -19,7 +17,7 @@
* 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) 2001-2002 by NaN Holding BV.
* The Original Code is Copyright (C) 2010 by Blender Foundation.
* All rights reserved.
*
* The Original Code is: all of this file.
@ -28,20 +26,38 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
/**
* \file IMB_bitplanes.h
* \ingroup imbuf
* \brief Function declarations for bitplanes.c
*/
#ifndef IMB_BITPLANES_H
#define IMB_BITPLANES_H
#ifndef GHOST_PATH_API_H
#define GHOST_PATH_API_H
struct ImBuf;
void imb_bptolong(struct ImBuf *ibuf);
void imb_longtobp(struct ImBuf *ibuf);
unsigned int **imb_copyplanelist(struct ImBuf *ibuf);
#include "GHOST_Types.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* Determine the base dir in which shared resources are located. It will first try to use
* "unpack and run" path, then look for properly installed path, not including versioning.
* @return Unsigned char string pointing to system dir (eg /usr/share/blender/).
*/
extern const GHOST_TUns8* GHOST_getSystemDir();
/**
* Determine the base dir in which user configuration is stored, not including versioning.
* @return Unsigned char string pointing to user dir (eg ~).
*/
extern const GHOST_TUns8* GHOST_getUserDir();
/**
* Determine the dir in which the binary file is found.
* @return Unsigned char string pointing to binary dir (eg ~/usr/local/bin/).
*/
extern const GHOST_TUns8* GHOST_getBinaryDir();
#ifdef __cplusplus
}
#endif
#endif

View File

@ -56,9 +56,8 @@ else:
if env['BF_GHOST_DEBUG']:
defs.append('BF_GHOST_DEBUG')
incs = '. ../string #extern/glew/include #source/blender/imbuf #source/blender/makesdna ' + env['BF_OPENGL_INC']
if window_system in ('win32-vc', 'win32-mingw', 'cygwin', 'linuxcross', 'win64-vc'):
incs = env['BF_WINTAB_INC'] + ' ' + incs
env.BlenderLib ('bf_ghost', sources, Split(incs), defines=defs, libtype=['intern','player'], priority = [40,15] )

View File

@ -28,10 +28,6 @@
#include "GHOST_Buttons.h"
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
GHOST_Buttons::GHOST_Buttons()

View File

@ -37,10 +37,6 @@
#include <stdlib.h>
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "intern/GHOST_Debug.h"
#include "GHOST_C-api.h"
#include "GHOST_ISystem.h"
@ -252,6 +248,21 @@ GHOST_TSuccess GHOST_AddEventConsumer(GHOST_SystemHandle systemhandle, GHOST_Eve
return system->addEventConsumer((GHOST_CallbackEventConsumer*)consumerhandle);
}
GHOST_TSuccess GHOST_SetProgressBar(GHOST_WindowHandle windowhandle,float progress)
{
GHOST_IWindow* window = (GHOST_IWindow*) windowhandle;
return window->setProgressBar(progress);
}
GHOST_TSuccess GHOST_EndProgressBar(GHOST_WindowHandle windowhandle)
{
GHOST_IWindow* window = (GHOST_IWindow*) windowhandle;
return window->endProgressBar();
}
int GHOST_OpenNDOF(GHOST_SystemHandle systemhandle, GHOST_WindowHandle windowhandle,
GHOST_NDOFLibraryInit_fp setNdofLibraryInit,
GHOST_NDOFLibraryShutdown_fp setNdofLibraryShutdown,
@ -854,15 +865,3 @@ void GHOST_putClipboard(GHOST_TInt8 *buffer, int selection)
GHOST_ISystem* system = GHOST_ISystem::getSystem();
system->putClipboard(buffer, selection);
}
const GHOST_TUns8* GHOST_getSystemDir()
{
GHOST_ISystem* system = GHOST_ISystem::getSystem();
return system->getSystemDir();
}
const GHOST_TUns8* GHOST_getUserDir()
{
GHOST_ISystem* system = GHOST_ISystem::getSystem();
return system->getUserDir();
}

View File

@ -34,10 +34,6 @@
* @date October 25, 2001
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "GHOST_Debug.h"
#include "GHOST_C-api.h"
#include "GHOST_CallbackEventConsumer.h"

View File

@ -32,10 +32,6 @@
* @date September 21, 2001
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "GHOST_DisplayManager.h"
#include "GHOST_Debug.h"

View File

@ -34,10 +34,6 @@
* @date September 21, 2001
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "GHOST_DisplayManagerCarbon.h"
#include "GHOST_Debug.h"

View File

@ -34,10 +34,6 @@
* @date September 21, 2001
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "GHOST_DisplayManagerWin32.h"
#include "GHOST_Debug.h"

View File

@ -26,10 +26,6 @@
* ***** END GPL LICENSE BLOCK *****
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "GHOST_DisplayManagerX11.h"
#include "GHOST_SystemX11.h"

View File

@ -110,8 +110,8 @@ ULONG __stdcall GHOST_DropTargetWin32::Release(void)
*/
HRESULT __stdcall GHOST_DropTargetWin32::DragEnter(IDataObject * pDataObject, DWORD grfKeyState, POINTL pt, DWORD * pdwEffect)
{
// we don't know yet if we accept the drop.
m_window->setAcceptDragOperation(false);
// we accept all drop by default
m_window->setAcceptDragOperation(true);
*pdwEffect = DROPEFFECT_NONE;
m_draggedObjectType = getGhostType(pDataObject);

View File

@ -38,10 +38,6 @@
#include <algorithm>
#include "GHOST_Debug.h"
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
GHOST_EventManager::GHOST_EventManager()
{

View File

@ -36,10 +36,6 @@
#include "GHOST_EventDragnDrop.h"
#include "GHOST_Debug.h"
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
bool GHOST_EventPrinter::processEvent(GHOST_IEvent* event)
{

View File

@ -34,10 +34,6 @@
* @date May 7, 2001
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "GHOST_ISystem.h"
#ifdef WIN32

View File

@ -34,10 +34,6 @@
* @date May 31, 2001
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "GHOST_ModifierKeys.h"

View File

@ -1,6 +1,4 @@
/**
* IMB_amiga.h
*
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
@ -19,7 +17,7 @@
* 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) 2001-2002 by NaN Holding BV.
* The Original Code is Copyright (C) 2010 by Blender Foundation.
* All rights reserved.
*
* The Original Code is: all of this file.
@ -28,20 +26,25 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
/**
* \file IMB_amiga.h
* \ingroup imbuf
* \brief Function declarations for amiga.c
*/
#ifndef IMB_AMIGA_H
#define IMB_AMIGA_H
#include "intern/GHOST_Debug.h"
#include "GHOST_Path-api.h"
#include "GHOST_ISystem.h"
struct ImBuf;
const GHOST_TUns8* GHOST_getSystemDir()
{
GHOST_ISystem* system = GHOST_ISystem::getSystem();
return system ? system->getSystemDir() : NULL;
}
struct ImBuf *imb_loadamiga(int *iffmem,int flags);
short imb_encodebodyh(struct ImBuf *ibuf, int file);
short imb_encodebodyv(struct ImBuf *ibuf, int file);
#endif
const GHOST_TUns8* GHOST_getUserDir()
{
GHOST_ISystem* system = GHOST_ISystem::getSystem();
return system ? system->getUserDir() : NULL; /* will be NULL in background mode */
}
const GHOST_TUns8* GHOST_getBinaryDir()
{
GHOST_ISystem* system = GHOST_ISystem::getSystem();
return system ? system->getBinaryDir() : NULL; /* will be NULL in background mode */
}

View File

@ -26,10 +26,6 @@
* ***** END GPL LICENSE BLOCK *****
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "GHOST_Rect.h"

View File

@ -34,10 +34,6 @@
* @date May 7, 2001
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "GHOST_System.h"
#include <time.h>

View File

@ -297,7 +297,7 @@ public:
*/
virtual void putClipboard(GHOST_TInt8 *buffer, bool selection) const = 0;
/**
/**
* Determine the base dir in which shared resources are located. It will first try to use
* "unpack and run" path, then look for properly installed path, not including versioning.
* @return Unsigned char string pointing to system dir (eg /usr/share/blender/).
@ -311,6 +311,11 @@ public:
*/
virtual const GHOST_TUns8* getUserDir() const = 0;
/**
* Determine the directory of the current binary
* @return Unsigned char string pointing to the binary dir
*/
virtual const GHOST_TUns8* getBinaryDir() const = 0;
protected:
/**
* Initialize the system.

View File

@ -531,7 +531,7 @@ GHOST_TSuccess GHOST_SystemCarbon::getCursorPosition(GHOST_TInt32& x, GHOST_TInt
}
GHOST_TSuccess GHOST_SystemCarbon::setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y) const
GHOST_TSuccess GHOST_SystemCarbon::setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y)
{
float xf=(float)x, yf=(float)y;
@ -1215,9 +1215,10 @@ void GHOST_SystemCarbon::putClipboard(GHOST_TInt8 *buffer, bool selection) const
}
}
const GHOST_TUns8* GHOST_SystemCarbon::getSystemDir() const
{
return (GHOST_TUns8*)"/Library/Application Support/Blender";
return (GHOST_TUns8*)"/Library/Application Support";
}
const GHOST_TUns8* GHOST_SystemCarbon::getUserDir() const
@ -1228,9 +1229,24 @@ const GHOST_TUns8* GHOST_SystemCarbon::getUserDir() const
if (env) {
strncpy(usrPath, env, 245);
usrPath[245]=0;
strcat(usrPath, "/Library/Application Support/Blender");
strcat(usrPath, "/Library/Application Support");
return (GHOST_TUns8*) usrPath;
}
else
return NULL;
}
const GHOST_TUns8* GHOST_SystemCarbon::getBinaryDir() const
{
CFURLRef bundleURL;
CFStringRef pathStr;
static char path[256];
CFBundleRef mainBundle = CFBundleGetMainBundle();
bundleURL = CFBundleCopyBundleURL(mainBundle);
pathStr = CFURLCopyFileSystemPath(bundleURL, kCFURLPOSIXPathStyle);
CFStringGetCString(pathStr, path, 255, kCFStringEncodingASCII);
CFRelease(pathStr);
CFRelease(bundleURL);
return (GHOST_TUns8*)path;
}

View File

@ -156,7 +156,7 @@ public:
* @param y The y-coordinate of the cursor.
* @return Indication of success.
*/
virtual GHOST_TSuccess setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y) const;
virtual GHOST_TSuccess setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y);
/***************************************************************************************
** Access to mouse button and keyboard states.
@ -190,6 +190,7 @@ public:
*/
virtual void putClipboard(GHOST_TInt8 *buffer, bool selection) const;
/**
* Determine the base dir in which shared resources are located. It will first try to use
* "unpack and run" path, then look for properly installed path, not including versioning.
@ -204,6 +205,12 @@ public:
*/
virtual const GHOST_TUns8* getUserDir() const;
/**
* Determine the directory of the current binary
* @return Unsigned char string pointing to the binary dir
*/
virtual const GHOST_TUns8* getBinaryDir() const;
protected:
/**
* Initializes the system.

View File

@ -179,8 +179,8 @@ public:
* @param y The y-coordinate of the cursor.
* @return Indication of success.
*/
virtual GHOST_TSuccess setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y) const;
virtual GHOST_TSuccess setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y);
/***************************************************************************************
** Access to mouse button and keyboard states.
***************************************************************************************/
@ -227,6 +227,12 @@ public:
*/
virtual const GHOST_TUns8* getUserDir() const;
/**
* Determine the directory of the current binary
* @return Unsigned char string pointing to the binary dir
*/
virtual const GHOST_TUns8* getBinaryDir() const;
/**
* Handles a window event. Called by GHOST_WindowCocoa window delegate
* @param eventType The type of window event
@ -272,6 +278,14 @@ protected:
*/
GHOST_TSuccess handleKeyEvent(void *eventPtr);
/**
* Performs the actual cursor position update (location in screen coordinates).
* @param x The x-coordinate of the cursor.
* @param y The y-coordinate of the cursor.
* @return Indication of success.
*/
GHOST_TSuccess setMouseCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y);
/** Start time at initialization. */
GHOST_TUns64 m_start_time;

View File

@ -15,6 +15,7 @@
* 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.
<<<<<<< .working
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
@ -41,9 +42,41 @@
#include "GHOST_EventCursor.h"
#include "GHOST_EventWheel.h"
#include "GHOST_EventNDOF.h"
=======
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): Maarten Gribnau 05/2001
* Damien Plisson 09/2009
*
* ***** END GPL LICENSE BLOCK *****
*/
#import <Cocoa/Cocoa.h>
/*For the currently not ported to Cocoa keyboard layout functions (64bit & 10.6 compatible)*/
#include <Carbon/Carbon.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/sysctl.h>
#include "GHOST_SystemCocoa.h"
#include "GHOST_DisplayManagerCocoa.h"
#include "GHOST_EventKey.h"
#include "GHOST_EventButton.h"
#include "GHOST_EventCursor.h"
#include "GHOST_EventWheel.h"
#include "GHOST_EventNDOF.h"
>>>>>>> .merge-right.r30358
#include "GHOST_EventTrackpad.h"
#include "GHOST_EventDragnDrop.h"
#include "GHOST_EventString.h"
<<<<<<< .working
#include "GHOST_TimerManager.h"
#include "GHOST_TimerTask.h"
@ -376,6 +409,381 @@ static GHOST_TKey convertKey(int rawCode, unichar recvChar)
}
=======
#include "GHOST_TimerManager.h"
#include "GHOST_TimerTask.h"
#include "GHOST_WindowManager.h"
#include "GHOST_WindowCocoa.h"
#include "GHOST_NDOFManager.h"
#include "AssertMacros.h"
#pragma mark KeyMap, mouse converters
#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4
/* Keycodes not defined in Tiger */
/*
* Summary:
* Virtual keycodes
*
* Discussion:
* These constants are the virtual keycodes defined originally in
* Inside Mac Volume V, pg. V-191. They identify physical keys on a
* keyboard. Those constants with "ANSI" in the name are labeled
* according to the key position on an ANSI-standard US keyboard.
* For example, kVK_ANSI_A indicates the virtual keycode for the key
* with the letter 'A' in the US keyboard layout. Other keyboard
* layouts may have the 'A' key label on a different physical key;
* in this case, pressing 'A' will generate a different virtual
* keycode.
*/
enum {
kVK_ANSI_A = 0x00,
kVK_ANSI_S = 0x01,
kVK_ANSI_D = 0x02,
kVK_ANSI_F = 0x03,
kVK_ANSI_H = 0x04,
kVK_ANSI_G = 0x05,
kVK_ANSI_Z = 0x06,
kVK_ANSI_X = 0x07,
kVK_ANSI_C = 0x08,
kVK_ANSI_V = 0x09,
kVK_ANSI_B = 0x0B,
kVK_ANSI_Q = 0x0C,
kVK_ANSI_W = 0x0D,
kVK_ANSI_E = 0x0E,
kVK_ANSI_R = 0x0F,
kVK_ANSI_Y = 0x10,
kVK_ANSI_T = 0x11,
kVK_ANSI_1 = 0x12,
kVK_ANSI_2 = 0x13,
kVK_ANSI_3 = 0x14,
kVK_ANSI_4 = 0x15,
kVK_ANSI_6 = 0x16,
kVK_ANSI_5 = 0x17,
kVK_ANSI_Equal = 0x18,
kVK_ANSI_9 = 0x19,
kVK_ANSI_7 = 0x1A,
kVK_ANSI_Minus = 0x1B,
kVK_ANSI_8 = 0x1C,
kVK_ANSI_0 = 0x1D,
kVK_ANSI_RightBracket = 0x1E,
kVK_ANSI_O = 0x1F,
kVK_ANSI_U = 0x20,
kVK_ANSI_LeftBracket = 0x21,
kVK_ANSI_I = 0x22,
kVK_ANSI_P = 0x23,
kVK_ANSI_L = 0x25,
kVK_ANSI_J = 0x26,
kVK_ANSI_Quote = 0x27,
kVK_ANSI_K = 0x28,
kVK_ANSI_Semicolon = 0x29,
kVK_ANSI_Backslash = 0x2A,
kVK_ANSI_Comma = 0x2B,
kVK_ANSI_Slash = 0x2C,
kVK_ANSI_N = 0x2D,
kVK_ANSI_M = 0x2E,
kVK_ANSI_Period = 0x2F,
kVK_ANSI_Grave = 0x32,
kVK_ANSI_KeypadDecimal = 0x41,
kVK_ANSI_KeypadMultiply = 0x43,
kVK_ANSI_KeypadPlus = 0x45,
kVK_ANSI_KeypadClear = 0x47,
kVK_ANSI_KeypadDivide = 0x4B,
kVK_ANSI_KeypadEnter = 0x4C,
kVK_ANSI_KeypadMinus = 0x4E,
kVK_ANSI_KeypadEquals = 0x51,
kVK_ANSI_Keypad0 = 0x52,
kVK_ANSI_Keypad1 = 0x53,
kVK_ANSI_Keypad2 = 0x54,
kVK_ANSI_Keypad3 = 0x55,
kVK_ANSI_Keypad4 = 0x56,
kVK_ANSI_Keypad5 = 0x57,
kVK_ANSI_Keypad6 = 0x58,
kVK_ANSI_Keypad7 = 0x59,
kVK_ANSI_Keypad8 = 0x5B,
kVK_ANSI_Keypad9 = 0x5C
};
/* keycodes for keys that are independent of keyboard layout*/
enum {
kVK_Return = 0x24,
kVK_Tab = 0x30,
kVK_Space = 0x31,
kVK_Delete = 0x33,
kVK_Escape = 0x35,
kVK_Command = 0x37,
kVK_Shift = 0x38,
kVK_CapsLock = 0x39,
kVK_Option = 0x3A,
kVK_Control = 0x3B,
kVK_RightShift = 0x3C,
kVK_RightOption = 0x3D,
kVK_RightControl = 0x3E,
kVK_Function = 0x3F,
kVK_F17 = 0x40,
kVK_VolumeUp = 0x48,
kVK_VolumeDown = 0x49,
kVK_Mute = 0x4A,
kVK_F18 = 0x4F,
kVK_F19 = 0x50,
kVK_F20 = 0x5A,
kVK_F5 = 0x60,
kVK_F6 = 0x61,
kVK_F7 = 0x62,
kVK_F3 = 0x63,
kVK_F8 = 0x64,
kVK_F9 = 0x65,
kVK_F11 = 0x67,
kVK_F13 = 0x69,
kVK_F16 = 0x6A,
kVK_F14 = 0x6B,
kVK_F10 = 0x6D,
kVK_F12 = 0x6F,
kVK_F15 = 0x71,
kVK_Help = 0x72,
kVK_Home = 0x73,
kVK_PageUp = 0x74,
kVK_ForwardDelete = 0x75,
kVK_F4 = 0x76,
kVK_End = 0x77,
kVK_F2 = 0x78,
kVK_PageDown = 0x79,
kVK_F1 = 0x7A,
kVK_LeftArrow = 0x7B,
kVK_RightArrow = 0x7C,
kVK_DownArrow = 0x7D,
kVK_UpArrow = 0x7E
};
/* ISO keyboards only*/
enum {
kVK_ISO_Section = 0x0A
};
/* JIS keyboards only*/
enum {
kVK_JIS_Yen = 0x5D,
kVK_JIS_Underscore = 0x5E,
kVK_JIS_KeypadComma = 0x5F,
kVK_JIS_Eisu = 0x66,
kVK_JIS_Kana = 0x68
};
#endif
static GHOST_TButtonMask convertButton(int button)
{
switch (button) {
case 0:
return GHOST_kButtonMaskLeft;
case 1:
return GHOST_kButtonMaskRight;
case 2:
return GHOST_kButtonMaskMiddle;
case 3:
return GHOST_kButtonMaskButton4;
case 4:
return GHOST_kButtonMaskButton5;
default:
return GHOST_kButtonMaskLeft;
}
}
/**
* Converts Mac rawkey codes (same for Cocoa & Carbon)
* into GHOST key codes
* @param rawCode The raw physical key code
* @param recvChar the character ignoring modifiers (except for shift)
* @return Ghost key code
*/
static GHOST_TKey convertKey(int rawCode, unichar recvChar, UInt16 keyAction)
{
//printf("\nrecvchar %c 0x%x",recvChar,recvChar);
switch (rawCode) {
/*Physical keycodes not used due to map changes in int'l keyboards
case kVK_ANSI_A: return GHOST_kKeyA;
case kVK_ANSI_B: return GHOST_kKeyB;
case kVK_ANSI_C: return GHOST_kKeyC;
case kVK_ANSI_D: return GHOST_kKeyD;
case kVK_ANSI_E: return GHOST_kKeyE;
case kVK_ANSI_F: return GHOST_kKeyF;
case kVK_ANSI_G: return GHOST_kKeyG;
case kVK_ANSI_H: return GHOST_kKeyH;
case kVK_ANSI_I: return GHOST_kKeyI;
case kVK_ANSI_J: return GHOST_kKeyJ;
case kVK_ANSI_K: return GHOST_kKeyK;
case kVK_ANSI_L: return GHOST_kKeyL;
case kVK_ANSI_M: return GHOST_kKeyM;
case kVK_ANSI_N: return GHOST_kKeyN;
case kVK_ANSI_O: return GHOST_kKeyO;
case kVK_ANSI_P: return GHOST_kKeyP;
case kVK_ANSI_Q: return GHOST_kKeyQ;
case kVK_ANSI_R: return GHOST_kKeyR;
case kVK_ANSI_S: return GHOST_kKeyS;
case kVK_ANSI_T: return GHOST_kKeyT;
case kVK_ANSI_U: return GHOST_kKeyU;
case kVK_ANSI_V: return GHOST_kKeyV;
case kVK_ANSI_W: return GHOST_kKeyW;
case kVK_ANSI_X: return GHOST_kKeyX;
case kVK_ANSI_Y: return GHOST_kKeyY;
case kVK_ANSI_Z: return GHOST_kKeyZ;*/
/* Numbers keys mapped to handle some int'l keyboard (e.g. French)*/
case kVK_ISO_Section: return GHOST_kKeyUnknown;
case kVK_ANSI_1: return GHOST_kKey1;
case kVK_ANSI_2: return GHOST_kKey2;
case kVK_ANSI_3: return GHOST_kKey3;
case kVK_ANSI_4: return GHOST_kKey4;
case kVK_ANSI_5: return GHOST_kKey5;
case kVK_ANSI_6: return GHOST_kKey6;
case kVK_ANSI_7: return GHOST_kKey7;
case kVK_ANSI_8: return GHOST_kKey8;
case kVK_ANSI_9: return GHOST_kKey9;
case kVK_ANSI_0: return GHOST_kKey0;
case kVK_ANSI_Keypad0: return GHOST_kKeyNumpad0;
case kVK_ANSI_Keypad1: return GHOST_kKeyNumpad1;
case kVK_ANSI_Keypad2: return GHOST_kKeyNumpad2;
case kVK_ANSI_Keypad3: return GHOST_kKeyNumpad3;
case kVK_ANSI_Keypad4: return GHOST_kKeyNumpad4;
case kVK_ANSI_Keypad5: return GHOST_kKeyNumpad5;
case kVK_ANSI_Keypad6: return GHOST_kKeyNumpad6;
case kVK_ANSI_Keypad7: return GHOST_kKeyNumpad7;
case kVK_ANSI_Keypad8: return GHOST_kKeyNumpad8;
case kVK_ANSI_Keypad9: return GHOST_kKeyNumpad9;
case kVK_ANSI_KeypadDecimal: return GHOST_kKeyNumpadPeriod;
case kVK_ANSI_KeypadEnter: return GHOST_kKeyNumpadEnter;
case kVK_ANSI_KeypadPlus: return GHOST_kKeyNumpadPlus;
case kVK_ANSI_KeypadMinus: return GHOST_kKeyNumpadMinus;
case kVK_ANSI_KeypadMultiply: return GHOST_kKeyNumpadAsterisk;
case kVK_ANSI_KeypadDivide: return GHOST_kKeyNumpadSlash;
case kVK_ANSI_KeypadClear: return GHOST_kKeyUnknown;
case kVK_F1: return GHOST_kKeyF1;
case kVK_F2: return GHOST_kKeyF2;
case kVK_F3: return GHOST_kKeyF3;
case kVK_F4: return GHOST_kKeyF4;
case kVK_F5: return GHOST_kKeyF5;
case kVK_F6: return GHOST_kKeyF6;
case kVK_F7: return GHOST_kKeyF7;
case kVK_F8: return GHOST_kKeyF8;
case kVK_F9: return GHOST_kKeyF9;
case kVK_F10: return GHOST_kKeyF10;
case kVK_F11: return GHOST_kKeyF11;
case kVK_F12: return GHOST_kKeyF12;
case kVK_F13: return GHOST_kKeyF13;
case kVK_F14: return GHOST_kKeyF14;
case kVK_F15: return GHOST_kKeyF15;
case kVK_F16: return GHOST_kKeyF16;
case kVK_F17: return GHOST_kKeyF17;
case kVK_F18: return GHOST_kKeyF18;
case kVK_F19: return GHOST_kKeyF19;
case kVK_F20: return GHOST_kKeyF20;
case kVK_UpArrow: return GHOST_kKeyUpArrow;
case kVK_DownArrow: return GHOST_kKeyDownArrow;
case kVK_LeftArrow: return GHOST_kKeyLeftArrow;
case kVK_RightArrow: return GHOST_kKeyRightArrow;
case kVK_Return: return GHOST_kKeyEnter;
case kVK_Delete: return GHOST_kKeyBackSpace;
case kVK_ForwardDelete: return GHOST_kKeyDelete;
case kVK_Escape: return GHOST_kKeyEsc;
case kVK_Tab: return GHOST_kKeyTab;
case kVK_Space: return GHOST_kKeySpace;
case kVK_Home: return GHOST_kKeyHome;
case kVK_End: return GHOST_kKeyEnd;
case kVK_PageUp: return GHOST_kKeyUpPage;
case kVK_PageDown: return GHOST_kKeyDownPage;
/*case kVK_ANSI_Minus: return GHOST_kKeyMinus;
case kVK_ANSI_Equal: return GHOST_kKeyEqual;
case kVK_ANSI_Comma: return GHOST_kKeyComma;
case kVK_ANSI_Period: return GHOST_kKeyPeriod;
case kVK_ANSI_Slash: return GHOST_kKeySlash;
case kVK_ANSI_Semicolon: return GHOST_kKeySemicolon;
case kVK_ANSI_Quote: return GHOST_kKeyQuote;
case kVK_ANSI_Backslash: return GHOST_kKeyBackslash;
case kVK_ANSI_LeftBracket: return GHOST_kKeyLeftBracket;
case kVK_ANSI_RightBracket: return GHOST_kKeyRightBracket;
case kVK_ANSI_Grave: return GHOST_kKeyAccentGrave;*/
case kVK_VolumeUp:
case kVK_VolumeDown:
case kVK_Mute:
return GHOST_kKeyUnknown;
default:
/* alphanumerical or punctuation key that is remappable in int'l keyboards */
if ((recvChar >= 'A') && (recvChar <= 'Z')) {
return (GHOST_TKey) (recvChar - 'A' + GHOST_kKeyA);
} else if ((recvChar >= 'a') && (recvChar <= 'z')) {
return (GHOST_TKey) (recvChar - 'a' + GHOST_kKeyA);
} else {
#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4
KeyboardLayoutRef keyLayout;
UCKeyboardLayout *uchrData;
KLGetCurrentKeyboardLayout(&keyLayout);
KLGetKeyboardLayoutProperty(keyLayout, kKLuchrData, (const void **)
&uchrData);
/*get actual character value of the "remappable" keys in int'l keyboards,
if keyboard layout is not correctly reported (e.g. some non Apple keyboards in Tiger),
then fallback on using the received charactersIgnoringModifiers */
if (uchrData)
{
UInt32 deadKeyState=0;
UniCharCount actualStrLength=0;
UCKeyTranslate(uchrData, rawCode, keyAction, 0,
LMGetKbdType(), kUCKeyTranslateNoDeadKeysBit, &deadKeyState, 1, &actualStrLength, &recvChar);
}
#else
/* Leopard and Snow Leopard 64bit compatible API*/
CFDataRef uchrHandle; /*the keyboard layout*/
TISInputSourceRef kbdTISHandle;
kbdTISHandle = TISCopyCurrentKeyboardLayoutInputSource();
uchrHandle = (CFDataRef)TISGetInputSourceProperty(kbdTISHandle,kTISPropertyUnicodeKeyLayoutData);
CFRelease(kbdTISHandle);
/*get actual character value of the "remappable" keys in int'l keyboards,
if keyboard layout is not correctly reported (e.g. some non Apple keyboards in Tiger),
then fallback on using the received charactersIgnoringModifiers */
if (uchrHandle)
{
UInt32 deadKeyState=0;
UniCharCount actualStrLength=0;
UCKeyTranslate((UCKeyboardLayout*)CFDataGetBytePtr(uchrHandle), rawCode, keyAction, 0,
LMGetKbdType(), kUCKeyTranslateNoDeadKeysBit, &deadKeyState, 1, &actualStrLength, &recvChar);
}
#endif
switch (recvChar) {
case '-': return GHOST_kKeyMinus;
case '=': return GHOST_kKeyEqual;
case ',': return GHOST_kKeyComma;
case '.': return GHOST_kKeyPeriod;
case '/': return GHOST_kKeySlash;
case ';': return GHOST_kKeySemicolon;
case '\'': return GHOST_kKeyQuote;
case '\\': return GHOST_kKeyBackslash;
case '[': return GHOST_kKeyLeftBracket;
case ']': return GHOST_kKeyRightBracket;
case '`': return GHOST_kKeyAccentGrave;
default:
return GHOST_kKeyUnknown;
}
}
}
return GHOST_kKeyUnknown;
}
>>>>>>> .merge-right.r30358
#pragma mark defines for 10.6 api not documented in 10.5
#ifndef MAC_OS_X_VERSION_10_6
enum {
@ -702,6 +1110,7 @@ GHOST_IWindow* GHOST_SystemCocoa::createWindow(
top = top > contentRect.origin.y ? top : contentRect.origin.y;
window = new GHOST_WindowCocoa (this, title, left, top, width, height, state, type, stereoVisual, numOfAASamples);
<<<<<<< .working
if (window) {
if (window->getValid()) {
@ -745,6 +1154,53 @@ GHOST_TSuccess GHOST_SystemCocoa::endFullScreen(void)
=======
if (window) {
if (window->getValid()) {
// Store the pointer to the window
GHOST_ASSERT(m_windowManager, "m_windowManager not initialized");
m_windowManager->addWindow(window);
m_windowManager->setActiveWindow(window);
//Need to tell window manager the new window is the active one (Cocoa does not send the event activate upon window creation)
pushEvent(new GHOST_Event(getMilliSeconds(), GHOST_kEventWindowActivate, window));
pushEvent(new GHOST_Event(getMilliSeconds(), GHOST_kEventWindowSize, window));
}
else {
GHOST_PRINT("GHOST_SystemCocoa::createWindow(): window invalid\n");
delete window;
window = 0;
}
}
else {
GHOST_PRINT("GHOST_SystemCocoa::createWindow(): could not create window\n");
}
[pool drain];
return window;
}
GHOST_TSuccess GHOST_SystemCocoa::beginFullScreen(const GHOST_DisplaySetting& setting, GHOST_IWindow** window, const bool stereoVisual)
{
GHOST_IWindow* currentWindow = m_windowManager->getActiveWindow();
*window = currentWindow;
if(!currentWindow) return GHOST_kFailure;
return currentWindow->setState(GHOST_kWindowStateFullScreen);
}
GHOST_TSuccess GHOST_SystemCocoa::endFullScreen(void)
{
GHOST_IWindow* currentWindow = m_windowManager->getActiveWindow();
if(!currentWindow) return GHOST_kFailure;
return currentWindow->setState(GHOST_kWindowStateNormal);
}
>>>>>>> .merge-right.r30358
/**
* @note : returns coordinates in Cocoa screen coordinates
*/
@ -761,10 +1217,39 @@ GHOST_TSuccess GHOST_SystemCocoa::getCursorPosition(GHOST_TInt32& x, GHOST_TInt3
/**
* @note : expect Cocoa screen coordinates
*/
<<<<<<< .working
GHOST_TSuccess GHOST_SystemCocoa::setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y) const
{
float xf=(float)x, yf=(float)y;
=======
GHOST_TSuccess GHOST_SystemCocoa::setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y)
{
GHOST_TInt32 wx,wy;
GHOST_WindowCocoa* window = (GHOST_WindowCocoa*)m_windowManager->getActiveWindow();
if (!window) return GHOST_kFailure;
//Cursor and mouse dissociation placed here not to interfere with continuous grab
// (in cont. grab setMouseCursorPosition is directly called)
CGAssociateMouseAndMouseCursorPosition(false);
setMouseCursorPosition(x, y);
CGAssociateMouseAndMouseCursorPosition(true);
//Force mouse move event (not pushed by Cocoa)
window->screenToClient(x, y, wx, wy);
pushEvent(new GHOST_EventCursor(getMilliSeconds(), GHOST_kEventCursorMove, window, wx,wy));
m_outsideLoopEventProcessed = true;
return GHOST_kSuccess;
}
GHOST_TSuccess GHOST_SystemCocoa::setMouseCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y)
{
float xf=(float)x, yf=(float)y;
>>>>>>> .merge-right.r30358
GHOST_WindowCocoa* window = (GHOST_WindowCocoa*)m_windowManager->getActiveWindow();
if (!window) return GHOST_kFailure;
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSScreen *windowScreen = window->getScreen();
NSRect screenRect = [windowScreen frame];
@ -777,12 +1262,22 @@ GHOST_TSuccess GHOST_SystemCocoa::setCursorPosition(GHOST_TInt32 x, GHOST_TInt32
CGDisplayMoveCursorToPoint((CGDirectDisplayID)[[[windowScreen deviceDescription] objectForKey:@"NSScreenNumber"] unsignedIntValue], CGPointMake(xf, yf));
<<<<<<< .working
return GHOST_kSuccess;
}
GHOST_TSuccess GHOST_SystemCocoa::getModifierKeys(GHOST_ModifierKeys& keys) const
{
=======
[pool drain];
return GHOST_kSuccess;
}
GHOST_TSuccess GHOST_SystemCocoa::getModifierKeys(GHOST_ModifierKeys& keys) const
{
>>>>>>> .merge-right.r30358
keys.set(GHOST_kModifierKeyCommand, (m_modifierMask & NSCommandKeyMask) ? true : false);
keys.set(GHOST_kModifierKeyLeftAlt, (m_modifierMask & NSAlternateKeyMask) ? true : false);
keys.set(GHOST_kModifierKeyLeftShift, (m_modifierMask & NSShiftKeyMask) ? true : false);
@ -1040,7 +1535,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleDraggingEvent(GHOST_TEventType eventType
{
droppedStr = [droppedArray objectAtIndex:i];
pastedTextSize = [droppedStr lengthOfBytesUsingEncoding:NSISOLatin1StringEncoding];
pastedTextSize = [droppedStr lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
temp_buff = (GHOST_TUns8*) malloc(pastedTextSize+1);
if (!temp_buff) {
@ -1048,7 +1543,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleDraggingEvent(GHOST_TEventType eventType
break;
}
strncpy((char*)temp_buff, [droppedStr cStringUsingEncoding:NSISOLatin1StringEncoding], pastedTextSize);
strncpy((char*)temp_buff, [droppedStr cStringUsingEncoding:NSUTF8StringEncoding], pastedTextSize);
temp_buff[pastedTextSize] = '\0';
strArray->strings[i] = temp_buff;
@ -1059,7 +1554,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleDraggingEvent(GHOST_TEventType eventType
case GHOST_kDragnDropTypeString:
droppedStr = (NSString*)data;
pastedTextSize = [droppedStr lengthOfBytesUsingEncoding:NSISOLatin1StringEncoding];
pastedTextSize = [droppedStr lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
temp_buff = (GHOST_TUns8*) malloc(pastedTextSize+1);
@ -1067,7 +1562,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleDraggingEvent(GHOST_TEventType eventType
return GHOST_kFailure;
}
strncpy((char*)temp_buff, [droppedStr cStringUsingEncoding:NSISOLatin1StringEncoding], pastedTextSize);
strncpy((char*)temp_buff, [droppedStr cStringUsingEncoding:NSUTF8StringEncoding], pastedTextSize);
temp_buff[pastedTextSize] = '\0';
@ -1467,7 +1962,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
//Set new cursor position
window->clientToScreen(x_mouse, y_mouse, x_cur, y_cur);
setCursorPosition(x_cur, y_cur); /* wrap */
setMouseCursorPosition(x_cur, y_cur); /* wrap */
//Post event
window->getCursorGrabInitPos(x_cur, y_cur);
@ -1573,9 +2068,15 @@ GHOST_TSuccess GHOST_SystemCocoa::handleKeyEvent(void *eventPtr)
charsIgnoringModifiers = [event charactersIgnoringModifiers];
if ([charsIgnoringModifiers length]>0)
keyCode = convertKey([event keyCode],
[charsIgnoringModifiers characterAtIndex:0]);
[charsIgnoringModifiers characterAtIndex:0],
[event type] == NSKeyDown?kUCKeyActionDown:kUCKeyActionUp);
else
<<<<<<< .working
keyCode = convertKey([event keyCode],0);
=======
keyCode = convertKey([event keyCode],0,
[event type] == NSKeyDown?kUCKeyActionDown:kUCKeyActionUp);
>>>>>>> .merge-right.r30358
characters = [event characters];
@ -1595,14 +2096,28 @@ GHOST_TSuccess GHOST_SystemCocoa::handleKeyEvent(void *eventPtr)
if ([event type] == NSKeyDown) {
pushEvent( new GHOST_EventKey([event timestamp]*1000, GHOST_kEventKeyDown, window, keyCode, ascii) );
<<<<<<< .working
//printf("\nKey pressed keyCode=%u ascii=%i %c",keyCode,ascii,ascii);
} else {
=======
//printf("\nKey down rawCode=0x%x charsIgnoringModifiers=%c keyCode=%u ascii=%i %c",[event keyCode],[charsIgnoringModifiers length]>0?[charsIgnoringModifiers characterAtIndex:0]:' ',keyCode,ascii,ascii);
} else {
>>>>>>> .merge-right.r30358
pushEvent( new GHOST_EventKey([event timestamp]*1000, GHOST_kEventKeyUp, window, keyCode, ascii) );
<<<<<<< .working
}
break;
case NSFlagsChanged:
modifiers = [event modifierFlags];
=======
//printf("\nKey up rawCode=0x%x charsIgnoringModifiers=%c keyCode=%u ascii=%i %c",[event keyCode],[charsIgnoringModifiers length]>0?[charsIgnoringModifiers characterAtIndex:0]:' ',keyCode,ascii,ascii);
}
break;
case NSFlagsChanged:
modifiers = [event modifierFlags];
>>>>>>> .merge-right.r30358
if ((modifiers & NSShiftKeyMask) != (m_modifierMask & NSShiftKeyMask)) {
pushEvent( new GHOST_EventKey([event timestamp]*1000, (modifiers & NSShiftKeyMask)?GHOST_kEventKeyDown:GHOST_kEventKeyUp, window, GHOST_kKeyLeftShift) );
@ -1718,22 +2233,16 @@ const GHOST_TUns8* GHOST_SystemCocoa::getSystemDir() const
{
static GHOST_TUns8 tempPath[512] = "";
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSFileManager *fileManager;
NSString *basePath;
NSArray *paths;
paths = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSLocalDomainMask, YES);
if ([paths count] > 0)
basePath = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"Blender"];
else { //Fall back to standard unix path in case of issue
basePath = @"/usr/share/blender";
}
/* Ensure path exists, creates it if needed */
fileManager = [NSFileManager defaultManager];
if (![fileManager fileExistsAtPath:basePath isDirectory:NULL]) {
[fileManager createDirectoryAtPath:basePath attributes:nil];
basePath = [paths objectAtIndex:0];
else {
[pool drain];
return NULL;
}
strcpy((char*)tempPath, [basePath cStringUsingEncoding:NSASCIIStringEncoding]);
@ -1746,22 +2255,35 @@ const GHOST_TUns8* GHOST_SystemCocoa::getUserDir() const
{
static GHOST_TUns8 tempPath[512] = "";
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSFileManager *fileManager;
NSString *basePath;
NSArray *paths;
paths = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES);
if ([paths count] > 0)
basePath = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"Blender"];
else { //Fall back to HOME in case of issue
basePath = [NSHomeDirectory() stringByAppendingPathComponent:@".blender"];
basePath = [paths objectAtIndex:0];
else {
[pool drain];
return NULL;
}
strcpy((char*)tempPath, [basePath cStringUsingEncoding:NSASCIIStringEncoding]);
/* Ensure path exists, creates it if needed */
fileManager = [NSFileManager defaultManager];
if (![fileManager fileExistsAtPath:basePath isDirectory:NULL]) {
[fileManager createDirectoryAtPath:basePath attributes:nil];
[pool drain];
return tempPath;
}
const GHOST_TUns8* GHOST_SystemCocoa::getBinaryDir() const
{
static GHOST_TUns8 tempPath[512] = "";
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSString *basePath;
basePath = [[NSBundle mainBundle] bundlePath];
if (basePath == nil) {
[pool drain];
return NULL;
}
strcpy((char*)tempPath, [basePath cStringUsingEncoding:NSASCIIStringEncoding]);

View File

@ -34,13 +34,17 @@
* @date May 7, 2001
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "GHOST_SystemWin32.h"
#include "GHOST_EventDragnDrop.h"
#define WIN32_LEAN_AND_MEAN
#ifdef _WIN32_IE
#undef _WIN32_IE
#endif
#define _WIN32_IE 0x0501
#include <windows.h>
#include <shlobj.h>
// win64 doesn't define GWL_USERDATA
#ifdef WIN32
#ifndef GWL_USERDATA
@ -273,8 +277,10 @@ GHOST_TSuccess GHOST_SystemWin32::getCursorPosition(GHOST_TInt32& x, GHOST_TInt3
}
GHOST_TSuccess GHOST_SystemWin32::setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y) const
GHOST_TSuccess GHOST_SystemWin32::setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y)
{
if (!GetActiveWindow())
return GHOST_kFailure;
return ::SetCursorPos(x, y) == TRUE ? GHOST_kSuccess : GHOST_kFailure;
}
@ -1097,10 +1103,36 @@ void GHOST_SystemWin32::putClipboard(GHOST_TInt8 *buffer, bool selection) const
const GHOST_TUns8* GHOST_SystemWin32::getSystemDir() const
{
static char knownpath[MAX_PATH];
HRESULT hResult = SHGetFolderPath(NULL, CSIDL_COMMON_APPDATA, NULL, SHGFP_TYPE_CURRENT, knownpath);
if (hResult == S_OK)
{
return (GHOST_TUns8*)knownpath;
}
return NULL;
}
const GHOST_TUns8* GHOST_SystemWin32::getUserDir() const
{
static char knownpath[MAX_PATH];
HRESULT hResult = SHGetFolderPath(NULL, CSIDL_APPDATA, NULL, SHGFP_TYPE_CURRENT, knownpath);
if (hResult == S_OK)
{
return (GHOST_TUns8*)knownpath;
}
return NULL;
}
const GHOST_TUns8* GHOST_SystemWin32::getBinaryDir() const
{
static char fullname[MAX_PATH];
if(GetModuleFileName(0, fullname, MAX_PATH)) {
return (GHOST_TUns8*)fullname;
}
return NULL;
}

View File

@ -153,7 +153,7 @@ public:
* @param y The y-coordinate of the cursor.
* @return Indication of success.
*/
virtual GHOST_TSuccess setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y) const;
virtual GHOST_TSuccess setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y);
/***************************************************************************************
** Access to mouse button and keyboard states.
@ -186,22 +186,27 @@ public:
* @return No return
*/
virtual void putClipboard(GHOST_TInt8 *buffer, bool selection) const;
/**
* Determine the base dir in which shared resources are located. It will first try to use
* "unpack and run" path, then look for properly installed path, not including versioning.
* @return Unsigned char string pointing to system dir (eg /usr/share/blender/).
* @return Unsigned char string pointing to system dir (eg /usr/share/).
*/
virtual const GHOST_TUns8* getSystemDir() const;
/**
* Determine the base dir in which user configuration is stored, not including versioning.
* If needed, it will create the base directory.
* @return Unsigned char string pointing to user dir (eg ~/.blender/).
* @return Unsigned char string pointing to user dir (eg ~/).
*/
virtual const GHOST_TUns8* getUserDir() const;
/**
* Determine the directory of the current binary
* @return Unsigned char string pointing to the binary dir
*/
virtual const GHOST_TUns8* getBinaryDir() const;
/**
* Creates a drag'n'drop event and pushes it immediately onto the event queue.
* Called by GHOST_DropTargetWin32 class.

View File

@ -29,10 +29,6 @@
* ***** END GPL LICENSE BLOCK *****
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "GHOST_SystemX11.h"
#include "GHOST_WindowX11.h"
#include "GHOST_WindowManager.h"
@ -469,7 +465,7 @@ GHOST_SystemX11::processEvent(XEvent *xe)
/* could also clamp to screen bounds
* wrap with a window outside the view will fail atm */
bounds.wrapPoint(x_new, y_new, 2); /* offset of one incase blender is at screen bounds */
bounds.wrapPoint(x_new, y_new, 8); /* offset of one incase blender is at screen bounds */
window->getCursorGrabAccum(x_accum, y_accum);
if(x_new != xme.x_root || y_new != xme.y_root) {
@ -536,38 +532,43 @@ GHOST_SystemX11::processEvent(XEvent *xe)
}
case ButtonPress:
{
/* process wheel mouse events and break */
if (xe->xbutton.button == 4) {
g_event = new GHOST_EventWheel(getMilliSeconds(), window, 1);
break;
}
if (xe->xbutton.button == 5) {
g_event = new GHOST_EventWheel(getMilliSeconds(), window, -1);
break;
}
}
case ButtonRelease:
{
XButtonEvent & xbe = xe->xbutton;
GHOST_TButtonMask gbmask = GHOST_kButtonMaskLeft;
switch (xbe.button) {
case Button1 : gbmask = GHOST_kButtonMaskLeft; break;
case Button3 : gbmask = GHOST_kButtonMaskRight; break;
/* It seems events 6 and 7 are for horizontal scrolling.
* you can re-order button mapping like this... (swaps 6,7 with 8,9)
* xmodmap -e "pointer = 1 2 3 4 5 8 9 6 7"
*/
case 8 : gbmask = GHOST_kButtonMaskButton4; break; /* Button4 is the wheel */
case 9 : gbmask = GHOST_kButtonMaskButton5; break; /* Button5 is a wheel too */
default:
case Button2 : gbmask = GHOST_kButtonMaskMiddle; break;
}
GHOST_TEventType type = (xbe.type == ButtonPress) ?
GHOST_kEventButtonDown : GHOST_kEventButtonUp;
/* process wheel mouse events and break, only pass on press events */
if(xbe.button == Button4) {
if(xbe.type == ButtonPress)
g_event = new GHOST_EventWheel(getMilliSeconds(), window, 1);
break;
}
else if(xbe.button == Button5) {
if(xbe.type == ButtonPress)
g_event = new GHOST_EventWheel(getMilliSeconds(), window, -1);
break;
}
/* process rest of normal mouse buttons */
if(xbe.button == Button1)
gbmask = GHOST_kButtonMaskLeft;
else if(xbe.button == Button2)
gbmask = GHOST_kButtonMaskMiddle;
else if(xbe.button == Button3)
gbmask = GHOST_kButtonMaskRight;
/* It seems events 6 and 7 are for horizontal scrolling.
* you can re-order button mapping like this... (swaps 6,7 with 8,9)
* xmodmap -e "pointer = 1 2 3 4 5 8 9 6 7"
*/
else if(xbe.button == 8)
gbmask = GHOST_kButtonMaskButton4;
else if(xbe.button == 9)
gbmask = GHOST_kButtonMaskButton5;
else
break;
g_event = new
GHOST_EventButton(
getMilliSeconds(),
@ -965,7 +966,7 @@ GHOST_SystemX11::
setCursorPosition(
GHOST_TInt32 x,
GHOST_TInt32 y
) const {
) {
// This is a brute force move in screen coordinates
// XWarpPointer does relative moves so first determine the
@ -1460,19 +1461,21 @@ void GHOST_SystemX11::putClipboard(GHOST_TInt8 *buffer, bool selection) const
const GHOST_TUns8* GHOST_SystemX11::getSystemDir() const
{
return (GHOST_TUns8*)"/usr/share/blender";
return (GHOST_TUns8*)"/usr/share";
}
const GHOST_TUns8* GHOST_SystemX11::getUserDir() const
{
static char path[256];
char* env = getenv("HOME");
if(env) {
strncpy(path, env, 245);
path[245]=0;
strcat(path, "/.blender/");
return (GHOST_TUns8*) path;
return (GHOST_TUns8*) env;
} else {
return NULL;
}
}
const GHOST_TUns8* GHOST_SystemX11::getBinaryDir() const
{
return NULL;
}

View File

@ -158,7 +158,7 @@ public:
setCursorPosition(
GHOST_TInt32 x,
GHOST_TInt32 y
) const;
);
/**
* Returns the state of all modifier keys.
@ -240,6 +240,12 @@ public:
*/
const GHOST_TUns8* getUserDir() const;
/**
* Determine the directory of the current binary
* @return Unsigned char string pointing to the binary dir
*/
const GHOST_TUns8* getBinaryDir() const;
/**
* Atom used for ICCCM, WM-spec and Motif.
* We only need get this atom at the start, it's relative

View File

@ -34,10 +34,6 @@
* @date May 31, 2001
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "GHOST_TimerManager.h"
#include <algorithm>

View File

@ -32,10 +32,6 @@
* @date May 10, 2001
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "GHOST_Window.h"
@ -57,6 +53,8 @@ GHOST_Window::GHOST_Window(
m_isUnsavedChanges = false;
m_canAcceptDragOperation = false;
m_progressBarVisible = false;
m_cursorGrabAccumPos[0] = 0;
m_cursorGrabAccumPos[1] = 0;

View File

@ -191,6 +191,17 @@ public:
*/
virtual GHOST_TSuccess getCursorGrabBounds(GHOST_Rect& bounds);
/**
* Sets the progress bar value displayed in the window/application icon
* @param progress The progress % (0.0 to 1.0)
*/
virtual GHOST_TSuccess setProgressBar(float progress) {return GHOST_kFailure;};
/**
* Hides the progress bar in the icon
*/
virtual GHOST_TSuccess endProgressBar() {return GHOST_kFailure;};
/**
* Tells if the ongoing drag'n'drop object can be accepted upon mouse drop
*/
@ -313,6 +324,9 @@ protected:
/** The current shape of the cursor */
GHOST_TStandardCursor m_cursorShape;
/** The presence of progress indicator with the application icon */
bool m_progressBarVisible;
/** The acceptance of the "drop candidate" of the current drag'n'drop operation */
bool m_canAcceptDragOperation;

View File

@ -34,10 +34,6 @@
* @date May 10, 2001
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "GHOST_WindowCarbon.h"
#include "GHOST_Debug.h"
@ -46,7 +42,7 @@ AGLContext GHOST_WindowCarbon::s_firstaglCtx = NULL;
const GHOST_TInt32 GHOST_WindowCarbon::s_sizeRectSize = 16;
#endif //GHOST_DRAW_CARBON_GUTTER
static const GLint sPreferredFormatWindow[8] = {
static const GLint sPreferredFormatWindow[10] = {
AGL_RGBA,
AGL_DOUBLEBUFFER,
AGL_ACCELERATED,
@ -54,7 +50,7 @@ AGL_DEPTH_SIZE, 32,
AGL_NONE,
};
static const GLint sPreferredFormatFullScreen[9] = {
static const GLint sPreferredFormatFullScreen[11] = {
AGL_RGBA,
AGL_DOUBLEBUFFER,
AGL_ACCELERATED,

View File

@ -226,6 +226,17 @@ public:
GHOST_TabletData& GetCocoaTabletData()
{ return m_tablet; }
/**
* Sets the progress bar value displayed in the window/application icon
* @param progress The progress % (0.0 to 1.0)
*/
virtual GHOST_TSuccess setProgressBar(float progress);
/**
* Hides the progress bar icon
*/
virtual GHOST_TSuccess endProgressBar();
protected:
/**
* Tries to install a rendering context in this window.
@ -291,14 +302,6 @@ protected:
NSCursor* m_customCursor;
GHOST_TabletData m_tablet;
/**
* The width/height of the size rectangle in the lower right corner of a
* Mac/Carbon window. This is also the height of the gutter area.
*/
#ifdef GHOST_DRAW_CARBON_GUTTER
static const GHOST_TInt32 s_sizeRectSize;
#endif // GHOST_DRAW_CARBON_GUTTER
};
#endif // _GHOST_WINDOW_COCOA_H_

View File

@ -167,7 +167,7 @@ extern "C" {
else if ([[draggingPBoard types] containsObject:NSStringPboardType]) m_draggedObjectType = GHOST_kDragnDropTypeString;
else return NSDragOperationNone;
associatedWindow->setAcceptDragOperation(FALSE); //Drag operation needs to be accepted explicitly by the event manager
associatedWindow->setAcceptDragOperation(TRUE); //Drag operation is accepted by default
systemCocoa->handleDraggingEvent(GHOST_kEventDraggingEntered, m_draggedObjectType, associatedWindow, mouseLocation.x, mouseLocation.y, nil);
return NSDragOperationCopy;
}
@ -348,10 +348,11 @@ GHOST_WindowCocoa::GHOST_WindowCocoa(
pixelFormatAttrsWindow[i++] = NSOpenGLPFAAccelerated;
//pixelFormatAttrsWindow[i++] = NSOpenGLPFAAllowOfflineRenderers,; // Removed to allow 10.4 builds, and 2 GPUs rendering is not used anyway
pixelFormatAttrsWindow[i++] = NSOpenGLPFADepthSize;
pixelFormatAttrsWindow[i++] = (NSOpenGLPixelFormatAttribute) 32;
if (stereoVisual) pixelFormatAttrsWindow[i++] = NSOpenGLPFAStereo;
if (numOfAASamples>0) {
@ -692,12 +693,239 @@ void GHOST_WindowCocoa::clientToScreen(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST
}
<<<<<<< .working
=======
void GHOST_WindowCocoa::setTitle(const STR_String& title)
{
GHOST_ASSERT(getValid(), "GHOST_WindowCocoa::setTitle(): window invalid")
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSString *windowTitle = [[NSString alloc] initWithUTF8String:title];
//Set associated file if applicable
if ([windowTitle hasPrefix:@"Blender"])
{
NSRange fileStrRange;
NSString *associatedFileName;
int len;
fileStrRange.location = [windowTitle rangeOfString:@"["].location+1;
len = [windowTitle rangeOfString:@"]"].location - fileStrRange.location;
if (len >0)
{
fileStrRange.length = len;
associatedFileName = [windowTitle substringWithRange:fileStrRange];
@try {
[m_window setRepresentedFilename:associatedFileName];
}
@catch (NSException * e) {
printf("\nInvalid file path given in window title");
}
[m_window setTitle:[associatedFileName lastPathComponent]];
}
else {
[m_window setTitle:windowTitle];
[m_window setRepresentedFilename:@""];
}
} else {
[m_window setTitle:windowTitle];
[m_window setRepresentedFilename:@""];
}
[windowTitle release];
[pool drain];
}
void GHOST_WindowCocoa::getTitle(STR_String& title) const
{
GHOST_ASSERT(getValid(), "GHOST_WindowCocoa::getTitle(): window invalid")
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSString *windowTitle = [m_window title];
if (windowTitle != nil) {
title = [windowTitle UTF8String];
}
[pool drain];
}
void GHOST_WindowCocoa::getWindowBounds(GHOST_Rect& bounds) const
{
NSRect rect;
GHOST_ASSERT(getValid(), "GHOST_WindowCocoa::getWindowBounds(): window invalid")
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSRect screenSize = [[m_window screen] visibleFrame];
rect = [m_window frame];
bounds.m_b = screenSize.size.height - (rect.origin.y -screenSize.origin.y);
bounds.m_l = rect.origin.x -screenSize.origin.x;
bounds.m_r = rect.origin.x-screenSize.origin.x + rect.size.width;
bounds.m_t = screenSize.size.height - (rect.origin.y + rect.size.height -screenSize.origin.y);
[pool drain];
}
void GHOST_WindowCocoa::getClientBounds(GHOST_Rect& bounds) const
{
NSRect rect;
GHOST_ASSERT(getValid(), "GHOST_WindowCocoa::getClientBounds(): window invalid")
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
if (!m_fullScreen)
{
NSRect screenSize = [[m_window screen] visibleFrame];
//Max window contents as screen size (excluding title bar...)
NSRect contentRect = [CocoaWindow contentRectForFrameRect:screenSize
styleMask:(NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask)];
rect = [m_window contentRectForFrameRect:[m_window frame]];
bounds.m_b = contentRect.size.height - (rect.origin.y -contentRect.origin.y);
bounds.m_l = rect.origin.x -contentRect.origin.x;
bounds.m_r = rect.origin.x-contentRect.origin.x + rect.size.width;
bounds.m_t = contentRect.size.height - (rect.origin.y + rect.size.height -contentRect.origin.y);
}
else {
NSRect screenSize = [[m_window screen] frame];
bounds.m_b = screenSize.origin.y + screenSize.size.height;
bounds.m_l = screenSize.origin.x;
bounds.m_r = screenSize.origin.x + screenSize.size.width;
bounds.m_t = screenSize.origin.y;
}
[pool drain];
}
GHOST_TSuccess GHOST_WindowCocoa::setClientWidth(GHOST_TUns32 width)
{
GHOST_ASSERT(getValid(), "GHOST_WindowCocoa::setClientWidth(): window invalid")
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
GHOST_Rect cBnds, wBnds;
getClientBounds(cBnds);
if (((GHOST_TUns32)cBnds.getWidth()) != width) {
NSSize size;
size.width=width;
size.height=cBnds.getHeight();
[m_window setContentSize:size];
}
[pool drain];
return GHOST_kSuccess;
}
GHOST_TSuccess GHOST_WindowCocoa::setClientHeight(GHOST_TUns32 height)
{
GHOST_ASSERT(getValid(), "GHOST_WindowCocoa::setClientHeight(): window invalid")
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
GHOST_Rect cBnds, wBnds;
getClientBounds(cBnds);
if (((GHOST_TUns32)cBnds.getHeight()) != height) {
NSSize size;
size.width=cBnds.getWidth();
size.height=height;
[m_window setContentSize:size];
}
[pool drain];
return GHOST_kSuccess;
}
GHOST_TSuccess GHOST_WindowCocoa::setClientSize(GHOST_TUns32 width, GHOST_TUns32 height)
{
GHOST_ASSERT(getValid(), "GHOST_WindowCocoa::setClientSize(): window invalid")
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
GHOST_Rect cBnds, wBnds;
getClientBounds(cBnds);
if ((((GHOST_TUns32)cBnds.getWidth()) != width) ||
(((GHOST_TUns32)cBnds.getHeight()) != height)) {
NSSize size;
size.width=width;
size.height=height;
[m_window setContentSize:size];
}
[pool drain];
return GHOST_kSuccess;
}
GHOST_TWindowState GHOST_WindowCocoa::getState() const
{
GHOST_ASSERT(getValid(), "GHOST_WindowCocoa::getState(): window invalid")
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
GHOST_TWindowState state;
if (m_fullScreen) {
state = GHOST_kWindowStateFullScreen;
}
else if ([m_window isMiniaturized]) {
state = GHOST_kWindowStateMinimized;
}
else if ([m_window isZoomed]) {
state = GHOST_kWindowStateMaximized;
}
else {
state = GHOST_kWindowStateNormal;
}
[pool drain];
return state;
}
void GHOST_WindowCocoa::screenToClient(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY) const
{
GHOST_ASSERT(getValid(), "GHOST_WindowCocoa::screenToClient(): window invalid")
NSPoint screenCoord;
NSPoint baseCoord;
screenCoord.x = inX;
screenCoord.y = inY;
baseCoord = [m_window convertScreenToBase:screenCoord];
outX = baseCoord.x;
outY = baseCoord.y;
}
void GHOST_WindowCocoa::clientToScreen(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY) const
{
GHOST_ASSERT(getValid(), "GHOST_WindowCocoa::clientToScreen(): window invalid")
NSPoint screenCoord;
NSPoint baseCoord;
baseCoord.x = inX;
baseCoord.y = inY;
screenCoord = [m_window convertBaseToScreen:baseCoord];
outX = screenCoord.x;
outY = screenCoord.y;
}
>>>>>>> .merge-right.r30358
NSScreen* GHOST_WindowCocoa::getScreen()
{
return [m_window screen];
}
<<<<<<< .working
/**
* @note Fullscreen switch is not actual fullscreen with display capture. As this capture removes all OS X window manager features.
* Instead, the menu bar and the dock are hidden, and the window is made borderless and enlarged.
@ -733,7 +961,45 @@ GHOST_TSuccess GHOST_WindowCocoa::setState(GHOST_TWindowState state)
//Make window borderless and enlarge it
[m_window setStyleMask:NSBorderlessWindowMask];
[m_window setFrame:[[m_window screen] frame] display:YES];
=======
/**
* @note Fullscreen switch is not actual fullscreen with display capture. As this capture removes all OS X window manager features.
* Instead, the menu bar and the dock are hidden, and the window is made borderless and enlarged.
* Thus, process switch, exposé, spaces, ... still work in fullscreen mode
*/
GHOST_TSuccess GHOST_WindowCocoa::setState(GHOST_TWindowState state)
{
GHOST_ASSERT(getValid(), "GHOST_WindowCocoa::setState(): window invalid")
switch (state) {
case GHOST_kWindowStateMinimized:
[m_window miniaturize:nil];
break;
case GHOST_kWindowStateMaximized:
[m_window zoom:nil];
break;
case GHOST_kWindowStateFullScreen:
if (!m_fullScreen)
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
//This status change needs to be done before Cocoa call to enter fullscreen mode
//to give window delegate hint not to forward its deactivation to ghost wm that doesn't know view/window difference
m_fullScreen = true;
#ifdef MAC_OS_X_VERSION_10_6
//10.6 provides Cocoa functions to autoshow menu bar, and to change a window style
//Hide menu & dock if needed
if ([[m_window screen] isEqual:[[NSScreen screens] objectAtIndex:0]])
{
[NSApp setPresentationOptions:(NSApplicationPresentationHideDock | NSApplicationPresentationAutoHideMenuBar)];
}
//Make window borderless and enlarge it
[m_window setStyleMask:NSBorderlessWindowMask];
[m_window setFrame:[[m_window screen] frame] display:YES];
>>>>>>> .merge-right.r30358
[m_window makeFirstResponder:m_openGLView];
<<<<<<< .working
#else
//With 10.5, we need to create a new window to change its style to borderless
//Hide menu & dock if needed
@ -791,6 +1057,65 @@ GHOST_TSuccess GHOST_WindowCocoa::setState(GHOST_TWindowState state)
//Make window normal and resize it
[m_window setStyleMask:(NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask)];
[m_window setFrame:[[m_window screen] visibleFrame] display:YES];
=======
#else
//With 10.5, we need to create a new window to change its style to borderless
//Hide menu & dock if needed
if ([[m_window screen] isEqual:[[NSScreen screens] objectAtIndex:0]])
{
//Cocoa function in 10.5 does not allow to set the menu bar in auto-show mode [NSMenu setMenuBarVisible:NO];
//One of the very few 64bit compatible Carbon function
SetSystemUIMode(kUIModeAllHidden,kUIOptionAutoShowMenuBar);
}
//Create a fullscreen borderless window
CocoaWindow *tmpWindow = [[CocoaWindow alloc]
initWithContentRect:[[m_window screen] frame]
styleMask:NSBorderlessWindowMask
backing:NSBackingStoreBuffered
defer:YES];
//Copy current window parameters
[tmpWindow setTitle:[m_window title]];
[tmpWindow setRepresentedFilename:[m_window representedFilename]];
[tmpWindow setReleasedWhenClosed:NO];
[tmpWindow setAcceptsMouseMovedEvents:YES];
[tmpWindow setDelegate:[m_window delegate]];
//Assign the openGL view to the new window
[tmpWindow setContentView:m_openGLView];
//Show the new window
[tmpWindow makeKeyAndOrderFront:nil];
//Close and release old window
[m_window setDelegate:nil]; // To avoid the notification of "window closed" event
[m_window close];
[m_window release];
m_window = tmpWindow;
#endif
//Tell WM of view new size
m_systemCocoa->handleWindowEvent(GHOST_kEventWindowSize, this);
[pool drain];
}
break;
case GHOST_kWindowStateNormal:
default:
if (m_fullScreen)
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
m_fullScreen = false;
//Exit fullscreen
#ifdef MAC_OS_X_VERSION_10_6
//Show again menu & dock if needed
if ([[m_window screen] isEqual:[NSScreen mainScreen]])
{
[NSApp setPresentationOptions:NSApplicationPresentationDefault];
}
//Make window normal and resize it
[m_window setStyleMask:(NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask)];
[m_window setFrame:[[m_window screen] visibleFrame] display:YES];
>>>>>>> .merge-right.r30358
//TODO for 10.6 only : window title is forgotten after the style change
[m_window makeFirstResponder:m_openGLView];
#else
@ -969,6 +1294,7 @@ GHOST_TSuccess GHOST_WindowCocoa::installDrawingContext(GHOST_TDrawingContextTyp
m_openGLContext = tmpOpenGLContext;
break;
<<<<<<< .working
case GHOST_kDrawingContextTypeNone:
success = GHOST_kSuccess;
break;
@ -1077,7 +1403,176 @@ void GHOST_WindowCocoa::loadCursor(bool visible, GHOST_TStandardCursor cursor) c
case GHOST_kStandardCursorTopRightCorner:
case GHOST_kStandardCursorBottomRightCorner:
case GHOST_kStandardCursorBottomLeftCorner:
=======
case GHOST_kDrawingContextTypeNone:
success = GHOST_kSuccess;
break;
default:
break;
}
[pool drain];
return success;
}
GHOST_TSuccess GHOST_WindowCocoa::removeDrawingContext()
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
switch (m_drawingContextType) {
case GHOST_kDrawingContextTypeOpenGL:
if (m_openGLContext)
{
[m_openGLView clearGLContext];
if (s_firstOpenGLcontext == m_openGLContext) s_firstOpenGLcontext = nil;
m_openGLContext = nil;
}
[pool drain];
return GHOST_kSuccess;
case GHOST_kDrawingContextTypeNone:
[pool drain];
return GHOST_kSuccess;
break;
default:
[pool drain];
return GHOST_kFailure;
}
}
GHOST_TSuccess GHOST_WindowCocoa::invalidate()
{
GHOST_ASSERT(getValid(), "GHOST_WindowCocoa::invalidate(): window invalid")
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
[m_openGLView setNeedsDisplay:YES];
[pool drain];
return GHOST_kSuccess;
}
#pragma mark Progress bar
GHOST_TSuccess GHOST_WindowCocoa::setProgressBar(float progress)
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
if ((progress >=0.0) && (progress <=1.0)) {
NSImage* dockIcon = [[NSImage alloc] initWithSize:NSMakeSize(128,128)];
[dockIcon lockFocus];
NSRect progressBox = {{4, 4}, {120, 16}};
[[NSImage imageNamed:@"NSApplicationIcon"] dissolveToPoint:NSZeroPoint fraction:1.0];
// Track & Outline
[[NSColor blackColor] setFill];
NSRectFill(progressBox);
[[NSColor whiteColor] set];
NSFrameRect(progressBox);
// Progress fill
progressBox = NSInsetRect(progressBox, 1, 1);
[[NSColor knobColor] setFill];
progressBox.size.width = progressBox.size.width * progress;
NSRectFill(progressBox);
[dockIcon unlockFocus];
[NSApp setApplicationIconImage:dockIcon];
[dockIcon release];
m_progressBarVisible = true;
}
[pool drain];
return GHOST_kSuccess;
}
GHOST_TSuccess GHOST_WindowCocoa::endProgressBar()
{
if (!m_progressBarVisible) return GHOST_kFailure;
m_progressBarVisible = false;
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSImage* dockIcon = [[NSImage alloc] initWithSize:NSMakeSize(128,128)];
[dockIcon lockFocus];
[[NSImage imageNamed:@"NSApplicationIcon"] dissolveToPoint:NSZeroPoint fraction:1.0];
[dockIcon unlockFocus];
[NSApp setApplicationIconImage:dockIcon];
[dockIcon release];
[pool drain];
return GHOST_kSuccess;
}
#pragma mark Cursor handling
void GHOST_WindowCocoa::loadCursor(bool visible, GHOST_TStandardCursor cursor) const
{
static bool systemCursorVisible = true;
NSCursor *tmpCursor =nil;
if (visible != systemCursorVisible) {
if (visible) {
[NSCursor unhide];
systemCursorVisible = true;
}
else {
[NSCursor hide];
systemCursorVisible = false;
}
}
if (cursor == GHOST_kStandardCursorCustom && m_customCursor) {
tmpCursor = m_customCursor;
} else {
switch (cursor) {
case GHOST_kStandardCursorDestroy:
tmpCursor = [NSCursor disappearingItemCursor];
break;
case GHOST_kStandardCursorText:
tmpCursor = [NSCursor IBeamCursor];
break;
case GHOST_kStandardCursorCrosshair:
tmpCursor = [NSCursor crosshairCursor];
break;
case GHOST_kStandardCursorUpDown:
tmpCursor = [NSCursor resizeUpDownCursor];
break;
case GHOST_kStandardCursorLeftRight:
tmpCursor = [NSCursor resizeLeftRightCursor];
break;
case GHOST_kStandardCursorTopSide:
tmpCursor = [NSCursor resizeUpCursor];
break;
case GHOST_kStandardCursorBottomSide:
tmpCursor = [NSCursor resizeDownCursor];
break;
case GHOST_kStandardCursorLeftSide:
tmpCursor = [NSCursor resizeLeftCursor];
break;
case GHOST_kStandardCursorRightSide:
tmpCursor = [NSCursor resizeRightCursor];
break;
case GHOST_kStandardCursorRightArrow:
case GHOST_kStandardCursorInfo:
case GHOST_kStandardCursorLeftArrow:
case GHOST_kStandardCursorHelp:
case GHOST_kStandardCursorCycle:
case GHOST_kStandardCursorSpray:
case GHOST_kStandardCursorWait:
case GHOST_kStandardCursorTopLeftCorner:
case GHOST_kStandardCursorTopRightCorner:
case GHOST_kStandardCursorBottomRightCorner:
case GHOST_kStandardCursorBottomLeftCorner:
>>>>>>> .merge-right.r30358
case GHOST_kStandardCursorCopy:
<<<<<<< .working
case GHOST_kStandardCursorDefault:
default:
tmpCursor = [NSCursor arrowCursor];
@ -1100,6 +1595,32 @@ GHOST_TSuccess GHOST_WindowCocoa::setWindowCursorVisibility(bool visible)
}
=======
case GHOST_kStandardCursorDefault:
default:
tmpCursor = [NSCursor arrowCursor];
break;
};
}
[tmpCursor set];
}
GHOST_TSuccess GHOST_WindowCocoa::setWindowCursorVisibility(bool visible)
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc]init];
if ([m_window isVisible]) {
loadCursor(visible, getCursorShape());
}
[pool drain];
return GHOST_kSuccess;
}
>>>>>>> .merge-right.r30358
GHOST_TSuccess GHOST_WindowCocoa::setWindowCursorGrab(GHOST_TGrabCursorMode mode)
{
GHOST_TSuccess err = GHOST_kSuccess;
@ -1142,6 +1663,7 @@ GHOST_TSuccess GHOST_WindowCocoa::setWindowCursorGrab(GHOST_TGrabCursorMode mode
m_cursorGrabBounds.m_l= m_cursorGrabBounds.m_r= -1; /* disable */
}
return err;
<<<<<<< .working
}
GHOST_TSuccess GHOST_WindowCocoa::setWindowCursorShape(GHOST_TStandardCursor shape)
@ -1205,6 +1727,74 @@ GHOST_TSuccess GHOST_WindowCocoa::setWindowCustomCursorShape(GHOST_TUns8 *bitmap
samplesPerPixel:2
hasAlpha:YES
isPlanar:YES
=======
}
GHOST_TSuccess GHOST_WindowCocoa::setWindowCursorShape(GHOST_TStandardCursor shape)
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
if (m_customCursor) {
[m_customCursor release];
m_customCursor = nil;
}
if ([m_window isVisible]) {
loadCursor(getCursorVisibility(), shape);
}
[pool drain];
return GHOST_kSuccess;
}
/** Reverse the bits in a GHOST_TUns8
static GHOST_TUns8 uns8ReverseBits(GHOST_TUns8 ch)
{
ch= ((ch>>1)&0x55) | ((ch<<1)&0xAA);
ch= ((ch>>2)&0x33) | ((ch<<2)&0xCC);
ch= ((ch>>4)&0x0F) | ((ch<<4)&0xF0);
return ch;
}
*/
/** Reverse the bits in a GHOST_TUns16 */
static GHOST_TUns16 uns16ReverseBits(GHOST_TUns16 shrt)
{
shrt= ((shrt>>1)&0x5555) | ((shrt<<1)&0xAAAA);
shrt= ((shrt>>2)&0x3333) | ((shrt<<2)&0xCCCC);
shrt= ((shrt>>4)&0x0F0F) | ((shrt<<4)&0xF0F0);
shrt= ((shrt>>8)&0x00FF) | ((shrt<<8)&0xFF00);
return shrt;
}
GHOST_TSuccess GHOST_WindowCocoa::setWindowCustomCursorShape(GHOST_TUns8 *bitmap, GHOST_TUns8 *mask,
int sizex, int sizey, int hotX, int hotY, int fg_color, int bg_color)
{
int y,nbUns16;
NSPoint hotSpotPoint;
NSBitmapImageRep *cursorImageRep;
NSImage *cursorImage;
NSSize imSize;
GHOST_TUns16 *cursorBitmap;
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
if (m_customCursor) {
[m_customCursor release];
m_customCursor = nil;
}
cursorImageRep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:nil
pixelsWide:sizex
pixelsHigh:sizey
bitsPerSample:1
samplesPerPixel:2
hasAlpha:YES
isPlanar:YES
>>>>>>> .merge-right.r30358
colorSpaceName:NSDeviceWhiteColorSpace
bytesPerRow:(sizex/8 + (sizex%8 >0 ?1:0))
bitsPerPixel:1];

View File

@ -34,10 +34,6 @@
* @date May 11, 2001
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "GHOST_WindowManager.h"
#include <algorithm>
#include "GHOST_Debug.h"

Some files were not shown because too many files have changed in this diff Show More