Merged
https://svn.blender.org/svnroot/bf-blender/branches/soc-2008-mxcurioni (r22789) and https://svn.blender.org/svnroot/bf-blender/trunk/blender (r23338) with the "Ignore ancestry" and "Ignore line endings" options enabled (using TortoiseSVN on Windows). After the merge operation, all changes (i.e., deletion) in source/blender/freestyle/ were reverted in order to keep the primary source tree of the Freestyle renderer.
This commit is contained in:
@@ -42,14 +42,40 @@ MACRO(SETUP_LIBDIRS)
|
||||
if(COMMAND cmake_policy)
|
||||
CMAKE_POLICY(SET CMP0003 NEW)
|
||||
endif(COMMAND cmake_policy)
|
||||
LINK_DIRECTORIES(${PYTHON_LIBPATH} ${SDL_LIBPATH} ${JPEG_LIBPATH} ${PNG_LIBPATH} ${ZLIB_LIBPATH} ${ICONV_LIBPATH} ${OPENEXR_LIBPATH} ${QUICKTIME_LIBPATH} ${FFMPEG_LIBPATH})
|
||||
|
||||
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})
|
||||
LINK_DIRECTORIES(${FREETYPE_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(WIN32)
|
||||
LINK_DIRECTORIES(${PTHREADS_LIBPATH})
|
||||
@@ -59,14 +85,48 @@ 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} ${PYTHON_LIB} ${PYTHON_LINKFLAGS} ${JPEG_LIB} ${PNG_LIB} ${ZLIB_LIB} ${SDL_LIB} ${LLIBS})
|
||||
#TARGET_LINK_LIBRARIES(${target} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${PYTHON_LIB} ${PYTHON_LINKFLAGS} ${JPEG_LIB} ${PNG_LIB} ${ZLIB_LIB} ${SDL_LIBRARY} ${LLIBS})
|
||||
|
||||
TARGET_LINK_LIBRARIES(${target} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${PYTHON_LINKFLAGS} ${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(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)
|
||||
|
||||
TARGET_LINK_LIBRARIES(${target} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${PYTHON_LINKFLAGS} ${JPEG_LIB} ${PNG_LIB} ${ZLIB_LIB} ${LLIBS})
|
||||
TARGET_LINK_LIBRARIES(${target} ${FREETYPE_LIBRARY} ${LIBSAMPLERATE_LIB})
|
||||
|
||||
# since we are using the local libs for python when compiling msvc projects, we need to add _d when compiling debug versions
|
||||
|
||||
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)
|
||||
|
||||
IF(WITH_INTERNATIONAL)
|
||||
TARGET_LINK_LIBRARIES(${target} ${FREETYPE_LIB})
|
||||
TARGET_LINK_LIBRARIES(${target} ${GETTEXT_LIB})
|
||||
ENDIF(WITH_INTERNATIONAL)
|
||||
IF(WITH_OPENAL)
|
||||
TARGET_LINK_LIBRARIES(${target} ${OPENAL_LIB})
|
||||
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(WIN32)
|
||||
TARGET_LINK_LIBRARIES(${target} ${ICONV_LIB})
|
||||
ENDIF(WIN32)
|
||||
@@ -83,3 +143,4 @@ MACRO(SETUP_LIBLINKS
|
||||
TARGET_LINK_LIBRARIES(${target} ${PTHREADS_LIB})
|
||||
ENDIF(WIN32)
|
||||
ENDMACRO(SETUP_LIBLINKS)
|
||||
|
||||
|
||||
737
CMakeLists.txt
737
CMakeLists.txt
@@ -34,11 +34,11 @@ IF(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
|
||||
MESSAGE(FATAL_ERROR "CMake generation for blender is not allowed within the source directory!
|
||||
Remove the CMakeCache.txt file and try again from another folder, e.g.:
|
||||
|
||||
rm CMakeCache.txt
|
||||
cd ..
|
||||
mkdir cmake-make
|
||||
cd cmake-make
|
||||
cmake -G \"Unix Makefiles\" ../blender
|
||||
rm CMakeCache.txt
|
||||
cd ..
|
||||
mkdir cmake-make
|
||||
cd cmake-make
|
||||
cmake -G \"Unix Makefiles\" ../blender
|
||||
")
|
||||
ENDIF(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
|
||||
|
||||
@@ -53,23 +53,30 @@ SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# 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_VERSE "Enable Verse (http://verse.blender.org)" OFF)
|
||||
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_FFMPEG "Enable FFMPeg Support (http://ffmpeg.mplayerhq.hu/)" OFF)
|
||||
OPTION(WITH_OPENAL "Enable OpenAL Support (http://www.openal.org)" ON)
|
||||
OPTION(WITH_OPENMP "Enable OpenMP (has to be supported by the compiler)" OFF)
|
||||
OPTION(WITH_WEBPLUGIN "Enable Web Plugin (Unix only)" OFF)
|
||||
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_OPENMP "Enable OpenMP (has to be supported by the compiler)" OFF)
|
||||
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_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)
|
||||
|
||||
IF(NOT WITH_GAMEENGINE AND WITH_PLAYER)
|
||||
MESSAGE("WARNING: WITH_PLAYER needs WITH_GAMEENGINE")
|
||||
MESSAGE("WARNING: WITH_PLAYER needs WITH_GAMEENGINE")
|
||||
ENDIF(NOT WITH_GAMEENGINE AND WITH_PLAYER)
|
||||
|
||||
# For alternate Python locations the commandline can be used to override detected/default cache settings, e.g:
|
||||
@@ -87,392 +94,486 @@ INCLUDE(CMake/macros.cmake)
|
||||
#-----------------------------------------------------------------------------
|
||||
#Platform specifics
|
||||
|
||||
IF(UNIX)
|
||||
INCLUDE(${CMAKE_ROOT}/Modules/FindOpenAL.cmake)
|
||||
IF(OPENAL_FOUND)
|
||||
SET(WITH_OPENAL ON)
|
||||
SET(OPENAL_LIB ${OPENAL_LIBRARY})
|
||||
SET(OPENAL_INC ${OPENAL_INCLUDE_DIR})
|
||||
ELSE(OPENAL_FOUND)
|
||||
SET(WITH_OPENAL OFF)
|
||||
ENDIF(OPENAL_FOUND)
|
||||
IF(UNIX AND NOT APPLE)
|
||||
IF(WITH_OPENAL)
|
||||
FIND_PACKAGE(OpenAL)
|
||||
IF(OPENAL_FOUND)
|
||||
SET(WITH_OPENAL ON)
|
||||
ELSE(OPENAL_FOUND)
|
||||
SET(WITH_OPENAL OFF)
|
||||
ENDIF(OPENAL_FOUND)
|
||||
ENDIF(WITH_OPENAL)
|
||||
|
||||
FIND_LIBRARY(ALUT_LIBRARY
|
||||
NAMES alut
|
||||
PATHS
|
||||
/usr/local/lib
|
||||
/usr/lib
|
||||
/sw/lib
|
||||
/opt/local/lib
|
||||
/opt/csw/lib
|
||||
/opt/lib
|
||||
)
|
||||
IF(ALUT_LIBRARY)
|
||||
SET(OPENAL_LIB ${OPENAL_LIB} ${ALUT_LIBRARY})
|
||||
ENDIF(ALUT_LIBRARY)
|
||||
IF(WITH_JACK)
|
||||
SET(JACK /usr)
|
||||
SET(JACK_INC ${JACK}/include/jack)
|
||||
SET(JACK_LIB jack)
|
||||
SET(JACK_LIBPATH ${JACK}/lib)
|
||||
ENDIF(WITH_JACK)
|
||||
|
||||
FIND_LIBRARY(INTL_LIBRARY
|
||||
NAMES intl
|
||||
PATHS
|
||||
/usr/local/lib
|
||||
/usr/lib
|
||||
/sw/lib
|
||||
/opt/local/lib
|
||||
/opt/csw/lib
|
||||
/opt/lib
|
||||
)
|
||||
FIND_LIBRARY(ICONV_LIBRARY
|
||||
NAMES iconv
|
||||
PATHS
|
||||
/usr/local/lib
|
||||
/usr/lib
|
||||
/sw/lib
|
||||
/opt/local/lib
|
||||
/opt/csw/lib
|
||||
/opt/lib
|
||||
)
|
||||
IF(INTL_LIBRARY AND ICONV_LIBRARY)
|
||||
SET(GETTEXT_LIB ${INTL_LIBRARY} ${ICONV_LIBRARY})
|
||||
ENDIF(INTL_LIBRARY AND ICONV_LIBRARY)
|
||||
IF(WITH_SNDFILE)
|
||||
SET(SNDFILE /usr)
|
||||
SET(SNDFILE_INC ${SNDFILE}/include)
|
||||
SET(SNDFILE_LIB sndfile)
|
||||
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
|
||||
)
|
||||
|
||||
FIND_PATH(FREETYPE_INC
|
||||
freetype
|
||||
PATHS
|
||||
/usr/local/include/freetype2
|
||||
/usr/include/freetype2
|
||||
/sw/include/freetype2
|
||||
/opt/local/include/freetype2
|
||||
/opt/csw/include/freetype2
|
||||
/opt/include/freetype2
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
SET(FREETYPE_LIB freetype)
|
||||
IF(INTL_LIBRARY AND ICONV_LIBRARY)
|
||||
SET(GETTEXT_LIB ${INTL_LIBRARY} ${ICONV_LIBRARY})
|
||||
ENDIF(INTL_LIBRARY AND ICONV_LIBRARY)
|
||||
|
||||
INCLUDE(${CMAKE_ROOT}/Modules/FindPythonLibs.cmake)
|
||||
SET(PYTHON_INC "${PYTHON_INCLUDE_PATH}" CACHE STRING "")
|
||||
SET(PYTHON_LIB "${PYTHON_LIBRARIES}" CACHE STRING "")
|
||||
INCLUDE(${CMAKE_ROOT}/Modules/FindPythonInterp.cmake)
|
||||
SET(PYTHON_BINARY ${PYTHON_EXECUTABLE} CACHE STRING "")
|
||||
SET(PYTHON_LINKFLAGS "-Xlinker -export-dynamic")
|
||||
FIND_PACKAGE(Freetype)
|
||||
# UNSET(FREETYPE_INCLUDE_DIRS CACHE) # cant use
|
||||
|
||||
INCLUDE(${CMAKE_ROOT}/Modules/FindSDL.cmake)
|
||||
SET(SDL_INC ${SDL_INCLUDE_DIR})
|
||||
SET(SDL_LIB ${SDL_LIBRARY})
|
||||
# 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")
|
||||
|
||||
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_SDL)
|
||||
FIND_PACKAGE(SDL)
|
||||
# UNSET(SDLMAIN_LIBRARY CACHE)
|
||||
IF(NOT SDL_FOUND)
|
||||
SET(WITH_SDL OFF)
|
||||
ENDIF(NOT SDL_FOUND)
|
||||
ENDIF(WITH_SDL)
|
||||
|
||||
SET(FFMPEG /usr)
|
||||
SET(FFMPEG_INC ${FFMPEG}/include)
|
||||
SET(FFMPEG_LIB avformat avcodec avutil)
|
||||
SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
|
||||
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)
|
||||
|
||||
SET(JPEG_LIB jpeg)
|
||||
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)
|
||||
SET(FFTW3_LIB fftw3)
|
||||
SET(FFTW3_LIBPATH ${FFTW3}/lib)
|
||||
ENDIF(WITH_FFTW3)
|
||||
|
||||
SET(PNG_LIB png)
|
||||
SET(LIBSAMPLERATE /usr)
|
||||
SET(LIBSAMPLERATE_INC ${LIBSAMPLERATE}/include)
|
||||
SET(LIBSAMPLERATE_LIB samplerate)
|
||||
SET(LIBSAMPLERATE_LIBPATH ${LIBSAMPLERATE}/lib)
|
||||
|
||||
SET(ZLIB_LIB z)
|
||||
FIND_PACKAGE(JPEG REQUIRED)
|
||||
|
||||
SET(LLIBS "-lXi -lutil -lc -lm -lpthread -lstdc++")
|
||||
FIND_PACKAGE(PNG REQUIRED)
|
||||
|
||||
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)
|
||||
FIND_PACKAGE(ZLIB REQUIRED)
|
||||
|
||||
# Could use ${X11_Xinput_LIB} ${X11_X11_LIB} too
|
||||
SET(LLIBS "-lXi -lutil -lc -lm -lpthread -lstdc++ -lX11")
|
||||
|
||||
IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
# BSD's dont use libdl.so
|
||||
SET(LLIBS "${LLIBS} -ldl")
|
||||
ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
|
||||
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)
|
||||
|
||||
|
||||
SET(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing -DXP_UNIX -Wno-char-subscripts")
|
||||
SET(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing -DXP_UNIX -Wno-char-subscripts")
|
||||
|
||||
SET(PLATFORM_LINKFLAGS "-pthread")
|
||||
SET(PLATFORM_LINKFLAGS "-pthread")
|
||||
|
||||
INCLUDE_DIRECTORIES(/usr/include /usr/local/include)
|
||||
ENDIF(UNIX)
|
||||
# Better warnings
|
||||
SET(C_WARNINGS "-Wall -Wno-char-subscripts -Wpointer-arith -Wcast-align -Wdeclaration-after-statement")
|
||||
SET(CXX_WARNINGS "-Wall -Wno-invalid-offsetof -Wno-sign-compare")
|
||||
|
||||
INCLUDE_DIRECTORIES(${JPEG_INCLUDE_DIR} ${PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} )
|
||||
ENDIF(UNIX AND NOT APPLE)
|
||||
|
||||
IF(WIN32)
|
||||
|
||||
INCLUDE(${CMAKE_ROOT}/Modules/Platform/Windows-cl.cmake)
|
||||
# this file is included anyway when building under Windows with cl.exe
|
||||
# INCLUDE(${CMAKE_ROOT}/Modules/Platform/Windows-cl.cmake)
|
||||
|
||||
SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/windows)
|
||||
SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/windows)
|
||||
|
||||
# Setup 64bit and 64bit windows systems
|
||||
IF(CMAKE_CL_64)
|
||||
message("64 bit compiler detected.")
|
||||
SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/win64)
|
||||
ENDIF(CMAKE_CL_64)
|
||||
# Setup 64bit and 64bit windows systems
|
||||
IF(CMAKE_CL_64)
|
||||
message("64 bit compiler detected.")
|
||||
SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/win64)
|
||||
ENDIF(CMAKE_CL_64)
|
||||
|
||||
SET(PYTHON ${LIBDIR}/python)
|
||||
SET(PYTHON_VERSION 2.5)
|
||||
SET(PYTHON_INC "${PYTHON}/include/python${PYTHON_VERSION}")
|
||||
SET(PYTHON_BINARY python)
|
||||
SET(PYTHON_LIB python25)
|
||||
SET(PYTHON_LIBPATH ${PYTHON}/lib)
|
||||
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(WITH_OPENAL ON)
|
||||
SET(OPENAL ${LIBDIR}/openal)
|
||||
SET(OPENAL_INC ${OPENAL}/include ${OPENAL}/include/AL)
|
||||
SET(OPENAL_LIB openal_static)
|
||||
SET(OPENAL_LIBPATH ${OPENAL}/lib)
|
||||
IF(CMAKE_CL_64)
|
||||
SET(WITH_OPENAL OFF)
|
||||
ELSE(CMAKE_CL_64)
|
||||
#SET(WITH_OPENAL ON)
|
||||
SET(OPENAL ${LIBDIR}/openal)
|
||||
SET(OPENAL_INCLUDE_DIR ${OPENAL}/include)
|
||||
SET(OPENAL_LIBRARY wrap_oal)
|
||||
SET(OPENAL_LIBPATH ${OPENAL}/lib)
|
||||
ENDIF(CMAKE_CL_64)
|
||||
|
||||
IF(CMAKE_CL_64)
|
||||
SET(PNG_LIB libpng)
|
||||
ELSE(CMAKE_CL_64)
|
||||
SET(PNG_LIB libpng_st)
|
||||
ENDIF(CMAKE_CL_64)
|
||||
SET(JPEG_LIB libjpeg)
|
||||
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)
|
||||
|
||||
SET(ZLIB ${LIBDIR}/zlib)
|
||||
SET(ZLIB_INC ${ZLIB}/include)
|
||||
IF(CMAKE_CL_64)
|
||||
SET(ZLIB_LIB zlib)
|
||||
ELSE(CMAKE_CL_64)
|
||||
SET(ZLIB_LIB libz)
|
||||
ENDIF(CMAKE_CL_64)
|
||||
SET(ZLIB_LIBPATH ${ZLIB}/lib)
|
||||
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(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)
|
||||
SET(ICONV ${LIBDIR}/iconv)
|
||||
SET(ICONV_INC ${ICONV}/include)
|
||||
SET(ICONV_LIB iconv)
|
||||
SET(ICONV_LIBPATH ${ICONV}/lib)
|
||||
|
||||
SET(GETTEXT ${LIBDIR}/gettext)
|
||||
SET(GETTEXT_INC ${GETTEXT}/include)
|
||||
IF(CMAKE_CL_64)
|
||||
SET(GETTEXT_LIB gettextlib)
|
||||
ELSE(CMAKE_CL_64)
|
||||
SET(GETTEXT_LIB gnu_gettext)
|
||||
ENDIF(CMAKE_CL_64)
|
||||
SET(GETTEXT_LIBPATH ${GETTEXT}/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_INC ${FREETYPE}/include ${FREETYPE}/include/freetype2)
|
||||
SET(FREETYPE_LIBPATH ${FREETYPE}/lib)
|
||||
SET(FREETYPE_LIB freetype2ST)
|
||||
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(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(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)
|
||||
SET(FFMPEG_LIB avcodec-51 avformat-52 avdevice-52 avutil-49 swscale-0)
|
||||
SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
|
||||
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(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(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)
|
||||
|
||||
SET(JPEG "${LIBDIR}/jpeg")
|
||||
SET(JPEG_INC "${JPEG}/include")
|
||||
SET(JPEG_LIBPATH ${JPEG}/lib)
|
||||
|
||||
SET(TIFF ${LIBDIR}/tiff)
|
||||
SET(TIFF_INC ${TIFF}/include)
|
||||
|
||||
IF(WITH_OPENAL)
|
||||
SET(LLIBS ${LLIBS} dxguid)
|
||||
ENDIF(WITH_OPENAL)
|
||||
SET(WINTAB_INC ${LIBDIR}/wintab/include)
|
||||
|
||||
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_INC ${SDL}/include)
|
||||
SET(SDL_LIB SDL)
|
||||
SET(SDL_LIBPATH ${SDL}/lib)
|
||||
|
||||
SET(PNG "${LIBDIR}/png")
|
||||
SET(PNG_INC "${PNG}/include")
|
||||
SET(PNG_LIBPATH ${PNG}/lib)
|
||||
|
||||
SET(JPEG "${LIBDIR}/jpeg")
|
||||
SET(JPEG_INC "${JPEG}/include")
|
||||
SET(JPEG_LIBPATH ${JPEG}/lib)
|
||||
|
||||
SET(TIFF ${LIBDIR}/tiff)
|
||||
SET(TIFF_INC ${TIFF}/include)
|
||||
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(WINTAB_INC ${LIBDIR}/wintab/include)
|
||||
|
||||
IF(CMAKE_CL_64)
|
||||
SET(PLATFORM_LINKFLAGS "/MANIFEST:NO /MANIFESTUAC:NO /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 ")
|
||||
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:libcmt.lib;libc.lib ")
|
||||
ENDIF(WIN32)
|
||||
|
||||
IF(APPLE)
|
||||
IF(CMAKE_OSX_ARCHITECTURES MATCHES i386)
|
||||
SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin-8.x.i386)
|
||||
ELSE(CMAKE_OSX_ARCHITECTURES MATCHES i386)
|
||||
SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin-6.1-powerpc)
|
||||
ENDIF(CMAKE_OSX_ARCHITECTURES MATCHES i386)
|
||||
IF(CMAKE_OSX_ARCHITECTURES MATCHES i386)
|
||||
SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin-8.x.i386)
|
||||
ELSE(CMAKE_OSX_ARCHITECTURES MATCHES i386)
|
||||
SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin-6.1-powerpc)
|
||||
ENDIF(CMAKE_OSX_ARCHITECTURES MATCHES i386)
|
||||
|
||||
INCLUDE(${CMAKE_ROOT}/Modules/FindOpenAL.cmake)
|
||||
IF(OPENAL_FOUND)
|
||||
SET(WITH_OPENAL ON)
|
||||
SET(OPENAL_LIB ${OPENAL_LIBRARY})
|
||||
SET(OPENAL_INC ${OPENAL_INCLUDE_DIR})
|
||||
ELSE(OPENAL_FOUND)
|
||||
SET(WITH_OPENAL OFF)
|
||||
ENDIF(OPENAL_FOUND)
|
||||
IF(WITH_OPENAL)
|
||||
FIND_PACKAGE(OpenAL)
|
||||
IF(OPENAL_FOUND)
|
||||
SET(WITH_OPENAL ON)
|
||||
ELSE(OPENAL_FOUND)
|
||||
SET(WITH_OPENAL OFF)
|
||||
ENDIF(OPENAL_FOUND)
|
||||
ENDIF(WITH_OPENAL)
|
||||
|
||||
SET(PYTHON /System/Library/Frameworks/Python.framework/Versions/)
|
||||
SET(PYTHON_VERSION 2.3)
|
||||
SET(PYTHON_INC "${PYTHON}${PYTHON_VERSION}/include/python${PYTHON_VERSION}" CACHE STRING "")
|
||||
SET(PYTHON_BINARY ${PYTHON}${PYTHON_VERSION}/bin/python${PYTHON_VERSION} CACHE STRING "")
|
||||
SET(PYTHON_LIB "")
|
||||
SET(PYTHON_LIBPATH ${PYTHON}${PYTHON_VERSION}/lib/python${PYTHON_VERSION}/config CACHE STRING "")
|
||||
SET(PYTHON_LINKFLAGS "-u __dummy -u _PyMac_Error -framework System -framework Python")
|
||||
IF(WITH_JACK)
|
||||
SET(JACK /usr)
|
||||
SET(JACK_INC ${JACK}/include/jack)
|
||||
SET(JACK_LIB jack)
|
||||
SET(JACK_LIBPATH ${JACK}/lib)
|
||||
ENDIF(WITH_JACK)
|
||||
|
||||
SET(GETTEXT ${LIBDIR}/gettext)
|
||||
SET(GETTEXT_INC "${GETTEXT}/include")
|
||||
SET(GETTEXT_LIB intl iconv)
|
||||
SET(GETTEXT_LIBPATH ${GETTEXT}/lib)
|
||||
IF(WITH_SNDFILE)
|
||||
SET(SNDFILE ${LIBDIR}/sndfile)
|
||||
SET(SNDFILE_INC ${SNDFILE}/include)
|
||||
SET(SNDFILE_LIB sndfile)
|
||||
SET(SNDFILE_LIBPATH ${SNDFILE}/lib)
|
||||
ENDIF(WITH_SNDFILE)
|
||||
|
||||
SET(PNG_LIB png)
|
||||
SET(JPEG_LIB jpeg)
|
||||
SET(PYTHON_VERSION 3.1)
|
||||
|
||||
SET(ZLIB /usr)
|
||||
SET(ZLIB_INC "${ZLIB}/include")
|
||||
SET(ZLIB_LIB z)
|
||||
IF(PYTHON_VERSION MATCHES 3.1)
|
||||
# we use precompiled libraries for py 3.1 and up by default
|
||||
|
||||
SET(FREETYPE ${LIBDIR}/freetype)
|
||||
SET(FREETYPE_INC ${FREETYPE}/include ${FREETYPE}/include/freetype2)
|
||||
SET(FREETYPE_LIBPATH ${FREETYPE}/lib)
|
||||
SET(FREETYPE_LIB freetype)
|
||||
SET(PYTHON ${LIBDIR}/python)
|
||||
SET(PYTHON_INC "${PYTHON}/include/python${PYTHON_VERSION}" CACHE STRING "")
|
||||
# SET(PYTHON_BINARY "${PYTHON}/bin/python${PYTHON_VERSION}" CACHE STRING "") # not used yet
|
||||
SET(PYTHON_LIB python${PYTHON_VERSION})
|
||||
SET(PYTHON_LIBPATH "${PYTHON}/lib/python${PYTHON_VERSION}" CACHE STRING "")
|
||||
# SET(PYTHON_LINKFLAGS "-u _PyMac_Error") # won't build with this enabled
|
||||
ELSE(PYTHON_VERSION MATCHES 3.1)
|
||||
# otherwise, use custom system framework
|
||||
|
||||
SET(OPENEXR ${LIBDIR}/openexr)
|
||||
SET(OPENEXR_INC ${OPENEXR}/include/OpenEXR ${OPENEXR}/include)
|
||||
IF(CMAKE_OSX_ARCHITECTURES MATCHES i386)
|
||||
SET(OPENEXR_LIB Iex Half IlmImf Imath IlmThread)
|
||||
ELSE(CMAKE_OSX_ARCHITECTURES MATCHES i386)
|
||||
SET(OPENEXR_LIB Iex Half IlmImf Imath)
|
||||
ENDIF(CMAKE_OSX_ARCHITECTURES MATCHES i386)
|
||||
SET(OPENEXR_LIBPATH ${OPENEXR}/lib)
|
||||
SET(PYTHON /System/Library/Frameworks/Python.framework/Versions/)
|
||||
SET(PYTHON_VERSION 2.5)
|
||||
SET(PYTHON_INC "${PYTHON}${PYTHON_VERSION}/include/python${PYTHON_VERSION}" CACHE STRING "")
|
||||
# SET(PYTHON_BINARY ${PYTHON}${PYTHON_VERSION}/bin/python${PYTHON_VERSION} CACHE STRING "") # not used yet
|
||||
SET(PYTHON_LIB "")
|
||||
SET(PYTHON_LIBPATH ${PYTHON}${PYTHON_VERSION}/lib/python${PYTHON_VERSION}/config CACHE STRING "")
|
||||
SET(PYTHON_LINKFLAGS "-u _PyMac_Error -framework System -framework Python")
|
||||
ENDIF(PYTHON_VERSION MATCHES 3.1)
|
||||
|
||||
SET(LLIBS stdc++ SystemStubs)
|
||||
SET(GETTEXT ${LIBDIR}/gettext)
|
||||
SET(GETTEXT_INC "${GETTEXT}/include")
|
||||
SET(GETTEXT_LIB intl iconv)
|
||||
SET(GETTEXT_LIBPATH ${GETTEXT}/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(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing")
|
||||
SET(PLATFORM_LINKFLAGS "-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Carbon -framework AGL -framework AudioUnit -framework AudioToolbox -framework CoreAudio -framework QuickTime")
|
||||
SET(PNG_LIBRARIES png)
|
||||
SET(JPEG_LIBRARY jpeg)
|
||||
|
||||
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)
|
||||
SET(ZLIB /usr)
|
||||
SET(ZLIB_INC "${ZLIB}/include")
|
||||
SET(ZLIB_LIBRARIES z)
|
||||
|
||||
SET(SDL ${LIBDIR}/sdl)
|
||||
SET(SDL_INC ${SDL}/include)
|
||||
SET(SDL_LIB SDL)
|
||||
SET(SDL_LIBPATH ${SDL}/lib)
|
||||
SET(FREETYPE ${LIBDIR}/freetype)
|
||||
SET(FREETYPE_INCLUDE_DIRS ${FREETYPE}/include ${FREETYPE}/include/freetype2)
|
||||
SET(FREETYPE_LIBPATH ${FREETYPE}/lib)
|
||||
SET(FREETYPE_LIBRARY freetype)
|
||||
|
||||
SET(PNG "${LIBDIR}/png")
|
||||
SET(PNG_INC "${PNG}/include")
|
||||
SET(PNG_LIBPATH ${PNG}/lib)
|
||||
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)
|
||||
|
||||
SET(JPEG "${LIBDIR}/jpeg")
|
||||
SET(JPEG_INC "${JPEG}/include")
|
||||
SET(JPEG_LIBPATH ${JPEG}/lib)
|
||||
SET(FFMPEG ${LIBDIR}/ffmpeg)
|
||||
SET(FFMPEG_INC ${CMAKE_SOURCE_DIR}/extern/ffmpeg)
|
||||
SET(FFMPEG_LIB avcodec avdevice avformat avutil mp3lame swscale x264 xvidcore)
|
||||
SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
|
||||
|
||||
SET(TIFF ${LIBDIR}/tiff)
|
||||
SET(TIFF_INC ${TIFF}/include)
|
||||
SET(LIBSAMPLERATE ${LIBDIR}/samplerate)
|
||||
SET(LIBSAMPLERATE_INC ${LIBSAMPLERATE}/include)
|
||||
SET(LIBSAMPLERATE_LIB samplerate)
|
||||
SET(LIBSAMPLERATE_LIBPATH ${LIBSAMPLERATE}/lib)
|
||||
|
||||
SET(EXETYPE MACOSX_BUNDLE)
|
||||
SET(LLIBS stdc++ SystemStubs)
|
||||
|
||||
SET(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing")
|
||||
SET(PLATFORM_LINKFLAGS "-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Carbon -framework AGL -framework AudioUnit -framework AudioToolbox -framework CoreAudio -framework QuickTime")
|
||||
|
||||
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)
|
||||
|
||||
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)
|
||||
|
||||
SET(JPEG "${LIBDIR}/jpeg")
|
||||
SET(JPEG_INC "${JPEG}/include")
|
||||
SET(JPEG_LIBPATH ${JPEG}/lib)
|
||||
|
||||
SET(TIFF ${LIBDIR}/tiff)
|
||||
SET(TIFF_INC ${TIFF}/include)
|
||||
|
||||
SET(EXETYPE MACOSX_BUNDLE)
|
||||
ENDIF(APPLE)
|
||||
|
||||
IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
SET(BINRELOC ${CMAKE_SOURCE_DIR}/extern/binreloc)
|
||||
SET(BINRELOC_INC ${BINRELOC}/include)
|
||||
SET(BINRELOC ${CMAKE_SOURCE_DIR}/extern/binreloc)
|
||||
SET(BINRELOC_INC ${BINRELOC}/include)
|
||||
ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
|
||||
|
||||
# TODO - buildinfo
|
||||
# IF(UNIX)
|
||||
# IF(WITH_BUILDINFO)
|
||||
# EXEC_PROGRAM("date \"+%Y-%m-%d\"" OUTPUT_VARIABLE BUILD_DATE)
|
||||
# EXEC_PROGRAM("date \"+%H:%M:%S\"" OUTPUT_VARIABLE BUILD_TIME)
|
||||
# EXEC_PROGRAM("svnversion ${CMAKE_SOURCE_DIR}" OUTPUT_VARIABLE BUILD_REV)
|
||||
# SET(BUILD_TYPE ${CMAKE_BUILD_TYPE})
|
||||
# ENDIF(WITH_BUILDINFO)
|
||||
# ENDIF(UNIX)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Common.
|
||||
SET(VERSE_INC ${CMAKE_SOURCE_DIR}/extern/verse/dist)
|
||||
|
||||
SET(FTGL ${CMAKE_SOURCE_DIR}/extern/bFTGL)
|
||||
SET(FTGL_INC ${FTGL}/include)
|
||||
SET(FTGL_LIB extern_ftgl)
|
||||
|
||||
set(OPENJPEG ${CMAKE_SOURCE_DIR}/extern/libopenjpeg)
|
||||
set(OPENJPEG_INC ${OPENJPEG})
|
||||
set(OPENJPEG_LIb extern_libopenjpeg)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Blender WebPlugin
|
||||
|
||||
IF(WITH_WEBPLUGIN)
|
||||
SET(GECKO_DIR "${CMAKE_SOURCE_DIR}/../gecko-sdk/" CACHE PATH "Gecko SDK path")
|
||||
SET(WEBPLUGIN_SANDBOX_MODE "apparmor" CACHE STRING "WEB Plugin sandbox mode, can be apparmor, privsep, none")
|
||||
SET(GECKO_DIR "${CMAKE_SOURCE_DIR}/../gecko-sdk/" CACHE PATH "Gecko SDK path")
|
||||
SET(WEBPLUGIN_SANDBOX_MODE "apparmor" CACHE STRING "WEB Plugin sandbox mode, can be apparmor, privsep, none")
|
||||
|
||||
SET(WITH_PLAYER ON)
|
||||
SET(WITH_PLAYER ON)
|
||||
ENDIF(WITH_WEBPLUGIN)
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Configure OpenGL.
|
||||
INCLUDE(${CMAKE_ROOT}/Modules/FindOpenGL.cmake)
|
||||
FIND_PACKAGE(OpenGL)
|
||||
INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR})
|
||||
# UNSET(OPENGL_LIBRARIES CACHE) # not compat with older cmake
|
||||
# UNSET(OPENGL_xmesa_INCLUDE_DIR CACHE) # not compat with older cmake
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Extra compile flags
|
||||
IF(WITH_GAMEENGINE)
|
||||
SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -DGAMEBLENDER ")
|
||||
ENDIF(WITH_GAMEENGINE)
|
||||
IF(WITH_BULLET)
|
||||
SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -DWITH_BULLET ")
|
||||
ENDIF(WITH_BULLET)
|
||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${PLATFORM_CFLAGS} ")
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${PLATFORM_CFLAGS} ")
|
||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${PLATFORM_CFLAGS} ${C_WARNINGS}")
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${PLATFORM_CFLAGS} ${CXX_WARNINGS}")
|
||||
|
||||
# better not define flags here but this is a debugging option thats off by default.
|
||||
IF(WITH_CXX_GUARDEDALLOC)
|
||||
SET(CMAKE_CXX_FLAGS " -DWITH_CXX_GUARDEDALLOC -I${CMAKE_SOURCE_DIR}/intern/guardedalloc ${CMAKE_CXX_FLAGS}")
|
||||
ENDIF(WITH_CXX_GUARDEDALLOC)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Libraries
|
||||
FILE(WRITE ${CMAKE_BINARY_DIR}/cmake_blender_libs.txt "")
|
||||
SUBDIRS(
|
||||
intern
|
||||
extern
|
||||
source
|
||||
)
|
||||
ADD_SUBDIRECTORY(intern)
|
||||
ADD_SUBDIRECTORY(extern)
|
||||
ADD_SUBDIRECTORY(source)
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Blender Application
|
||||
SUBDIRS(source/creator)
|
||||
ADD_SUBDIRECTORY(source/creator)
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Blender Player
|
||||
IF(WITH_PLAYER)
|
||||
SUBDIRS(blenderplayer)
|
||||
ADD_SUBDIRECTORY(source/blenderplayer)
|
||||
ENDIF(WITH_PLAYER)
|
||||
|
||||
|
||||
21
Makefile
21
Makefile
@@ -1,3 +1,5 @@
|
||||
# -*- mode: gnumakefile; tab-width: 8; indent-tabs-mode: t; -*-
|
||||
# vim: tabstop=8
|
||||
# $Id$
|
||||
#
|
||||
# ***** BEGIN GPL LICENSE BLOCK *****
|
||||
@@ -21,7 +23,7 @@
|
||||
#
|
||||
# The Original Code is: revision 1.1
|
||||
#
|
||||
# Contributor(s): Hans Lambermont
|
||||
# Contributor(s): Hans Lambermont, GSR
|
||||
#
|
||||
# ***** END GPL LICENSE BLOCK *****
|
||||
#
|
||||
@@ -31,12 +33,11 @@
|
||||
# If the user wants to override some of the build
|
||||
# vars they can put it in the file user-def.mk which
|
||||
# will get included if it exists (please do not commit
|
||||
# user-def.mk to cvs).
|
||||
|
||||
# user-def.mk to the revision control server).
|
||||
sinclude user-def.mk
|
||||
|
||||
# To build without openAL, uncomment the following line, or set it as
|
||||
# an environment variable, or put it uncommented in user-def.mk:
|
||||
# To build without openAL, set it as an environment variable,
|
||||
# or put it uncommented in user-def.mk:
|
||||
# export NAN_NO_OPENAL=true
|
||||
|
||||
export NANBLENDERHOME=$(shell pwd)
|
||||
@@ -44,13 +45,9 @@ MAKEFLAGS=-I$(NANBLENDERHOME)/source --no-print-directory
|
||||
|
||||
SOURCEDIR =
|
||||
ifeq ($(FREE_WINDOWS),true)
|
||||
DIRS ?= dlltool extern intern source
|
||||
endif
|
||||
|
||||
DIRS ?= extern intern source
|
||||
|
||||
ifneq ($(INTERNATIONAL),false)
|
||||
DIRS += po
|
||||
DIRS ?= dlltool extern intern source po
|
||||
else
|
||||
DIRS ?= extern intern source po
|
||||
endif
|
||||
|
||||
include source/nan_subdirs.mk
|
||||
|
||||
589
SConstruct
589
SConstruct
@@ -29,6 +29,14 @@
|
||||
# Set up some custom actions and target/argument handling
|
||||
# Then read all SConscripts and build
|
||||
|
||||
import platform as pltfrm
|
||||
|
||||
# Need a better way to do this. Automagical maybe is not the best thing, maybe it is.
|
||||
if pltfrm.architecture()[0] == '64bit':
|
||||
bitness = 64
|
||||
else:
|
||||
bitness = 32
|
||||
|
||||
import sys
|
||||
import os
|
||||
import os.path
|
||||
@@ -52,13 +60,10 @@ B = tools.Blender
|
||||
platform = sys.platform
|
||||
quickie = None
|
||||
quickdebug = None
|
||||
nsis_build = None
|
||||
|
||||
##### BEGIN SETUP #####
|
||||
|
||||
B.possible_types = ['core', 'common', 'blender', 'intern',
|
||||
'international', 'game', 'game2',
|
||||
'player', 'player2', 'system']
|
||||
B.possible_types = ['core', 'player', 'intern', 'extern']
|
||||
|
||||
B.binarykind = ['blender' , 'blenderplayer']
|
||||
##################################
|
||||
@@ -67,15 +72,15 @@ B.binarykind = ['blender' , 'blenderplayer']
|
||||
# XX cheating for BF_FANCY, we check for BF_FANCY before args are validated
|
||||
use_color = ARGUMENTS.get('BF_FANCY', '1')
|
||||
if platform=='win32':
|
||||
use_color = None
|
||||
use_color = None
|
||||
|
||||
if not use_color=='1':
|
||||
B.bc.disable()
|
||||
|
||||
B.bc.disable()
|
||||
|
||||
#on defaut white Os X terminal, some colors are totally unlegible
|
||||
if platform=='darwin':
|
||||
B.bc.OKGREEN = '\033[34m'
|
||||
B.bc.WARNING = '\033[36m'
|
||||
B.bc.OKGREEN = '\033[34m'
|
||||
B.bc.WARNING = '\033[36m'
|
||||
|
||||
# arguments
|
||||
print B.bc.HEADER+'Command-line arguments'+B.bc.ENDC
|
||||
@@ -98,252 +103,261 @@ quickie = B.arguments.get('BF_QUICK', None)
|
||||
quickdebug = B.arguments.get('BF_QUICKDEBUG', None)
|
||||
|
||||
if quickdebug:
|
||||
B.quickdebug=string.split(quickdebug, ',')
|
||||
B.quickdebug=string.split(quickdebug, ',')
|
||||
else:
|
||||
B.quickdebug=[]
|
||||
B.quickdebug=[]
|
||||
|
||||
if quickie:
|
||||
B.quickie=string.split(quickie,',')
|
||||
B.quickie=string.split(quickie,',')
|
||||
else:
|
||||
B.quickie=[]
|
||||
|
||||
B.quickie=[]
|
||||
|
||||
toolset = B.arguments.get('BF_TOOLSET', None)
|
||||
if toolset:
|
||||
print "Using " + toolset
|
||||
if toolset=='mstoolkit':
|
||||
env = BlenderEnvironment(ENV = os.environ)
|
||||
env.Tool('mstoolkit', ['tools'])
|
||||
else:
|
||||
env = BlenderEnvironment(tools=[toolset], ENV = os.environ)
|
||||
if env:
|
||||
btools.SetupSpawn(env)
|
||||
print "Using " + toolset
|
||||
if toolset=='mstoolkit':
|
||||
env = BlenderEnvironment(ENV = os.environ)
|
||||
env.Tool('mstoolkit', ['tools'])
|
||||
else:
|
||||
env = BlenderEnvironment(tools=[toolset], ENV = os.environ)
|
||||
# xxx commented out, as was supressing warnings under mingw..
|
||||
#if env:
|
||||
# btools.SetupSpawn(env)
|
||||
else:
|
||||
env = BlenderEnvironment(ENV = os.environ)
|
||||
env = BlenderEnvironment(ENV = os.environ)
|
||||
|
||||
if not env:
|
||||
print "Could not create a build environment"
|
||||
Exit()
|
||||
print "Could not create a build environment"
|
||||
Exit()
|
||||
|
||||
|
||||
cc = B.arguments.get('CC', None)
|
||||
cxx = B.arguments.get('CXX', None)
|
||||
if cc:
|
||||
env['CC'] = cc
|
||||
env['CC'] = cc
|
||||
if cxx:
|
||||
env['CXX'] = cxx
|
||||
env['CXX'] = cxx
|
||||
|
||||
if env['CC'] in ['cl', 'cl.exe'] and sys.platform=='win32':
|
||||
platform = 'win32-vc'
|
||||
if bitness == 64:
|
||||
platform = 'win64-vc'
|
||||
else:
|
||||
platform = 'win32-vc'
|
||||
elif env['CC'] in ['gcc'] and sys.platform=='win32':
|
||||
platform = 'win32-mingw'
|
||||
platform = 'win32-mingw'
|
||||
|
||||
env.SConscriptChdir(0)
|
||||
|
||||
crossbuild = B.arguments.get('BF_CROSS', None)
|
||||
if crossbuild and platform!='win32':
|
||||
platform = 'linuxcross'
|
||||
if crossbuild and platform not in ('win32-vc', 'win64-vc'):
|
||||
platform = 'linuxcross'
|
||||
|
||||
env['OURPLATFORM'] = platform
|
||||
|
||||
configfile = 'config'+os.sep+platform+'-config.py'
|
||||
|
||||
if os.path.exists(configfile):
|
||||
print B.bc.OKGREEN + "Using config file: " + B.bc.ENDC + configfile
|
||||
print B.bc.OKGREEN + "Using config file: " + B.bc.ENDC + configfile
|
||||
else:
|
||||
print B.bc.FAIL + configfile + " doesn't exist" + B.bc.ENDC
|
||||
print B.bc.FAIL + configfile + " doesn't exist" + B.bc.ENDC
|
||||
|
||||
if crossbuild and env['PLATFORM'] != 'win32':
|
||||
print B.bc.HEADER+"Preparing for crossbuild"+B.bc.ENDC
|
||||
env.Tool('crossmingw', ['tools'])
|
||||
# todo: determine proper libs/includes etc.
|
||||
# Needed for gui programs, console programs should do without it
|
||||
env.Append(LINKFLAGS=['-mwindows'])
|
||||
print B.bc.HEADER+"Preparing for crossbuild"+B.bc.ENDC
|
||||
env.Tool('crossmingw', ['tools'])
|
||||
# todo: determine proper libs/includes etc.
|
||||
# Needed for gui programs, console programs should do without it
|
||||
env.Append(LINKFLAGS=['-mwindows'])
|
||||
|
||||
userconfig = B.arguments.get('BF_CONFIG', 'user-config.py')
|
||||
# first read platform config. B.arguments will override
|
||||
optfiles = [configfile]
|
||||
if os.path.exists(userconfig):
|
||||
print B.bc.OKGREEN + "Using user-config file: " + B.bc.ENDC + userconfig
|
||||
optfiles += [userconfig]
|
||||
print B.bc.OKGREEN + "Using user-config file: " + B.bc.ENDC + userconfig
|
||||
optfiles += [userconfig]
|
||||
else:
|
||||
print B.bc.WARNING + userconfig + " not found, no user overrides" + B.bc.ENDC
|
||||
print B.bc.WARNING + userconfig + " not found, no user overrides" + B.bc.ENDC
|
||||
|
||||
opts = btools.read_opts(optfiles, B.arguments)
|
||||
opts.Update(env)
|
||||
|
||||
if not env['BF_FANCY']:
|
||||
B.bc.disable()
|
||||
B.bc.disable()
|
||||
|
||||
SetOption('num_jobs', int(env['BF_NUMJOBS']))
|
||||
print "Build with %d parallel jobs" % (GetOption('num_jobs'))
|
||||
|
||||
# disable elbeem (fluidsim) compilation?
|
||||
if env['BF_NO_ELBEEM'] == 1:
|
||||
env['CPPFLAGS'].append('-DDISABLE_ELBEEM')
|
||||
env['CXXFLAGS'].append('-DDISABLE_ELBEEM')
|
||||
env['CCFLAGS'].append('-DDISABLE_ELBEEM')
|
||||
env['CPPFLAGS'].append('-DDISABLE_ELBEEM')
|
||||
env['CXXFLAGS'].append('-DDISABLE_ELBEEM')
|
||||
env['CCFLAGS'].append('-DDISABLE_ELBEEM')
|
||||
|
||||
if env['WITH_BF_OPENMP'] == 1:
|
||||
if env['OURPLATFORM']=='win32-vc':
|
||||
env['CCFLAGS'].append('/openmp')
|
||||
env['CPPFLAGS'].append('/openmp')
|
||||
env['CXXFLAGS'].append('/openmp')
|
||||
else:
|
||||
if env['CC'][-3:] == 'icc': # to be able to handle CC=/opt/bla/icc case
|
||||
env.Append(LINKFLAGS=['-openmp', '-static-intel'])
|
||||
env['CCFLAGS'].append('-openmp')
|
||||
env['CPPFLAGS'].append('-openmp')
|
||||
env['CXXFLAGS'].append('-openmp')
|
||||
else:
|
||||
env.Append(CCFLAGS=['-fopenmp'])
|
||||
env.Append(CPPFLAGS=['-fopenmp'])
|
||||
env.Append(CXXFLAGS=['-fopenmp'])
|
||||
# env.Append(LINKFLAGS=['-fprofile-generate'])
|
||||
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
|
||||
env['CCFLAGS'].append('/openmp')
|
||||
env['CPPFLAGS'].append('/openmp')
|
||||
env['CXXFLAGS'].append('/openmp')
|
||||
else:
|
||||
if env['CC'][-3:] == 'icc': # to be able to handle CC=/opt/bla/icc case
|
||||
env.Append(LINKFLAGS=['-openmp', '-static-intel'])
|
||||
env['CCFLAGS'].append('-openmp')
|
||||
env['CPPFLAGS'].append('-openmp')
|
||||
env['CXXFLAGS'].append('-openmp')
|
||||
else:
|
||||
env.Append(CCFLAGS=['-fopenmp'])
|
||||
env.Append(CPPFLAGS=['-fopenmp'])
|
||||
env.Append(CXXFLAGS=['-fopenmp'])
|
||||
|
||||
#check for additional debug libnames
|
||||
|
||||
if env.has_key('BF_DEBUG_LIBS'):
|
||||
B.quickdebug += env['BF_DEBUG_LIBS']
|
||||
B.quickdebug += env['BF_DEBUG_LIBS']
|
||||
|
||||
printdebug = B.arguments.get('BF_LISTDEBUG', 0)
|
||||
|
||||
# see if this linux distro has libalut
|
||||
|
||||
if env['OURPLATFORM'] == 'linux2' :
|
||||
if env['WITH_BF_OPENAL']:
|
||||
mylib_test_source_file = """
|
||||
#include "AL/alut.h"
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
alutGetMajorVersion();
|
||||
return 0;
|
||||
}
|
||||
"""
|
||||
if env['WITH_BF_OPENAL']:
|
||||
mylib_test_source_file = """
|
||||
#include "AL/alut.h"
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
alutGetMajorVersion();
|
||||
return 0;
|
||||
}
|
||||
"""
|
||||
|
||||
def CheckFreeAlut(context,env):
|
||||
context.Message( B.bc.OKGREEN + "Linux platform detected:\n checking for FreeAlut... " + B.bc.ENDC )
|
||||
env['LIBS'] = 'alut'
|
||||
result = context.TryLink(mylib_test_source_file, '.c')
|
||||
context.Result(result)
|
||||
return result
|
||||
def CheckFreeAlut(context,env):
|
||||
context.Message( B.bc.OKGREEN + "Linux platform detected:\n checking for FreeAlut... " + B.bc.ENDC )
|
||||
env['LIBS'] = 'alut'
|
||||
result = context.TryLink(mylib_test_source_file, '.c')
|
||||
context.Result(result)
|
||||
return result
|
||||
|
||||
env2 = env.Copy( LIBPATH = env['BF_OPENAL'] )
|
||||
sconf_temp = mkdtemp()
|
||||
conf = Configure( env2, {'CheckFreeAlut' : CheckFreeAlut}, sconf_temp, '/dev/null' )
|
||||
if conf.CheckFreeAlut( env2 ):
|
||||
env['BF_OPENAL_LIB'] += ' alut'
|
||||
del env2
|
||||
root = ''
|
||||
for root, dirs, files in os.walk(sconf_temp, topdown=False):
|
||||
for name in files:
|
||||
os.remove(os.path.join(root, name))
|
||||
for name in dirs:
|
||||
os.rmdir(os.path.join(root, name))
|
||||
if root: os.rmdir(root)
|
||||
env2 = env.Clone( LIBPATH = env['BF_OPENAL'] )
|
||||
sconf_temp = mkdtemp()
|
||||
conf = Configure( env2, {'CheckFreeAlut' : CheckFreeAlut}, sconf_temp, '/dev/null' )
|
||||
if conf.CheckFreeAlut( env2 ):
|
||||
env['BF_OPENAL_LIB'] += ' alut'
|
||||
del env2
|
||||
root = ''
|
||||
for root, dirs, files in os.walk(sconf_temp, topdown=False):
|
||||
for name in files:
|
||||
os.remove(os.path.join(root, name))
|
||||
for name in dirs:
|
||||
os.rmdir(os.path.join(root, name))
|
||||
if root: os.rmdir(root)
|
||||
|
||||
if len(B.quickdebug) > 0 and printdebug != 0:
|
||||
print B.bc.OKGREEN + "Buildings these libs with debug symbols:" + B.bc.ENDC
|
||||
for l in B.quickdebug:
|
||||
print "\t" + l
|
||||
print B.bc.OKGREEN + "Buildings these libs with debug symbols:" + B.bc.ENDC
|
||||
for l in B.quickdebug:
|
||||
print "\t" + l
|
||||
|
||||
# remove stdc++ from LLIBS if we are building a statc linked CXXFLAGS
|
||||
if env['WITH_BF_STATICCXX']:
|
||||
if 'stdc++' in env['LLIBS']:
|
||||
env['LLIBS'] = env['LLIBS'].replace('stdc++', ' ')
|
||||
else:
|
||||
print '\tcould not remove stdc++ library from LLIBS, WITH_BF_STATICCXX may not work for your platform'
|
||||
if 'stdc++' in env['LLIBS']:
|
||||
env['LLIBS'].remove('stdc++')
|
||||
else:
|
||||
print '\tcould not remove stdc++ library from LLIBS, WITH_BF_STATICCXX may not work for your platform'
|
||||
|
||||
# check target for blenderplayer. Set WITH_BF_PLAYER if found on cmdline
|
||||
if 'blenderplayer' in B.targets:
|
||||
env['WITH_BF_PLAYER'] = True
|
||||
env['WITH_BF_PLAYER'] = True
|
||||
|
||||
if 'blendernogame' in B.targets:
|
||||
env['WITH_BF_GAMEENGINE'] = False
|
||||
env['WITH_BF_GAMEENGINE'] = False
|
||||
|
||||
if 'blenderlite' in B.targets:
|
||||
env['WITH_BF_GAMEENGINE'] = False
|
||||
env['WITH_BF_OPENAL'] = False
|
||||
env['WITH_BF_OPENEXR'] = False
|
||||
env['WITH_BF_ICONV'] = False
|
||||
env['WITH_BF_INTERNATIONAL'] = False
|
||||
env['WITH_BF_OPENJPEG'] = False
|
||||
env['WITH_BF_FFMPEG'] = False
|
||||
env['WITH_BF_QUICKTIME'] = False
|
||||
env['WITH_BF_YAFRAY'] = False
|
||||
env['WITH_BF_REDCODE'] = False
|
||||
env['WITH_BF_FTGL'] = False
|
||||
env['WITH_BF_DDS'] = False
|
||||
env['WITH_BF_ZLIB'] = False
|
||||
env['WITH_BF_SDL'] = False
|
||||
env['WITH_BF_JPEG'] = False
|
||||
env['WITH_BF_PNG'] = False
|
||||
env['WITH_BF_ODE'] = False
|
||||
env['WITH_BF_BULLET'] = False
|
||||
env['WITH_BF_BINRELOC'] = False
|
||||
env['BF_BUILDINFO'] = False
|
||||
env['BF_NO_ELBEEM'] = True
|
||||
env['WITH_BF_PYTHON'] = False
|
||||
target_env_defs = {}
|
||||
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_ICONV'] = False
|
||||
target_env_defs['WITH_BF_INTERNATIONAL'] = False
|
||||
target_env_defs['WITH_BF_OPENJPEG'] = False
|
||||
target_env_defs['WITH_BF_FFMPEG'] = False
|
||||
target_env_defs['WITH_BF_QUICKTIME'] = False
|
||||
target_env_defs['WITH_BF_REDCODE'] = False
|
||||
target_env_defs['WITH_BF_DDS'] = False
|
||||
target_env_defs['WITH_BF_ZLIB'] = False
|
||||
target_env_defs['WITH_BF_SDL'] = False
|
||||
target_env_defs['WITH_BF_JPEG'] = False
|
||||
target_env_defs['WITH_BF_PNG'] = False
|
||||
target_env_defs['WITH_BF_BULLET'] = False
|
||||
target_env_defs['WITH_BF_BINRELOC'] = False
|
||||
target_env_defs['BF_BUILDINFO'] = False
|
||||
target_env_defs['BF_NO_ELBEEM'] = True
|
||||
target_env_defs['WITH_BF_PYTHON'] = False
|
||||
|
||||
# Merge blenderlite, let command line to override
|
||||
for k,v in target_env_defs.iteritems():
|
||||
if k not in B.arguments:
|
||||
env[k] = v
|
||||
|
||||
if env['WITH_BF_SDL'] == False and env['OURPLATFORM'] in ('win32-vc', 'win32-ming', 'win64-vc'):
|
||||
env['PLATFORM_LINKFLAGS'].remove('/ENTRY:mainCRTStartup')
|
||||
env['PLATFORM_LINKFLAGS'].append('/ENTRY:main')
|
||||
|
||||
# lastly we check for root_build_dir ( we should not do before, otherwise we might do wrong builddir
|
||||
#B.root_build_dir = B.arguments.get('BF_BUILDDIR', '..'+os.sep+'build'+os.sep+platform+os.sep)
|
||||
B.root_build_dir = env['BF_BUILDDIR']
|
||||
B.doc_build_dir = env['BF_DOCDIR']
|
||||
if not B.root_build_dir[-1]==os.sep:
|
||||
B.root_build_dir += os.sep
|
||||
B.root_build_dir += os.sep
|
||||
if not B.doc_build_dir[-1]==os.sep:
|
||||
B.doc_build_dir += os.sep
|
||||
|
||||
B.doc_build_dir += os.sep
|
||||
|
||||
# We do a shortcut for clean when no quicklist is given: just delete
|
||||
# builddir without reading in SConscripts
|
||||
do_clean = None
|
||||
if 'clean' in B.targets:
|
||||
do_clean = True
|
||||
do_clean = True
|
||||
|
||||
if not quickie and do_clean:
|
||||
if os.path.exists(B.doc_build_dir):
|
||||
print B.bc.HEADER+'Cleaning doc dir...'+B.bc.ENDC
|
||||
dirs = os.listdir(B.doc_build_dir)
|
||||
for entry in dirs:
|
||||
if os.path.isdir(B.doc_build_dir + entry) == 1:
|
||||
print "clean dir %s"%(B.doc_build_dir+entry)
|
||||
shutil.rmtree(B.doc_build_dir+entry)
|
||||
else: # remove file
|
||||
print "remove file %s"%(B.doc_build_dir+entry)
|
||||
os.remove(B.root_build_dir+entry)
|
||||
if os.path.exists(B.root_build_dir):
|
||||
print B.bc.HEADER+'Cleaning build dir...'+B.bc.ENDC
|
||||
dirs = os.listdir(B.root_build_dir)
|
||||
for dir in dirs:
|
||||
if os.path.isdir(B.root_build_dir + dir) == 1:
|
||||
print "clean dir %s"%(B.root_build_dir+dir)
|
||||
shutil.rmtree(B.root_build_dir+dir)
|
||||
for confile in ['extern/ffmpeg/config.mak', 'extern/x264/config.mak',
|
||||
'extern/xvidcore/build/generic/platform.inc']:
|
||||
if os.path.exists(confile):
|
||||
print "clean file %s"%confile
|
||||
os.remove(confile)
|
||||
|
||||
if platform in ('win32-vc', 'win32-mingw'):
|
||||
makesdnafile = B.root_build_dir+'makesdna.exe'
|
||||
else:
|
||||
makesdnafile = B.root_build_dir+'makesdna'
|
||||
if os.path.exists(makesdnafile):
|
||||
print "removing", makesdnafile
|
||||
os.remove(makesdnafile)
|
||||
print B.bc.OKGREEN+'...done'+B.bc.ENDC
|
||||
else:
|
||||
print B.bc.HEADER+'Already Clean, nothing to do.'+B.bc.ENDC
|
||||
Exit()
|
||||
if os.path.exists(B.doc_build_dir):
|
||||
print B.bc.HEADER+'Cleaning doc dir...'+B.bc.ENDC
|
||||
dirs = os.listdir(B.doc_build_dir)
|
||||
for entry in dirs:
|
||||
if os.path.isdir(B.doc_build_dir + entry) == 1:
|
||||
print "clean dir %s"%(B.doc_build_dir+entry)
|
||||
shutil.rmtree(B.doc_build_dir+entry)
|
||||
else: # remove file
|
||||
print "remove file %s"%(B.doc_build_dir+entry)
|
||||
os.remove(B.root_build_dir+entry)
|
||||
if os.path.exists(B.root_build_dir):
|
||||
print B.bc.HEADER+'Cleaning build dir...'+B.bc.ENDC
|
||||
dirs = os.listdir(B.root_build_dir)
|
||||
for entry in dirs:
|
||||
if os.path.isdir(B.root_build_dir + entry) == 1:
|
||||
print "clean dir %s"%(B.root_build_dir+entry)
|
||||
shutil.rmtree(B.root_build_dir+entry)
|
||||
else: # remove file
|
||||
print "remove file %s"%(B.root_build_dir+entry)
|
||||
os.remove(B.root_build_dir+entry)
|
||||
for confile in ['extern/ffmpeg/config.mak', 'extern/x264/config.mak',
|
||||
'extern/xvidcore/build/generic/platform.inc', 'extern/ffmpeg/include']:
|
||||
if os.path.exists(confile):
|
||||
print "clean file %s"%confile
|
||||
if os.path.isdir(confile):
|
||||
for root, dirs, files in os.walk(confile):
|
||||
for name in files:
|
||||
os.remove(os.path.join(root, name))
|
||||
else:
|
||||
os.remove(confile)
|
||||
print B.bc.OKGREEN+'...done'+B.bc.ENDC
|
||||
else:
|
||||
print B.bc.HEADER+'Already Clean, nothing to do.'+B.bc.ENDC
|
||||
Exit()
|
||||
|
||||
if not os.path.isdir ( B.root_build_dir):
|
||||
os.makedirs ( B.root_build_dir )
|
||||
os.makedirs ( B.root_build_dir + 'source' )
|
||||
os.makedirs ( B.root_build_dir + 'intern' )
|
||||
os.makedirs ( B.root_build_dir + 'extern' )
|
||||
os.makedirs ( B.root_build_dir + 'lib' )
|
||||
os.makedirs ( B.root_build_dir + 'bin' )
|
||||
os.makedirs ( B.root_build_dir )
|
||||
os.makedirs ( B.root_build_dir + 'source' )
|
||||
os.makedirs ( B.root_build_dir + 'intern' )
|
||||
os.makedirs ( B.root_build_dir + 'extern' )
|
||||
os.makedirs ( B.root_build_dir + 'lib' )
|
||||
os.makedirs ( B.root_build_dir + 'bin' )
|
||||
if not os.path.isdir(B.doc_build_dir):
|
||||
os.makedirs ( B.doc_build_dir )
|
||||
os.makedirs ( B.doc_build_dir )
|
||||
|
||||
Help(opts.GenerateHelpText(env))
|
||||
|
||||
@@ -351,10 +365,10 @@ Help(opts.GenerateHelpText(env))
|
||||
# commands, do 'scons BF_QUIET=0'
|
||||
bf_quietoutput = B.arguments.get('BF_QUIET', '1')
|
||||
if env['BF_QUIET']:
|
||||
B.set_quiet_output(env)
|
||||
B.set_quiet_output(env)
|
||||
else:
|
||||
if toolset=='msvc':
|
||||
B.msvc_hack(env)
|
||||
if toolset=='msvc':
|
||||
B.msvc_hack(env)
|
||||
|
||||
print B.bc.HEADER+'Building in '+B.bc.ENDC+B.root_build_dir
|
||||
env.SConsignFile(B.root_build_dir+'scons-signatures')
|
||||
@@ -376,23 +390,23 @@ SConscript(B.root_build_dir+'/source/SConscript')
|
||||
# libraries to give as objects to linking phase
|
||||
mainlist = []
|
||||
for tp in B.possible_types:
|
||||
if not tp == 'player' and not tp == 'player2':
|
||||
mainlist += B.create_blender_liblist(env, tp)
|
||||
if not tp == 'player':
|
||||
mainlist += B.create_blender_liblist(env, tp)
|
||||
|
||||
if B.arguments.get('BF_PRIORITYLIST', '0')=='1':
|
||||
B.propose_priorities()
|
||||
B.propose_priorities()
|
||||
|
||||
dobj = B.buildinfo(env, "dynamic") + B.resources
|
||||
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')
|
||||
env.BlenderProg(B.root_build_dir, "blenderplayer", dobj + playerlist + thestatlibs, [], thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blenderplayer')
|
||||
|
||||
|
||||
playerlist = B.create_blender_liblist(env, 'player')
|
||||
playerlist += B.create_blender_liblist(env, 'intern')
|
||||
playerlist += B.create_blender_liblist(env, 'extern')
|
||||
env.BlenderProg(B.root_build_dir, "blenderplayer", dobj + playerlist, [], thestatlibs + thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blenderplayer')
|
||||
|
||||
##### Now define some targets
|
||||
|
||||
@@ -400,22 +414,19 @@ if env['WITH_BF_PLAYER']:
|
||||
#------------ INSTALL
|
||||
|
||||
#-- binaries
|
||||
|
||||
blenderinstall = []
|
||||
if env['OURPLATFORM']=='darwin':
|
||||
for prg in B.program_list:
|
||||
bundle = '%s.app' % prg[0]
|
||||
bundledir = os.path.dirname(bundle)
|
||||
for dp, dn, df in os.walk(bundle):
|
||||
if 'CVS' in dn:
|
||||
dn.remove('CVS')
|
||||
if '.svn' in dn:
|
||||
dn.remove('.svn')
|
||||
dir=env['BF_INSTALLDIR']+dp[len(bundledir):]
|
||||
source=[dp+os.sep+f for f in df]
|
||||
blenderinstall.append(env.Install(dir=dir,source=source))
|
||||
for prg in B.program_list:
|
||||
bundle = '%s.app' % prg[0]
|
||||
bundledir = os.path.dirname(bundle)
|
||||
for dp, dn, df in os.walk(bundle):
|
||||
if '.svn' in dn:
|
||||
dn.remove('.svn')
|
||||
dir=env['BF_INSTALLDIR']+dp[len(bundledir):]
|
||||
source=[dp+os.sep+f for f in df]
|
||||
blenderinstall.append(env.Install(dir=dir,source=source))
|
||||
else:
|
||||
blenderinstall = env.Install(dir=env['BF_INSTALLDIR'], source=B.program_list)
|
||||
blenderinstall = env.Install(dir=env['BF_INSTALLDIR'], source=B.program_list)
|
||||
|
||||
#-- .blender
|
||||
#- dont do .blender and scripts for darwin, it is already in the bundle
|
||||
@@ -424,30 +435,38 @@ dottargetlist = []
|
||||
scriptinstall = []
|
||||
|
||||
if env['OURPLATFORM']!='darwin':
|
||||
for dp, dn, df in os.walk('bin/.blender'):
|
||||
if 'CVS' in dn:
|
||||
dn.remove('CVS')
|
||||
if '.svn' in dn:
|
||||
dn.remove('.svn')
|
||||
for f in df:
|
||||
dotblendlist.append(dp+os.sep+f)
|
||||
dottargetlist.append(env['BF_INSTALLDIR']+dp[3:]+os.sep+f)
|
||||
for dp, dn, df in os.walk('bin/.blender'):
|
||||
if '.svn' in dn:
|
||||
dn.remove('.svn')
|
||||
|
||||
for f in df:
|
||||
if not env['WITH_BF_INTERNATIONAL']:
|
||||
if 'locale' in dp:
|
||||
continue
|
||||
if f == '.Blanguages':
|
||||
continue
|
||||
if not env['WITH_BF_FREETYPE']:
|
||||
if f.endswith('.ttf'):
|
||||
continue
|
||||
|
||||
dotblendlist.append(os.path.join(dp, f))
|
||||
dottargetlist.append(env['BF_INSTALLDIR']+dp[3:]+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))
|
||||
|
||||
#-- .blender/scripts
|
||||
scriptpath='release/scripts'
|
||||
for dp, dn, df in os.walk(scriptpath):
|
||||
if 'CVS' in dn:
|
||||
dn.remove('CVS')
|
||||
if '.svn' in dn:
|
||||
dn.remove('.svn')
|
||||
dir=env['BF_INSTALLDIR']+'/.blender/scripts'+dp[len(scriptpath):]
|
||||
source=[dp+os.sep+f for f in df]
|
||||
scriptinstall.append(env.Install(dir=dir,source=source))
|
||||
dotblenderinstall = []
|
||||
for targetdir,srcfile in zip(dottargetlist, dotblendlist):
|
||||
td, tf = os.path.split(targetdir)
|
||||
dotblenderinstall.append(env.Install(dir=td, source=srcfile))
|
||||
|
||||
if env['WITH_BF_PYTHON']:
|
||||
#-- .blender/scripts, .blender/ui, .blender/io
|
||||
scriptpaths=['release/scripts', 'release/ui', 'release/io']
|
||||
for scriptpath in scriptpaths:
|
||||
for dp, dn, df in os.walk(scriptpath):
|
||||
if '.svn' in dn:
|
||||
dn.remove('.svn')
|
||||
dir=env['BF_INSTALLDIR']+'/.blender/'+os.path.basename(scriptpath)+dp[len(scriptpath):]
|
||||
source=[dp+os.sep+f for f in df]
|
||||
scriptinstall.append(env.Install(dir=dir,source=source))
|
||||
|
||||
#-- icons
|
||||
if env['OURPLATFORM']=='linux2':
|
||||
@@ -455,12 +474,9 @@ if env['OURPLATFORM']=='linux2':
|
||||
icontargetlist = []
|
||||
|
||||
for tp, tn, tf in os.walk('release/freedesktop/icons'):
|
||||
if 'CVS' in tn:
|
||||
tn.remove('CVS')
|
||||
if '.svn' in tn:
|
||||
tn.remove('.svn')
|
||||
for f in tf:
|
||||
print ">>>", env['BF_INSTALLDIR'], tp, f
|
||||
iconlist.append(tp+os.sep+f)
|
||||
icontargetlist.append(env['BF_INSTALLDIR']+tp[19:]+os.sep+f)
|
||||
|
||||
@@ -469,18 +485,22 @@ if env['OURPLATFORM']=='linux2':
|
||||
td, tf = os.path.split(targetdir)
|
||||
iconinstall.append(env.Install(dir=td, source=srcfile))
|
||||
|
||||
# dlls for linuxcross
|
||||
# TODO - add more libs, for now this lets blenderlite run
|
||||
if env['OURPLATFORM']=='linuxcross':
|
||||
dir=env['BF_INSTALLDIR']
|
||||
source = ['../lib/windows/pthreads/lib/pthreadGC2.dll']
|
||||
scriptinstall.append(env.Install(dir=dir, source=source))
|
||||
|
||||
#-- plugins
|
||||
pluglist = []
|
||||
plugtargetlist = []
|
||||
for tp, tn, tf in os.walk('release/plugins'):
|
||||
if 'CVS' in tn:
|
||||
tn.remove('CVS')
|
||||
if '.svn' in tn:
|
||||
tn.remove('.svn')
|
||||
for f in tf:
|
||||
print ">>>", env['BF_INSTALLDIR'], tp, f
|
||||
pluglist.append(tp+os.sep+f)
|
||||
plugtargetlist.append(env['BF_INSTALLDIR']+tp[7:]+os.sep+f)
|
||||
if '.svn' in tn:
|
||||
tn.remove('.svn')
|
||||
for f in tf:
|
||||
pluglist.append(tp+os.sep+f)
|
||||
plugtargetlist.append(env['BF_INSTALLDIR']+tp[7:]+os.sep+f)
|
||||
|
||||
# header files for plugins
|
||||
pluglist.append('source/blender/blenpluginapi/documentation.h')
|
||||
@@ -500,59 +520,69 @@ plugtargetlist.append(env['BF_INSTALLDIR'] + os.sep + 'plugins' + os.sep + 'incl
|
||||
|
||||
plugininstall = []
|
||||
for targetdir,srcfile in zip(plugtargetlist, pluglist):
|
||||
td, tf = os.path.split(targetdir)
|
||||
plugininstall.append(env.Install(dir=td, source=srcfile))
|
||||
td, tf = os.path.split(targetdir)
|
||||
plugininstall.append(env.Install(dir=td, source=srcfile))
|
||||
|
||||
textlist = []
|
||||
texttargetlist = []
|
||||
for tp, tn, tf in os.walk('release/text'):
|
||||
if 'CVS' in tn:
|
||||
tn.remove('CVS')
|
||||
if '.svn' in tn:
|
||||
tn.remove('.svn')
|
||||
for f in tf:
|
||||
textlist.append(tp+os.sep+f)
|
||||
if '.svn' in tn:
|
||||
tn.remove('.svn')
|
||||
for f in tf:
|
||||
textlist.append(tp+os.sep+f)
|
||||
|
||||
textinstall = env.Install(dir=env['BF_INSTALLDIR'], source=textlist)
|
||||
|
||||
if env['OURPLATFORM']=='darwin':
|
||||
allinstall = [blenderinstall, plugininstall, textinstall]
|
||||
allinstall = [blenderinstall, plugininstall, textinstall]
|
||||
elif env['OURPLATFORM']=='linux2':
|
||||
allinstall = [blenderinstall, dotblenderinstall, scriptinstall, plugininstall, textinstall, iconinstall]
|
||||
allinstall = [blenderinstall, dotblenderinstall, scriptinstall, plugininstall, textinstall, iconinstall]
|
||||
else:
|
||||
allinstall = [blenderinstall, dotblenderinstall, scriptinstall, plugininstall, textinstall]
|
||||
allinstall = [blenderinstall, dotblenderinstall, scriptinstall, plugininstall, textinstall]
|
||||
|
||||
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw'):
|
||||
dllsources = ['${LCGDIR}/gettext/lib/gnu_gettext.dll',
|
||||
'${LCGDIR}/png/lib/libpng.dll',
|
||||
'#release/windows/extra/python25.zip',
|
||||
'#release/windows/extra/zlib.pyd',
|
||||
'${LCGDIR}/sdl/lib/SDL.dll',
|
||||
'${LCGDIR}/zlib/lib/zlib.dll',
|
||||
'${LCGDIR}/tiff/lib/libtiff.dll']
|
||||
if env['BF_DEBUG']:
|
||||
dllsources.append('${LCGDIR}/python/lib/${BF_PYTHON_LIB}_d.dll')
|
||||
else:
|
||||
dllsources.append('${LCGDIR}/python/lib/${BF_PYTHON_LIB}.dll')
|
||||
if env['OURPLATFORM'] == 'win32-mingw':
|
||||
dllsources += ['${LCGDIR}/pthreads/lib/pthreadGC2.dll']
|
||||
else:
|
||||
dllsources += ['${LCGDIR}/pthreads/lib/pthreadVC2.dll']
|
||||
if env['WITH_BF_ICONV']:
|
||||
dllsources += ['${LCGDIR}/iconv/lib/iconv.dll']
|
||||
if env['WITH_BF_FFMPEG']:
|
||||
dllsources += ['${LCGDIR}/ffmpeg/lib/avcodec-51.dll',
|
||||
'${LCGDIR}/ffmpeg/lib/avformat-52.dll',
|
||||
'${LCGDIR}/ffmpeg/lib/avdevice-52.dll',
|
||||
'${LCGDIR}/ffmpeg/lib/avutil-49.dll',
|
||||
'${LCGDIR}/ffmpeg/lib/libfaad-0.dll',
|
||||
'${LCGDIR}/ffmpeg/lib/libfaac-0.dll',
|
||||
'${LCGDIR}/ffmpeg/lib/libmp3lame-0.dll',
|
||||
'${LCGDIR}/ffmpeg/lib/libx264-59.dll',
|
||||
'${LCGDIR}/ffmpeg/lib/xvidcore.dll',
|
||||
'${LCGDIR}/ffmpeg/lib/swscale-0.dll']
|
||||
windlls = env.Install(dir=env['BF_INSTALLDIR'], source = dllsources)
|
||||
allinstall += windlls
|
||||
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc'):
|
||||
if env['OURPLATFORM'] == 'win64-vc':
|
||||
dllsources = []
|
||||
else:
|
||||
dllsources = ['${LCGDIR}/gettext/lib/gnu_gettext.dll',
|
||||
'${BF_PNG_LIBPATH}/libpng.dll',
|
||||
'${BF_ZLIB_LIBPATH}/zlib.dll',
|
||||
'${BF_TIFF_LIBPATH}/${BF_TIFF_LIB}.dll']
|
||||
dllsources += ['${BF_PTHREADS_LIBPATH}/${BF_PTHREADS_LIB}.dll']
|
||||
if env['WITH_BF_SDL']:
|
||||
if env['OURPLATFORM'] == 'win64-vc':
|
||||
pass # we link statically already to SDL on win64
|
||||
else:
|
||||
dllsources.append('${BF_SDL_LIBPATH}/SDL.dll')
|
||||
if env['WITH_BF_PYTHON']:
|
||||
ver = env["BF_PYTHON_VERSION"].replace(".", "")
|
||||
|
||||
dllsources.append('${LCGDIR}/release/python' + ver + '.zip')
|
||||
dllsources.append('${LCGDIR}/release/zlib.pyd')
|
||||
if env['BF_DEBUG']:
|
||||
dllsources.append('${BF_PYTHON_LIBPATH}/${BF_PYTHON_LIB}_d.dll')
|
||||
else:
|
||||
dllsources.append('${BF_PYTHON_LIBPATH}/${BF_PYTHON_LIB}.dll')
|
||||
if env['WITH_BF_ICONV']:
|
||||
if env['OURPLATFORM'] == 'win64-vc':
|
||||
pass # we link statically to iconv on win64
|
||||
else:
|
||||
dllsources += ['${BF_ICONV_LIBPATH}/iconv.dll']
|
||||
if env['WITH_BF_OPENAL']:
|
||||
dllsources.append('${LCGDIR}/openal/lib/OpenAL32.dll')
|
||||
dllsources.append('${LCGDIR}/openal/lib/wrap_oal.dll')
|
||||
if env['WITH_BF_SNDFILE']:
|
||||
dllsources.append('${LCGDIR}/sndfile/lib/libsndfile-1.dll')
|
||||
if env['WITH_BF_FFMPEG']:
|
||||
dllsources += ['${LCGDIR}/ffmpeg/lib/avcodec-52.dll',
|
||||
'${LCGDIR}/ffmpeg/lib/avformat-52.dll',
|
||||
'${LCGDIR}/ffmpeg/lib/avdevice-52.dll',
|
||||
'${LCGDIR}/ffmpeg/lib/avutil-50.dll',
|
||||
'${LCGDIR}/ffmpeg/lib/swscale-0.dll']
|
||||
if env['WITH_BF_JACK']:
|
||||
dllsources += ['${LCGDIR}/jack/lib/libjack.dll']
|
||||
windlls = env.Install(dir=env['BF_INSTALLDIR'], source = dllsources)
|
||||
allinstall += windlls
|
||||
|
||||
installtarget = env.Alias('install', allinstall)
|
||||
bininstalltarget = env.Alias('install-bin', blenderinstall)
|
||||
@@ -566,12 +596,12 @@ if 'blender' in B.targets:
|
||||
Depends(blenderexe,installtarget)
|
||||
|
||||
if env['WITH_BF_PLAYER']:
|
||||
blenderplayer = env.Alias('blenderplayer', B.program_list)
|
||||
Depends(blenderplayer,installtarget)
|
||||
blenderplayer = env.Alias('blenderplayer', B.program_list)
|
||||
Depends(blenderplayer,installtarget)
|
||||
|
||||
if not env['WITH_BF_GAMEENGINE']:
|
||||
blendernogame = env.Alias('blendernogame', B.program_list)
|
||||
Depends(blendernogame,installtarget)
|
||||
blendernogame = env.Alias('blendernogame', B.program_list)
|
||||
Depends(blendernogame,installtarget)
|
||||
|
||||
if 'blenderlite' in B.targets:
|
||||
blenderlite = env.Alias('blenderlite', B.program_list)
|
||||
@@ -582,16 +612,17 @@ Depends(nsiscmd, allinstall)
|
||||
Default(B.program_list)
|
||||
|
||||
if not env['WITHOUT_BF_INSTALL']:
|
||||
Default(installtarget)
|
||||
|
||||
#------------ RELEASE
|
||||
# TODO: zipup the installation
|
||||
|
||||
#------------ BLENDERPLAYER
|
||||
# TODO: build stubs and link into blenderplayer
|
||||
Default(installtarget)
|
||||
|
||||
#------------ EPYDOC
|
||||
if env['WITH_BF_DOCS']:
|
||||
SConscript('source/blender/python/api2_2x/doc/SConscript')
|
||||
SConscript('source/gameengine/PyDoc/SConscript')
|
||||
try: import epydoc
|
||||
except: epydoc = None
|
||||
|
||||
if epydoc:
|
||||
SConscript('source/blender/python/api2_2x/doc/SConscript')
|
||||
SConscript('source/gameengine/PyDoc/SConscript')
|
||||
else:
|
||||
print "No epydoc install detected, Python API and Gameengine API Docs will not be generated "
|
||||
|
||||
|
||||
|
||||
@@ -1,135 +0,0 @@
|
||||
# $Id$
|
||||
# ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
# The Original Code is Copyright (C) 2006, Blender Foundation
|
||||
# All rights reserved.
|
||||
#
|
||||
# The Original Code is: all of this file.
|
||||
#
|
||||
# Contributor(s): Jacques Beaurain.
|
||||
#
|
||||
# ***** END GPL LICENSE BLOCK *****
|
||||
|
||||
MESSAGE(STATUS "Configuring blenderplayer")
|
||||
|
||||
SETUP_LIBDIRS()
|
||||
|
||||
IF(WITH_QUICKTIME)
|
||||
ADD_DEFINITIONS(-DWITH_QUICKTIME)
|
||||
ENDIF(WITH_QUICKTIME)
|
||||
|
||||
IF(LINUX)
|
||||
ADD_DEFINITIONS(-DWITH_BINRELOC)
|
||||
INCLUDE_DIRECTORIES(${BINRELOC_INC})
|
||||
endif(LINUX)
|
||||
|
||||
ADD_CUSTOM_COMMAND(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/dna.c
|
||||
COMMAND ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/makesdna ${CMAKE_CURRENT_BINARY_DIR}/dna.c ${CMAKE_SOURCE_DIR}/source/blender/makesdna/
|
||||
DEPENDS ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/makesdna
|
||||
)
|
||||
|
||||
IF(WIN32)
|
||||
ADD_EXECUTABLE(blenderplayer ${EXETYPE} ${CMAKE_CURRENT_BINARY_DIR}/dna.c ../source/icons/winblender.rc)
|
||||
ELSE(WIN32)
|
||||
ADD_EXECUTABLE(blenderplayer ${CMAKE_CURRENT_BINARY_DIR}/dna.c)
|
||||
ENDIF(WIN32)
|
||||
|
||||
ADD_DEPENDENCIES(blenderplayer makesdna)
|
||||
|
||||
FILE(READ ${CMAKE_BINARY_DIR}/cmake_blender_libs.txt BLENDER_LINK_LIBS)
|
||||
|
||||
SET(BLENDER_LINK_LIBS ${BLENDER_LINK_LIBS} gp_common gp_ghost blenkernel_blc)
|
||||
|
||||
IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
SET(BLENDER_LINK_LIBS ${BLENDER_LINK_LIBS} extern_binreloc)
|
||||
ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
|
||||
IF(UNIX)
|
||||
# Sort libraries
|
||||
SET(BLENDER_SORTED_LIBS
|
||||
gp_ghost
|
||||
gp_common
|
||||
bf_string
|
||||
bf_ghost
|
||||
bf_blenkernel
|
||||
verse
|
||||
bf_blenkernel
|
||||
bf_decimation
|
||||
bf_blenloader
|
||||
bf_blenpluginapi
|
||||
bf_blroutines
|
||||
bf_converter
|
||||
bf_sumo
|
||||
bf_ketsji
|
||||
extern_solid
|
||||
extern_qhull
|
||||
bf_bullet
|
||||
bf_common
|
||||
bf_dummy
|
||||
bf_logic
|
||||
bf_rasterizer
|
||||
bf_oglrasterizer
|
||||
bf_expressions
|
||||
bf_scenegraph
|
||||
bf_IK
|
||||
bf_moto
|
||||
bf_soundsystem
|
||||
bf_kernel
|
||||
bf_nodes
|
||||
bf_gpu
|
||||
bf_imbuf
|
||||
bf_avi
|
||||
kx_network
|
||||
bf_ngnetwork
|
||||
bf_loopbacknetwork
|
||||
extern_bullet
|
||||
bf_guardedalloc
|
||||
bf_memutil
|
||||
bf_bmfont
|
||||
bf_blenlib
|
||||
bf_cineon
|
||||
bf_openexr
|
||||
bf_dds
|
||||
bf_ftfont
|
||||
extern_ftgl
|
||||
bf_readblenfile
|
||||
blenkernel_blc
|
||||
bf_quicktime
|
||||
extern_binreloc
|
||||
extern_glew
|
||||
)
|
||||
|
||||
FOREACH(SORTLIB ${BLENDER_SORTED_LIBS})
|
||||
SET(REMLIB ${SORTLIB})
|
||||
FOREACH(SEARCHLIB ${BLENDER_LINK_LIBS})
|
||||
IF(${SEARCHLIB} STREQUAL ${SORTLIB})
|
||||
SET(REMLIB "")
|
||||
ENDIF(${SEARCHLIB} STREQUAL ${SORTLIB})
|
||||
ENDFOREACH(SEARCHLIB)
|
||||
IF(REMLIB)
|
||||
MESSAGE(STATUS "Removing library ${REMLIB} from blenderplayer linking because: not configured")
|
||||
LIST(REMOVE_ITEM BLENDER_SORTED_LIBS ${REMLIB})
|
||||
ENDIF(REMLIB)
|
||||
ENDFOREACH(SORTLIB)
|
||||
|
||||
TARGET_LINK_LIBRARIES(blenderplayer ${BLENDER_SORTED_LIBS})
|
||||
ELSE(UNIX)
|
||||
TARGET_LINK_LIBRARIES(blenderplayer ${BLENDER_LINK_LIBS})
|
||||
ENDIF(UNIX)
|
||||
|
||||
SETUP_LIBLINKS(blenderplayer)
|
||||
@@ -1,17 +1,8 @@
|
||||
#
|
||||
# Note : if you want to alter this file
|
||||
# copy it as a whole in the upper folder
|
||||
# as user-config.py
|
||||
# dont create a new file with only some
|
||||
# vars changed.
|
||||
|
||||
import commands
|
||||
|
||||
# IMPORTANT NOTE : OFFICIAL BUILDS SHOULD BE DONE WITH SDKs
|
||||
USE_SDK=True
|
||||
|
||||
BF_PYTHON_VERSION = '2.3'
|
||||
|
||||
cmd = 'uname -p'
|
||||
MAC_PROC=commands.getoutput(cmd)
|
||||
cmd = 'uname -r'
|
||||
@@ -29,6 +20,8 @@ else :
|
||||
LCGDIR = '#../lib/darwin-8.x.i386'
|
||||
LIBDIR = '${LCGDIR}'
|
||||
|
||||
BF_PYTHON_VERSION = '3.1'
|
||||
|
||||
if MAC_PROC== 'powerpc' and BF_PYTHON_VERSION == '2.3':
|
||||
MAC_MIN_VERS = '10.3'
|
||||
MACOSX_SDK='/Developer/SDKs/MacOSX10.3.9.sdk'
|
||||
@@ -39,46 +32,53 @@ else:
|
||||
|
||||
# enable ffmpeg support
|
||||
WITH_BF_FFMPEG = True # -DWITH_FFMPEG
|
||||
BF_FFMPEG = "#extern/ffmpeg"
|
||||
BF_FFMPEG_INC = '${BF_FFMPEG}/include'
|
||||
if USE_SDK==True:
|
||||
BF_FFMPEG_EXTRA = '-isysroot '+MACOSX_SDK+' -mmacosx-version-min='+MAC_MIN_VERS
|
||||
#BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
|
||||
#BF_FFMPEG_LIB = 'avformat.a avcodec.a avutil.a'
|
||||
|
||||
WITH_BF_VERSE = False
|
||||
BF_VERSE = "#extern/verse/dist"
|
||||
BF_VERSE_LIBPATH = "${BF_BUILDDIR}/extern/verse/dist"
|
||||
BF_VERSE_INCLUDE = BF_VERSE
|
||||
BF_VERSE_LIBS = "libverse"
|
||||
|
||||
# python.org libs install in /library we want to use that for 2.5
|
||||
#
|
||||
# if you want py2.5 on leopard without installing
|
||||
# change value to BF_PYTHON = '/Library/Frameworks/Python.framework/Versions/'
|
||||
# BEWARE: in that case it will work only on leopard
|
||||
|
||||
if BF_PYTHON_VERSION=='2.3':
|
||||
BF_PYTHON = '/System/Library/Frameworks/Python.framework/Versions/'
|
||||
FFMPEG_PRECOMPILED = False
|
||||
if FFMPEG_PRECOMPILED:
|
||||
# use precompiled ffmpeg in /lib
|
||||
BF_FFMPEG = LIBDIR + '/ffmpeg'
|
||||
BF_FFMPEG_INC = "#extern/ffmpeg"
|
||||
BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
|
||||
BF_FFMPEG_LIB = 'avcodec avdevice avformat avutil mp3lame swscale x264 xvidcore'
|
||||
else:
|
||||
BF_PYTHON = '/Library/Frameworks/Python.framework/Versions/'
|
||||
# use ffmpeg in extern
|
||||
BF_FFMPEG = "#extern/ffmpeg"
|
||||
BF_FFMPEG_INC = '${BF_FFMPEG}'
|
||||
if USE_SDK==True:
|
||||
BF_FFMPEG_EXTRA = '-isysroot '+MACOSX_SDK+' -mmacosx-version-min='+MAC_MIN_VERS
|
||||
BF_XVIDCORE_CONFIG = '--disable-assembly' # currently causes errors, even with yasm installed
|
||||
BF_X264_CONFIG = '--disable-pthread'
|
||||
|
||||
BF_PYTHON_INC = '${BF_PYTHON}${BF_PYTHON_VERSION}/include/python${BF_PYTHON_VERSION}'
|
||||
BF_PYTHON_BINARY = '${BF_PYTHON}${BF_PYTHON_VERSION}/bin/python${BF_PYTHON_VERSION}'
|
||||
BF_PYTHON_LIB = ''
|
||||
BF_PYTHON_LIBPATH = '${BF_PYTHON}${BF_PYTHON_VERSION}/lib/python${BF_PYTHON_VERSION}/config'
|
||||
BF_PYTHON_LINKFLAGS = '-u _PyMac_Error -framework System -framework Python'
|
||||
if MAC_CUR_VER=='10.3' or MAC_CUR_VER=='10.4':
|
||||
BF_PYTHON_LINKFLAGS ='-u __dummy '+BF_PYTHON_LINKFLAGS
|
||||
if BF_PYTHON_VERSION=='3.1':
|
||||
# python 3.1 uses precompiled libraries in bf svn /lib by default
|
||||
|
||||
BF_PYTHON = LIBDIR + '/python'
|
||||
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_LIBPATH = '${BF_PYTHON}/lib/python${BF_PYTHON_VERSION}'
|
||||
# BF_PYTHON_LINKFLAGS = ['-u', '_PyMac_Error', '-framework', 'System']
|
||||
else:
|
||||
# python 2.5 etc. uses built-in framework
|
||||
|
||||
# python.org libs install in /library we want to use that for 2.5
|
||||
#
|
||||
# if you want py2.5 on leopard without installing
|
||||
# change value to BF_PYTHON = '/Library/Frameworks/Python.framework/Versions/'
|
||||
# BEWARE: in that case it will work only on leopard
|
||||
|
||||
BF_PYTHON = '/System/Library/Frameworks/Python.framework/Versions/'
|
||||
|
||||
BF_PYTHON_INC = '${BF_PYTHON}${BF_PYTHON_VERSION}/include/python${BF_PYTHON_VERSION}'
|
||||
BF_PYTHON_BINARY = '${BF_PYTHON}${BF_PYTHON_VERSION}/bin/python${BF_PYTHON_VERSION}'
|
||||
BF_PYTHON_LIB = ''
|
||||
BF_PYTHON_LIBPATH = '${BF_PYTHON}${BF_PYTHON_VERSION}/lib/python${BF_PYTHON_VERSION}/config'
|
||||
BF_PYTHON_LINKFLAGS = ['-u','_PyMac_Error','-framework','System','-framework','Python']
|
||||
if MAC_CUR_VER=='10.3' or MAC_CUR_VER=='10.4':
|
||||
BF_PYTHON_LINKFLAGS = ['-u', '__dummy']+BF_PYTHON_LINKFLAGS
|
||||
|
||||
BF_QUIET = '1'
|
||||
WITH_BF_OPENMP = '0'
|
||||
|
||||
# Note : should be true, but openal simply dont work on intel
|
||||
if MAC_PROC == 'i386':
|
||||
WITH_BF_OPENAL = False
|
||||
else:
|
||||
WITH_BF_OPENAL = True
|
||||
#different lib must be used following version of gcc
|
||||
# for gcc 3.3
|
||||
#BF_OPENAL = LIBDIR + '/openal'
|
||||
@@ -100,15 +100,30 @@ BF_CXX = '/usr'
|
||||
WITH_BF_STATICCXX = False
|
||||
BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
|
||||
|
||||
BF_LIBSAMPLERATE = LIBDIR + '/samplerate'
|
||||
BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
|
||||
BF_LIBSAMPLERATE_LIB = 'samplerate'
|
||||
BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
|
||||
|
||||
# TODO - set proper paths here (add precompiled to lib/ ? )
|
||||
WITH_BF_JACK = False
|
||||
BF_JACK = '/usr'
|
||||
BF_JACK_INC = '${BF_JACK}/include/jack'
|
||||
BF_JACK_LIB = 'jack'
|
||||
BF_JACK_LIBPATH = '${BF_JACK}/lib'
|
||||
|
||||
WITH_BF_SNDFILE = False
|
||||
BF_SNDFILE = LIBDIR + '/sndfile'
|
||||
BF_SNDFILE_INC = '${BF_SNDFILE}/include'
|
||||
BF_SNDFILE_LIB = 'sndfile'
|
||||
BF_SNDFILE_LIBPATH = '${BF_SNDFILE}/lib'
|
||||
|
||||
WITH_BF_SDL = True
|
||||
BF_SDL = LIBDIR + '/sdl' #$(shell sdl-config --prefix)
|
||||
BF_SDL_INC = '${BF_SDL}/include' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
|
||||
BF_SDL_LIB = 'SDL' #BF_SDL #$(shell $(BF_SDL)/bin/sdl-config --libs) -lSDL_mixer
|
||||
BF_SDL_LIBPATH = '${BF_SDL}/lib'
|
||||
|
||||
WITH_BF_FMOD = False
|
||||
BF_FMOD = LIBDIR + '/fmod'
|
||||
|
||||
WITH_BF_OPENEXR = True
|
||||
WITH_BF_STATICOPENEXR = False
|
||||
BF_OPENEXR = '${LCGDIR}/openexr'
|
||||
@@ -147,29 +162,19 @@ BF_GETTEXT_INC = '${BF_GETTEXT}/include'
|
||||
BF_GETTEXT_LIB = 'intl'
|
||||
BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
|
||||
|
||||
WITH_BF_FTGL = True
|
||||
BF_FTGL = '#extern/bFTGL'
|
||||
BF_FTGL_INC = '${BF_FTGL}/include'
|
||||
BF_FTGL_LIB = 'extern_ftgl'
|
||||
|
||||
WITH_BF_GAMEENGINE=True
|
||||
WITH_BF_PLAYER=True
|
||||
|
||||
WITH_BF_ODE = False
|
||||
BF_ODE = LIBDIR + '/ode'
|
||||
BF_ODE_INC = '${BF_ODE}/include'
|
||||
BF_ODE_LIB = '${BF_ODE}/lib/libode.a'
|
||||
WITH_BF_PLAYER = False
|
||||
|
||||
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_FFTW3 = False
|
||||
BF_FFTW3 = LIBDIR + '/fftw3'
|
||||
BF_FFTW3_INC = '${BF_FFTW3}/include'
|
||||
BF_FFTW3_LIB = 'libfftw3'
|
||||
BF_FFTW3_LIBPATH = '${BF_FFTW3}/lib'
|
||||
|
||||
#WITH_BF_NSPR = True
|
||||
#BF_NSPR = $(LIBDIR)/nspr
|
||||
@@ -206,28 +211,28 @@ BF_ICONV_LIB = 'iconv'
|
||||
WITH_BF_STATICOPENGL = True
|
||||
BF_OPENGL_LIB = 'GL GLU'
|
||||
BF_OPENGL_LIBPATH = '/System/Library/Frameworks/OpenGL.framework/Libraries'
|
||||
BF_OPENGL_LINKFLAGS = '-framework OpenGL'
|
||||
BF_OPENGL_LINKFLAGS = ['-framework', 'OpenGL']
|
||||
|
||||
CFLAGS = ['-pipe','-fPIC','-funsigned-char']
|
||||
|
||||
CPPFLAGS = ['-fpascal-strings']
|
||||
CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fpascal-strings']
|
||||
CXXFLAGS = [ '-pipe','-fPIC','-funsigned-char', '-fpascal-strings']
|
||||
PLATFORM_LINKFLAGS = '-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Carbon -framework AGL -framework AudioUnit -framework AudioToolbox -framework CoreAudio -framework QuickTime'
|
||||
PLATFORM_LINKFLAGS = ['-fexceptions','-framework','CoreServices','-framework','Foundation','-framework','IOKit','-framework','AppKit','-framework','Carbon','-framework','AGL','-framework','AudioUnit','-framework','AudioToolbox','-framework','CoreAudio','-framework','QuickTime']
|
||||
|
||||
#note to build succesfully on 10.3.9 SDK you need to patch 10.3.9 by adding the SystemStubs.a lib from 10.4
|
||||
LLIBS = 'stdc++ SystemStubs'
|
||||
LLIBS = ['stdc++', 'SystemStubs']
|
||||
|
||||
# some flags shuffling for different Os versions
|
||||
if MAC_MIN_VERS == '10.3':
|
||||
CFLAGS = ['-fuse-cxa-atexit']+CFLAGS
|
||||
CXXFLAGS = ['-fuse-cxa-atexit']+CXXFLAGS
|
||||
PLATFORM_LINKFLAGS = '-fuse-cxa-atexit '+PLATFORM_LINKFLAGS
|
||||
LLIBS = LLIBS + ' crt3.o'
|
||||
PLATFORM_LINKFLAGS = ['-fuse-cxa-atexit']+PLATFORM_LINKFLAGS
|
||||
LLIBS.append('crt3.o')
|
||||
|
||||
if USE_SDK==True:
|
||||
SDK_FLAGS=['-isysroot', MACOSX_SDK,'-mmacosx-version-min='+MAC_MIN_VERS]
|
||||
PLATFORM_LINKFLAGS = '-mmacosx-version-min='+MAC_MIN_VERS+ ' -Wl,-syslibroot,' + MACOSX_SDK+" "+PLATFORM_LINKFLAGS
|
||||
PLATFORM_LINKFLAGS = ['-mmacosx-version-min='+MAC_MIN_VERS, '-Wl,-syslibroot,' + MACOSX_SDK]+PLATFORM_LINKFLAGS
|
||||
CCFLAGS=SDK_FLAGS+CCFLAGS
|
||||
CXXFLAGS=SDK_FLAGS+CXXFLAGS
|
||||
|
||||
@@ -260,11 +265,12 @@ CC_WARN = ['-Wall', '-Wno-long-double']
|
||||
##LOPTS = --dynamic
|
||||
##DYNLDFLAGS = -shared $(LDFLAGS)
|
||||
|
||||
BF_PROFILE_FLAGS = ' -pg -g '
|
||||
BF_PROFILE_CCFLAGS = ['-pg', '-g ']
|
||||
BF_PROFILE_LINKFLAGS = ['-pg']
|
||||
BF_PROFILE = False
|
||||
|
||||
BF_DEBUG = False
|
||||
BF_DEBUG_FLAGS = '-g'
|
||||
BF_DEBUG_CCFLAGS = ['-g']
|
||||
|
||||
BF_BUILDDIR='../build/darwin'
|
||||
BF_INSTALLDIR='../install/darwin'
|
||||
|
||||
209
config/irix6-config.py
Normal file
209
config/irix6-config.py
Normal file
@@ -0,0 +1,209 @@
|
||||
import os
|
||||
|
||||
LCGDIR = os.getcwd()+"/../lib/irix-6.5-mips"
|
||||
LIBDIR = LCGDIR
|
||||
|
||||
BF_PYTHON = LCGDIR+'/python'
|
||||
BF_PYTHON_VERSION = '2.5'
|
||||
WITH_BF_STATICPYTHON = 'true'
|
||||
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'
|
||||
|
||||
WITH_BF_OPENAL = 'true'
|
||||
WITH_BF_STATICOPENAL = 'true'
|
||||
BF_OPENAL = LCGDIR+'/openal'
|
||||
BF_OPENAL_INC = '${BF_OPENAL}/include'
|
||||
BF_OPENAL_LIB = 'openal'
|
||||
BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
|
||||
BF_OPENAL_LIBPATH = LIBDIR + '/lib'
|
||||
|
||||
BF_CXX = '/usr'
|
||||
WITH_BF_STATICCXX = 'false'
|
||||
BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
|
||||
|
||||
BF_LIBSAMPLERATE = LCGDIR+'/samplerate'
|
||||
BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
|
||||
BF_LIBSAMPLERATE_LIB = 'samplerate'
|
||||
BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
|
||||
|
||||
WITH_BF_SDL = 'true'
|
||||
BF_SDL = LCGDIR+'/sdl' #$(shell sdl-config --prefix)
|
||||
BF_SDL_INC = '${BF_SDL}/include/SDL' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
|
||||
BF_SDL_LIB = 'SDL audio iconv charset' #BF_SDL #$(shell $(BF_SDL)/bin/sdl-config --libs) -lSDL_mixer
|
||||
BF_SDL_LIBPATH = '${BF_SDL}/lib'
|
||||
|
||||
WITH_BF_OPENEXR = 'false'
|
||||
WITH_BF_STATICOPENEXR = 'false'
|
||||
BF_OPENEXR = '/usr'
|
||||
# when compiling with your own openexr lib you might need to set...
|
||||
# BF_OPENEXR_INC = '${BF_OPENEXR}/include/OpenEXR ${BF_OPENEXR}/include'
|
||||
|
||||
BF_OPENEXR_INC = '${BF_OPENEXR}/include/OpenEXR'
|
||||
BF_OPENEXR_LIB = 'Half IlmImf Iex Imath '
|
||||
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'
|
||||
# BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
|
||||
|
||||
|
||||
WITH_BF_DDS = 'false'
|
||||
|
||||
WITH_BF_JPEG = 'false'
|
||||
BF_JPEG = LCGDIR+'/jpeg'
|
||||
BF_JPEG_INC = '${BF_JPEG}/include'
|
||||
BF_JPEG_LIB = 'jpeg'
|
||||
BF_JPEG_LIBPATH = '${BF_JPEG}/lib'
|
||||
|
||||
WITH_BF_PNG = 'false'
|
||||
BF_PNG = LCGDIR+"/png"
|
||||
BF_PNG_INC = '${BF_PNG}/include'
|
||||
BF_PNG_LIB = 'png'
|
||||
BF_PNG_LIBPATH = '${BF_PNG}/lib'
|
||||
|
||||
BF_TIFF = '/usr/nekoware'
|
||||
BF_TIFF_INC = '${BF_TIFF}/include'
|
||||
|
||||
WITH_BF_ZLIB = 'true'
|
||||
BF_ZLIB = LCGDIR+"/zlib"
|
||||
BF_ZLIB_INC = '${BF_ZLIB}/include'
|
||||
BF_ZLIB_LIB = 'z'
|
||||
BF_ZLIB_LIBPATH = '${BF_ZLIB}/lib'
|
||||
|
||||
WITH_BF_INTERNATIONAL = 'true'
|
||||
|
||||
BF_GETTEXT = LCGDIR+'/gettext'
|
||||
BF_GETTEXT_INC = '${BF_GETTEXT}/include'
|
||||
BF_GETTEXT_LIB = 'gettextpo intl'
|
||||
BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
|
||||
|
||||
WITH_BF_GAMEENGINE='false'
|
||||
WITH_BF_PLAYER = 'false'
|
||||
|
||||
WITH_BF_BULLET = 'true'
|
||||
BF_BULLET = '#extern/bullet2/src'
|
||||
BF_BULLET_INC = '${BF_BULLET}'
|
||||
BF_BULLET_LIB = 'extern_bullet'
|
||||
|
||||
#WITH_BF_NSPR = 'true'
|
||||
#BF_NSPR = $(LIBDIR)/nspr
|
||||
#BF_NSPR_INC = -I$(BF_NSPR)/include -I$(BF_NSPR)/include/nspr
|
||||
#BF_NSPR_LIB =
|
||||
|
||||
# Uncomment the following line to use Mozilla inplace of netscape
|
||||
#CPPFLAGS += -DMOZ_NOT_NET
|
||||
# Location of MOZILLA/Netscape header files...
|
||||
#BF_MOZILLA = $(LIBDIR)/mozilla
|
||||
#BF_MOZILLA_INC = -I$(BF_MOZILLA)/include/mozilla/nspr -I$(BF_MOZILLA)/include/mozilla -I$(BF_MOZILLA)/include/mozilla/xpcom -I$(BF_MOZILLA)/include/mozilla/idl
|
||||
#BF_MOZILLA_LIB =
|
||||
# Will fall back to look in BF_MOZILLA_INC/nspr and BF_MOZILLA_LIB
|
||||
# if this is not set.
|
||||
#
|
||||
# Be paranoid regarding library creation (do not update archives)
|
||||
#BF_PARANOID = 'true'
|
||||
|
||||
# enable freetype2 support for text objects
|
||||
BF_FREETYPE = LCGDIR+'/freetype'
|
||||
BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2'
|
||||
BF_FREETYPE_LIB = 'freetype'
|
||||
BF_FREETYPE_LIBPATH = '${BF_FREETYPE}/lib'
|
||||
|
||||
WITH_BF_QUICKTIME = 'false' # -DWITH_QUICKTIME
|
||||
BF_QUICKTIME = '/usr/local'
|
||||
BF_QUICKTIME_INC = '${BF_QUICKTIME}/include'
|
||||
|
||||
WITH_BF_ICONV = 'true'
|
||||
BF_ICONV = LIBDIR + "/iconv"
|
||||
BF_ICONV_INC = '${BF_ICONV}/include'
|
||||
BF_ICONV_LIB = 'iconv charset'
|
||||
BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
|
||||
|
||||
WITH_BF_BINRELOC = 'false'
|
||||
|
||||
# enable ffmpeg support
|
||||
WITH_BF_FFMPEG = 'true' # -DWITH_FFMPEG
|
||||
# Uncomment the following two lines to use system's ffmpeg
|
||||
BF_FFMPEG = LCGDIR+'/ffmpeg'
|
||||
BF_FFMPEG_LIB = 'avformat avcodec swscale avutil avdevice faad faac vorbis x264 ogg mp3lame z'
|
||||
BF_FFMPEG_INC = '${BF_FFMPEG}/include'
|
||||
BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
|
||||
|
||||
# enable ogg, vorbis and theora in ffmpeg
|
||||
WITH_BF_OGG = 'false' # -DWITH_OGG
|
||||
BF_OGG = '/usr'
|
||||
BF_OGG_INC = '${BF_OGG}/include'
|
||||
BF_OGG_LIB = 'ogg vorbis theoraenc theoradec'
|
||||
|
||||
WITH_BF_OPENJPEG = 'false'
|
||||
BF_OPENJPEG = '#extern/libopenjpeg'
|
||||
BF_OPENJPEG_LIB = ''
|
||||
BF_OPENJPEG_INC = '${BF_OPENJPEG}'
|
||||
BF_OPENJPEG_LIBPATH='${BF_OPENJPEG}/lib'
|
||||
|
||||
WITH_BF_REDCODE = 'false'
|
||||
BF_REDCODE = '#extern/libredcode'
|
||||
BF_REDCODE_LIB = ''
|
||||
BF_REDCODE_INC = '${BF_REDCODE}/include'
|
||||
BF_REDCODE_LIBPATH='${BF_REDCODE}/lib'
|
||||
|
||||
# Mesa Libs should go here if your using them as well....
|
||||
WITH_BF_STATICOPENGL = 'false'
|
||||
BF_OPENGL = '/usr'
|
||||
BF_OPENGL_INC = '${BF_OPENGL}/include'
|
||||
BF_OPENGL_LIB = 'GL GLU X11 Xi Xext'
|
||||
BF_OPENGL_LIBPATH = '/usr/X11R6/lib'
|
||||
BF_OPENGL_LIB_STATIC = '${BF_OPENGL}/libGL.a ${BF_OPENGL}/libGLU.a ${BF_OPENGL}/libXxf86vm.a ${BF_OPENGL}/libX11.a ${BF_OPENGL}/libXi.a ${BF_OPENGL}/libXext.a ${BF_OPENGL}/libXxf86vm.a'
|
||||
|
||||
|
||||
CC = 'c99'
|
||||
CXX = 'CC'
|
||||
|
||||
|
||||
CCFLAGS = ['-pipe','-fPIC', '-n32']
|
||||
|
||||
CPPFLAGS = ['-DXP_UNIX']
|
||||
CXXFLAGS = ['-pipe','-fPIC', '-n32']
|
||||
REL_CFLAGS = ['-O2']
|
||||
REL_CCFLAGS = ['-O2']
|
||||
##BF_DEPEND = 'true'
|
||||
##
|
||||
##AR = ar
|
||||
##ARFLAGS = ruv
|
||||
##ARFLAGSQUIET = ru
|
||||
##
|
||||
C_WARN = '-no_prelink -ptused'
|
||||
|
||||
CC_WARN = '-no_prelink -ptused'
|
||||
|
||||
##FIX_STUBS_WARNINGS = -Wno-unused
|
||||
|
||||
LLIBS = 'c m dl pthread dmedia movie'
|
||||
##LOPTS = --dynamic
|
||||
##DYNLDFLAGS = -shared $(LDFLAGS)
|
||||
|
||||
BF_PROFILE_FLAGS = ['-pg','-g']
|
||||
BF_PROFILE = 'false'
|
||||
|
||||
BF_DEBUG = 'false'
|
||||
BF_DEBUG_FLAGS = '-g'
|
||||
|
||||
BF_BUILDDIR = '../build/irix6'
|
||||
BF_INSTALLDIR='../install/irix6'
|
||||
BF_DOCDIR='../install/doc'
|
||||
|
||||
#Link against pthread
|
||||
LDIRS = []
|
||||
LDIRS.append(BF_FREETYPE_LIBPATH)
|
||||
LDIRS.append(BF_PNG_LIBPATH)
|
||||
LDIRS.append(BF_ZLIB_LIBPATH)
|
||||
LDIRS.append(BF_SDL_LIBPATH)
|
||||
LDIRS.append(BF_OPENAL_LIBPATH)
|
||||
LDIRS.append(BF_ICONV_LIBPATH)
|
||||
|
||||
PLATFORM_LINKFLAGS = []
|
||||
for x in LDIRS:
|
||||
PLATFORM_LINKFLAGS.append("-L"+x)
|
||||
|
||||
PLATFORM_LINKFLAGS += ['-L${LCGDIR}/jpeg/lib' , '-L/usr/lib32', '-n32', '-v', '-no_prelink']
|
||||
print PLATFORM_LINKFLAGS
|
||||
LINKFLAGS= PLATFORM_LINKFLAGS
|
||||
@@ -1,11 +1,9 @@
|
||||
LCGDIR = '../lib/linux2'
|
||||
LIBDIR = "${LCGDIR}"
|
||||
|
||||
WITH_BF_VERSE = False
|
||||
BF_VERSE_INCLUDE = "#extern/verse/dist"
|
||||
|
||||
BF_PYTHON = '/usr'
|
||||
BF_PYTHON_VERSION = '2.5'
|
||||
BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib'
|
||||
BF_PYTHON_VERSION = '3.1'
|
||||
WITH_BF_STATICPYTHON = False
|
||||
BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}'
|
||||
BF_PYTHON_BINARY = '${BF_PYTHON}/bin/python${BF_PYTHON_VERSION}'
|
||||
@@ -20,23 +18,32 @@ BF_OPENAL_INC = '${BF_OPENAL}/include'
|
||||
BF_OPENAL_LIB = 'openal'
|
||||
BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
|
||||
|
||||
# some distros have a separate libalut
|
||||
# if you get linker complaints, you need to uncomment the line below
|
||||
# BF_OPENAL_LIB = 'openal alut'
|
||||
# BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a ${BF_OPENAL}/lib/libalut.a'
|
||||
|
||||
BF_CXX = '/usr'
|
||||
WITH_BF_STATICCXX = False
|
||||
BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
|
||||
|
||||
BF_LIBSAMPLERATE = '/usr'
|
||||
BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
|
||||
BF_LIBSAMPLERATE_LIB = 'samplerate'
|
||||
BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
|
||||
|
||||
WITH_BF_JACK = False
|
||||
BF_JACK = '/usr'
|
||||
BF_JACK_INC = '${BF_JACK}/include/jack'
|
||||
BF_JACK_LIB = 'jack'
|
||||
BF_JACK_LIBPATH = '${BF_JACK}/lib'
|
||||
|
||||
WITH_BF_SNDFILE = False
|
||||
BF_SNDFILE = '/usr'
|
||||
BF_SNDFILE_INC = '${BF_SNDFILE}/include/sndfile'
|
||||
BF_SNDFILE_LIB = 'sndfile'
|
||||
BF_SNDFILE_LIBPATH = '${BF_SNDFILE}/lib'
|
||||
|
||||
WITH_BF_SDL = True
|
||||
BF_SDL = '/usr' #$(shell sdl-config --prefix)
|
||||
BF_SDL_INC = '${BF_SDL}/include/SDL' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
|
||||
BF_SDL_LIB = 'SDL' #BF_SDL #$(shell $(BF_SDL)/bin/sdl-config --libs) -lSDL_mixer
|
||||
|
||||
WITH_BF_FMOD = False
|
||||
BF_FMOD = LIBDIR + '/fmod'
|
||||
|
||||
WITH_BF_OPENEXR = True
|
||||
WITH_BF_STATICOPENEXR = False
|
||||
BF_OPENEXR = '/usr'
|
||||
@@ -76,46 +83,14 @@ BF_GETTEXT_INC = '${BF_GETTEXT}/include'
|
||||
BF_GETTEXT_LIB = 'gettextlib'
|
||||
BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
|
||||
|
||||
WITH_BF_FTGL = True
|
||||
BF_FTGL = '#extern/bFTGL'
|
||||
BF_FTGL_INC = '${BF_FTGL}/include'
|
||||
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_GAMEENGINE = True
|
||||
WITH_BF_PLAYER = False
|
||||
|
||||
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
|
||||
#BF_NSPR_LIB =
|
||||
|
||||
# Uncomment the following line to use Mozilla inplace of netscape
|
||||
#CPPFLAGS += -DMOZ_NOT_NET
|
||||
# Location of MOZILLA/Netscape header files...
|
||||
#BF_MOZILLA = $(LIBDIR)/mozilla
|
||||
#BF_MOZILLA_INC = -I$(BF_MOZILLA)/include/mozilla/nspr -I$(BF_MOZILLA)/include/mozilla -I$(BF_MOZILLA)/include/mozilla/xpcom -I$(BF_MOZILLA)/include/mozilla/idl
|
||||
#BF_MOZILLA_LIB =
|
||||
# Will fall back to look in BF_MOZILLA_INC/nspr and BF_MOZILLA_LIB
|
||||
# if this is not set.
|
||||
#
|
||||
# Be paranoid regarding library creation (do not update archives)
|
||||
#BF_PARANOID = True
|
||||
|
||||
# enable freetype2 support for text objects
|
||||
BF_FREETYPE = '/usr'
|
||||
BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2'
|
||||
@@ -139,26 +114,33 @@ BF_FFMPEG = '#extern/ffmpeg'
|
||||
BF_FFMPEG_LIB = ''
|
||||
# Uncomment the following two lines to use system's ffmpeg
|
||||
# BF_FFMPEG = '/usr'
|
||||
# BF_FFMPEG_LIB = 'avformat avcodec swscale avutil'
|
||||
BF_FFMPEG_INC = '${BF_FFMPEG}/include'
|
||||
# BF_FFMPEG_LIB = 'avformat avcodec swscale avutil avdevice'
|
||||
BF_FFMPEG_INC = '${BF_FFMPEG}'
|
||||
BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
|
||||
|
||||
# enable ogg, vorbis and theora in ffmpeg
|
||||
WITH_BF_OGG = False # -DWITH_OGG
|
||||
BF_OGG = '/usr'
|
||||
BF_OGG_INC = '${BF_OGG}/include'
|
||||
BF_OGG_LIB = 'ogg vorbis theoraenc theoradec'
|
||||
BF_OGG_LIB = 'ogg vorbis vorbisenc theoraenc theoradec'
|
||||
|
||||
WITH_BF_OPENJPEG = True
|
||||
BF_OPENJPEG = '#extern/libopenjpeg'
|
||||
BF_OPENJPEG_LIB = ''
|
||||
BF_OPENJPEG_INC = '${BF_OPENJPEG}/include'
|
||||
BF_OPENJPEG_INC = '${BF_OPENJPEG}'
|
||||
BF_OPENJPEG_LIBPATH='${BF_OPENJPEG}/lib'
|
||||
|
||||
WITH_BF_FFTW3 = False
|
||||
BF_FFTW3 = LIBDIR + '/usr'
|
||||
BF_FFTW3_INC = '${BF_FFTW3}/include'
|
||||
BF_FFTW3_LIB = 'fftw3'
|
||||
BF_FFTW3_LIBPATH = '${BF_FFTW3}/lib'
|
||||
|
||||
WITH_BF_REDCODE = False
|
||||
BF_REDCODE = '#extern/libredcode'
|
||||
BF_REDCODE_LIB = ''
|
||||
BF_REDCODE_INC = '${BF_REDCODE}/include'
|
||||
# BF_REDCODE_INC = '${BF_REDCODE}/include'
|
||||
BF_REDCODE_INC = '${BF_REDCODE}/../' #C files request "libredcode/format.h" which is in "#extern/libredcode/format.h", stupid but compiles for now.
|
||||
BF_REDCODE_LIBPATH='${BF_REDCODE}/lib'
|
||||
|
||||
# Mesa Libs should go here if your using them as well....
|
||||
@@ -188,20 +170,22 @@ REL_CCFLAGS = ['-O2']
|
||||
##ARFLAGSQUIET = ru
|
||||
##
|
||||
C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement']
|
||||
|
||||
CC_WARN = ['-Wall']
|
||||
CXX_WARN = ['-Wno-invalid-offsetof', '-Wno-sign-compare']
|
||||
|
||||
|
||||
##FIX_STUBS_WARNINGS = -Wno-unused
|
||||
|
||||
LLIBS = 'util c m dl pthread stdc++'
|
||||
LLIBS = ['util', 'c', 'm', 'dl', 'pthread', 'stdc++']
|
||||
##LOPTS = --dynamic
|
||||
##DYNLDFLAGS = -shared $(LDFLAGS)
|
||||
|
||||
BF_PROFILE_FLAGS = ['-pg','-g']
|
||||
BF_PROFILE = False
|
||||
BF_PROFILE_CCFLAGS = ['-pg','-g']
|
||||
BF_PROFILE_LINKFLAGS = ['-pg']
|
||||
|
||||
BF_DEBUG = False
|
||||
BF_DEBUG_FLAGS = '-g'
|
||||
BF_DEBUG_CCFLAGS = ['-g']
|
||||
|
||||
BF_BUILDDIR = '../build/linux2'
|
||||
BF_INSTALLDIR='../install/linux2'
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
LCGDIR = '../lib/windows'
|
||||
LCGDIR = '#../lib/windows'
|
||||
LIBDIR = '${LCGDIR}'
|
||||
|
||||
WITH_BF_VERSE = False
|
||||
BF_VERSE_INCLUDE = "#extern/verse/dist"
|
||||
|
||||
WITH_BF_YAFRAY = True
|
||||
|
||||
BF_PYTHON = LIBDIR + '/python'
|
||||
BF_PYTHON_VERSION = '2.5'
|
||||
BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}'
|
||||
@@ -27,6 +22,11 @@ BF_CXX = '/usr'
|
||||
WITH_BF_STATICCXX = False
|
||||
BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
|
||||
|
||||
BF_LIBSAMPLERATE = LIBDIR + '/samplerate'
|
||||
BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
|
||||
BF_LIBSAMPLERATE_LIB = 'samplerate'
|
||||
BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
|
||||
|
||||
WITH_BF_SDL = True
|
||||
BF_SDL = LIBDIR + '/sdl'
|
||||
BF_SDL_INC = '${BF_SDL}/include'
|
||||
@@ -38,9 +38,6 @@ BF_PTHREADS_INC = '${BF_PTHREADS}/include'
|
||||
BF_PTHREADS_LIB = 'pthreadGC2'
|
||||
BF_PTHREADS_LIBPATH = '${BF_PTHREADS}/lib'
|
||||
|
||||
WITH_BF_FMOD = False
|
||||
BF_FMOD = LIBDIR + '/fmod'
|
||||
|
||||
WITH_BF_OPENEXR = True
|
||||
WITH_BF_STATICOPENEXR = False
|
||||
BF_OPENEXR = LIBDIR + '/gcc/openexr'
|
||||
@@ -80,26 +77,16 @@ BF_GETTEXT_INC = '${BF_GETTEXT}/include'
|
||||
BF_GETTEXT_LIB = 'gnu_gettext'
|
||||
BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
|
||||
|
||||
WITH_BF_FTGL = True
|
||||
BF_FTGL = LIBDIR + '/ftgl'
|
||||
BF_FTGL_INC = '${BF_FTGL}/include'
|
||||
BF_FTGL_LIB = 'extern_ftgl'
|
||||
|
||||
WITH_BF_GAMEENGINE = False
|
||||
|
||||
WITH_BF_ODE = True
|
||||
BF_ODE = LIBDIR + '/ode'
|
||||
BF_ODE_INC = BF_ODE + '/include'
|
||||
BF_ODE_LIB = BF_ODE + '/lib/libode.a'
|
||||
WITH_BF_PLAYER = False
|
||||
|
||||
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'
|
||||
BF_WINTAB = LIBDIR + '/wintab'
|
||||
BF_WINTAB_INC = '${BF_WINTAB}/INCLUDE'
|
||||
|
||||
# enable freetype2 support for text objects
|
||||
BF_FREETYPE = LIBDIR + '/gcc/freetype'
|
||||
@@ -144,7 +131,11 @@ CC_WARN = [ '-Wall' ]
|
||||
LLIBS = [ '-ldxguid', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lws2_32', '-lz'] #'-lutil', '-lc', '-lm', '-ldl', '-lpthread' ]
|
||||
|
||||
BF_DEBUG = False
|
||||
BF_DEBUG_FLAGS= ''
|
||||
BF_DEBUG_CCFLAGS= []
|
||||
|
||||
BF_PROFILE = False
|
||||
BF_PROFILE_CCFLAGS = ['-pg','-g']
|
||||
BF_PROFILE_LINKFLAGS = ['-pg']
|
||||
|
||||
BF_BUILDDIR = '../build/linuxcross'
|
||||
BF_INSTALLDIR='../install/linuxcross'
|
||||
|
||||
@@ -16,15 +16,17 @@ WITH_BF_OPENAL = False
|
||||
#BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
|
||||
#BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
|
||||
|
||||
BF_LIBSAMPLERATE = '/usr/local'
|
||||
BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
|
||||
BF_LIBSAMPLERATE_LIB = 'samplerate'
|
||||
BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
|
||||
|
||||
WITH_BF_SDL = True
|
||||
BF_SDL = '/usr/local' #$(shell sdl-config --prefix)
|
||||
BF_SDL_INC = '${BF_SDL}/include/SDL' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
|
||||
BF_SDL_LIB = 'SDL' #BF_SDL #$(shell $(BF_SDL)/bin/sdl-config --libs) -lSDL_mixer
|
||||
BF_SDL_LIBPATH = '${BF_SDL}/lib'
|
||||
|
||||
WITH_BF_FMOD = False
|
||||
BF_FMOD = LIBDIR + '/fmod'
|
||||
|
||||
WITH_BF_OPENEXR = False
|
||||
WITH_BF_STATICOPENEXR = False
|
||||
BF_OPENEXR = '/usr/local'
|
||||
@@ -62,29 +64,14 @@ BF_GETTEXT_INC = '${BF_GETTEXT}/include'
|
||||
BF_GETTEXT_LIB = 'intl iconv'
|
||||
BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
|
||||
|
||||
WITH_BF_FTGL = True
|
||||
BF_FTGL = '#extern/bFTGL'
|
||||
BF_FTGL_INC = '${BF_FTGL}/include'
|
||||
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_PLAYER = False
|
||||
|
||||
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
|
||||
@@ -151,15 +138,16 @@ CC_WARN = ['-Wall']
|
||||
|
||||
##FIX_STUBS_WARNINGS = -Wno-unused
|
||||
|
||||
LLIBS = 'm stdc++ pthread util'
|
||||
LLIBS = ['m', 'stdc++', 'pthread', 'util']
|
||||
##LOPTS = --dynamic
|
||||
##DYNLDFLAGS = -shared $(LDFLAGS)
|
||||
|
||||
BF_PROFILE_FLAGS = ' -pg -g '
|
||||
BF_PROFILE = False
|
||||
BF_PROFILE_CCFLAGS = ['-pg','-g']
|
||||
BF_PROFILE_LINKFLAGS = ['-pg']
|
||||
|
||||
BF_DEBUG = False
|
||||
BF_DEBUG_FLAGS = '-g'
|
||||
BF_DEBUG_CCFLAGS = ['-g']
|
||||
|
||||
BF_BUILDDIR='../build/openbsd3'
|
||||
BF_INSTALLDIR='../install/openbsd3'
|
||||
|
||||
@@ -22,15 +22,17 @@ BF_CXX = '/usr'
|
||||
WITH_BF_STATICCXX = False
|
||||
BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
|
||||
|
||||
BF_LIBSAMPLERATE = '/usr/local'
|
||||
BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
|
||||
BF_LIBSAMPLERATE_LIB = 'samplerate'
|
||||
BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
|
||||
|
||||
WITH_BF_SDL = True
|
||||
BF_SDL = '/usr/local' #$(shell sdl-config --prefix)
|
||||
BF_SDL_INC = '${BF_SDL}/include/SDL' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
|
||||
BF_SDL_LIBPATH = '${BF_SDL}/lib'
|
||||
BF_SDL_LIB = 'SDL' #BF_SDL #$(shell $(BF_SDL)/bin/sdl-config --libs) -lSDL_mixer
|
||||
|
||||
WITH_BF_FMOD = False
|
||||
BF_FMOD = LIBDIR + '/fmod'
|
||||
|
||||
WITH_BF_OPENEXR = True
|
||||
WITH_BF_STATICOPENEXR = False
|
||||
BF_OPENEXR = '/usr/local'
|
||||
@@ -70,29 +72,14 @@ BF_GETTEXT_INC = '${BF_GETTEXT}/include'
|
||||
BF_GETTEXT_LIB = 'gettextlib'
|
||||
BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
|
||||
|
||||
WITH_BF_FTGL = True
|
||||
BF_FTGL = '#extern/bFTGL'
|
||||
BF_FTGL_INC = '${BF_FTGL}/include'
|
||||
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_PLAYER = False
|
||||
|
||||
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
|
||||
@@ -127,11 +114,11 @@ BF_ICONV_LIB = 'iconv'
|
||||
BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
|
||||
|
||||
# enable ffmpeg support
|
||||
WITH_BF_FFMPEG = False # -DWITH_FFMPEG
|
||||
WITH_BF_FFMPEG = True # -DWITH_FFMPEG
|
||||
BF_FFMPEG = '/usr/local'
|
||||
BF_FFMPEG_INC = '${BF_FFMPEG}/include'
|
||||
BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
|
||||
BF_FFMPEG_LIB = 'avformat avcodec avutil'
|
||||
BF_FFMPEG_LIB = 'avformat avcodec avutil avdevice'
|
||||
|
||||
# Mesa Libs should go here if your using them as well....
|
||||
WITH_BF_STATICOPENGL = False
|
||||
@@ -165,19 +152,20 @@ CC_WARN = ['-Wall']
|
||||
|
||||
##FIX_STUBS_WARNINGS = -Wno-unused
|
||||
|
||||
LLIBS = 'c m dl pthread stdc++'
|
||||
LLIBS = ['c', 'm', 'dl', 'pthread', 'stdc++']
|
||||
##LOPTS = --dynamic
|
||||
##DYNLDFLAGS = -shared $(LDFLAGS)
|
||||
|
||||
BF_PROFILE_FLAGS = ['-pg','-g']
|
||||
BF_PROFILE_CCFLAGS = ['-pg', '-g ']
|
||||
BF_PROFILE_LINKFLAGS = ['-pg']
|
||||
BF_PROFILE = False
|
||||
|
||||
BF_DEBUG = False
|
||||
BF_DEBUG_FLAGS = ''
|
||||
BF_DEBUG_CCFLAGS = []
|
||||
|
||||
BF_BUILDDIR = '../build/sunos5'
|
||||
BF_INSTALLDIR='../install/sunos5'
|
||||
BF_DOCDIR='../install/doc'
|
||||
|
||||
|
||||
PLATFORM_LINKFLAGS = ['']
|
||||
PLATFORM_LINKFLAGS = []
|
||||
|
||||
@@ -1,29 +1,42 @@
|
||||
LCGDIR = '#../lib/windows'
|
||||
LIBDIR = "${LCGDIR}"
|
||||
|
||||
WITH_BF_VERSE = False
|
||||
BF_VERSE_INCLUDE = "#extern/verse/dist"
|
||||
|
||||
BF_PYTHON = LIBDIR + '/python'
|
||||
BF_PYTHON_VERSION = '2.5'
|
||||
BF_PYTHON_VERSION = '3.1'
|
||||
WITH_BF_STATICPYTHON = False
|
||||
BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}'
|
||||
BF_PYTHON_BINARY = 'python'
|
||||
BF_PYTHON_LIB = 'python25'
|
||||
BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION[0]}${BF_PYTHON_VERSION[2]}'
|
||||
BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib'
|
||||
BF_PYTHON_LIB_STATIC = '${BF_PYTHON}/lib/libpython${BF_PYTHON_VERSION[0]}${BF_PYTHON_VERSION[2]}.a'
|
||||
|
||||
WITH_BF_OPENAL = True
|
||||
WITH_BF_STATICOPENAL = False
|
||||
BF_OPENAL = LIBDIR + '/openal'
|
||||
BF_OPENAL_INC = '${BF_OPENAL}/include'
|
||||
BF_OPENAL_LIB = 'dxguid openal_static'
|
||||
BF_OPENAL_LIB = 'wrap_oal'
|
||||
BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
|
||||
# Warning, this static lib configuration is untested! users of this OS please confirm.
|
||||
BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
|
||||
|
||||
WITH_BF_FFMPEG = False
|
||||
BF_FFMPEG_LIB = 'avformat swscale avcodec avutil xvidcore x264'
|
||||
BF_FFMPEG_LIBPATH = LIBDIR + '/gcc/ffmpeg/lib'
|
||||
BF_FFMPEG_INC = LIBDIR + '/gcc/ffmpeg/include'
|
||||
BF_FFMPEG_LIB = 'avformat-52 avcodec-52 avdevice-52 avutil-50 swscale-0'
|
||||
BF_FFMPEG_LIBPATH = LIBDIR + '/ffmpeg/lib'
|
||||
BF_FFMPEG_INC = LIBDIR + '/ffmpeg/include'
|
||||
|
||||
BF_LIBSAMPLERATE = LIBDIR + '/samplerate'
|
||||
BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
|
||||
BF_LIBSAMPLERATE_LIB = 'libsamplerate'
|
||||
BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
|
||||
|
||||
WITH_BF_JACK = False
|
||||
BF_JACK = LIBDIR + '/jack'
|
||||
BF_JACK_INC = '${BF_JACK}/include'
|
||||
BF_JACK_LIB = 'libjack'
|
||||
BF_JACK_LIBPATH = '${BF_JACK}/lib'
|
||||
|
||||
WITH_BF_SNDFILE = False
|
||||
BF_SNDFILE = LIBDIR + '/sndfile'
|
||||
BF_SNDFILE_INC = '${BF_SNDFILE}/include'
|
||||
BF_SNDFILE_LIB = 'libsndfile-1'
|
||||
BF_SNDFILE_LIBPATH = '${BF_SNDFILE}/lib'
|
||||
|
||||
WITH_BF_SDL = True
|
||||
BF_SDL = LIBDIR + '/sdl'
|
||||
@@ -36,9 +49,6 @@ BF_PTHREADS_INC = '${BF_PTHREADS}/include'
|
||||
BF_PTHREADS_LIB = 'pthreadGC2'
|
||||
BF_PTHREADS_LIBPATH = '${BF_PTHREADS}/lib'
|
||||
|
||||
WITH_BF_FMOD = False
|
||||
BF_FMOD = LIBDIR + '/fmod'
|
||||
|
||||
WITH_BF_OPENEXR = True
|
||||
WITH_BF_STATICOPENEXR = False
|
||||
BF_OPENEXR = LIBDIR + '/gcc/openexr'
|
||||
@@ -64,6 +74,8 @@ BF_PNG_LIBPATH = '${BF_PNG}/lib'
|
||||
|
||||
BF_TIFF = LIBDIR + '/tiff'
|
||||
BF_TIFF_INC = '${BF_TIFF}/include'
|
||||
BF_TIFF_LIB = 'libtiff'
|
||||
BF_TIFF_LIBPATH = '${BF_TIFF}/lib'
|
||||
|
||||
WITH_BF_ZLIB = True
|
||||
BF_ZLIB = LIBDIR + '/zlib'
|
||||
@@ -77,46 +89,17 @@ BF_GETTEXT_INC = '${BF_GETTEXT}/include'
|
||||
BF_GETTEXT_LIB = 'gnu_gettext'
|
||||
BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
|
||||
|
||||
WITH_BF_FTGL = True
|
||||
BF_FTGL = LIBDIR + '/ftgl'
|
||||
BF_FTGL_INC = '${BF_FTGL}/include'
|
||||
BF_FTGL_LIB = 'extern_ftgl'
|
||||
|
||||
WITH_BF_GAMEENGINE = False
|
||||
|
||||
WITH_BF_ODE = True
|
||||
BF_ODE = LIBDIR + '/ode'
|
||||
BF_ODE_INC = BF_ODE + '/include'
|
||||
BF_ODE_LIB = BF_ODE + '/lib/libode.a'
|
||||
WITH_BF_PLAYER = False
|
||||
|
||||
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'
|
||||
|
||||
BF_WINTAB = LIBDIR + '/wintab'
|
||||
BF_WINTAB_INC = '${BF_WINTAB}/INCLUDE'
|
||||
|
||||
WITH_BF_YAFRAY = True
|
||||
|
||||
#WITH_BF_NSPR = True
|
||||
#BF_NSPR = $(LIBDIR)/nspr
|
||||
#BF_NSPR_INC = -I$(BF_NSPR)/include -I$(BF_NSPR)/include/nspr
|
||||
#BF_NSPR_LIB =
|
||||
|
||||
# Uncomment the following line to use Mozilla inplace of netscape
|
||||
#CPPFLAGS += -DMOZ_NOT_NET
|
||||
# Location of MOZILLA/Netscape header files...
|
||||
#BF_MOZILLA = $(LIBDIR)/mozilla
|
||||
#BF_MOZILLA_INC = -I$(BF_MOZILLA)/include/mozilla/nspr -I$(BF_MOZILLA)/include/mozilla -I$(BF_MOZILLA)/include/mozilla/xpcom -I$(BF_MOZILLA)/include/mozilla/idl
|
||||
#BF_MOZILLA_LIB =
|
||||
# Will fall back to look in BF_MOZILLA_INC/nspr and BF_MOZILLA_LIB
|
||||
# if this is not set.
|
||||
|
||||
# enable freetype2 support for text objects
|
||||
BF_FREETYPE = LIBDIR + '/gcc/freetype'
|
||||
BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2'
|
||||
@@ -160,11 +143,13 @@ CC_WARN = [ '-Wall' ]
|
||||
LLIBS = ['-lshell32', '-lshfolder', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lws2_32', '-lz', '-lstdc++']
|
||||
|
||||
BF_DEBUG = False
|
||||
BF_DEBUG_FLAGS= '-g'
|
||||
BF_DEBUG_CCFLAGS= ['-g']
|
||||
|
||||
BF_PROFILE_FLAGS = ['-pg','-g']
|
||||
BF_PROFILE_CCFLAGS = ['-pg', '-g']
|
||||
BF_PROFILE_LINKFLAGS = ['-pg']
|
||||
BF_PROFILE_FLAGS = BF_PROFILE_CCFLAGS
|
||||
BF_PROFILE = False
|
||||
|
||||
BF_BUILDDIR = '..\\build\\win32-mingw'
|
||||
BF_INSTALLDIR='..\\install\\win32-mingw'
|
||||
BF_DOCDIR = '..\\install\\doc'
|
||||
BF_DOCDIR = '..\\install\\doc'
|
||||
|
||||
@@ -1,36 +1,25 @@
|
||||
LCGDIR = '#../lib/windows'
|
||||
LIBDIR = '${LCGDIR}'
|
||||
|
||||
WITH_BF_VERSE = False
|
||||
BF_VERSE_INCLUDE = "#extern/verse/dist"
|
||||
|
||||
# enable ffmpeg support
|
||||
WITH_BF_FFMPEG = True # -DWITH_FFMPEG
|
||||
BF_FFMPEG = LIBDIR +'/ffmpeg'
|
||||
BF_FFMPEG_INC = '${BF_FFMPEG}/include'
|
||||
BF_FFMPEG_INC = '${BF_FFMPEG}/include ${BF_FFMPEG}/include/msvc'
|
||||
BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
|
||||
BF_FFMPEG_LIB = 'avformat-52.lib avcodec-51.lib avdevice-52.lib avutil-49.lib swscale-0.lib'
|
||||
BF_FFMPEG_LIB = 'avformat-52.lib avcodec-52.lib avdevice-52.lib avutil-50.lib swscale-0.lib'
|
||||
|
||||
BF_PYTHON = LIBDIR + '/python'
|
||||
BF_PYTHON_VERSION = '2.5'
|
||||
BF_PYTHON_VERSION = '3.1'
|
||||
BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}'
|
||||
BF_PYTHON_BINARY = 'python'
|
||||
BF_PYTHON_LIB = 'python25'
|
||||
BF_PYTHON_LIB = 'python31'
|
||||
BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib'
|
||||
|
||||
WITH_BF_OPENAL = True
|
||||
WITH_BF_STATICOPENAL = False
|
||||
BF_OPENAL = LIBDIR + '/openal'
|
||||
BF_OPENAL_INC = '${BF_OPENAL}/include ${BF_OPENAL}/include/AL '
|
||||
BF_OPENAL_LIB = 'dxguid openal_static'
|
||||
BF_OPENAL_INC = '${BF_OPENAL}/include '
|
||||
BF_OPENAL_LIB = 'wrap_oal'
|
||||
BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
|
||||
# Warning, this static lib configuration is untested! users of this OS please confirm.
|
||||
BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
|
||||
|
||||
# TODO - are these useful on win32?
|
||||
# BF_CXX = '/usr'
|
||||
# WITH_BF_STATICCXX = False
|
||||
# BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
|
||||
|
||||
WITH_BF_ICONV = True
|
||||
BF_ICONV = LIBDIR + '/iconv'
|
||||
@@ -38,6 +27,23 @@ BF_ICONV_INC = '${BF_ICONV}/include'
|
||||
BF_ICONV_LIB = 'iconv'
|
||||
BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
|
||||
|
||||
BF_LIBSAMPLERATE = LIBDIR + '/samplerate'
|
||||
BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
|
||||
BF_LIBSAMPLERATE_LIB = 'libsamplerate'
|
||||
BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
|
||||
|
||||
WITH_BF_JACK = False
|
||||
BF_JACK = LIBDIR + '/jack'
|
||||
BF_JACK_INC = '${BF_JACK}/include'
|
||||
BF_JACK_LIB = 'libjack'
|
||||
BF_JACK_LIBPATH = '${BF_JACK}/lib'
|
||||
|
||||
WITH_BF_SNDFILE = False
|
||||
BF_SNDFILE = LIBDIR + '/sndfile'
|
||||
BF_SNDFILE_INC = '${BF_SNDFILE}/include'
|
||||
BF_SNDFILE_LIB = 'libsndfile-1'
|
||||
BF_SNDFILE_LIBPATH = '${BF_SNDFILE}/lib'
|
||||
|
||||
WITH_BF_SDL = True
|
||||
BF_SDL = LIBDIR + '/sdl'
|
||||
BF_SDL_INC = '${BF_SDL}/include'
|
||||
@@ -49,9 +55,6 @@ BF_PTHREADS_INC = '${BF_PTHREADS}/include'
|
||||
BF_PTHREADS_LIB = 'pthreadVC2'
|
||||
BF_PTHREADS_LIBPATH = '${BF_PTHREADS}/lib'
|
||||
|
||||
WITH_BF_FMOD = False
|
||||
BF_FMOD = LIBDIR + '/fmod'
|
||||
|
||||
WITH_BF_OPENEXR = True
|
||||
WITH_BF_STATICOPENEXR = False
|
||||
BF_OPENEXR = LIBDIR + '/openexr'
|
||||
@@ -77,6 +80,8 @@ BF_PNG_LIBPATH = '${BF_PNG}/lib'
|
||||
|
||||
BF_TIFF = LIBDIR + '/tiff'
|
||||
BF_TIFF_INC = '${BF_TIFF}/include'
|
||||
BF_TIFF_LIB = 'libtiff'
|
||||
BF_TIFF_LIBPATH = '${BF_TIFF}/lib'
|
||||
|
||||
WITH_BF_ZLIB = True
|
||||
BF_ZLIB = LIBDIR + '/zlib'
|
||||
@@ -91,52 +96,19 @@ BF_GETTEXT_INC = '${BF_GETTEXT}/include'
|
||||
BF_GETTEXT_LIB = 'gnu_gettext'
|
||||
BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
|
||||
|
||||
WITH_BF_FTGL = True
|
||||
BF_FTGL = LIBDIR + '/ftgl'
|
||||
BF_FTGL_INC = '${BF_FTGL}/include'
|
||||
BF_FTGL_LIB = 'extern_ftgl'
|
||||
|
||||
WITH_BF_GAMEENGINE = True
|
||||
WITH_BF_PLAYER = True
|
||||
|
||||
WITH_BF_ODE = True
|
||||
BF_ODE = LIBDIR + '/ode'
|
||||
BF_ODE_INC = BF_ODE + '/include'
|
||||
BF_ODE_LIB = BF_ODE + '/lib/libode.a'
|
||||
WITH_BF_PLAYER = False
|
||||
|
||||
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'
|
||||
|
||||
BF_WINTAB = LIBDIR + '/wintab'
|
||||
BF_WINTAB_INC = '${BF_WINTAB}/INCLUDE'
|
||||
|
||||
WITH_BF_YAFRAY = True
|
||||
|
||||
WITH_BF_BINRELOC = False
|
||||
|
||||
#WITH_BF_NSPR = True
|
||||
#BF_NSPR = $(LIBDIR)/nspr
|
||||
#BF_NSPR_INC = -I$(BF_NSPR)/include -I$(BF_NSPR)/include/nspr
|
||||
#BF_NSPR_LIB =
|
||||
|
||||
# Uncomment the following line to use Mozilla inplace of netscape
|
||||
#CPPFLAGS += -DMOZ_NOT_NET
|
||||
# Location of MOZILLA/Netscape header files...
|
||||
#BF_MOZILLA = $(LIBDIR)/mozilla
|
||||
#BF_MOZILLA_INC = -I$(BF_MOZILLA)/include/mozilla/nspr -I$(BF_MOZILLA)/include/mozilla -I$(BF_MOZILLA)/include/mozilla/xpcom -I$(BF_MOZILLA)/include/mozilla/idl
|
||||
#BF_MOZILLA_LIB =
|
||||
# Will fall back to look in BF_MOZILLA_INC/nspr and BF_MOZILLA_LIB
|
||||
# if this is not set.
|
||||
#
|
||||
# Be paranoid regarding library creation (do not update archives)
|
||||
#BF_PARANOID = True
|
||||
|
||||
# enable freetype2 support for text objects
|
||||
BF_WITH_FREETYPE = True
|
||||
BF_FREETYPE = LIBDIR + '/freetype'
|
||||
@@ -150,6 +122,21 @@ BF_QUICKTIME_INC = '${BF_QUICKTIME}/CIncludes'
|
||||
BF_QUICKTIME_LIB = 'qtmlClient'
|
||||
BF_QUICKTIME_LIBPATH = '${BF_QUICKTIME}/Libraries'
|
||||
|
||||
WITH_BF_OPENJPEG = True
|
||||
BF_OPENJPEG = '#extern/libopenjpeg'
|
||||
BF_OPENJPEG_LIB = ''
|
||||
BF_OPENJPEG_INC = '${BF_OPENJPEG}'
|
||||
BF_OPENJPEG_LIBPATH='${BF_OPENJPEG}/lib'
|
||||
|
||||
WITH_BF_FFTW3 = False
|
||||
BF_FFTW3 = LIBDIR + '/fftw3'
|
||||
BF_FFTW3_INC = '${BF_FFTW3}/include'
|
||||
BF_FFTW3_LIB = 'libfftw'
|
||||
BF_FFTW3_LIBPATH = '${BF_FFTW3}/lib'
|
||||
|
||||
WITH_BF_REDCODE = False
|
||||
BF_REDCODE_INC = '#extern'
|
||||
|
||||
WITH_BF_STATICOPENGL = False
|
||||
BF_OPENGL_INC = '${BF_OPENGL}/include'
|
||||
BF_OPENGL_LIBINC = '${BF_OPENGL}/lib'
|
||||
@@ -160,7 +147,9 @@ BF_OPENGL_LIB_STATIC = [ '${BF_OPENGL}/lib/libGL.a', '${BF_OPENGL}/lib/libGLU.a'
|
||||
CC = 'cl.exe'
|
||||
CXX = 'cl.exe'
|
||||
|
||||
CCFLAGS = ['/nologo', '/Ob1', '/J', '/W3', '/Gd', '/MT']
|
||||
CCFLAGS = ['/nologo', '/Ob1', '/J', '/W3', '/Gd', '/wd4244', '/wd4305', '/wd4800', '/wd4065', '/wd4267']
|
||||
CXXFLAGS = ['/EHsc']
|
||||
BGE_CXXFLAGS = ['/O2', '/EHsc', '/GR', '/fp:fast', '/arch:SSE']
|
||||
|
||||
BF_DEBUG_CCFLAGS = ['/Zi', '/FR${TARGET}.sbr']
|
||||
|
||||
@@ -173,21 +162,14 @@ C_WARN = []
|
||||
CC_WARN = []
|
||||
CXX_WARN = []
|
||||
|
||||
LLIBS = 'ws2_32 vfw32 winmm kernel32 user32 gdi32 comdlg32 advapi32 shfolder shell32 ole32 oleaut32 uuid'
|
||||
LLIBS = ['ws2_32', 'vfw32', 'winmm', 'kernel32', 'user32', 'gdi32', 'comdlg32', 'advapi32', 'shfolder', 'shell32', 'ole32', 'oleaut32', 'uuid']
|
||||
|
||||
PLATFORM_LINKFLAGS = '''
|
||||
/SUBSYSTEM:CONSOLE
|
||||
/MACHINE:IX86
|
||||
/ENTRY:mainCRTStartup
|
||||
/INCREMENTAL:NO
|
||||
/NODEFAULTLIB:"msvcprt.lib"
|
||||
/NODEFAULTLIB:"glut32.lib"
|
||||
/NODEFAULTLIB:"libc.lib"
|
||||
/NODEFAULTLIB:"libcd.lib"
|
||||
/NODEFAULTLIB:"libcpd.lib"
|
||||
/NODEFAULTLIB:"libcp.lib"
|
||||
/LARGEADDRESSAWARE
|
||||
'''
|
||||
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
|
||||
|
||||
BF_BUILDDIR = '..\\build\\win32-vc'
|
||||
BF_INSTALLDIR='..\\install\\win32-vc'
|
||||
|
||||
203
config/win64-vc-config.py
Normal file
203
config/win64-vc-config.py
Normal file
@@ -0,0 +1,203 @@
|
||||
LCGDIR = '#../lib/win64'
|
||||
LIBDIR = '${LCGDIR}'
|
||||
|
||||
# enable ffmpeg support
|
||||
WITH_BF_FFMPEG = False # -DWITH_FFMPEG
|
||||
BF_FFMPEG = LIBDIR +'/ffmpeg'
|
||||
BF_FFMPEG_INC = '${BF_FFMPEG}/include'
|
||||
BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
|
||||
BF_FFMPEG_LIB = 'avformat-52.lib avcodec-51.lib avdevice-52.lib avutil-49.lib swscale-0.lib'
|
||||
|
||||
BF_PYTHON = LIBDIR + '/python'
|
||||
BF_PYTHON_VERSION = '3.1'
|
||||
BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}'
|
||||
BF_PYTHON_BINARY = 'python'
|
||||
BF_PYTHON_LIB = 'python31'
|
||||
BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib'
|
||||
|
||||
WITH_BF_OPENAL = False
|
||||
BF_OPENAL = LIBDIR + '/openal'
|
||||
BF_OPENAL_INC = '${BF_OPENAL}/include '
|
||||
BF_OPENAL_LIB = 'wrap_oal'
|
||||
BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
|
||||
|
||||
# TODO - are these useful on win32?
|
||||
# BF_CXX = '/usr'
|
||||
# WITH_BF_STATICCXX = False
|
||||
# BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
|
||||
|
||||
WITH_BF_ICONV = True
|
||||
BF_ICONV = LIBDIR + '/iconv'
|
||||
BF_ICONV_INC = '${BF_ICONV}/include'
|
||||
BF_ICONV_LIB = 'iconv'
|
||||
BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
|
||||
|
||||
BF_LIBSAMPLERATE = LIBDIR + '/samplerate'
|
||||
BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
|
||||
BF_LIBSAMPLERATE_LIB = 'libsamplerate'
|
||||
BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
|
||||
|
||||
WITH_BF_SDL = True
|
||||
BF_SDL = LIBDIR + '/sdl'
|
||||
BF_SDL_INC = '${BF_SDL}/include'
|
||||
BF_SDL_LIB = 'SDL.lib'
|
||||
BF_SDL_LIBPATH = '${BF_SDL}/lib'
|
||||
|
||||
BF_PTHREADS = LIBDIR + '/pthreads'
|
||||
BF_PTHREADS_INC = '${BF_PTHREADS}/include'
|
||||
BF_PTHREADS_LIB = 'pthreadVC2'
|
||||
BF_PTHREADS_LIBPATH = '${BF_PTHREADS}/lib'
|
||||
|
||||
WITH_BF_FMOD = False
|
||||
BF_FMOD = LIBDIR + '/fmod'
|
||||
|
||||
WITH_BF_OPENEXR = True
|
||||
WITH_BF_STATICOPENEXR = False
|
||||
BF_OPENEXR = LIBDIR + '/openexr'
|
||||
BF_OPENEXR_INC = '${BF_OPENEXR}/include ${BF_OPENEXR}/include/IlmImf ${BF_OPENEXR}/include/Iex ${BF_OPENEXR}/include/Imath '
|
||||
BF_OPENEXR_LIB = ' Iex Half IlmImf Imath IlmThread '
|
||||
BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib_vs2008'
|
||||
# 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'
|
||||
|
||||
WITH_BF_DDS = True
|
||||
|
||||
WITH_BF_JPEG = True
|
||||
BF_JPEG = LIBDIR + '/jpeg'
|
||||
BF_JPEG_INC = '${BF_JPEG}/include'
|
||||
BF_JPEG_LIB = 'libjpeg'
|
||||
BF_JPEG_LIBPATH = '${BF_JPEG}/lib'
|
||||
|
||||
WITH_BF_PNG = True
|
||||
BF_PNG = LIBDIR + '/png'
|
||||
BF_PNG_INC = '${BF_PNG}/include'
|
||||
BF_PNG_LIB = 'libpng'
|
||||
BF_PNG_LIBPATH = '${BF_PNG}/lib'
|
||||
|
||||
BF_TIFF = LIBDIR + '/tiff'
|
||||
BF_TIFF_INC = '${BF_TIFF}/include'
|
||||
BF_TIFF_LIB = 'libtiff'
|
||||
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 = False
|
||||
|
||||
BF_GETTEXT = LIBDIR + '/gettext'
|
||||
BF_GETTEXT_INC = '${BF_GETTEXT}/include'
|
||||
BF_GETTEXT_LIB = 'gettext'
|
||||
BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
|
||||
|
||||
WITH_BF_GAMEENGINE = True
|
||||
WITH_BF_PLAYER = False
|
||||
|
||||
WITH_BF_BULLET = True
|
||||
BF_BULLET = '#extern/bullet2/src'
|
||||
BF_BULLET_INC = '${BF_BULLET}'
|
||||
BF_BULLET_LIB = 'extern_bullet'
|
||||
|
||||
BF_WINTAB = LIBDIR + '/wintab'
|
||||
BF_WINTAB_INC = '${BF_WINTAB}/INCLUDE'
|
||||
|
||||
WITH_BF_BINRELOC = False
|
||||
|
||||
#WITH_BF_NSPR = True
|
||||
#BF_NSPR = $(LIBDIR)/nspr
|
||||
#BF_NSPR_INC = -I$(BF_NSPR)/include -I$(BF_NSPR)/include/nspr
|
||||
#BF_NSPR_LIB =
|
||||
|
||||
# Uncomment the following line to use Mozilla inplace of netscape
|
||||
#CPPFLAGS += -DMOZ_NOT_NET
|
||||
# Location of MOZILLA/Netscape header files...
|
||||
#BF_MOZILLA = $(LIBDIR)/mozilla
|
||||
#BF_MOZILLA_INC = -I$(BF_MOZILLA)/include/mozilla/nspr -I$(BF_MOZILLA)/include/mozilla -I$(BF_MOZILLA)/include/mozilla/xpcom -I$(BF_MOZILLA)/include/mozilla/idl
|
||||
#BF_MOZILLA_LIB =
|
||||
# Will fall back to look in BF_MOZILLA_INC/nspr and BF_MOZILLA_LIB
|
||||
# if this is not set.
|
||||
#
|
||||
# Be paranoid regarding library creation (do not update archives)
|
||||
#BF_PARANOID = True
|
||||
|
||||
# enable freetype2 support for text objects
|
||||
BF_WITH_FREETYPE = True
|
||||
BF_FREETYPE = LIBDIR + '/freetype'
|
||||
BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2'
|
||||
BF_FREETYPE_LIB = 'freetype2ST'
|
||||
BF_FREETYPE_LIBPATH = '${BF_FREETYPE}/lib'
|
||||
|
||||
WITH_BF_QUICKTIME = False # -DWITH_QUICKTIME
|
||||
BF_QUICKTIME = LIBDIR + '/QTDevWin'
|
||||
BF_QUICKTIME_INC = '${BF_QUICKTIME}/CIncludes'
|
||||
BF_QUICKTIME_LIB = 'qtmlClient'
|
||||
BF_QUICKTIME_LIBPATH = '${BF_QUICKTIME}/Libraries'
|
||||
|
||||
WITH_BF_OPENJPEG = False
|
||||
BF_OPENJPEG = '#extern/libopenjpeg'
|
||||
BF_OPENJPEG_LIB = ''
|
||||
BF_OPENJPEG_INC = '${BF_OPENJPEG}'
|
||||
BF_OPENJPEG_LIBPATH='${BF_OPENJPEG}/lib'
|
||||
|
||||
WITH_BF_FFTW3 = True
|
||||
BF_FFTW3 = LIBDIR + '/fftw3'
|
||||
BF_FFTW3_INC = '${BF_FFTW3}/include'
|
||||
BF_FFTW3_LIB = 'libfftw'
|
||||
BF_FFTW3_LIBPATH = '${BF_FFTW3}/lib'
|
||||
|
||||
WITH_BF_REDCODE = False
|
||||
BF_REDCODE_INC = '#extern'
|
||||
|
||||
WITH_BF_STATICOPENGL = False
|
||||
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' ]
|
||||
CC = 'cl.exe'
|
||||
CXX = 'cl.exe'
|
||||
|
||||
CFLAGS = []
|
||||
CCFLAGS = ['/nologo', '/Ob1', '/J', '/W3', '/Gd', '/wd4244', '/wd4305', '/wd4800', '/wd4065', '/wd4267']
|
||||
CXXFLAGS = ['/EHsc']
|
||||
BGE_CXXFLAGS = ['/O2', '/EHsc', '/GR', '/fp:fast', '/arch:SSE2']
|
||||
|
||||
BF_DEBUG_CCFLAGS = ['/Zi', '/FR${TARGET}.sbr']
|
||||
|
||||
CPPFLAGS = ['-DWIN32','-D_CONSOLE', '-D_LIB', '-DFTGL_LIBRARY_STATIC', '-D_CRT_SECURE_NO_DEPRECATE']
|
||||
REL_CFLAGS = ['-O2', '-DNDEBUG']
|
||||
REL_CCFLAGS = ['-O2', '-DNDEBUG']
|
||||
REL_CXXFLAGS = ['-O2', '-DNDEBUG']
|
||||
|
||||
C_WARN = []
|
||||
CC_WARN = []
|
||||
CXX_WARN = []
|
||||
|
||||
LLIBS = ['ws2_32', 'vfw32', 'winmm', 'kernel32', 'user32', 'gdi32', 'comdlg32', 'advapi32', 'shfolder', 'shell32', 'ole32', 'oleaut32', 'uuid']
|
||||
|
||||
WITH_BF_DOCS=False
|
||||
|
||||
BF_DEBUG=False
|
||||
BF_BSC=False
|
||||
|
||||
if BF_DEBUG:
|
||||
BF_NUMJOBS=1
|
||||
else:
|
||||
BF_NUMJOBS=6
|
||||
|
||||
PLATFORM_LINKFLAGS = ['/SUBSYSTEM:CONSOLE','/MACHINE:X64','/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"']
|
||||
|
||||
BF_BUILDDIR = '..\\build\\blender25-win64-vc'
|
||||
BF_INSTALLDIR='..\\install\\blender25-win64-vc'
|
||||
BF_DOCDIR='..\\install\\blender25-win64-vc\\doc'
|
||||
|
||||
|
||||
|
||||
######################### MERGE WITH ABOVE ################################
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -26,8 +26,9 @@ $Id$
|
||||
----------------
|
||||
|
||||
To build Blender with the SCons scripts you need a full Python
|
||||
install, version 2.4 or later (http://www.python.org) and a SCons
|
||||
installation, version v1.1.0 (http://www.scons.org).
|
||||
install, version 2.4 or later (http://www.python.org). We already provide
|
||||
a scons-local installation, which can be found in the scons/ subdirectory.
|
||||
This document uses the scons-local installation for its examples.
|
||||
|
||||
Check from the page
|
||||
http://www.blender.org/development/building-blender/getting-dependencies/
|
||||
@@ -38,9 +39,14 @@ $Id$
|
||||
In the base directory of the sources (from now on called $BLENDERHOME)
|
||||
you'll see a file named SConstruct. This is the entry point for the
|
||||
SCons build system. In a terminal, change to this directory. To just
|
||||
build, issue the command 'scons':
|
||||
build, start the SCons entry script on Windows (will be used for the remainder
|
||||
of this document):
|
||||
|
||||
% scons
|
||||
% python scons\scons.py
|
||||
|
||||
On a Unix-compatible system it would be
|
||||
|
||||
% python ./scons/scons.py
|
||||
|
||||
This will start the build process with default values. Depending
|
||||
on your platform you may see colour in your output (non-Windows
|
||||
@@ -49,8 +55,9 @@ $Id$
|
||||
build are configured.
|
||||
|
||||
The build uses BF_BUILDDIR to build into and BF_INSTALLDIR to
|
||||
finally copy all needed files to get a proper setup. These
|
||||
variabbles have default values for every platform in
|
||||
finally copy all needed files to get a proper setup. The BF_DOCDIR is
|
||||
used to generate Blender Python documentation files to. These
|
||||
variables have default values for every platform in
|
||||
$BLENDERHOME/config/(platform)-config.py. After the build successfully
|
||||
completes, you can find everything you need in BF_INSTALLDIR.
|
||||
|
||||
@@ -59,7 +66,7 @@ $Id$
|
||||
As an extra dependency, you need the MoreInfo plugin too. The creation of
|
||||
the installer is tied into the build process and can be triggered with:
|
||||
|
||||
% scons nsis
|
||||
% python scons\scons.py nsis
|
||||
|
||||
|
||||
Configuring the build
|
||||
@@ -76,20 +83,21 @@ $Id$
|
||||
(TBD: add cygwin, solaris and freebsd support)
|
||||
|
||||
These files you will normally not change. If you need to override
|
||||
a default value, make a copy of the proper configuration to
|
||||
$BLENDERHOME/user-config.py. This file you can modify to your
|
||||
likings. Any value set here will override the ones from the
|
||||
(platform)-config.py.
|
||||
a default value, make a file called $BLENDERHOME/user-config.py, and copy
|
||||
settings from the config/(platform)-config.py that you want to change. Don't
|
||||
copy the entire file (unless explicitely stated in the configuration file),
|
||||
because you may not get updated options you don't change yourself, which may
|
||||
result in build errors.
|
||||
|
||||
You can use BF_CONFIG argument to override the default user-config.py
|
||||
check. This is just like the user-config.py, but just with another name:
|
||||
|
||||
% scons BF_CONFIG=myownsettings
|
||||
% python scons\scons.py BF_CONFIG=myownsettings
|
||||
|
||||
If you want to quickly test a new setting, you can give the option
|
||||
also on the command-line:
|
||||
|
||||
% scons BF_BUILDDIR=../mybuilddir WITH_BF_OPENEXR=0
|
||||
% python scons\scons.py BF_BUILDDIR=../mybuilddir WITH_BF_OPENEXR=0
|
||||
|
||||
This command sets the build directory to BF_BUILDDIR and disables
|
||||
OpenEXR support.
|
||||
@@ -97,7 +105,7 @@ $Id$
|
||||
If you need to know what can be set through the command-line, run
|
||||
scons with -h:
|
||||
|
||||
% scons -h
|
||||
% python scons\scons.py -h
|
||||
|
||||
This command will print a long list with settable options and what
|
||||
every option means. Many of the default values will be empty, and
|
||||
@@ -118,11 +126,11 @@ $Id$
|
||||
you need to see the full command-line for compiles, then you can
|
||||
change that behaviour. Also the use of colours can be changed:
|
||||
|
||||
% scons BF_FANCY=0
|
||||
% python scons\scons.py BF_FANCY=0
|
||||
|
||||
This will disable the use of colours.
|
||||
|
||||
% scons BF_QUIET=0
|
||||
% python scons\scons.py BF_QUIET=0
|
||||
|
||||
This will give the old, noisy output. Every command-line per
|
||||
compile is printed out in its full glory. This is very useful when
|
||||
@@ -133,11 +141,11 @@ $Id$
|
||||
Compiling Only Some Libraries
|
||||
-----------------------------
|
||||
|
||||
Scons now has support for specifying a list of libraries that are
|
||||
Our implementation now has support for specifying a list of libraries that are
|
||||
exclusively compiled, ignoring all other libraries. This is invoked
|
||||
with the BF_QUICK arguments; for example:
|
||||
|
||||
% scons BF_QUICK=src,bf_blenkernel
|
||||
% python scons\scons.py BF_QUICK=src,bf_blenkernel
|
||||
|
||||
Note that this not the same as passing a list of folders as in the
|
||||
makefile's "quicky" command. In Scons, all of Blender's code modules
|
||||
@@ -157,7 +165,7 @@ $Id$
|
||||
|
||||
BF_QUICKDEBUG is similar to BF_QUICK:
|
||||
|
||||
% scons BF_QUICKDEBUG=src,bf_blenkernel,some-other-lib
|
||||
% python scons\scons.py BF_QUICKDEBUG=src,bf_blenkernel,some-other-lib
|
||||
|
||||
To use BF_DEBUG_LIBS, put something like the following in you user-config.py:
|
||||
|
||||
@@ -184,14 +192,8 @@ $Id$
|
||||
On Windows with all of the three toolset installed you need to
|
||||
specify what toolset to use
|
||||
|
||||
% scons BF_TOOLSET=msvc
|
||||
% scons BF_TOOLSET=mingw
|
||||
|
||||
If you have only the toolkit installed, you will also need to give
|
||||
BF_TOOLSET=mstoolkit on the command-line, to make sure everything is
|
||||
setup properly. Currently there is no good mechanism to automatically
|
||||
determine wether the found 'cl.exe' is from the toolkit or from a
|
||||
complete install.
|
||||
% python scons\scons.py BF_TOOLSET=msvc
|
||||
% python scons\scons.py BF_TOOLSET=mingw
|
||||
|
||||
LINUX and OS X
|
||||
|
||||
@@ -204,30 +206,26 @@ $Id$
|
||||
|
||||
Build Blender with the defaults:
|
||||
|
||||
% scons
|
||||
% python scons\scons.py
|
||||
|
||||
Build Blender, but disable OpenEXR support:
|
||||
|
||||
% scons WITH_BF_OPENEXR=0
|
||||
% python scons\scons.py WITH_BF_OPENEXR=0
|
||||
|
||||
Build Blender, enable debug symbols:
|
||||
|
||||
% scons BF_DEBUG=1
|
||||
% python scons\scons.py BF_DEBUG=1
|
||||
|
||||
Build Blender, install to different directory:
|
||||
|
||||
% scons BF_INSTALLDIR=/tmp/testbuild
|
||||
% python scons\scons.py BF_INSTALLDIR=../myown/installdir
|
||||
|
||||
Build Blender in /tmp/obj and install to /usr/local:
|
||||
Build Blender in ../myown/builddir and install to ../myown/installdir:
|
||||
|
||||
% scons BF_BUILDDIR=/tmp/obj BF_INSTALLDIR=/usr/local
|
||||
% python scons\scons.py BF_BUILDDIR=../myown/builddir BF_INSTALLDIR=../myown/installdir
|
||||
|
||||
Clean BF_BUILDDIR:
|
||||
|
||||
% scons clean
|
||||
|
||||
Clean out the installed files:
|
||||
|
||||
% scons -c
|
||||
% python scons\scons.py clean
|
||||
|
||||
/Nathan Letwory (jesterKing)
|
||||
|
||||
24
extern/CMakeLists.txt
vendored
24
extern/CMakeLists.txt
vendored
@@ -24,25 +24,19 @@
|
||||
#
|
||||
# ***** END GPL LICENSE BLOCK *****
|
||||
|
||||
IF(WITH_GAMEENGINE)
|
||||
SUBDIRS(qhull solid)
|
||||
ENDIF(WITH_GAMEENGINE)
|
||||
|
||||
IF(WITH_BULLET)
|
||||
SUBDIRS(bullet2)
|
||||
ADD_SUBDIRECTORY(bullet2)
|
||||
ENDIF(WITH_BULLET)
|
||||
|
||||
IF(WITH_INTERNATIONAL)
|
||||
SUBDIRS(bFTGL)
|
||||
ENDIF(WITH_INTERNATIONAL)
|
||||
|
||||
IF(WITH_VERSE)
|
||||
SUBDIRS(verse)
|
||||
ENDIF(WITH_VERSE)
|
||||
|
||||
IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
SUBDIRS(binreloc)
|
||||
ADD_SUBDIRECTORY(binreloc)
|
||||
ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
|
||||
SUBDIRS(glew)
|
||||
ADD_SUBDIRECTORY(glew)
|
||||
|
||||
IF(WITH_OPENJPEG)
|
||||
ADD_SUBDIRECTORY(libopenjpeg)
|
||||
ENDIF(WITH_OPENJPEG)
|
||||
|
||||
ADD_SUBDIRECTORY(lzo)
|
||||
ADD_SUBDIRECTORY(lzma)
|
||||
|
||||
41
extern/Makefile
vendored
41
extern/Makefile
vendored
@@ -30,38 +30,31 @@ include nan_definitions.mk
|
||||
|
||||
SOURCEDIR = extern
|
||||
DIR = $(OCGDIR)/extern
|
||||
DIRS = qhull/src solid glew/src
|
||||
DIRS = glew/src
|
||||
|
||||
ifeq ($(WITH_FREETYPE2), true)
|
||||
DIRS += bFTGL/src
|
||||
endif
|
||||
|
||||
ifeq ($(WITH_FFMPEG), true)
|
||||
ifeq ($(NAN_FFMPEG), $(LCGDIR)/ffmpeg)
|
||||
DIRS += ffmpeg
|
||||
endif
|
||||
ifeq ($(NAN_FFMPEG), $(LCGDIR)/gcc/ffmpeg)
|
||||
DIRS += ffmpeg
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(WITH_VERSE), true)
|
||||
DIRS += verse
|
||||
endif
|
||||
|
||||
ifneq ($(NAN_NO_KETSJI), true)
|
||||
DIRS += bullet2
|
||||
endif
|
||||
# Cloth requires it
|
||||
#ifneq ($(NAN_NO_KETSJI), true)
|
||||
DIRS += bullet2
|
||||
#endif
|
||||
|
||||
ifeq ($(WITH_BINRELOC), true)
|
||||
DIRS += binreloc
|
||||
endif
|
||||
|
||||
TARGET =
|
||||
ifneq ($(OS),irix)
|
||||
TARGET=solid
|
||||
ifeq ($(WITH_OPENJPEG), true)
|
||||
DIRS += libopenjpeg
|
||||
endif
|
||||
|
||||
ifeq ($(WITH_LZO), true)
|
||||
DIRS += lzo/minilzo
|
||||
endif
|
||||
|
||||
ifeq ($(WITH_LZMA), true)
|
||||
DIRS += lzma
|
||||
endif
|
||||
|
||||
TARGET = solid
|
||||
|
||||
all::
|
||||
@[ -d $(OCGDIR)/extern ] || mkdir -p $(OCGDIR)/extern
|
||||
@for i in $(DIRS); do \
|
||||
|
||||
14
extern/SConscript
vendored
14
extern/SConscript
vendored
@@ -4,19 +4,9 @@ Import('env')
|
||||
|
||||
SConscript(['glew/SConscript'])
|
||||
|
||||
if env['WITH_BF_GAMEENGINE']:
|
||||
SConscript(['qhull/SConscript',
|
||||
'solid/SConscript'])
|
||||
|
||||
if env['WITH_BF_BULLET']:
|
||||
SConscript(['bullet2/src/SConscript'])
|
||||
|
||||
if env['WITH_BF_INTERNATIONAL']:
|
||||
SConscript(['bFTGL/SConscript'])
|
||||
|
||||
if env['WITH_BF_VERSE']:
|
||||
SConscript(['verse/dist/SConstruct'])
|
||||
|
||||
if env['WITH_BF_FFMPEG'] and env['BF_FFMPEG_LIB'] == '':
|
||||
SConscript(['x264/SConscript'])
|
||||
SConscript(['libmp3lame/SConscript'])
|
||||
@@ -32,5 +22,5 @@ if env['WITH_BF_REDCODE'] and env['BF_REDCODE_LIB'] == '':
|
||||
if env['OURPLATFORM'] == 'linux2':
|
||||
SConscript(['binreloc/SConscript']);
|
||||
|
||||
# FFTW not needed atm - dg
|
||||
# SConscript(['fftw/SConscript'])
|
||||
SConscript(['lzo/SConscript'])
|
||||
SConscript(['lzma/SConscript'])
|
||||
|
||||
32
extern/bFTGL/CMakeLists.txt
vendored
32
extern/bFTGL/CMakeLists.txt
vendored
@@ -1,32 +0,0 @@
|
||||
# $Id$
|
||||
# ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
# The Original Code is Copyright (C) 2006, Blender Foundation
|
||||
# All rights reserved.
|
||||
#
|
||||
# The Original Code is: all of this file.
|
||||
#
|
||||
# Contributor(s): Jacques Beaurain.
|
||||
#
|
||||
# ***** END GPL LICENSE BLOCK *****
|
||||
|
||||
SET(INC include src ${FREETYPE_INC})
|
||||
|
||||
FILE(GLOB SRC src/*.cpp)
|
||||
ADD_DEFINITIONS(-DFTGL_LIBRARY_STATIC)
|
||||
BLENDERLIB(extern_ftgl "${SRC}" "${INC}")
|
||||
#, libtype=['international','player'], priority=[5, 210])
|
||||
481
extern/bFTGL/COPYING.txt
vendored
481
extern/bFTGL/COPYING.txt
vendored
@@ -1,481 +0,0 @@
|
||||
GNU LIBRARY GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the library GPL. It is
|
||||
numbered 2 because it goes with version 2 of the ordinary GPL.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Library General Public License, applies to some
|
||||
specially designated Free Software Foundation software, and to any
|
||||
other libraries whose authors decide to use it. You can use it for
|
||||
your libraries, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if
|
||||
you distribute copies of the library, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link a program with the library, you must provide
|
||||
complete object files to the recipients so that they can relink them
|
||||
with the library, after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
Our method of protecting your rights has two steps: (1) copyright
|
||||
the library, and (2) offer you this license which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
Also, for each distributor's protection, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
library. If the library is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original
|
||||
version, so that any problems introduced by others will not reflect on
|
||||
the original authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that companies distributing free
|
||||
software will individually obtain patent licenses, thus in effect
|
||||
transforming the program into proprietary software. To prevent this,
|
||||
we have made it clear that any patent must be licensed for everyone's
|
||||
free use or not licensed at all.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the ordinary
|
||||
GNU General Public License, which was designed for utility programs. This
|
||||
license, the GNU Library General Public License, applies to certain
|
||||
designated libraries. This license is quite different from the ordinary
|
||||
one; be sure to read it in full, and don't assume that anything in it is
|
||||
the same as in the ordinary license.
|
||||
|
||||
The reason we have a separate public license for some libraries is that
|
||||
they blur the distinction we usually make between modifying or adding to a
|
||||
program and simply using it. Linking a program with a library, without
|
||||
changing the library, is in some sense simply using the library, and is
|
||||
analogous to running a utility program or application program. However, in
|
||||
a textual and legal sense, the linked executable is a combined work, a
|
||||
derivative of the original library, and the ordinary General Public License
|
||||
treats it as such.
|
||||
|
||||
Because of this blurred distinction, using the ordinary General
|
||||
Public License for libraries did not effectively promote software
|
||||
sharing, because most developers did not use the libraries. We
|
||||
concluded that weaker conditions might promote sharing better.
|
||||
|
||||
However, unrestricted linking of non-free programs would deprive the
|
||||
users of those programs of all benefit from the free status of the
|
||||
libraries themselves. This Library General Public License is intended to
|
||||
permit developers of non-free programs to use free libraries, while
|
||||
preserving your freedom as a user of such programs to change the free
|
||||
libraries that are incorporated in them. (We have not seen how to achieve
|
||||
this as regards changes in header files, but we have achieved it as regards
|
||||
changes in the actual functions of the Library.) The hope is that this
|
||||
will lead to faster development of free libraries.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, while the latter only
|
||||
works together with the library.
|
||||
|
||||
Note that it is possible for a library to be covered by the ordinary
|
||||
General Public License rather than by this special one.
|
||||
|
||||
GNU LIBRARY GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library which
|
||||
contains a notice placed by the copyright holder or other authorized
|
||||
party saying it may be distributed under the terms of this Library
|
||||
General Public License (also called "this License"). Each licensee is
|
||||
addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also compile or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
c) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
d) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the source code distributed need not include anything that is normally
|
||||
distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Library General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
||||
51
extern/bFTGL/README.txt
vendored
51
extern/bFTGL/README.txt
vendored
@@ -1,51 +0,0 @@
|
||||
FTGL 2.0.11
|
||||
16 August 2004
|
||||
|
||||
DESCRIPTION:
|
||||
|
||||
FTGL is a free open source library to enable developers to use arbitrary
|
||||
fonts in their OpenGL (www.opengl.org) applications.
|
||||
Unlike other OpenGL font libraries FTGL uses standard font file formats
|
||||
so doesn't need a preprocessing step to convert the high quality font data
|
||||
into a lesser quality, proprietary format.
|
||||
FTGL uses the Freetype (www.freetype.org) font library to open and 'decode'
|
||||
the fonts. It then takes that output and stores it in a format most efficient
|
||||
for OpenGL rendering.
|
||||
|
||||
Rendering modes supported are
|
||||
- Bit maps
|
||||
- Antialiased Pix maps
|
||||
- Texture maps
|
||||
- Outlines
|
||||
- Polygon meshes
|
||||
- Extruded polygon meshes
|
||||
|
||||
FTGL is designed to be used in commercial quality software. It has been
|
||||
written with performance, robustness and simplicity in mind.
|
||||
|
||||
USAGE:
|
||||
|
||||
FTGLPixmapFont font( "Fonts:Arial");
|
||||
|
||||
font.FaceSize( 72);
|
||||
|
||||
font.render( "Hello World!");
|
||||
|
||||
This library was inspired by gltt, Copyright (C) 1998-1999 Stephane Rehel
|
||||
(http://gltt.sourceforge.net)
|
||||
Bezier curve code contributed by Jed Soane.
|
||||
Demo, Linux port, extrusion code and gltt maintainance by Gerard Lanois
|
||||
Linux port by Matthias Kretz
|
||||
Windows port by Andrew Ellerton & Max Rheiner
|
||||
Bug fixes by Robert Osfield, Marcelo E. Magallon, Markku Rontu, Mark A. Fox,
|
||||
Patrick Rogers
|
||||
Containers and optimisations by Sebastien Barre
|
||||
Autoconf Marcelo E. Magallon.
|
||||
|
||||
|
||||
Please contact me if you have any suggestions, feature requests, or problems.
|
||||
|
||||
Henry Maddocks
|
||||
ftgl@opengl.geek.nz
|
||||
http://homepages.paradise.net.nz/henryj/
|
||||
|
||||
12
extern/bFTGL/SConscript
vendored
12
extern/bFTGL/SConscript
vendored
@@ -1,12 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
import sys
|
||||
import os
|
||||
|
||||
Import('env')
|
||||
|
||||
incs = 'include src ' + env['BF_FREETYPE_INC'] + ' ' + env['BF_OPENGL_INC']
|
||||
defs = ''
|
||||
|
||||
sources = env.Glob('src/*.cpp')
|
||||
|
||||
env.BlenderLib ( 'extern_ftgl', sources, Split(incs), Split(defs), libtype=['international','player'], priority=[5, 210])
|
||||
4
extern/bFTGL/cleanup
vendored
4
extern/bFTGL/cleanup
vendored
@@ -1,4 +0,0 @@
|
||||
#!/bin/sh -fx
|
||||
# script to get rid of the grabage that MAC OSX drops in all the directories
|
||||
|
||||
find . -name .DS_Store -print -exec rm {} \;
|
||||
124
extern/bFTGL/include/FTBBox.h
vendored
124
extern/bFTGL/include/FTBBox.h
vendored
@@ -1,124 +0,0 @@
|
||||
#ifndef __FTBBox__
|
||||
#define __FTBBox__
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
//#include FT_GLYPH_H
|
||||
#include FT_OUTLINE_H
|
||||
|
||||
#include "FTGL.h"
|
||||
#include "FTPoint.h"
|
||||
|
||||
|
||||
/**
|
||||
* FTBBox is a convenience class for handling bounding boxes.
|
||||
*/
|
||||
class FTGL_EXPORT FTBBox
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Default constructor. Bounding box is set to zero.
|
||||
*/
|
||||
FTBBox()
|
||||
: lowerX(0.0f),
|
||||
lowerY(0.0f),
|
||||
lowerZ(0.0f),
|
||||
upperX(0.0f),
|
||||
upperY(0.0f),
|
||||
upperZ(0.0f)
|
||||
{}
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
FTBBox( float lx, float ly, float lz, float ux, float uy, float uz)
|
||||
: lowerX(lx),
|
||||
lowerY(ly),
|
||||
lowerZ(lz),
|
||||
upperX(ux),
|
||||
upperY(uy),
|
||||
upperZ(uz)
|
||||
{}
|
||||
|
||||
/**
|
||||
* Constructor. Extracts a bounding box from a freetype glyph. Uses
|
||||
* the control box for the glyph. <code>FT_Glyph_Get_CBox()</code>
|
||||
*
|
||||
* @param glyph A freetype glyph
|
||||
*/
|
||||
FTBBox( FT_GlyphSlot glyph)
|
||||
: lowerX(0.0f),
|
||||
lowerY(0.0f),
|
||||
lowerZ(0.0f),
|
||||
upperX(0.0f),
|
||||
upperY(0.0f),
|
||||
upperZ(0.0f)
|
||||
{
|
||||
FT_BBox bbox;
|
||||
FT_Outline_Get_CBox( &(glyph->outline), &bbox);
|
||||
|
||||
lowerX = static_cast<float>( bbox.xMin) / 64.0f;
|
||||
lowerY = static_cast<float>( bbox.yMin) / 64.0f;
|
||||
lowerZ = 0.0f;
|
||||
upperX = static_cast<float>( bbox.xMax) / 64.0f;
|
||||
upperY = static_cast<float>( bbox.yMax) / 64.0f;
|
||||
upperZ = 0.0f;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
~FTBBox()
|
||||
{}
|
||||
|
||||
|
||||
/**
|
||||
* Move the Bounding Box by a vector.
|
||||
*
|
||||
* @param distance The distance to move the bbox in 3D space.
|
||||
*/
|
||||
FTBBox& Move( FTPoint distance)
|
||||
{
|
||||
lowerX += distance.x;
|
||||
lowerY += distance.y;
|
||||
lowerZ += distance.z;
|
||||
upperX += distance.x;
|
||||
upperY += distance.y;
|
||||
upperZ += distance.z;
|
||||
return *this;
|
||||
}
|
||||
|
||||
FTBBox& operator += ( const FTBBox& bbox)
|
||||
{
|
||||
lowerX = bbox.lowerX < lowerX? bbox.lowerX: lowerX;
|
||||
lowerY = bbox.lowerY < lowerY? bbox.lowerY: lowerY;
|
||||
lowerZ = bbox.lowerZ < lowerZ? bbox.lowerZ: lowerZ;
|
||||
upperX = bbox.upperX > upperX? bbox.upperX: upperX;
|
||||
upperY = bbox.upperY > upperY? bbox.upperY: upperY;
|
||||
upperZ = bbox.upperZ > upperZ? bbox.upperZ: upperZ;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
void SetDepth( float depth)
|
||||
{
|
||||
upperZ = lowerZ + depth;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The bounds of the box
|
||||
*/
|
||||
// Make these ftPoints & private
|
||||
float lowerX, lowerY, lowerZ, upperX, upperY, upperZ;
|
||||
protected:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif // __FTBBox__
|
||||
|
||||
76
extern/bFTGL/include/FTBitmapGlyph.h
vendored
76
extern/bFTGL/include/FTBitmapGlyph.h
vendored
@@ -1,76 +0,0 @@
|
||||
#ifndef __FTBitmapGlyph__
|
||||
#define __FTBitmapGlyph__
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
#include FT_GLYPH_H
|
||||
|
||||
#include "FTGL.h"
|
||||
#include "FTGlyph.h"
|
||||
|
||||
|
||||
/**
|
||||
* FTBitmapGlyph is a specialisation of FTGlyph for creating bitmaps.
|
||||
*
|
||||
* It provides the interface between Freetype glyphs and their openGL
|
||||
* Renderable counterparts. This is an abstract class and derived classes
|
||||
* must implement the <code>Render</code> function.
|
||||
*
|
||||
* @see FTGlyphContainer
|
||||
*
|
||||
*/
|
||||
class FTGL_EXPORT FTBitmapGlyph : public FTGlyph
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param glyph The Freetype glyph to be processed
|
||||
*/
|
||||
FTBitmapGlyph( FT_GlyphSlot glyph);
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
virtual ~FTBitmapGlyph();
|
||||
|
||||
/**
|
||||
* Renders this glyph at the current pen position.
|
||||
*
|
||||
* @param pen The current pen position.
|
||||
* @return The advance distance for this glyph.
|
||||
*/
|
||||
virtual float Render( const FTPoint& pen);
|
||||
|
||||
private:
|
||||
/**
|
||||
* The width of the glyph 'image'
|
||||
*/
|
||||
unsigned int destWidth;
|
||||
|
||||
/**
|
||||
* The height of the glyph 'image'
|
||||
*/
|
||||
unsigned int destHeight;
|
||||
|
||||
/**
|
||||
* The pitch of the glyph 'image'
|
||||
*/
|
||||
unsigned int destPitch;
|
||||
|
||||
/**
|
||||
* Vector from the pen position to the topleft corner of the bitmap
|
||||
*/
|
||||
FTPoint pos;
|
||||
|
||||
/**
|
||||
* Pointer to the 'image' data
|
||||
*/
|
||||
unsigned char* data;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif // __FTBitmapGlyph__
|
||||
|
||||
76
extern/bFTGL/include/FTBufferGlyph.h
vendored
76
extern/bFTGL/include/FTBufferGlyph.h
vendored
@@ -1,76 +0,0 @@
|
||||
#ifndef __FTBufferGlyph__
|
||||
#define __FTBufferGlyph__
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
#include FT_GLYPH_H
|
||||
|
||||
#include "FTGL.h"
|
||||
#include "FTGlyph.h"
|
||||
|
||||
|
||||
/**
|
||||
* FTBufferGlyph is a specialisation of FTGlyph for creating pixmaps.
|
||||
*
|
||||
* @see FTGlyphContainer
|
||||
*
|
||||
*/
|
||||
class FTGL_EXPORT FTBufferGlyph : public FTGlyph
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param glyph The Freetype glyph to be processed
|
||||
*/
|
||||
FTBufferGlyph( FT_GlyphSlot glyph, unsigned char* clientBuffer);
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
virtual ~FTBufferGlyph();
|
||||
|
||||
/**
|
||||
* Renders this glyph at the current pen position.
|
||||
*
|
||||
* @param pen The current pen position.
|
||||
* @return The advance distance for this glyph.
|
||||
*/
|
||||
virtual float Render( const FTPoint& pen);
|
||||
|
||||
// attributes
|
||||
|
||||
private:
|
||||
/**
|
||||
* The width of the glyph 'image'
|
||||
*/
|
||||
int destWidth;
|
||||
|
||||
/**
|
||||
* The height of the glyph 'image'
|
||||
*/
|
||||
int destHeight;
|
||||
|
||||
/**
|
||||
* The pitch of the glyph 'image'
|
||||
*/
|
||||
unsigned int destPitch;
|
||||
|
||||
/**
|
||||
* Vector from the pen position to the topleft corner of the pixmap
|
||||
*/
|
||||
FTPoint pos;
|
||||
|
||||
/**
|
||||
* Pointer to the 'image' data
|
||||
*/
|
||||
unsigned char* data;
|
||||
|
||||
|
||||
unsigned char* buffer;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif // __FTBufferGlyph__
|
||||
130
extern/bFTGL/include/FTCharToGlyphIndexMap.h
vendored
130
extern/bFTGL/include/FTCharToGlyphIndexMap.h
vendored
@@ -1,130 +0,0 @@
|
||||
#ifndef __FTCharToGlyphIndexMap__
|
||||
#define __FTCharToGlyphIndexMap__
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "FTGL.h"
|
||||
|
||||
/**
|
||||
* Provides a non-STL alternative to the STL map<unsigned long, unsigned long>
|
||||
* which maps character codes to glyph indices inside FTCharmap.
|
||||
*
|
||||
* Implementation:
|
||||
* - NumberOfBuckets buckets are considered.
|
||||
* - Each bucket has BucketSize entries.
|
||||
* - When the glyph index for the character code C has to be stored, the
|
||||
* bucket this character belongs to is found using 'C div BucketSize'.
|
||||
* If this bucket has not been allocated yet, do it now.
|
||||
* The entry in the bucked is found using 'C mod BucketSize'.
|
||||
* If it is set to IndexNotFound, then the glyph entry has not been set.
|
||||
* - Try to mimic the calls made to the STL map API.
|
||||
*
|
||||
* Caveats:
|
||||
* - The glyph index is now a signed long instead of unsigned long, so
|
||||
* the special value IndexNotFound (= -1) can be used to specify that the
|
||||
* glyph index has not been stored yet.
|
||||
*/
|
||||
class FTGL_EXPORT FTCharToGlyphIndexMap
|
||||
{
|
||||
public:
|
||||
|
||||
typedef unsigned long CharacterCode;
|
||||
typedef signed long GlyphIndex;
|
||||
|
||||
enum
|
||||
{
|
||||
NumberOfBuckets = 256,
|
||||
BucketSize = 256,
|
||||
IndexNotFound = -1
|
||||
};
|
||||
|
||||
FTCharToGlyphIndexMap()
|
||||
{
|
||||
this->Indices = 0;
|
||||
}
|
||||
|
||||
virtual ~FTCharToGlyphIndexMap()
|
||||
{
|
||||
if( this->Indices)
|
||||
{
|
||||
// Free all buckets
|
||||
this->clear();
|
||||
|
||||
// Free main structure
|
||||
delete [] this->Indices;
|
||||
this->Indices = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void clear()
|
||||
{
|
||||
if(this->Indices)
|
||||
{
|
||||
for( int i = 0; i < FTCharToGlyphIndexMap::NumberOfBuckets; i++)
|
||||
{
|
||||
if( this->Indices[i])
|
||||
{
|
||||
delete [] this->Indices[i];
|
||||
this->Indices[i] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const GlyphIndex find( CharacterCode c)
|
||||
{
|
||||
if( !this->Indices)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Find position of char code in buckets
|
||||
div_t pos = div( c, FTCharToGlyphIndexMap::BucketSize);
|
||||
|
||||
if( !this->Indices[pos.quot])
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
const FTCharToGlyphIndexMap::GlyphIndex *ptr = &this->Indices[pos.quot][pos.rem];
|
||||
if( *ptr == FTCharToGlyphIndexMap::IndexNotFound)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return *ptr;
|
||||
}
|
||||
|
||||
void insert( CharacterCode c, GlyphIndex g)
|
||||
{
|
||||
if( !this->Indices)
|
||||
{
|
||||
this->Indices = new GlyphIndex* [FTCharToGlyphIndexMap::NumberOfBuckets];
|
||||
for( int i = 0; i < FTCharToGlyphIndexMap::NumberOfBuckets; i++)
|
||||
{
|
||||
this->Indices[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Find position of char code in buckets
|
||||
div_t pos = div(c, FTCharToGlyphIndexMap::BucketSize);
|
||||
|
||||
// Allocate bucket if does not exist yet
|
||||
if( !this->Indices[pos.quot])
|
||||
{
|
||||
this->Indices[pos.quot] = new GlyphIndex [FTCharToGlyphIndexMap::BucketSize];
|
||||
for( int i = 0; i < FTCharToGlyphIndexMap::BucketSize; i++)
|
||||
{
|
||||
this->Indices[pos.quot][i] = FTCharToGlyphIndexMap::IndexNotFound;
|
||||
}
|
||||
}
|
||||
|
||||
this->Indices[pos.quot][pos.rem] = g;
|
||||
}
|
||||
|
||||
private:
|
||||
GlyphIndex** Indices;
|
||||
};
|
||||
|
||||
|
||||
#endif // __FTCharToGlyphIndexMap__
|
||||
136
extern/bFTGL/include/FTCharmap.h
vendored
136
extern/bFTGL/include/FTCharmap.h
vendored
@@ -1,136 +0,0 @@
|
||||
#ifndef __FTCharmap__
|
||||
#define __FTCharmap__
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
#include FT_GLYPH_H
|
||||
|
||||
#include "FTCharToGlyphIndexMap.h"
|
||||
|
||||
#include "FTGL.h"
|
||||
|
||||
|
||||
/**
|
||||
* FTCharmap takes care of specifying the encoding for a font and mapping
|
||||
* character codes to glyph indices.
|
||||
*
|
||||
* It doesn't preprocess all indices, only on an as needed basis. This may
|
||||
* seem like a performance penalty but it is quicker than using the 'raw'
|
||||
* freetype calls and will save significant amounts of memory when dealing
|
||||
* with unicode encoding
|
||||
*
|
||||
* @see "Freetype 2 Documentation"
|
||||
*
|
||||
*/
|
||||
|
||||
class FTFace;
|
||||
|
||||
class FTGL_EXPORT FTCharmap
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
FTCharmap( FTFace* face);
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
virtual ~FTCharmap();
|
||||
|
||||
/**
|
||||
* Queries for the current character map code.
|
||||
*
|
||||
* @return The current character map code.
|
||||
*/
|
||||
FT_Encoding Encoding() const { return ftEncoding;}
|
||||
|
||||
/**
|
||||
* Sets the character map for the face.
|
||||
* Valid encodings as at Freetype 2.0.4
|
||||
* ft_encoding_none
|
||||
* ft_encoding_symbol
|
||||
* ft_encoding_unicode
|
||||
* ft_encoding_latin_2
|
||||
* ft_encoding_sjis
|
||||
* ft_encoding_gb2312
|
||||
* ft_encoding_big5
|
||||
* ft_encoding_wansung
|
||||
* ft_encoding_johab
|
||||
* ft_encoding_adobe_standard
|
||||
* ft_encoding_adobe_expert
|
||||
* ft_encoding_adobe_custom
|
||||
* ft_encoding_apple_roman
|
||||
*
|
||||
* @param encoding the Freetype encoding symbol. See above.
|
||||
* @return <code>true</code> if charmap was valid and set
|
||||
* correctly. If the requested encoding is
|
||||
* unavailable it will be set to ft_encoding_none.
|
||||
*/
|
||||
bool CharMap( FT_Encoding encoding);
|
||||
|
||||
/**
|
||||
* Get the FTGlyphContainer index of the input character.
|
||||
*
|
||||
* @param characterCode The character code of the requested glyph in
|
||||
* the current encoding eg apple roman.
|
||||
* @return The FTGlyphContainer index for the character or zero
|
||||
* if it wasn't found
|
||||
*/
|
||||
unsigned int GlyphListIndex( const unsigned int characterCode);
|
||||
|
||||
/**
|
||||
* Get the font glyph index of the input character.
|
||||
*
|
||||
* @param characterCode The character code of the requested glyph in
|
||||
* the current encoding eg apple roman.
|
||||
* @return The glyph index for the character.
|
||||
*/
|
||||
unsigned int FontIndex( const unsigned int characterCode);
|
||||
|
||||
/**
|
||||
* Set the FTGlyphContainer index of the character code.
|
||||
*
|
||||
* @param characterCode The character code of the requested glyph in
|
||||
* the current encoding eg apple roman.
|
||||
* @param containerIndex The index into the FTGlyphContainer of the
|
||||
* character code.
|
||||
*/
|
||||
void InsertIndex( const unsigned int characterCode, const unsigned int containerIndex);
|
||||
|
||||
/**
|
||||
* Queries for errors.
|
||||
*
|
||||
* @return The current error code. Zero means no error.
|
||||
*/
|
||||
FT_Error Error() const { return err;}
|
||||
|
||||
private:
|
||||
/**
|
||||
* Current character map code.
|
||||
*/
|
||||
FT_Encoding ftEncoding;
|
||||
|
||||
/**
|
||||
* The current Freetype face.
|
||||
*/
|
||||
const FT_Face ftFace;
|
||||
|
||||
/**
|
||||
* A structure that maps glyph indices to character codes
|
||||
*
|
||||
* < character code, face glyph index>
|
||||
*/
|
||||
typedef FTCharToGlyphIndexMap CharacterMap;
|
||||
CharacterMap charMap;
|
||||
|
||||
/**
|
||||
* Current error code.
|
||||
*/
|
||||
FT_Error err;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif // __FTCharmap__
|
||||
88
extern/bFTGL/include/FTContour.h
vendored
88
extern/bFTGL/include/FTContour.h
vendored
@@ -1,88 +0,0 @@
|
||||
#ifndef __FTContour__
|
||||
#define __FTContour__
|
||||
|
||||
#include "FTPoint.h"
|
||||
#include "FTVector.h"
|
||||
#include "FTGL.h"
|
||||
|
||||
|
||||
/**
|
||||
* FTContour class is a container of points that describe a vector font
|
||||
* outline. It is used as a container for the output of the bezier curve
|
||||
* evaluator in FTVectoriser.
|
||||
*
|
||||
* @see FTOutlineGlyph
|
||||
* @see FTPolyGlyph
|
||||
* @see FTPoint
|
||||
*/
|
||||
class FTGL_EXPORT FTContour
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param contour
|
||||
* @param pointTags
|
||||
* @param numberOfPoints
|
||||
*/
|
||||
FTContour( FT_Vector* contour, char* pointTags, unsigned int numberOfPoints);
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
~FTContour()
|
||||
{
|
||||
pointList.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a point at index.
|
||||
*
|
||||
* @param index of the point in the curve.
|
||||
* @return const point reference
|
||||
*/
|
||||
const FTPoint& Point( unsigned int index) const { return pointList[index];}
|
||||
|
||||
/**
|
||||
* How many points define this contour
|
||||
*
|
||||
* @return the number of points in this contour
|
||||
*/
|
||||
size_t PointCount() const { return pointList.size();}
|
||||
|
||||
private:
|
||||
/**
|
||||
* Add a point to this contour. This function tests for duplicate
|
||||
* points.
|
||||
*
|
||||
* @param point The point to be added to the contour.
|
||||
*/
|
||||
inline void AddPoint( FTPoint point);
|
||||
|
||||
inline void AddPoint( float x, float y);
|
||||
|
||||
/**
|
||||
* De Casteljau (bezier) algorithm contributed by Jed Soane
|
||||
* Evaluates a quadratic or conic (second degree) curve
|
||||
*/
|
||||
inline void evaluateQuadraticCurve();
|
||||
|
||||
/**
|
||||
* De Casteljau (bezier) algorithm contributed by Jed Soane
|
||||
* Evaluates a cubic (third degree) curve
|
||||
*/
|
||||
inline void evaluateCubicCurve();
|
||||
|
||||
/**
|
||||
* The list of points in this contour
|
||||
*/
|
||||
typedef FTVector<FTPoint> PointVector;
|
||||
PointVector pointList;
|
||||
|
||||
/**
|
||||
* 2D array storing values of de Casteljau algorithm.
|
||||
*/
|
||||
float controlPoints[4][2];
|
||||
};
|
||||
|
||||
#endif // __FTContour__
|
||||
71
extern/bFTGL/include/FTExtrdGlyph.h
vendored
71
extern/bFTGL/include/FTExtrdGlyph.h
vendored
@@ -1,71 +0,0 @@
|
||||
#ifndef __FTExtrdGlyph__
|
||||
#define __FTExtrdGlyph__
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
#include FT_GLYPH_H
|
||||
|
||||
#include "FTGL.h"
|
||||
#include "FTGlyph.h"
|
||||
|
||||
class FTVectoriser;
|
||||
|
||||
/**
|
||||
* FTExtrdGlyph is a specialisation of FTGlyph for creating tessellated
|
||||
* extruded polygon glyphs.
|
||||
*
|
||||
* @see FTGlyphContainer
|
||||
* @see FTVectoriser
|
||||
*
|
||||
*/
|
||||
class FTGL_EXPORT FTExtrdGlyph : public FTGlyph
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Constructor. Sets the Error to Invalid_Outline if the glyphs isn't an outline.
|
||||
*
|
||||
* @param glyph The Freetype glyph to be processed
|
||||
* @param depth The distance along the z axis to extrude the glyph
|
||||
*/
|
||||
FTExtrdGlyph( FT_GlyphSlot glyph, float depth);
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
virtual ~FTExtrdGlyph();
|
||||
|
||||
/**
|
||||
* Renders this glyph at the current pen position.
|
||||
*
|
||||
* @param pen The current pen position.
|
||||
* @return The advance distance for this glyph.
|
||||
*/
|
||||
virtual float Render( const FTPoint& pen);
|
||||
|
||||
private:
|
||||
/**
|
||||
* Calculate the normal vector to 2 points. This is 2D and ignores
|
||||
* the z component. The normal will be normalised
|
||||
*
|
||||
* @param a
|
||||
* @param b
|
||||
* @return
|
||||
*/
|
||||
FTPoint GetNormal( const FTPoint &a, const FTPoint &b);
|
||||
|
||||
|
||||
/**
|
||||
* OpenGL display list
|
||||
*/
|
||||
GLuint glList;
|
||||
|
||||
/**
|
||||
* Distance to extrude the glyph
|
||||
*/
|
||||
float depth;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif // __FTExtrdGlyph__
|
||||
|
||||
149
extern/bFTGL/include/FTFace.h
vendored
149
extern/bFTGL/include/FTFace.h
vendored
@@ -1,149 +0,0 @@
|
||||
#ifndef __FTFace__
|
||||
#define __FTFace__
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
#include FT_GLYPH_H
|
||||
|
||||
#include "FTGL.h"
|
||||
#include "FTPoint.h"
|
||||
#include "FTSize.h"
|
||||
|
||||
/**
|
||||
* FTFace class provides an abstraction layer for the Freetype Face.
|
||||
*
|
||||
* @see "Freetype 2 Documentation"
|
||||
*
|
||||
*/
|
||||
class FTGL_EXPORT FTFace
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Opens and reads a face file. Error is set.
|
||||
*
|
||||
* @param filename font file name.
|
||||
*/
|
||||
FTFace( const char* filename);
|
||||
|
||||
/**
|
||||
* Read face data from an in-memory buffer. Error is set.
|
||||
*
|
||||
* @param pBufferBytes the in-memory buffer
|
||||
* @param bufferSizeInBytes the length of the buffer in bytes
|
||||
*/
|
||||
FTFace( const unsigned char *pBufferBytes, size_t bufferSizeInBytes );
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*
|
||||
* Disposes of the current Freetype Face.
|
||||
*/
|
||||
virtual ~FTFace();
|
||||
|
||||
/**
|
||||
* Attach auxilliary file to font (e.g., font metrics).
|
||||
*
|
||||
* @param filename auxilliary font file name.
|
||||
* @return <code>true</code> if file has opened
|
||||
* successfully.
|
||||
*/
|
||||
bool Attach( const char* filename);
|
||||
|
||||
/**
|
||||
* Attach auxilliary data to font (e.g., font metrics) from memory
|
||||
*
|
||||
* @param pBufferBytes the in-memory buffer
|
||||
* @param bufferSizeInBytes the length of the buffer in bytes
|
||||
* @return <code>true</code> if file has opened
|
||||
* successfully.
|
||||
*/
|
||||
bool Attach( const unsigned char *pBufferBytes, size_t bufferSizeInBytes);
|
||||
|
||||
/**
|
||||
* Disposes of the face
|
||||
*/
|
||||
void Close();
|
||||
|
||||
/**
|
||||
* Get the freetype face object..
|
||||
*
|
||||
* @return pointer to an FT_Face.
|
||||
*/
|
||||
FT_Face* Face() const { return ftFace;}
|
||||
|
||||
/**
|
||||
* Sets the char size for the current face.
|
||||
*
|
||||
* This doesn't guarantee that the size was set correctly. Clients
|
||||
* should check errors.
|
||||
*
|
||||
* @param size the face size in points (1/72 inch)
|
||||
* @param res the resolution of the target device.
|
||||
* @return <code>FTSize</code> object
|
||||
*/
|
||||
const FTSize& Size( const unsigned int size, const unsigned int res);
|
||||
|
||||
unsigned int UnitsPerEM() const;
|
||||
|
||||
/**
|
||||
* Get the number of character maps in this face.
|
||||
*
|
||||
* @return character map count.
|
||||
*/
|
||||
unsigned int CharMapCount();
|
||||
|
||||
/**
|
||||
* Get a list of character maps in this face.
|
||||
*
|
||||
* @return pointer to the first encoding.
|
||||
*/
|
||||
FT_Encoding* CharMapList();
|
||||
|
||||
/**
|
||||
* Gets the kerning vector between two glyphs
|
||||
*/
|
||||
FTPoint KernAdvance( unsigned int index1, unsigned int index2);
|
||||
|
||||
/**
|
||||
* Loads and creates a Freetype glyph.
|
||||
*/
|
||||
FT_GlyphSlot Glyph( unsigned int index, FT_Int load_flags);
|
||||
|
||||
/**
|
||||
* Gets the number of glyphs in the current face.
|
||||
*/
|
||||
unsigned int GlyphCount() const { return numGlyphs;}
|
||||
|
||||
/**
|
||||
* Queries for errors.
|
||||
*
|
||||
* @return The current error code.
|
||||
*/
|
||||
FT_Error Error() const { return err; }
|
||||
|
||||
private:
|
||||
/**
|
||||
* The Freetype face
|
||||
*/
|
||||
FT_Face* ftFace;
|
||||
|
||||
/**
|
||||
* The size object associated with this face
|
||||
*/
|
||||
FTSize charSize;
|
||||
|
||||
/**
|
||||
* The number of glyphs in this face
|
||||
*/
|
||||
int numGlyphs;
|
||||
|
||||
FT_Encoding* fontEncodingList;
|
||||
|
||||
/**
|
||||
* Current error code. Zero means no error.
|
||||
*/
|
||||
FT_Error err;
|
||||
};
|
||||
|
||||
|
||||
#endif // __FTFace__
|
||||
260
extern/bFTGL/include/FTFont.h
vendored
260
extern/bFTGL/include/FTFont.h
vendored
@@ -1,260 +0,0 @@
|
||||
#ifndef __FTFont__
|
||||
#define __FTFont__
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
#include "FTFace.h"
|
||||
#include "FTGL.h"
|
||||
|
||||
class FTGlyphContainer;
|
||||
class FTGlyph;
|
||||
|
||||
|
||||
/**
|
||||
* FTFont is the public interface for the FTGL library.
|
||||
*
|
||||
* Specific font classes are derived from this class. It uses the helper
|
||||
* classes FTFace and FTSize to access the Freetype library. This class
|
||||
* is abstract and deriving classes must implement the protected
|
||||
* <code>MakeGlyph</code> function to create glyphs of the
|
||||
* appropriate type.
|
||||
*
|
||||
* It is good practice after using these functions to test the error
|
||||
* code returned. <code>FT_Error Error()</code>
|
||||
*
|
||||
* @see FTFace
|
||||
* @see FTSize
|
||||
* @see FTGlyphContainer
|
||||
* @see FTGlyph
|
||||
*/
|
||||
class FTGL_EXPORT FTFont
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Open and read a font file. Sets Error flag.
|
||||
*
|
||||
* @param fontname font file name.
|
||||
*/
|
||||
FTFont( const char* fontname);
|
||||
|
||||
/**
|
||||
* Open and read a font from a buffer in memory. Sets Error flag.
|
||||
* The buffer is owned by the client and is NOT copied by FTGL. The
|
||||
* pointer must be valid while using FTGL.
|
||||
*
|
||||
* @param pBufferBytes the in-memory buffer
|
||||
* @param bufferSizeInBytes the length of the buffer in bytes
|
||||
*/
|
||||
FTFont( const unsigned char *pBufferBytes, size_t bufferSizeInBytes);
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
virtual ~FTFont();
|
||||
|
||||
/**
|
||||
* Attach auxilliary file to font e.g font metrics.
|
||||
*
|
||||
* Note: not all font formats implement this function.
|
||||
*
|
||||
* @param filename auxilliary font file name.
|
||||
* @return <code>true</code> if file has been attached
|
||||
* successfully.
|
||||
*/
|
||||
bool Attach( const char* filename);
|
||||
|
||||
/**
|
||||
* Attach auxilliary data to font e.g font metrics, from memory
|
||||
*
|
||||
* Note: not all font formats implement this function.
|
||||
*
|
||||
* @param pBufferBytes the in-memory buffer
|
||||
* @param bufferSizeInBytes the length of the buffer in bytes
|
||||
* @return <code>true</code> if file has been attached
|
||||
* successfully.
|
||||
*/
|
||||
bool Attach( const unsigned char *pBufferBytes, size_t bufferSizeInBytes);
|
||||
|
||||
/**
|
||||
* Set the character map for the face.
|
||||
*
|
||||
* @param encoding Freetype enumerate for char map code.
|
||||
* @return <code>true</code> if charmap was valid and
|
||||
* set correctly
|
||||
*/
|
||||
bool CharMap( FT_Encoding encoding );
|
||||
|
||||
/**
|
||||
* Get the number of character maps in this face.
|
||||
*
|
||||
* @return character map count.
|
||||
*/
|
||||
unsigned int CharMapCount();
|
||||
|
||||
/**
|
||||
* Get a list of character maps in this face.
|
||||
*
|
||||
* @return pointer to the first encoding.
|
||||
*/
|
||||
FT_Encoding* CharMapList();
|
||||
|
||||
/**
|
||||
* Set the char size for the current face.
|
||||
*
|
||||
* @param size the face size in points (1/72 inch)
|
||||
* @param res the resolution of the target device.
|
||||
* @return <code>true</code> if size was set correctly
|
||||
*/
|
||||
virtual bool FaceSize( const unsigned int size, const unsigned int res = 72);
|
||||
|
||||
/**
|
||||
* Get the current face size in points.
|
||||
*
|
||||
* @return face size
|
||||
*/
|
||||
unsigned int FaceSize() const;
|
||||
|
||||
/**
|
||||
* Set the extrusion distance for the font. Only implemented by
|
||||
* FTGLExtrdFont
|
||||
*
|
||||
* @param d The extrusion distance.
|
||||
*/
|
||||
virtual void Depth( float d){}
|
||||
|
||||
/**
|
||||
* Get the global ascender height for the face.
|
||||
*
|
||||
* @return Ascender height
|
||||
*/
|
||||
float Ascender() const;
|
||||
|
||||
/**
|
||||
* Gets the global descender height for the face.
|
||||
*
|
||||
* @return Descender height
|
||||
*/
|
||||
float Descender() const;
|
||||
|
||||
/**
|
||||
* Get the bounding box for a string.
|
||||
*
|
||||
* @param string a char string
|
||||
* @param llx lower left near x coord
|
||||
* @param lly lower left near y coord
|
||||
* @param llz lower left near z coord
|
||||
* @param urx upper right far x coord
|
||||
* @param ury upper right far y coord
|
||||
* @param urz upper right far z coord
|
||||
*/
|
||||
void BBox( const char* string, float& llx, float& lly, float& llz, float& urx, float& ury, float& urz);
|
||||
|
||||
/**
|
||||
* Get the bounding box for a string.
|
||||
*
|
||||
* @param string a wchar_t string
|
||||
* @param llx lower left near x coord
|
||||
* @param lly lower left near y coord
|
||||
* @param llz lower left near z coord
|
||||
* @param urx upper right far x coord
|
||||
* @param ury upper right far y coord
|
||||
* @param urz upper right far z coord
|
||||
*/
|
||||
void BBox( const wchar_t* string, float& llx, float& lly, float& llz, float& urx, float& ury, float& urz);
|
||||
|
||||
/**
|
||||
* Get the advance width for a string.
|
||||
*
|
||||
* @param string a wchar_t string
|
||||
* @return advance width
|
||||
*/
|
||||
float Advance( const wchar_t* string);
|
||||
|
||||
/**
|
||||
* Get the advance width for a string.
|
||||
*
|
||||
* @param string a char string
|
||||
* @return advance width
|
||||
*/
|
||||
float Advance( const char* string);
|
||||
|
||||
/**
|
||||
* Render a string of characters
|
||||
*
|
||||
* @param string 'C' style string to be output.
|
||||
*/
|
||||
virtual void Render( const char* string );
|
||||
|
||||
/**
|
||||
* Render a string of characters
|
||||
*
|
||||
* @param string wchar_t string to be output.
|
||||
*/
|
||||
virtual void Render( const wchar_t* string );
|
||||
|
||||
/**
|
||||
* Queries the Font for errors.
|
||||
*
|
||||
* @return The current error code.
|
||||
*/
|
||||
FT_Error Error() const { return err;}
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Construct a glyph of the correct type.
|
||||
*
|
||||
* Clients must overide the function and return their specialised
|
||||
* FTGlyph.
|
||||
*
|
||||
* @param g The glyph index NOT the char code.
|
||||
* @return An FT****Glyph or <code>null</code> on failure.
|
||||
*/
|
||||
virtual FTGlyph* MakeGlyph( unsigned int g) = 0;
|
||||
|
||||
/**
|
||||
* Current face object
|
||||
*/
|
||||
FTFace face;
|
||||
|
||||
/**
|
||||
* Current size object
|
||||
*/
|
||||
FTSize charSize;
|
||||
|
||||
/**
|
||||
* Current error code. Zero means no error.
|
||||
*/
|
||||
FT_Error err;
|
||||
|
||||
private:
|
||||
/**
|
||||
* Render a character
|
||||
* This function does an implicit conversion on it's arguments.
|
||||
*
|
||||
* @param chr current character
|
||||
* @param nextChr next character
|
||||
*/
|
||||
inline void DoRender( const unsigned int chr, const unsigned int nextChr);
|
||||
|
||||
/**
|
||||
* Check that the glyph at <code>chr</code> exist. If not load it.
|
||||
*
|
||||
* @param chr character index
|
||||
*/
|
||||
inline void CheckGlyph( const unsigned int chr);
|
||||
|
||||
/**
|
||||
* An object that holds a list of glyphs
|
||||
*/
|
||||
FTGlyphContainer* glyphList;
|
||||
|
||||
/**
|
||||
* Current pen or cursor position;
|
||||
*/
|
||||
FTPoint pen;
|
||||
};
|
||||
|
||||
|
||||
#endif // __FTFont__
|
||||
|
||||
100
extern/bFTGL/include/FTGL.h
vendored
100
extern/bFTGL/include/FTGL.h
vendored
@@ -1,100 +0,0 @@
|
||||
#ifndef __FTGL__
|
||||
#define __FTGL__
|
||||
|
||||
|
||||
typedef double FTGL_DOUBLE;
|
||||
typedef float FTGL_FLOAT;
|
||||
|
||||
// Fixes for deprecated identifiers in 2.1.5
|
||||
#ifndef FT_OPEN_MEMORY
|
||||
#define FT_OPEN_MEMORY (FT_Open_Flags)1
|
||||
#endif
|
||||
|
||||
#ifndef FT_RENDER_MODE_MONO
|
||||
#define FT_RENDER_MODE_MONO ft_render_mode_mono
|
||||
#endif
|
||||
|
||||
#ifndef FT_RENDER_MODE_NORMAL
|
||||
#define FT_RENDER_MODE_NORMAL ft_render_mode_normal
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef WIN32
|
||||
|
||||
// Under windows avoid including <windows.h> is overrated.
|
||||
// Sure, it can be avoided and "name space pollution" can be
|
||||
// avoided, but why? It really doesn't make that much difference
|
||||
// these days.
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
|
||||
#ifndef __gl_h_
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glu.h>
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
// Non windows platforms - don't require nonsense as seen above :-)
|
||||
#ifndef __gl_h_
|
||||
#ifdef __APPLE_CC__
|
||||
#include <OpenGL/gl.h>
|
||||
#include <OpenGL/glu.h>
|
||||
#else
|
||||
#include <GL/gl.h>
|
||||
#if defined (__sun__) && !defined (__sparc__)
|
||||
#include <mesa/glu.h>
|
||||
#else
|
||||
#include <GL/glu.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// Required for compatibility with glext.h style function definitions of
|
||||
// OpenGL extensions, such as in src/osg/Point.cpp.
|
||||
#ifndef APIENTRY
|
||||
#define APIENTRY
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Compiler-specific conditional compilation
|
||||
#ifdef _MSC_VER // MS Visual C++
|
||||
|
||||
// Disable various warning.
|
||||
// 4786: template name too long
|
||||
#pragma warning( disable : 4251 )
|
||||
#pragma warning( disable : 4275 )
|
||||
#pragma warning( disable : 4786 )
|
||||
|
||||
// The following definitions control how symbols are exported.
|
||||
// If the target is a static library ensure that FTGL_LIBRARY_STATIC
|
||||
// is defined. If building a dynamic library (ie DLL) ensure the
|
||||
// FTGL_LIBRARY macro is defined, as it will mark symbols for
|
||||
// export. If compiling a project to _use_ the _dynamic_ library
|
||||
// version of the library, no definition is required.
|
||||
#ifdef FTGL_LIBRARY_STATIC // static lib - no special export required
|
||||
# define FTGL_EXPORT
|
||||
#elif FTGL_LIBRARY // dynamic lib - must export/import symbols appropriately.
|
||||
# define FTGL_EXPORT __declspec(dllexport)
|
||||
#else
|
||||
# define FTGL_EXPORT __declspec(dllimport)
|
||||
#endif
|
||||
|
||||
#else
|
||||
// Compiler that is not MS Visual C++.
|
||||
// Ensure that the export symbol is defined (and blank)
|
||||
#define FTGL_EXPORT
|
||||
#endif
|
||||
|
||||
|
||||
// lifted from glext.h, to remove dependancy on glext.h
|
||||
#ifndef GL_EXT_texture_object
|
||||
#define GL_TEXTURE_PRIORITY_EXT 0x8066
|
||||
#define GL_TEXTURE_RESIDENT_EXT 0x8067
|
||||
#define GL_TEXTURE_1D_BINDING_EXT 0x8068
|
||||
#define GL_TEXTURE_2D_BINDING_EXT 0x8069
|
||||
#define GL_TEXTURE_3D_BINDING_EXT 0x806A
|
||||
#endif
|
||||
|
||||
#endif // __FTGL__
|
||||
65
extern/bFTGL/include/FTGLBitmapFont.h
vendored
65
extern/bFTGL/include/FTGLBitmapFont.h
vendored
@@ -1,65 +0,0 @@
|
||||
#ifndef __FTGLBitmapFont__
|
||||
#define __FTGLBitmapFont__
|
||||
|
||||
#include "FTFont.h"
|
||||
#include "FTGL.h"
|
||||
|
||||
|
||||
class FTGlyph;
|
||||
|
||||
/**
|
||||
* FTGLBitmapFont is a specialisation of the FTFont class for handling
|
||||
* Bitmap fonts
|
||||
*
|
||||
* @see FTFont
|
||||
*/
|
||||
class FTGL_EXPORT FTGLBitmapFont : public FTFont
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Open and read a font file. Sets Error flag.
|
||||
*
|
||||
* @param fontname font file name.
|
||||
*/
|
||||
FTGLBitmapFont( const char* fontname);
|
||||
|
||||
/**
|
||||
* Open and read a font from a buffer in memory. Sets Error flag.
|
||||
*
|
||||
* @param pBufferBytes the in-memory buffer
|
||||
* @param bufferSizeInBytes the length of the buffer in bytes
|
||||
*/
|
||||
FTGLBitmapFont( const unsigned char *pBufferBytes, size_t bufferSizeInBytes);
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
~FTGLBitmapFont();
|
||||
|
||||
/**
|
||||
* Renders a string of characters
|
||||
*
|
||||
* @param string 'C' style string to be output.
|
||||
*/
|
||||
void Render( const char* string);
|
||||
|
||||
/**
|
||||
* Renders a string of characters
|
||||
*
|
||||
* @param string 'C' style wide string to be output.
|
||||
*/
|
||||
void Render( const wchar_t* string);
|
||||
|
||||
// attributes
|
||||
|
||||
private:
|
||||
/**
|
||||
* Construct a FTBitmapGlyph.
|
||||
*
|
||||
* @param g The glyph index NOT the char code.
|
||||
* @return An FTBitmapGlyph or <code>null</code> on failure.
|
||||
*/
|
||||
inline virtual FTGlyph* MakeGlyph( unsigned int g);
|
||||
|
||||
};
|
||||
#endif // __FTGLBitmapFont__
|
||||
76
extern/bFTGL/include/FTGLBufferFont.h
vendored
76
extern/bFTGL/include/FTGLBufferFont.h
vendored
@@ -1,76 +0,0 @@
|
||||
#ifndef __FTGLBufferFont__
|
||||
#define __FTGLBufferFont__
|
||||
|
||||
|
||||
#include "FTFont.h"
|
||||
#include "FTGL.h"
|
||||
|
||||
|
||||
class FTGlyph;
|
||||
|
||||
|
||||
/**
|
||||
* FTGLBufferFont is a specialisation of the FTFont class for handling
|
||||
* Pixmap (Grey Scale) fonts
|
||||
*
|
||||
* @see FTFont
|
||||
*/
|
||||
class FTGL_EXPORT FTGLBufferFont : public FTFont
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Open and read a font file. Sets Error flag.
|
||||
*
|
||||
* @param fontname font file name.
|
||||
*/
|
||||
FTGLBufferFont( const char* fontname);
|
||||
|
||||
/**
|
||||
* Open and read a font from a buffer in memory. Sets Error flag.
|
||||
*
|
||||
* @param pBufferBytes the in-memory buffer
|
||||
* @param bufferSizeInBytes the length of the buffer in bytes
|
||||
*/
|
||||
FTGLBufferFont( const unsigned char *pBufferBytes, size_t bufferSizeInBytes);
|
||||
|
||||
|
||||
void SetClientBuffer( unsigned char* b)
|
||||
{
|
||||
buffer = b;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
~FTGLBufferFont();
|
||||
|
||||
/**
|
||||
* Renders a string of characters
|
||||
*
|
||||
* @param string 'C' style string to be output.
|
||||
*/
|
||||
void Render( const char* string);
|
||||
|
||||
/**
|
||||
* Renders a string of characters
|
||||
*
|
||||
* @param string wchar_t string to be output.
|
||||
*/
|
||||
void Render( const wchar_t* string);
|
||||
|
||||
private:
|
||||
/**
|
||||
* Construct a FTBufferGlyph.
|
||||
*
|
||||
* @param g The glyph index NOT the char code.
|
||||
* @return An FTBufferGlyph or <code>null</code> on failure.
|
||||
*/
|
||||
inline virtual FTGlyph* MakeGlyph( unsigned int g);
|
||||
|
||||
unsigned char* buffer;
|
||||
};
|
||||
|
||||
|
||||
#endif // __FTGLBufferFont__
|
||||
|
||||
55
extern/bFTGL/include/FTGLExtrdFont.h
vendored
55
extern/bFTGL/include/FTGLExtrdFont.h
vendored
@@ -1,55 +0,0 @@
|
||||
#ifndef __FTGLExtrdFont__
|
||||
#define __FTGLExtrdFont__
|
||||
|
||||
#include "FTFont.h"
|
||||
#include "FTGL.h"
|
||||
|
||||
class FTGlyph;
|
||||
|
||||
/**
|
||||
* FTGLExtrdFont is a specialisation of the FTFont class for handling
|
||||
* extruded Polygon fonts
|
||||
*
|
||||
* @see FTFont
|
||||
* @see FTGLPolygonFont
|
||||
*/
|
||||
class FTGL_EXPORT FTGLExtrdFont : public FTFont
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Open and read a font file. Sets Error flag.
|
||||
*
|
||||
* @param fontname font file name.
|
||||
*/
|
||||
FTGLExtrdFont( const char* fontname);
|
||||
|
||||
/**
|
||||
* Open and read a font from a buffer in memory. Sets Error flag.
|
||||
*
|
||||
* @param pBufferBytes the in-memory buffer
|
||||
* @param bufferSizeInBytes the length of the buffer in bytes
|
||||
*/
|
||||
FTGLExtrdFont( const unsigned char *pBufferBytes, size_t bufferSizeInBytes);
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
~FTGLExtrdFont();
|
||||
|
||||
void Depth( float d) { depth = d;}
|
||||
|
||||
private:
|
||||
/**
|
||||
* Construct a FTPolyGlyph.
|
||||
*
|
||||
* @param glyphIndex The glyph index NOT the char code.
|
||||
* @return An FTExtrdGlyph or <code>null</code> on failure.
|
||||
*/
|
||||
inline virtual FTGlyph* MakeGlyph( unsigned int glyphIndex);
|
||||
|
||||
float depth;
|
||||
};
|
||||
|
||||
|
||||
#endif // __FTGLExtrdFont__
|
||||
|
||||
64
extern/bFTGL/include/FTGLOutlineFont.h
vendored
64
extern/bFTGL/include/FTGLOutlineFont.h
vendored
@@ -1,64 +0,0 @@
|
||||
#ifndef __FTGLOutlineFont__
|
||||
#define __FTGLOutlineFont__
|
||||
|
||||
|
||||
#include "FTFont.h"
|
||||
#include "FTGL.h"
|
||||
|
||||
class FTGlyph;
|
||||
|
||||
|
||||
/**
|
||||
* FTGLOutlineFont is a specialisation of the FTFont class for handling
|
||||
* Vector Outline fonts
|
||||
*
|
||||
* @see FTFont
|
||||
*/
|
||||
class FTGL_EXPORT FTGLOutlineFont : public FTFont
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Open and read a font file. Sets Error flag.
|
||||
*
|
||||
* @param fontname font file name.
|
||||
*/
|
||||
FTGLOutlineFont( const char* fontname);
|
||||
|
||||
/**
|
||||
* Open and read a font from a buffer in memory. Sets Error flag.
|
||||
*
|
||||
* @param pBufferBytes the in-memory buffer
|
||||
* @param bufferSizeInBytes the length of the buffer in bytes
|
||||
*/
|
||||
FTGLOutlineFont( const unsigned char *pBufferBytes, size_t bufferSizeInBytes);
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
~FTGLOutlineFont();
|
||||
|
||||
/**
|
||||
* Renders a string of characters
|
||||
*
|
||||
* @param string 'C' style string to be output.
|
||||
*/
|
||||
void Render( const char* string);
|
||||
|
||||
/**
|
||||
* Renders a string of characters
|
||||
*
|
||||
* @param string wchar_t string to be output.
|
||||
*/
|
||||
void Render( const wchar_t* string);
|
||||
|
||||
private:
|
||||
/**
|
||||
* Construct a FTOutlineGlyph.
|
||||
*
|
||||
* @param g The glyph index NOT the char code.
|
||||
* @return An FTOutlineGlyph or <code>null</code> on failure.
|
||||
*/
|
||||
inline virtual FTGlyph* MakeGlyph( unsigned int g);
|
||||
|
||||
};
|
||||
#endif // __FTGLOutlineFont__
|
||||
68
extern/bFTGL/include/FTGLPixmapFont.h
vendored
68
extern/bFTGL/include/FTGLPixmapFont.h
vendored
@@ -1,68 +0,0 @@
|
||||
#ifndef __FTGLPixmapFont__
|
||||
#define __FTGLPixmapFont__
|
||||
|
||||
|
||||
#include "FTFont.h"
|
||||
#include "FTGL.h"
|
||||
|
||||
|
||||
class FTGlyph;
|
||||
|
||||
|
||||
/**
|
||||
* FTGLPixmapFont is a specialisation of the FTFont class for handling
|
||||
* Pixmap (Grey Scale) fonts
|
||||
*
|
||||
* @see FTFont
|
||||
*/
|
||||
class FTGL_EXPORT FTGLPixmapFont : public FTFont
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Open and read a font file. Sets Error flag.
|
||||
*
|
||||
* @param fontname font file name.
|
||||
*/
|
||||
FTGLPixmapFont( const char* fontname);
|
||||
|
||||
/**
|
||||
* Open and read a font from a buffer in memory. Sets Error flag.
|
||||
*
|
||||
* @param pBufferBytes the in-memory buffer
|
||||
* @param bufferSizeInBytes the length of the buffer in bytes
|
||||
*/
|
||||
FTGLPixmapFont( const unsigned char *pBufferBytes, size_t bufferSizeInBytes);
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
~FTGLPixmapFont();
|
||||
|
||||
/**
|
||||
* Renders a string of characters
|
||||
*
|
||||
* @param string 'C' style string to be output.
|
||||
*/
|
||||
void Render( const char* string);
|
||||
|
||||
/**
|
||||
* Renders a string of characters
|
||||
*
|
||||
* @param string wchar_t string to be output.
|
||||
*/
|
||||
void Render( const wchar_t* string);
|
||||
|
||||
private:
|
||||
/**
|
||||
* Construct a FTPixmapGlyph.
|
||||
*
|
||||
* @param g The glyph index NOT the char code.
|
||||
* @return An FTPixmapGlyph or <code>null</code> on failure.
|
||||
*/
|
||||
inline virtual FTGlyph* MakeGlyph( unsigned int g);
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif // __FTGLPixmapFont__
|
||||
|
||||
53
extern/bFTGL/include/FTGLPolygonFont.h
vendored
53
extern/bFTGL/include/FTGLPolygonFont.h
vendored
@@ -1,53 +0,0 @@
|
||||
#ifndef __FTGLPolygonFont__
|
||||
#define __FTGLPolygonFont__
|
||||
|
||||
|
||||
#include "FTFont.h"
|
||||
#include "FTGL.h"
|
||||
|
||||
class FTGlyph;
|
||||
|
||||
|
||||
/**
|
||||
* FTGLPolygonFont is a specialisation of the FTFont class for handling
|
||||
* tesselated Polygon Mesh fonts
|
||||
*
|
||||
* @see FTFont
|
||||
*/
|
||||
class FTGL_EXPORT FTGLPolygonFont : public FTFont
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Open and read a font file. Sets Error flag.
|
||||
*
|
||||
* @param fontname font file name.
|
||||
*/
|
||||
FTGLPolygonFont( const char* fontname);
|
||||
|
||||
/**
|
||||
* Open and read a font from a buffer in memory. Sets Error flag.
|
||||
*
|
||||
* @param pBufferBytes the in-memory buffer
|
||||
* @param bufferSizeInBytes the length of the buffer in bytes
|
||||
*/
|
||||
FTGLPolygonFont( const unsigned char *pBufferBytes, size_t bufferSizeInBytes);
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
~FTGLPolygonFont();
|
||||
|
||||
private:
|
||||
/**
|
||||
* Construct a FTPolyGlyph.
|
||||
*
|
||||
* @param g The glyph index NOT the char code.
|
||||
* @return An FTPolyGlyph or <code>null</code> on failure.
|
||||
*/
|
||||
inline virtual FTGlyph* MakeGlyph( unsigned int g);
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif // __FTGLPolygonFont__
|
||||
|
||||
151
extern/bFTGL/include/FTGLTextureFont.h
vendored
151
extern/bFTGL/include/FTGLTextureFont.h
vendored
@@ -1,151 +0,0 @@
|
||||
#ifndef __FTGLTextureFont__
|
||||
#define __FTGLTextureFont__
|
||||
|
||||
#include "FTFont.h"
|
||||
#include "FTVector.h"
|
||||
#include "FTGL.h"
|
||||
|
||||
class FTTextureGlyph;
|
||||
|
||||
|
||||
/**
|
||||
* FTGLTextureFont is a specialisation of the FTFont class for handling
|
||||
* Texture mapped fonts
|
||||
*
|
||||
* @see FTFont
|
||||
*/
|
||||
class FTGL_EXPORT FTGLTextureFont : public FTFont
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Open and read a font file. Sets Error flag.
|
||||
*
|
||||
* @param fontname font file name.
|
||||
*/
|
||||
FTGLTextureFont( const char* fontname);
|
||||
|
||||
/**
|
||||
* Open and read a font from a buffer in memory. Sets Error flag.
|
||||
*
|
||||
* @param pBufferBytes the in-memory buffer
|
||||
* @param bufferSizeInBytes the length of the buffer in bytes
|
||||
*/
|
||||
FTGLTextureFont( const unsigned char *pBufferBytes, size_t bufferSizeInBytes);
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
virtual ~FTGLTextureFont();
|
||||
|
||||
/**
|
||||
* Set the char size for the current face.
|
||||
*
|
||||
* @param size the face size in points (1/72 inch)
|
||||
* @param res the resolution of the target device.
|
||||
* @return <code>true</code> if size was set correctly
|
||||
*/
|
||||
virtual bool FaceSize( const unsigned int size, const unsigned int res = 72);
|
||||
|
||||
/**
|
||||
* Renders a string of characters
|
||||
*
|
||||
* @param string 'C' style string to be output.
|
||||
*/
|
||||
virtual void Render( const char* string);
|
||||
|
||||
/**
|
||||
* Renders a string of characters
|
||||
*
|
||||
* @param string wchar_t string to be output.
|
||||
*/
|
||||
virtual void Render( const wchar_t* string);
|
||||
|
||||
|
||||
private:
|
||||
/**
|
||||
* Construct a FTTextureGlyph.
|
||||
*
|
||||
* @param glyphIndex The glyph index NOT the char code.
|
||||
* @return An FTTextureGlyph or <code>null</code> on failure.
|
||||
*/
|
||||
inline virtual FTGlyph* MakeGlyph( unsigned int glyphIndex);
|
||||
|
||||
/**
|
||||
* Get the size of a block of memory required to layout the glyphs
|
||||
*
|
||||
* Calculates a width and height based on the glyph sizes and the
|
||||
* number of glyphs. It over estimates.
|
||||
*/
|
||||
inline void CalculateTextureSize();
|
||||
|
||||
/**
|
||||
* Creates a 'blank' OpenGL texture object.
|
||||
*
|
||||
* The format is GL_ALPHA and the params are
|
||||
* GL_TEXTURE_WRAP_S = GL_CLAMP
|
||||
* GL_TEXTURE_WRAP_T = GL_CLAMP
|
||||
* GL_TEXTURE_MAG_FILTER = GL_LINEAR
|
||||
* GL_TEXTURE_MIN_FILTER = GL_LINEAR
|
||||
* Note that mipmapping is NOT used
|
||||
*/
|
||||
inline GLuint CreateTexture();
|
||||
|
||||
/**
|
||||
* The maximum texture dimension on this OpenGL implemetation
|
||||
*/
|
||||
GLsizei maxTextSize;
|
||||
|
||||
/**
|
||||
* The minimum texture width required to hold the glyphs
|
||||
*/
|
||||
GLsizei textureWidth;
|
||||
|
||||
/**
|
||||
* The minimum texture height required to hold the glyphs
|
||||
*/
|
||||
GLsizei textureHeight;
|
||||
|
||||
/**
|
||||
*An array of texture ids
|
||||
*/
|
||||
FTVector<GLuint> textureIDList;
|
||||
|
||||
/**
|
||||
* The max height for glyphs in the current font
|
||||
*/
|
||||
int glyphHeight;
|
||||
|
||||
/**
|
||||
* The max width for glyphs in the current font
|
||||
*/
|
||||
int glyphWidth;
|
||||
|
||||
/**
|
||||
* A value to be added to the height and width to ensure that
|
||||
* glyphs don't overlap in the texture
|
||||
*/
|
||||
unsigned int padding;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
unsigned int numGlyphs;
|
||||
|
||||
/**
|
||||
*/
|
||||
unsigned int remGlyphs;
|
||||
|
||||
/**
|
||||
*/
|
||||
int xOffset;
|
||||
|
||||
/**
|
||||
*/
|
||||
int yOffset;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif // __FTGLTextureFont__
|
||||
|
||||
|
||||
89
extern/bFTGL/include/FTGlyph.h
vendored
89
extern/bFTGL/include/FTGlyph.h
vendored
@@ -1,89 +0,0 @@
|
||||
#ifndef __FTGlyph__
|
||||
#define __FTGlyph__
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
#include FT_GLYPH_H
|
||||
|
||||
#include "FTBBox.h"
|
||||
#include "FTPoint.h"
|
||||
#include "FTGL.h"
|
||||
|
||||
|
||||
/**
|
||||
* FTGlyph is the base class for FTGL glyphs.
|
||||
*
|
||||
* It provides the interface between Freetype glyphs and their openGL
|
||||
* renderable counterparts. This is an abstract class and derived classes
|
||||
* must implement the <code>render</code> function.
|
||||
*
|
||||
* @see FTGlyphContainer
|
||||
* @see FTBBox
|
||||
* @see FTPoint
|
||||
*
|
||||
*/
|
||||
class FTGL_EXPORT FTGlyph
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
FTGlyph( FT_GlyphSlot glyph);
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
virtual ~FTGlyph();
|
||||
|
||||
/**
|
||||
* Renders this glyph at the current pen position.
|
||||
*
|
||||
* @param pen The current pen position.
|
||||
* @return The advance distance for this glyph.
|
||||
*/
|
||||
virtual float Render( const FTPoint& pen) = 0;
|
||||
|
||||
/**
|
||||
* Return the advance width for this glyph.
|
||||
*
|
||||
* @return advance width.
|
||||
*/
|
||||
float Advance() const { return advance;}
|
||||
|
||||
/**
|
||||
* Return the bounding box for this glyph.
|
||||
*
|
||||
* @return bounding box.
|
||||
*/
|
||||
const FTBBox& BBox() const { return bBox;}
|
||||
|
||||
/**
|
||||
* Queries for errors.
|
||||
*
|
||||
* @return The current error code.
|
||||
*/
|
||||
FT_Error Error() const { return err;}
|
||||
|
||||
protected:
|
||||
/**
|
||||
* The advance distance for this glyph
|
||||
*/
|
||||
float advance;
|
||||
|
||||
/**
|
||||
* The bounding box of this glyph.
|
||||
*/
|
||||
FTBBox bBox;
|
||||
|
||||
/**
|
||||
* Current error code. Zero means no error.
|
||||
*/
|
||||
FT_Error err;
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif // __FTGlyph__
|
||||
|
||||
127
extern/bFTGL/include/FTGlyphContainer.h
vendored
127
extern/bFTGL/include/FTGlyphContainer.h
vendored
@@ -1,127 +0,0 @@
|
||||
#ifndef __FTGlyphContainer__
|
||||
#define __FTGlyphContainer__
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
#include FT_GLYPH_H
|
||||
|
||||
#include "FTGL.h"
|
||||
#include "FTBBox.h"
|
||||
#include "FTPoint.h"
|
||||
#include "FTVector.h"
|
||||
|
||||
class FTFace;
|
||||
class FTGlyph;
|
||||
class FTCharmap;
|
||||
|
||||
/**
|
||||
* FTGlyphContainer holds the post processed FTGlyph objects.
|
||||
*
|
||||
* @see FTGlyph
|
||||
*/
|
||||
class FTGL_EXPORT FTGlyphContainer
|
||||
{
|
||||
typedef FTVector<FTGlyph*> GlyphVector;
|
||||
public:
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param face The Freetype face
|
||||
*/
|
||||
FTGlyphContainer( FTFace* face);
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
~FTGlyphContainer();
|
||||
|
||||
/**
|
||||
* Sets the character map for the face.
|
||||
*
|
||||
* @param encoding the Freetype encoding symbol. See above.
|
||||
* @return <code>true</code> if charmap was valid
|
||||
* and set correctly
|
||||
*/
|
||||
bool CharMap( FT_Encoding encoding);
|
||||
|
||||
/**
|
||||
* Get the font index of the input character.
|
||||
*
|
||||
* @param characterCode The character code of the requested glyph in the
|
||||
* current encoding eg apple roman.
|
||||
* @return The font index for the character.
|
||||
*/
|
||||
unsigned int FontIndex( const unsigned int characterCode ) const;
|
||||
|
||||
/**
|
||||
* Adds a glyph to this glyph list.
|
||||
*
|
||||
* @param glyph The FTGlyph to be inserted into the container
|
||||
* @param characterCode The char code of the glyph NOT the glyph index.
|
||||
*/
|
||||
void Add( FTGlyph* glyph, const unsigned int characterCode);
|
||||
|
||||
/**
|
||||
* Get a glyph from the glyph list
|
||||
*
|
||||
* @param characterCode The char code of the glyph NOT the glyph index
|
||||
* @return An FTGlyph or <code>null</code> is it hasn't been
|
||||
* loaded.
|
||||
*/
|
||||
const FTGlyph* const Glyph( const unsigned int characterCode) const;
|
||||
|
||||
/**
|
||||
* Get the bounding box for a character.
|
||||
* @param characterCode The char code of the glyph NOT the glyph index
|
||||
*/
|
||||
FTBBox BBox( const unsigned int characterCode) const;
|
||||
|
||||
/**
|
||||
* Returns the kerned advance width for a glyph.
|
||||
*
|
||||
* @param characterCode glyph index of the character
|
||||
* @param nextCharacterCode the next glyph in a string
|
||||
* @return advance width
|
||||
*/
|
||||
float Advance( const unsigned int characterCode, const unsigned int nextCharacterCode);
|
||||
|
||||
/**
|
||||
* Renders a character
|
||||
* @param characterCode the glyph to be Rendered
|
||||
* @param nextCharacterCode the next glyph in the string. Used for kerning.
|
||||
* @param penPosition the position to Render the glyph
|
||||
* @return The distance to advance the pen position after Rendering
|
||||
*/
|
||||
FTPoint Render( const unsigned int characterCode, const unsigned int nextCharacterCode, FTPoint penPosition);
|
||||
|
||||
/**
|
||||
* Queries the Font for errors.
|
||||
*
|
||||
* @return The current error code.
|
||||
*/
|
||||
FT_Error Error() const { return err;}
|
||||
|
||||
private:
|
||||
/**
|
||||
* The FTGL face
|
||||
*/
|
||||
FTFace* face;
|
||||
|
||||
/**
|
||||
* The Character Map object associated with the current face
|
||||
*/
|
||||
FTCharmap* charMap;
|
||||
|
||||
/**
|
||||
* A structure to hold the glyphs
|
||||
*/
|
||||
GlyphVector glyphs;
|
||||
|
||||
/**
|
||||
* Current error code. Zero means no error.
|
||||
*/
|
||||
FT_Error err;
|
||||
};
|
||||
|
||||
|
||||
#endif // __FTGlyphContainer__
|
||||
97
extern/bFTGL/include/FTLibrary.h
vendored
97
extern/bFTGL/include/FTLibrary.h
vendored
@@ -1,97 +0,0 @@
|
||||
#ifndef __FTLibrary__
|
||||
#define __FTLibrary__
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
//#include FT_CACHE_H
|
||||
|
||||
#include "FTGL.h"
|
||||
|
||||
|
||||
/**
|
||||
* FTLibrary class is the global accessor for the Freetype library.
|
||||
*
|
||||
* This class encapsulates the Freetype Library. This is a singleton class
|
||||
* and ensures that only one FT_Library is in existence at any one time.
|
||||
* All constructors are private therefore clients cannot create or
|
||||
* instantiate this class themselves and must access it's methods via the
|
||||
* static <code>FTLibrary::Instance()</code> function.
|
||||
*
|
||||
* Just because this class returns a valid <code>FTLibrary</code> object
|
||||
* doesn't mean that the Freetype Library has been successfully initialised.
|
||||
* Clients should check for errors. You can initialse the library AND check
|
||||
* for errors using the following code...
|
||||
* <code>err = FTLibrary::Instance().Error();</code>
|
||||
*
|
||||
* @see "Freetype 2 Documentation"
|
||||
*
|
||||
*/
|
||||
class FTGL_EXPORT FTLibrary
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Global acces point to the single FTLibrary object.
|
||||
*
|
||||
* @return The global <code>FTLibrary</code> object.
|
||||
*/
|
||||
static FTLibrary& Instance();
|
||||
|
||||
/**
|
||||
* Gets a pointer to the native Freetype library.
|
||||
*
|
||||
* @return A handle to a FreeType library instance.
|
||||
*/
|
||||
const FT_Library* const GetLibrary() const { return library;}
|
||||
|
||||
/**
|
||||
* Queries the library for errors.
|
||||
*
|
||||
* @return The current error code.
|
||||
*/
|
||||
FT_Error Error() const { return err;}
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*
|
||||
* Disposes of the Freetype library
|
||||
*/
|
||||
~FTLibrary();
|
||||
|
||||
private:
|
||||
/**
|
||||
* Default constructors.
|
||||
*
|
||||
* Made private to stop clients creating there own FTLibrary
|
||||
* objects.
|
||||
*/
|
||||
FTLibrary();
|
||||
FTLibrary( const FT_Library&){}
|
||||
FTLibrary& operator=( const FT_Library&) { return *this; }
|
||||
|
||||
/**
|
||||
* Initialises the Freetype library
|
||||
*
|
||||
* Even though this function indicates success via the return value,
|
||||
* clients can't see this so must check the error codes. This function
|
||||
* is only ever called by the default c_stor
|
||||
*
|
||||
* @return <code>true</code> if the Freetype library was
|
||||
* successfully initialised, <code>false</code>
|
||||
* otherwise.
|
||||
*/
|
||||
bool Initialise();
|
||||
|
||||
/**
|
||||
* Freetype library handle.
|
||||
*/
|
||||
FT_Library* library;
|
||||
// FTC_Manager* manager;
|
||||
|
||||
/**
|
||||
* Current error code. Zero means no error.
|
||||
*/
|
||||
FT_Error err;
|
||||
|
||||
};
|
||||
|
||||
#endif // __FTLibrary__
|
||||
112
extern/bFTGL/include/FTList.h
vendored
112
extern/bFTGL/include/FTList.h
vendored
@@ -1,112 +0,0 @@
|
||||
#ifndef __FTList__
|
||||
#define __FTList__
|
||||
|
||||
#include "FTGL.h"
|
||||
|
||||
/**
|
||||
* Provides a non-STL alternative to the STL list
|
||||
*/
|
||||
template <typename FT_LIST_ITEM_TYPE>
|
||||
class FTGL_EXPORT FTList
|
||||
{
|
||||
public:
|
||||
typedef FT_LIST_ITEM_TYPE value_type;
|
||||
typedef value_type& reference;
|
||||
typedef const value_type& const_reference;
|
||||
typedef size_t size_type;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
FTList()
|
||||
: listSize(0),
|
||||
tail(0)
|
||||
{
|
||||
tail = NULL;
|
||||
head = new Node;
|
||||
}
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
~FTList()
|
||||
{
|
||||
Node* next;
|
||||
|
||||
for( Node *walk = head; walk; walk = next)
|
||||
{
|
||||
next = walk->next;
|
||||
delete walk;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the number of items in the list
|
||||
*/
|
||||
size_type size() const
|
||||
{
|
||||
return listSize;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an item to the end of the list
|
||||
*/
|
||||
void push_back( const value_type& item)
|
||||
{
|
||||
Node* node = new Node( item);
|
||||
|
||||
if( head->next == NULL)
|
||||
{
|
||||
head->next = node;
|
||||
}
|
||||
|
||||
if( tail)
|
||||
{
|
||||
tail->next = node;
|
||||
}
|
||||
tail = node;
|
||||
++listSize;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the item at the front of the list
|
||||
*/
|
||||
reference front() const
|
||||
{
|
||||
return head->next->payload;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the item at the end of the list
|
||||
*/
|
||||
reference back() const
|
||||
{
|
||||
return tail->payload;
|
||||
}
|
||||
|
||||
private:
|
||||
struct Node
|
||||
{
|
||||
Node()
|
||||
: next(NULL)
|
||||
{}
|
||||
|
||||
Node( const value_type& item)
|
||||
: next(NULL)
|
||||
{
|
||||
payload = item;
|
||||
}
|
||||
|
||||
Node* next;
|
||||
|
||||
value_type payload;
|
||||
};
|
||||
|
||||
size_type listSize;
|
||||
|
||||
Node* head;
|
||||
Node* tail;
|
||||
};
|
||||
|
||||
#endif // __FTList__
|
||||
|
||||
54
extern/bFTGL/include/FTOutlineGlyph.h
vendored
54
extern/bFTGL/include/FTOutlineGlyph.h
vendored
@@ -1,54 +0,0 @@
|
||||
#ifndef __FTOutlineGlyph__
|
||||
#define __FTOutlineGlyph__
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
#include FT_GLYPH_H
|
||||
|
||||
#include "FTGL.h"
|
||||
#include "FTGlyph.h"
|
||||
|
||||
class FTVectoriser;
|
||||
|
||||
|
||||
/**
|
||||
* FTOutlineGlyph is a specialisation of FTGlyph for creating outlines.
|
||||
*
|
||||
* @see FTGlyphContainer
|
||||
* @see FTVectoriser
|
||||
*
|
||||
*/
|
||||
class FTGL_EXPORT FTOutlineGlyph : public FTGlyph
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Constructor. Sets the Error to Invalid_Outline if the glyphs isn't an outline.
|
||||
*
|
||||
* @param glyph The Freetype glyph to be processed
|
||||
*/
|
||||
FTOutlineGlyph( FT_GlyphSlot glyph);
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
virtual ~FTOutlineGlyph();
|
||||
|
||||
/**
|
||||
* Renders this glyph at the current pen position.
|
||||
*
|
||||
* @param pen The current pen position.
|
||||
* @return The advance distance for this glyph.
|
||||
*/
|
||||
virtual float Render( const FTPoint& pen);
|
||||
|
||||
private:
|
||||
/**
|
||||
* OpenGL display list
|
||||
*/
|
||||
GLuint glList;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif // __FTOutlineGlyph__
|
||||
|
||||
68
extern/bFTGL/include/FTPixmapGlyph.h
vendored
68
extern/bFTGL/include/FTPixmapGlyph.h
vendored
@@ -1,68 +0,0 @@
|
||||
#ifndef __FTPixmapGlyph__
|
||||
#define __FTPixmapGlyph__
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
#include FT_GLYPH_H
|
||||
|
||||
#include "FTGL.h"
|
||||
#include "FTGlyph.h"
|
||||
|
||||
|
||||
/**
|
||||
* FTPixmapGlyph is a specialisation of FTGlyph for creating pixmaps.
|
||||
*
|
||||
* @see FTGlyphContainer
|
||||
*
|
||||
*/
|
||||
class FTGL_EXPORT FTPixmapGlyph : public FTGlyph
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param glyph The Freetype glyph to be processed
|
||||
*/
|
||||
FTPixmapGlyph( FT_GlyphSlot glyph);
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
virtual ~FTPixmapGlyph();
|
||||
|
||||
/**
|
||||
* Renders this glyph at the current pen position.
|
||||
*
|
||||
* @param pen The current pen position.
|
||||
* @return The advance distance for this glyph.
|
||||
*/
|
||||
virtual float Render( const FTPoint& pen);
|
||||
|
||||
// attributes
|
||||
|
||||
private:
|
||||
/**
|
||||
* The width of the glyph 'image'
|
||||
*/
|
||||
int destWidth;
|
||||
|
||||
/**
|
||||
* The height of the glyph 'image'
|
||||
*/
|
||||
int destHeight;
|
||||
|
||||
/**
|
||||
* Vector from the pen position to the topleft corner of the pixmap
|
||||
*/
|
||||
FTPoint pos;
|
||||
|
||||
/**
|
||||
* Pointer to the 'image' data
|
||||
*/
|
||||
unsigned char* data;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif // __FTPixmapGlyph__
|
||||
85
extern/bFTGL/include/FTPoint.h
vendored
85
extern/bFTGL/include/FTPoint.h
vendored
@@ -1,85 +0,0 @@
|
||||
#ifndef __FTPoint__
|
||||
#define __FTPoint__
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
#include FT_GLYPH_H
|
||||
|
||||
#include "FTGL.h"
|
||||
|
||||
/**
|
||||
* FTPoint class is a basic 3 dimensional point or vector.
|
||||
*/
|
||||
class FTGL_EXPORT FTPoint
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Default constructor. Point is set to zero.
|
||||
*/
|
||||
FTPoint()
|
||||
: x(0), y(0), z(0)
|
||||
{}
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param X
|
||||
* @param Y
|
||||
* @param Z
|
||||
*/
|
||||
FTPoint( const FTGL_DOUBLE X, const FTGL_DOUBLE Y, const FTGL_DOUBLE Z)
|
||||
: x(X), y(Y), z(Z)
|
||||
{}
|
||||
|
||||
/**
|
||||
* Constructor. This converts an FT_Vector to an FT_Point
|
||||
*
|
||||
* @param ft_vector A freetype vector
|
||||
*/
|
||||
FTPoint( const FT_Vector& ft_vector)
|
||||
: x(ft_vector.x), y(ft_vector.y), z(0)
|
||||
{}
|
||||
|
||||
/**
|
||||
* Operator +=
|
||||
*
|
||||
* @param point
|
||||
* @return this plus point.
|
||||
*/
|
||||
FTPoint& operator += ( const FTPoint& point)
|
||||
{
|
||||
x += point.x;
|
||||
y += point.y;
|
||||
z += point.z;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Operator == Tests for eqaulity
|
||||
*
|
||||
* @param a
|
||||
* @param b
|
||||
* @return
|
||||
*/
|
||||
friend bool operator == ( const FTPoint &a, const FTPoint &b);
|
||||
|
||||
/**
|
||||
* Operator != Tests for non equality
|
||||
*
|
||||
* @param a
|
||||
* @param b
|
||||
* @return
|
||||
*/
|
||||
friend bool operator != ( const FTPoint &a, const FTPoint &b);
|
||||
|
||||
/**
|
||||
* The point data
|
||||
*/
|
||||
FTGL_DOUBLE x, y, z; // FIXME make private
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
#endif // __FTPoint__
|
||||
|
||||
55
extern/bFTGL/include/FTPolyGlyph.h
vendored
55
extern/bFTGL/include/FTPolyGlyph.h
vendored
@@ -1,55 +0,0 @@
|
||||
#ifndef __FTPolyGlyph__
|
||||
#define __FTPolyGlyph__
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
#include FT_GLYPH_H
|
||||
|
||||
#include "FTGL.h"
|
||||
#include "FTGlyph.h"
|
||||
|
||||
class FTVectoriser;
|
||||
|
||||
/**
|
||||
* FTPolyGlyph is a specialisation of FTGlyph for creating tessellated
|
||||
* polygon glyphs.
|
||||
*
|
||||
* @see FTGlyphContainer
|
||||
* @see FTVectoriser
|
||||
*
|
||||
*/
|
||||
class FTGL_EXPORT FTPolyGlyph : public FTGlyph
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Constructor. Sets the Error to Invalid_Outline if the glyphs isn't an outline.
|
||||
*
|
||||
* @param glyph The Freetype glyph to be processed
|
||||
*/
|
||||
FTPolyGlyph( FT_GlyphSlot glyph);
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
virtual ~FTPolyGlyph();
|
||||
|
||||
/**
|
||||
* Renders this glyph at the current pen position.
|
||||
*
|
||||
* @param pen The current pen position.
|
||||
* @return The advance distance for this glyph.
|
||||
*/
|
||||
virtual float Render( const FTPoint& pen);
|
||||
|
||||
private:
|
||||
/**
|
||||
* OpenGL display list
|
||||
*/
|
||||
GLuint glList;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif // __FTPolyGlyph__
|
||||
|
||||
132
extern/bFTGL/include/FTSize.h
vendored
132
extern/bFTGL/include/FTSize.h
vendored
@@ -1,132 +0,0 @@
|
||||
#ifndef __FTSize__
|
||||
#define __FTSize__
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
#include "FTGL.h"
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* FTSize class provides an abstraction layer for the Freetype Size.
|
||||
*
|
||||
* @see "Freetype 2 Documentation"
|
||||
*
|
||||
*/
|
||||
class FTGL_EXPORT FTSize
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Default Constructor
|
||||
*/
|
||||
FTSize();
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
virtual ~FTSize();
|
||||
|
||||
/**
|
||||
* Sets the char size for the current face.
|
||||
*
|
||||
* This doesn't guarantee that the size was set correctly. Clients
|
||||
* should check errors.
|
||||
*
|
||||
* @param face Parent face for this size object
|
||||
* @param point_size the face size in points (1/72 inch)
|
||||
* @param x_resolution the horizontal resolution of the target device.
|
||||
* @param y_resolution the vertical resolution of the target device.
|
||||
* @return <code>true</code> if the size has been set. Clients should check Error() for more information if this function returns false()
|
||||
*/
|
||||
bool CharSize( FT_Face* face, unsigned int point_size, unsigned int x_resolution, unsigned int y_resolution);
|
||||
|
||||
/**
|
||||
* get the char size for the current face.
|
||||
*
|
||||
* @return The char size in points
|
||||
*/
|
||||
unsigned int CharSize() const;
|
||||
|
||||
/**
|
||||
* Gets the global ascender height for the face in pixels.
|
||||
*
|
||||
* @return Ascender height
|
||||
*/
|
||||
float Ascender() const;
|
||||
|
||||
/**
|
||||
* Gets the global descender height for the face in pixels.
|
||||
*
|
||||
* @return Ascender height
|
||||
*/
|
||||
float Descender() const;
|
||||
|
||||
/**
|
||||
* Gets the global face height for the face.
|
||||
*
|
||||
* If the face is scalable this returns the height of the global
|
||||
* bounding box which ensures that any glyph will be less than or
|
||||
* equal to this height. If the font isn't scalable there is no
|
||||
* guarantee that glyphs will not be taller than this value.
|
||||
*
|
||||
* @return height in pixels.
|
||||
*/
|
||||
float Height() const;
|
||||
|
||||
/**
|
||||
* Gets the global face width for the face.
|
||||
*
|
||||
* If the face is scalable this returns the width of the global
|
||||
* bounding box which ensures that any glyph will be less than or
|
||||
* equal to this width. If the font isn't scalable this value is
|
||||
* the max_advance for the face.
|
||||
*
|
||||
* @return width in pixels.
|
||||
*/
|
||||
float Width() const;
|
||||
|
||||
/**
|
||||
* Gets the underline position for the face.
|
||||
*
|
||||
* @return underline position in pixels
|
||||
*/
|
||||
float Underline() const;
|
||||
|
||||
unsigned int XPixelsPerEm() const;
|
||||
|
||||
unsigned int YPixelsPerEm() const;
|
||||
|
||||
/**
|
||||
* Queries for errors.
|
||||
*
|
||||
* @return The current error code.
|
||||
*/
|
||||
FT_Error Error() const { return err; }
|
||||
|
||||
private:
|
||||
/**
|
||||
* The current Freetype face that this FTSize object relates to.
|
||||
*/
|
||||
FT_Face* ftFace;
|
||||
|
||||
/**
|
||||
* The Freetype size.
|
||||
*/
|
||||
FT_Size ftSize;
|
||||
|
||||
/**
|
||||
* The size in points.
|
||||
*/
|
||||
unsigned int size;
|
||||
|
||||
/**
|
||||
* Current error code. Zero means no error.
|
||||
*/
|
||||
FT_Error err;
|
||||
|
||||
};
|
||||
|
||||
#endif // __FTSize__
|
||||
|
||||
89
extern/bFTGL/include/FTTextureGlyph.h
vendored
89
extern/bFTGL/include/FTTextureGlyph.h
vendored
@@ -1,89 +0,0 @@
|
||||
#ifndef __FTTextureGlyph__
|
||||
#define __FTTextureGlyph__
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
#include FT_GLYPH_H
|
||||
|
||||
#include "FTGL.h"
|
||||
#include "FTGlyph.h"
|
||||
|
||||
|
||||
/**
|
||||
* FTTextureGlyph is a specialisation of FTGlyph for creating texture
|
||||
* glyphs.
|
||||
*
|
||||
* @see FTGlyphContainer
|
||||
*
|
||||
*/
|
||||
class FTGL_EXPORT FTTextureGlyph : public FTGlyph
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param glyph The Freetype glyph to be processed
|
||||
* @param id The id of the texture that this glyph will be
|
||||
* drawn in
|
||||
* @param xOffset The x offset into the parent texture to draw
|
||||
* this glyph
|
||||
* @param yOffset The y offset into the parent texture to draw
|
||||
* this glyph
|
||||
* @param width The width of the parent texture
|
||||
* @param height The height (number of rows) of the parent texture
|
||||
*/
|
||||
FTTextureGlyph( FT_GlyphSlot glyph, int id, int xOffset, int yOffset, GLsizei width, GLsizei height);
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
virtual ~FTTextureGlyph();
|
||||
|
||||
/**
|
||||
* Renders this glyph at the current pen position.
|
||||
*
|
||||
* @param pen The current pen position.
|
||||
* @return The advance distance for this glyph.
|
||||
*/
|
||||
virtual float Render( const FTPoint& pen);
|
||||
|
||||
private:
|
||||
/**
|
||||
* The width of the glyph 'image'
|
||||
*/
|
||||
int destWidth;
|
||||
|
||||
/**
|
||||
* The height of the glyph 'image'
|
||||
*/
|
||||
int destHeight;
|
||||
|
||||
/**
|
||||
* Vector from the pen position to the topleft corner of the pixmap
|
||||
*/
|
||||
FTPoint pos;
|
||||
|
||||
/**
|
||||
* The texture co-ords of this glyph within the texture.
|
||||
*/
|
||||
FTPoint uv[2];
|
||||
|
||||
/**
|
||||
* The texture index that this glyph is contained in.
|
||||
*/
|
||||
int glTextureID;
|
||||
|
||||
/**
|
||||
* The texture index of the currently active texture
|
||||
*
|
||||
* We call glGetIntegerv( GL_TEXTURE_2D_BINDING, activeTextureID);
|
||||
* to get the currently active texture to try to reduce the number
|
||||
* of texture bind operations
|
||||
*/
|
||||
GLint activeTextureID;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif // __FTTextureGlyph__
|
||||
190
extern/bFTGL/include/FTVector.h
vendored
190
extern/bFTGL/include/FTVector.h
vendored
@@ -1,190 +0,0 @@
|
||||
#ifndef __FTVector__
|
||||
#define __FTVector__
|
||||
|
||||
#include "FTGL.h"
|
||||
|
||||
/**
|
||||
* Provides a non-STL alternative to the STL vector
|
||||
*/
|
||||
template <typename FT_VECTOR_ITEM_TYPE>
|
||||
class FTGL_EXPORT FTVector
|
||||
{
|
||||
public:
|
||||
typedef FT_VECTOR_ITEM_TYPE value_type;
|
||||
typedef value_type& reference;
|
||||
typedef const value_type& const_reference;
|
||||
typedef value_type* iterator;
|
||||
typedef const value_type* const_iterator;
|
||||
typedef size_t size_type;
|
||||
|
||||
FTVector()
|
||||
{
|
||||
Capacity = Size = 0;
|
||||
Items = 0;
|
||||
}
|
||||
|
||||
|
||||
virtual ~FTVector()
|
||||
{
|
||||
clear();
|
||||
}
|
||||
|
||||
FTVector& operator =(const FTVector& v)
|
||||
{
|
||||
reserve(v.capacity());
|
||||
|
||||
iterator ptr = begin();
|
||||
const_iterator vbegin = v.begin();
|
||||
const_iterator vend = v.end();
|
||||
|
||||
while( vbegin != vend)
|
||||
{
|
||||
*ptr++ = *vbegin++;
|
||||
}
|
||||
|
||||
Size = v.size();
|
||||
return *this;
|
||||
}
|
||||
|
||||
size_type size() const
|
||||
{
|
||||
return Size;
|
||||
}
|
||||
|
||||
size_type capacity() const
|
||||
{
|
||||
return Capacity;
|
||||
}
|
||||
|
||||
iterator begin()
|
||||
{
|
||||
return Items;
|
||||
}
|
||||
|
||||
const_iterator begin() const
|
||||
{
|
||||
return Items;
|
||||
}
|
||||
|
||||
iterator end()
|
||||
{
|
||||
return begin() + size();
|
||||
}
|
||||
|
||||
const_iterator end() const
|
||||
{
|
||||
return begin() + size();
|
||||
}
|
||||
|
||||
bool empty() const
|
||||
{
|
||||
return size() == 0;
|
||||
}
|
||||
|
||||
reference operator [](size_type pos)
|
||||
{
|
||||
return( *(begin() + pos));
|
||||
}
|
||||
|
||||
const_reference operator []( size_type pos) const
|
||||
{
|
||||
return( *(begin() + pos));
|
||||
}
|
||||
|
||||
void clear()
|
||||
{
|
||||
if( Capacity)
|
||||
{
|
||||
delete [] Items;
|
||||
Capacity = Size = 0;
|
||||
Items = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void reserve( size_type n)
|
||||
{
|
||||
if( capacity() < n)
|
||||
{
|
||||
expand(n);
|
||||
}
|
||||
}
|
||||
|
||||
void push_back(const value_type& x)
|
||||
{
|
||||
if( size() == capacity())
|
||||
{
|
||||
expand();
|
||||
}
|
||||
|
||||
( *this)[size()] = x;
|
||||
++Size;
|
||||
}
|
||||
|
||||
void resize(size_type n, value_type x)
|
||||
{
|
||||
if( n == size())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
reserve(n);
|
||||
iterator begin, end;
|
||||
|
||||
if( n >= Size)
|
||||
{
|
||||
begin = this->end();
|
||||
end = this->begin() + n;
|
||||
}
|
||||
else
|
||||
{
|
||||
begin = this->begin() + n;
|
||||
end = this->end();
|
||||
}
|
||||
|
||||
while( begin != end)
|
||||
{
|
||||
*begin++ = x;
|
||||
}
|
||||
|
||||
Size = n;
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
void expand(size_type capacity_hint = 0)
|
||||
{
|
||||
size_type new_capacity =( capacity() == 0) ? 256 : capacity()* 2;
|
||||
if( capacity_hint)
|
||||
{
|
||||
while( new_capacity < capacity_hint)
|
||||
{
|
||||
new_capacity *= 2;
|
||||
}
|
||||
}
|
||||
|
||||
value_type *new_items = new value_type[new_capacity];
|
||||
|
||||
iterator begin = this->begin();
|
||||
iterator end = this->end();
|
||||
value_type *ptr = new_items;
|
||||
|
||||
while( begin != end)
|
||||
{
|
||||
*ptr++ = *begin++;
|
||||
}
|
||||
|
||||
if( Capacity)
|
||||
{
|
||||
delete [] Items;
|
||||
}
|
||||
|
||||
Items = new_items;
|
||||
Capacity = new_capacity;
|
||||
}
|
||||
|
||||
size_type Capacity;
|
||||
size_type Size;
|
||||
value_type* Items;
|
||||
};
|
||||
|
||||
#endif // __FTVector__
|
||||
275
extern/bFTGL/include/FTVectoriser.h
vendored
275
extern/bFTGL/include/FTVectoriser.h
vendored
@@ -1,275 +0,0 @@
|
||||
#ifndef __FTVectoriser__
|
||||
#define __FTVectoriser__
|
||||
|
||||
|
||||
#include "FTContour.h"
|
||||
#include "FTList.h"
|
||||
#include "FTPoint.h"
|
||||
#include "FTVector.h"
|
||||
#include "FTGL.h"
|
||||
|
||||
|
||||
#ifndef CALLBACK
|
||||
#define CALLBACK
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* FTTesselation captures points that are output by OpenGL's gluTesselator.
|
||||
*/
|
||||
class FTGL_EXPORT FTTesselation
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Default constructor
|
||||
*/
|
||||
FTTesselation( GLenum m)
|
||||
: meshType(m)
|
||||
{
|
||||
pointList.reserve( 128);
|
||||
}
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
~FTTesselation()
|
||||
{
|
||||
pointList.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a point to the mesh.
|
||||
*/
|
||||
void AddPoint( const FTGL_DOUBLE x, const FTGL_DOUBLE y, const FTGL_DOUBLE z)
|
||||
{
|
||||
pointList.push_back( FTPoint( x, y, z));
|
||||
}
|
||||
|
||||
/**
|
||||
* The number of points in this mesh
|
||||
*/
|
||||
size_t PointCount() const { return pointList.size();}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
const FTPoint& Point( unsigned int index) const { return pointList[index];}
|
||||
|
||||
/**
|
||||
* Return the OpenGL polygon type.
|
||||
*/
|
||||
GLenum PolygonType() const { return meshType;}
|
||||
|
||||
private:
|
||||
/**
|
||||
* Points generated by gluTesselator.
|
||||
*/
|
||||
typedef FTVector<FTPoint> PointVector;
|
||||
PointVector pointList;
|
||||
|
||||
/**
|
||||
* OpenGL primitive type from gluTesselator.
|
||||
*/
|
||||
GLenum meshType;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* FTMesh is a container of FTTesselation's that make up a polygon glyph
|
||||
*/
|
||||
class FTGL_EXPORT FTMesh
|
||||
{
|
||||
typedef FTVector<FTTesselation*> TesselationVector;
|
||||
typedef FTList<FTPoint> PointList;
|
||||
|
||||
public:
|
||||
/**
|
||||
* Default constructor
|
||||
*/
|
||||
FTMesh();
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
~FTMesh();
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
void AddPoint( const FTGL_DOUBLE x, const FTGL_DOUBLE y, const FTGL_DOUBLE z);
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
FTGL_DOUBLE* Combine( const FTGL_DOUBLE x, const FTGL_DOUBLE y, const FTGL_DOUBLE z);
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
void Begin( GLenum meshType);
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
void End();
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
void Error( GLenum e) { err = e;}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
unsigned int TesselationCount() const { return tesselationList.size();}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
const FTTesselation* const Tesselation( unsigned int index) const;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
const PointList& TempPointList() const { return tempPointList;}
|
||||
|
||||
/**
|
||||
* Get the GL ERROR returned by the glu tesselator
|
||||
*/
|
||||
GLenum Error() const { return err;}
|
||||
|
||||
private:
|
||||
/**
|
||||
* The current sub mesh that we are constructing.
|
||||
*/
|
||||
FTTesselation* currentTesselation;
|
||||
|
||||
/**
|
||||
* Holds each sub mesh that comprises this glyph.
|
||||
*/
|
||||
TesselationVector tesselationList;
|
||||
|
||||
/**
|
||||
* Holds extra points created by gluTesselator. See ftglCombine.
|
||||
*/
|
||||
PointList tempPointList;
|
||||
|
||||
/**
|
||||
* GL ERROR returned by the glu tesselator
|
||||
*/
|
||||
GLenum err;
|
||||
|
||||
};
|
||||
|
||||
const FTGL_DOUBLE FTGL_FRONT_FACING = 1.0;
|
||||
const FTGL_DOUBLE FTGL_BACK_FACING = -1.0;
|
||||
|
||||
/**
|
||||
* FTVectoriser class is a helper class that converts font outlines into
|
||||
* point data.
|
||||
*
|
||||
* @see FTExtrdGlyph
|
||||
* @see FTOutlineGlyph
|
||||
* @see FTPolyGlyph
|
||||
* @see FTContour
|
||||
* @see FTPoint
|
||||
*
|
||||
*/
|
||||
class FTGL_EXPORT FTVectoriser
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param glyph The freetype glyph to be processed
|
||||
*/
|
||||
FTVectoriser( const FT_GlyphSlot glyph);
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
virtual ~FTVectoriser();
|
||||
|
||||
/**
|
||||
* Build an FTMesh from the vector outline data.
|
||||
*
|
||||
* @param zNormal The direction of the z axis of the normal
|
||||
* for this mesh
|
||||
*/
|
||||
void MakeMesh( FTGL_DOUBLE zNormal = FTGL_FRONT_FACING);
|
||||
|
||||
/**
|
||||
* Get the current mesh.
|
||||
*/
|
||||
const FTMesh* const GetMesh() const { return mesh;}
|
||||
|
||||
/**
|
||||
* Get the total count of points in this outline
|
||||
*
|
||||
* @return the number of points
|
||||
*/
|
||||
size_t PointCount();
|
||||
|
||||
/**
|
||||
* Get the count of contours in this outline
|
||||
*
|
||||
* @return the number of contours
|
||||
*/
|
||||
size_t ContourCount() const { return ftContourCount;}
|
||||
|
||||
/**
|
||||
* Return a contour at index
|
||||
*
|
||||
* @return the number of contours
|
||||
*/
|
||||
const FTContour* const Contour( unsigned int index) const;
|
||||
|
||||
/**
|
||||
* Get the number of points in a specific contour in this outline
|
||||
*
|
||||
* @param c The contour index
|
||||
* @return the number of points in contour[c]
|
||||
*/
|
||||
size_t ContourSize( int c) const { return contourList[c]->PointCount();}
|
||||
|
||||
/**
|
||||
* Get the flag for the tesselation rule for this outline
|
||||
*
|
||||
* @return The contour flag
|
||||
*/
|
||||
int ContourFlag() const { return contourFlag;}
|
||||
|
||||
private:
|
||||
/**
|
||||
* Process the freetype outline data into contours of points
|
||||
*/
|
||||
void ProcessContours();
|
||||
|
||||
/**
|
||||
* The list of contours in the glyph
|
||||
*/
|
||||
FTContour** contourList;
|
||||
|
||||
/**
|
||||
* A Mesh for tesselations
|
||||
*/
|
||||
FTMesh* mesh;
|
||||
|
||||
/**
|
||||
* The number of contours reported by Freetype
|
||||
*/
|
||||
short ftContourCount;
|
||||
|
||||
/**
|
||||
* A flag indicating the tesselation rule for the glyph
|
||||
*/
|
||||
int contourFlag;
|
||||
|
||||
/**
|
||||
* A Freetype outline
|
||||
*/
|
||||
FT_Outline outline;
|
||||
};
|
||||
|
||||
|
||||
#endif // __FTVectoriser__
|
||||
27
extern/bFTGL/license.txt
vendored
27
extern/bFTGL/license.txt
vendored
@@ -1,27 +0,0 @@
|
||||
FTGL
|
||||
|
||||
Herewith is a license. I've also chucked in a gnu (see COPYING.txt) license
|
||||
for those that are that way inclined. Basically I want you to use this
|
||||
software and if you think this license is preventing you from doing so
|
||||
let me know.
|
||||
|
||||
Copyright (C) 2001-3 Henry Maddocks
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
406
extern/bFTGL/make/msvc_7_0/ftgl_static_lib.vcproj
vendored
406
extern/bFTGL/make/msvc_7_0/ftgl_static_lib.vcproj
vendored
@@ -1,406 +0,0 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="ftgl_static_lib"
|
||||
ProjectGUID="{F9850C15-FF0A-429E-9D47-89FB433C9BD8}"
|
||||
SccProjectName=""
|
||||
SccLocalPath="">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Blender Debug|Win32"
|
||||
OutputDirectory="..\..\..\..\..\build\msvc_7\extern\ftgl\debug"
|
||||
IntermediateDirectory="..\..\..\..\..\build\msvc_7\extern\ftgl\debug"
|
||||
ConfigurationType="4"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\include;..\..\..\..\..\lib\windows\freetype\include"
|
||||
PreprocessorDefinitions="_DEBUG;WIN32;_LIB;FTGL_LIBRARY_STATIC"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderFile="..\..\..\..\..\build\msvc_7\extern\ftgl\debug\ftgl_static_lib.pch"
|
||||
AssemblerListingLocation="..\..\..\..\..\build\msvc_7\extern\ftgl\debug\"
|
||||
ObjectFile="..\..\..\..\..\build\msvc_7\extern\ftgl\debug\"
|
||||
ProgramDataBaseFileName="..\..\..\..\..\build\msvc_7\extern\ftgl\debug\"
|
||||
WarningLevel="2"
|
||||
SuppressStartupBanner="TRUE"
|
||||
DebugInformationFormat="3"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="..\..\..\..\..\build\msvc_7\libs\extern\debug\ftgl_static.lib"
|
||||
SuppressStartupBanner="TRUE"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
Description="Copying FTGL files library (debug target) to lib tree."
|
||||
CommandLine="ECHO Copying header files
|
||||
IF NOT EXIST ..\..\..\..\..\build\msvc_7\extern\ftgl\include\ MKDIR ..\..\..\..\..\build\msvc_7\extern\ftgl\include
|
||||
XCOPY /Y ..\..\include\*.h ..\..\..\..\..\build\msvc_7\extern\ftgl\include
|
||||
ECHO Done
|
||||
"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Blender Release|Win32"
|
||||
OutputDirectory="..\..\..\..\..\build\msvc_7\extern\ftgl"
|
||||
IntermediateDirectory="..\..\..\..\..\build\msvc_7\extern\ftgl"
|
||||
ConfigurationType="4"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\..\include;..\..\..\..\..\lib\windows\freetype\include"
|
||||
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;FTGL_LIBRARY_STATIC"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderFile="..\..\..\..\..\build\msvc_7\extern\ftgl\ftgl_static_lib.pch"
|
||||
AssemblerListingLocation="..\..\..\..\..\build\msvc_7\extern\ftgl\"
|
||||
ObjectFile="..\..\..\..\..\build\msvc_7\extern\ftgl\"
|
||||
ProgramDataBaseFileName="..\..\..\..\..\build\msvc_7\extern\ftgl\"
|
||||
WarningLevel="2"
|
||||
SuppressStartupBanner="TRUE"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="..\..\..\..\..\build\msvc_7\libs\extern\ftgl_static.lib"
|
||||
SuppressStartupBanner="TRUE"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
Description="Copying FTGL files library to lib tree."
|
||||
CommandLine="ECHO Copying header files
|
||||
IF NOT EXIST ..\..\..\..\..\build\msvc_7\extern\ftgl\include\ MKDIR ..\..\..\..\..\build\msvc_7\extern\ftgl\include
|
||||
XCOPY /Y ..\..\include\*.h ..\..\..\..\..\build\msvc_7\extern\ftgl\include
|
||||
ECHO Done
|
||||
"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="3D Plugin Release|Win32"
|
||||
OutputDirectory="..\..\..\..\..\build\msvc_7\extern\ftgl\mtdll"
|
||||
IntermediateDirectory="..\..\..\..\..\build\msvc_7\extern\ftgl\mtdll"
|
||||
ConfigurationType="4"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\..\include;..\..\..\..\..\lib\windows\freetype\include"
|
||||
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;FTGL_LIBRARY_STATIC"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderFile="..\..\..\..\..\build\msvc_7\extern\ftgl\mtdll\ftgl_static_lib.pch"
|
||||
AssemblerListingLocation="..\..\..\..\..\build\msvc_7\extern\ftgl\mtdll\"
|
||||
ObjectFile="..\..\..\..\..\build\msvc_7\extern\ftgl\mtdll\"
|
||||
ProgramDataBaseFileName="..\..\..\..\..\build\msvc_7\extern\ftgl\mtdll\"
|
||||
WarningLevel="2"
|
||||
SuppressStartupBanner="TRUE"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="..\..\..\..\..\build\msvc_7\libs\extern\mtdll\ftgl_static.lib"
|
||||
SuppressStartupBanner="TRUE"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
Description="Copying FTGL files library to lib tree."
|
||||
CommandLine="ECHO Copying header files
|
||||
IF NOT EXIST ..\..\..\..\..\build\msvc_7\extern\ftgl\include\ MKDIR ..\..\..\..\..\build\msvc_7\extern\ftgl\include
|
||||
XCOPY /Y ..\..\include\*.h ..\..\..\..\..\build\msvc_7\extern\ftgl\include
|
||||
ECHO Done
|
||||
"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="3D Plugin Debug|Win32"
|
||||
OutputDirectory="..\..\..\..\..\build\msvc_7\extern\ftgl\mtdll\debug"
|
||||
IntermediateDirectory="..\..\..\..\..\build\msvc_7\extern\ftgl\mtdll\debug"
|
||||
ConfigurationType="4"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\include;..\..\..\..\..\lib\windows\freetype\include"
|
||||
PreprocessorDefinitions="_DEBUG;WIN32;_LIB;FTGL_LIBRARY_STATIC"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderFile="..\..\..\..\..\build\msvc_7\extern\ftgl\mtdll\debug\ftgl_static_lib.pch"
|
||||
AssemblerListingLocation="..\..\..\..\..\build\msvc_7\extern\ftgl\mtdll\debug\"
|
||||
ObjectFile="..\..\..\..\..\build\msvc_7\extern\ftgl\mtdll\debug\"
|
||||
ProgramDataBaseFileName="..\..\..\..\..\build\msvc_7\extern\ftgl\mtdll\debug\"
|
||||
WarningLevel="2"
|
||||
SuppressStartupBanner="TRUE"
|
||||
DebugInformationFormat="3"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="..\..\..\..\..\build\msvc_7\libs\extern\mtdll\debug\ftgl_static.lib"
|
||||
SuppressStartupBanner="TRUE"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
Description="Copying FTGL files library (debug target) to lib tree."
|
||||
CommandLine="ECHO Copying header files
|
||||
IF NOT EXIST ..\..\..\..\..\build\msvc_7\extern\ftgl\include\ MKDIR ..\..\..\..\..\build\msvc_7\extern\ftgl\include
|
||||
XCOPY /Y ..\..\include\*.h ..\..\..\..\..\build\msvc_7\extern\ftgl\include
|
||||
ECHO Done
|
||||
"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
|
||||
<File
|
||||
RelativePath="..\..\src\FTBitmapGlyph.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\FTCharmap.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\FTContour.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\FTExtrdGlyph.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\FTFace.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\FTFont.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\FTGLBitmapFont.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\FTGLExtrdFont.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\FTGLOutlineFont.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\FTGLPixmapFont.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\FTGLPolygonFont.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\FTGLTextureFont.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\FTGlyph.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\FTGlyphContainer.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\FTLibrary.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\FTOutlineGlyph.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\FTPixmapGlyph.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\FTPoint.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\FTPolyGlyph.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\FTSize.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\FTTextureGlyph.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\FTVectoriser.cpp">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl">
|
||||
<File
|
||||
RelativePath="..\..\include\FTBBox.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\FTBitmapGlyph.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\FTCharmap.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\FTCharToGlyphIndexMap.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\FTContour.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\FTExtrdGlyph.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\FTFace.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\FTFont.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\FTGL.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\FTGLBitmapFont.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\FTGLExtrdFont.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\FTGLOutlineFont.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\FTGLPixmapFont.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\FTGLPolygonFont.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\FTGLTextureFont.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\FTGlyph.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\FTGlyphContainer.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\FTLibrary.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\FTList.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\FTOutlineGlyph.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\FTPixmapGlyph.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\FTPoint.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\FTPolyGlyph.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\FTSize.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\FTTextureGlyph.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\FTVector.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\FTVectoriser.h">
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
66
extern/bFTGL/src/FTBitmapGlyph.cpp
vendored
66
extern/bFTGL/src/FTBitmapGlyph.cpp
vendored
@@ -1,66 +0,0 @@
|
||||
#include <string>
|
||||
|
||||
#include "FTBitmapGlyph.h"
|
||||
|
||||
FTBitmapGlyph::FTBitmapGlyph( FT_GlyphSlot glyph)
|
||||
: FTGlyph( glyph),
|
||||
destWidth(0),
|
||||
destHeight(0),
|
||||
data(0)
|
||||
{
|
||||
err = FT_Render_Glyph( glyph, FT_RENDER_MODE_MONO);
|
||||
if( err || ft_glyph_format_bitmap != glyph->format)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
FT_Bitmap bitmap = glyph->bitmap;
|
||||
|
||||
unsigned int srcWidth = bitmap.width;
|
||||
unsigned int srcHeight = bitmap.rows;
|
||||
unsigned int srcPitch = bitmap.pitch;
|
||||
|
||||
destWidth = srcWidth;
|
||||
destHeight = srcHeight;
|
||||
destPitch = srcPitch;
|
||||
|
||||
if( destWidth && destHeight)
|
||||
{
|
||||
data = new unsigned char[destPitch * destHeight];
|
||||
unsigned char* dest = data + (( destHeight - 1) * destPitch);
|
||||
|
||||
unsigned char* src = bitmap.buffer;
|
||||
|
||||
for( unsigned int y = 0; y < srcHeight; ++y)
|
||||
{
|
||||
memcpy( dest, src, srcPitch);
|
||||
dest -= destPitch;
|
||||
src += srcPitch;
|
||||
}
|
||||
}
|
||||
|
||||
pos.x = glyph->bitmap_left;
|
||||
pos.y = static_cast<int>(srcHeight) - glyph->bitmap_top;
|
||||
}
|
||||
|
||||
|
||||
FTBitmapGlyph::~FTBitmapGlyph()
|
||||
{
|
||||
delete [] data;
|
||||
}
|
||||
|
||||
|
||||
float FTBitmapGlyph::Render( const FTPoint& pen)
|
||||
{
|
||||
if( data)
|
||||
{
|
||||
glBitmap( 0, 0, 0.0, 0.0, pen.x + pos.x, pen.y - pos.y, (const GLubyte*)0 );
|
||||
|
||||
glPixelStorei( GL_UNPACK_ROW_LENGTH, destPitch * 8);
|
||||
glBitmap( destWidth, destHeight, 0.0f, 0.0, 0.0, 0.0, (const GLubyte*)data);
|
||||
|
||||
glBitmap( 0, 0, 0.0, 0.0, -pen.x - pos.x, -pen.y + pos.y, (const GLubyte*)0 );
|
||||
}
|
||||
|
||||
return advance;
|
||||
}
|
||||
59
extern/bFTGL/src/FTBufferGlyph.cpp
vendored
59
extern/bFTGL/src/FTBufferGlyph.cpp
vendored
@@ -1,59 +0,0 @@
|
||||
#include "FTBufferGlyph.h"
|
||||
|
||||
FTBufferGlyph::FTBufferGlyph( FT_GlyphSlot glyph, unsigned char* b)
|
||||
: FTGlyph( glyph),
|
||||
destWidth(0),
|
||||
destHeight(0),
|
||||
data(0),
|
||||
buffer(b)
|
||||
{
|
||||
err = FT_Render_Glyph( glyph, FT_RENDER_MODE_NORMAL);
|
||||
if( err || ft_glyph_format_bitmap != glyph->format)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
FT_Bitmap bitmap = glyph->bitmap;
|
||||
|
||||
unsigned int srcWidth = bitmap.width;
|
||||
unsigned int srcHeight = bitmap.rows;
|
||||
unsigned int srcPitch = bitmap.pitch;
|
||||
|
||||
destWidth = srcWidth;
|
||||
destHeight = srcHeight;
|
||||
destPitch = srcPitch;
|
||||
|
||||
if( destWidth && destHeight)
|
||||
{
|
||||
data = new unsigned char[destPitch * destHeight];
|
||||
unsigned char* dest = data + (( destHeight - 1) * destPitch);
|
||||
|
||||
unsigned char* src = bitmap.buffer;
|
||||
|
||||
for( unsigned int y = 0; y < srcHeight; ++y)
|
||||
{
|
||||
memcpy( dest, src, srcPitch);
|
||||
dest -= destPitch;
|
||||
src += srcPitch;
|
||||
}
|
||||
}
|
||||
|
||||
pos.x = glyph->bitmap_left;
|
||||
pos.y = srcHeight - glyph->bitmap_top;
|
||||
}
|
||||
|
||||
|
||||
FTBufferGlyph::~FTBufferGlyph()
|
||||
{
|
||||
delete [] data;
|
||||
}
|
||||
|
||||
|
||||
float FTBufferGlyph::Render( const FTPoint& pen)
|
||||
{
|
||||
if( data && buffer)
|
||||
{
|
||||
}
|
||||
|
||||
return advance;
|
||||
}
|
||||
62
extern/bFTGL/src/FTCharmap.cpp
vendored
62
extern/bFTGL/src/FTCharmap.cpp
vendored
@@ -1,62 +0,0 @@
|
||||
#include "FTFace.h"
|
||||
#include "FTCharmap.h"
|
||||
|
||||
|
||||
FTCharmap::FTCharmap( FTFace* face)
|
||||
: ftFace( *(face->Face())),
|
||||
err(0)
|
||||
{
|
||||
if( !ftFace->charmap)
|
||||
{
|
||||
err = FT_Set_Charmap( ftFace, ftFace->charmaps[0]);
|
||||
}
|
||||
|
||||
ftEncoding = ftFace->charmap->encoding;
|
||||
}
|
||||
|
||||
|
||||
FTCharmap::~FTCharmap()
|
||||
{
|
||||
charMap.clear();
|
||||
}
|
||||
|
||||
|
||||
bool FTCharmap::CharMap( FT_Encoding encoding)
|
||||
{
|
||||
if( ftEncoding == encoding)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
err = FT_Select_Charmap( ftFace, encoding );
|
||||
|
||||
if( !err)
|
||||
{
|
||||
ftEncoding = encoding;
|
||||
}
|
||||
else
|
||||
{
|
||||
ftEncoding = ft_encoding_none;
|
||||
}
|
||||
|
||||
charMap.clear();
|
||||
return !err;
|
||||
}
|
||||
|
||||
|
||||
unsigned int FTCharmap::GlyphListIndex( const unsigned int characterCode )
|
||||
{
|
||||
return charMap.find( characterCode);
|
||||
}
|
||||
|
||||
|
||||
unsigned int FTCharmap::FontIndex( const unsigned int characterCode )
|
||||
{
|
||||
return FT_Get_Char_Index( ftFace, characterCode);
|
||||
}
|
||||
|
||||
|
||||
void FTCharmap::InsertIndex( const unsigned int characterCode, const unsigned int containerIndex)
|
||||
{
|
||||
charMap.insert( characterCode, containerIndex);
|
||||
}
|
||||
149
extern/bFTGL/src/FTContour.cpp
vendored
149
extern/bFTGL/src/FTContour.cpp
vendored
@@ -1,149 +0,0 @@
|
||||
#include "FTContour.h"
|
||||
|
||||
static const float BEZIER_STEP_SIZE = 0.2f;
|
||||
|
||||
|
||||
void FTContour::AddPoint( FTPoint point)
|
||||
{
|
||||
if( pointList.empty() || point != pointList[pointList.size() - 1])
|
||||
{
|
||||
pointList.push_back( point);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void FTContour::AddPoint( float x, float y)
|
||||
{
|
||||
AddPoint( FTPoint( x, y, 0.0f));
|
||||
}
|
||||
|
||||
|
||||
void FTContour::evaluateQuadraticCurve()
|
||||
{
|
||||
for( unsigned int i = 0; i <= ( 1.0f / BEZIER_STEP_SIZE); i++)
|
||||
{
|
||||
float bezierValues[2][2];
|
||||
|
||||
float t = static_cast<float>(i) * BEZIER_STEP_SIZE;
|
||||
|
||||
bezierValues[0][0] = (1.0f - t) * controlPoints[0][0] + t * controlPoints[1][0];
|
||||
bezierValues[0][1] = (1.0f - t) * controlPoints[0][1] + t * controlPoints[1][1];
|
||||
|
||||
bezierValues[1][0] = (1.0f - t) * controlPoints[1][0] + t * controlPoints[2][0];
|
||||
bezierValues[1][1] = (1.0f - t) * controlPoints[1][1] + t * controlPoints[2][1];
|
||||
|
||||
bezierValues[0][0] = (1.0f - t) * bezierValues[0][0] + t * bezierValues[1][0];
|
||||
bezierValues[0][1] = (1.0f - t) * bezierValues[0][1] + t * bezierValues[1][1];
|
||||
|
||||
AddPoint( bezierValues[0][0], bezierValues[0][1]);
|
||||
}
|
||||
}
|
||||
|
||||
void FTContour::evaluateCubicCurve()
|
||||
{
|
||||
for( unsigned int i = 0; i <= ( 1.0f / BEZIER_STEP_SIZE); i++)
|
||||
{
|
||||
float bezierValues[3][2];
|
||||
|
||||
float t = static_cast<float>(i) * BEZIER_STEP_SIZE;
|
||||
|
||||
bezierValues[0][0] = (1.0f - t) * controlPoints[0][0] + t * controlPoints[1][0];
|
||||
bezierValues[0][1] = (1.0f - t) * controlPoints[0][1] + t * controlPoints[1][1];
|
||||
|
||||
bezierValues[1][0] = (1.0f - t) * controlPoints[1][0] + t * controlPoints[2][0];
|
||||
bezierValues[1][1] = (1.0f - t) * controlPoints[1][1] + t * controlPoints[2][1];
|
||||
|
||||
bezierValues[2][0] = (1.0f - t) * controlPoints[2][0] + t * controlPoints[3][0];
|
||||
bezierValues[2][1] = (1.0f - t) * controlPoints[2][1] + t * controlPoints[3][1];
|
||||
|
||||
bezierValues[0][0] = (1.0f - t) * bezierValues[0][0] + t * bezierValues[1][0];
|
||||
bezierValues[0][1] = (1.0f - t) * bezierValues[0][1] + t * bezierValues[1][1];
|
||||
|
||||
bezierValues[1][0] = (1.0f - t) * bezierValues[1][0] + t * bezierValues[2][0];
|
||||
bezierValues[1][1] = (1.0f - t) * bezierValues[1][1] + t * bezierValues[2][1];
|
||||
|
||||
bezierValues[0][0] = (1.0f - t) * bezierValues[0][0] + t * bezierValues[1][0];
|
||||
bezierValues[0][1] = (1.0f - t) * bezierValues[0][1] + t * bezierValues[1][1];
|
||||
|
||||
AddPoint( bezierValues[0][0], bezierValues[0][1]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
FTContour::FTContour( FT_Vector* contour, char* pointTags, unsigned int numberOfPoints)
|
||||
{
|
||||
for( unsigned int pointIndex = 0; pointIndex < numberOfPoints; ++ pointIndex)
|
||||
{
|
||||
char pointTag = pointTags[pointIndex];
|
||||
|
||||
if( pointTag == FT_Curve_Tag_On || numberOfPoints < 2)
|
||||
{
|
||||
AddPoint( contour[pointIndex].x, contour[pointIndex].y);
|
||||
continue;
|
||||
}
|
||||
|
||||
FTPoint controlPoint( contour[pointIndex]);
|
||||
FTPoint previousPoint = ( 0 == pointIndex)
|
||||
? FTPoint( contour[numberOfPoints - 1])
|
||||
: pointList[pointList.size() - 1];
|
||||
|
||||
FTPoint nextPoint = ( pointIndex == numberOfPoints - 1)
|
||||
? pointList[0]
|
||||
: FTPoint( contour[pointIndex + 1]);
|
||||
|
||||
if( pointTag == FT_Curve_Tag_Conic)
|
||||
{
|
||||
char nextPointTag = ( pointIndex == numberOfPoints - 1)
|
||||
? pointTags[0]
|
||||
: pointTags[pointIndex + 1];
|
||||
|
||||
while( nextPointTag == FT_Curve_Tag_Conic)
|
||||
{
|
||||
nextPoint = FTPoint( static_cast<float>( controlPoint.x + nextPoint.x) * 0.5f,
|
||||
static_cast<float>( controlPoint.y + nextPoint.y) * 0.5f,
|
||||
0);
|
||||
|
||||
controlPoints[0][0] = previousPoint.x; controlPoints[0][1] = previousPoint.y;
|
||||
controlPoints[1][0] = controlPoint.x; controlPoints[1][1] = controlPoint.y;
|
||||
controlPoints[2][0] = nextPoint.x; controlPoints[2][1] = nextPoint.y;
|
||||
|
||||
evaluateQuadraticCurve();
|
||||
++pointIndex;
|
||||
|
||||
previousPoint = nextPoint;
|
||||
controlPoint = FTPoint( contour[pointIndex]);
|
||||
nextPoint = ( pointIndex == numberOfPoints - 1)
|
||||
? pointList[0]
|
||||
: FTPoint( contour[pointIndex + 1]);
|
||||
nextPointTag = ( pointIndex == numberOfPoints - 1)
|
||||
? pointTags[0]
|
||||
: pointTags[pointIndex + 1];
|
||||
}
|
||||
|
||||
controlPoints[0][0] = previousPoint.x; controlPoints[0][1] = previousPoint.y;
|
||||
controlPoints[1][0] = controlPoint.x; controlPoints[1][1] = controlPoint.y;
|
||||
controlPoints[2][0] = nextPoint.x; controlPoints[2][1] = nextPoint.y;
|
||||
|
||||
evaluateQuadraticCurve();
|
||||
continue;
|
||||
}
|
||||
|
||||
if( pointTag == FT_Curve_Tag_Cubic)
|
||||
{
|
||||
FTPoint controlPoint2 = nextPoint;
|
||||
|
||||
FTPoint nextPoint = ( pointIndex == numberOfPoints - 2)
|
||||
? pointList[0]
|
||||
: FTPoint( contour[pointIndex + 2]);
|
||||
|
||||
controlPoints[0][0] = previousPoint.x; controlPoints[0][1] = previousPoint.y;
|
||||
controlPoints[1][0] = controlPoint.x; controlPoints[1][1] = controlPoint.y;
|
||||
controlPoints[2][0] = controlPoint2.x; controlPoints[2][1] = controlPoint2.y;
|
||||
controlPoints[3][0] = nextPoint.x; controlPoints[3][1] = nextPoint.y;
|
||||
|
||||
evaluateCubicCurve();
|
||||
++pointIndex;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
141
extern/bFTGL/src/FTExtrdGlyph.cpp
vendored
141
extern/bFTGL/src/FTExtrdGlyph.cpp
vendored
@@ -1,141 +0,0 @@
|
||||
#include <math.h>
|
||||
|
||||
#include "FTExtrdGlyph.h"
|
||||
#include "FTVectoriser.h"
|
||||
|
||||
|
||||
FTExtrdGlyph::FTExtrdGlyph( FT_GlyphSlot glyph, float d)
|
||||
: FTGlyph( glyph),
|
||||
glList(0),
|
||||
depth(d)
|
||||
{
|
||||
bBox.SetDepth( -depth);
|
||||
|
||||
if( ft_glyph_format_outline != glyph->format)
|
||||
{
|
||||
err = 0x14; // Invalid_Outline
|
||||
return;
|
||||
}
|
||||
|
||||
FTVectoriser vectoriser( glyph);
|
||||
if ( ( vectoriser.ContourCount() < 1) || ( vectoriser.PointCount() < 3))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
unsigned int tesselationIndex;
|
||||
glList = glGenLists(1);
|
||||
glNewList( glList, GL_COMPILE);
|
||||
|
||||
vectoriser.MakeMesh( 1.0);
|
||||
glNormal3d(0.0, 0.0, 1.0);
|
||||
|
||||
const FTMesh* mesh = vectoriser.GetMesh();
|
||||
for( tesselationIndex = 0; tesselationIndex < mesh->TesselationCount(); ++tesselationIndex)
|
||||
{
|
||||
const FTTesselation* subMesh = mesh->Tesselation( tesselationIndex);
|
||||
unsigned int polyonType = subMesh->PolygonType();
|
||||
|
||||
glBegin( polyonType);
|
||||
for( unsigned int pointIndex = 0; pointIndex < subMesh->PointCount(); ++pointIndex)
|
||||
{
|
||||
glVertex3f( subMesh->Point( pointIndex).x / 64.0f,
|
||||
subMesh->Point( pointIndex).y / 64.0f,
|
||||
0.0f);
|
||||
}
|
||||
glEnd();
|
||||
}
|
||||
|
||||
vectoriser.MakeMesh( -1.0);
|
||||
glNormal3d(0.0, 0.0, -1.0);
|
||||
|
||||
mesh = vectoriser.GetMesh();
|
||||
for( tesselationIndex = 0; tesselationIndex < mesh->TesselationCount(); ++tesselationIndex)
|
||||
{
|
||||
const FTTesselation* subMesh = mesh->Tesselation( tesselationIndex);
|
||||
unsigned int polyonType = subMesh->PolygonType();
|
||||
|
||||
glBegin( polyonType);
|
||||
for( unsigned int pointIndex = 0; pointIndex < subMesh->PointCount(); ++pointIndex)
|
||||
{
|
||||
glVertex3f( subMesh->Point( pointIndex).x / 64.0f,
|
||||
subMesh->Point( pointIndex).y / 64.0f,
|
||||
-depth);
|
||||
}
|
||||
glEnd();
|
||||
}
|
||||
|
||||
int contourFlag = vectoriser.ContourFlag();
|
||||
|
||||
for( size_t c = 0; c < vectoriser.ContourCount(); ++c)
|
||||
{
|
||||
const FTContour* contour = vectoriser.Contour(c);
|
||||
unsigned int numberOfPoints = contour->PointCount();
|
||||
|
||||
glBegin( GL_QUAD_STRIP);
|
||||
for( unsigned int j = 0; j <= numberOfPoints; ++j)
|
||||
{
|
||||
unsigned int index = ( j == numberOfPoints) ? 0 : j;
|
||||
unsigned int nextIndex = ( index == numberOfPoints - 1) ? 0 : index + 1;
|
||||
|
||||
FTPoint normal = GetNormal( contour->Point(index), contour->Point(nextIndex));
|
||||
glNormal3f( normal.x, normal.y, 0.0f);
|
||||
|
||||
if( contourFlag & ft_outline_reverse_fill)
|
||||
{
|
||||
glVertex3f( contour->Point(index).x / 64.0f, contour->Point(index).y / 64.0f, 0.0f);
|
||||
glVertex3f( contour->Point(index).x / 64.0f, contour->Point(index).y / 64.0f, -depth);
|
||||
}
|
||||
else
|
||||
{
|
||||
glVertex3f( contour->Point(index).x / 64.0f, contour->Point(index).y / 64.0f, -depth);
|
||||
glVertex3f( contour->Point(index).x / 64.0f, contour->Point(index).y / 64.0f, 0.0f);
|
||||
}
|
||||
}
|
||||
glEnd();
|
||||
}
|
||||
|
||||
glEndList();
|
||||
}
|
||||
|
||||
|
||||
FTExtrdGlyph::~FTExtrdGlyph()
|
||||
{
|
||||
glDeleteLists( glList, 1);
|
||||
}
|
||||
|
||||
|
||||
float FTExtrdGlyph::Render( const FTPoint& pen)
|
||||
{
|
||||
if( glList)
|
||||
{
|
||||
glTranslatef( pen.x, pen.y, 0);
|
||||
glCallList( glList);
|
||||
glTranslatef( -pen.x, -pen.y, 0);
|
||||
}
|
||||
|
||||
return advance;
|
||||
}
|
||||
|
||||
|
||||
FTPoint FTExtrdGlyph::GetNormal( const FTPoint &a, const FTPoint &b)
|
||||
{
|
||||
float vectorX = a.x - b.x;
|
||||
float vectorY = a.y - b.y;
|
||||
|
||||
float length = sqrt( vectorX * vectorX + vectorY * vectorY );
|
||||
|
||||
if( length > 0.0f)
|
||||
{
|
||||
length = 1 / length;
|
||||
}
|
||||
else
|
||||
{
|
||||
length = 0.0f;
|
||||
}
|
||||
|
||||
return FTPoint( -vectorY * length,
|
||||
vectorX * length,
|
||||
0.0f);
|
||||
}
|
||||
|
||||
154
extern/bFTGL/src/FTFace.cpp
vendored
154
extern/bFTGL/src/FTFace.cpp
vendored
@@ -1,154 +0,0 @@
|
||||
#include "FTFace.h"
|
||||
#include "FTLibrary.h"
|
||||
|
||||
#include FT_TRUETYPE_TABLES_H
|
||||
|
||||
FTFace::FTFace( const char* filename)
|
||||
: numGlyphs(0),
|
||||
fontEncodingList(0),
|
||||
err(0)
|
||||
{
|
||||
const FT_Long DEFAULT_FACE_INDEX = 0;
|
||||
ftFace = new FT_Face;
|
||||
|
||||
err = FT_New_Face( *FTLibrary::Instance().GetLibrary(), filename, DEFAULT_FACE_INDEX, ftFace);
|
||||
|
||||
if( err)
|
||||
{
|
||||
delete ftFace;
|
||||
ftFace = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
numGlyphs = (*ftFace)->num_glyphs;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
FTFace::FTFace( const unsigned char *pBufferBytes, size_t bufferSizeInBytes)
|
||||
: numGlyphs(0),
|
||||
err(0)
|
||||
{
|
||||
const FT_Long DEFAULT_FACE_INDEX = 0;
|
||||
ftFace = new FT_Face;
|
||||
|
||||
err = FT_New_Memory_Face( *FTLibrary::Instance().GetLibrary(), (FT_Byte *)pBufferBytes, bufferSizeInBytes, DEFAULT_FACE_INDEX, ftFace);
|
||||
|
||||
if( err)
|
||||
{
|
||||
delete ftFace;
|
||||
ftFace = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
numGlyphs = (*ftFace)->num_glyphs;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
FTFace::~FTFace()
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
|
||||
bool FTFace::Attach( const char* filename)
|
||||
{
|
||||
err = FT_Attach_File( *ftFace, filename);
|
||||
return !err;
|
||||
}
|
||||
|
||||
|
||||
bool FTFace::Attach( const unsigned char *pBufferBytes, size_t bufferSizeInBytes)
|
||||
{
|
||||
FT_Open_Args open;
|
||||
|
||||
open.flags = FT_OPEN_MEMORY;
|
||||
open.memory_base = (FT_Byte *)pBufferBytes;
|
||||
open.memory_size = bufferSizeInBytes;
|
||||
|
||||
err = FT_Attach_Stream( *ftFace, &open);
|
||||
return !err;
|
||||
}
|
||||
|
||||
|
||||
void FTFace::Close()
|
||||
{
|
||||
if( ftFace)
|
||||
{
|
||||
FT_Done_Face( *ftFace);
|
||||
delete ftFace;
|
||||
ftFace = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const FTSize& FTFace::Size( const unsigned int size, const unsigned int res)
|
||||
{
|
||||
charSize.CharSize( ftFace, size, res, res);
|
||||
err = charSize.Error();
|
||||
|
||||
return charSize;
|
||||
}
|
||||
|
||||
|
||||
unsigned int FTFace::CharMapCount()
|
||||
{
|
||||
return (*ftFace)->num_charmaps;
|
||||
}
|
||||
|
||||
|
||||
FT_Encoding* FTFace::CharMapList()
|
||||
{
|
||||
if( 0 == fontEncodingList)
|
||||
{
|
||||
fontEncodingList = new FT_Encoding[CharMapCount()];
|
||||
for( size_t encodingIndex = 0; encodingIndex < CharMapCount(); ++encodingIndex)
|
||||
{
|
||||
fontEncodingList[encodingIndex] = (*ftFace)->charmaps[encodingIndex]->encoding;
|
||||
}
|
||||
}
|
||||
|
||||
return fontEncodingList;
|
||||
}
|
||||
|
||||
|
||||
unsigned int FTFace::UnitsPerEM() const
|
||||
{
|
||||
return (*ftFace)->units_per_EM;
|
||||
}
|
||||
|
||||
|
||||
FTPoint FTFace::KernAdvance( unsigned int index1, unsigned int index2)
|
||||
{
|
||||
float x, y;
|
||||
x = y = 0.0f;
|
||||
|
||||
if( FT_HAS_KERNING((*ftFace)) && index1 && index2)
|
||||
{
|
||||
FT_Vector kernAdvance;
|
||||
kernAdvance.x = kernAdvance.y = 0;
|
||||
|
||||
err = FT_Get_Kerning( *ftFace, index1, index2, ft_kerning_unfitted, &kernAdvance);
|
||||
if( !err)
|
||||
{
|
||||
x = static_cast<float>( kernAdvance.x) / 64.0f;
|
||||
y = static_cast<float>( kernAdvance.y) / 64.0f;
|
||||
}
|
||||
}
|
||||
|
||||
return FTPoint( x, y, 0.0);
|
||||
}
|
||||
|
||||
|
||||
FT_GlyphSlot FTFace::Glyph( unsigned int index, FT_Int load_flags)
|
||||
{
|
||||
err = FT_Load_Glyph( *ftFace, index, load_flags);
|
||||
if( err)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return (*ftFace)->glyph;
|
||||
}
|
||||
|
||||
271
extern/bFTGL/src/FTFont.cpp
vendored
271
extern/bFTGL/src/FTFont.cpp
vendored
@@ -1,271 +0,0 @@
|
||||
#include "FTFace.h"
|
||||
#include "FTFont.h"
|
||||
#include "FTGlyphContainer.h"
|
||||
#include "FTBBox.h"
|
||||
|
||||
|
||||
FTFont::FTFont( const char* fontname)
|
||||
: face( fontname),
|
||||
glyphList(0)
|
||||
{
|
||||
err = face.Error();
|
||||
if( err == 0)
|
||||
{
|
||||
glyphList = new FTGlyphContainer( &face);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
FTFont::FTFont( const unsigned char *pBufferBytes, size_t bufferSizeInBytes)
|
||||
: face( pBufferBytes, bufferSizeInBytes),
|
||||
glyphList(0)
|
||||
{
|
||||
err = face.Error();
|
||||
if( err == 0)
|
||||
{
|
||||
glyphList = new FTGlyphContainer( &face);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
FTFont::~FTFont()
|
||||
{
|
||||
delete glyphList;
|
||||
}
|
||||
|
||||
|
||||
bool FTFont::Attach( const char* filename)
|
||||
{
|
||||
if( face.Attach( filename))
|
||||
{
|
||||
err = 0;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
err = face.Error();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool FTFont::Attach( const unsigned char *pBufferBytes, size_t bufferSizeInBytes)
|
||||
{
|
||||
if( face.Attach( pBufferBytes, bufferSizeInBytes))
|
||||
{
|
||||
err = 0;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
err = face.Error();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool FTFont::FaceSize( const unsigned int size, const unsigned int res )
|
||||
{
|
||||
charSize = face.Size( size, res);
|
||||
|
||||
if( face.Error())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if( glyphList != NULL)
|
||||
{
|
||||
delete glyphList;
|
||||
}
|
||||
|
||||
glyphList = new FTGlyphContainer( &face);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
unsigned int FTFont::FaceSize() const
|
||||
{
|
||||
return charSize.CharSize();
|
||||
}
|
||||
|
||||
|
||||
bool FTFont::CharMap( FT_Encoding encoding)
|
||||
{
|
||||
bool result = glyphList->CharMap( encoding);
|
||||
err = glyphList->Error();
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
unsigned int FTFont::CharMapCount()
|
||||
{
|
||||
return face.CharMapCount();
|
||||
}
|
||||
|
||||
|
||||
FT_Encoding* FTFont::CharMapList()
|
||||
{
|
||||
return face.CharMapList();
|
||||
}
|
||||
|
||||
|
||||
float FTFont::Ascender() const
|
||||
{
|
||||
return charSize.Ascender();
|
||||
}
|
||||
|
||||
|
||||
float FTFont::Descender() const
|
||||
{
|
||||
return charSize.Descender();
|
||||
}
|
||||
|
||||
|
||||
void FTFont::BBox( const char* string,
|
||||
float& llx, float& lly, float& llz, float& urx, float& ury, float& urz)
|
||||
{
|
||||
FTBBox totalBBox;
|
||||
|
||||
if((NULL != string) && ('\0' != *string))
|
||||
{
|
||||
const unsigned char* c = (unsigned char*)string;
|
||||
|
||||
CheckGlyph( *c);
|
||||
|
||||
totalBBox = glyphList->BBox( *c);
|
||||
float advance = glyphList->Advance( *c, *(c + 1));
|
||||
++c;
|
||||
|
||||
while( *c)
|
||||
{
|
||||
CheckGlyph( *c);
|
||||
FTBBox tempBBox = glyphList->BBox( *c);
|
||||
tempBBox.Move( FTPoint( advance, 0.0f, 0.0f));
|
||||
totalBBox += tempBBox;
|
||||
advance += glyphList->Advance( *c, *(c + 1));
|
||||
++c;
|
||||
}
|
||||
}
|
||||
|
||||
llx = totalBBox.lowerX;
|
||||
lly = totalBBox.lowerY;
|
||||
llz = totalBBox.lowerZ;
|
||||
urx = totalBBox.upperX;
|
||||
ury = totalBBox.upperY;
|
||||
urz = totalBBox.upperZ;
|
||||
}
|
||||
|
||||
|
||||
void FTFont::BBox( const wchar_t* string,
|
||||
float& llx, float& lly, float& llz, float& urx, float& ury, float& urz)
|
||||
{
|
||||
FTBBox totalBBox;
|
||||
|
||||
if((NULL != string) && ('\0' != *string))
|
||||
{
|
||||
const wchar_t* c = string;
|
||||
|
||||
CheckGlyph( *c);
|
||||
|
||||
totalBBox = glyphList->BBox( *c);
|
||||
float advance = glyphList->Advance( *c, *(c + 1));
|
||||
++c;
|
||||
|
||||
while( *c)
|
||||
{
|
||||
CheckGlyph( *c);
|
||||
FTBBox tempBBox = glyphList->BBox( *c);
|
||||
tempBBox.Move( FTPoint( advance, 0.0f, 0.0f));
|
||||
totalBBox += tempBBox;
|
||||
advance += glyphList->Advance( *c, *(c + 1));
|
||||
++c;
|
||||
}
|
||||
}
|
||||
|
||||
llx = totalBBox.lowerX;
|
||||
lly = totalBBox.lowerY;
|
||||
llz = totalBBox.lowerZ;
|
||||
urx = totalBBox.upperX;
|
||||
ury = totalBBox.upperY;
|
||||
urz = totalBBox.upperZ;
|
||||
}
|
||||
|
||||
|
||||
float FTFont::Advance( const wchar_t* string)
|
||||
{
|
||||
const wchar_t* c = string;
|
||||
float width = 0.0f;
|
||||
|
||||
while( *c)
|
||||
{
|
||||
CheckGlyph( *c);
|
||||
width += glyphList->Advance( *c, *(c + 1));
|
||||
++c;
|
||||
}
|
||||
|
||||
return width;
|
||||
}
|
||||
|
||||
|
||||
float FTFont::Advance( const char* string)
|
||||
{
|
||||
const unsigned char* c = (unsigned char*)string;
|
||||
float width = 0.0f;
|
||||
|
||||
while( *c)
|
||||
{
|
||||
CheckGlyph( *c);
|
||||
width += glyphList->Advance( *c, *(c + 1));
|
||||
++c;
|
||||
}
|
||||
|
||||
return width;
|
||||
}
|
||||
|
||||
|
||||
void FTFont::Render( const char* string )
|
||||
{
|
||||
const unsigned char* c = (unsigned char*)string;
|
||||
pen.x = 0; pen.y = 0;
|
||||
|
||||
while( *c)
|
||||
{
|
||||
DoRender( *c, *(c + 1));
|
||||
++c;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void FTFont::Render( const wchar_t* string )
|
||||
{
|
||||
const wchar_t* c = string;
|
||||
pen.x = 0; pen.y = 0;
|
||||
|
||||
while( *c)
|
||||
{
|
||||
DoRender( *c, *(c + 1));
|
||||
++c;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void FTFont::DoRender( const unsigned int chr, const unsigned int nextChr)
|
||||
{
|
||||
CheckGlyph( chr);
|
||||
|
||||
FTPoint kernAdvance = glyphList->Render( chr, nextChr, pen);
|
||||
|
||||
pen.x += kernAdvance.x;
|
||||
pen.y += kernAdvance.y;
|
||||
}
|
||||
|
||||
|
||||
void FTFont::CheckGlyph( const unsigned int characterCode)
|
||||
{
|
||||
if( NULL == glyphList->Glyph( characterCode))
|
||||
{
|
||||
unsigned int glyphIndex = glyphList->FontIndex( characterCode);
|
||||
glyphList->Add( MakeGlyph( glyphIndex), characterCode);
|
||||
}
|
||||
}
|
||||
|
||||
66
extern/bFTGL/src/FTGLBitmapFont.cpp
vendored
66
extern/bFTGL/src/FTGLBitmapFont.cpp
vendored
@@ -1,66 +0,0 @@
|
||||
#include "FTGLBitmapFont.h"
|
||||
#include "FTBitmapGlyph.h"
|
||||
|
||||
|
||||
FTGLBitmapFont::FTGLBitmapFont( const char* fontname)
|
||||
: FTFont( fontname)
|
||||
{}
|
||||
|
||||
|
||||
FTGLBitmapFont::FTGLBitmapFont( const unsigned char *pBufferBytes, size_t bufferSizeInBytes)
|
||||
: FTFont( pBufferBytes, bufferSizeInBytes)
|
||||
{}
|
||||
|
||||
|
||||
FTGLBitmapFont::~FTGLBitmapFont()
|
||||
{}
|
||||
|
||||
|
||||
FTGlyph* FTGLBitmapFont::MakeGlyph( unsigned int g)
|
||||
{
|
||||
FT_GlyphSlot ftGlyph = face.Glyph( g, FT_LOAD_DEFAULT);
|
||||
|
||||
if( ftGlyph)
|
||||
{
|
||||
FTBitmapGlyph* tempGlyph = new FTBitmapGlyph( ftGlyph);
|
||||
return tempGlyph;
|
||||
}
|
||||
|
||||
err = face.Error();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
void FTGLBitmapFont::Render( const char* string)
|
||||
{
|
||||
glPushClientAttrib( GL_CLIENT_PIXEL_STORE_BIT);
|
||||
glPushAttrib( GL_ENABLE_BIT);
|
||||
|
||||
glPixelStorei( GL_UNPACK_LSB_FIRST, GL_FALSE);
|
||||
glPixelStorei( GL_UNPACK_ALIGNMENT, 1);
|
||||
|
||||
glDisable( GL_BLEND);
|
||||
|
||||
FTFont::Render( string);
|
||||
|
||||
glPopAttrib();
|
||||
glPopClientAttrib();
|
||||
}
|
||||
|
||||
|
||||
void FTGLBitmapFont::Render( const wchar_t* string)
|
||||
{
|
||||
glPushClientAttrib( GL_CLIENT_PIXEL_STORE_BIT);
|
||||
glPushAttrib( GL_ENABLE_BIT);
|
||||
|
||||
glPixelStorei( GL_UNPACK_LSB_FIRST, GL_FALSE);
|
||||
glPixelStorei( GL_UNPACK_ALIGNMENT, 1);
|
||||
|
||||
glDisable( GL_BLEND);
|
||||
|
||||
FTFont::Render( string);
|
||||
|
||||
glPopAttrib();
|
||||
glPopClientAttrib();
|
||||
}
|
||||
|
||||
53
extern/bFTGL/src/FTGLBufferFont.cpp
vendored
53
extern/bFTGL/src/FTGLBufferFont.cpp
vendored
@@ -1,53 +0,0 @@
|
||||
#include "FTGLBufferFont.h"
|
||||
#include "FTBufferGlyph.h"
|
||||
|
||||
|
||||
FTGLBufferFont::FTGLBufferFont( const char* fontname)
|
||||
: FTFont( fontname),
|
||||
buffer(0)
|
||||
{}
|
||||
|
||||
|
||||
FTGLBufferFont::FTGLBufferFont( const unsigned char *pBufferBytes, size_t bufferSizeInBytes)
|
||||
: FTFont( pBufferBytes, bufferSizeInBytes),
|
||||
buffer(0)
|
||||
{}
|
||||
|
||||
|
||||
FTGLBufferFont::~FTGLBufferFont()
|
||||
{}
|
||||
|
||||
|
||||
FTGlyph* FTGLBufferFont::MakeGlyph( unsigned int g)
|
||||
{
|
||||
FT_GlyphSlot ftGlyph = face.Glyph( g, FT_LOAD_NO_HINTING);
|
||||
|
||||
if( ftGlyph)
|
||||
{
|
||||
FTBufferGlyph* tempGlyph = new FTBufferGlyph( ftGlyph, buffer);
|
||||
return tempGlyph;
|
||||
}
|
||||
|
||||
err = face.Error();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
void FTGLBufferFont::Render( const char* string)
|
||||
{
|
||||
if( NULL != buffer)
|
||||
{
|
||||
FTFont::Render( string);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void FTGLBufferFont::Render( const wchar_t* string)
|
||||
{
|
||||
if( NULL != buffer)
|
||||
{
|
||||
FTFont::Render( string);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
35
extern/bFTGL/src/FTGLExtrdFont.cpp
vendored
35
extern/bFTGL/src/FTGLExtrdFont.cpp
vendored
@@ -1,35 +0,0 @@
|
||||
#include "FTGLExtrdFont.h"
|
||||
#include "FTExtrdGlyph.h"
|
||||
|
||||
|
||||
FTGLExtrdFont::FTGLExtrdFont( const char* fontname)
|
||||
: FTFont( fontname),
|
||||
depth( 0.0f)
|
||||
{}
|
||||
|
||||
|
||||
FTGLExtrdFont::FTGLExtrdFont( const unsigned char *pBufferBytes, size_t bufferSizeInBytes)
|
||||
: FTFont( pBufferBytes, bufferSizeInBytes),
|
||||
depth( 0.0f)
|
||||
{}
|
||||
|
||||
|
||||
FTGLExtrdFont::~FTGLExtrdFont()
|
||||
{}
|
||||
|
||||
|
||||
FTGlyph* FTGLExtrdFont::MakeGlyph( unsigned int glyphIndex)
|
||||
{
|
||||
FT_GlyphSlot ftGlyph = face.Glyph( glyphIndex, FT_LOAD_NO_HINTING);
|
||||
|
||||
if( ftGlyph)
|
||||
{
|
||||
FTExtrdGlyph* tempGlyph = new FTExtrdGlyph( ftGlyph, depth);
|
||||
return tempGlyph;
|
||||
}
|
||||
|
||||
err = face.Error();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
66
extern/bFTGL/src/FTGLOutlineFont.cpp
vendored
66
extern/bFTGL/src/FTGLOutlineFont.cpp
vendored
@@ -1,66 +0,0 @@
|
||||
#include "FTGLOutlineFont.h"
|
||||
#include "FTOutlineGlyph.h"
|
||||
|
||||
|
||||
FTGLOutlineFont::FTGLOutlineFont( const char* fontname)
|
||||
: FTFont( fontname)
|
||||
{}
|
||||
|
||||
|
||||
FTGLOutlineFont::FTGLOutlineFont( const unsigned char *pBufferBytes, size_t bufferSizeInBytes)
|
||||
: FTFont( pBufferBytes, bufferSizeInBytes)
|
||||
{}
|
||||
|
||||
|
||||
FTGLOutlineFont::~FTGLOutlineFont()
|
||||
{}
|
||||
|
||||
|
||||
FTGlyph* FTGLOutlineFont::MakeGlyph( unsigned int g)
|
||||
{
|
||||
FT_GlyphSlot ftGlyph = face.Glyph( g, FT_LOAD_NO_HINTING);
|
||||
|
||||
if( ftGlyph)
|
||||
{
|
||||
FTOutlineGlyph* tempGlyph = new FTOutlineGlyph( ftGlyph);
|
||||
return tempGlyph;
|
||||
}
|
||||
|
||||
err = face.Error();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
void FTGLOutlineFont::Render( const char* string)
|
||||
{
|
||||
glPushAttrib( GL_ENABLE_BIT | GL_HINT_BIT | GL_LINE_BIT | GL_COLOR_BUFFER_BIT);
|
||||
|
||||
glDisable( GL_TEXTURE_2D);
|
||||
|
||||
glEnable( GL_LINE_SMOOTH);
|
||||
glHint( GL_LINE_SMOOTH_HINT, GL_DONT_CARE);
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // GL_ONE
|
||||
|
||||
FTFont::Render( string);
|
||||
|
||||
glPopAttrib();
|
||||
}
|
||||
|
||||
|
||||
void FTGLOutlineFont::Render( const wchar_t* string)
|
||||
{
|
||||
glPushAttrib( GL_ENABLE_BIT | GL_HINT_BIT | GL_LINE_BIT | GL_COLOR_BUFFER_BIT);
|
||||
|
||||
glDisable( GL_TEXTURE_2D);
|
||||
|
||||
glEnable( GL_LINE_SMOOTH);
|
||||
glHint( GL_LINE_SMOOTH_HINT, GL_DONT_CARE);
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // GL_ONE
|
||||
|
||||
FTFont::Render( string);
|
||||
|
||||
glPopAttrib();
|
||||
}
|
||||
|
||||
68
extern/bFTGL/src/FTGLPixmapFont.cpp
vendored
68
extern/bFTGL/src/FTGLPixmapFont.cpp
vendored
@@ -1,68 +0,0 @@
|
||||
#include "FTGLPixmapFont.h"
|
||||
#include "FTPixmapGlyph.h"
|
||||
|
||||
|
||||
FTGLPixmapFont::FTGLPixmapFont( const char* fontname)
|
||||
: FTFont( fontname)
|
||||
{}
|
||||
|
||||
|
||||
FTGLPixmapFont::FTGLPixmapFont( const unsigned char *pBufferBytes, size_t bufferSizeInBytes)
|
||||
: FTFont( pBufferBytes, bufferSizeInBytes)
|
||||
{}
|
||||
|
||||
|
||||
FTGLPixmapFont::~FTGLPixmapFont()
|
||||
{}
|
||||
|
||||
|
||||
FTGlyph* FTGLPixmapFont::MakeGlyph( unsigned int g)
|
||||
{
|
||||
FT_GlyphSlot ftGlyph = face.Glyph( g, FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP);
|
||||
|
||||
if( ftGlyph)
|
||||
{
|
||||
FTPixmapGlyph* tempGlyph = new FTPixmapGlyph( ftGlyph);
|
||||
return tempGlyph;
|
||||
}
|
||||
|
||||
err = face.Error();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
void FTGLPixmapFont::Render( const char* string)
|
||||
{
|
||||
glPushAttrib( GL_ENABLE_BIT | GL_PIXEL_MODE_BIT | GL_COLOR_BUFFER_BIT);
|
||||
glPushClientAttrib( GL_CLIENT_PIXEL_STORE_BIT);
|
||||
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
glDisable( GL_TEXTURE_2D);
|
||||
|
||||
FTFont::Render( string);
|
||||
|
||||
glPopClientAttrib();
|
||||
glPopAttrib();
|
||||
}
|
||||
|
||||
|
||||
void FTGLPixmapFont::Render( const wchar_t* string)
|
||||
{
|
||||
//glPushAttrib( GL_ENABLE_BIT | GL_PIXEL_MODE_BIT | GL_COLOR_BUFFER_BIT);
|
||||
// glPushClientAttrib( GL_CLIENT_PIXEL_STORE_BIT);
|
||||
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
glDisable( GL_TEXTURE_2D);
|
||||
|
||||
FTFont::Render( string);
|
||||
|
||||
glDisable(GL_BLEND);
|
||||
// glPopClientAttrib();
|
||||
// glPopAttrib();
|
||||
}
|
||||
|
||||
|
||||
33
extern/bFTGL/src/FTGLPolygonFont.cpp
vendored
33
extern/bFTGL/src/FTGLPolygonFont.cpp
vendored
@@ -1,33 +0,0 @@
|
||||
#include "FTGLPolygonFont.h"
|
||||
#include "FTPolyGlyph.h"
|
||||
|
||||
|
||||
FTGLPolygonFont::FTGLPolygonFont( const char* fontname)
|
||||
: FTFont( fontname)
|
||||
{}
|
||||
|
||||
|
||||
FTGLPolygonFont::FTGLPolygonFont( const unsigned char *pBufferBytes, size_t bufferSizeInBytes)
|
||||
: FTFont( pBufferBytes, bufferSizeInBytes)
|
||||
{}
|
||||
|
||||
|
||||
FTGLPolygonFont::~FTGLPolygonFont()
|
||||
{}
|
||||
|
||||
|
||||
FTGlyph* FTGLPolygonFont::MakeGlyph( unsigned int g)
|
||||
{
|
||||
FT_GlyphSlot ftGlyph = face.Glyph( g, FT_LOAD_NO_HINTING);
|
||||
|
||||
if( ftGlyph)
|
||||
{
|
||||
FTPolyGlyph* tempGlyph = new FTPolyGlyph( ftGlyph);
|
||||
return tempGlyph;
|
||||
}
|
||||
|
||||
err = face.Error();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
178
extern/bFTGL/src/FTGLTextureFont.cpp
vendored
178
extern/bFTGL/src/FTGLTextureFont.cpp
vendored
@@ -1,178 +0,0 @@
|
||||
#include <string> // For memset
|
||||
|
||||
#include "FTGLTextureFont.h"
|
||||
#include "FTTextureGlyph.h"
|
||||
|
||||
|
||||
inline GLuint NextPowerOf2( GLuint in)
|
||||
{
|
||||
in -= 1;
|
||||
|
||||
in |= in >> 16;
|
||||
in |= in >> 8;
|
||||
in |= in >> 4;
|
||||
in |= in >> 2;
|
||||
in |= in >> 1;
|
||||
|
||||
return in + 1;
|
||||
}
|
||||
|
||||
|
||||
FTGLTextureFont::FTGLTextureFont( const char* fontname)
|
||||
: FTFont( fontname),
|
||||
maxTextSize(0),
|
||||
textureWidth(0),
|
||||
textureHeight(0),
|
||||
glyphHeight(0),
|
||||
glyphWidth(0),
|
||||
padding(3),
|
||||
xOffset(0),
|
||||
yOffset(0)
|
||||
{
|
||||
remGlyphs = numGlyphs = face.GlyphCount();
|
||||
}
|
||||
|
||||
|
||||
FTGLTextureFont::FTGLTextureFont( const unsigned char *pBufferBytes, size_t bufferSizeInBytes)
|
||||
: FTFont( pBufferBytes, bufferSizeInBytes),
|
||||
maxTextSize(0),
|
||||
textureWidth(0),
|
||||
textureHeight(0),
|
||||
glyphHeight(0),
|
||||
glyphWidth(0),
|
||||
padding(3),
|
||||
xOffset(0),
|
||||
yOffset(0)
|
||||
{
|
||||
remGlyphs = numGlyphs = face.GlyphCount();
|
||||
}
|
||||
|
||||
|
||||
FTGLTextureFont::~FTGLTextureFont()
|
||||
{
|
||||
glDeleteTextures( textureIDList.size(), (const GLuint*)&textureIDList[0]);
|
||||
}
|
||||
|
||||
|
||||
FTGlyph* FTGLTextureFont::MakeGlyph( unsigned int glyphIndex)
|
||||
{
|
||||
FT_GlyphSlot ftGlyph = face.Glyph( glyphIndex, FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP);
|
||||
|
||||
if( ftGlyph)
|
||||
{
|
||||
glyphHeight = static_cast<int>( charSize.Height());
|
||||
glyphWidth = static_cast<int>( charSize.Width());
|
||||
|
||||
if( textureIDList.empty())
|
||||
{
|
||||
textureIDList.push_back( CreateTexture());
|
||||
xOffset = yOffset = padding;
|
||||
}
|
||||
|
||||
if( xOffset > ( textureWidth - glyphWidth))
|
||||
{
|
||||
xOffset = padding;
|
||||
yOffset += glyphHeight;
|
||||
|
||||
if( yOffset > ( textureHeight - glyphHeight))
|
||||
{
|
||||
textureIDList.push_back( CreateTexture());
|
||||
yOffset = padding;
|
||||
}
|
||||
}
|
||||
|
||||
FTTextureGlyph* tempGlyph = new FTTextureGlyph( ftGlyph, textureIDList[textureIDList.size() - 1],
|
||||
xOffset, yOffset, textureWidth, textureHeight);
|
||||
xOffset += static_cast<int>( tempGlyph->BBox().upperX - tempGlyph->BBox().lowerX + padding);
|
||||
|
||||
--remGlyphs;
|
||||
return tempGlyph;
|
||||
}
|
||||
|
||||
err = face.Error();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
void FTGLTextureFont::CalculateTextureSize()
|
||||
{
|
||||
if( !maxTextSize)
|
||||
{
|
||||
glGetIntegerv( GL_MAX_TEXTURE_SIZE, (GLint*)&maxTextSize);
|
||||
}
|
||||
|
||||
textureWidth = NextPowerOf2( (remGlyphs * glyphWidth) + ( padding * 2));
|
||||
if( textureWidth > maxTextSize)
|
||||
{
|
||||
textureWidth = maxTextSize;
|
||||
}
|
||||
|
||||
int h = static_cast<int>( (textureWidth - ( padding * 2)) / glyphWidth);
|
||||
|
||||
textureHeight = NextPowerOf2( (( numGlyphs / h) + 1) * glyphHeight);
|
||||
textureHeight = textureHeight > maxTextSize ? maxTextSize : textureHeight;
|
||||
}
|
||||
|
||||
|
||||
GLuint FTGLTextureFont::CreateTexture()
|
||||
{
|
||||
CalculateTextureSize();
|
||||
|
||||
int totalMemory = textureWidth * textureHeight;
|
||||
unsigned char* textureMemory = new unsigned char[totalMemory];
|
||||
memset( textureMemory, 0, totalMemory);
|
||||
|
||||
GLuint textID;
|
||||
glGenTextures( 1, (GLuint*)&textID);
|
||||
|
||||
glBindTexture( GL_TEXTURE_2D, textID);
|
||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
|
||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
|
||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
|
||||
glTexImage2D( GL_TEXTURE_2D, 0, GL_ALPHA, textureWidth, textureHeight, 0, GL_ALPHA, GL_UNSIGNED_BYTE, textureMemory);
|
||||
|
||||
delete [] textureMemory;
|
||||
|
||||
return textID;
|
||||
}
|
||||
|
||||
|
||||
bool FTGLTextureFont::FaceSize( const unsigned int size, const unsigned int res)
|
||||
{
|
||||
if( !textureIDList.empty())
|
||||
{
|
||||
glDeleteTextures( textureIDList.size(), (const GLuint*)&textureIDList[0]);
|
||||
remGlyphs = numGlyphs = face.GlyphCount();
|
||||
}
|
||||
|
||||
return FTFont::FaceSize( size, res);
|
||||
}
|
||||
|
||||
|
||||
void FTGLTextureFont::Render( const char* string)
|
||||
{
|
||||
// glPushAttrib( GL_ENABLE_BIT | GL_COLOR_BUFFER_BIT);
|
||||
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // GL_ONE
|
||||
|
||||
FTFont::Render( string);
|
||||
|
||||
// glPopAttrib();
|
||||
}
|
||||
|
||||
|
||||
void FTGLTextureFont::Render( const wchar_t* string)
|
||||
{
|
||||
// glPushAttrib( GL_ENABLE_BIT | GL_COLOR_BUFFER_BIT);
|
||||
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // GL_ONE
|
||||
|
||||
FTFont::Render( string);
|
||||
|
||||
// glPopAttrib();
|
||||
}
|
||||
|
||||
17
extern/bFTGL/src/FTGlyph.cpp
vendored
17
extern/bFTGL/src/FTGlyph.cpp
vendored
@@ -1,17 +0,0 @@
|
||||
#include "FTGlyph.h"
|
||||
|
||||
|
||||
FTGlyph::FTGlyph( FT_GlyphSlot glyph)
|
||||
: advance(0.0f),
|
||||
err(0)
|
||||
{
|
||||
if( glyph)
|
||||
{
|
||||
bBox = FTBBox( glyph);
|
||||
advance = static_cast<float>( glyph->advance.x) / 64.0f;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
FTGlyph::~FTGlyph()
|
||||
{}
|
||||
93
extern/bFTGL/src/FTGlyphContainer.cpp
vendored
93
extern/bFTGL/src/FTGlyphContainer.cpp
vendored
@@ -1,93 +0,0 @@
|
||||
#include "FTGlyphContainer.h"
|
||||
#include "FTGlyph.h"
|
||||
#include "FTFace.h"
|
||||
#include "FTCharmap.h"
|
||||
|
||||
|
||||
FTGlyphContainer::FTGlyphContainer( FTFace* f)
|
||||
: face(f),
|
||||
err(0)
|
||||
{
|
||||
glyphs.push_back( NULL);
|
||||
charMap = new FTCharmap( face);
|
||||
}
|
||||
|
||||
|
||||
FTGlyphContainer::~FTGlyphContainer()
|
||||
{
|
||||
GlyphVector::iterator glyphIterator;
|
||||
for( glyphIterator = glyphs.begin(); glyphIterator != glyphs.end(); ++glyphIterator)
|
||||
{
|
||||
delete *glyphIterator;
|
||||
}
|
||||
|
||||
glyphs.clear();
|
||||
delete charMap;
|
||||
}
|
||||
|
||||
|
||||
bool FTGlyphContainer::CharMap( FT_Encoding encoding)
|
||||
{
|
||||
bool result = charMap->CharMap( encoding);
|
||||
err = charMap->Error();
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
unsigned int FTGlyphContainer::FontIndex( const unsigned int characterCode) const
|
||||
{
|
||||
return charMap->FontIndex( characterCode);
|
||||
}
|
||||
|
||||
|
||||
void FTGlyphContainer::Add( FTGlyph* tempGlyph, const unsigned int characterCode)
|
||||
{
|
||||
charMap->InsertIndex( characterCode, glyphs.size());
|
||||
glyphs.push_back( tempGlyph);
|
||||
}
|
||||
|
||||
|
||||
const FTGlyph* const FTGlyphContainer::Glyph( const unsigned int characterCode) const
|
||||
{
|
||||
signed int index = charMap->GlyphListIndex( characterCode);
|
||||
return glyphs[index];
|
||||
}
|
||||
|
||||
|
||||
FTBBox FTGlyphContainer::BBox( const unsigned int characterCode) const
|
||||
{
|
||||
return glyphs[charMap->GlyphListIndex( characterCode)]->BBox();
|
||||
}
|
||||
|
||||
|
||||
float FTGlyphContainer::Advance( const unsigned int characterCode, const unsigned int nextCharacterCode)
|
||||
{
|
||||
unsigned int left = charMap->FontIndex( characterCode);
|
||||
unsigned int right = charMap->FontIndex( nextCharacterCode);
|
||||
|
||||
float width = face->KernAdvance( left, right).x;
|
||||
width += glyphs[charMap->GlyphListIndex( characterCode)]->Advance();
|
||||
|
||||
return width;
|
||||
}
|
||||
|
||||
|
||||
FTPoint FTGlyphContainer::Render( const unsigned int characterCode, const unsigned int nextCharacterCode, FTPoint penPosition)
|
||||
{
|
||||
FTPoint kernAdvance;
|
||||
float advance = 0;
|
||||
|
||||
unsigned int left = charMap->FontIndex( characterCode);
|
||||
unsigned int right = charMap->FontIndex( nextCharacterCode);
|
||||
|
||||
kernAdvance = face->KernAdvance( left, right);
|
||||
|
||||
if( !face->Error())
|
||||
{
|
||||
advance = glyphs[charMap->GlyphListIndex( characterCode)]->Render( penPosition);
|
||||
}
|
||||
|
||||
kernAdvance.x = advance + kernAdvance.x;
|
||||
// kernAdvance.y = advance.y + kernAdvance.y;
|
||||
return kernAdvance;
|
||||
}
|
||||
64
extern/bFTGL/src/FTLibrary.cpp
vendored
64
extern/bFTGL/src/FTLibrary.cpp
vendored
@@ -1,64 +0,0 @@
|
||||
#include "FTLibrary.h"
|
||||
|
||||
|
||||
FTLibrary& FTLibrary::Instance()
|
||||
{
|
||||
static FTLibrary ftlib;
|
||||
return ftlib;
|
||||
}
|
||||
|
||||
|
||||
FTLibrary::~FTLibrary()
|
||||
{
|
||||
if( library != 0)
|
||||
{
|
||||
FT_Done_FreeType( *library);
|
||||
|
||||
delete library;
|
||||
library= 0;
|
||||
}
|
||||
|
||||
// if( manager != 0)
|
||||
// {
|
||||
// FTC_Manager_Done( manager );
|
||||
//
|
||||
// delete manager;
|
||||
// manager= 0;
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
FTLibrary::FTLibrary()
|
||||
: library(0),
|
||||
err(0)
|
||||
{
|
||||
Initialise();
|
||||
}
|
||||
|
||||
|
||||
bool FTLibrary::Initialise()
|
||||
{
|
||||
if( library != 0)
|
||||
return true;
|
||||
|
||||
library = new FT_Library;
|
||||
|
||||
err = FT_Init_FreeType( library);
|
||||
if( err)
|
||||
{
|
||||
delete library;
|
||||
library = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
// FTC_Manager* manager;
|
||||
//
|
||||
// if( FTC_Manager_New( lib, 0, 0, 0, my_face_requester, 0, manager )
|
||||
// {
|
||||
// delete manager;
|
||||
// manager= 0;
|
||||
// return false;
|
||||
// }
|
||||
|
||||
return true;
|
||||
}
|
||||
57
extern/bFTGL/src/FTOutlineGlyph.cpp
vendored
57
extern/bFTGL/src/FTOutlineGlyph.cpp
vendored
@@ -1,57 +0,0 @@
|
||||
#include "FTOutlineGlyph.h"
|
||||
#include "FTVectoriser.h"
|
||||
|
||||
|
||||
FTOutlineGlyph::FTOutlineGlyph( FT_GlyphSlot glyph)
|
||||
: FTGlyph( glyph),
|
||||
glList(0)
|
||||
{
|
||||
if( ft_glyph_format_outline != glyph->format)
|
||||
{
|
||||
err = 0x14; // Invalid_Outline
|
||||
return;
|
||||
}
|
||||
|
||||
FTVectoriser vectoriser( glyph);
|
||||
|
||||
size_t numContours = vectoriser.ContourCount();
|
||||
if ( ( numContours < 1) || ( vectoriser.PointCount() < 3))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
glList = glGenLists(1);
|
||||
glNewList( glList, GL_COMPILE);
|
||||
for( unsigned int c = 0; c < numContours; ++c)
|
||||
{
|
||||
const FTContour* contour = vectoriser.Contour(c);
|
||||
|
||||
glBegin( GL_LINE_LOOP);
|
||||
for( unsigned int p = 0; p < contour->PointCount(); ++p)
|
||||
{
|
||||
glVertex2f( contour->Point(p).x / 64.0f, contour->Point(p).y / 64.0f);
|
||||
}
|
||||
glEnd();
|
||||
}
|
||||
glEndList();
|
||||
}
|
||||
|
||||
|
||||
FTOutlineGlyph::~FTOutlineGlyph()
|
||||
{
|
||||
glDeleteLists( glList, 1);
|
||||
}
|
||||
|
||||
|
||||
float FTOutlineGlyph::Render( const FTPoint& pen)
|
||||
{
|
||||
if( glList)
|
||||
{
|
||||
glTranslatef( pen.x, pen.y, 0);
|
||||
glCallList( glList);
|
||||
glTranslatef( -pen.x, -pen.y, 0);
|
||||
}
|
||||
|
||||
return advance;
|
||||
}
|
||||
|
||||
109
extern/bFTGL/src/FTPixmapGlyph.cpp
vendored
109
extern/bFTGL/src/FTPixmapGlyph.cpp
vendored
@@ -1,109 +0,0 @@
|
||||
#include "FTPixmapGlyph.h"
|
||||
|
||||
FTPixmapGlyph::FTPixmapGlyph( FT_GlyphSlot glyph)
|
||||
: FTGlyph( glyph),
|
||||
destWidth(0),
|
||||
destHeight(0),
|
||||
data(0)
|
||||
{
|
||||
err = FT_Render_Glyph( glyph, FT_RENDER_MODE_NORMAL);
|
||||
if( err || ft_glyph_format_bitmap != glyph->format)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
FT_Bitmap bitmap = glyph->bitmap;
|
||||
|
||||
//check the pixel mode
|
||||
//ft_pixel_mode_grays
|
||||
|
||||
int srcWidth = bitmap.width;
|
||||
int srcHeight = bitmap.rows;
|
||||
|
||||
// FIXME What about dest alignment?
|
||||
destWidth = srcWidth;
|
||||
destHeight = srcHeight;
|
||||
|
||||
if( destWidth && destHeight)
|
||||
{
|
||||
data = new unsigned char[destWidth * destHeight * 4];
|
||||
|
||||
// Get the current glColor.
|
||||
float ftglColour[4];
|
||||
// glGetFloatv( GL_CURRENT_COLOR, ftglColour);
|
||||
ftglColour[0] = ftglColour[1] = ftglColour[2] = ftglColour[3] = 1.0;
|
||||
|
||||
unsigned char redComponent = static_cast<unsigned char>( ftglColour[0] * 255.0f);
|
||||
unsigned char greenComponent = static_cast<unsigned char>( ftglColour[1] * 255.0f);
|
||||
unsigned char blueComponent = static_cast<unsigned char>( ftglColour[2] * 255.0f);
|
||||
|
||||
unsigned char* src = bitmap.buffer;
|
||||
|
||||
unsigned char* dest = data + ((destHeight - 1) * destWidth) * 4;
|
||||
size_t destStep = destWidth * 4 * 2;
|
||||
|
||||
if( ftglColour[3] == 1.0f)
|
||||
{
|
||||
for( int y = 0; y < srcHeight; ++y)
|
||||
{
|
||||
for( int x = 0; x < srcWidth; ++x)
|
||||
{
|
||||
*dest++ = redComponent;
|
||||
*dest++ = greenComponent;
|
||||
*dest++ = blueComponent;
|
||||
*dest++ = *src++;
|
||||
}
|
||||
dest -= destStep;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for( int y = 0; y < srcHeight; ++y)
|
||||
{
|
||||
for( int x = 0; x < srcWidth; ++x)
|
||||
{
|
||||
*dest++ = redComponent;
|
||||
*dest++ = greenComponent;
|
||||
*dest++ = blueComponent;
|
||||
*dest++ = static_cast<unsigned char>(ftglColour[3] * *src++);
|
||||
}
|
||||
dest -= destStep;
|
||||
}
|
||||
}
|
||||
|
||||
destHeight = srcHeight;
|
||||
}
|
||||
|
||||
pos.x = glyph->bitmap_left;
|
||||
pos.y = srcHeight - glyph->bitmap_top;
|
||||
}
|
||||
|
||||
|
||||
FTPixmapGlyph::~FTPixmapGlyph()
|
||||
{
|
||||
delete [] data;
|
||||
}
|
||||
|
||||
#include <math.h>
|
||||
float FTPixmapGlyph::Render( const FTPoint& pen)
|
||||
{
|
||||
if( data)
|
||||
{
|
||||
float dx, dy;
|
||||
|
||||
dx= floor( (pen.x + pos.x ) );
|
||||
dy= ( (pen.y - pos.y ) );
|
||||
|
||||
// Move the glyph origin
|
||||
glBitmap( 0, 0, 0.0f, 0.0f, dx, dy, (const GLubyte*)0);
|
||||
|
||||
glPixelStorei( GL_UNPACK_ROW_LENGTH, 0);
|
||||
|
||||
glDrawPixels( destWidth, destHeight, GL_RGBA, GL_UNSIGNED_BYTE, (const GLvoid*)data);
|
||||
|
||||
// Restore the glyph origin
|
||||
glBitmap( 0, 0, 0.0f, 0.0f, -dx, -dy, (const GLubyte*)0);
|
||||
}
|
||||
|
||||
return advance;
|
||||
}
|
||||
14
extern/bFTGL/src/FTPoint.cpp
vendored
14
extern/bFTGL/src/FTPoint.cpp
vendored
@@ -1,14 +0,0 @@
|
||||
#include "FTPoint.h"
|
||||
|
||||
|
||||
bool operator == ( const FTPoint &a, const FTPoint &b)
|
||||
{
|
||||
return((a.x == b.x) && (a.y == b.y) && (a.z == b.z));
|
||||
}
|
||||
|
||||
bool operator != ( const FTPoint &a, const FTPoint &b)
|
||||
{
|
||||
return((a.x != b.x) || (a.y != b.y) || (a.z != b.z));
|
||||
}
|
||||
|
||||
|
||||
62
extern/bFTGL/src/FTPolyGlyph.cpp
vendored
62
extern/bFTGL/src/FTPolyGlyph.cpp
vendored
@@ -1,62 +0,0 @@
|
||||
#include "FTPolyGlyph.h"
|
||||
#include "FTVectoriser.h"
|
||||
|
||||
|
||||
FTPolyGlyph::FTPolyGlyph( FT_GlyphSlot glyph)
|
||||
: FTGlyph( glyph),
|
||||
glList(0)
|
||||
{
|
||||
if( ft_glyph_format_outline != glyph->format)
|
||||
{
|
||||
err = 0x14; // Invalid_Outline
|
||||
return;
|
||||
}
|
||||
|
||||
FTVectoriser vectoriser( glyph);
|
||||
|
||||
if(( vectoriser.ContourCount() < 1) || ( vectoriser.PointCount() < 3))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
vectoriser.MakeMesh( 1.0);
|
||||
|
||||
glList = glGenLists( 1);
|
||||
glNewList( glList, GL_COMPILE);
|
||||
|
||||
const FTMesh* mesh = vectoriser.GetMesh();
|
||||
for( unsigned int index = 0; index < mesh->TesselationCount(); ++index)
|
||||
{
|
||||
const FTTesselation* subMesh = mesh->Tesselation( index);
|
||||
unsigned int polyonType = subMesh->PolygonType();
|
||||
|
||||
glBegin( polyonType);
|
||||
for( unsigned int x = 0; x < subMesh->PointCount(); ++x)
|
||||
{
|
||||
glVertex3f( subMesh->Point(x).x / 64.0f,
|
||||
subMesh->Point(x).y / 64.0f,
|
||||
0.0f);
|
||||
}
|
||||
glEnd();
|
||||
}
|
||||
glEndList();
|
||||
}
|
||||
|
||||
|
||||
FTPolyGlyph::~FTPolyGlyph()
|
||||
{
|
||||
glDeleteLists( glList, 1);
|
||||
}
|
||||
|
||||
|
||||
float FTPolyGlyph::Render( const FTPoint& pen)
|
||||
{
|
||||
if( glList)
|
||||
{
|
||||
glTranslatef( pen.x, pen.y, 0);
|
||||
glCallList( glList);
|
||||
glTranslatef( -pen.x, -pen.y, 0);
|
||||
}
|
||||
|
||||
return advance;
|
||||
}
|
||||
105
extern/bFTGL/src/FTSize.cpp
vendored
105
extern/bFTGL/src/FTSize.cpp
vendored
@@ -1,105 +0,0 @@
|
||||
#include "FTSize.h"
|
||||
|
||||
|
||||
FTSize::FTSize()
|
||||
: ftFace(0),
|
||||
ftSize(0),
|
||||
size(0),
|
||||
err(0)
|
||||
{}
|
||||
|
||||
|
||||
FTSize::~FTSize()
|
||||
{}
|
||||
|
||||
|
||||
bool FTSize::CharSize( FT_Face* face, unsigned int point_size, unsigned int x_resolution, unsigned int y_resolution )
|
||||
{
|
||||
err = FT_Set_Char_Size( *face, 0L, point_size * 64, x_resolution, y_resolution);
|
||||
|
||||
if( !err)
|
||||
{
|
||||
ftFace = face;
|
||||
size = point_size;
|
||||
ftSize = (*ftFace)->size;
|
||||
}
|
||||
else
|
||||
{
|
||||
ftFace = 0;
|
||||
size = 0;
|
||||
ftSize = 0;
|
||||
}
|
||||
|
||||
return !err;
|
||||
}
|
||||
|
||||
|
||||
unsigned int FTSize::CharSize() const
|
||||
{
|
||||
return size;
|
||||
}
|
||||
|
||||
|
||||
float FTSize::Ascender() const
|
||||
{
|
||||
return ftSize == 0 ? 0.0f : static_cast<float>( ftSize->metrics.ascender) / 64.0f;
|
||||
}
|
||||
|
||||
|
||||
float FTSize::Descender() const
|
||||
{
|
||||
return ftSize == 0 ? 0.0f : static_cast<float>( ftSize->metrics.descender) / 64.0f;
|
||||
}
|
||||
|
||||
|
||||
float FTSize::Height() const
|
||||
{
|
||||
if( 0 == ftSize)
|
||||
{
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
if( FT_IS_SCALABLE((*ftFace)))
|
||||
{
|
||||
return ( (*ftFace)->bbox.yMax - (*ftFace)->bbox.yMin) * ( (float)ftSize->metrics.y_ppem / (float)(*ftFace)->units_per_EM);
|
||||
}
|
||||
else
|
||||
{
|
||||
return static_cast<float>( ftSize->metrics.height) / 64.0f;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
float FTSize::Width() const
|
||||
{
|
||||
if( 0 == ftSize)
|
||||
{
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
if( FT_IS_SCALABLE((*ftFace)))
|
||||
{
|
||||
return ( (*ftFace)->bbox.xMax - (*ftFace)->bbox.xMin) * ( static_cast<float>(ftSize->metrics.x_ppem) / static_cast<float>((*ftFace)->units_per_EM));
|
||||
}
|
||||
else
|
||||
{
|
||||
return static_cast<float>( ftSize->metrics.max_advance) / 64.0f;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
float FTSize::Underline() const
|
||||
{
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
unsigned int FTSize::XPixelsPerEm() const
|
||||
{
|
||||
return ftSize == 0 ? 0 : ftSize->metrics.x_ppem;
|
||||
}
|
||||
|
||||
unsigned int FTSize::YPixelsPerEm() const
|
||||
{
|
||||
return ftSize == 0 ? 0 : ftSize->metrics.y_ppem;
|
||||
}
|
||||
|
||||
87
extern/bFTGL/src/FTTextureGlyph.cpp
vendored
87
extern/bFTGL/src/FTTextureGlyph.cpp
vendored
@@ -1,87 +0,0 @@
|
||||
#include "FTTextureGlyph.h"
|
||||
|
||||
|
||||
FTTextureGlyph::FTTextureGlyph( FT_GlyphSlot glyph, int id, int xOffset, int yOffset, GLsizei width, GLsizei height)
|
||||
: FTGlyph( glyph),
|
||||
destWidth(0),
|
||||
destHeight(0),
|
||||
glTextureID(id),
|
||||
activeTextureID(0)
|
||||
{
|
||||
err = FT_Render_Glyph( glyph, FT_RENDER_MODE_NORMAL);
|
||||
if( err || glyph->format != ft_glyph_format_bitmap)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
FT_Bitmap bitmap = glyph->bitmap;
|
||||
|
||||
destWidth = bitmap.width;
|
||||
destHeight = bitmap.rows;
|
||||
|
||||
if( destWidth && destHeight)
|
||||
{
|
||||
glPushClientAttrib( GL_CLIENT_PIXEL_STORE_BIT);
|
||||
glPixelStorei( GL_UNPACK_LSB_FIRST, GL_FALSE);
|
||||
glPixelStorei( GL_UNPACK_ROW_LENGTH, 0);
|
||||
glPixelStorei( GL_UNPACK_ALIGNMENT, 1);
|
||||
|
||||
glBindTexture( GL_TEXTURE_2D, glTextureID);
|
||||
glTexSubImage2D( GL_TEXTURE_2D, 0, xOffset, yOffset, destWidth, destHeight, GL_ALPHA, GL_UNSIGNED_BYTE, bitmap.buffer);
|
||||
|
||||
glPopClientAttrib();
|
||||
}
|
||||
|
||||
|
||||
// 0
|
||||
// +----+
|
||||
// | |
|
||||
// | |
|
||||
// | |
|
||||
// +----+
|
||||
// 1
|
||||
|
||||
uv[0].x = static_cast<float>(xOffset) / static_cast<float>(width);
|
||||
uv[0].y = static_cast<float>(yOffset) / static_cast<float>(height);
|
||||
uv[1].x = static_cast<float>( xOffset + destWidth) / static_cast<float>(width);
|
||||
uv[1].y = static_cast<float>( yOffset + destHeight) / static_cast<float>(height);
|
||||
|
||||
pos.x = glyph->bitmap_left;
|
||||
pos.y = glyph->bitmap_top;
|
||||
}
|
||||
|
||||
|
||||
FTTextureGlyph::~FTTextureGlyph()
|
||||
{}
|
||||
|
||||
#include <math.h>
|
||||
|
||||
float FTTextureGlyph::Render( const FTPoint& pen)
|
||||
{
|
||||
float dx;
|
||||
|
||||
glGetIntegerv( GL_TEXTURE_2D_BINDING_EXT, &activeTextureID);
|
||||
if( activeTextureID != glTextureID)
|
||||
{
|
||||
glBindTexture( GL_TEXTURE_2D, (GLuint)glTextureID);
|
||||
}
|
||||
|
||||
dx= floor( (pen.x + pos.x ) );
|
||||
|
||||
glBegin( GL_QUADS);
|
||||
glTexCoord2f( uv[0].x, uv[0].y);
|
||||
glVertex2f( dx, pen.y + pos.y);
|
||||
|
||||
glTexCoord2f( uv[0].x, uv[1].y);
|
||||
glVertex2f( dx, pen.y + pos.y - destHeight);
|
||||
|
||||
glTexCoord2f( uv[1].x, uv[1].y);
|
||||
glVertex2f( dx + destWidth, pen.y + pos.y - destHeight);
|
||||
|
||||
glTexCoord2f( uv[1].x, uv[0].y);
|
||||
glVertex2f( dx + destWidth, pen.y + pos.y);
|
||||
glEnd();
|
||||
|
||||
return advance;
|
||||
}
|
||||
|
||||
229
extern/bFTGL/src/FTVectoriser.cpp
vendored
229
extern/bFTGL/src/FTVectoriser.cpp
vendored
@@ -1,229 +0,0 @@
|
||||
#include "FTVectoriser.h"
|
||||
#include "FTGL.h"
|
||||
|
||||
#ifndef CALLBACK
|
||||
#define CALLBACK
|
||||
#endif
|
||||
|
||||
#if defined(__APPLE_CC__)
|
||||
#if __APPLE_CC__ >= 5465
|
||||
typedef GLvoid (*GLUTesselatorFunction)();
|
||||
#else
|
||||
typedef GLvoid (*GLUTesselatorFunction)(...);
|
||||
#endif
|
||||
#elif defined( __mips ) || defined( __linux__ ) || defined( __FreeBSD__ ) || defined( __OpenBSD__ ) || defined( __sun ) || defined (__CYGWIN__)
|
||||
typedef GLvoid (*GLUTesselatorFunction)();
|
||||
#elif defined ( WIN32)
|
||||
typedef GLvoid (CALLBACK *GLUTesselatorFunction)( );
|
||||
#else
|
||||
#error "Error - need to define type GLUTesselatorFunction for this platform/compiler"
|
||||
#endif
|
||||
|
||||
|
||||
void CALLBACK ftglError( GLenum errCode, FTMesh* mesh)
|
||||
{
|
||||
mesh->Error( errCode);
|
||||
}
|
||||
|
||||
|
||||
void CALLBACK ftglVertex( void* data, FTMesh* mesh)
|
||||
{
|
||||
FTGL_DOUBLE* vertex = static_cast<FTGL_DOUBLE*>(data);
|
||||
mesh->AddPoint( vertex[0], vertex[1], vertex[2]);
|
||||
}
|
||||
|
||||
|
||||
void CALLBACK ftglCombine( FTGL_DOUBLE coords[3], void* vertex_data[4], GLfloat weight[4], void** outData, FTMesh* mesh)
|
||||
{
|
||||
FTGL_DOUBLE* vertex = static_cast<FTGL_DOUBLE*>(coords);
|
||||
*outData = mesh->Combine( vertex[0], vertex[1], vertex[2]);
|
||||
}
|
||||
|
||||
|
||||
void CALLBACK ftglBegin( GLenum type, FTMesh* mesh)
|
||||
{
|
||||
mesh->Begin( type);
|
||||
}
|
||||
|
||||
|
||||
void CALLBACK ftglEnd( FTMesh* mesh)
|
||||
{
|
||||
mesh->End();
|
||||
}
|
||||
|
||||
|
||||
FTMesh::FTMesh()
|
||||
: currentTesselation(0),
|
||||
err(0)
|
||||
{
|
||||
tesselationList.reserve( 16);
|
||||
}
|
||||
|
||||
|
||||
FTMesh::~FTMesh()
|
||||
{
|
||||
for( size_t t = 0; t < tesselationList.size(); ++t)
|
||||
{
|
||||
delete tesselationList[t];
|
||||
}
|
||||
|
||||
tesselationList.clear();
|
||||
}
|
||||
|
||||
|
||||
void FTMesh::AddPoint( const FTGL_DOUBLE x, const FTGL_DOUBLE y, const FTGL_DOUBLE z)
|
||||
{
|
||||
currentTesselation->AddPoint( x, y, z);
|
||||
}
|
||||
|
||||
|
||||
FTGL_DOUBLE* FTMesh::Combine( const FTGL_DOUBLE x, const FTGL_DOUBLE y, const FTGL_DOUBLE z)
|
||||
{
|
||||
tempPointList.push_back( FTPoint( x, y,z));
|
||||
return &tempPointList.back().x;
|
||||
}
|
||||
|
||||
|
||||
void FTMesh::Begin( GLenum meshType)
|
||||
{
|
||||
currentTesselation = new FTTesselation( meshType);
|
||||
}
|
||||
|
||||
|
||||
void FTMesh::End()
|
||||
{
|
||||
tesselationList.push_back( currentTesselation);
|
||||
}
|
||||
|
||||
|
||||
const FTTesselation* const FTMesh::Tesselation( unsigned int index) const
|
||||
{
|
||||
return ( index < tesselationList.size()) ? tesselationList[index] : NULL;
|
||||
}
|
||||
|
||||
|
||||
FTVectoriser::FTVectoriser( const FT_GlyphSlot glyph)
|
||||
: contourList(0),
|
||||
mesh(0),
|
||||
ftContourCount(0),
|
||||
contourFlag(0)
|
||||
{
|
||||
if( glyph)
|
||||
{
|
||||
outline = glyph->outline;
|
||||
|
||||
ftContourCount = outline.n_contours;;
|
||||
contourList = 0;
|
||||
contourFlag = outline.flags;
|
||||
|
||||
ProcessContours();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
FTVectoriser::~FTVectoriser()
|
||||
{
|
||||
for( size_t c = 0; c < ContourCount(); ++c)
|
||||
{
|
||||
delete contourList[c];
|
||||
}
|
||||
|
||||
delete [] contourList;
|
||||
delete mesh;
|
||||
}
|
||||
|
||||
|
||||
void FTVectoriser::ProcessContours()
|
||||
{
|
||||
short contourLength = 0;
|
||||
short startIndex = 0;
|
||||
short endIndex = 0;
|
||||
|
||||
contourList = new FTContour*[ftContourCount];
|
||||
|
||||
for( short contourIndex = 0; contourIndex < ftContourCount; ++contourIndex)
|
||||
{
|
||||
FT_Vector* pointList = &outline.points[startIndex];
|
||||
char* tagList = &outline.tags[startIndex];
|
||||
|
||||
endIndex = outline.contours[contourIndex];
|
||||
contourLength = ( endIndex - startIndex) + 1;
|
||||
|
||||
FTContour* contour = new FTContour( pointList, tagList, contourLength);
|
||||
|
||||
contourList[contourIndex] = contour;
|
||||
|
||||
startIndex = endIndex + 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
size_t FTVectoriser::PointCount()
|
||||
{
|
||||
size_t s = 0;
|
||||
for( size_t c = 0; c < ContourCount(); ++c)
|
||||
{
|
||||
s += contourList[c]->PointCount();
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
const FTContour* const FTVectoriser::Contour( unsigned int index) const
|
||||
{
|
||||
return ( index < ContourCount()) ? contourList[index] : NULL;
|
||||
}
|
||||
|
||||
|
||||
void FTVectoriser::MakeMesh( FTGL_DOUBLE zNormal)
|
||||
{
|
||||
if( mesh)
|
||||
{
|
||||
delete mesh;
|
||||
}
|
||||
|
||||
mesh = new FTMesh;
|
||||
|
||||
GLUtesselator* tobj = gluNewTess();
|
||||
|
||||
gluTessCallback( tobj, GLU_TESS_BEGIN_DATA, (GLUTesselatorFunction)ftglBegin);
|
||||
gluTessCallback( tobj, GLU_TESS_VERTEX_DATA, (GLUTesselatorFunction)ftglVertex);
|
||||
gluTessCallback( tobj, GLU_TESS_COMBINE_DATA, (GLUTesselatorFunction)ftglCombine);
|
||||
gluTessCallback( tobj, GLU_TESS_END_DATA, (GLUTesselatorFunction)ftglEnd);
|
||||
gluTessCallback( tobj, GLU_TESS_ERROR_DATA, (GLUTesselatorFunction)ftglError);
|
||||
|
||||
if( contourFlag & ft_outline_even_odd_fill) // ft_outline_reverse_fill
|
||||
{
|
||||
gluTessProperty( tobj, GLU_TESS_WINDING_RULE, GLU_TESS_WINDING_ODD);
|
||||
}
|
||||
else
|
||||
{
|
||||
gluTessProperty( tobj, GLU_TESS_WINDING_RULE, GLU_TESS_WINDING_NONZERO);
|
||||
}
|
||||
|
||||
|
||||
gluTessProperty( tobj, GLU_TESS_TOLERANCE, 0);
|
||||
gluTessNormal( tobj, 0.0f, 0.0f, zNormal);
|
||||
gluTessBeginPolygon( tobj, mesh);
|
||||
|
||||
for( size_t c = 0; c < ContourCount(); ++c)
|
||||
{
|
||||
const FTContour* contour = contourList[c];
|
||||
|
||||
gluTessBeginContour( tobj);
|
||||
|
||||
for( size_t p = 0; p < contour->PointCount(); ++p)
|
||||
{
|
||||
FTGL_DOUBLE* d = const_cast<FTGL_DOUBLE*>(&contour->Point(p).x);
|
||||
gluTessVertex( tobj, d, d);
|
||||
}
|
||||
|
||||
gluTessEndContour( tobj);
|
||||
}
|
||||
|
||||
gluTessEndPolygon( tobj);
|
||||
|
||||
gluDeleteTess( tobj);
|
||||
}
|
||||
|
||||
60
extern/bFTGL/src/Makefile
vendored
60
extern/bFTGL/src/Makefile
vendored
@@ -1,60 +0,0 @@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
# ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
# 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): none yet.
|
||||
#
|
||||
# ***** END GPL LICENSE BLOCK *****
|
||||
#
|
||||
#
|
||||
|
||||
LIBNAME = ftgl
|
||||
DIR = $(OCGDIR)/extern/$(LIBNAME)
|
||||
|
||||
CCFLAGS += $(LEVEL_1_CPP_WARNINGS)
|
||||
|
||||
CSRCS =
|
||||
CCSRCS = FTBitmapGlyph.cpp FTCharmap.cpp FTContour.cpp FTExtrdGlyph.cpp \
|
||||
FTFace.cpp FTFont.cpp FTGLBitmapFont.cpp FTGLExtrdFont.cpp \
|
||||
FTGLOutlineFont.cpp FTGLPixmapFont.cpp FTGLPolygonFont.cpp \
|
||||
FTGLTextureFont.cpp FTGlyph.cpp FTGlyphContainer.cpp FTLibrary.cpp \
|
||||
FTOutlineGlyph.cpp FTPixmapGlyph.cpp FTPoint.cpp FTPolyGlyph.cpp \
|
||||
FTSize.cpp FTTextureGlyph.cpp FTVectoriser.cpp
|
||||
|
||||
include nan_compile.mk
|
||||
CPPFLAGS += -I../include
|
||||
CPPFLAGS += -I$(NAN_FREETYPE)/include -I$(NAN_FREETYPE)/include/freetype2
|
||||
CPPFLAGS += -I$(OPENGL_HEADERS)
|
||||
|
||||
install: all debug
|
||||
@[ -d $(NAN_FTGL) ] || mkdir -p $(NAN_FTGL)
|
||||
@[ -d $(NAN_FTGL)/include ] || mkdir -p $(NAN_FTGL)/include
|
||||
@[ -d $(NAN_FTGL)/lib ] || mkdir -p $(NAN_FTGL)/lib
|
||||
@[ -d $(NAN_FTGL)/lib/debug ] || mkdir -p $(NAN_FTGL)/lib/debug
|
||||
@$(NANBLENDERHOME)/intern/tools/cpifdiff.sh $(DIR)/lib$(LIBNAME).a $(NAN_FTGL)/lib/
|
||||
# @$(NANBLENDERHOME)/intern/tools/cpifdiff.sh $(DIR)/debug/lib$(LIBNAME).a $(NAN_FTGL)/lib/debug/
|
||||
ifeq ($(OS),darwin)
|
||||
ranlib $(NAN_FTGL)/lib/lib$(LIBNAME).a
|
||||
endif
|
||||
@$(NANBLENDERHOME)/intern/tools/cpifdiff.sh ../include/*.h $(NAN_FTGL)/include/
|
||||
|
||||
206
extern/bFTGL/win32_vcpp/README_WIN32.txt
vendored
206
extern/bFTGL/win32_vcpp/README_WIN32.txt
vendored
@@ -1,206 +0,0 @@
|
||||
FTGL 1.31
|
||||
|
||||
NOTES FOR COMPILING ON WINDOWS
|
||||
|
||||
14 Feb 2002
|
||||
|
||||
Ellers, ellers@iinet.net.au
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
SUPPORTED COMPILERS
|
||||
|
||||
|
||||
|
||||
I have rebuilt the FTGL project files for Visual C++ (version 6). There are
|
||||
|
||||
presently no other compilers or environments supported but feel free to
|
||||
|
||||
contribute them.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
QUICK GUIDE: COMPILING FTGL
|
||||
|
||||
|
||||
|
||||
- Start up MSVC++ with ftgl.dsw.
|
||||
|
||||
- Tell MSVC++ where FreeType is. You'll need to do something like this:
|
||||
|
||||
|
||||
|
||||
* select Project>Settings
|
||||
|
||||
* select ftgl_static (for a start)
|
||||
|
||||
* select "All Configurations"
|
||||
|
||||
* go to the tab C++ > PreProcessor
|
||||
|
||||
* Set additional include directories appropriately. For me it is:
|
||||
|
||||
D:\cots\freetype-2.0.5\include
|
||||
|
||||
* repeat for all configurations of ftgl_dll
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
QUICK GUIDE: COMPILING/RUNNING SUPPLIED DEMO PROGRAM
|
||||
|
||||
|
||||
|
||||
- The program expects the first argument to be the name of a truetype file.
|
||||
|
||||
I copied timesbi.ttf from the windows directory to C:\TEMP and then edit
|
||||
|
||||
the settings of the project:
|
||||
|
||||
|
||||
|
||||
* select Project>Settings
|
||||
|
||||
* select Demo project
|
||||
|
||||
* select panel Debug>General
|
||||
|
||||
* set Program Arguments to be "C:\TEMP\timesbi.ttf"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
QUICK GUIDE: COMPILING YOUR PROGRAM TO USE FTGL
|
||||
|
||||
|
||||
|
||||
- Choose dynamic or static library linkage
|
||||
|
||||
* if you want to link to a static FTGL library ensure that
|
||||
|
||||
FTGL_LIBRARY_STATIC is defined in the preprocessor section
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
CONFIGURATION / CODE GENERATION / C LIBRARIES
|
||||
|
||||
|
||||
|
||||
FTGL can be built in various configurations (inspired by Freetype and libpng):
|
||||
|
||||
|
||||
|
||||
- static library (.lib)
|
||||
|
||||
- dynamic library (.dll)
|
||||
|
||||
|
||||
|
||||
MSVC++ requires selection of "code generation" option, which seems to be
|
||||
|
||||
mostly to do with which version of the Standard C library is linked with the
|
||||
|
||||
library.
|
||||
|
||||
|
||||
|
||||
The following modes are supported:
|
||||
|
||||
|
||||
|
||||
- static/dynamic
|
||||
|
||||
- single threaded (ST) or multithreaded (MT)
|
||||
|
||||
NOTE: the multithreaded DLL (MD) mode was NOT included, as freetype itself
|
||||
|
||||
doesn't support that mode so I figure there's no point yet.
|
||||
|
||||
- debug/release (debug has _d suffix)
|
||||
|
||||
|
||||
|
||||
So the static multithreaded release library is:
|
||||
|
||||
|
||||
|
||||
ftgl_static_MT.lib
|
||||
|
||||
|
||||
|
||||
The same library built in DEBUG mode:
|
||||
|
||||
|
||||
|
||||
ftgl_static_MT_d.lib
|
||||
|
||||
|
||||
|
||||
If you're not sure which one is appropriate (and if you're a novice don't
|
||||
|
||||
been too put off...) start with making the decision about debug or release.
|
||||
|
||||
This should be easy because if you're building the debug version of your
|
||||
|
||||
app its probably a good idea to link with the debug version of FTGL (but
|
||||
|
||||
not compulsory). Once thats done, you may get errors like:
|
||||
|
||||
|
||||
|
||||
LIBCMTD.lib(crt0init.obj) : warning LNK4098: defaultlib "libcmt.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
|
||||
|
||||
|
||||
|
||||
This will happen, for example, when you link a glut app with an FTGL library
|
||||
|
||||
compiled with different codegen options than the GLUT library.
|
||||
|
||||
|
||||
|
||||
MSVC++ "sort of"
|
||||
|
||||
requires that all libs be linked with the same codegen option. GLUT is built
|
||||
|
||||
in XXX mode, so if you're linking with GLUT, you can get rid of the warning
|
||||
|
||||
by linking with the XXX version of FTGL. The various versions are particularly
|
||||
|
||||
useful if you're doing std C stuff, like printf etc.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
FAQ
|
||||
|
||||
|
||||
|
||||
Q: "But... do I HAVE to use all these DIFFERENT build modes, like multi-
|
||||
|
||||
threaded, debug single threaded, etc?"
|
||||
|
||||
|
||||
|
||||
A: No. Sometimes library makers only generate one style anyway. It depends
|
||||
|
||||
on your needs. Unless you're linking with standard C stuff (e.g. printf)
|
||||
|
||||
then it probably won't make a great deal of difference. If you get
|
||||
|
||||
warnings about "default lib libcmt.lib conflicts" etc, then you can make
|
||||
|
||||
use of the different libraries.
|
||||
|
||||
|
||||
|
||||
92
extern/bFTGL/win32_vcpp/ftgl.dsw
vendored
92
extern/bFTGL/win32_vcpp/ftgl.dsw
vendored
@@ -1,92 +0,0 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "ftgl_demo"=".\ftgl_demo\ftgl_demo.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name ftgl_dll
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name ftgl_static_lib
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "ftgl_demo_2"=".\ftgl_demo\ftgl_demo_2.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name ftgl_dll
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name ftgl_static_lib
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "ftgl_dll"=".\ftgl_dll\ftgl_dll.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "ftgl_static_lib"=".\ftgl_static_lib\ftgl_static_lib.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "unit_tests"=".\unit_tests\unit_tests.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name ftgl_static_lib
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
357
extern/bFTGL/win32_vcpp/ftgl_dll/ftgl_dll.dsp
vendored
357
extern/bFTGL/win32_vcpp/ftgl_dll/ftgl_dll.dsp
vendored
@@ -1,357 +0,0 @@
|
||||
# Microsoft Developer Studio Project File - Name="ftgl_dll" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
|
||||
|
||||
CFG=ftgl_dll - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "ftgl_dll.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "ftgl_dll.mak" CFG="ftgl_dll - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "ftgl_dll - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE "ftgl_dll - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE "ftgl_dll - Win32 Release MT" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE "ftgl_dll - Win32 Debug MT" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "ftgl_dll - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release_ST"
|
||||
# PROP BASE Intermediate_Dir "Release_ST"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "../Build"
|
||||
# PROP Intermediate_Dir "Release_ST"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir "../Build"
|
||||
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FTGL_DLL_EXPORTS" /YX /FD /c
|
||||
# ADD CPP /nologo /MT /W3 /GX /O2 /I "D:\cots\freetype-2.0.5\include" /I "..\..\include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FTGL_LIBRARY" /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib opengl32.lib glu32.lib freetype204.lib /nologo /dll /machine:I386 /out:"../Build/ftgl_dynamic_MT.dll" /libpath:"D:\cots\freetype-2.0.5\objs"
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftgl_dll - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug_ST"
|
||||
# PROP BASE Intermediate_Dir "Debug_ST"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "../Build"
|
||||
# PROP Intermediate_Dir "Debug_ST"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir "../Build"
|
||||
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FTGL_DLL_EXPORTS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "D:\cots\freetype-2.0.5\include" /I "..\..\include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FTGL_LIBRARY" /YX /FD /GZ /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib opengl32.lib glu32.lib freetype204_D.lib /nologo /dll /pdb:"Debug_ST/ftgl_dynamic_ST_d.pdb" /debug /machine:I386 /out:"../Build/ftgl_dynamic_MT_d.dll" /pdbtype:sept /libpath:"D:\cots\freetype-2.0.5\objs"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftgl_dll - Win32 Release MT"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release_MT"
|
||||
# PROP BASE Intermediate_Dir "Release_MT"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "../Build"
|
||||
# PROP Intermediate_Dir "Release_MT"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir "../Build"
|
||||
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FTGL_DLL_EXPORTS" /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "D:\cots\freetype-2.0.5\include" /I "..\..\include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FTGL_LIBRARY" /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib opengl32.lib glu32.lib freetype204MT.lib /nologo /dll /machine:I386 /out:"../Build/ftgl_dynamic_MTD.dll" /libpath:"D:\cots\freetype-2.0.5\objs"
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftgl_dll - Win32 Debug MT"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug_MT"
|
||||
# PROP BASE Intermediate_Dir "Debug_MT"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "../Build"
|
||||
# PROP Intermediate_Dir "Debug_MT"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir "../Build"
|
||||
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FTGL_DLL_EXPORTS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "D:\cots\freetype-2.0.5\include" /I "..\..\include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FTGL_LIBRARY" /YX /FD /GZ /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib opengl32.lib glu32.lib freetype204MT_D.lib /nologo /dll /pdb:"Debug_ST/ftgl_dynamic_MT_d.pdb" /debug /machine:I386 /out:"../Build/ftgl_dynamic_MTD_d.dll" /pdbtype:sept /libpath:"D:\cots\freetype-2.0.5\objs"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "ftgl_dll - Win32 Release"
|
||||
# Name "ftgl_dll - Win32 Debug"
|
||||
# Name "ftgl_dll - Win32 Release MT"
|
||||
# Name "ftgl_dll - Win32 Debug MT"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\FTBitmapGlyph.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\FTCharmap.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\FTContour.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\FTExtrdGlyph.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\FTFace.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\FTFont.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\FTGLBitmapFont.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\FTGLExtrdFont.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\FTGLOutlineFont.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\FTGLPixmapFont.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\FTGLPolygonFont.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\FTGLTextureFont.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\FTGlyph.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\FTGlyphContainer.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\FTLibrary.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\FTOutlineGlyph.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\FTPixmapGlyph.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\FTPoint.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\FTPolyGlyph.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\FTSize.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\FTTextureGlyph.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\FTVectoriser.cpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FTBBox.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FTBitmapGlyph.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FTCharmap.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FTCharToGlyphIndexMap.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FTContour.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FTExtrdGlyph.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FTFace.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FTFont.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FTGL.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FTGLBitmapFont.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FTGLExtrdFont.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FTGLOutlineFont.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FTGLPixmapFont.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FTGLPolygonFont.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FTGLTextureFont.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FTGlyph.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FTGlyphContainer.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FTLibrary.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FTList.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FTOutlineGlyph.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FTPixmapGlyph.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FTPoint.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FTPolyGlyph.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FTSize.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FTTextureGlyph.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FTVector.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FTVectoriser.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
@@ -1,342 +0,0 @@
|
||||
# Microsoft Developer Studio Project File - Name="ftgl_static_lib" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Static Library" 0x0104
|
||||
|
||||
CFG=ftgl_static_lib - Win32 Debug MT
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "ftgl_static_lib.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "ftgl_static_lib.mak" CFG="ftgl_static_lib - Win32 Debug MT"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "ftgl_static_lib - Win32 Release" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "ftgl_static_lib - Win32 Debug" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "ftgl_static_lib - Win32 Debug MT" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "ftgl_static_lib - Win32 Release MT" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "ftgl_static_lib - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release_ST"
|
||||
# PROP BASE Intermediate_Dir "Release_ST"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release_ST"
|
||||
# PROP Intermediate_Dir "Release_ST"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
|
||||
# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\..\lib\windows\freetype\include" /I "..\..\include" /I "..\..\..\..\..\lib\windows\freetype\include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FTGL_LIBRARY_STATIC" /YX /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo /out:"..\Build\ftgl_static_ST.lib"
|
||||
# Begin Special Build Tool
|
||||
SOURCE="$(InputPath)"
|
||||
PostBuild_Cmds=ECHO Copying lib to lib\windows\ftgl\lib XCOPY /Y ..\Build\*lib ..\..\..\..\..\lib\windows\ftgl\lib
|
||||
# End Special Build Tool
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftgl_static_lib - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug_ST"
|
||||
# PROP BASE Intermediate_Dir "Debug_ST"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug_ST"
|
||||
# PROP Intermediate_Dir "Debug_ST"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "D:\cots\freetype-2.0.5\include" /I "..\..\include" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FTGL_LIBRARY_STATIC" /YX /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo /out:"..\Build\ftgl_static_MT_d.lib"
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftgl_static_lib - Win32 Debug MT"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug_MT"
|
||||
# PROP BASE Intermediate_Dir "Debug_MT"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug_MT"
|
||||
# PROP Intermediate_Dir "Debug_MT"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /I "D:\cots\freetype-2.0.5\include" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FTGL_LIBRARY_STATIC" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "D:\cots\freetype-2.0.5\include" /I "..\..\include" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FTGL_LIBRARY_STATIC" /YX /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo /out:"..\Build\ftgl_static_MTD_d.lib"
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftgl_static_lib - Win32 Release MT"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release_MT"
|
||||
# PROP BASE Intermediate_Dir "Release_MT"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release_MT"
|
||||
# PROP Intermediate_Dir "Release_MT"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FTGL_LIBRARY_STATIC" /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "D:\cots\freetype-2.0.5\include" /I "..\..\include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FTGL_LIBRARY_STATIC" /YX /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo /out:"..\Build\ftgl_static_MTD.lib"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "ftgl_static_lib - Win32 Release"
|
||||
# Name "ftgl_static_lib - Win32 Debug"
|
||||
# Name "ftgl_static_lib - Win32 Debug MT"
|
||||
# Name "ftgl_static_lib - Win32 Release MT"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\FTBitmapGlyph.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\FTCharmap.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\FTContour.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\FTExtrdGlyph.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\FTFace.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\FTFont.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\FTGLBitmapFont.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\FTGLExtrdFont.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\FTGLOutlineFont.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\FTGLPixmapFont.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\FTGLPolygonFont.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\FTGLTextureFont.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\FTGlyph.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\FTGlyphContainer.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\FTLibrary.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\FTOutlineGlyph.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\FTPixmapGlyph.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\FTPoint.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\FTPolyGlyph.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\FTSize.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\FTTextureGlyph.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\FTVectoriser.cpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FTBBox.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FTBitmapGlyph.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FTCharmap.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FTCharToGlyphIndexMap.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FTContour.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FTExtrdGlyph.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FTFace.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FTFont.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FTGL.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FTGLBitmapFont.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FTGLExtrdFont.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FTGLOutlineFont.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FTGLPixmapFont.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FTGLPolygonFont.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FTGLTextureFont.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FTGlyph.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FTGlyphContainer.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FTLibrary.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FTList.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FTOutlineGlyph.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FTPixmapGlyph.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FTPoint.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FTPolyGlyph.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FTSize.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FTTextureGlyph.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FTVector.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FTVectoriser.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
168
extern/bFTGL/win32_vcpp/unit_tests/unit_tests.dsp
vendored
168
extern/bFTGL/win32_vcpp/unit_tests/unit_tests.dsp
vendored
@@ -1,168 +0,0 @@
|
||||
# Microsoft Developer Studio Project File - Name="unit_tests" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=unit_tests - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "unit_tests.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "unit_tests.mak" CFG="unit_tests - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "unit_tests - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "unit_tests - Win32 Debug" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "unit_tests - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "$(MIC_COTS_CPPUNIT_DIR)/include" /I "../../include" /I "../../extras" /I "D:\cots\freetype-2.0.5\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "FTGL_LIBRARY_STATIC" /FD /c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 freetype204MT.lib ftgl_static_MT.lib cppunit.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib opengl32.lib glu32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\Build" /libpath:"D:\cots\freetype-2.0.5\objs" /libpath:"D:\cots\cppunit-1.9.8\lib"
|
||||
|
||||
!ELSEIF "$(CFG)" == "unit_tests - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "$(MIC_COTS_CPPUNIT_DIR)/include" /I "../../include" /I "../../extras" /I "D:\cots\freetype-2.0.5\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "FTGL_LIBRARY_STATIC" /FD /GZ /c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 freetype204MT_D.lib ftgl_static_MT_d.lib cppunitd.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib opengl32.lib glu32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\Build" /libpath:"D:\cots\freetype-2.0.5\objs" /libpath:"D:\cots\cppunit-1.9.8\lib"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "unit_tests - Win32 Release"
|
||||
# Name "unit_tests - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\..\test\FTBBox-Test.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\..\test\FTCharmap-Test.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\..\test\FTContour-Test.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\..\test\FTFace-Test.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\..\test\FTFont-Test.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\..\test\FTGlyphContainer-Test.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\..\test\FTLibrary-Test.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\..\test\FTList-Test.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\..\test\FTMesh-Test.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\..\test\FTPoint-Test.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\..\test\FTSize-Test.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\..\test\FTTesselation-Test.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\..\test\FTVector-Test.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\..\test\FTVectoriser-Test.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\test\HPGCalc_afm.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\test\HPGCalc_pfb.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\test\TestMain.cpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\test\Fontdefs.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
4
extern/binreloc/CMakeLists.txt
vendored
4
extern/binreloc/CMakeLists.txt
vendored
@@ -18,8 +18,8 @@
|
||||
# All rights reserved.
|
||||
#
|
||||
|
||||
SET(INC ./include ${WINTAB_INC})
|
||||
ADD_DEFINITIONS(-DWITH_BINRELOC)
|
||||
SET(INC ./include )
|
||||
ADD_DEFINITIONS(-DENABLE_BINRELOC)
|
||||
FILE(GLOB SRC *.c)
|
||||
|
||||
BLENDERLIB(extern_binreloc "${SRC}" "${INC}")
|
||||
|
||||
7
extern/binreloc/Makefile
vendored
7
extern/binreloc/Makefile
vendored
@@ -1,3 +1,5 @@
|
||||
# -*- mode: gnumakefile; tab-width: 8; indent-tabs-mode: t; -*-
|
||||
# vim: tabstop=8
|
||||
#
|
||||
# ***** BEGIN GPL LICENSE BLOCK *****
|
||||
#
|
||||
@@ -25,13 +27,12 @@ DIR = $(OCGDIR)/extern/$(LIBNAME)
|
||||
|
||||
include nan_definitions.mk
|
||||
|
||||
CPPFLAGS += -I./include
|
||||
CPPFLAGS += -DENABLE_BINRELOC -I./include
|
||||
|
||||
|
||||
include nan_compile.mk
|
||||
|
||||
|
||||
install: all debug
|
||||
install: $(ALL_OR_DEBUG)
|
||||
@[ -d $(DIR) ] || mkdir $(DIR)
|
||||
@[ -d $(DIR)/include ] || mkdir $(DIR)/include
|
||||
@../../intern/tools/cpifdiff.sh include/*.h $(DIR)/include/
|
||||
|
||||
2
extern/binreloc/SConscript
vendored
2
extern/binreloc/SConscript
vendored
@@ -9,5 +9,5 @@ cflags = []
|
||||
sources = ['binreloc.c']
|
||||
incs = 'include'
|
||||
|
||||
env.BlenderLib ( 'extern_binreloc', sources, Split(incs), Split(defs), libtype=['intern','player'], priority=[36, 226], compileflags = cflags)
|
||||
env.BlenderLib ( 'extern_binreloc', sources, Split(incs), Split(defs), libtype=['extern','player'], priority=[36,225], compileflags = cflags)
|
||||
|
||||
|
||||
20
extern/bullet2/CMakeLists.txt
vendored
20
extern/bullet2/CMakeLists.txt
vendored
@@ -27,16 +27,16 @@
|
||||
SET(INC . src)
|
||||
|
||||
FILE(GLOB SRC
|
||||
src/LinearMath/*.cpp
|
||||
src/BulletCollision/BroadphaseCollision/*.cpp
|
||||
src/BulletCollision/CollisionShapes/*.cpp
|
||||
src/BulletCollision/NarrowPhaseCollision/*.cpp
|
||||
src/BulletCollision/Gimpact/*.cpp
|
||||
src/BulletCollision//CollisionDispatch/*.cpp
|
||||
src/BulletDynamics/ConstraintSolver/*.cpp
|
||||
src/BulletDynamics/Vehicle/*.cpp
|
||||
src/BulletDynamics/Dynamics/*.cpp
|
||||
src/BulletSoftBody/*.cpp
|
||||
src/LinearMath/*.cpp
|
||||
src/BulletCollision/BroadphaseCollision/*.cpp
|
||||
src/BulletCollision/CollisionShapes/*.cpp
|
||||
src/BulletCollision/NarrowPhaseCollision/*.cpp
|
||||
src/BulletCollision/Gimpact/*.cpp
|
||||
src/BulletCollision//CollisionDispatch/*.cpp
|
||||
src/BulletDynamics/ConstraintSolver/*.cpp
|
||||
src/BulletDynamics/Vehicle/*.cpp
|
||||
src/BulletDynamics/Dynamics/*.cpp
|
||||
src/BulletSoftBody/*.cpp
|
||||
)
|
||||
|
||||
ADD_DEFINITIONS(-D_LIB)
|
||||
|
||||
4
extern/bullet2/Makefile
vendored
4
extern/bullet2/Makefile
vendored
@@ -1,3 +1,5 @@
|
||||
# -*- mode: gnumakefile; tab-width: 8; indent-tabs-mode: t; -*-
|
||||
# vim: tabstop=8
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
@@ -48,7 +50,7 @@ include nan_subdirs.mk
|
||||
|
||||
CP = $(NANBLENDERHOME)/intern/tools/cpifdiff.sh
|
||||
|
||||
install: all debug
|
||||
install: $(ALL_OR_DEBUG)
|
||||
@[ -d $(NAN_BULLET2) ] || mkdir -p $(NAN_BULLET2)
|
||||
@[ -d $(NAN_BULLET2)/include ] || mkdir -p $(NAN_BULLET2)/include
|
||||
@for i in $(BULLETDIRS); do \
|
||||
|
||||
1525
extern/bullet2/make/msvc_9_0/Bullet.vcproj
vendored
Normal file
1525
extern/bullet2/make/msvc_9_0/Bullet.vcproj
vendored
Normal file
File diff suppressed because it is too large
Load Diff
18
extern/bullet2/src/Bullet-C-Api.h
vendored
18
extern/bullet2/src/Bullet-C-Api.h
vendored
@@ -38,37 +38,37 @@ typedef plReal plQuaternion[4];
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Particular physics SDK */
|
||||
/** Particular physics SDK (C-API) */
|
||||
PL_DECLARE_HANDLE(plPhysicsSdkHandle);
|
||||
|
||||
/* Dynamics world, belonging to some physics SDK */
|
||||
/** Dynamics world, belonging to some physics SDK (C-API)*/
|
||||
PL_DECLARE_HANDLE(plDynamicsWorldHandle);
|
||||
|
||||
/* Rigid Body that can be part of a Dynamics World */
|
||||
/** Rigid Body that can be part of a Dynamics World (C-API)*/
|
||||
PL_DECLARE_HANDLE(plRigidBodyHandle);
|
||||
|
||||
/* Collision Shape/Geometry, property of a Rigid Body */
|
||||
/** Collision Shape/Geometry, property of a Rigid Body (C-API)*/
|
||||
PL_DECLARE_HANDLE(plCollisionShapeHandle);
|
||||
|
||||
/* Constraint for Rigid Bodies */
|
||||
/** Constraint for Rigid Bodies (C-API)*/
|
||||
PL_DECLARE_HANDLE(plConstraintHandle);
|
||||
|
||||
/* Triangle Mesh interface */
|
||||
/** Triangle Mesh interface (C-API)*/
|
||||
PL_DECLARE_HANDLE(plMeshInterfaceHandle);
|
||||
|
||||
/* Broadphase Scene/Proxy Handles */
|
||||
/** Broadphase Scene/Proxy Handles (C-API)*/
|
||||
PL_DECLARE_HANDLE(plCollisionBroadphaseHandle);
|
||||
PL_DECLARE_HANDLE(plBroadphaseProxyHandle);
|
||||
PL_DECLARE_HANDLE(plCollisionWorldHandle);
|
||||
|
||||
/*
|
||||
/**
|
||||
Create and Delete a Physics SDK
|
||||
*/
|
||||
|
||||
extern plPhysicsSdkHandle plNewBulletSdk(); //this could be also another sdk, like ODE, PhysX etc.
|
||||
extern void plDeletePhysicsSdk(plPhysicsSdkHandle physicsSdk);
|
||||
|
||||
/* Collision World, not strictly necessary, you can also just create a Dynamics World with Rigid Bodies which internally manages the Collision World with Collision Objects */
|
||||
/** Collision World, not strictly necessary, you can also just create a Dynamics World with Rigid Bodies which internally manages the Collision World with Collision Objects */
|
||||
|
||||
typedef void(*btBroadphaseCallback)(void* clientData, void* object1,void* object2);
|
||||
|
||||
|
||||
@@ -19,10 +19,9 @@
|
||||
// 3. This notice may not be removed or altered from any source distribution.
|
||||
#include "btAxisSweep3.h"
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
btAxisSweep3::btAxisSweep3(const btPoint3& worldAabbMin,const btPoint3& worldAabbMax, unsigned short int maxHandles, btOverlappingPairCache* pairCache)
|
||||
:btAxisSweep3Internal<unsigned short int>(worldAabbMin,worldAabbMax,0xfffe,0xffff,maxHandles,pairCache)
|
||||
btAxisSweep3::btAxisSweep3(const btVector3& worldAabbMin,const btVector3& worldAabbMax, unsigned short int maxHandles, btOverlappingPairCache* pairCache, bool disableRaycastAccelerator)
|
||||
:btAxisSweep3Internal<unsigned short int>(worldAabbMin,worldAabbMax,0xfffe,0xffff,maxHandles,pairCache,disableRaycastAccelerator)
|
||||
{
|
||||
// 1 handle is reserved as sentinel
|
||||
btAssert(maxHandles > 1 && maxHandles < 32767);
|
||||
@@ -30,8 +29,8 @@ btAxisSweep3::btAxisSweep3(const btPoint3& worldAabbMin,const btPoint3& worldAab
|
||||
}
|
||||
|
||||
|
||||
bt32BitAxisSweep3::bt32BitAxisSweep3(const btPoint3& worldAabbMin,const btPoint3& worldAabbMax, unsigned int maxHandles , btOverlappingPairCache* pairCache )
|
||||
:btAxisSweep3Internal<unsigned int>(worldAabbMin,worldAabbMax,0xfffffffe,0x7fffffff,maxHandles,pairCache)
|
||||
bt32BitAxisSweep3::bt32BitAxisSweep3(const btVector3& worldAabbMin,const btVector3& worldAabbMax, unsigned int maxHandles , btOverlappingPairCache* pairCache , bool disableRaycastAccelerator)
|
||||
:btAxisSweep3Internal<unsigned int>(worldAabbMin,worldAabbMax,0xfffffffe,0x7fffffff,maxHandles,pairCache,disableRaycastAccelerator)
|
||||
{
|
||||
// 1 handle is reserved as sentinel
|
||||
btAssert(maxHandles > 1 && maxHandles < 2147483647);
|
||||
|
||||
@@ -19,12 +19,12 @@
|
||||
#ifndef AXIS_SWEEP_3_H
|
||||
#define AXIS_SWEEP_3_H
|
||||
|
||||
#include "LinearMath/btPoint3.h"
|
||||
#include "LinearMath/btVector3.h"
|
||||
#include "btOverlappingPairCache.h"
|
||||
#include "btBroadphaseInterface.h"
|
||||
#include "btBroadphaseProxy.h"
|
||||
#include "btOverlappingPairCallback.h"
|
||||
#include "btDbvtBroadphase.h"
|
||||
|
||||
//#define DEBUG_BROADPHASE 1
|
||||
#define USE_OVERLAP_TEST_ON_REMOVES 1
|
||||
@@ -42,6 +42,7 @@ protected:
|
||||
|
||||
public:
|
||||
|
||||
BT_DECLARE_ALIGNED_ALLOCATOR();
|
||||
|
||||
class Edge
|
||||
{
|
||||
@@ -61,8 +62,7 @@ public:
|
||||
// indexes into the edge arrays
|
||||
BP_FP_INT_TYPE m_minEdges[3], m_maxEdges[3]; // 6 * 2 = 12
|
||||
// BP_FP_INT_TYPE m_uniqueId;
|
||||
BP_FP_INT_TYPE m_pad;
|
||||
|
||||
btBroadphaseProxy* m_dbvtProxy;//for faster raycast
|
||||
//void* m_pOwner; this is now in btBroadphaseProxy.m_clientObject
|
||||
|
||||
SIMD_FORCE_INLINE void SetNextFree(BP_FP_INT_TYPE next) {m_minEdges[0] = next;}
|
||||
@@ -71,8 +71,8 @@ public:
|
||||
|
||||
|
||||
protected:
|
||||
btPoint3 m_worldAabbMin; // overall system bounds
|
||||
btPoint3 m_worldAabbMax; // overall system bounds
|
||||
btVector3 m_worldAabbMin; // overall system bounds
|
||||
btVector3 m_worldAabbMax; // overall system bounds
|
||||
|
||||
btVector3 m_quantize; // scaling factor for quantization
|
||||
|
||||
@@ -94,6 +94,12 @@ protected:
|
||||
|
||||
int m_invalidPair;
|
||||
|
||||
///additional dynamic aabb structure, used to accelerate ray cast queries.
|
||||
///can be disabled using a optional argument in the constructor
|
||||
btDbvtBroadphase* m_raycastAccelerator;
|
||||
btOverlappingPairCache* m_nullPairCache;
|
||||
|
||||
|
||||
// allocation/deallocation
|
||||
BP_FP_INT_TYPE allocHandle();
|
||||
void freeHandle(BP_FP_INT_TYPE handle);
|
||||
@@ -108,7 +114,7 @@ protected:
|
||||
//Overlap* AddOverlap(BP_FP_INT_TYPE handleA, BP_FP_INT_TYPE handleB);
|
||||
//void RemoveOverlap(BP_FP_INT_TYPE handleA, BP_FP_INT_TYPE handleB);
|
||||
|
||||
void quantize(BP_FP_INT_TYPE* out, const btPoint3& point, int isMax) const;
|
||||
|
||||
|
||||
void sortMinDown(int axis, BP_FP_INT_TYPE edge, btDispatcher* dispatcher, bool updateOverlaps );
|
||||
void sortMinUp(int axis, BP_FP_INT_TYPE edge, btDispatcher* dispatcher, bool updateOverlaps );
|
||||
@@ -117,7 +123,7 @@ protected:
|
||||
|
||||
public:
|
||||
|
||||
btAxisSweep3Internal(const btPoint3& worldAabbMin,const btPoint3& worldAabbMax, BP_FP_INT_TYPE handleMask, BP_FP_INT_TYPE handleSentinel, BP_FP_INT_TYPE maxHandles = 16384, btOverlappingPairCache* pairCache=0);
|
||||
btAxisSweep3Internal(const btVector3& worldAabbMin,const btVector3& worldAabbMax, BP_FP_INT_TYPE handleMask, BP_FP_INT_TYPE handleSentinel, BP_FP_INT_TYPE maxHandles = 16384, btOverlappingPairCache* pairCache=0,bool disableRaycastAccelerator = false);
|
||||
|
||||
virtual ~btAxisSweep3Internal();
|
||||
|
||||
@@ -128,17 +134,26 @@ public:
|
||||
|
||||
virtual void calculateOverlappingPairs(btDispatcher* dispatcher);
|
||||
|
||||
BP_FP_INT_TYPE addHandle(const btPoint3& aabbMin,const btPoint3& aabbMax, void* pOwner,short int collisionFilterGroup,short int collisionFilterMask,btDispatcher* dispatcher,void* multiSapProxy);
|
||||
BP_FP_INT_TYPE addHandle(const btVector3& aabbMin,const btVector3& aabbMax, void* pOwner,short int collisionFilterGroup,short int collisionFilterMask,btDispatcher* dispatcher,void* multiSapProxy);
|
||||
void removeHandle(BP_FP_INT_TYPE handle,btDispatcher* dispatcher);
|
||||
void updateHandle(BP_FP_INT_TYPE handle, const btPoint3& aabbMin,const btPoint3& aabbMax,btDispatcher* dispatcher);
|
||||
void updateHandle(BP_FP_INT_TYPE handle, const btVector3& aabbMin,const btVector3& aabbMax,btDispatcher* dispatcher);
|
||||
SIMD_FORCE_INLINE Handle* getHandle(BP_FP_INT_TYPE index) const {return m_pHandles + index;}
|
||||
|
||||
virtual void resetPool(btDispatcher* dispatcher);
|
||||
|
||||
void processAllOverlappingPairs(btOverlapCallback* callback);
|
||||
|
||||
//Broadphase Interface
|
||||
virtual btBroadphaseProxy* createProxy( const btVector3& aabbMin, const btVector3& aabbMax,int shapeType,void* userPtr ,short int collisionFilterGroup,short int collisionFilterMask,btDispatcher* dispatcher,void* multiSapProxy);
|
||||
virtual void destroyProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher);
|
||||
virtual void setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax,btDispatcher* dispatcher);
|
||||
virtual void getAabb(btBroadphaseProxy* proxy,btVector3& aabbMin, btVector3& aabbMax ) const;
|
||||
|
||||
virtual void rayTest(const btVector3& rayFrom,const btVector3& rayTo, btBroadphaseRayCallback& rayCallback, const btVector3& aabbMin=btVector3(0,0,0), const btVector3& aabbMax = btVector3(0,0,0));
|
||||
|
||||
void quantize(BP_FP_INT_TYPE* out, const btVector3& point, int isMax) const;
|
||||
///unQuantize should be conservative: aabbMin/aabbMax should be larger then 'getAabb' result
|
||||
void unQuantize(btBroadphaseProxy* proxy,btVector3& aabbMin, btVector3& aabbMax ) const;
|
||||
|
||||
bool testAabbOverlap(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1);
|
||||
|
||||
@@ -206,7 +221,7 @@ void btAxisSweep3<BP_FP_INT_TYPE>::debugPrintAxis(int axis, bool checkCardinalit
|
||||
}
|
||||
|
||||
if (checkCardinality)
|
||||
assert(numEdges == m_numHandles*2+1);
|
||||
btAssert(numEdges == m_numHandles*2+1);
|
||||
}
|
||||
#endif //DEBUG_BROADPHASE
|
||||
|
||||
@@ -217,7 +232,12 @@ btBroadphaseProxy* btAxisSweep3Internal<BP_FP_INT_TYPE>::createProxy( const btV
|
||||
BP_FP_INT_TYPE handleId = addHandle(aabbMin,aabbMax, userPtr,collisionFilterGroup,collisionFilterMask,dispatcher,multiSapProxy);
|
||||
|
||||
Handle* handle = getHandle(handleId);
|
||||
|
||||
|
||||
if (m_raycastAccelerator)
|
||||
{
|
||||
btBroadphaseProxy* rayProxy = m_raycastAccelerator->createProxy(aabbMin,aabbMax,shapeType,userPtr,collisionFilterGroup,collisionFilterMask,dispatcher,0);
|
||||
handle->m_dbvtProxy = rayProxy;
|
||||
}
|
||||
return handle;
|
||||
}
|
||||
|
||||
@@ -227,6 +247,8 @@ template <typename BP_FP_INT_TYPE>
|
||||
void btAxisSweep3Internal<BP_FP_INT_TYPE>::destroyProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher)
|
||||
{
|
||||
Handle* handle = static_cast<Handle*>(proxy);
|
||||
if (m_raycastAccelerator)
|
||||
m_raycastAccelerator->destroyProxy(handle->m_dbvtProxy,dispatcher);
|
||||
removeHandle(static_cast<BP_FP_INT_TYPE>(handle->m_uniqueId), dispatcher);
|
||||
}
|
||||
|
||||
@@ -234,22 +256,80 @@ template <typename BP_FP_INT_TYPE>
|
||||
void btAxisSweep3Internal<BP_FP_INT_TYPE>::setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax,btDispatcher* dispatcher)
|
||||
{
|
||||
Handle* handle = static_cast<Handle*>(proxy);
|
||||
handle->m_aabbMin = aabbMin;
|
||||
handle->m_aabbMax = aabbMax;
|
||||
updateHandle(static_cast<BP_FP_INT_TYPE>(handle->m_uniqueId), aabbMin, aabbMax,dispatcher);
|
||||
if (m_raycastAccelerator)
|
||||
m_raycastAccelerator->setAabb(handle->m_dbvtProxy,aabbMin,aabbMax,dispatcher);
|
||||
|
||||
}
|
||||
|
||||
template <typename BP_FP_INT_TYPE>
|
||||
void btAxisSweep3Internal<BP_FP_INT_TYPE>::rayTest(const btVector3& rayFrom,const btVector3& rayTo, btBroadphaseRayCallback& rayCallback,const btVector3& aabbMin,const btVector3& aabbMax)
|
||||
{
|
||||
if (m_raycastAccelerator)
|
||||
{
|
||||
m_raycastAccelerator->rayTest(rayFrom,rayTo,rayCallback,aabbMin,aabbMax);
|
||||
} else
|
||||
{
|
||||
//choose axis?
|
||||
BP_FP_INT_TYPE axis = 0;
|
||||
//for each proxy
|
||||
for (BP_FP_INT_TYPE i=1;i<m_numHandles*2+1;i++)
|
||||
{
|
||||
if (m_pEdges[axis][i].IsMax())
|
||||
{
|
||||
rayCallback.process(getHandle(m_pEdges[axis][i].m_handle));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
template <typename BP_FP_INT_TYPE>
|
||||
void btAxisSweep3Internal<BP_FP_INT_TYPE>::getAabb(btBroadphaseProxy* proxy,btVector3& aabbMin, btVector3& aabbMax ) const
|
||||
{
|
||||
Handle* pHandle = static_cast<Handle*>(proxy);
|
||||
aabbMin = pHandle->m_aabbMin;
|
||||
aabbMax = pHandle->m_aabbMax;
|
||||
}
|
||||
|
||||
|
||||
template <typename BP_FP_INT_TYPE>
|
||||
void btAxisSweep3Internal<BP_FP_INT_TYPE>::unQuantize(btBroadphaseProxy* proxy,btVector3& aabbMin, btVector3& aabbMax ) const
|
||||
{
|
||||
Handle* pHandle = static_cast<Handle*>(proxy);
|
||||
|
||||
unsigned short vecInMin[3];
|
||||
unsigned short vecInMax[3];
|
||||
|
||||
vecInMin[0] = m_pEdges[0][pHandle->m_minEdges[0]].m_pos ;
|
||||
vecInMax[0] = m_pEdges[0][pHandle->m_maxEdges[0]].m_pos +1 ;
|
||||
vecInMin[1] = m_pEdges[1][pHandle->m_minEdges[1]].m_pos ;
|
||||
vecInMax[1] = m_pEdges[1][pHandle->m_maxEdges[1]].m_pos +1 ;
|
||||
vecInMin[2] = m_pEdges[2][pHandle->m_minEdges[2]].m_pos ;
|
||||
vecInMax[2] = m_pEdges[2][pHandle->m_maxEdges[2]].m_pos +1 ;
|
||||
|
||||
aabbMin.setValue((btScalar)(vecInMin[0]) / (m_quantize.getX()),(btScalar)(vecInMin[1]) / (m_quantize.getY()),(btScalar)(vecInMin[2]) / (m_quantize.getZ()));
|
||||
aabbMin += m_worldAabbMin;
|
||||
|
||||
aabbMax.setValue((btScalar)(vecInMax[0]) / (m_quantize.getX()),(btScalar)(vecInMax[1]) / (m_quantize.getY()),(btScalar)(vecInMax[2]) / (m_quantize.getZ()));
|
||||
aabbMax += m_worldAabbMin;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
template <typename BP_FP_INT_TYPE>
|
||||
btAxisSweep3Internal<BP_FP_INT_TYPE>::btAxisSweep3Internal(const btPoint3& worldAabbMin,const btPoint3& worldAabbMax, BP_FP_INT_TYPE handleMask, BP_FP_INT_TYPE handleSentinel,BP_FP_INT_TYPE userMaxHandles, btOverlappingPairCache* pairCache )
|
||||
btAxisSweep3Internal<BP_FP_INT_TYPE>::btAxisSweep3Internal(const btVector3& worldAabbMin,const btVector3& worldAabbMax, BP_FP_INT_TYPE handleMask, BP_FP_INT_TYPE handleSentinel,BP_FP_INT_TYPE userMaxHandles, btOverlappingPairCache* pairCache , bool disableRaycastAccelerator)
|
||||
:m_bpHandleMask(handleMask),
|
||||
m_handleSentinel(handleSentinel),
|
||||
m_pairCache(pairCache),
|
||||
m_userPairCallback(0),
|
||||
m_ownsPairCache(false),
|
||||
m_invalidPair(0)
|
||||
m_invalidPair(0),
|
||||
m_raycastAccelerator(0)
|
||||
{
|
||||
BP_FP_INT_TYPE maxHandles = static_cast<BP_FP_INT_TYPE>(userMaxHandles+1);//need to add one sentinel handle
|
||||
|
||||
@@ -260,7 +340,14 @@ m_invalidPair(0)
|
||||
m_ownsPairCache = true;
|
||||
}
|
||||
|
||||
//assert(bounds.HasVolume());
|
||||
if (!disableRaycastAccelerator)
|
||||
{
|
||||
m_nullPairCache = new (btAlignedAlloc(sizeof(btNullPairCache),16)) btNullPairCache();
|
||||
m_raycastAccelerator = new (btAlignedAlloc(sizeof(btDbvtBroadphase),16)) btDbvtBroadphase(m_nullPairCache);//m_pairCache);
|
||||
m_raycastAccelerator->m_deferedcollide = true;//don't add/remove pairs
|
||||
}
|
||||
|
||||
//btAssert(bounds.HasVolume());
|
||||
|
||||
// init bounds
|
||||
m_worldAabbMin = worldAabbMin;
|
||||
@@ -320,7 +407,14 @@ m_invalidPair(0)
|
||||
template <typename BP_FP_INT_TYPE>
|
||||
btAxisSweep3Internal<BP_FP_INT_TYPE>::~btAxisSweep3Internal()
|
||||
{
|
||||
|
||||
if (m_raycastAccelerator)
|
||||
{
|
||||
m_nullPairCache->~btOverlappingPairCache();
|
||||
btAlignedFree(m_nullPairCache);
|
||||
m_raycastAccelerator->~btDbvtBroadphase();
|
||||
btAlignedFree (m_raycastAccelerator);
|
||||
}
|
||||
|
||||
for (int i = 2; i >= 0; i--)
|
||||
{
|
||||
btAlignedFree(m_pEdgesRawPtr[i]);
|
||||
@@ -335,27 +429,31 @@ btAxisSweep3Internal<BP_FP_INT_TYPE>::~btAxisSweep3Internal()
|
||||
}
|
||||
|
||||
template <typename BP_FP_INT_TYPE>
|
||||
void btAxisSweep3Internal<BP_FP_INT_TYPE>::quantize(BP_FP_INT_TYPE* out, const btPoint3& point, int isMax) const
|
||||
void btAxisSweep3Internal<BP_FP_INT_TYPE>::quantize(BP_FP_INT_TYPE* out, const btVector3& point, int isMax) const
|
||||
{
|
||||
btPoint3 clampedPoint(point);
|
||||
|
||||
|
||||
|
||||
#ifdef OLD_CLAMPING_METHOD
|
||||
///problem with this clamping method is that the floating point during quantization might still go outside the range [(0|isMax) .. (m_handleSentinel&m_bpHandleMask]|isMax]
|
||||
///see http://code.google.com/p/bullet/issues/detail?id=87
|
||||
btVector3 clampedPoint(point);
|
||||
clampedPoint.setMax(m_worldAabbMin);
|
||||
clampedPoint.setMin(m_worldAabbMax);
|
||||
|
||||
btVector3 v = (clampedPoint - m_worldAabbMin) * m_quantize;
|
||||
out[0] = (BP_FP_INT_TYPE)(((BP_FP_INT_TYPE)v.getX() & m_bpHandleMask) | isMax);
|
||||
out[1] = (BP_FP_INT_TYPE)(((BP_FP_INT_TYPE)v.getY() & m_bpHandleMask) | isMax);
|
||||
out[2] = (BP_FP_INT_TYPE)(((BP_FP_INT_TYPE)v.getZ() & m_bpHandleMask) | isMax);
|
||||
|
||||
#else
|
||||
btVector3 v = (point - m_worldAabbMin) * m_quantize;
|
||||
out[0]=(v[0]<=0)?(BP_FP_INT_TYPE)isMax:(v[0]>=m_handleSentinel)?(BP_FP_INT_TYPE)((m_handleSentinel&m_bpHandleMask)|isMax):(BP_FP_INT_TYPE)(((BP_FP_INT_TYPE)v[0]&m_bpHandleMask)|isMax);
|
||||
out[1]=(v[1]<=0)?(BP_FP_INT_TYPE)isMax:(v[1]>=m_handleSentinel)?(BP_FP_INT_TYPE)((m_handleSentinel&m_bpHandleMask)|isMax):(BP_FP_INT_TYPE)(((BP_FP_INT_TYPE)v[1]&m_bpHandleMask)|isMax);
|
||||
out[2]=(v[2]<=0)?(BP_FP_INT_TYPE)isMax:(v[2]>=m_handleSentinel)?(BP_FP_INT_TYPE)((m_handleSentinel&m_bpHandleMask)|isMax):(BP_FP_INT_TYPE)(((BP_FP_INT_TYPE)v[2]&m_bpHandleMask)|isMax);
|
||||
#endif //OLD_CLAMPING_METHOD
|
||||
}
|
||||
|
||||
|
||||
template <typename BP_FP_INT_TYPE>
|
||||
BP_FP_INT_TYPE btAxisSweep3Internal<BP_FP_INT_TYPE>::allocHandle()
|
||||
{
|
||||
assert(m_firstFreeHandle);
|
||||
btAssert(m_firstFreeHandle);
|
||||
|
||||
BP_FP_INT_TYPE handle = m_firstFreeHandle;
|
||||
m_firstFreeHandle = getHandle(handle)->GetNextFree();
|
||||
@@ -367,7 +465,7 @@ BP_FP_INT_TYPE btAxisSweep3Internal<BP_FP_INT_TYPE>::allocHandle()
|
||||
template <typename BP_FP_INT_TYPE>
|
||||
void btAxisSweep3Internal<BP_FP_INT_TYPE>::freeHandle(BP_FP_INT_TYPE handle)
|
||||
{
|
||||
assert(handle > 0 && handle < m_maxHandles);
|
||||
btAssert(handle > 0 && handle < m_maxHandles);
|
||||
|
||||
getHandle(handle)->SetNextFree(m_firstFreeHandle);
|
||||
m_firstFreeHandle = handle;
|
||||
@@ -377,7 +475,7 @@ void btAxisSweep3Internal<BP_FP_INT_TYPE>::freeHandle(BP_FP_INT_TYPE handle)
|
||||
|
||||
|
||||
template <typename BP_FP_INT_TYPE>
|
||||
BP_FP_INT_TYPE btAxisSweep3Internal<BP_FP_INT_TYPE>::addHandle(const btPoint3& aabbMin,const btPoint3& aabbMax, void* pOwner,short int collisionFilterGroup,short int collisionFilterMask,btDispatcher* dispatcher,void* multiSapProxy)
|
||||
BP_FP_INT_TYPE btAxisSweep3Internal<BP_FP_INT_TYPE>::addHandle(const btVector3& aabbMin,const btVector3& aabbMax, void* pOwner,short int collisionFilterGroup,short int collisionFilterMask,btDispatcher* dispatcher,void* multiSapProxy)
|
||||
{
|
||||
// quantize the bounds
|
||||
BP_FP_INT_TYPE min[3], max[3];
|
||||
@@ -440,7 +538,7 @@ void btAxisSweep3Internal<BP_FP_INT_TYPE>::removeHandle(BP_FP_INT_TYPE handle,bt
|
||||
|
||||
//explicitly remove the pairs containing the proxy
|
||||
//we could do it also in the sortMinUp (passing true)
|
||||
//todo: compare performance
|
||||
///@todo: compare performance
|
||||
if (!m_pairCache->hasDeferredRemoval())
|
||||
{
|
||||
m_pairCache->removeOverlappingPairsContainingProxy(pHandle,dispatcher);
|
||||
@@ -489,6 +587,21 @@ void btAxisSweep3Internal<BP_FP_INT_TYPE>::removeHandle(BP_FP_INT_TYPE handle,bt
|
||||
|
||||
}
|
||||
|
||||
template <typename BP_FP_INT_TYPE>
|
||||
void btAxisSweep3Internal<BP_FP_INT_TYPE>::resetPool(btDispatcher* dispatcher)
|
||||
{
|
||||
if (m_numHandles == 0)
|
||||
{
|
||||
m_firstFreeHandle = 1;
|
||||
{
|
||||
for (BP_FP_INT_TYPE i = m_firstFreeHandle; i < m_maxHandles; i++)
|
||||
m_pHandles[i].SetNextFree(static_cast<BP_FP_INT_TYPE>(i + 1));
|
||||
m_pHandles[m_maxHandles - 1].SetNextFree(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
extern int gOverlappingPairs;
|
||||
//#include <stdio.h>
|
||||
|
||||
@@ -529,6 +642,7 @@ void btAxisSweep3Internal<BP_FP_INT_TYPE>::calculateOverlappingPairs(btDispatche
|
||||
|
||||
if (!isDuplicate)
|
||||
{
|
||||
///important to use an AABB test that is consistent with the broadphase
|
||||
bool hasOverlap = testAabbOverlap(pair.m_pProxy0,pair.m_pProxy1);
|
||||
|
||||
if (hasOverlap)
|
||||
@@ -574,10 +688,6 @@ void btAxisSweep3Internal<BP_FP_INT_TYPE>::calculateOverlappingPairs(btDispatche
|
||||
//printf("overlappingPairArray.size()=%d\n",overlappingPairArray.size());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -616,10 +726,10 @@ bool btAxisSweep3Internal<BP_FP_INT_TYPE>::testOverlap2D(const Handle* pHandleA,
|
||||
}
|
||||
|
||||
template <typename BP_FP_INT_TYPE>
|
||||
void btAxisSweep3Internal<BP_FP_INT_TYPE>::updateHandle(BP_FP_INT_TYPE handle, const btPoint3& aabbMin,const btPoint3& aabbMax,btDispatcher* dispatcher)
|
||||
void btAxisSweep3Internal<BP_FP_INT_TYPE>::updateHandle(BP_FP_INT_TYPE handle, const btVector3& aabbMin,const btVector3& aabbMax,btDispatcher* dispatcher)
|
||||
{
|
||||
// assert(bounds.IsFinite());
|
||||
//assert(bounds.HasVolume());
|
||||
// btAssert(bounds.IsFinite());
|
||||
//btAssert(bounds.HasVolume());
|
||||
|
||||
Handle* pHandle = getHandle(handle);
|
||||
|
||||
@@ -895,7 +1005,7 @@ class btAxisSweep3 : public btAxisSweep3Internal<unsigned short int>
|
||||
{
|
||||
public:
|
||||
|
||||
btAxisSweep3(const btPoint3& worldAabbMin,const btPoint3& worldAabbMax, unsigned short int maxHandles = 16384, btOverlappingPairCache* pairCache = 0);
|
||||
btAxisSweep3(const btVector3& worldAabbMin,const btVector3& worldAabbMax, unsigned short int maxHandles = 16384, btOverlappingPairCache* pairCache = 0, bool disableRaycastAccelerator = false);
|
||||
|
||||
};
|
||||
|
||||
@@ -906,7 +1016,7 @@ class bt32BitAxisSweep3 : public btAxisSweep3Internal<unsigned int>
|
||||
{
|
||||
public:
|
||||
|
||||
bt32BitAxisSweep3(const btPoint3& worldAabbMin,const btPoint3& worldAabbMax, unsigned int maxHandles = 1500000, btOverlappingPairCache* pairCache = 0);
|
||||
bt32BitAxisSweep3(const btVector3& worldAabbMin,const btVector3& worldAabbMax, unsigned int maxHandles = 1500000, btOverlappingPairCache* pairCache = 0, bool disableRaycastAccelerator = false);
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -21,8 +21,22 @@ subject to the following restrictions:
|
||||
struct btDispatcherInfo;
|
||||
class btDispatcher;
|
||||
#include "btBroadphaseProxy.h"
|
||||
|
||||
class btOverlappingPairCache;
|
||||
|
||||
|
||||
|
||||
struct btBroadphaseRayCallback
|
||||
{
|
||||
///added some cached data to accelerate ray-AABB tests
|
||||
btVector3 m_rayDirectionInverse;
|
||||
unsigned int m_signs[3];
|
||||
btScalar m_lambda_max;
|
||||
|
||||
virtual ~btBroadphaseRayCallback() {}
|
||||
virtual bool process(const btBroadphaseProxy* proxy) = 0;
|
||||
};
|
||||
|
||||
#include "LinearMath/btVector3.h"
|
||||
|
||||
///The btBroadphaseInterface class provides an interface to detect aabb-overlapping object pairs.
|
||||
@@ -36,7 +50,10 @@ public:
|
||||
virtual btBroadphaseProxy* createProxy( const btVector3& aabbMin, const btVector3& aabbMax,int shapeType,void* userPtr, short int collisionFilterGroup,short int collisionFilterMask, btDispatcher* dispatcher,void* multiSapProxy) =0;
|
||||
virtual void destroyProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher)=0;
|
||||
virtual void setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax, btDispatcher* dispatcher)=0;
|
||||
|
||||
virtual void getAabb(btBroadphaseProxy* proxy,btVector3& aabbMin, btVector3& aabbMax ) const =0;
|
||||
|
||||
virtual void rayTest(const btVector3& rayFrom,const btVector3& rayTo, btBroadphaseRayCallback& rayCallback, const btVector3& aabbMin=btVector3(0,0,0), const btVector3& aabbMax = btVector3(0,0,0)) = 0;
|
||||
|
||||
///calculateOverlappingPairs is optional: incremental algorithms (sweep and prune) might do it during the set aabb
|
||||
virtual void calculateOverlappingPairs(btDispatcher* dispatcher)=0;
|
||||
|
||||
@@ -47,6 +64,9 @@ public:
|
||||
///will add some transform later
|
||||
virtual void getBroadphaseAabb(btVector3& aabbMin,btVector3& aabbMax) const =0;
|
||||
|
||||
///reset broadphase internal structures, to ensure determinism/reproducability
|
||||
virtual void resetPool(btDispatcher* dispatcher) {};
|
||||
|
||||
virtual void printStats() = 0;
|
||||
|
||||
};
|
||||
|
||||
@@ -17,20 +17,24 @@ subject to the following restrictions:
|
||||
#define BROADPHASE_PROXY_H
|
||||
|
||||
#include "LinearMath/btScalar.h" //for SIMD_FORCE_INLINE
|
||||
#include "LinearMath/btVector3.h"
|
||||
#include "LinearMath/btAlignedAllocator.h"
|
||||
|
||||
|
||||
/// btDispatcher uses these types
|
||||
/// IMPORTANT NOTE:The types are ordered polyhedral, implicit convex and concave
|
||||
/// to facilitate type checking
|
||||
/// CUSTOM_POLYHEDRAL_SHAPE_TYPE,CUSTOM_CONVEX_SHAPE_TYPE and CUSTOM_CONCAVE_SHAPE_TYPE can be used to extend Bullet without modifying source code
|
||||
enum BroadphaseNativeTypes
|
||||
{
|
||||
// polyhedral convex shapes
|
||||
// polyhedral convex shapes
|
||||
BOX_SHAPE_PROXYTYPE,
|
||||
TRIANGLE_SHAPE_PROXYTYPE,
|
||||
TETRAHEDRAL_SHAPE_PROXYTYPE,
|
||||
CONVEX_TRIANGLEMESH_SHAPE_PROXYTYPE,
|
||||
CONVEX_HULL_SHAPE_PROXYTYPE,
|
||||
CONVEX_POINT_CLOUD_SHAPE_PROXYTYPE,
|
||||
CUSTOM_POLYHEDRAL_SHAPE_TYPE,
|
||||
//implicit convex shapes
|
||||
IMPLICIT_CONVEX_SHAPES_START_HERE,
|
||||
SPHERE_SHAPE_PROXYTYPE,
|
||||
@@ -42,6 +46,7 @@ IMPLICIT_CONVEX_SHAPES_START_HERE,
|
||||
UNIFORM_SCALING_SHAPE_PROXYTYPE,
|
||||
MINKOWSKI_SUM_SHAPE_PROXYTYPE,
|
||||
MINKOWSKI_DIFFERENCE_SHAPE_PROXYTYPE,
|
||||
CUSTOM_CONVEX_SHAPE_TYPE,
|
||||
//concave shapes
|
||||
CONCAVE_SHAPES_START_HERE,
|
||||
//keep all the convex shapetype below here, for the check IsConvexShape in broadphase proxy!
|
||||
@@ -58,13 +63,18 @@ CONCAVE_SHAPES_START_HERE,
|
||||
|
||||
EMPTY_SHAPE_PROXYTYPE,
|
||||
STATIC_PLANE_PROXYTYPE,
|
||||
CUSTOM_CONCAVE_SHAPE_TYPE,
|
||||
CONCAVE_SHAPES_END_HERE,
|
||||
|
||||
COMPOUND_SHAPE_PROXYTYPE,
|
||||
|
||||
SOFTBODY_SHAPE_PROXYTYPE,
|
||||
HFFLUID_SHAPE_PROXYTYPE,
|
||||
HFFLUID_BUOYANT_CONVEX_SHAPE_PROXYTYPE,
|
||||
INVALID_SHAPE_PROXYTYPE,
|
||||
|
||||
MAX_BROADPHASE_COLLISION_TYPES
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -83,20 +93,20 @@ BT_DECLARE_ALIGNED_ALLOCATOR();
|
||||
KinematicFilter = 4,
|
||||
DebrisFilter = 8,
|
||||
SensorTrigger = 16,
|
||||
CharacterFilter = 32,
|
||||
AllFilter = -1 //all bits sets: DefaultFilter | StaticFilter | KinematicFilter | DebrisFilter | SensorTrigger
|
||||
};
|
||||
|
||||
//Usually the client btCollisionObject or Rigidbody class
|
||||
void* m_clientObject;
|
||||
|
||||
short int m_collisionFilterGroup;
|
||||
short int m_collisionFilterMask;
|
||||
|
||||
void* m_multiSapParentProxy;
|
||||
|
||||
|
||||
int m_uniqueId;//m_uniqueId is introduced for paircache. could get rid of this, by calculating the address offset etc.
|
||||
|
||||
btVector3 m_aabbMin;
|
||||
btVector3 m_aabbMax;
|
||||
|
||||
SIMD_FORCE_INLINE int getUid() const
|
||||
{
|
||||
return m_uniqueId;
|
||||
@@ -107,10 +117,12 @@ BT_DECLARE_ALIGNED_ALLOCATOR();
|
||||
{
|
||||
}
|
||||
|
||||
btBroadphaseProxy(void* userPtr,short int collisionFilterGroup, short int collisionFilterMask,void* multiSapParentProxy=0)
|
||||
btBroadphaseProxy(const btVector3& aabbMin,const btVector3& aabbMax,void* userPtr,short int collisionFilterGroup, short int collisionFilterMask,void* multiSapParentProxy=0)
|
||||
:m_clientObject(userPtr),
|
||||
m_collisionFilterGroup(collisionFilterGroup),
|
||||
m_collisionFilterMask(collisionFilterMask)
|
||||
m_collisionFilterMask(collisionFilterMask),
|
||||
m_aabbMin(aabbMin),
|
||||
m_aabbMax(aabbMax)
|
||||
{
|
||||
m_multiSapParentProxy = multiSapParentProxy;
|
||||
}
|
||||
@@ -159,7 +171,7 @@ ATTRIBUTE_ALIGNED16(struct) btBroadphasePair
|
||||
m_pProxy0(0),
|
||||
m_pProxy1(0),
|
||||
m_algorithm(0),
|
||||
m_userInfo(0)
|
||||
m_internalInfo1(0)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -169,14 +181,14 @@ BT_DECLARE_ALIGNED_ALLOCATOR();
|
||||
: m_pProxy0(other.m_pProxy0),
|
||||
m_pProxy1(other.m_pProxy1),
|
||||
m_algorithm(other.m_algorithm),
|
||||
m_userInfo(other.m_userInfo)
|
||||
m_internalInfo1(other.m_internalInfo1)
|
||||
{
|
||||
}
|
||||
btBroadphasePair(btBroadphaseProxy& proxy0,btBroadphaseProxy& proxy1)
|
||||
{
|
||||
|
||||
//keep them sorted, so the std::set operations work
|
||||
if (&proxy0 < &proxy1)
|
||||
if (proxy0.m_uniqueId < proxy1.m_uniqueId)
|
||||
{
|
||||
m_pProxy0 = &proxy0;
|
||||
m_pProxy1 = &proxy1;
|
||||
@@ -188,7 +200,7 @@ BT_DECLARE_ALIGNED_ALLOCATOR();
|
||||
}
|
||||
|
||||
m_algorithm = 0;
|
||||
m_userInfo = 0;
|
||||
m_internalInfo1 = 0;
|
||||
|
||||
}
|
||||
|
||||
@@ -196,7 +208,7 @@ BT_DECLARE_ALIGNED_ALLOCATOR();
|
||||
btBroadphaseProxy* m_pProxy1;
|
||||
|
||||
mutable btCollisionAlgorithm* m_algorithm;
|
||||
mutable void* m_userInfo;
|
||||
union { void* m_internalInfo1; int m_internalTmpValue;};//don't use this data, it will be removed in future version.
|
||||
|
||||
};
|
||||
|
||||
@@ -217,8 +229,13 @@ class btBroadphasePairSortPredicate
|
||||
|
||||
bool operator() ( const btBroadphasePair& a, const btBroadphasePair& b )
|
||||
{
|
||||
return a.m_pProxy0 > b.m_pProxy0 ||
|
||||
(a.m_pProxy0 == b.m_pProxy0 && a.m_pProxy1 > b.m_pProxy1) ||
|
||||
const int uidA0 = a.m_pProxy0 ? a.m_pProxy0->m_uniqueId : -1;
|
||||
const int uidB0 = b.m_pProxy0 ? b.m_pProxy0->m_uniqueId : -1;
|
||||
const int uidA1 = a.m_pProxy1 ? a.m_pProxy1->m_uniqueId : -1;
|
||||
const int uidB1 = b.m_pProxy1 ? b.m_pProxy1->m_uniqueId : -1;
|
||||
|
||||
return uidA0 > uidB0 ||
|
||||
(a.m_pProxy0 == b.m_pProxy0 && uidA1 > uidB1) ||
|
||||
(a.m_pProxy0 == b.m_pProxy0 && a.m_pProxy1 == b.m_pProxy1 && a.m_algorithm > b.m_algorithm);
|
||||
}
|
||||
};
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -26,19 +26,19 @@ subject to the following restrictions:
|
||||
|
||||
#if DBVT_BP_PROFILE
|
||||
struct ProfileScope
|
||||
{
|
||||
{
|
||||
__forceinline ProfileScope(btClock& clock,unsigned long& value) :
|
||||
m_clock(&clock),m_value(&value),m_base(clock.getTimeMicroseconds())
|
||||
{
|
||||
}
|
||||
m_clock(&clock),m_value(&value),m_base(clock.getTimeMicroseconds())
|
||||
{
|
||||
}
|
||||
__forceinline ~ProfileScope()
|
||||
{
|
||||
{
|
||||
(*m_value)+=m_clock->getTimeMicroseconds()-m_base;
|
||||
}
|
||||
}
|
||||
btClock* m_clock;
|
||||
unsigned long* m_value;
|
||||
unsigned long m_base;
|
||||
};
|
||||
};
|
||||
#define SPC(_value_) ProfileScope spc_scope(m_clock,_value_)
|
||||
#else
|
||||
#define SPC(_value_)
|
||||
@@ -52,35 +52,35 @@ struct ProfileScope
|
||||
template <typename T>
|
||||
static inline void listappend(T* item,T*& list)
|
||||
{
|
||||
item->links[0]=0;
|
||||
item->links[1]=list;
|
||||
if(list) list->links[0]=item;
|
||||
list=item;
|
||||
item->links[0]=0;
|
||||
item->links[1]=list;
|
||||
if(list) list->links[0]=item;
|
||||
list=item;
|
||||
}
|
||||
|
||||
//
|
||||
template <typename T>
|
||||
static inline void listremove(T* item,T*& list)
|
||||
{
|
||||
if(item->links[0]) item->links[0]->links[1]=item->links[1]; else list=item->links[1];
|
||||
if(item->links[1]) item->links[1]->links[0]=item->links[0];
|
||||
if(item->links[0]) item->links[0]->links[1]=item->links[1]; else list=item->links[1];
|
||||
if(item->links[1]) item->links[1]->links[0]=item->links[0];
|
||||
}
|
||||
|
||||
//
|
||||
template <typename T>
|
||||
static inline int listcount(T* root)
|
||||
{
|
||||
int n=0;
|
||||
while(root) { ++n;root=root->links[1]; }
|
||||
return(n);
|
||||
int n=0;
|
||||
while(root) { ++n;root=root->links[1]; }
|
||||
return(n);
|
||||
}
|
||||
|
||||
//
|
||||
template <typename T>
|
||||
static inline void clear(T& value)
|
||||
{
|
||||
static const struct ZeroDummy : T {} zerodummy;
|
||||
value=zerodummy;
|
||||
static const struct ZeroDummy : T {} zerodummy;
|
||||
value=zerodummy;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -90,25 +90,26 @@ value=zerodummy;
|
||||
/* Tree collider */
|
||||
struct btDbvtTreeCollider : btDbvt::ICollide
|
||||
{
|
||||
btDbvtBroadphase* pbp;
|
||||
btDbvtProxy* proxy;
|
||||
btDbvtTreeCollider(btDbvtBroadphase* p) : pbp(p) {}
|
||||
void Process(const btDbvtNode* na,const btDbvtNode* nb)
|
||||
btDbvtBroadphase* pbp;
|
||||
btDbvtProxy* proxy;
|
||||
btDbvtTreeCollider(btDbvtBroadphase* p) : pbp(p) {}
|
||||
void Process(const btDbvtNode* na,const btDbvtNode* nb)
|
||||
{
|
||||
if(na!=nb)
|
||||
if(na!=nb)
|
||||
{
|
||||
btDbvtProxy* pa=(btDbvtProxy*)na->data;
|
||||
btDbvtProxy* pb=(btDbvtProxy*)nb->data;
|
||||
#if DBVT_BP_SORTPAIRS
|
||||
if(pa>pb) btSwap(pa,pb);
|
||||
#endif
|
||||
pbp->m_paircache->addOverlappingPair(pa,pb);
|
||||
++pbp->m_newpairs;
|
||||
btDbvtProxy* pa=(btDbvtProxy*)na->data;
|
||||
btDbvtProxy* pb=(btDbvtProxy*)nb->data;
|
||||
#if DBVT_BP_SORTPAIRS
|
||||
if(pa->m_uniqueId>pb->m_uniqueId)
|
||||
btSwap(pa,pb);
|
||||
#endif
|
||||
pbp->m_paircache->addOverlappingPair(pa,pb);
|
||||
++pbp->m_newpairs;
|
||||
}
|
||||
}
|
||||
void Process(const btDbvtNode* n)
|
||||
void Process(const btDbvtNode* n)
|
||||
{
|
||||
Process(n,proxy->leaf);
|
||||
Process(n,proxy->leaf);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -119,147 +120,197 @@ void Process(const btDbvtNode* n)
|
||||
//
|
||||
btDbvtBroadphase::btDbvtBroadphase(btOverlappingPairCache* paircache)
|
||||
{
|
||||
m_deferedcollide = false;
|
||||
m_needcleanup = true;
|
||||
m_releasepaircache = (paircache!=0)?false:true;
|
||||
m_prediction = 1/(btScalar)2;
|
||||
m_stageCurrent = 0;
|
||||
m_fixedleft = 0;
|
||||
m_fupdates = 1;
|
||||
m_dupdates = 0;
|
||||
m_cupdates = 10;
|
||||
m_newpairs = 1;
|
||||
m_updates_call = 0;
|
||||
m_updates_done = 0;
|
||||
m_updates_ratio = 0;
|
||||
m_paircache = paircache?
|
||||
paircache :
|
||||
new(btAlignedAlloc(sizeof(btHashedOverlappingPairCache),16)) btHashedOverlappingPairCache();
|
||||
m_gid = 0;
|
||||
m_pid = 0;
|
||||
m_cid = 0;
|
||||
for(int i=0;i<=STAGECOUNT;++i)
|
||||
m_deferedcollide = false;
|
||||
m_needcleanup = true;
|
||||
m_releasepaircache = (paircache!=0)?false:true;
|
||||
m_prediction = 1/(btScalar)2;
|
||||
m_stageCurrent = 0;
|
||||
m_fixedleft = 0;
|
||||
m_fupdates = 1;
|
||||
m_dupdates = 0;
|
||||
m_cupdates = 10;
|
||||
m_newpairs = 1;
|
||||
m_updates_call = 0;
|
||||
m_updates_done = 0;
|
||||
m_updates_ratio = 0;
|
||||
m_paircache = paircache? paircache : new(btAlignedAlloc(sizeof(btHashedOverlappingPairCache),16)) btHashedOverlappingPairCache();
|
||||
m_gid = 0;
|
||||
m_pid = 0;
|
||||
m_cid = 0;
|
||||
for(int i=0;i<=STAGECOUNT;++i)
|
||||
{
|
||||
m_stageRoots[i]=0;
|
||||
m_stageRoots[i]=0;
|
||||
}
|
||||
#if DBVT_BP_PROFILE
|
||||
clear(m_profiling);
|
||||
clear(m_profiling);
|
||||
#endif
|
||||
}
|
||||
|
||||
//
|
||||
btDbvtBroadphase::~btDbvtBroadphase()
|
||||
{
|
||||
if(m_releasepaircache)
|
||||
{
|
||||
m_paircache->~btOverlappingPairCache();
|
||||
btAlignedFree(m_paircache);
|
||||
}
|
||||
if(m_releasepaircache)
|
||||
{
|
||||
m_paircache->~btOverlappingPairCache();
|
||||
btAlignedFree(m_paircache);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
btBroadphaseProxy* btDbvtBroadphase::createProxy( const btVector3& aabbMin,
|
||||
const btVector3& aabbMax,
|
||||
int /*shapeType*/,
|
||||
void* userPtr,
|
||||
short int collisionFilterGroup,
|
||||
short int collisionFilterMask,
|
||||
btDispatcher* /*dispatcher*/,
|
||||
void* /*multiSapProxy*/)
|
||||
const btVector3& aabbMax,
|
||||
int /*shapeType*/,
|
||||
void* userPtr,
|
||||
short int collisionFilterGroup,
|
||||
short int collisionFilterMask,
|
||||
btDispatcher* /*dispatcher*/,
|
||||
void* /*multiSapProxy*/)
|
||||
{
|
||||
btDbvtProxy* proxy=new(btAlignedAlloc(sizeof(btDbvtProxy),16)) btDbvtProxy( userPtr,
|
||||
collisionFilterGroup,
|
||||
collisionFilterMask);
|
||||
proxy->aabb = btDbvtVolume::FromMM(aabbMin,aabbMax);
|
||||
proxy->stage = m_stageCurrent;
|
||||
proxy->m_uniqueId = ++m_gid;
|
||||
proxy->leaf = m_sets[0].insert(proxy->aabb,proxy);
|
||||
listappend(proxy,m_stageRoots[m_stageCurrent]);
|
||||
if(!m_deferedcollide)
|
||||
btDbvtProxy* proxy=new(btAlignedAlloc(sizeof(btDbvtProxy),16)) btDbvtProxy( aabbMin,aabbMax,userPtr,
|
||||
collisionFilterGroup,
|
||||
collisionFilterMask);
|
||||
|
||||
btDbvtAabbMm aabb = btDbvtVolume::FromMM(aabbMin,aabbMax);
|
||||
|
||||
//bproxy->aabb = btDbvtVolume::FromMM(aabbMin,aabbMax);
|
||||
proxy->stage = m_stageCurrent;
|
||||
proxy->m_uniqueId = ++m_gid;
|
||||
proxy->leaf = m_sets[0].insert(aabb,proxy);
|
||||
listappend(proxy,m_stageRoots[m_stageCurrent]);
|
||||
if(!m_deferedcollide)
|
||||
{
|
||||
btDbvtTreeCollider collider(this);
|
||||
collider.proxy=proxy;
|
||||
btDbvt::collideTV(m_sets[0].m_root,proxy->aabb,collider);
|
||||
btDbvt::collideTV(m_sets[1].m_root,proxy->aabb,collider);
|
||||
btDbvtTreeCollider collider(this);
|
||||
collider.proxy=proxy;
|
||||
m_sets[0].collideTV(m_sets[0].m_root,aabb,collider);
|
||||
m_sets[1].collideTV(m_sets[1].m_root,aabb,collider);
|
||||
}
|
||||
return(proxy);
|
||||
return(proxy);
|
||||
}
|
||||
|
||||
//
|
||||
void btDbvtBroadphase::destroyProxy( btBroadphaseProxy* absproxy,
|
||||
btDispatcher* dispatcher)
|
||||
btDispatcher* dispatcher)
|
||||
{
|
||||
btDbvtProxy* proxy=(btDbvtProxy*)absproxy;
|
||||
if(proxy->stage==STAGECOUNT)
|
||||
m_sets[1].remove(proxy->leaf);
|
||||
btDbvtProxy* proxy=(btDbvtProxy*)absproxy;
|
||||
if(proxy->stage==STAGECOUNT)
|
||||
m_sets[1].remove(proxy->leaf);
|
||||
else
|
||||
m_sets[0].remove(proxy->leaf);
|
||||
listremove(proxy,m_stageRoots[proxy->stage]);
|
||||
m_paircache->removeOverlappingPairsContainingProxy(proxy,dispatcher);
|
||||
btAlignedFree(proxy);
|
||||
m_needcleanup=true;
|
||||
m_sets[0].remove(proxy->leaf);
|
||||
listremove(proxy,m_stageRoots[proxy->stage]);
|
||||
m_paircache->removeOverlappingPairsContainingProxy(proxy,dispatcher);
|
||||
btAlignedFree(proxy);
|
||||
m_needcleanup=true;
|
||||
}
|
||||
|
||||
void btDbvtBroadphase::getAabb(btBroadphaseProxy* absproxy,btVector3& aabbMin, btVector3& aabbMax ) const
|
||||
{
|
||||
btDbvtProxy* proxy=(btDbvtProxy*)absproxy;
|
||||
aabbMin = proxy->m_aabbMin;
|
||||
aabbMax = proxy->m_aabbMax;
|
||||
}
|
||||
|
||||
struct BroadphaseRayTester : btDbvt::ICollide
|
||||
{
|
||||
btBroadphaseRayCallback& m_rayCallback;
|
||||
BroadphaseRayTester(btBroadphaseRayCallback& orgCallback)
|
||||
:m_rayCallback(orgCallback)
|
||||
{
|
||||
}
|
||||
void Process(const btDbvtNode* leaf)
|
||||
{
|
||||
btDbvtProxy* proxy=(btDbvtProxy*)leaf->data;
|
||||
m_rayCallback.process(proxy);
|
||||
}
|
||||
};
|
||||
|
||||
void btDbvtBroadphase::rayTest(const btVector3& rayFrom,const btVector3& rayTo, btBroadphaseRayCallback& rayCallback,const btVector3& aabbMin,const btVector3& aabbMax)
|
||||
{
|
||||
BroadphaseRayTester callback(rayCallback);
|
||||
|
||||
m_sets[0].rayTestInternal( m_sets[0].m_root,
|
||||
rayFrom,
|
||||
rayTo,
|
||||
rayCallback.m_rayDirectionInverse,
|
||||
rayCallback.m_signs,
|
||||
rayCallback.m_lambda_max,
|
||||
aabbMin,
|
||||
aabbMax,
|
||||
callback);
|
||||
|
||||
m_sets[1].rayTestInternal( m_sets[1].m_root,
|
||||
rayFrom,
|
||||
rayTo,
|
||||
rayCallback.m_rayDirectionInverse,
|
||||
rayCallback.m_signs,
|
||||
rayCallback.m_lambda_max,
|
||||
aabbMin,
|
||||
aabbMax,
|
||||
callback);
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
void btDbvtBroadphase::setAabb( btBroadphaseProxy* absproxy,
|
||||
const btVector3& aabbMin,
|
||||
const btVector3& aabbMax,
|
||||
btDispatcher* /*dispatcher*/)
|
||||
const btVector3& aabbMin,
|
||||
const btVector3& aabbMax,
|
||||
btDispatcher* /*dispatcher*/)
|
||||
{
|
||||
btDbvtProxy* proxy=(btDbvtProxy*)absproxy;
|
||||
ATTRIBUTE_ALIGNED16(btDbvtVolume) aabb=btDbvtVolume::FromMM(aabbMin,aabbMax);
|
||||
btDbvtProxy* proxy=(btDbvtProxy*)absproxy;
|
||||
ATTRIBUTE_ALIGNED16(btDbvtVolume) aabb=btDbvtVolume::FromMM(aabbMin,aabbMax);
|
||||
#if DBVT_BP_PREVENTFALSEUPDATE
|
||||
if(NotEqual(aabb,proxy->leaf->volume))
|
||||
if(NotEqual(aabb,proxy->leaf->volume))
|
||||
#endif
|
||||
{
|
||||
bool docollide=false;
|
||||
if(proxy->stage==STAGECOUNT)
|
||||
bool docollide=false;
|
||||
if(proxy->stage==STAGECOUNT)
|
||||
{/* fixed -> dynamic set */
|
||||
m_sets[1].remove(proxy->leaf);
|
||||
proxy->leaf=m_sets[0].insert(aabb,proxy);
|
||||
docollide=true;
|
||||
m_sets[1].remove(proxy->leaf);
|
||||
proxy->leaf=m_sets[0].insert(aabb,proxy);
|
||||
docollide=true;
|
||||
}
|
||||
else
|
||||
{/* dynamic set */
|
||||
++m_updates_call;
|
||||
if(Intersect(proxy->leaf->volume,aabb))
|
||||
++m_updates_call;
|
||||
if(Intersect(proxy->leaf->volume,aabb))
|
||||
{/* Moving */
|
||||
const btVector3 delta=aabbMin-proxy->aabb.Mins();
|
||||
btVector3 velocity(aabb.Extents()*m_prediction);
|
||||
if(delta[0]<0) velocity[0]=-velocity[0];
|
||||
if(delta[1]<0) velocity[1]=-velocity[1];
|
||||
if(delta[2]<0) velocity[2]=-velocity[2];
|
||||
if (
|
||||
#ifdef DBVT_BP_MARGIN
|
||||
m_sets[0].update(proxy->leaf,aabb,velocity,DBVT_BP_MARGIN)
|
||||
#else
|
||||
m_sets[0].update(proxy->leaf,aabb,velocity)
|
||||
#endif
|
||||
)
|
||||
|
||||
const btVector3 delta=aabbMin-proxy->m_aabbMin;
|
||||
btVector3 velocity(((proxy->m_aabbMax-proxy->m_aabbMin)/2)*m_prediction);
|
||||
if(delta[0]<0) velocity[0]=-velocity[0];
|
||||
if(delta[1]<0) velocity[1]=-velocity[1];
|
||||
if(delta[2]<0) velocity[2]=-velocity[2];
|
||||
if (
|
||||
#ifdef DBVT_BP_MARGIN
|
||||
m_sets[0].update(proxy->leaf,aabb,velocity,DBVT_BP_MARGIN)
|
||||
#else
|
||||
m_sets[0].update(proxy->leaf,aabb,velocity)
|
||||
#endif
|
||||
)
|
||||
{
|
||||
++m_updates_done;
|
||||
docollide=true;
|
||||
++m_updates_done;
|
||||
docollide=true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{/* Teleporting */
|
||||
m_sets[0].update(proxy->leaf,aabb);
|
||||
++m_updates_done;
|
||||
docollide=true;
|
||||
m_sets[0].update(proxy->leaf,aabb);
|
||||
++m_updates_done;
|
||||
docollide=true;
|
||||
}
|
||||
}
|
||||
listremove(proxy,m_stageRoots[proxy->stage]);
|
||||
proxy->aabb = aabb;
|
||||
proxy->stage = m_stageCurrent;
|
||||
listappend(proxy,m_stageRoots[m_stageCurrent]);
|
||||
if(docollide)
|
||||
listremove(proxy,m_stageRoots[proxy->stage]);
|
||||
proxy->m_aabbMin = aabbMin;
|
||||
proxy->m_aabbMax = aabbMax;
|
||||
proxy->stage = m_stageCurrent;
|
||||
listappend(proxy,m_stageRoots[m_stageCurrent]);
|
||||
if(docollide)
|
||||
{
|
||||
m_needcleanup=true;
|
||||
if(!m_deferedcollide)
|
||||
m_needcleanup=true;
|
||||
if(!m_deferedcollide)
|
||||
{
|
||||
btDbvtTreeCollider collider(this);
|
||||
btDbvt::collideTT(m_sets[1].m_root,proxy->leaf,collider);
|
||||
btDbvt::collideTT(m_sets[0].m_root,proxy->leaf,collider);
|
||||
btDbvtTreeCollider collider(this);
|
||||
m_sets[1].collideTTpersistentStack(m_sets[1].m_root,proxy->leaf,collider);
|
||||
m_sets[0].collideTTpersistentStack(m_sets[0].m_root,proxy->leaf,collider);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -268,132 +319,226 @@ if(NotEqual(aabb,proxy->leaf->volume))
|
||||
//
|
||||
void btDbvtBroadphase::calculateOverlappingPairs(btDispatcher* dispatcher)
|
||||
{
|
||||
collide(dispatcher);
|
||||
collide(dispatcher);
|
||||
#if DBVT_BP_PROFILE
|
||||
if(0==(m_pid%DBVT_BP_PROFILING_RATE))
|
||||
if(0==(m_pid%DBVT_BP_PROFILING_RATE))
|
||||
{
|
||||
printf("fixed(%u) dynamics(%u) pairs(%u)\r\n",m_sets[1].m_leaves,m_sets[0].m_leaves,m_paircache->getNumOverlappingPairs());
|
||||
unsigned int total=m_profiling.m_total;
|
||||
if(total<=0) total=1;
|
||||
printf("ddcollide: %u%% (%uus)\r\n",(50+m_profiling.m_ddcollide*100)/total,m_profiling.m_ddcollide/DBVT_BP_PROFILING_RATE);
|
||||
printf("fdcollide: %u%% (%uus)\r\n",(50+m_profiling.m_fdcollide*100)/total,m_profiling.m_fdcollide/DBVT_BP_PROFILING_RATE);
|
||||
printf("cleanup: %u%% (%uus)\r\n",(50+m_profiling.m_cleanup*100)/total,m_profiling.m_cleanup/DBVT_BP_PROFILING_RATE);
|
||||
printf("total: %uus\r\n",total/DBVT_BP_PROFILING_RATE);
|
||||
const unsigned long sum=m_profiling.m_ddcollide+
|
||||
m_profiling.m_fdcollide+
|
||||
m_profiling.m_cleanup;
|
||||
printf("leaked: %u%% (%uus)\r\n",100-((50+sum*100)/total),(total-sum)/DBVT_BP_PROFILING_RATE);
|
||||
printf("job counts: %u%%\r\n",(m_profiling.m_jobcount*100)/((m_sets[0].m_leaves+m_sets[1].m_leaves)*DBVT_BP_PROFILING_RATE));
|
||||
clear(m_profiling);
|
||||
m_clock.reset();
|
||||
printf("fixed(%u) dynamics(%u) pairs(%u)\r\n",m_sets[1].m_leaves,m_sets[0].m_leaves,m_paircache->getNumOverlappingPairs());
|
||||
unsigned int total=m_profiling.m_total;
|
||||
if(total<=0) total=1;
|
||||
printf("ddcollide: %u%% (%uus)\r\n",(50+m_profiling.m_ddcollide*100)/total,m_profiling.m_ddcollide/DBVT_BP_PROFILING_RATE);
|
||||
printf("fdcollide: %u%% (%uus)\r\n",(50+m_profiling.m_fdcollide*100)/total,m_profiling.m_fdcollide/DBVT_BP_PROFILING_RATE);
|
||||
printf("cleanup: %u%% (%uus)\r\n",(50+m_profiling.m_cleanup*100)/total,m_profiling.m_cleanup/DBVT_BP_PROFILING_RATE);
|
||||
printf("total: %uus\r\n",total/DBVT_BP_PROFILING_RATE);
|
||||
const unsigned long sum=m_profiling.m_ddcollide+
|
||||
m_profiling.m_fdcollide+
|
||||
m_profiling.m_cleanup;
|
||||
printf("leaked: %u%% (%uus)\r\n",100-((50+sum*100)/total),(total-sum)/DBVT_BP_PROFILING_RATE);
|
||||
printf("job counts: %u%%\r\n",(m_profiling.m_jobcount*100)/((m_sets[0].m_leaves+m_sets[1].m_leaves)*DBVT_BP_PROFILING_RATE));
|
||||
clear(m_profiling);
|
||||
m_clock.reset();
|
||||
}
|
||||
#endif
|
||||
|
||||
performDeferredRemoval(dispatcher);
|
||||
|
||||
}
|
||||
|
||||
void btDbvtBroadphase::performDeferredRemoval(btDispatcher* dispatcher)
|
||||
{
|
||||
|
||||
if (m_paircache->hasDeferredRemoval())
|
||||
{
|
||||
|
||||
btBroadphasePairArray& overlappingPairArray = m_paircache->getOverlappingPairArray();
|
||||
|
||||
//perform a sort, to find duplicates and to sort 'invalid' pairs to the end
|
||||
overlappingPairArray.quickSort(btBroadphasePairSortPredicate());
|
||||
|
||||
int invalidPair = 0;
|
||||
|
||||
|
||||
int i;
|
||||
|
||||
btBroadphasePair previousPair;
|
||||
previousPair.m_pProxy0 = 0;
|
||||
previousPair.m_pProxy1 = 0;
|
||||
previousPair.m_algorithm = 0;
|
||||
|
||||
|
||||
for (i=0;i<overlappingPairArray.size();i++)
|
||||
{
|
||||
|
||||
btBroadphasePair& pair = overlappingPairArray[i];
|
||||
|
||||
bool isDuplicate = (pair == previousPair);
|
||||
|
||||
previousPair = pair;
|
||||
|
||||
bool needsRemoval = false;
|
||||
|
||||
if (!isDuplicate)
|
||||
{
|
||||
//important to perform AABB check that is consistent with the broadphase
|
||||
btDbvtProxy* pa=(btDbvtProxy*)pair.m_pProxy0;
|
||||
btDbvtProxy* pb=(btDbvtProxy*)pair.m_pProxy1;
|
||||
bool hasOverlap = Intersect(pa->leaf->volume,pb->leaf->volume);
|
||||
|
||||
if (hasOverlap)
|
||||
{
|
||||
needsRemoval = false;
|
||||
} else
|
||||
{
|
||||
needsRemoval = true;
|
||||
}
|
||||
} else
|
||||
{
|
||||
//remove duplicate
|
||||
needsRemoval = true;
|
||||
//should have no algorithm
|
||||
btAssert(!pair.m_algorithm);
|
||||
}
|
||||
|
||||
if (needsRemoval)
|
||||
{
|
||||
m_paircache->cleanOverlappingPair(pair,dispatcher);
|
||||
|
||||
pair.m_pProxy0 = 0;
|
||||
pair.m_pProxy1 = 0;
|
||||
invalidPair++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//perform a sort, to sort 'invalid' pairs to the end
|
||||
overlappingPairArray.quickSort(btBroadphasePairSortPredicate());
|
||||
overlappingPairArray.resize(overlappingPairArray.size() - invalidPair);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
void btDbvtBroadphase::collide(btDispatcher* dispatcher)
|
||||
{
|
||||
SPC(m_profiling.m_total);
|
||||
/* optimize */
|
||||
m_sets[0].optimizeIncremental(1+(m_sets[0].m_leaves*m_dupdates)/100);
|
||||
if(m_fixedleft)
|
||||
/*printf("---------------------------------------------------------\n");
|
||||
printf("m_sets[0].m_leaves=%d\n",m_sets[0].m_leaves);
|
||||
printf("m_sets[1].m_leaves=%d\n",m_sets[1].m_leaves);
|
||||
printf("numPairs = %d\n",getOverlappingPairCache()->getNumOverlappingPairs());
|
||||
{
|
||||
const int count=1+(m_sets[1].m_leaves*m_fupdates)/100;
|
||||
m_sets[1].optimizeIncremental(1+(m_sets[1].m_leaves*m_fupdates)/100);
|
||||
m_fixedleft=btMax<int>(0,m_fixedleft-count);
|
||||
int i;
|
||||
for (i=0;i<getOverlappingPairCache()->getNumOverlappingPairs();i++)
|
||||
{
|
||||
printf("pair[%d]=(%d,%d),",i,getOverlappingPairCache()->getOverlappingPairArray()[i].m_pProxy0->getUid(),
|
||||
getOverlappingPairCache()->getOverlappingPairArray()[i].m_pProxy1->getUid());
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
/* dynamic -> fixed set */
|
||||
m_stageCurrent=(m_stageCurrent+1)%STAGECOUNT;
|
||||
btDbvtProxy* current=m_stageRoots[m_stageCurrent];
|
||||
if(current)
|
||||
*/
|
||||
|
||||
|
||||
|
||||
SPC(m_profiling.m_total);
|
||||
/* optimize */
|
||||
m_sets[0].optimizeIncremental(1+(m_sets[0].m_leaves*m_dupdates)/100);
|
||||
if(m_fixedleft)
|
||||
{
|
||||
btDbvtTreeCollider collider(this);
|
||||
do {
|
||||
btDbvtProxy* next=current->links[1];
|
||||
listremove(current,m_stageRoots[current->stage]);
|
||||
listappend(current,m_stageRoots[STAGECOUNT]);
|
||||
#if DBVT_BP_ACCURATESLEEPING
|
||||
m_paircache->removeOverlappingPairsContainingProxy(current,dispatcher);
|
||||
collider.proxy=current;
|
||||
btDbvt::collideTV(m_sets[0].m_root,current->aabb,collider);
|
||||
btDbvt::collideTV(m_sets[1].m_root,current->aabb,collider);
|
||||
#endif
|
||||
m_sets[0].remove(current->leaf);
|
||||
current->leaf = m_sets[1].insert(current->aabb,current);
|
||||
current->stage = STAGECOUNT;
|
||||
current = next;
|
||||
const int count=1+(m_sets[1].m_leaves*m_fupdates)/100;
|
||||
m_sets[1].optimizeIncremental(1+(m_sets[1].m_leaves*m_fupdates)/100);
|
||||
m_fixedleft=btMax<int>(0,m_fixedleft-count);
|
||||
}
|
||||
/* dynamic -> fixed set */
|
||||
m_stageCurrent=(m_stageCurrent+1)%STAGECOUNT;
|
||||
btDbvtProxy* current=m_stageRoots[m_stageCurrent];
|
||||
if(current)
|
||||
{
|
||||
btDbvtTreeCollider collider(this);
|
||||
do {
|
||||
btDbvtProxy* next=current->links[1];
|
||||
listremove(current,m_stageRoots[current->stage]);
|
||||
listappend(current,m_stageRoots[STAGECOUNT]);
|
||||
#if DBVT_BP_ACCURATESLEEPING
|
||||
m_paircache->removeOverlappingPairsContainingProxy(current,dispatcher);
|
||||
collider.proxy=current;
|
||||
btDbvt::collideTV(m_sets[0].m_root,current->aabb,collider);
|
||||
btDbvt::collideTV(m_sets[1].m_root,current->aabb,collider);
|
||||
#endif
|
||||
m_sets[0].remove(current->leaf);
|
||||
ATTRIBUTE_ALIGNED16(btDbvtVolume) curAabb=btDbvtVolume::FromMM(current->m_aabbMin,current->m_aabbMax);
|
||||
current->leaf = m_sets[1].insert(curAabb,current);
|
||||
current->stage = STAGECOUNT;
|
||||
current = next;
|
||||
} while(current);
|
||||
m_fixedleft=m_sets[1].m_leaves;
|
||||
m_needcleanup=true;
|
||||
m_fixedleft=m_sets[1].m_leaves;
|
||||
m_needcleanup=true;
|
||||
}
|
||||
/* collide dynamics */
|
||||
/* collide dynamics */
|
||||
{
|
||||
btDbvtTreeCollider collider(this);
|
||||
if(m_deferedcollide)
|
||||
btDbvtTreeCollider collider(this);
|
||||
if(m_deferedcollide)
|
||||
{
|
||||
SPC(m_profiling.m_fdcollide);
|
||||
btDbvt::collideTT(m_sets[0].m_root,m_sets[1].m_root,collider);
|
||||
SPC(m_profiling.m_fdcollide);
|
||||
m_sets[0].collideTTpersistentStack(m_sets[0].m_root,m_sets[1].m_root,collider);
|
||||
}
|
||||
if(m_deferedcollide)
|
||||
if(m_deferedcollide)
|
||||
{
|
||||
SPC(m_profiling.m_ddcollide);
|
||||
btDbvt::collideTT(m_sets[0].m_root,m_sets[0].m_root,collider);
|
||||
SPC(m_profiling.m_ddcollide);
|
||||
m_sets[0].collideTTpersistentStack(m_sets[0].m_root,m_sets[0].m_root,collider);
|
||||
}
|
||||
}
|
||||
/* clean up */
|
||||
if(m_needcleanup)
|
||||
/* clean up */
|
||||
if(m_needcleanup)
|
||||
{
|
||||
SPC(m_profiling.m_cleanup);
|
||||
btBroadphasePairArray& pairs=m_paircache->getOverlappingPairArray();
|
||||
if(pairs.size()>0)
|
||||
SPC(m_profiling.m_cleanup);
|
||||
btBroadphasePairArray& pairs=m_paircache->getOverlappingPairArray();
|
||||
if(pairs.size()>0)
|
||||
{
|
||||
const int ci=pairs.size();
|
||||
int ni=btMin(ci,btMax<int>(m_newpairs,(ci*m_cupdates)/100));
|
||||
for(int i=0;i<ni;++i)
|
||||
|
||||
int ni=btMin(pairs.size(),btMax<int>(m_newpairs,(pairs.size()*m_cupdates)/100));
|
||||
for(int i=0;i<ni;++i)
|
||||
{
|
||||
btBroadphasePair& p=pairs[(m_cid+i)%ci];
|
||||
btDbvtProxy* pa=(btDbvtProxy*)p.m_pProxy0;
|
||||
btDbvtProxy* pb=(btDbvtProxy*)p.m_pProxy1;
|
||||
if(!Intersect(pa->leaf->volume,pb->leaf->volume))
|
||||
btBroadphasePair& p=pairs[(m_cid+i)%pairs.size()];
|
||||
btDbvtProxy* pa=(btDbvtProxy*)p.m_pProxy0;
|
||||
btDbvtProxy* pb=(btDbvtProxy*)p.m_pProxy1;
|
||||
if(!Intersect(pa->leaf->volume,pb->leaf->volume))
|
||||
{
|
||||
#if DBVT_BP_SORTPAIRS
|
||||
if(pa>pb) btSwap(pa,pb);
|
||||
#endif
|
||||
m_paircache->removeOverlappingPair(pa,pb,dispatcher);
|
||||
--ni;--i;
|
||||
#if DBVT_BP_SORTPAIRS
|
||||
if(pa->m_uniqueId>pb->m_uniqueId)
|
||||
btSwap(pa,pb);
|
||||
#endif
|
||||
m_paircache->removeOverlappingPair(pa,pb,dispatcher);
|
||||
--ni;--i;
|
||||
}
|
||||
}
|
||||
if(pairs.size()>0) m_cid=(m_cid+ni)%pairs.size(); else m_cid=0;
|
||||
if(pairs.size()>0) m_cid=(m_cid+ni)%pairs.size(); else m_cid=0;
|
||||
}
|
||||
}
|
||||
++m_pid;
|
||||
m_newpairs=1;
|
||||
m_needcleanup=false;
|
||||
if(m_updates_call>0)
|
||||
++m_pid;
|
||||
m_newpairs=1;
|
||||
m_needcleanup=false;
|
||||
if(m_updates_call>0)
|
||||
{ m_updates_ratio=m_updates_done/(btScalar)m_updates_call; }
|
||||
else
|
||||
{ m_updates_ratio=0; }
|
||||
m_updates_done/=2;
|
||||
m_updates_call/=2;
|
||||
m_updates_done/=2;
|
||||
m_updates_call/=2;
|
||||
}
|
||||
|
||||
//
|
||||
void btDbvtBroadphase::optimize()
|
||||
{
|
||||
m_sets[0].optimizeTopDown();
|
||||
m_sets[1].optimizeTopDown();
|
||||
m_sets[0].optimizeTopDown();
|
||||
m_sets[1].optimizeTopDown();
|
||||
}
|
||||
|
||||
//
|
||||
btOverlappingPairCache* btDbvtBroadphase::getOverlappingPairCache()
|
||||
{
|
||||
return(m_paircache);
|
||||
return(m_paircache);
|
||||
}
|
||||
|
||||
//
|
||||
const btOverlappingPairCache* btDbvtBroadphase::getOverlappingPairCache() const
|
||||
{
|
||||
return(m_paircache);
|
||||
return(m_paircache);
|
||||
}
|
||||
|
||||
//
|
||||
@@ -402,16 +547,49 @@ void btDbvtBroadphase::getBroadphaseAabb(btVector3& aabbMin,btVector3& aab
|
||||
|
||||
ATTRIBUTE_ALIGNED16(btDbvtVolume) bounds;
|
||||
|
||||
if(!m_sets[0].empty())
|
||||
if(!m_sets[1].empty()) Merge( m_sets[0].m_root->volume,
|
||||
m_sets[1].m_root->volume,bounds);
|
||||
else
|
||||
bounds=m_sets[0].m_root->volume;
|
||||
else if(!m_sets[1].empty()) bounds=m_sets[1].m_root->volume;
|
||||
else
|
||||
bounds=btDbvtVolume::FromCR(btVector3(0,0,0),0);
|
||||
aabbMin=bounds.Mins();
|
||||
aabbMax=bounds.Maxs();
|
||||
if(!m_sets[0].empty())
|
||||
if(!m_sets[1].empty()) Merge( m_sets[0].m_root->volume,
|
||||
m_sets[1].m_root->volume,bounds);
|
||||
else
|
||||
bounds=m_sets[0].m_root->volume;
|
||||
else if(!m_sets[1].empty()) bounds=m_sets[1].m_root->volume;
|
||||
else
|
||||
bounds=btDbvtVolume::FromCR(btVector3(0,0,0),0);
|
||||
aabbMin=bounds.Mins();
|
||||
aabbMax=bounds.Maxs();
|
||||
}
|
||||
|
||||
void btDbvtBroadphase::resetPool(btDispatcher* dispatcher)
|
||||
{
|
||||
|
||||
int totalObjects = m_sets[0].m_leaves + m_sets[1].m_leaves;
|
||||
if (!totalObjects)
|
||||
{
|
||||
//reset internal dynamic tree data structures
|
||||
m_sets[0].clear();
|
||||
m_sets[1].clear();
|
||||
|
||||
m_deferedcollide = false;
|
||||
m_needcleanup = true;
|
||||
m_prediction = 1/(btScalar)2;
|
||||
m_stageCurrent = 0;
|
||||
m_fixedleft = 0;
|
||||
m_fupdates = 1;
|
||||
m_dupdates = 0;
|
||||
m_cupdates = 10;
|
||||
m_newpairs = 1;
|
||||
m_updates_call = 0;
|
||||
m_updates_done = 0;
|
||||
m_updates_ratio = 0;
|
||||
|
||||
m_gid = 0;
|
||||
m_pid = 0;
|
||||
m_cid = 0;
|
||||
for(int i=0;i<=STAGECOUNT;++i)
|
||||
{
|
||||
m_stageRoots[i]=0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
@@ -422,9 +600,9 @@ void btDbvtBroadphase::printStats()
|
||||
#if DBVT_BP_ENABLE_BENCHMARK
|
||||
|
||||
struct btBroadphaseBenchmark
|
||||
{
|
||||
{
|
||||
struct Experiment
|
||||
{
|
||||
{
|
||||
const char* name;
|
||||
int object_count;
|
||||
int update_count;
|
||||
@@ -432,109 +610,109 @@ struct btBroadphaseBenchmark
|
||||
int iterations;
|
||||
btScalar speed;
|
||||
btScalar amplitude;
|
||||
};
|
||||
};
|
||||
struct Object
|
||||
{
|
||||
{
|
||||
btVector3 center;
|
||||
btVector3 extents;
|
||||
btBroadphaseProxy* proxy;
|
||||
btScalar time;
|
||||
void update(btScalar speed,btScalar amplitude,btBroadphaseInterface* pbi)
|
||||
{
|
||||
{
|
||||
time += speed;
|
||||
center[0] = btCos(time*(btScalar)2.17)*amplitude+
|
||||
btSin(time)*amplitude/2;
|
||||
btSin(time)*amplitude/2;
|
||||
center[1] = btCos(time*(btScalar)1.38)*amplitude+
|
||||
btSin(time)*amplitude;
|
||||
btSin(time)*amplitude;
|
||||
center[2] = btSin(time*(btScalar)0.777)*amplitude;
|
||||
pbi->setAabb(proxy,center-extents,center+extents,0);
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
static int UnsignedRand(int range=RAND_MAX-1) { return(rand()%(range+1)); }
|
||||
static btScalar UnitRand() { return(UnsignedRand(16384)/(btScalar)16384); }
|
||||
static void OutputTime(const char* name,btClock& c,unsigned count=0)
|
||||
{
|
||||
{
|
||||
const unsigned long us=c.getTimeMicroseconds();
|
||||
const unsigned long ms=(us+500)/1000;
|
||||
const btScalar sec=us/(btScalar)(1000*1000);
|
||||
if(count>0)
|
||||
printf("%s : %u us (%u ms), %.2f/s\r\n",name,us,ms,count/sec);
|
||||
else
|
||||
else
|
||||
printf("%s : %u us (%u ms)\r\n",name,us,ms);
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
void btDbvtBroadphase::benchmark(btBroadphaseInterface* pbi)
|
||||
{
|
||||
static const btBroadphaseBenchmark::Experiment experiments[]=
|
||||
static const btBroadphaseBenchmark::Experiment experiments[]=
|
||||
{
|
||||
{"1024o.10%",1024,10,0,8192,(btScalar)0.005,(btScalar)100},
|
||||
/*{"4096o.10%",4096,10,0,8192,(btScalar)0.005,(btScalar)100},
|
||||
{"8192o.10%",8192,10,0,8192,(btScalar)0.005,(btScalar)100},*/
|
||||
{"1024o.10%",1024,10,0,8192,(btScalar)0.005,(btScalar)100},
|
||||
/*{"4096o.10%",4096,10,0,8192,(btScalar)0.005,(btScalar)100},
|
||||
{"8192o.10%",8192,10,0,8192,(btScalar)0.005,(btScalar)100},*/
|
||||
};
|
||||
static const int nexperiments=sizeof(experiments)/sizeof(experiments[0]);
|
||||
btAlignedObjectArray<btBroadphaseBenchmark::Object*> objects;
|
||||
btClock wallclock;
|
||||
/* Begin */
|
||||
for(int iexp=0;iexp<nexperiments;++iexp)
|
||||
static const int nexperiments=sizeof(experiments)/sizeof(experiments[0]);
|
||||
btAlignedObjectArray<btBroadphaseBenchmark::Object*> objects;
|
||||
btClock wallclock;
|
||||
/* Begin */
|
||||
for(int iexp=0;iexp<nexperiments;++iexp)
|
||||
{
|
||||
const btBroadphaseBenchmark::Experiment& experiment=experiments[iexp];
|
||||
const int object_count=experiment.object_count;
|
||||
const int update_count=(object_count*experiment.update_count)/100;
|
||||
const int spawn_count=(object_count*experiment.spawn_count)/100;
|
||||
const btScalar speed=experiment.speed;
|
||||
const btScalar amplitude=experiment.amplitude;
|
||||
printf("Experiment #%u '%s':\r\n",iexp,experiment.name);
|
||||
printf("\tObjects: %u\r\n",object_count);
|
||||
printf("\tUpdate: %u\r\n",update_count);
|
||||
printf("\tSpawn: %u\r\n",spawn_count);
|
||||
printf("\tSpeed: %f\r\n",speed);
|
||||
printf("\tAmplitude: %f\r\n",amplitude);
|
||||
srand(180673);
|
||||
/* Create objects */
|
||||
wallclock.reset();
|
||||
objects.reserve(object_count);
|
||||
for(int i=0;i<object_count;++i)
|
||||
const btBroadphaseBenchmark::Experiment& experiment=experiments[iexp];
|
||||
const int object_count=experiment.object_count;
|
||||
const int update_count=(object_count*experiment.update_count)/100;
|
||||
const int spawn_count=(object_count*experiment.spawn_count)/100;
|
||||
const btScalar speed=experiment.speed;
|
||||
const btScalar amplitude=experiment.amplitude;
|
||||
printf("Experiment #%u '%s':\r\n",iexp,experiment.name);
|
||||
printf("\tObjects: %u\r\n",object_count);
|
||||
printf("\tUpdate: %u\r\n",update_count);
|
||||
printf("\tSpawn: %u\r\n",spawn_count);
|
||||
printf("\tSpeed: %f\r\n",speed);
|
||||
printf("\tAmplitude: %f\r\n",amplitude);
|
||||
srand(180673);
|
||||
/* Create objects */
|
||||
wallclock.reset();
|
||||
objects.reserve(object_count);
|
||||
for(int i=0;i<object_count;++i)
|
||||
{
|
||||
btBroadphaseBenchmark::Object* po=new btBroadphaseBenchmark::Object();
|
||||
po->center[0]=btBroadphaseBenchmark::UnitRand()*50;
|
||||
po->center[1]=btBroadphaseBenchmark::UnitRand()*50;
|
||||
po->center[2]=btBroadphaseBenchmark::UnitRand()*50;
|
||||
po->extents[0]=btBroadphaseBenchmark::UnitRand()*2+2;
|
||||
po->extents[1]=btBroadphaseBenchmark::UnitRand()*2+2;
|
||||
po->extents[2]=btBroadphaseBenchmark::UnitRand()*2+2;
|
||||
po->time=btBroadphaseBenchmark::UnitRand()*2000;
|
||||
po->proxy=pbi->createProxy(po->center-po->extents,po->center+po->extents,0,po,1,1,0,0);
|
||||
objects.push_back(po);
|
||||
btBroadphaseBenchmark::Object* po=new btBroadphaseBenchmark::Object();
|
||||
po->center[0]=btBroadphaseBenchmark::UnitRand()*50;
|
||||
po->center[1]=btBroadphaseBenchmark::UnitRand()*50;
|
||||
po->center[2]=btBroadphaseBenchmark::UnitRand()*50;
|
||||
po->extents[0]=btBroadphaseBenchmark::UnitRand()*2+2;
|
||||
po->extents[1]=btBroadphaseBenchmark::UnitRand()*2+2;
|
||||
po->extents[2]=btBroadphaseBenchmark::UnitRand()*2+2;
|
||||
po->time=btBroadphaseBenchmark::UnitRand()*2000;
|
||||
po->proxy=pbi->createProxy(po->center-po->extents,po->center+po->extents,0,po,1,1,0,0);
|
||||
objects.push_back(po);
|
||||
}
|
||||
btBroadphaseBenchmark::OutputTime("\tInitialization",wallclock);
|
||||
/* First update */
|
||||
wallclock.reset();
|
||||
for(int i=0;i<objects.size();++i)
|
||||
btBroadphaseBenchmark::OutputTime("\tInitialization",wallclock);
|
||||
/* First update */
|
||||
wallclock.reset();
|
||||
for(int i=0;i<objects.size();++i)
|
||||
{
|
||||
objects[i]->update(speed,amplitude,pbi);
|
||||
objects[i]->update(speed,amplitude,pbi);
|
||||
}
|
||||
btBroadphaseBenchmark::OutputTime("\tFirst update",wallclock);
|
||||
/* Updates */
|
||||
wallclock.reset();
|
||||
for(int i=0;i<experiment.iterations;++i)
|
||||
btBroadphaseBenchmark::OutputTime("\tFirst update",wallclock);
|
||||
/* Updates */
|
||||
wallclock.reset();
|
||||
for(int i=0;i<experiment.iterations;++i)
|
||||
{
|
||||
for(int j=0;j<update_count;++j)
|
||||
for(int j=0;j<update_count;++j)
|
||||
{
|
||||
objects[j]->update(speed,amplitude,pbi);
|
||||
objects[j]->update(speed,amplitude,pbi);
|
||||
}
|
||||
pbi->calculateOverlappingPairs(0);
|
||||
pbi->calculateOverlappingPairs(0);
|
||||
}
|
||||
btBroadphaseBenchmark::OutputTime("\tUpdate",wallclock,experiment.iterations);
|
||||
/* Clean up */
|
||||
wallclock.reset();
|
||||
for(int i=0;i<objects.size();++i)
|
||||
btBroadphaseBenchmark::OutputTime("\tUpdate",wallclock,experiment.iterations);
|
||||
/* Clean up */
|
||||
wallclock.reset();
|
||||
for(int i=0;i<objects.size();++i)
|
||||
{
|
||||
pbi->destroyProxy(objects[i]->proxy,0);
|
||||
delete objects[i];
|
||||
pbi->destroyProxy(objects[i]->proxy,0);
|
||||
delete objects[i];
|
||||
}
|
||||
objects.resize(0);
|
||||
btBroadphaseBenchmark::OutputTime("\tRelease",wallclock);
|
||||
objects.resize(0);
|
||||
btBroadphaseBenchmark::OutputTime("\tRelease",wallclock);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -546,3 +724,4 @@ void btDbvtBroadphase::benchmark(btBroadphaseInterface*)
|
||||
#if DBVT_BP_PROFILE
|
||||
#undef SPC
|
||||
#endif
|
||||
|
||||
|
||||
@@ -24,15 +24,15 @@ subject to the following restrictions:
|
||||
//
|
||||
|
||||
#define DBVT_BP_PROFILE 0
|
||||
#define DBVT_BP_SORTPAIRS 1
|
||||
//#define DBVT_BP_SORTPAIRS 1
|
||||
#define DBVT_BP_PREVENTFALSEUPDATE 0
|
||||
#define DBVT_BP_ACCURATESLEEPING 0
|
||||
#define DBVT_BP_ENABLE_BENCHMARK 0
|
||||
#define DBVT_BP_MARGIN (btScalar)0.05
|
||||
|
||||
#if DBVT_BP_PROFILE
|
||||
#define DBVT_BP_PROFILING_RATE 256
|
||||
#include "LinearMath/btQuickprof.h"
|
||||
#define DBVT_BP_PROFILING_RATE 256
|
||||
#include "LinearMath/btQuickprof.h"
|
||||
#endif
|
||||
|
||||
//
|
||||
@@ -40,16 +40,16 @@ subject to the following restrictions:
|
||||
//
|
||||
struct btDbvtProxy : btBroadphaseProxy
|
||||
{
|
||||
/* Fields */
|
||||
btDbvtAabbMm aabb;
|
||||
btDbvtNode* leaf;
|
||||
btDbvtProxy* links[2];
|
||||
int stage;
|
||||
/* ctor */
|
||||
btDbvtProxy(void* userPtr,short int collisionFilterGroup, short int collisionFilterMask) :
|
||||
btBroadphaseProxy(userPtr,collisionFilterGroup,collisionFilterMask)
|
||||
/* Fields */
|
||||
//btDbvtAabbMm aabb;
|
||||
btDbvtNode* leaf;
|
||||
btDbvtProxy* links[2];
|
||||
int stage;
|
||||
/* ctor */
|
||||
btDbvtProxy(const btVector3& aabbMin,const btVector3& aabbMax,void* userPtr,short int collisionFilterGroup, short int collisionFilterMask) :
|
||||
btBroadphaseProxy(aabbMin,aabbMax,userPtr,collisionFilterGroup,collisionFilterMask)
|
||||
{
|
||||
links[0]=links[1]=0;
|
||||
links[0]=links[1]=0;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -60,57 +60,67 @@ typedef btAlignedObjectArray<btDbvtProxy*> btDbvtProxyArray;
|
||||
///This is a very fast broadphase, especially for very dynamic worlds where many objects are moving. Its insert/add and remove of objects is generally faster than the sweep and prune broadphases btAxisSweep3 and bt32BitAxisSweep3.
|
||||
struct btDbvtBroadphase : btBroadphaseInterface
|
||||
{
|
||||
/* Config */
|
||||
enum {
|
||||
/* Config */
|
||||
enum {
|
||||
DYNAMIC_SET = 0, /* Dynamic set index */
|
||||
FIXED_SET = 1, /* Fixed set index */
|
||||
STAGECOUNT = 2 /* Number of stages */
|
||||
};
|
||||
/* Fields */
|
||||
btDbvt m_sets[2]; // Dbvt sets
|
||||
btDbvtProxy* m_stageRoots[STAGECOUNT+1]; // Stages list
|
||||
btOverlappingPairCache* m_paircache; // Pair cache
|
||||
btScalar m_prediction; // Velocity prediction
|
||||
int m_stageCurrent; // Current stage
|
||||
int m_fupdates; // % of fixed updates per frame
|
||||
int m_dupdates; // % of dynamic updates per frame
|
||||
int m_cupdates; // % of cleanup updates per frame
|
||||
int m_newpairs; // Number of pairs created
|
||||
int m_fixedleft; // Fixed optimization left
|
||||
unsigned m_updates_call; // Number of updates call
|
||||
unsigned m_updates_done; // Number of updates done
|
||||
btScalar m_updates_ratio; // m_updates_done/m_updates_call
|
||||
int m_pid; // Parse id
|
||||
int m_cid; // Cleanup index
|
||||
int m_gid; // Gen id
|
||||
bool m_releasepaircache; // Release pair cache on delete
|
||||
bool m_deferedcollide; // Defere dynamic/static collision to collide call
|
||||
bool m_needcleanup; // Need to run cleanup?
|
||||
};
|
||||
/* Fields */
|
||||
btDbvt m_sets[2]; // Dbvt sets
|
||||
btDbvtProxy* m_stageRoots[STAGECOUNT+1]; // Stages list
|
||||
btOverlappingPairCache* m_paircache; // Pair cache
|
||||
btScalar m_prediction; // Velocity prediction
|
||||
int m_stageCurrent; // Current stage
|
||||
int m_fupdates; // % of fixed updates per frame
|
||||
int m_dupdates; // % of dynamic updates per frame
|
||||
int m_cupdates; // % of cleanup updates per frame
|
||||
int m_newpairs; // Number of pairs created
|
||||
int m_fixedleft; // Fixed optimization left
|
||||
unsigned m_updates_call; // Number of updates call
|
||||
unsigned m_updates_done; // Number of updates done
|
||||
btScalar m_updates_ratio; // m_updates_done/m_updates_call
|
||||
int m_pid; // Parse id
|
||||
int m_cid; // Cleanup index
|
||||
int m_gid; // Gen id
|
||||
bool m_releasepaircache; // Release pair cache on delete
|
||||
bool m_deferedcollide; // Defere dynamic/static collision to collide call
|
||||
bool m_needcleanup; // Need to run cleanup?
|
||||
#if DBVT_BP_PROFILE
|
||||
btClock m_clock;
|
||||
struct {
|
||||
btClock m_clock;
|
||||
struct {
|
||||
unsigned long m_total;
|
||||
unsigned long m_ddcollide;
|
||||
unsigned long m_fdcollide;
|
||||
unsigned long m_cleanup;
|
||||
unsigned long m_jobcount;
|
||||
} m_profiling;
|
||||
} m_profiling;
|
||||
#endif
|
||||
/* Methods */
|
||||
btDbvtBroadphase(btOverlappingPairCache* paircache=0);
|
||||
~btDbvtBroadphase();
|
||||
void collide(btDispatcher* dispatcher);
|
||||
void optimize();
|
||||
/* btBroadphaseInterface Implementation */
|
||||
btBroadphaseProxy* createProxy(const btVector3& aabbMin,const btVector3& aabbMax,int shapeType,void* userPtr,short int collisionFilterGroup,short int collisionFilterMask,btDispatcher* dispatcher,void* multiSapProxy);
|
||||
void destroyProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher);
|
||||
void setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax,btDispatcher* dispatcher);
|
||||
void calculateOverlappingPairs(btDispatcher* dispatcher);
|
||||
btOverlappingPairCache* getOverlappingPairCache();
|
||||
const btOverlappingPairCache* getOverlappingPairCache() const;
|
||||
void getBroadphaseAabb(btVector3& aabbMin,btVector3& aabbMax) const;
|
||||
void printStats();
|
||||
static void benchmark(btBroadphaseInterface*);
|
||||
/* Methods */
|
||||
btDbvtBroadphase(btOverlappingPairCache* paircache=0);
|
||||
~btDbvtBroadphase();
|
||||
void collide(btDispatcher* dispatcher);
|
||||
void optimize();
|
||||
/* btBroadphaseInterface Implementation */
|
||||
btBroadphaseProxy* createProxy(const btVector3& aabbMin,const btVector3& aabbMax,int shapeType,void* userPtr,short int collisionFilterGroup,short int collisionFilterMask,btDispatcher* dispatcher,void* multiSapProxy);
|
||||
void destroyProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher);
|
||||
void setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax,btDispatcher* dispatcher);
|
||||
virtual void rayTest(const btVector3& rayFrom,const btVector3& rayTo, btBroadphaseRayCallback& rayCallback, const btVector3& aabbMin=btVector3(0,0,0), const btVector3& aabbMax = btVector3(0,0,0));
|
||||
|
||||
virtual void getAabb(btBroadphaseProxy* proxy,btVector3& aabbMin, btVector3& aabbMax ) const;
|
||||
void calculateOverlappingPairs(btDispatcher* dispatcher);
|
||||
btOverlappingPairCache* getOverlappingPairCache();
|
||||
const btOverlappingPairCache* getOverlappingPairCache() const;
|
||||
void getBroadphaseAabb(btVector3& aabbMin,btVector3& aabbMax) const;
|
||||
void printStats();
|
||||
static void benchmark(btBroadphaseInterface*);
|
||||
|
||||
|
||||
void performDeferredRemoval(btDispatcher* dispatcher);
|
||||
|
||||
///reset broadphase internal structures, to ensure determinism/reproducability
|
||||
virtual void resetPool(btDispatcher* dispatcher);
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -46,22 +46,25 @@ struct btDispatcherInfo
|
||||
m_enableSPU(true),
|
||||
m_useEpa(true),
|
||||
m_allowedCcdPenetration(btScalar(0.04)),
|
||||
m_useConvexConservativeDistanceUtil(true),
|
||||
m_convexConservativeDistanceThreshold(0.0f),
|
||||
m_stackAllocator(0)
|
||||
{
|
||||
|
||||
}
|
||||
btScalar m_timeStep;
|
||||
int m_stepCount;
|
||||
int m_dispatchFunc;
|
||||
int m_stepCount;
|
||||
int m_dispatchFunc;
|
||||
mutable btScalar m_timeOfImpact;
|
||||
bool m_useContinuous;
|
||||
bool m_useContinuous;
|
||||
class btIDebugDraw* m_debugDraw;
|
||||
bool m_enableSatConvex;
|
||||
bool m_enableSPU;
|
||||
bool m_useEpa;
|
||||
bool m_enableSatConvex;
|
||||
bool m_enableSPU;
|
||||
bool m_useEpa;
|
||||
btScalar m_allowedCcdPenetration;
|
||||
bool m_useConvexConservativeDistanceUtil;
|
||||
btScalar m_convexConservativeDistanceThreshold;
|
||||
btStackAlloc* m_stackAllocator;
|
||||
|
||||
};
|
||||
|
||||
///The btDispatcher interface class can be used in combination with broadphase to dispatch calculations for overlapping pairs.
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user