Compare commits

..

43 Commits

Author SHA1 Message Date
f750a68a26 Useless final sound system branch update. 2009-08-11 20:48:19 +00:00
88beab2cce Sound Branch:
* Last commit before merge to 2.5
* Merge until revision 22324 of 2.5 branch
* Fixes for some compiler warnings
* Updated some build system files
2009-08-09 18:14:07 +00:00
212851e176 Sound Branch:
* Added some documentation.
 * Fixed the loading of sounds from libraries.
2009-08-07 09:38:24 +00:00
b84ee4f7ff Update for cmake for the new openal libs. 2009-08-06 18:22:41 +00:00
0596724fbb Code cleanup for the merge. 2009-08-06 13:40:44 +00:00
Nathan Letwory
b27f89d3d2 copy openal dlls 2009-08-05 15:29:45 +00:00
Nathan Letwory
d6c2413817 * config changes for newer openal and samplerate change 2009-08-05 14:42:42 +00:00
a73d3c0a74 Update for new windows OpenAL libs. 2009-08-05 14:12:49 +00:00
6cf9016dc6 OpenALDevice update to work with windows pthreads library. 2009-08-05 10:53:25 +00:00
3389f04bc1 Merge to revision 22221 of 2.5 branch. 2009-08-05 09:45:52 +00:00
20ea6bac2d Merge with 2.5 branch to revision 22207. 2009-08-04 07:28:17 +00:00
a917e1d6de Sound settings from pre 2.5 files are now loaded into SoundActuators. 2009-08-03 08:16:36 +00:00
04d5344cae Loading pre 2.5 files now works flawlessly. 2009-08-02 20:34:12 +00:00
40c8585e84 svn 2.5 branch merge r22138 to r22143 2009-08-02 12:49:53 +00:00
96cc681825 Fix for sound structures to work with makesdna. 2009-08-02 10:16:31 +00:00
d31bfdc78f Fixed an include error, included an FFMPEG file where not needed. 2009-08-02 07:47:52 +00:00
9cd522d650 Windows build system update. 2009-07-31 22:58:22 +00:00
831e93a318 Added sound caching. 2009-07-31 19:48:28 +00:00
c34203b834 Updated sequencer; now you can load movie and sound together. Also removed the difference between RAM and HD sound. 2009-07-31 15:58:15 +00:00
393e580082 * Merge with 2.5 branch revision 21915 to 22079
* SoundActuator update
2009-07-31 12:29:28 +00:00
a3dd5d04b3 Added audio device settings. You can even switch them while playing! 2009-07-30 18:52:21 +00:00
368d9a1747 Added ffmpeg audio mixdown. 2009-07-30 10:33:41 +00:00
e5ee83a628 More accurate seeking with ffmpeg. 2009-07-29 11:56:49 +00:00
519cf33f85 Sound Branch:
Readded scrubbing.
2009-07-29 08:02:50 +00:00
f7b2917908 Sound Branch
Sequencer audio update, still not perfect, but improving.
2009-07-28 18:42:26 +00:00
154c7c97f4 * 2.5 merge revision 21713 to 21915
* fixed a bug in the OpenAL Device resulting in a crash when exiting while sounds are playing
2009-07-26 09:28:33 +00:00
25aa8d37b5 Initial (ugly) sequencer sound support. 2009-07-24 18:28:09 +00:00
4d1d1480eb cmake update for win32 regarding libsamplerate aka SRC 2009-07-22 20:23:23 +00:00
e7141b2bfb Added support for 3D audio and other GE stuff, like volume, pitch and ping pong looping. 2009-07-22 14:14:26 +00:00
a668ffb6e2 blender sound structure internals update:
* file writing/loading
* bSample removed
* blenkernel/BKE_sound.h updated
* fixed a bug in AUD_OpenALDevice that crashed the app if quitted after no sound played
2009-07-21 13:21:14 +00:00
Nathan Letwory
6f1718015a copy samplerate dll too 2009-07-21 13:15:29 +00:00
Nathan Letwory
9ae679289f with correct libname it even links properly 2009-07-21 11:51:43 +00:00
Nathan Letwory
a1c270851d some fixes so this compiles on windows. 2009-07-21 11:34:55 +00:00
79c9fce2d7 New (updated) C-API! 2009-07-20 16:06:03 +00:00
94ff22d9e1 audaspace update including build system adoptions for linux, all other OSs are not expected to work yet due to missing libsamplerate aka SRC 2009-07-20 12:05:18 +00:00
456672efd0 svn merge with 2.5 branch from revision 21504 to 21713 2009-07-20 07:50:57 +00:00
263670abb0 * fixed error of msvc complaining about empty structs in C
* fixed bug of non stopping sound actuator on replay
2009-07-11 18:39:07 +00:00
28f5c0074f BGE now uses the audaspace library for sound output. 3D sound and several settings have been lost for the moment. 2009-07-11 15:07:36 +00:00
f759f48ae0 Merged with 2.5 branch revision 21504 2009-07-10 19:55:16 +00:00
cd55b358a8 Implemented a basic C API. 2009-07-10 11:50:51 +00:00
8a27080f00 Added pthreads includes for windows building. 2009-07-10 08:05:13 +00:00
3e160cbe4b Updated default scons configuration for other platforms. 2009-07-10 07:31:46 +00:00
2dcea756af 3 first big steps:
- Merged with 2.5 branch
- Added first version of audaspace
- Update build systems
2009-07-09 21:41:38 +00:00
1177 changed files with 59376 additions and 79758 deletions

View File

@@ -42,40 +42,17 @@ MACRO(SETUP_LIBDIRS)
if(COMMAND cmake_policy)
CMAKE_POLICY(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
LINK_DIRECTORIES(${JPEG_LIBPATH} ${PNG_LIBPATH} ${ZLIB_LIBPATH} ${FREETYPE_LIBPATH} ${LIBSAMPLERATE_LIBPATH})
IF(WITH_PYTHON)
LINK_DIRECTORIES(${PYTHON_LIBPATH})
ENDIF(WITH_PYTHON)
LINK_DIRECTORIES(${PYTHON_LIBPATH} ${SDL_LIBPATH} ${JPEG_LIBPATH} ${PNG_LIBPATH} ${ZLIB_LIBPATH} ${ICONV_LIBPATH} ${OPENEXR_LIBPATH} ${QUICKTIME_LIBPATH} ${FFMPEG_LIBPATH})
LINK_DIRECTORIES(${FREETYPE_LIBPATH} ${LIBSAMPLERATE_LIBPATH})
IF(WITH_INTERNATIONAL)
LINK_DIRECTORIES(${ICONV_LIBPATH})
LINK_DIRECTORIES(${GETTEXT_LIBPATH})
ENDIF(WITH_INTERNATIONAL)
IF(WITH_SDL)
LINK_DIRECTORIES(${SDL_LIBPATH})
ENDIF(WITH_SDL)
IF(WITH_FFMPEG)
LINK_DIRECTORIES(${FFMPEG_LIBPATH})
ENDIF(WITH_FFMPEG)
IF(WITH_OPENEXR)
LINK_DIRECTORIES(${OPENEXR_LIBPATH})
ENDIF(WITH_OPENEXR)
IF(WITH_QUICKTIME)
LINK_DIRECTORIES(${QUICKTIME_LIBPATH})
ENDIF(WITH_QUICKTIME)
IF(WITH_OPENAL)
LINK_DIRECTORIES(${OPENAL_LIBPATH})
ENDIF(WITH_OPENAL)
IF(WITH_JACK)
LINK_DIRECTORIES(${JACK_LIBPATH})
ENDIF(WITH_JACK)
IF(WITH_SNDFILE)
LINK_DIRECTORIES(${SNDFILE_LIBPATH})
ENDIF(WITH_SNDFILE)
IF(WITH_FFTW3)
LINK_DIRECTORIES(${FFTW3_LIBPATH})
ENDIF(WITH_FFTW3)
ENDIF(WITH_FFTW3)
IF(WIN32)
LINK_DIRECTORIES(${PTHREADS_LIBPATH})
@@ -85,48 +62,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_LIBRARY} ${LLIBS})
#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_LINKFLAGS} ${JPEG_LIBRARY} ${PNG_LIBRARIES} ${ZLIB_LIBRARIES} ${LLIBS})
TARGET_LINK_LIBRARIES(${target} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${PYTHON_LINKFLAGS} ${FFTW3_LIB} ${JPEG_LIBRARY} ${PNG_LIBRARIES} ${ZLIB_LIBRARIES} ${SDL_LIB} ${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})
TARGET_LINK_LIBRARIES(${target} debug ${PYTHON_LIB}_d)
TARGET_LINK_LIBRARIES(${target} optimized ${PYTHON_LIB})
ELSE(WIN32)
TARGET_LINK_LIBRARIES(${target} ${PYTHON_LIB})
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})
TARGET_LINK_LIBRARIES(${target} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${PYTHON_LINKFLAGS} ${JPEG_LIB} ${PNG_LIB} ${ZLIB_LIB} ${SDL_LIB} ${LLIBS})
TARGET_LINK_LIBRARIES(${target} ${FREETYPE_LIB} ${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})
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} ${GETTEXT_LIB})
ENDIF(WITH_INTERNATIONAL)
IF(WITH_OPENAL)
TARGET_LINK_LIBRARIES(${target} ${OPENAL_LIBRARY})
TARGET_LINK_LIBRARIES(${target} ${OPENAL_LIB})
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)
@@ -143,4 +120,3 @@ MACRO(SETUP_LIBLINKS
TARGET_LINK_LIBRARIES(${target} ${PTHREADS_LIB})
ENDIF(WIN32)
ENDMACRO(SETUP_LIBLINKS)

View File

@@ -25,20 +25,20 @@
# ***** END GPL LICENSE BLOCK *****
#-----------------------------------------------------------------------------
# We don't allow in-source builds. This causes no end of troubles because
# all out-of-source builds will use the CMakeCache.txt file there and even
# build the libs and objects in it. It will also conflict with the current
# We don't allow in-source builds. This causes no end of troubles because
# all out-of-source builds will use the CMakeCache.txt file there and even
# build the libs and objects in it. It will also conflict with the current
# Makefile system for Blender
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.:
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,36 +53,31 @@ 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_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)
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/)" ON)
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)
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:
# On Unix:
# On Unix:
# cmake -D PYTHON_LIB=/usr/local/lib/python2.3/config/libpython2.3.so -D PYTHON_INC=/usr/local/include/python2.3 -D PYTHON_BINARY=/usr/local/bin/python2.3 -G "Unix Makefiles" ../blender
# On Macs:
# On Macs:
# cmake -D PYTHON_INC=/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -D PYTHON_LIBPATH=/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/config -D PYTHON_BINARY=/System/Library/Frameworks/Python.framework/Versions/2.5/bin/python2.5 -G Xcode ../blender
#
# When changing any of this remember to update the notes in doc/blender-cmake.txt
@@ -95,434 +90,364 @@ INCLUDE(CMake/macros.cmake)
#Platform specifics
IF(UNIX AND NOT APPLE)
IF(WITH_OPENAL)
FIND_PACKAGE(OpenAL)
IF(OPENAL_FOUND)
SET(WITH_OPENAL ON)
ELSE(OPENAL_FOUND)
SET(WITH_OPENAL OFF)
ENDIF(OPENAL_FOUND)
ENDIF(WITH_OPENAL)
IF(WITH_OPENAL)
FIND_PACKAGE(OpenAL)
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)
ENDIF(WITH_OPENAL)
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
/sw/lib
)
FIND_LIBRARY(ICONV_LIBRARY
NAMES iconv
PATHS
/sw/lib
)
IF(INTL_LIBRARY AND ICONV_LIBRARY)
SET(GETTEXT_LIB ${INTL_LIBRARY} ${ICONV_LIBRARY})
ENDIF(INTL_LIBRARY AND ICONV_LIBRARY)
IF(WITH_SNDFILE)
SET(SNDFILE /usr)
SET(SNDFILE_INC ${SNDFILE}/include)
SET(SNDFILE_LIB sndfile)
SET(SNDFILE_LIBPATH ${SNDFILE}/lib)
ENDIF(WITH_SNDFILE)
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)
FIND_LIBRARY(INTL_LIBRARY
NAMES intl
PATHS
/sw/lib
)
FIND_LIBRARY(ICONV_LIBRARY
NAMES iconv
PATHS
/sw/lib
)
FIND_PACKAGE(PythonLibs)
SET(PYTHON_INC "${PYTHON_INCLUDE_PATH}" CACHE STRING "")
SET(PYTHON_LIB "${PYTHON_LIBRARIES}" CACHE STRING "")
FIND_PACKAGE(PythonInterp)
SET(PYTHON_BINARY ${PYTHON_EXECUTABLE} CACHE STRING "")
SET(PYTHON_LINKFLAGS "-Xlinker -export-dynamic")
IF(WITH_SDL)
FIND_PACKAGE(SDL)
SET(SDL_INC ${SDL_INCLUDE_DIR})
SET(SDL_LIB ${SDL_LIBRARY})
ENDIF(WITH_SDL)
FIND_PATH(OPENEXR_INC
ImfXdr.h
PATHS
/usr/local/include/OpenEXR
/usr/include/OpenEXR
/sw/include/OpenEXR
/opt/local/include/OpenEXR
/opt/csw/include/OpenEXR
/opt/include/OpenEXR
)
SET(OPENEXR_LIB Half IlmImf Iex Imath)
SET(FFMPEG /usr)
SET(FFMPEG_INC ${FFMPEG}/include)
SET(FFMPEG_LIB avformat avcodec avutil avdevice swscale)
SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
IF(INTL_LIBRARY AND ICONV_LIBRARY)
SET(GETTEXT_LIB ${INTL_LIBRARY} ${ICONV_LIBRARY})
ENDIF(INTL_LIBRARY AND ICONV_LIBRARY)
IF(WITH_FFTW3)
SET(FFTW3 /usr)
SET(FFTW3_INC ${FFTW3}/include)
SET(FFTW3_LIB fftw3)
SET(FFTW3_LIBPATH ${FFTW3}/lib)
ENDIF(WITH_FFTW3)
FIND_PACKAGE(Freetype)
# UNSET(FREETYPE_INCLUDE_DIRS CACHE) # cant use
SET(LIBSAMPLERATE /usr)
SET(LIBSAMPLERATE_INC ${LIBSAMPLERATE}/include)
SET(LIBSAMPLERATE_LIB samplerate)
SET(LIBSAMPLERATE_LIBPATH ${LIBSAMPLERATE}/lib)
# 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_PACKAGE(JPEG REQUIRED)
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)
FIND_PACKAGE(PNG REQUIRED)
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)
FIND_PACKAGE(ZLIB REQUIRED)
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(LLIBS "-lXi -lutil -lc -lm -lpthread -lstdc++ -lX11 -ldl")
SET(LIBSAMPLERATE /usr)
SET(LIBSAMPLERATE_INC ${LIBSAMPLERATE}/include)
SET(LIBSAMPLERATE_LIB samplerate)
SET(LIBSAMPLERATE_LIBPATH ${LIBSAMPLERATE}/lib)
FIND_PACKAGE(JPEG REQUIRED)
FIND_PACKAGE(PNG REQUIRED)
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)
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")
# 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")
# Better warnings
SET(C_WARNINGS "-Wall -Wno-char-subscripts -Wpointer-arith -Wcast-align -Wnested-externs -Wdeclaration-after-statement")
INCLUDE_DIRECTORIES(${JPEG_INCLUDE_DIR} ${PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} )
INCLUDE_DIRECTORIES(${JPEG_INCLUDE_DIR} ${PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} )
ENDIF(UNIX AND NOT APPLE)
IF(WIN32)
# this file is included anyway when building under Windows with cl.exe
# 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)
# 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.6)
SET(PYTHON_INC "${PYTHON}/include/python${PYTHON_VERSION}")
SET(PYTHON_BINARY python)
SET(PYTHON_LIB python26)
SET(PYTHON_LIBPATH ${PYTHON}/lib)
IF(CMAKE_CL_64)
SET(WITH_OPENAL OFF)
ELSE(CMAKE_CL_64)
#SET(WITH_OPENAL ON)
SET(OPENAL ${LIBDIR}/openal)
SET(OPENAL_INC ${OPENAL}/include)
SET(OPENAL_LIB wrap_oal)
SET(OPENAL_LIBPATH ${OPENAL}/lib)
ENDIF(CMAKE_CL_64)
IF(CMAKE_CL_64)
SET(PNG_LIBRARIES libpng)
ELSE(CMAKE_CL_64)
SET(PNG_LIBRARIES libpng_st)
ENDIF(CMAKE_CL_64)
SET(JPEG_LIBRARY libjpeg)
SET(ZLIB ${LIBDIR}/zlib)
SET(ZLIB_INC ${ZLIB}/include)
SET(ZLIB_LIBRARIES zlib)
SET(ZLIB_LIBPATH ${ZLIB}/lib)
SET(PTHREADS ${LIBDIR}/pthreads)
SET(PTHREADS_INC ${PTHREADS}/include)
SET(PTHREADS_LIB pthreadVC2)
SET(PTHREADS_LIBPATH ${PTHREADS}/lib)
SET(ICONV ${LIBDIR}/iconv)
SET(ICONV_INC ${ICONV}/include)
SET(ICONV_LIB iconv)
SET(ICONV_LIBPATH ${ICONV}/lib)
IF(WITH_FFTW3)
SET(FFTW3 ${LIBDIR}/fftw3)
SET(FFTW3_INC ${FFTW3}/include)
SET(FFTW3_LIB libfftw)
SET(FFTW3_LIBPATH ${FFTW3}/lib)
ENDIF(WITH_FFTW3)
SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/windows)
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)
# 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(FREETYPE ${LIBDIR}/freetype)
SET(FREETYPE_INC ${FREETYPE}/include ${FREETYPE}/include/freetype2)
SET(FREETYPE_LIBPATH ${FREETYPE}/lib)
SET(FREETYPE_LIB freetype2ST)
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(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)
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(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(QUICKTIME ${LIBDIR}/QTDevWin)
SET(QUICKTIME_INC ${QUICKTIME}/CIncludes)
SET(QUICKTIME_LIB qtmlClient)
SET(QUICKTIME_LIBPATH ${QUICKTIME}/Libraries)
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)
SET(FFMPEG ${LIBDIR}/ffmpeg)
SET(FFMPEG_INC ${FFMPEG}/include)
SET(FFMPEG_LIB avcodec-52 avformat-52 avdevice-52 avutil-50 swscale-0)
SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
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(LIBSAMPLERATE ${LIBDIR}/samplerate)
SET(LIBSAMPLERATE_INC ${LIBSAMPLERATE}/include)
SET(LIBSAMPLERATE_LIB libsamplerate)
SET(LIBSAMPLERATE_LIBPATH ${LIBSAMPLERATE}/lib)
SET(ZLIB ${LIBDIR}/zlib)
SET(ZLIB_INC ${ZLIB}/include)
IF(CMAKE_CL_64)
SET(ZLIB_LIBRARIES libz)
ELSE(CMAKE_CL_64)
SET(ZLIB_LIBRARIES zlib)
ENDIF(CMAKE_CL_64)
SET(ZLIB_LIBPATH ${ZLIB}/lib)
SET(PTHREADS ${LIBDIR}/pthreads)
SET(PTHREADS_INC ${PTHREADS}/include)
SET(PTHREADS_LIB pthreadVC2)
SET(PTHREADS_LIBPATH ${PTHREADS}/lib)
SET(ICONV ${LIBDIR}/iconv)
SET(ICONV_INC ${ICONV}/include)
SET(ICONV_LIB iconv)
SET(ICONV_LIBPATH ${ICONV}/lib)
IF(WITH_FFTW3)
SET(FFTW3 ${LIBDIR}/fftw3)
SET(FFTW3_INC ${FFTW3}/include)
SET(FFTW3_LIB libfftw)
SET(FFTW3_LIBPATH ${FFTW3}/lib)
ENDIF(WITH_FFTW3)
SET(GETTEXT ${LIBDIR}/gettext)
SET(GETTEXT_INC ${GETTEXT}/include)
IF(CMAKE_CL_64)
SET(GETTEXT_LIB gettext)
ELSE(CMAKE_CL_64)
SET(GETTEXT_LIB gnu_gettext)
ENDIF(CMAKE_CL_64)
SET(GETTEXT_LIBPATH ${GETTEXT}/lib)
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(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(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)
SET(QUICKTIME ${LIBDIR}/QTDevWin)
SET(QUICKTIME_INC ${QUICKTIME}/CIncludes)
SET(QUICKTIME_LIB qtmlClient)
SET(QUICKTIME_LIBPATH ${QUICKTIME}/Libraries)
IF(WITH_OPENMP)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /openmp ")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /openmp ")
ENDIF(WITH_OPENMP)
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)
SET(SDL ${LIBDIR}/sdl)
SET(SDL_INC ${SDL}/include)
SET(SDL_LIB SDL)
SET(SDL_LIBPATH ${SDL}/lib)
SET(LIBSAMPLERATE ${LIBDIR}/samplerate)
SET(LIBSAMPLERATE_INC ${LIBSAMPLERATE}/include)
SET(LIBSAMPLERATE_LIB libsamplerate)
SET(LIBSAMPLERATE_LIBPATH ${LIBSAMPLERATE}/lib)
SET(PNG "${LIBDIR}/png")
SET(PNG_INC "${PNG}/include")
SET(PNG_LIBPATH ${PNG}/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(JPEG "${LIBDIR}/jpeg")
SET(JPEG_INC "${JPEG}/include")
SET(JPEG_LIBPATH ${JPEG}/lib)
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)
SET(TIFF ${LIBDIR}/tiff)
SET(TIFF_INC ${TIFF}/include)
IF(WITH_OPENMP)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /openmp ")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /openmp ")
ENDIF(WITH_OPENMP)
SET(WINTAB_INC ${LIBDIR}/wintab/include)
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(WINTAB_INC ${LIBDIR}/wintab/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(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:libcmt.lib;libc.lib ")
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 ")
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)
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)
IF(WITH_OPENAL)
FIND_PACKAGE(OpenAL)
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)
ENDIF(WITH_OPENAL)
IF(WITH_JACK)
SET(JACK /usr)
SET(JACK_INC ${JACK}/include/jack)
SET(JACK_LIB jack)
SET(JACK_LIBPATH ${JACK}/lib)
ENDIF(WITH_JACK)
IF(WITH_SNDFILE)
SET(SNDFILE /usr)
SET(SNDFILE_INC ${SNDFILE}/include)
SET(SNDFILE_LIB sndfile)
SET(SNDFILE_LIBPATH ${SNDFILE}/lib)
ENDIF(WITH_SNDFILE)
SET(PYTHON_VERSION 3.1)
SET(PYTHON_VERSION 3.1)
IF(PYTHON_VERSION MATCHES 3.1)
# we use precompiled libraries for py 3.1 and up by default
IF(PYTHON_VERSION MATCHES 3.1)
# we use precompiled libraries for py 3.1 and up by default
SET(PYTHON ${LIBDIR}/python)
SET(PYTHON_INC "${PYTHON}/include/python${PYTHON_VERSION}" CACHE STRING "")
SET(PYTHON_BINARY "${PYTHON}/bin/python${PYTHON_VERSION}" CACHE STRING "")
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(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(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 "")
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(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(GETTEXT ${LIBDIR}/gettext)
SET(GETTEXT_INC "${GETTEXT}/include")
SET(GETTEXT_LIB intl iconv)
SET(GETTEXT_LIBPATH ${GETTEXT}/lib)
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)
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(PNG_LIBRARIES png)
SET(JPEG_LIBRARY jpeg)
SET(PNG_LIBRARIES png)
SET(JPEG_LIBRARY jpeg)
SET(ZLIB /usr)
SET(ZLIB_INC "${ZLIB}/include")
SET(ZLIB_LIBRARIES z)
SET(ZLIB /usr)
SET(ZLIB_INC "${ZLIB}/include")
SET(ZLIB_LIBRARIES z)
SET(FREETYPE ${LIBDIR}/freetype)
SET(FREETYPE_INCLUDE_DIRS ${FREETYPE}/include ${FREETYPE}/include/freetype2)
SET(FREETYPE_LIBPATH ${FREETYPE}/lib)
SET(FREETYPE_LIBRARY freetype)
SET(FREETYPE ${LIBDIR}/freetype)
SET(FREETYPE_INC ${FREETYPE}/include ${FREETYPE}/include/freetype2)
SET(FREETYPE_LIBPATH ${FREETYPE}/lib)
SET(FREETYPE_LIB freetype)
SET(OPENEXR ${LIBDIR}/openexr)
SET(OPENEXR_INC ${OPENEXR}/include/OpenEXR ${OPENEXR}/include)
SET(OPENEXR_LIB Iex Half IlmImf Imath IlmThread)
SET(OPENEXR_LIBPATH ${OPENEXR}/lib)
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(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(LLIBS stdc++ SystemStubs)
SET(LIBSAMPLERATE ${LIBDIR}/samplerate)
SET(LIBSAMPLERATE_INC ${LIBSAMPLERATE}/include)
SET(LIBSAMPLERATE_LIB samplerate)
SET(LIBSAMPLERATE_LIBPATH ${LIBSAMPLERATE}/lib)
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(LLIBS stdc++ SystemStubs)
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")
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(SDL ${LIBDIR}/sdl)
SET(SDL_INC ${SDL}/include)
SET(SDL_LIB SDL)
SET(SDL_LIBPATH ${SDL}/lib)
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(PNG "${LIBDIR}/png")
SET(PNG_INC "${PNG}/include")
SET(PNG_LIBPATH ${PNG}/lib)
SET(SDL ${LIBDIR}/sdl)
SET(SDL_INCLUDE_DIR ${SDL}/include)
SET(SDL_LIBRARY SDL)
SET(SDL_LIBPATH ${SDL}/lib)
SET(JPEG "${LIBDIR}/jpeg")
SET(JPEG_INC "${JPEG}/include")
SET(JPEG_LIBPATH ${JPEG}/lib)
SET(PNG "${LIBDIR}/png")
SET(PNG_INC "${PNG}/include")
SET(PNG_LIBPATH ${PNG}/lib)
SET(TIFF ${LIBDIR}/tiff)
SET(TIFF_INC ${TIFF}/include)
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)
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.
@@ -533,11 +458,11 @@ 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")
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(WITH_PLAYER ON)
SET(WITH_PLAYER ON)
ENDIF(WITH_WEBPLUGIN)
@@ -545,18 +470,16 @@ ENDIF(WITH_WEBPLUGIN)
# Configure OpenGL.
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} ${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)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${PLATFORM_CFLAGS} ")
#-----------------------------------------------------------------------------
# Libraries
@@ -574,6 +497,5 @@ ADD_SUBDIRECTORY(source/creator)
#-----------------------------------------------------------------------------
# Blender Player
IF(WITH_PLAYER)
ADD_SUBDIRECTORY(source/blenderplayer)
ADD_SUBDIRECTORY(blenderplayer)
ENDIF(WITH_PLAYER)

View File

@@ -60,6 +60,7 @@ B = tools.Blender
platform = sys.platform
quickie = None
quickdebug = None
nsis_build = None
##### BEGIN SETUP #####
@@ -207,6 +208,7 @@ if env['WITH_BF_OPENMP'] == 1:
env.Append(CCFLAGS=['-fopenmp'])
env.Append(CPPFLAGS=['-fopenmp'])
env.Append(CXXFLAGS=['-fopenmp'])
# env.Append(LINKFLAGS=['-fprofile-generate'])
#check for additional debug libnames
@@ -300,6 +302,7 @@ if env['WITH_BF_SDL'] == False and env['OURPLATFORM'] in ('win32-vc', 'win32-min
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:
@@ -390,7 +393,7 @@ 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':
if not tp == 'player' and not tp == 'player2':
mainlist += B.create_blender_liblist(env, tp)
if B.arguments.get('BF_PRIORITYLIST', '0')=='1':
@@ -400,12 +403,14 @@ dobj = B.buildinfo(env, "dynamic") + B.resources
thestatlibs, thelibincs = B.setup_staticlibs(env)
thesyslibs = B.setup_syslibs(env)
if env['WITH_BF_PLAYER']:
print("Warning: Game player may not build on 2.5")
if 'blender' in B.targets or not env['WITH_BF_NOBLENDER']:
#env.BlenderProg(B.root_build_dir, "blender", dobj , [], mainlist + thestatlibs + thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blender')
env.BlenderProg(B.root_build_dir, "blender", dobj + mainlist, [], thestatlibs + thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blender')
if env['WITH_BF_PLAYER']:
playerlist = B.create_blender_liblist(env, 'player')
playerlist += B.create_blender_liblist(env, 'intern')
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
@@ -420,6 +425,8 @@ if env['OURPLATFORM']=='darwin':
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):]
@@ -436,6 +443,8 @@ 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')
@@ -462,6 +471,8 @@ if env['OURPLATFORM']!='darwin':
scriptpaths=['release/scripts', 'release/ui', 'release/io']
for scriptpath in scriptpaths:
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/'+os.path.basename(scriptpath)+dp[len(scriptpath):]
@@ -474,6 +485,8 @@ 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:
@@ -496,6 +509,8 @@ if env['OURPLATFORM']=='linuxcross':
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:
@@ -526,6 +541,8 @@ for targetdir,srcfile in zip(plugtargetlist, pluglist):
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:
@@ -571,16 +588,17 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc'):
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/libfaad-2.dll',
'${LCGDIR}/ffmpeg/lib/libfaac-0.dll',
'${LCGDIR}/ffmpeg/lib/libmp3lame-0.dll',
'${LCGDIR}/ffmpeg/lib/libx264-67.dll',
'${LCGDIR}/ffmpeg/lib/xvidcore.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

View File

@@ -0,0 +1,132 @@
# $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(CMAKE_SYSTEM_NAME MATCHES "Linux")
ADD_DEFINITIONS(-DWITH_BINRELOC)
INCLUDE_DIRECTORIES(${BINRELOC_INC})
ENDIF(CMAKE_SYSTEM_NAME MATCHES "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_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_blenlib
bf_cineon
bf_openexr
extern_libopenjpeg
bf_dds
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)

View File

@@ -1,3 +1,10 @@
#
# 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
@@ -56,7 +63,7 @@ if BF_PYTHON_VERSION=='3.1':
# 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']
# BF_PYTHON_LINKFLAGS = '-u _PyMac_Error -framework System'
else:
# python 2.5 etc. uses built-in framework
@@ -72,9 +79,9 @@ else:
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']
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_PYTHON_LINKFLAGS ='-u __dummy '+BF_PYTHON_LINKFLAGS
BF_QUIET = '1'
WITH_BF_OPENMP = '0'
@@ -105,19 +112,6 @@ 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)
@@ -207,18 +201,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 = 'samplerate'
BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
# Mesa Libs should go here if your using them as well....
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']
@@ -227,12 +226,12 @@ LLIBS = ['stdc++', 'SystemStubs']
if MAC_MIN_VERS == '10.3':
CFLAGS = ['-fuse-cxa-atexit']+CFLAGS
CXXFLAGS = ['-fuse-cxa-atexit']+CXXFLAGS
PLATFORM_LINKFLAGS = ['-fuse-cxa-atexit']+PLATFORM_LINKFLAGS
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

View File

@@ -27,18 +27,6 @@ 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)
@@ -91,6 +79,23 @@ 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 = '/usr'
BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2'
@@ -170,9 +175,8 @@ REL_CCFLAGS = ['-O2']
##ARFLAGSQUIET = ru
##
C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement']
CC_WARN = ['-Wall']
CXX_WARN = ['-Wno-invalid-offsetof', '-Wno-sign-compare']
CC_WARN = ['-Wall']
##FIX_STUBS_WARNINGS = -Wno-unused

View File

@@ -3,9 +3,14 @@ LIBDIR = "${LCGDIR}"
BF_PYTHON = LIBDIR + '/python'
BF_PYTHON_VERSION = '3.1'
#BF_PYTHON_VERSION = '2.6'
#BF_PYTHON_VERSION = '2.6'
WITH_BF_STATICPYTHON = False
BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}'
BF_PYTHON_BINARY = 'python'
#BF_PYTHON_LIB = 'python25'
#BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib/lib25_vs2005'
#BF_PYTHON_LIB_STATIC = '${BF_PYTHON}/lib/lib25_vs2005/libpython25.a'
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'
@@ -17,27 +22,15 @@ BF_OPENAL_LIB = 'wrap_oal'
BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
WITH_BF_FFMPEG = False
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_FFMPEG_LIB = 'avformat swscale avcodec avutil avdevice xvidcore x264'
BF_FFMPEG_LIBPATH = LIBDIR + '/gcc/ffmpeg/lib'
BF_FFMPEG_INC = LIBDIR + '/gcc/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'
BF_SDL_INC = '${BF_SDL}/include'
@@ -100,6 +93,20 @@ BF_BULLET_LIB = 'extern_bullet'
BF_WINTAB = LIBDIR + '/wintab'
BF_WINTAB_INC = '${BF_WINTAB}/INCLUDE'
#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'

View File

@@ -4,7 +4,7 @@ LIBDIR = '${LCGDIR}'
# enable ffmpeg support
WITH_BF_FFMPEG = True # -DWITH_FFMPEG
BF_FFMPEG = LIBDIR +'/ffmpeg'
BF_FFMPEG_INC = '${BF_FFMPEG}/include ${BF_FFMPEG}/include/msvc'
BF_FFMPEG_INC = '${BF_FFMPEG}/include'
BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
BF_FFMPEG_LIB = 'avformat-52.lib avcodec-52.lib avdevice-52.lib avutil-50.lib swscale-0.lib'
@@ -21,6 +21,11 @@ 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'
@@ -32,18 +37,6 @@ 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'
@@ -109,6 +102,23 @@ 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'
@@ -149,7 +159,6 @@ CXX = 'cl.exe'
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']

View File

@@ -163,7 +163,6 @@ 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']

View File

@@ -25,18 +25,15 @@
# ***** END GPL LICENSE BLOCK *****
IF(WITH_BULLET)
ADD_SUBDIRECTORY(bullet2)
ADD_SUBDIRECTORY(bullet2)
ENDIF(WITH_BULLET)
IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
ADD_SUBDIRECTORY(binreloc)
ADD_SUBDIRECTORY(binreloc)
ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
ADD_SUBDIRECTORY(glew)
IF(WITH_OPENJPEG)
ADD_SUBDIRECTORY(libopenjpeg)
ADD_SUBDIRECTORY(libopenjpeg)
ENDIF(WITH_OPENJPEG)
ADD_SUBDIRECTORY(lzo)
ADD_SUBDIRECTORY(lzma)

8
extern/Makefile vendored
View File

@@ -54,14 +54,6 @@ 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::

4
extern/SConscript vendored
View File

@@ -22,5 +22,5 @@ if env['WITH_BF_REDCODE'] and env['BF_REDCODE_LIB'] == '':
if env['OURPLATFORM'] == 'linux2':
SConscript(['binreloc/SConscript']);
SConscript(['lzo/SConscript'])
SConscript(['lzma/SConscript'])
# FFTW not needed atm - dg
# SConscript(['fftw/SConscript'])

View File

@@ -9,5 +9,5 @@ cflags = []
sources = ['binreloc.c']
incs = 'include'
env.BlenderLib ( 'extern_binreloc', sources, Split(incs), Split(defs), libtype=['extern','player'], priority=[36,225], compileflags = cflags)
env.BlenderLib ( 'extern_binreloc', sources, Split(incs), Split(defs), libtype=['extern'], priority=[36], compileflags = cflags)

View File

@@ -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)

View File

@@ -211,13 +211,13 @@ ADD_LIBRARY(BulletCollision ${BulletCollision_SRCS} ${BulletCollision_HDRS})
SET_TARGET_PROPERTIES(BulletCollision PROPERTIES VERSION ${BULLET_VERSION})
SET_TARGET_PROPERTIES(BulletCollision PROPERTIES SOVERSION ${BULLET_VERSION})
IF (BUILD_SHARED_LIBS)
TARGET_LINK_LIBRARIES(BulletCollision LinearMath)
TARGET_LINK_LIBRARIES(BulletCollision LinearMath)
ENDIF (BUILD_SHARED_LIBS)
#INSTALL of other files requires CMake 2.6
IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5)
INSTALL(TARGETS BulletCollision DESTINATION lib)
INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION include FILES_MATCHING PATTERN "*.h")
INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION include FILES_MATCHING PATTERN "*.h")
ENDIF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5)
IF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)

View File

@@ -34,7 +34,7 @@ ENDIF (BUILD_SHARED_LIBS)
IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5)
INSTALL(TARGETS BulletSoftBody DESTINATION lib)
INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION include FILES_MATCHING PATTERN "*.h")
INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION include FILES_MATCHING PATTERN "*.h")
ENDIF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5)
IF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)

View File

@@ -35,11 +35,11 @@ softbody_src = env.Glob("BulletSoftBody/*.cpp")
incs = '. BulletCollision BulletDynamics LinearMath BulletSoftBody'
env.BlenderLib ( libname = 'extern_bullet2linmath', sources=linearmath_src, includes=Split(incs), defines=Split(defs), libtype=['extern','player'], priority=[20,137], compileflags=cflags )
env.BlenderLib ( libname = 'extern_bullet2dynamics', sources=bulletdyn_src, includes=Split(incs), defines=Split(defs), libtype=['extern','player'], priority=[19,136], compileflags=cflags )
env.BlenderLib ( libname = 'extern_bullet2collision_broadphase', sources=collision_broadphase_src, includes=Split(incs), defines=Split(defs), libtype=['extern','player'], priority=[25,145], compileflags=cflags )
env.BlenderLib ( libname = 'extern_bullet2collision_dispatch', sources=collision_dispatch_src, includes=Split(incs), defines=Split(defs), libtype=['extern','player'], priority=[20,138], compileflags=cflags )
env.BlenderLib ( libname = 'extern_bullet2collision_gimpact', sources=collision_gimpact_src, includes=Split(incs), defines=Split(defs), libtype=['extern','player'], priority=[20,138], compileflags=cflags )
env.BlenderLib ( libname = 'extern_bullet2collision_shapes', sources=collision_shapes_src, includes=Split(incs), defines=Split(defs), libtype=['extern','player'], priority=[20,138], compileflags=cflags )
env.BlenderLib ( libname = 'extern_bullet2collision_narrowphase', sources=collision_narrowphase_src, includes=Split(incs), defines=Split(defs), libtype=['extern','player'], priority=[20,138], compileflags=cflags )
env.BlenderLib ( libname = 'extern_bullet2softbody', sources=softbody_src, includes=Split(incs), defines=Split(defs), libtype=['extern','player'], priority=[18,135], compileflags=cflags )
env.BlenderLib ( libname = 'extern_bullet2linmath', sources=linearmath_src, includes=Split(incs), defines=Split(defs), libtype=['extern'], priority=[20], compileflags=cflags )
env.BlenderLib ( libname = 'extern_bullet2dynamics', sources=bulletdyn_src, includes=Split(incs), defines=Split(defs), libtype=['extern'], priority=[19], compileflags=cflags )
env.BlenderLib ( libname = 'extern_bullet2collision_broadphase', sources=collision_broadphase_src, includes=Split(incs), defines=Split(defs), libtype=['extern'], priority=[25], compileflags=cflags )
env.BlenderLib ( libname = 'extern_bullet2collision_dispatch', sources=collision_dispatch_src, includes=Split(incs), defines=Split(defs), libtype=['extern'], priority=[20], compileflags=cflags )
env.BlenderLib ( libname = 'extern_bullet2collision_gimpact', sources=collision_gimpact_src, includes=Split(incs), defines=Split(defs), libtype=['extern'], priority=[20], compileflags=cflags )
env.BlenderLib ( libname = 'extern_bullet2collision_shapes', sources=collision_shapes_src, includes=Split(incs), defines=Split(defs), libtype=['extern'], priority=[20], compileflags=cflags )
env.BlenderLib ( libname = 'extern_bullet2collision_narrowphase', sources=collision_narrowphase_src, includes=Split(incs), defines=Split(defs), libtype=['extern'], priority=[20], compileflags=cflags )
env.BlenderLib ( libname = 'extern_bullet2softbody', sources=softbody_src, includes=Split(incs), defines=Split(defs), libtype=['extern'], priority=[18], compileflags=cflags )

View File

@@ -26,13 +26,8 @@
SET(INC include src)
IF(UNIX)
SET(INC ${INC} ${X11_X11_INCLUDE_PATH})
ENDIF(UNIX)
SET(SRC
src/glew.c
src/glew.c
)
BLENDERLIB(extern_glew "${SRC}" "${INC}")

View File

@@ -9,4 +9,4 @@ sources = ['src/glew.c']
defs = ''
incs = 'include'
env.BlenderLib ( 'extern_glew', sources, Split(incs), Split(defs), libtype=['extern','player'], priority=[50,230])
env.BlenderLib ( 'extern_glew', sources, Split(incs), Split(defs), libtype=['extern'], priority=[50])

View File

@@ -24,7 +24,7 @@
#
# ***** END GPL LICENSE BLOCK *****
SET(INC . src)
SET(INC . src ${FREETYPE_INC})
FILE(GLOB SRC *.c except t1_generate_luts.c)
ADD_DEFINITIONS(-DWITH_OPENJPEG)

View File

@@ -24,5 +24,5 @@ if not env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
oj_env.BlenderLib ( libname='extern_openjpeg',
sources=sources, includes=Split(incs),
defines=defs,
libtype=['extern','player'],
priority=[10,185], compileflags = flags)
libtype=['extern'],
priority=[10], compileflags = flags)

View File

@@ -12,5 +12,5 @@ incs = '. ../libopenjpeg'
env.BlenderLib ( libname='extern_redcode',
sources=sources, includes=Split(incs),
defines=[],
libtype=['core','intern'],
priority=[5, 5], compileflags = [])
libtype=['core','intern','player'],
priority=[5, 5, 200], compileflags = [])

127
extern/lzma/Alloc.c vendored
View File

@@ -1,127 +0,0 @@
/* Alloc.c -- Memory allocation functions
2008-09-24
Igor Pavlov
Public domain */
#ifdef _WIN32
#include <windows.h>
#endif
#include <stdlib.h>
#include "Alloc.h"
/* #define _SZ_ALLOC_DEBUG */
/* use _SZ_ALLOC_DEBUG to debug alloc/free operations */
#ifdef _SZ_ALLOC_DEBUG
#include <stdio.h>
int g_allocCount = 0;
int g_allocCountMid = 0;
int g_allocCountBig = 0;
#endif
void *MyAlloc(size_t size)
{
if (size == 0)
return 0;
#ifdef _SZ_ALLOC_DEBUG
{
void *p = malloc(size);
fprintf(stderr, "\nAlloc %10d bytes, count = %10d, addr = %8X", size, g_allocCount++, (unsigned)p);
return p;
}
#else
return malloc(size);
#endif
}
void MyFree(void *address)
{
#ifdef _SZ_ALLOC_DEBUG
if (address != 0)
fprintf(stderr, "\nFree; count = %10d, addr = %8X", --g_allocCount, (unsigned)address);
#endif
free(address);
}
#ifdef _WIN32
void *MidAlloc(size_t size)
{
if (size == 0)
return 0;
#ifdef _SZ_ALLOC_DEBUG
fprintf(stderr, "\nAlloc_Mid %10d bytes; count = %10d", size, g_allocCountMid++);
#endif
return VirtualAlloc(0, size, MEM_COMMIT, PAGE_READWRITE);
}
void MidFree(void *address)
{
#ifdef _SZ_ALLOC_DEBUG
if (address != 0)
fprintf(stderr, "\nFree_Mid; count = %10d", --g_allocCountMid);
#endif
if (address == 0)
return;
VirtualFree(address, 0, MEM_RELEASE);
}
#ifndef MEM_LARGE_PAGES
#undef _7ZIP_LARGE_PAGES
#endif
#ifdef _7ZIP_LARGE_PAGES
SIZE_T g_LargePageSize = 0;
typedef SIZE_T (WINAPI *GetLargePageMinimumP)();
#endif
void SetLargePageSize()
{
#ifdef _7ZIP_LARGE_PAGES
SIZE_T size = 0;
GetLargePageMinimumP largePageMinimum = (GetLargePageMinimumP)
GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "GetLargePageMinimum");
if (largePageMinimum == 0)
return;
size = largePageMinimum();
if (size == 0 || (size & (size - 1)) != 0)
return;
g_LargePageSize = size;
#endif
}
void *BigAlloc(size_t size)
{
if (size == 0)
return 0;
#ifdef _SZ_ALLOC_DEBUG
fprintf(stderr, "\nAlloc_Big %10d bytes; count = %10d", size, g_allocCountBig++);
#endif
#ifdef _7ZIP_LARGE_PAGES
if (g_LargePageSize != 0 && g_LargePageSize <= (1 << 30) && size >= (1 << 18))
{
void *res = VirtualAlloc(0, (size + g_LargePageSize - 1) & (~(g_LargePageSize - 1)),
MEM_COMMIT | MEM_LARGE_PAGES, PAGE_READWRITE);
if (res != 0)
return res;
}
#endif
return VirtualAlloc(0, size, MEM_COMMIT, PAGE_READWRITE);
}
void BigFree(void *address)
{
#ifdef _SZ_ALLOC_DEBUG
if (address != 0)
fprintf(stderr, "\nFree_Big; count = %10d", --g_allocCountBig);
#endif
if (address == 0)
return;
VirtualFree(address, 0, MEM_RELEASE);
}
#endif

32
extern/lzma/Alloc.h vendored
View File

@@ -1,32 +0,0 @@
/* Alloc.h -- Memory allocation functions
2008-03-13
Igor Pavlov
Public domain */
#ifndef __COMMON_ALLOC_H
#define __COMMON_ALLOC_H
#include <stddef.h>
void *MyAlloc(size_t size);
void MyFree(void *address);
#ifdef _WIN32
void SetLargePageSize();
void *MidAlloc(size_t size);
void MidFree(void *address);
void *BigAlloc(size_t size);
void BigFree(void *address);
#else
#define MidAlloc(size) MyAlloc(size)
#define MidFree(address) MyFree(address)
#define BigAlloc(size) MyAlloc(size)
#define BigFree(address) MyFree(address)
#endif
#endif

View File

@@ -1,34 +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): Daniel Genrich
#
# ***** END GPL LICENSE BLOCK *****
SET(INC . )
FILE(GLOB SRC ./*.c)
BLENDERLIB(bf_lzma "${SRC}" "${INC}")
#, libtype='blender', priority = 0 )

751
extern/lzma/LzFind.c vendored
View File

@@ -1,751 +0,0 @@
/* LzFind.c -- Match finder for LZ algorithms
2008-10-04 : Igor Pavlov : Public domain */
#include <string.h>
#include "LzFind.h"
#include "LzHash.h"
#define kEmptyHashValue 0
#define kMaxValForNormalize ((UInt32)0xFFFFFFFF)
#define kNormalizeStepMin (1 << 10) /* it must be power of 2 */
#define kNormalizeMask (~(kNormalizeStepMin - 1))
#define kMaxHistorySize ((UInt32)3 << 30)
#define kStartMaxLen 3
static void LzInWindow_Free(CMatchFinder *p, ISzAlloc *alloc)
{
if (!p->directInput)
{
alloc->Free(alloc, p->bufferBase);
p->bufferBase = 0;
}
}
/* keepSizeBefore + keepSizeAfter + keepSizeReserv must be < 4G) */
static int LzInWindow_Create(CMatchFinder *p, UInt32 keepSizeReserv, ISzAlloc *alloc)
{
UInt32 blockSize = p->keepSizeBefore + p->keepSizeAfter + keepSizeReserv;
if (p->directInput)
{
p->blockSize = blockSize;
return 1;
}
if (p->bufferBase == 0 || p->blockSize != blockSize)
{
LzInWindow_Free(p, alloc);
p->blockSize = blockSize;
p->bufferBase = (Byte *)alloc->Alloc(alloc, (size_t)blockSize);
}
return (p->bufferBase != 0);
}
Byte *MatchFinder_GetPointerToCurrentPos(CMatchFinder *p) { return p->buffer; }
Byte MatchFinder_GetIndexByte(CMatchFinder *p, Int32 index) { return p->buffer[index]; }
UInt32 MatchFinder_GetNumAvailableBytes(CMatchFinder *p) { return p->streamPos - p->pos; }
void MatchFinder_ReduceOffsets(CMatchFinder *p, UInt32 subValue)
{
p->posLimit -= subValue;
p->pos -= subValue;
p->streamPos -= subValue;
}
static void MatchFinder_ReadBlock(CMatchFinder *p)
{
if (p->streamEndWasReached || p->result != SZ_OK)
return;
for (;;)
{
Byte *dest = p->buffer + (p->streamPos - p->pos);
size_t size = (p->bufferBase + p->blockSize - dest);
if (size == 0)
return;
p->result = p->stream->Read(p->stream, dest, &size);
if (p->result != SZ_OK)
return;
if (size == 0)
{
p->streamEndWasReached = 1;
return;
}
p->streamPos += (UInt32)size;
if (p->streamPos - p->pos > p->keepSizeAfter)
return;
}
}
void MatchFinder_MoveBlock(CMatchFinder *p)
{
memmove(p->bufferBase,
p->buffer - p->keepSizeBefore,
(size_t)(p->streamPos - p->pos + p->keepSizeBefore));
p->buffer = p->bufferBase + p->keepSizeBefore;
}
int MatchFinder_NeedMove(CMatchFinder *p)
{
/* if (p->streamEndWasReached) return 0; */
return ((size_t)(p->bufferBase + p->blockSize - p->buffer) <= p->keepSizeAfter);
}
void MatchFinder_ReadIfRequired(CMatchFinder *p)
{
if (p->streamEndWasReached)
return;
if (p->keepSizeAfter >= p->streamPos - p->pos)
MatchFinder_ReadBlock(p);
}
static void MatchFinder_CheckAndMoveAndRead(CMatchFinder *p)
{
if (MatchFinder_NeedMove(p))
MatchFinder_MoveBlock(p);
MatchFinder_ReadBlock(p);
}
static void MatchFinder_SetDefaultSettings(CMatchFinder *p)
{
p->cutValue = 32;
p->btMode = 1;
p->numHashBytes = 4;
/* p->skipModeBits = 0; */
p->directInput = 0;
p->bigHash = 0;
}
#define kCrcPoly 0xEDB88320
void MatchFinder_Construct(CMatchFinder *p)
{
UInt32 i;
p->bufferBase = 0;
p->directInput = 0;
p->hash = 0;
MatchFinder_SetDefaultSettings(p);
for (i = 0; i < 256; i++)
{
UInt32 r = i;
int j;
for (j = 0; j < 8; j++)
r = (r >> 1) ^ (kCrcPoly & ~((r & 1) - 1));
p->crc[i] = r;
}
}
static void MatchFinder_FreeThisClassMemory(CMatchFinder *p, ISzAlloc *alloc)
{
alloc->Free(alloc, p->hash);
p->hash = 0;
}
void MatchFinder_Free(CMatchFinder *p, ISzAlloc *alloc)
{
MatchFinder_FreeThisClassMemory(p, alloc);
LzInWindow_Free(p, alloc);
}
static CLzRef* AllocRefs(UInt32 num, ISzAlloc *alloc)
{
size_t sizeInBytes = (size_t)num * sizeof(CLzRef);
if (sizeInBytes / sizeof(CLzRef) != num)
return 0;
return (CLzRef *)alloc->Alloc(alloc, sizeInBytes);
}
int MatchFinder_Create(CMatchFinder *p, UInt32 historySize,
UInt32 keepAddBufferBefore, UInt32 matchMaxLen, UInt32 keepAddBufferAfter,
ISzAlloc *alloc)
{
UInt32 sizeReserv;
if (historySize > kMaxHistorySize)
{
MatchFinder_Free(p, alloc);
return 0;
}
sizeReserv = historySize >> 1;
if (historySize > ((UInt32)2 << 30))
sizeReserv = historySize >> 2;
sizeReserv += (keepAddBufferBefore + matchMaxLen + keepAddBufferAfter) / 2 + (1 << 19);
p->keepSizeBefore = historySize + keepAddBufferBefore + 1;
p->keepSizeAfter = matchMaxLen + keepAddBufferAfter;
/* we need one additional byte, since we use MoveBlock after pos++ and before dictionary using */
if (LzInWindow_Create(p, sizeReserv, alloc))
{
UInt32 newCyclicBufferSize = (historySize /* >> p->skipModeBits */) + 1;
UInt32 hs;
p->matchMaxLen = matchMaxLen;
{
p->fixedHashSize = 0;
if (p->numHashBytes == 2)
hs = (1 << 16) - 1;
else
{
hs = historySize - 1;
hs |= (hs >> 1);
hs |= (hs >> 2);
hs |= (hs >> 4);
hs |= (hs >> 8);
hs >>= 1;
/* hs >>= p->skipModeBits; */
hs |= 0xFFFF; /* don't change it! It's required for Deflate */
if (hs > (1 << 24))
{
if (p->numHashBytes == 3)
hs = (1 << 24) - 1;
else
hs >>= 1;
}
}
p->hashMask = hs;
hs++;
if (p->numHashBytes > 2) p->fixedHashSize += kHash2Size;
if (p->numHashBytes > 3) p->fixedHashSize += kHash3Size;
if (p->numHashBytes > 4) p->fixedHashSize += kHash4Size;
hs += p->fixedHashSize;
}
{
UInt32 prevSize = p->hashSizeSum + p->numSons;
UInt32 newSize;
p->historySize = historySize;
p->hashSizeSum = hs;
p->cyclicBufferSize = newCyclicBufferSize;
p->numSons = (p->btMode ? newCyclicBufferSize * 2 : newCyclicBufferSize);
newSize = p->hashSizeSum + p->numSons;
if (p->hash != 0 && prevSize == newSize)
return 1;
MatchFinder_FreeThisClassMemory(p, alloc);
p->hash = AllocRefs(newSize, alloc);
if (p->hash != 0)
{
p->son = p->hash + p->hashSizeSum;
return 1;
}
}
}
MatchFinder_Free(p, alloc);
return 0;
}
static void MatchFinder_SetLimits(CMatchFinder *p)
{
UInt32 limit = kMaxValForNormalize - p->pos;
UInt32 limit2 = p->cyclicBufferSize - p->cyclicBufferPos;
if (limit2 < limit)
limit = limit2;
limit2 = p->streamPos - p->pos;
if (limit2 <= p->keepSizeAfter)
{
if (limit2 > 0)
limit2 = 1;
}
else
limit2 -= p->keepSizeAfter;
if (limit2 < limit)
limit = limit2;
{
UInt32 lenLimit = p->streamPos - p->pos;
if (lenLimit > p->matchMaxLen)
lenLimit = p->matchMaxLen;
p->lenLimit = lenLimit;
}
p->posLimit = p->pos + limit;
}
void MatchFinder_Init(CMatchFinder *p)
{
UInt32 i;
for (i = 0; i < p->hashSizeSum; i++)
p->hash[i] = kEmptyHashValue;
p->cyclicBufferPos = 0;
p->buffer = p->bufferBase;
p->pos = p->streamPos = p->cyclicBufferSize;
p->result = SZ_OK;
p->streamEndWasReached = 0;
MatchFinder_ReadBlock(p);
MatchFinder_SetLimits(p);
}
static UInt32 MatchFinder_GetSubValue(CMatchFinder *p)
{
return (p->pos - p->historySize - 1) & kNormalizeMask;
}
void MatchFinder_Normalize3(UInt32 subValue, CLzRef *items, UInt32 numItems)
{
UInt32 i;
for (i = 0; i < numItems; i++)
{
UInt32 value = items[i];
if (value <= subValue)
value = kEmptyHashValue;
else
value -= subValue;
items[i] = value;
}
}
static void MatchFinder_Normalize(CMatchFinder *p)
{
UInt32 subValue = MatchFinder_GetSubValue(p);
MatchFinder_Normalize3(subValue, p->hash, p->hashSizeSum + p->numSons);
MatchFinder_ReduceOffsets(p, subValue);
}
static void MatchFinder_CheckLimits(CMatchFinder *p)
{
if (p->pos == kMaxValForNormalize)
MatchFinder_Normalize(p);
if (!p->streamEndWasReached && p->keepSizeAfter == p->streamPos - p->pos)
MatchFinder_CheckAndMoveAndRead(p);
if (p->cyclicBufferPos == p->cyclicBufferSize)
p->cyclicBufferPos = 0;
MatchFinder_SetLimits(p);
}
static UInt32 * Hc_GetMatchesSpec(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son,
UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue,
UInt32 *distances, UInt32 maxLen)
{
son[_cyclicBufferPos] = curMatch;
for (;;)
{
UInt32 delta = pos - curMatch;
if (cutValue-- == 0 || delta >= _cyclicBufferSize)
return distances;
{
const Byte *pb = cur - delta;
curMatch = son[_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)];
if (pb[maxLen] == cur[maxLen] && *pb == *cur)
{
UInt32 len = 0;
while (++len != lenLimit)
if (pb[len] != cur[len])
break;
if (maxLen < len)
{
*distances++ = maxLen = len;
*distances++ = delta - 1;
if (len == lenLimit)
return distances;
}
}
}
}
}
UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son,
UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue,
UInt32 *distances, UInt32 maxLen)
{
CLzRef *ptr0 = son + (_cyclicBufferPos << 1) + 1;
CLzRef *ptr1 = son + (_cyclicBufferPos << 1);
UInt32 len0 = 0, len1 = 0;
for (;;)
{
UInt32 delta = pos - curMatch;
if (cutValue-- == 0 || delta >= _cyclicBufferSize)
{
*ptr0 = *ptr1 = kEmptyHashValue;
return distances;
}
{
CLzRef *pair = son + ((_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)) << 1);
const Byte *pb = cur - delta;
UInt32 len = (len0 < len1 ? len0 : len1);
if (pb[len] == cur[len])
{
if (++len != lenLimit && pb[len] == cur[len])
while (++len != lenLimit)
if (pb[len] != cur[len])
break;
if (maxLen < len)
{
*distances++ = maxLen = len;
*distances++ = delta - 1;
if (len == lenLimit)
{
*ptr1 = pair[0];
*ptr0 = pair[1];
return distances;
}
}
}
if (pb[len] < cur[len])
{
*ptr1 = curMatch;
ptr1 = pair + 1;
curMatch = *ptr1;
len1 = len;
}
else
{
*ptr0 = curMatch;
ptr0 = pair;
curMatch = *ptr0;
len0 = len;
}
}
}
}
static void SkipMatchesSpec(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son,
UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue)
{
CLzRef *ptr0 = son + (_cyclicBufferPos << 1) + 1;
CLzRef *ptr1 = son + (_cyclicBufferPos << 1);
UInt32 len0 = 0, len1 = 0;
for (;;)
{
UInt32 delta = pos - curMatch;
if (cutValue-- == 0 || delta >= _cyclicBufferSize)
{
*ptr0 = *ptr1 = kEmptyHashValue;
return;
}
{
CLzRef *pair = son + ((_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)) << 1);
const Byte *pb = cur - delta;
UInt32 len = (len0 < len1 ? len0 : len1);
if (pb[len] == cur[len])
{
while (++len != lenLimit)
if (pb[len] != cur[len])
break;
{
if (len == lenLimit)
{
*ptr1 = pair[0];
*ptr0 = pair[1];
return;
}
}
}
if (pb[len] < cur[len])
{
*ptr1 = curMatch;
ptr1 = pair + 1;
curMatch = *ptr1;
len1 = len;
}
else
{
*ptr0 = curMatch;
ptr0 = pair;
curMatch = *ptr0;
len0 = len;
}
}
}
}
#define MOVE_POS \
++p->cyclicBufferPos; \
p->buffer++; \
if (++p->pos == p->posLimit) MatchFinder_CheckLimits(p);
#define MOVE_POS_RET MOVE_POS return offset;
static void MatchFinder_MovePos(CMatchFinder *p) { MOVE_POS; }
#define GET_MATCHES_HEADER2(minLen, ret_op) \
UInt32 lenLimit; UInt32 hashValue; const Byte *cur; UInt32 curMatch; \
lenLimit = p->lenLimit; { if (lenLimit < minLen) { MatchFinder_MovePos(p); ret_op; }} \
cur = p->buffer;
#define GET_MATCHES_HEADER(minLen) GET_MATCHES_HEADER2(minLen, return 0)
#define SKIP_HEADER(minLen) GET_MATCHES_HEADER2(minLen, continue)
#define MF_PARAMS(p) p->pos, p->buffer, p->son, p->cyclicBufferPos, p->cyclicBufferSize, p->cutValue
#define GET_MATCHES_FOOTER(offset, maxLen) \
offset = (UInt32)(GetMatchesSpec1(lenLimit, curMatch, MF_PARAMS(p), \
distances + offset, maxLen) - distances); MOVE_POS_RET;
#define SKIP_FOOTER \
SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p)); MOVE_POS;
static UInt32 Bt2_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
{
UInt32 offset;
GET_MATCHES_HEADER(2)
HASH2_CALC;
curMatch = p->hash[hashValue];
p->hash[hashValue] = p->pos;
offset = 0;
GET_MATCHES_FOOTER(offset, 1)
}
UInt32 Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
{
UInt32 offset;
GET_MATCHES_HEADER(3)
HASH_ZIP_CALC;
curMatch = p->hash[hashValue];
p->hash[hashValue] = p->pos;
offset = 0;
GET_MATCHES_FOOTER(offset, 2)
}
static UInt32 Bt3_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
{
UInt32 hash2Value, delta2, maxLen, offset;
GET_MATCHES_HEADER(3)
HASH3_CALC;
delta2 = p->pos - p->hash[hash2Value];
curMatch = p->hash[kFix3HashSize + hashValue];
p->hash[hash2Value] =
p->hash[kFix3HashSize + hashValue] = p->pos;
maxLen = 2;
offset = 0;
if (delta2 < p->cyclicBufferSize && *(cur - delta2) == *cur)
{
for (; maxLen != lenLimit; maxLen++)
if (cur[(ptrdiff_t)maxLen - delta2] != cur[maxLen])
break;
distances[0] = maxLen;
distances[1] = delta2 - 1;
offset = 2;
if (maxLen == lenLimit)
{
SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p));
MOVE_POS_RET;
}
}
GET_MATCHES_FOOTER(offset, maxLen)
}
static UInt32 Bt4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
{
UInt32 hash2Value, hash3Value, delta2, delta3, maxLen, offset;
GET_MATCHES_HEADER(4)
HASH4_CALC;
delta2 = p->pos - p->hash[ hash2Value];
delta3 = p->pos - p->hash[kFix3HashSize + hash3Value];
curMatch = p->hash[kFix4HashSize + hashValue];
p->hash[ hash2Value] =
p->hash[kFix3HashSize + hash3Value] =
p->hash[kFix4HashSize + hashValue] = p->pos;
maxLen = 1;
offset = 0;
if (delta2 < p->cyclicBufferSize && *(cur - delta2) == *cur)
{
distances[0] = maxLen = 2;
distances[1] = delta2 - 1;
offset = 2;
}
if (delta2 != delta3 && delta3 < p->cyclicBufferSize && *(cur - delta3) == *cur)
{
maxLen = 3;
distances[offset + 1] = delta3 - 1;
offset += 2;
delta2 = delta3;
}
if (offset != 0)
{
for (; maxLen != lenLimit; maxLen++)
if (cur[(ptrdiff_t)maxLen - delta2] != cur[maxLen])
break;
distances[offset - 2] = maxLen;
if (maxLen == lenLimit)
{
SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p));
MOVE_POS_RET;
}
}
if (maxLen < 3)
maxLen = 3;
GET_MATCHES_FOOTER(offset, maxLen)
}
static UInt32 Hc4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
{
UInt32 hash2Value, hash3Value, delta2, delta3, maxLen, offset;
GET_MATCHES_HEADER(4)
HASH4_CALC;
delta2 = p->pos - p->hash[ hash2Value];
delta3 = p->pos - p->hash[kFix3HashSize + hash3Value];
curMatch = p->hash[kFix4HashSize + hashValue];
p->hash[ hash2Value] =
p->hash[kFix3HashSize + hash3Value] =
p->hash[kFix4HashSize + hashValue] = p->pos;
maxLen = 1;
offset = 0;
if (delta2 < p->cyclicBufferSize && *(cur - delta2) == *cur)
{
distances[0] = maxLen = 2;
distances[1] = delta2 - 1;
offset = 2;
}
if (delta2 != delta3 && delta3 < p->cyclicBufferSize && *(cur - delta3) == *cur)
{
maxLen = 3;
distances[offset + 1] = delta3 - 1;
offset += 2;
delta2 = delta3;
}
if (offset != 0)
{
for (; maxLen != lenLimit; maxLen++)
if (cur[(ptrdiff_t)maxLen - delta2] != cur[maxLen])
break;
distances[offset - 2] = maxLen;
if (maxLen == lenLimit)
{
p->son[p->cyclicBufferPos] = curMatch;
MOVE_POS_RET;
}
}
if (maxLen < 3)
maxLen = 3;
offset = (UInt32)(Hc_GetMatchesSpec(lenLimit, curMatch, MF_PARAMS(p),
distances + offset, maxLen) - (distances));
MOVE_POS_RET
}
UInt32 Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
{
UInt32 offset;
GET_MATCHES_HEADER(3)
HASH_ZIP_CALC;
curMatch = p->hash[hashValue];
p->hash[hashValue] = p->pos;
offset = (UInt32)(Hc_GetMatchesSpec(lenLimit, curMatch, MF_PARAMS(p),
distances, 2) - (distances));
MOVE_POS_RET
}
static void Bt2_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
{
do
{
SKIP_HEADER(2)
HASH2_CALC;
curMatch = p->hash[hashValue];
p->hash[hashValue] = p->pos;
SKIP_FOOTER
}
while (--num != 0);
}
void Bt3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
{
do
{
SKIP_HEADER(3)
HASH_ZIP_CALC;
curMatch = p->hash[hashValue];
p->hash[hashValue] = p->pos;
SKIP_FOOTER
}
while (--num != 0);
}
static void Bt3_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
{
do
{
UInt32 hash2Value;
SKIP_HEADER(3)
HASH3_CALC;
curMatch = p->hash[kFix3HashSize + hashValue];
p->hash[hash2Value] =
p->hash[kFix3HashSize + hashValue] = p->pos;
SKIP_FOOTER
}
while (--num != 0);
}
static void Bt4_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
{
do
{
UInt32 hash2Value, hash3Value;
SKIP_HEADER(4)
HASH4_CALC;
curMatch = p->hash[kFix4HashSize + hashValue];
p->hash[ hash2Value] =
p->hash[kFix3HashSize + hash3Value] = p->pos;
p->hash[kFix4HashSize + hashValue] = p->pos;
SKIP_FOOTER
}
while (--num != 0);
}
static void Hc4_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
{
do
{
UInt32 hash2Value, hash3Value;
SKIP_HEADER(4)
HASH4_CALC;
curMatch = p->hash[kFix4HashSize + hashValue];
p->hash[ hash2Value] =
p->hash[kFix3HashSize + hash3Value] =
p->hash[kFix4HashSize + hashValue] = p->pos;
p->son[p->cyclicBufferPos] = curMatch;
MOVE_POS
}
while (--num != 0);
}
void Hc3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
{
do
{
SKIP_HEADER(3)
HASH_ZIP_CALC;
curMatch = p->hash[hashValue];
p->hash[hashValue] = p->pos;
p->son[p->cyclicBufferPos] = curMatch;
MOVE_POS
}
while (--num != 0);
}
void MatchFinder_CreateVTable(CMatchFinder *p, IMatchFinder *vTable)
{
vTable->Init = (Mf_Init_Func)MatchFinder_Init;
vTable->GetIndexByte = (Mf_GetIndexByte_Func)MatchFinder_GetIndexByte;
vTable->GetNumAvailableBytes = (Mf_GetNumAvailableBytes_Func)MatchFinder_GetNumAvailableBytes;
vTable->GetPointerToCurrentPos = (Mf_GetPointerToCurrentPos_Func)MatchFinder_GetPointerToCurrentPos;
if (!p->btMode)
{
vTable->GetMatches = (Mf_GetMatches_Func)Hc4_MatchFinder_GetMatches;
vTable->Skip = (Mf_Skip_Func)Hc4_MatchFinder_Skip;
}
else if (p->numHashBytes == 2)
{
vTable->GetMatches = (Mf_GetMatches_Func)Bt2_MatchFinder_GetMatches;
vTable->Skip = (Mf_Skip_Func)Bt2_MatchFinder_Skip;
}
else if (p->numHashBytes == 3)
{
vTable->GetMatches = (Mf_GetMatches_Func)Bt3_MatchFinder_GetMatches;
vTable->Skip = (Mf_Skip_Func)Bt3_MatchFinder_Skip;
}
else
{
vTable->GetMatches = (Mf_GetMatches_Func)Bt4_MatchFinder_GetMatches;
vTable->Skip = (Mf_Skip_Func)Bt4_MatchFinder_Skip;
}
}

107
extern/lzma/LzFind.h vendored
View File

@@ -1,107 +0,0 @@
/* LzFind.h -- Match finder for LZ algorithms
2008-10-04 : Igor Pavlov : Public domain */
#ifndef __LZFIND_H
#define __LZFIND_H
#include "Types.h"
typedef UInt32 CLzRef;
typedef struct _CMatchFinder
{
Byte *buffer;
UInt32 pos;
UInt32 posLimit;
UInt32 streamPos;
UInt32 lenLimit;
UInt32 cyclicBufferPos;
UInt32 cyclicBufferSize; /* it must be = (historySize + 1) */
UInt32 matchMaxLen;
CLzRef *hash;
CLzRef *son;
UInt32 hashMask;
UInt32 cutValue;
Byte *bufferBase;
ISeqInStream *stream;
int streamEndWasReached;
UInt32 blockSize;
UInt32 keepSizeBefore;
UInt32 keepSizeAfter;
UInt32 numHashBytes;
int directInput;
int btMode;
/* int skipModeBits; */
int bigHash;
UInt32 historySize;
UInt32 fixedHashSize;
UInt32 hashSizeSum;
UInt32 numSons;
SRes result;
UInt32 crc[256];
} CMatchFinder;
#define Inline_MatchFinder_GetPointerToCurrentPos(p) ((p)->buffer)
#define Inline_MatchFinder_GetIndexByte(p, index) ((p)->buffer[(Int32)(index)])
#define Inline_MatchFinder_GetNumAvailableBytes(p) ((p)->streamPos - (p)->pos)
int MatchFinder_NeedMove(CMatchFinder *p);
Byte *MatchFinder_GetPointerToCurrentPos(CMatchFinder *p);
void MatchFinder_MoveBlock(CMatchFinder *p);
void MatchFinder_ReadIfRequired(CMatchFinder *p);
void MatchFinder_Construct(CMatchFinder *p);
/* Conditions:
historySize <= 3 GB
keepAddBufferBefore + matchMaxLen + keepAddBufferAfter < 511MB
*/
int MatchFinder_Create(CMatchFinder *p, UInt32 historySize,
UInt32 keepAddBufferBefore, UInt32 matchMaxLen, UInt32 keepAddBufferAfter,
ISzAlloc *alloc);
void MatchFinder_Free(CMatchFinder *p, ISzAlloc *alloc);
void MatchFinder_Normalize3(UInt32 subValue, CLzRef *items, UInt32 numItems);
void MatchFinder_ReduceOffsets(CMatchFinder *p, UInt32 subValue);
UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *buffer, CLzRef *son,
UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 _cutValue,
UInt32 *distances, UInt32 maxLen);
/*
Conditions:
Mf_GetNumAvailableBytes_Func must be called before each Mf_GetMatchLen_Func.
Mf_GetPointerToCurrentPos_Func's result must be used only before any other function
*/
typedef void (*Mf_Init_Func)(void *object);
typedef Byte (*Mf_GetIndexByte_Func)(void *object, Int32 index);
typedef UInt32 (*Mf_GetNumAvailableBytes_Func)(void *object);
typedef const Byte * (*Mf_GetPointerToCurrentPos_Func)(void *object);
typedef UInt32 (*Mf_GetMatches_Func)(void *object, UInt32 *distances);
typedef void (*Mf_Skip_Func)(void *object, UInt32);
typedef struct _IMatchFinder
{
Mf_Init_Func Init;
Mf_GetIndexByte_Func GetIndexByte;
Mf_GetNumAvailableBytes_Func GetNumAvailableBytes;
Mf_GetPointerToCurrentPos_Func GetPointerToCurrentPos;
Mf_GetMatches_Func GetMatches;
Mf_Skip_Func Skip;
} IMatchFinder;
void MatchFinder_CreateVTable(CMatchFinder *p, IMatchFinder *vTable);
void MatchFinder_Init(CMatchFinder *p);
UInt32 Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances);
UInt32 Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances);
void Bt3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num);
void Hc3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num);
#endif

54
extern/lzma/LzHash.h vendored
View File

@@ -1,54 +0,0 @@
/* LzHash.h -- HASH functions for LZ algorithms
2008-10-04 : Igor Pavlov : Public domain */
#ifndef __LZHASH_H
#define __LZHASH_H
#define kHash2Size (1 << 10)
#define kHash3Size (1 << 16)
#define kHash4Size (1 << 20)
#define kFix3HashSize (kHash2Size)
#define kFix4HashSize (kHash2Size + kHash3Size)
#define kFix5HashSize (kHash2Size + kHash3Size + kHash4Size)
#define HASH2_CALC hashValue = cur[0] | ((UInt32)cur[1] << 8);
#define HASH3_CALC { \
UInt32 temp = p->crc[cur[0]] ^ cur[1]; \
hash2Value = temp & (kHash2Size - 1); \
hashValue = (temp ^ ((UInt32)cur[2] << 8)) & p->hashMask; }
#define HASH4_CALC { \
UInt32 temp = p->crc[cur[0]] ^ cur[1]; \
hash2Value = temp & (kHash2Size - 1); \
hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); \
hashValue = (temp ^ ((UInt32)cur[2] << 8) ^ (p->crc[cur[3]] << 5)) & p->hashMask; }
#define HASH5_CALC { \
UInt32 temp = p->crc[cur[0]] ^ cur[1]; \
hash2Value = temp & (kHash2Size - 1); \
hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); \
hash4Value = (temp ^ ((UInt32)cur[2] << 8) ^ (p->crc[cur[3]] << 5)); \
hashValue = (hash4Value ^ (p->crc[cur[4]] << 3)) & p->hashMask; \
hash4Value &= (kHash4Size - 1); }
/* #define HASH_ZIP_CALC hashValue = ((cur[0] | ((UInt32)cur[1] << 8)) ^ p->crc[cur[2]]) & 0xFFFF; */
#define HASH_ZIP_CALC hashValue = ((cur[2] | ((UInt32)cur[0] << 8)) ^ p->crc[cur[1]]) & 0xFFFF;
#define MT_HASH2_CALC \
hash2Value = (p->crc[cur[0]] ^ cur[1]) & (kHash2Size - 1);
#define MT_HASH3_CALC { \
UInt32 temp = p->crc[cur[0]] ^ cur[1]; \
hash2Value = temp & (kHash2Size - 1); \
hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); }
#define MT_HASH4_CALC { \
UInt32 temp = p->crc[cur[0]] ^ cur[1]; \
hash2Value = temp & (kHash2Size - 1); \
hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); \
hash4Value = (temp ^ ((UInt32)cur[2] << 8) ^ (p->crc[cur[3]] << 5)) & (kHash4Size - 1); }
#endif

1007
extern/lzma/LzmaDec.c vendored

File diff suppressed because it is too large Load Diff

223
extern/lzma/LzmaDec.h vendored
View File

@@ -1,223 +0,0 @@
/* LzmaDec.h -- LZMA Decoder
2008-10-04 : Igor Pavlov : Public domain */
#ifndef __LZMADEC_H
#define __LZMADEC_H
#include "Types.h"
/* #define _LZMA_PROB32 */
/* _LZMA_PROB32 can increase the speed on some CPUs,
but memory usage for CLzmaDec::probs will be doubled in that case */
#ifdef _LZMA_PROB32
#define CLzmaProb UInt32
#else
#define CLzmaProb UInt16
#endif
/* ---------- LZMA Properties ---------- */
#define LZMA_PROPS_SIZE 5
typedef struct _CLzmaProps
{
unsigned lc, lp, pb;
UInt32 dicSize;
} CLzmaProps;
/* LzmaProps_Decode - decodes properties
Returns:
SZ_OK
SZ_ERROR_UNSUPPORTED - Unsupported properties
*/
SRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size);
/* ---------- LZMA Decoder state ---------- */
/* LZMA_REQUIRED_INPUT_MAX = number of required input bytes for worst case.
Num bits = log2((2^11 / 31) ^ 22) + 26 < 134 + 26 = 160; */
#define LZMA_REQUIRED_INPUT_MAX 20
typedef struct
{
CLzmaProps prop;
CLzmaProb *probs;
Byte *dic;
const Byte *buf;
UInt32 range, code;
SizeT dicPos;
SizeT dicBufSize;
UInt32 processedPos;
UInt32 checkDicSize;
unsigned state;
UInt32 reps[4];
unsigned remainLen;
int needFlush;
int needInitState;
UInt32 numProbs;
unsigned tempBufSize;
Byte tempBuf[LZMA_REQUIRED_INPUT_MAX];
} CLzmaDec;
#define LzmaDec_Construct(p) { (p)->dic = 0; (p)->probs = 0; }
void LzmaDec_Init(CLzmaDec *p);
/* There are two types of LZMA streams:
0) Stream with end mark. That end mark adds about 6 bytes to compressed size.
1) Stream without end mark. You must know exact uncompressed size to decompress such stream. */
typedef enum
{
LZMA_FINISH_ANY, /* finish at any point */
LZMA_FINISH_END /* block must be finished at the end */
} ELzmaFinishMode;
/* ELzmaFinishMode has meaning only if the decoding reaches output limit !!!
You must use LZMA_FINISH_END, when you know that current output buffer
covers last bytes of block. In other cases you must use LZMA_FINISH_ANY.
If LZMA decoder sees end marker before reaching output limit, it returns SZ_OK,
and output value of destLen will be less than output buffer size limit.
You can check status result also.
You can use multiple checks to test data integrity after full decompression:
1) Check Result and "status" variable.
2) Check that output(destLen) = uncompressedSize, if you know real uncompressedSize.
3) Check that output(srcLen) = compressedSize, if you know real compressedSize.
You must use correct finish mode in that case. */
typedef enum
{
LZMA_STATUS_NOT_SPECIFIED, /* use main error code instead */
LZMA_STATUS_FINISHED_WITH_MARK, /* stream was finished with end mark. */
LZMA_STATUS_NOT_FINISHED, /* stream was not finished */
LZMA_STATUS_NEEDS_MORE_INPUT, /* you must provide more input bytes */
LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK /* there is probability that stream was finished without end mark */
} ELzmaStatus;
/* ELzmaStatus is used only as output value for function call */
/* ---------- Interfaces ---------- */
/* There are 3 levels of interfaces:
1) Dictionary Interface
2) Buffer Interface
3) One Call Interface
You can select any of these interfaces, but don't mix functions from different
groups for same object. */
/* There are two variants to allocate state for Dictionary Interface:
1) LzmaDec_Allocate / LzmaDec_Free
2) LzmaDec_AllocateProbs / LzmaDec_FreeProbs
You can use variant 2, if you set dictionary buffer manually.
For Buffer Interface you must always use variant 1.
LzmaDec_Allocate* can return:
SZ_OK
SZ_ERROR_MEM - Memory allocation error
SZ_ERROR_UNSUPPORTED - Unsupported properties
*/
SRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc);
void LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc);
SRes LzmaDec_Allocate(CLzmaDec *state, const Byte *prop, unsigned propsSize, ISzAlloc *alloc);
void LzmaDec_Free(CLzmaDec *state, ISzAlloc *alloc);
/* ---------- Dictionary Interface ---------- */
/* You can use it, if you want to eliminate the overhead for data copying from
dictionary to some other external buffer.
You must work with CLzmaDec variables directly in this interface.
STEPS:
LzmaDec_Constr()
LzmaDec_Allocate()
for (each new stream)
{
LzmaDec_Init()
while (it needs more decompression)
{
LzmaDec_DecodeToDic()
use data from CLzmaDec::dic and update CLzmaDec::dicPos
}
}
LzmaDec_Free()
*/
/* LzmaDec_DecodeToDic
The decoding to internal dictionary buffer (CLzmaDec::dic).
You must manually update CLzmaDec::dicPos, if it reaches CLzmaDec::dicBufSize !!!
finishMode:
It has meaning only if the decoding reaches output limit (dicLimit).
LZMA_FINISH_ANY - Decode just dicLimit bytes.
LZMA_FINISH_END - Stream must be finished after dicLimit.
Returns:
SZ_OK
status:
LZMA_STATUS_FINISHED_WITH_MARK
LZMA_STATUS_NOT_FINISHED
LZMA_STATUS_NEEDS_MORE_INPUT
LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK
SZ_ERROR_DATA - Data error
*/
SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit,
const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);
/* ---------- Buffer Interface ---------- */
/* It's zlib-like interface.
See LzmaDec_DecodeToDic description for information about STEPS and return results,
but you must use LzmaDec_DecodeToBuf instead of LzmaDec_DecodeToDic and you don't need
to work with CLzmaDec variables manually.
finishMode:
It has meaning only if the decoding reaches output limit (*destLen).
LZMA_FINISH_ANY - Decode just destLen bytes.
LZMA_FINISH_END - Stream must be finished after (*destLen).
*/
SRes LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen,
const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);
/* ---------- One Call Interface ---------- */
/* LzmaDecode
finishMode:
It has meaning only if the decoding reaches output limit (*destLen).
LZMA_FINISH_ANY - Decode just destLen bytes.
LZMA_FINISH_END - Stream must be finished after (*destLen).
Returns:
SZ_OK
status:
LZMA_STATUS_FINISHED_WITH_MARK
LZMA_STATUS_NOT_FINISHED
LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK
SZ_ERROR_DATA - Data error
SZ_ERROR_MEM - Memory allocation error
SZ_ERROR_UNSUPPORTED - Unsupported properties
SZ_ERROR_INPUT_EOF - It needs more bytes in input buffer (src).
*/
SRes LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen,
const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode,
ELzmaStatus *status, ISzAlloc *alloc);
#endif

2281
extern/lzma/LzmaEnc.c vendored

File diff suppressed because it is too large Load Diff

72
extern/lzma/LzmaEnc.h vendored
View File

@@ -1,72 +0,0 @@
/* LzmaEnc.h -- LZMA Encoder
2008-10-04 : Igor Pavlov : Public domain */
#ifndef __LZMAENC_H
#define __LZMAENC_H
#include "Types.h"
#define LZMA_PROPS_SIZE 5
typedef struct _CLzmaEncProps
{
int level; /* 0 <= level <= 9 */
UInt32 dictSize; /* (1 << 12) <= dictSize <= (1 << 27) for 32-bit version
(1 << 12) <= dictSize <= (1 << 30) for 64-bit version
default = (1 << 24) */
int lc; /* 0 <= lc <= 8, default = 3 */
int lp; /* 0 <= lp <= 4, default = 0 */
int pb; /* 0 <= pb <= 4, default = 2 */
int algo; /* 0 - fast, 1 - normal, default = 1 */
int fb; /* 5 <= fb <= 273, default = 32 */
int btMode; /* 0 - hashChain Mode, 1 - binTree mode - normal, default = 1 */
int numHashBytes; /* 2, 3 or 4, default = 4 */
UInt32 mc; /* 1 <= mc <= (1 << 30), default = 32 */
unsigned writeEndMark; /* 0 - do not write EOPM, 1 - write EOPM, default = 0 */
int numThreads; /* 1 or 2, default = 2 */
} CLzmaEncProps;
void LzmaEncProps_Init(CLzmaEncProps *p);
void LzmaEncProps_Normalize(CLzmaEncProps *p);
UInt32 LzmaEncProps_GetDictSize(const CLzmaEncProps *props2);
/* ---------- CLzmaEncHandle Interface ---------- */
/* LzmaEnc_* functions can return the following exit codes:
Returns:
SZ_OK - OK
SZ_ERROR_MEM - Memory allocation error
SZ_ERROR_PARAM - Incorrect paramater in props
SZ_ERROR_WRITE - Write callback error.
SZ_ERROR_PROGRESS - some break from progress callback
SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version)
*/
typedef void * CLzmaEncHandle;
CLzmaEncHandle LzmaEnc_Create(ISzAlloc *alloc);
void LzmaEnc_Destroy(CLzmaEncHandle p, ISzAlloc *alloc, ISzAlloc *allocBig);
SRes LzmaEnc_SetProps(CLzmaEncHandle p, const CLzmaEncProps *props);
SRes LzmaEnc_WriteProperties(CLzmaEncHandle p, Byte *properties, SizeT *size);
SRes LzmaEnc_Encode(CLzmaEncHandle p, ISeqOutStream *outStream, ISeqInStream *inStream,
ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig);
SRes LzmaEnc_MemEncode(CLzmaEncHandle p, Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
int writeEndMark, ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig);
/* ---------- One Call Interface ---------- */
/* LzmaEncode
Return code:
SZ_OK - OK
SZ_ERROR_MEM - Memory allocation error
SZ_ERROR_PARAM - Incorrect paramater
SZ_ERROR_OUTPUT_EOF - output buffer overflow
SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version)
*/
SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
const CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark,
ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig);
#endif

46
extern/lzma/LzmaLib.c vendored
View File

@@ -1,46 +0,0 @@
/* LzmaLib.c -- LZMA library wrapper
2008-08-05
Igor Pavlov
Public domain */
#include "LzmaEnc.h"
#include "LzmaDec.h"
#include "Alloc.h"
#include "LzmaLib.h"
static void *SzAlloc(void *p, size_t size) { p = p; return MyAlloc(size); }
static void SzFree(void *p, void *address) { p = p; MyFree(address); }
static ISzAlloc g_Alloc = { SzAlloc, SzFree };
MY_STDAPI LzmaCompress(unsigned char *dest, size_t *destLen, const unsigned char *src, size_t srcLen,
unsigned char *outProps, size_t *outPropsSize,
int level, /* 0 <= level <= 9, default = 5 */
unsigned dictSize, /* use (1 << N) or (3 << N). 4 KB < dictSize <= 128 MB */
int lc, /* 0 <= lc <= 8, default = 3 */
int lp, /* 0 <= lp <= 4, default = 0 */
int pb, /* 0 <= pb <= 4, default = 2 */
int fb, /* 5 <= fb <= 273, default = 32 */
int numThreads /* 1 or 2, default = 2 */
)
{
CLzmaEncProps props;
LzmaEncProps_Init(&props);
props.level = level;
props.dictSize = dictSize;
props.lc = lc;
props.lp = lp;
props.pb = pb;
props.fb = fb;
props.numThreads = numThreads;
return LzmaEncode(dest, destLen, src, srcLen, &props, outProps, outPropsSize, 0,
NULL, &g_Alloc, &g_Alloc);
}
MY_STDAPI LzmaUncompress(unsigned char *dest, size_t *destLen, const unsigned char *src, size_t *srcLen,
const unsigned char *props, size_t propsSize)
{
ELzmaStatus status;
return LzmaDecode(dest, destLen, src, srcLen, props, (unsigned)propsSize, LZMA_FINISH_ANY, &status, &g_Alloc);
}

135
extern/lzma/LzmaLib.h vendored
View File

@@ -1,135 +0,0 @@
/* LzmaLib.h -- LZMA library interface
2008-08-05
Igor Pavlov
Public domain */
#ifndef __LZMALIB_H
#define __LZMALIB_H
#include "Types.h"
#ifdef __cplusplus
#define MY_EXTERN_C extern "C"
#else
#define MY_EXTERN_C extern
#endif
#define MY_STDAPI MY_EXTERN_C int MY_STD_CALL
#define LZMA_PROPS_SIZE 5
/*
RAM requirements for LZMA:
for compression: (dictSize * 11.5 + 6 MB) + state_size
for decompression: dictSize + state_size
state_size = (4 + (1.5 << (lc + lp))) KB
by default (lc=3, lp=0), state_size = 16 KB.
LZMA properties (5 bytes) format
Offset Size Description
0 1 lc, lp and pb in encoded form.
1 4 dictSize (little endian).
*/
/*
LzmaCompress
------------
outPropsSize -
In: the pointer to the size of outProps buffer; *outPropsSize = LZMA_PROPS_SIZE = 5.
Out: the pointer to the size of written properties in outProps buffer; *outPropsSize = LZMA_PROPS_SIZE = 5.
LZMA Encoder will use defult values for any parameter, if it is
-1 for any from: level, loc, lp, pb, fb, numThreads
0 for dictSize
level - compression level: 0 <= level <= 9;
level dictSize algo fb
0: 16 KB 0 32
1: 64 KB 0 32
2: 256 KB 0 32
3: 1 MB 0 32
4: 4 MB 0 32
5: 16 MB 1 32
6: 32 MB 1 32
7+: 64 MB 1 64
The default value for "level" is 5.
algo = 0 means fast method
algo = 1 means normal method
dictSize - The dictionary size in bytes. The maximum value is
128 MB = (1 << 27) bytes for 32-bit version
1 GB = (1 << 30) bytes for 64-bit version
The default value is 16 MB = (1 << 24) bytes.
It's recommended to use the dictionary that is larger than 4 KB and
that can be calculated as (1 << N) or (3 << N) sizes.
lc - The number of literal context bits (high bits of previous literal).
It can be in the range from 0 to 8. The default value is 3.
Sometimes lc=4 gives the gain for big files.
lp - The number of literal pos bits (low bits of current position for literals).
It can be in the range from 0 to 4. The default value is 0.
The lp switch is intended for periodical data when the period is equal to 2^lp.
For example, for 32-bit (4 bytes) periodical data you can use lp=2. Often it's
better to set lc=0, if you change lp switch.
pb - The number of pos bits (low bits of current position).
It can be in the range from 0 to 4. The default value is 2.
The pb switch is intended for periodical data when the period is equal 2^pb.
fb - Word size (the number of fast bytes).
It can be in the range from 5 to 273. The default value is 32.
Usually, a big number gives a little bit better compression ratio and
slower compression process.
numThreads - The number of thereads. 1 or 2. The default value is 2.
Fast mode (algo = 0) can use only 1 thread.
Out:
destLen - processed output size
Returns:
SZ_OK - OK
SZ_ERROR_MEM - Memory allocation error
SZ_ERROR_PARAM - Incorrect paramater
SZ_ERROR_OUTPUT_EOF - output buffer overflow
SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version)
*/
MY_STDAPI LzmaCompress(unsigned char *dest, size_t *destLen, const unsigned char *src, size_t srcLen,
unsigned char *outProps, size_t *outPropsSize, /* *outPropsSize must be = 5 */
int level, /* 0 <= level <= 9, default = 5 */
unsigned dictSize, /* default = (1 << 24) */
int lc, /* 0 <= lc <= 8, default = 3 */
int lp, /* 0 <= lp <= 4, default = 0 */
int pb, /* 0 <= pb <= 4, default = 2 */
int fb, /* 5 <= fb <= 273, default = 32 */
int numThreads /* 1 or 2, default = 2 */
);
/*
LzmaUncompress
--------------
In:
dest - output data
destLen - output data size
src - input data
srcLen - input data size
Out:
destLen - processed output size
srcLen - processed input size
Returns:
SZ_OK - OK
SZ_ERROR_DATA - Data error
SZ_ERROR_MEM - Memory allocation arror
SZ_ERROR_UNSUPPORTED - Unsupported properties
SZ_ERROR_INPUT_EOF - it needs more bytes in input buffer (src)
*/
MY_STDAPI LzmaUncompress(unsigned char *dest, size_t *destLen, const unsigned char *src, SizeT *srcLen,
const unsigned char *props, size_t propsSize);
#endif

46
extern/lzma/Makefile vendored
View File

@@ -1,46 +0,0 @@
#
# $Id$
#
# ***** BEGIN GPL/BL DUAL 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. The Blender
# Foundation also sells licenses for use in proprietary software under
# the Blender License. See http://www.blender.org/BL/ for information
# about this.
#
# 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):
#
# ***** END GPL/BL DUAL LICENSE BLOCK *****
#
#
LIBNAME = lzma
DIR = $(OCGDIR)/extern/$(LIBNAME)
include nan_compile.mk
install: $(ALL_OR_DEBUG)
@[ -d $(NAN_LZMA) ] || mkdir -p $(NAN_LZMA)
@[ -d $(NAN_LZMA)/lib/$(DEBUG_DIR) ] || mkdir -p $(NAN_LZMA)/lib/$(DEBUG_DIR)
@$(NANBLENDERHOME)/intern/tools/cpifdiff.sh $(DIR)/$(DEBUG_DIR)lib$(LIBNAME).a $(NAN_LZMA)/lib/$(DEBUG_DIR)
ifeq ($(OS),darwin)
ranlib $(NAN_LZMA)/lib/$(DEBUG_DIR)lib$(LIBNAME).a
endif
@$(NANBLENDERHOME)/intern/tools/cpifdiff.sh *.h $(NAN_LZMA)

View File

@@ -1,9 +0,0 @@
#!/usr/bin/python
Import ('env')
sources = env.Glob('./*.c')
defs = ''
incs = ' . '
env.BlenderLib ('bf_lzma', sources, Split(incs), Split(defs), libtype=['intern'], priority=[40] )

208
extern/lzma/Types.h vendored
View File

@@ -1,208 +0,0 @@
/* Types.h -- Basic types
2008-11-23 : Igor Pavlov : Public domain */
#ifndef __7Z_TYPES_H
#define __7Z_TYPES_H
#include <stddef.h>
#ifdef _WIN32
#include <windows.h>
#endif
#define SZ_OK 0
#define SZ_ERROR_DATA 1
#define SZ_ERROR_MEM 2
#define SZ_ERROR_CRC 3
#define SZ_ERROR_UNSUPPORTED 4
#define SZ_ERROR_PARAM 5
#define SZ_ERROR_INPUT_EOF 6
#define SZ_ERROR_OUTPUT_EOF 7
#define SZ_ERROR_READ 8
#define SZ_ERROR_WRITE 9
#define SZ_ERROR_PROGRESS 10
#define SZ_ERROR_FAIL 11
#define SZ_ERROR_THREAD 12
#define SZ_ERROR_ARCHIVE 16
#define SZ_ERROR_NO_ARCHIVE 17
typedef int SRes;
#ifdef _WIN32
typedef DWORD WRes;
#else
typedef int WRes;
#endif
#ifndef RINOK
#define RINOK(x) { int __result__ = (x); if (__result__ != 0) return __result__; }
#endif
typedef unsigned char Byte;
typedef short Int16;
typedef unsigned short UInt16;
#ifdef _LZMA_UINT32_IS_ULONG
typedef long Int32;
typedef unsigned long UInt32;
#else
typedef int Int32;
typedef unsigned int UInt32;
#endif
#ifdef _SZ_NO_INT_64
/* define _SZ_NO_INT_64, if your compiler doesn't support 64-bit integers.
NOTES: Some code will work incorrectly in that case! */
typedef long Int64;
typedef unsigned long UInt64;
#else
#if defined(_MSC_VER) || defined(__BORLANDC__)
typedef __int64 Int64;
typedef unsigned __int64 UInt64;
#else
typedef long long int Int64;
typedef unsigned long long int UInt64;
#endif
#endif
#ifdef _LZMA_NO_SYSTEM_SIZE_T
typedef UInt32 SizeT;
#else
typedef size_t SizeT;
#endif
typedef int Bool;
#define True 1
#define False 0
#ifdef _MSC_VER
#if _MSC_VER >= 1300
#define MY_NO_INLINE __declspec(noinline)
#else
#define MY_NO_INLINE
#endif
#define MY_CDECL __cdecl
#define MY_STD_CALL __stdcall
#define MY_FAST_CALL MY_NO_INLINE __fastcall
#else
#define MY_CDECL
#define MY_STD_CALL
#define MY_FAST_CALL
#endif
/* The following interfaces use first parameter as pointer to structure */
typedef struct
{
SRes (*Read)(void *p, void *buf, size_t *size);
/* if (input(*size) != 0 && output(*size) == 0) means end_of_stream.
(output(*size) < input(*size)) is allowed */
} ISeqInStream;
/* it can return SZ_ERROR_INPUT_EOF */
SRes SeqInStream_Read(ISeqInStream *stream, void *buf, size_t size);
SRes SeqInStream_Read2(ISeqInStream *stream, void *buf, size_t size, SRes errorType);
SRes SeqInStream_ReadByte(ISeqInStream *stream, Byte *buf);
typedef struct
{
size_t (*Write)(void *p, const void *buf, size_t size);
/* Returns: result - the number of actually written bytes.
(result < size) means error */
} ISeqOutStream;
typedef enum
{
SZ_SEEK_SET = 0,
SZ_SEEK_CUR = 1,
SZ_SEEK_END = 2
} ESzSeek;
typedef struct
{
SRes (*Read)(void *p, void *buf, size_t *size); /* same as ISeqInStream::Read */
SRes (*Seek)(void *p, Int64 *pos, ESzSeek origin);
} ISeekInStream;
typedef struct
{
SRes (*Look)(void *p, void **buf, size_t *size);
/* if (input(*size) != 0 && output(*size) == 0) means end_of_stream.
(output(*size) > input(*size)) is not allowed
(output(*size) < input(*size)) is allowed */
SRes (*Skip)(void *p, size_t offset);
/* offset must be <= output(*size) of Look */
SRes (*Read)(void *p, void *buf, size_t *size);
/* reads directly (without buffer). It's same as ISeqInStream::Read */
SRes (*Seek)(void *p, Int64 *pos, ESzSeek origin);
} ILookInStream;
SRes LookInStream_LookRead(ILookInStream *stream, void *buf, size_t *size);
SRes LookInStream_SeekTo(ILookInStream *stream, UInt64 offset);
/* reads via ILookInStream::Read */
SRes LookInStream_Read2(ILookInStream *stream, void *buf, size_t size, SRes errorType);
SRes LookInStream_Read(ILookInStream *stream, void *buf, size_t size);
#define LookToRead_BUF_SIZE (1 << 14)
typedef struct
{
ILookInStream s;
ISeekInStream *realStream;
size_t pos;
size_t size;
Byte buf[LookToRead_BUF_SIZE];
} CLookToRead;
void LookToRead_CreateVTable(CLookToRead *p, int lookahead);
void LookToRead_Init(CLookToRead *p);
typedef struct
{
ISeqInStream s;
ILookInStream *realStream;
} CSecToLook;
void SecToLook_CreateVTable(CSecToLook *p);
typedef struct
{
ISeqInStream s;
ILookInStream *realStream;
} CSecToRead;
void SecToRead_CreateVTable(CSecToRead *p);
typedef struct
{
SRes (*Progress)(void *p, UInt64 inSize, UInt64 outSize);
/* Returns: result. (result != SZ_OK) means break.
Value (UInt64)(Int64)-1 for size means unknown value. */
} ICompressProgress;
typedef struct
{
void *(*Alloc)(void *p, size_t size);
void (*Free)(void *p, void *address); /* address can be 0 */
} ISzAlloc;
#define IAlloc_Alloc(p, size) (p)->Alloc((p), size)
#define IAlloc_Free(p, a) (p)->Free((p), a)
#endif

View File

@@ -1,236 +0,0 @@
HISTORY of the LZMA SDK
-----------------------
4.65 2009-02-03
-------------------------
- Some minor fixes
4.63 2008-12-31
-------------------------
- Some minor fixes
4.61 beta 2008-11-23
-------------------------
- The bug in ANSI-C LZMA Decoder was fixed:
If encoded stream was corrupted, decoder could access memory
outside of allocated range.
- Some changes in ANSI-C 7z Decoder interfaces.
- LZMA SDK is placed in the public domain.
4.60 beta 2008-08-19
-------------------------
- Some minor fixes.
4.59 beta 2008-08-13
-------------------------
- The bug was fixed:
LZMA Encoder in fast compression mode could access memory outside of
allocated range in some rare cases.
4.58 beta 2008-05-05
-------------------------
- ANSI-C LZMA Decoder was rewritten for speed optimizations.
- ANSI-C LZMA Encoder was included to LZMA SDK.
- C++ LZMA code now is just wrapper over ANSI-C code.
4.57 2007-12-12
-------------------------
- Speed optimizations in <20>++ LZMA Decoder.
- Small changes for more compatibility with some C/C++ compilers.
4.49 beta 2007-07-05
-------------------------
- .7z ANSI-C Decoder:
- now it supports BCJ and BCJ2 filters
- now it supports files larger than 4 GB.
- now it supports "Last Write Time" field for files.
- C++ code for .7z archives compressing/decompressing from 7-zip
was included to LZMA SDK.
4.43 2006-06-04
-------------------------
- Small changes for more compatibility with some C/C++ compilers.
4.42 2006-05-15
-------------------------
- Small changes in .h files in ANSI-C version.
4.39 beta 2006-04-14
-------------------------
- The bug in versions 4.33b:4.38b was fixed:
C++ version of LZMA encoder could not correctly compress
files larger than 2 GB with HC4 match finder (-mfhc4).
4.37 beta 2005-04-06
-------------------------
- Fixes in C++ code: code could no be compiled if _NO_EXCEPTIONS was defined.
4.35 beta 2005-03-02
-------------------------
- The bug was fixed in C++ version of LZMA Decoder:
If encoded stream was corrupted, decoder could access memory
outside of allocated range.
4.34 beta 2006-02-27
-------------------------
- Compressing speed and memory requirements for compressing were increased
- LZMA now can use only these match finders: HC4, BT2, BT3, BT4
4.32 2005-12-09
-------------------------
- Java version of LZMA SDK was included
4.30 2005-11-20
-------------------------
- Compression ratio was improved in -a2 mode
- Speed optimizations for compressing in -a2 mode
- -fb switch now supports values up to 273
- The bug in 7z_C (7zIn.c) was fixed:
It used Alloc/Free functions from different memory pools.
So if program used two memory pools, it worked incorrectly.
- 7z_C: .7z format supporting was improved
- LZMA# SDK (C#.NET version) was included
4.27 (Updated) 2005-09-21
-------------------------
- Some GUIDs/interfaces in C++ were changed.
IStream.h:
ISequentialInStream::Read now works as old ReadPart
ISequentialOutStream::Write now works as old WritePart
4.27 2005-08-07
-------------------------
- The bug in LzmaDecodeSize.c was fixed:
if _LZMA_IN_CB and _LZMA_OUT_READ were defined,
decompressing worked incorrectly.
4.26 2005-08-05
-------------------------
- Fixes in 7z_C code and LzmaTest.c:
previous versions could work incorrectly,
if malloc(0) returns 0
4.23 2005-06-29
-------------------------
- Small fixes in C++ code
4.22 2005-06-10
-------------------------
- Small fixes
4.21 2005-06-08
-------------------------
- Interfaces for ANSI-C LZMA Decoder (LzmaDecode.c) were changed
- New additional version of ANSI-C LZMA Decoder with zlib-like interface:
- LzmaStateDecode.h
- LzmaStateDecode.c
- LzmaStateTest.c
- ANSI-C LZMA Decoder now can decompress files larger than 4 GB
4.17 2005-04-18
-------------------------
- New example for RAM->RAM compressing/decompressing:
LZMA + BCJ (filter for x86 code):
- LzmaRam.h
- LzmaRam.cpp
- LzmaRamDecode.h
- LzmaRamDecode.c
- -f86 switch for lzma.exe
4.16 2005-03-29
-------------------------
- The bug was fixed in LzmaDecode.c (ANSI-C LZMA Decoder):
If _LZMA_OUT_READ was defined, and if encoded stream was corrupted,
decoder could access memory outside of allocated range.
- Speed optimization of ANSI-C LZMA Decoder (now it's about 20% faster).
Old version of LZMA Decoder now is in file LzmaDecodeSize.c.
LzmaDecodeSize.c can provide slightly smaller code than LzmaDecode.c
- Small speed optimization in LZMA C++ code
- filter for SPARC's code was added
- Simplified version of .7z ANSI-C Decoder was included
4.06 2004-09-05
-------------------------
- The bug in v4.05 was fixed:
LZMA-Encoder didn't release output stream in some cases.
4.05 2004-08-25
-------------------------
- Source code of filters for x86, IA-64, ARM, ARM-Thumb
and PowerPC code was included to SDK
- Some internal minor changes
4.04 2004-07-28
-------------------------
- More compatibility with some C++ compilers
4.03 2004-06-18
-------------------------
- "Benchmark" command was added. It measures compressing
and decompressing speed and shows rating values.
Also it checks hardware errors.
4.02 2004-06-10
-------------------------
- C++ LZMA Encoder/Decoder code now is more portable
and it can be compiled by GCC on Linux.
4.01 2004-02-15
-------------------------
- Some detection of data corruption was enabled.
LzmaDecode.c / RangeDecoderReadByte
.....
{
rd->ExtraBytes = 1;
return 0xFF;
}
4.00 2004-02-13
-------------------------
- Original version of LZMA SDK
HISTORY of the LZMA
-------------------
2001-2008: Improvements to LZMA compressing/decompressing code,
keeping compatibility with original LZMA format
1996-2001: Development of LZMA compression format
Some milestones:
2001-08-30: LZMA compression was added to 7-Zip
1999-01-02: First version of 7-Zip was released
End of document

594
extern/lzma/lzma.txt vendored
View File

@@ -1,594 +0,0 @@
LZMA SDK 4.65
-------------
LZMA SDK provides the documentation, samples, header files, libraries,
and tools you need to develop applications that use LZMA compression.
LZMA is default and general compression method of 7z format
in 7-Zip compression program (www.7-zip.org). LZMA provides high
compression ratio and very fast decompression.
LZMA is an improved version of famous LZ77 compression algorithm.
It was improved in way of maximum increasing of compression ratio,
keeping high decompression speed and low memory requirements for
decompressing.
LICENSE
-------
LZMA SDK is written and placed in the public domain by Igor Pavlov.
LZMA SDK Contents
-----------------
LZMA SDK includes:
- ANSI-C/C++/C#/Java source code for LZMA compressing and decompressing
- Compiled file->file LZMA compressing/decompressing program for Windows system
UNIX/Linux version
------------------
To compile C++ version of file->file LZMA encoding, go to directory
C++/7zip/Compress/LZMA_Alone
and call make to recompile it:
make -f makefile.gcc clean all
In some UNIX/Linux versions you must compile LZMA with static libraries.
To compile with static libraries, you can use
LIB = -lm -static
Files
---------------------
lzma.txt - LZMA SDK description (this file)
7zFormat.txt - 7z Format description
7zC.txt - 7z ANSI-C Decoder description
methods.txt - Compression method IDs for .7z
lzma.exe - Compiled file->file LZMA encoder/decoder for Windows
history.txt - history of the LZMA SDK
Source code structure
---------------------
C/ - C files
7zCrc*.* - CRC code
Alloc.* - Memory allocation functions
Bra*.* - Filters for x86, IA-64, ARM, ARM-Thumb, PowerPC and SPARC code
LzFind.* - Match finder for LZ (LZMA) encoders
LzFindMt.* - Match finder for LZ (LZMA) encoders for multithreading encoding
LzHash.h - Additional file for LZ match finder
LzmaDec.* - LZMA decoding
LzmaEnc.* - LZMA encoding
LzmaLib.* - LZMA Library for DLL calling
Types.h - Basic types for another .c files
Threads.* - The code for multithreading.
LzmaLib - LZMA Library (.DLL for Windows)
LzmaUtil - LZMA Utility (file->file LZMA encoder/decoder).
Archive - files related to archiving
7z - 7z ANSI-C Decoder
CPP/ -- CPP files
Common - common files for C++ projects
Windows - common files for Windows related code
7zip - files related to 7-Zip Project
Common - common files for 7-Zip
Compress - files related to compression/decompression
Copy - Copy coder
RangeCoder - Range Coder (special code of compression/decompression)
LZMA - LZMA compression/decompression on C++
LZMA_Alone - file->file LZMA compression/decompression
Branch - Filters for x86, IA-64, ARM, ARM-Thumb, PowerPC and SPARC code
Archive - files related to archiving
Common - common files for archive handling
7z - 7z C++ Encoder/Decoder
Bundles - Modules that are bundles of other modules
Alone7z - 7zr.exe: Standalone version of 7z.exe that supports only 7z/LZMA/BCJ/BCJ2
Format7zR - 7zr.dll: Reduced version of 7za.dll: extracting/compressing to 7z/LZMA/BCJ/BCJ2
Format7zExtractR - 7zxr.dll: Reduced version of 7zxa.dll: extracting from 7z/LZMA/BCJ/BCJ2.
UI - User Interface files
Client7z - Test application for 7za.dll, 7zr.dll, 7zxr.dll
Common - Common UI files
Console - Code for console archiver
CS/ - C# files
7zip
Common - some common files for 7-Zip
Compress - files related to compression/decompression
LZ - files related to LZ (Lempel-Ziv) compression algorithm
LZMA - LZMA compression/decompression
LzmaAlone - file->file LZMA compression/decompression
RangeCoder - Range Coder (special code of compression/decompression)
Java/ - Java files
SevenZip
Compression - files related to compression/decompression
LZ - files related to LZ (Lempel-Ziv) compression algorithm
LZMA - LZMA compression/decompression
RangeCoder - Range Coder (special code of compression/decompression)
C/C++ source code of LZMA SDK is part of 7-Zip project.
7-Zip source code can be downloaded from 7-Zip's SourceForge page:
http://sourceforge.net/projects/sevenzip/
LZMA features
-------------
- Variable dictionary size (up to 1 GB)
- Estimated compressing speed: about 2 MB/s on 2 GHz CPU
- Estimated decompressing speed:
- 20-30 MB/s on 2 GHz Core 2 or AMD Athlon 64
- 1-2 MB/s on 200 MHz ARM, MIPS, PowerPC or other simple RISC
- Small memory requirements for decompressing (16 KB + DictionarySize)
- Small code size for decompressing: 5-8 KB
LZMA decoder uses only integer operations and can be
implemented in any modern 32-bit CPU (or on 16-bit CPU with some conditions).
Some critical operations that affect the speed of LZMA decompression:
1) 32*16 bit integer multiply
2) Misspredicted branches (penalty mostly depends from pipeline length)
3) 32-bit shift and arithmetic operations
The speed of LZMA decompressing mostly depends from CPU speed.
Memory speed has no big meaning. But if your CPU has small data cache,
overall weight of memory speed will slightly increase.
How To Use
----------
Using LZMA encoder/decoder executable
--------------------------------------
Usage: LZMA <e|d> inputFile outputFile [<switches>...]
e: encode file
d: decode file
b: Benchmark. There are two tests: compressing and decompressing
with LZMA method. Benchmark shows rating in MIPS (million
instructions per second). Rating value is calculated from
measured speed and it is normalized with Intel's Core 2 results.
Also Benchmark checks possible hardware errors (RAM
errors in most cases). Benchmark uses these settings:
(-a1, -d21, -fb32, -mfbt4). You can change only -d parameter.
Also you can change the number of iterations. Example for 30 iterations:
LZMA b 30
Default number of iterations is 10.
<Switches>
-a{N}: set compression mode 0 = fast, 1 = normal
default: 1 (normal)
d{N}: Sets Dictionary size - [0, 30], default: 23 (8MB)
The maximum value for dictionary size is 1 GB = 2^30 bytes.
Dictionary size is calculated as DictionarySize = 2^N bytes.
For decompressing file compressed by LZMA method with dictionary
size D = 2^N you need about D bytes of memory (RAM).
-fb{N}: set number of fast bytes - [5, 273], default: 128
Usually big number gives a little bit better compression ratio
and slower compression process.
-lc{N}: set number of literal context bits - [0, 8], default: 3
Sometimes lc=4 gives gain for big files.
-lp{N}: set number of literal pos bits - [0, 4], default: 0
lp switch is intended for periodical data when period is
equal 2^N. For example, for 32-bit (4 bytes)
periodical data you can use lp=2. Often it's better to set lc0,
if you change lp switch.
-pb{N}: set number of pos bits - [0, 4], default: 2
pb switch is intended for periodical data
when period is equal 2^N.
-mf{MF_ID}: set Match Finder. Default: bt4.
Algorithms from hc* group doesn't provide good compression
ratio, but they often works pretty fast in combination with
fast mode (-a0).
Memory requirements depend from dictionary size
(parameter "d" in table below).
MF_ID Memory Description
bt2 d * 9.5 + 4MB Binary Tree with 2 bytes hashing.
bt3 d * 11.5 + 4MB Binary Tree with 3 bytes hashing.
bt4 d * 11.5 + 4MB Binary Tree with 4 bytes hashing.
hc4 d * 7.5 + 4MB Hash Chain with 4 bytes hashing.
-eos: write End Of Stream marker. By default LZMA doesn't write
eos marker, since LZMA decoder knows uncompressed size
stored in .lzma file header.
-si: Read data from stdin (it will write End Of Stream marker).
-so: Write data to stdout
Examples:
1) LZMA e file.bin file.lzma -d16 -lc0
compresses file.bin to file.lzma with 64 KB dictionary (2^16=64K)
and 0 literal context bits. -lc0 allows to reduce memory requirements
for decompression.
2) LZMA e file.bin file.lzma -lc0 -lp2
compresses file.bin to file.lzma with settings suitable
for 32-bit periodical data (for example, ARM or MIPS code).
3) LZMA d file.lzma file.bin
decompresses file.lzma to file.bin.
Compression ratio hints
-----------------------
Recommendations
---------------
To increase the compression ratio for LZMA compressing it's desirable
to have aligned data (if it's possible) and also it's desirable to locate
data in such order, where code is grouped in one place and data is
grouped in other place (it's better than such mixing: code, data, code,
data, ...).
Filters
-------
You can increase the compression ratio for some data types, using
special filters before compressing. For example, it's possible to
increase the compression ratio on 5-10% for code for those CPU ISAs:
x86, IA-64, ARM, ARM-Thumb, PowerPC, SPARC.
You can find C source code of such filters in C/Bra*.* files
You can check the compression ratio gain of these filters with such
7-Zip commands (example for ARM code):
No filter:
7z a a1.7z a.bin -m0=lzma
With filter for little-endian ARM code:
7z a a2.7z a.bin -m0=arm -m1=lzma
It works in such manner:
Compressing = Filter_encoding + LZMA_encoding
Decompressing = LZMA_decoding + Filter_decoding
Compressing and decompressing speed of such filters is very high,
so it will not increase decompressing time too much.
Moreover, it reduces decompression time for LZMA_decoding,
since compression ratio with filtering is higher.
These filters convert CALL (calling procedure) instructions
from relative offsets to absolute addresses, so such data becomes more
compressible.
For some ISAs (for example, for MIPS) it's impossible to get gain from such filter.
LZMA compressed file format
---------------------------
Offset Size Description
0 1 Special LZMA properties (lc,lp, pb in encoded form)
1 4 Dictionary size (little endian)
5 8 Uncompressed size (little endian). -1 means unknown size
13 Compressed data
ANSI-C LZMA Decoder
~~~~~~~~~~~~~~~~~~~
Please note that interfaces for ANSI-C code were changed in LZMA SDK 4.58.
If you want to use old interfaces you can download previous version of LZMA SDK
from sourceforge.net site.
To use ANSI-C LZMA Decoder you need the following files:
1) LzmaDec.h + LzmaDec.c + Types.h
LzmaUtil/LzmaUtil.c is example application that uses these files.
Memory requirements for LZMA decoding
-------------------------------------
Stack usage of LZMA decoding function for local variables is not
larger than 200-400 bytes.
LZMA Decoder uses dictionary buffer and internal state structure.
Internal state structure consumes
state_size = (4 + (1.5 << (lc + lp))) KB
by default (lc=3, lp=0), state_size = 16 KB.
How To decompress data
----------------------
LZMA Decoder (ANSI-C version) now supports 2 interfaces:
1) Single-call Decompressing
2) Multi-call State Decompressing (zlib-like interface)
You must use external allocator:
Example:
void *SzAlloc(void *p, size_t size) { p = p; return malloc(size); }
void SzFree(void *p, void *address) { p = p; free(address); }
ISzAlloc alloc = { SzAlloc, SzFree };
You can use p = p; operator to disable compiler warnings.
Single-call Decompressing
-------------------------
When to use: RAM->RAM decompressing
Compile files: LzmaDec.h + LzmaDec.c + Types.h
Compile defines: no defines
Memory Requirements:
- Input buffer: compressed size
- Output buffer: uncompressed size
- LZMA Internal Structures: state_size (16 KB for default settings)
Interface:
int LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen,
const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode,
ELzmaStatus *status, ISzAlloc *alloc);
In:
dest - output data
destLen - output data size
src - input data
srcLen - input data size
propData - LZMA properties (5 bytes)
propSize - size of propData buffer (5 bytes)
finishMode - It has meaning only if the decoding reaches output limit (*destLen).
LZMA_FINISH_ANY - Decode just destLen bytes.
LZMA_FINISH_END - Stream must be finished after (*destLen).
You can use LZMA_FINISH_END, when you know that
current output buffer covers last bytes of stream.
alloc - Memory allocator.
Out:
destLen - processed output size
srcLen - processed input size
Output:
SZ_OK
status:
LZMA_STATUS_FINISHED_WITH_MARK
LZMA_STATUS_NOT_FINISHED
LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK
SZ_ERROR_DATA - Data error
SZ_ERROR_MEM - Memory allocation error
SZ_ERROR_UNSUPPORTED - Unsupported properties
SZ_ERROR_INPUT_EOF - It needs more bytes in input buffer (src).
If LZMA decoder sees end_marker before reaching output limit, it returns OK result,
and output value of destLen will be less than output buffer size limit.
You can use multiple checks to test data integrity after full decompression:
1) Check Result and "status" variable.
2) Check that output(destLen) = uncompressedSize, if you know real uncompressedSize.
3) Check that output(srcLen) = compressedSize, if you know real compressedSize.
You must use correct finish mode in that case. */
Multi-call State Decompressing (zlib-like interface)
----------------------------------------------------
When to use: file->file decompressing
Compile files: LzmaDec.h + LzmaDec.c + Types.h
Memory Requirements:
- Buffer for input stream: any size (for example, 16 KB)
- Buffer for output stream: any size (for example, 16 KB)
- LZMA Internal Structures: state_size (16 KB for default settings)
- LZMA dictionary (dictionary size is encoded in LZMA properties header)
1) read LZMA properties (5 bytes) and uncompressed size (8 bytes, little-endian) to header:
unsigned char header[LZMA_PROPS_SIZE + 8];
ReadFile(inFile, header, sizeof(header)
2) Allocate CLzmaDec structures (state + dictionary) using LZMA properties
CLzmaDec state;
LzmaDec_Constr(&state);
res = LzmaDec_Allocate(&state, header, LZMA_PROPS_SIZE, &g_Alloc);
if (res != SZ_OK)
return res;
3) Init LzmaDec structure before any new LZMA stream. And call LzmaDec_DecodeToBuf in loop
LzmaDec_Init(&state);
for (;;)
{
...
int res = LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen,
const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode);
...
}
4) Free all allocated structures
LzmaDec_Free(&state, &g_Alloc);
For full code example, look at C/LzmaUtil/LzmaUtil.c code.
How To compress data
--------------------
Compile files: LzmaEnc.h + LzmaEnc.c + Types.h +
LzFind.c + LzFind.h + LzFindMt.c + LzFindMt.h + LzHash.h
Memory Requirements:
- (dictSize * 11.5 + 6 MB) + state_size
Lzma Encoder can use two memory allocators:
1) alloc - for small arrays.
2) allocBig - for big arrays.
For example, you can use Large RAM Pages (2 MB) in allocBig allocator for
better compression speed. Note that Windows has bad implementation for
Large RAM Pages.
It's OK to use same allocator for alloc and allocBig.
Single-call Compression with callbacks
--------------------------------------
Check C/LzmaUtil/LzmaUtil.c as example,
When to use: file->file decompressing
1) you must implement callback structures for interfaces:
ISeqInStream
ISeqOutStream
ICompressProgress
ISzAlloc
static void *SzAlloc(void *p, size_t size) { p = p; return MyAlloc(size); }
static void SzFree(void *p, void *address) { p = p; MyFree(address); }
static ISzAlloc g_Alloc = { SzAlloc, SzFree };
CFileSeqInStream inStream;
CFileSeqOutStream outStream;
inStream.funcTable.Read = MyRead;
inStream.file = inFile;
outStream.funcTable.Write = MyWrite;
outStream.file = outFile;
2) Create CLzmaEncHandle object;
CLzmaEncHandle enc;
enc = LzmaEnc_Create(&g_Alloc);
if (enc == 0)
return SZ_ERROR_MEM;
3) initialize CLzmaEncProps properties;
LzmaEncProps_Init(&props);
Then you can change some properties in that structure.
4) Send LZMA properties to LZMA Encoder
res = LzmaEnc_SetProps(enc, &props);
5) Write encoded properties to header
Byte header[LZMA_PROPS_SIZE + 8];
size_t headerSize = LZMA_PROPS_SIZE;
UInt64 fileSize;
int i;
res = LzmaEnc_WriteProperties(enc, header, &headerSize);
fileSize = MyGetFileLength(inFile);
for (i = 0; i < 8; i++)
header[headerSize++] = (Byte)(fileSize >> (8 * i));
MyWriteFileAndCheck(outFile, header, headerSize)
6) Call encoding function:
res = LzmaEnc_Encode(enc, &outStream.funcTable, &inStream.funcTable,
NULL, &g_Alloc, &g_Alloc);
7) Destroy LZMA Encoder Object
LzmaEnc_Destroy(enc, &g_Alloc, &g_Alloc);
If callback function return some error code, LzmaEnc_Encode also returns that code.
Single-call RAM->RAM Compression
--------------------------------
Single-call RAM->RAM Compression is similar to Compression with callbacks,
but you provide pointers to buffers instead of pointers to stream callbacks:
HRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark,
ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig);
Return code:
SZ_OK - OK
SZ_ERROR_MEM - Memory allocation error
SZ_ERROR_PARAM - Incorrect paramater
SZ_ERROR_OUTPUT_EOF - output buffer overflow
SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version)
LZMA Defines
------------
_LZMA_SIZE_OPT - Enable some optimizations in LZMA Decoder to get smaller executable code.
_LZMA_PROB32 - It can increase the speed on some 32-bit CPUs, but memory usage for
some structures will be doubled in that case.
_LZMA_UINT32_IS_ULONG - Define it if int is 16-bit on your compiler and long is 32-bit.
_LZMA_NO_SYSTEM_SIZE_T - Define it if you don't want to use size_t type.
C++ LZMA Encoder/Decoder
~~~~~~~~~~~~~~~~~~~~~~~~
C++ LZMA code use COM-like interfaces. So if you want to use it,
you can study basics of COM/OLE.
C++ LZMA code is just wrapper over ANSI-C code.
C++ Notes
~~~~~~~~~~~~~~~~~~~~~~~~
If you use some C++ code folders in 7-Zip (for example, C++ code for .7z handling),
you must check that you correctly work with "new" operator.
7-Zip can be compiled with MSVC 6.0 that doesn't throw "exception" from "new" operator.
So 7-Zip uses "CPP\Common\NewHandler.cpp" that redefines "new" operator:
operator new(size_t size)
{
void *p = ::malloc(size);
if (p == 0)
throw CNewException();
return p;
}
If you use MSCV that throws exception for "new" operator, you can compile without
"NewHandler.cpp". So standard exception will be used. Actually some code of
7-Zip catches any exception in internal code and converts it to HRESULT code.
So you don't need to catch CNewException, if you call COM interfaces of 7-Zip.
---
http://www.7-zip.org
http://www.7-zip.org/sdk.html
http://www.7-zip.org/support.html

View File

@@ -1,34 +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): Daniel Genrich
#
# ***** END GPL LICENSE BLOCK *****
SET(INC include)
FILE(GLOB SRC minilzo/*.c)
BLENDERLIB(bf_minilzo "${SRC}" "${INC}")
#, libtype='blender', priority = 0 )

View File

@@ -1,9 +0,0 @@
#!/usr/bin/python
Import ('env')
sources = env.Glob('minilzo/*.c')
defs = ''
incs = ' include '
env.BlenderLib ('bf_minilzo', sources, Split(incs), Split(defs), libtype=['intern'], priority=[40] )

View File

@@ -1,340 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, 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 software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, 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 redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
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 give any other recipients of the Program a copy of this License
along with the Program.
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 Program or any portion
of it, thus forming a work based on the Program, 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) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
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 Program, 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 Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) 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; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, 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 executable. 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.
If distribution of executable or 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 counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program 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.
5. 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 Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program 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.
7. 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 Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program 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 Program.
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.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program 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.
9. The Free Software Foundation may publish revised and/or new versions
of the 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 Program
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 Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, 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
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "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 PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. 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 PROGRAM 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 PROGRAM (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 PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), 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 Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. 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 program's name and a brief idea of what it does.>
Copyright (C) 19yy <name of author>
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
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19yy name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

View File

@@ -1,40 +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) 2009 Blender Foundation
# All rights reserved.
#
# Contributor(s): none yet.
#
# ***** END GPL LICENSE BLOCK *****
LIBNAME = minilzo
DIR = $(OCGDIR)/extern/$(LIBNAME)
include nan_compile.mk
install: $(ALL_OR_DEBUG)
@[ -d $(NAN_LZO) ] || mkdir -p $(NAN_LZO)
@[ -d $(NAN_LZO)/minilzo ] || mkdir -p $(NAN_LZO)/minilzo
@[ -d $(NAN_LZO)/lib/$(DEBUG_DIR) ] || mkdir -p $(NAN_LZO)/lib/$(DEBUG_DIR)
@$(NANBLENDERHOME)/intern/tools/cpifdiff.sh $(DIR)/$(DEBUG_DIR)lib$(LIBNAME).a $(NAN_LZO)/lib/$(DEBUG_DIR)
ifeq ($(OS),darwin)
ranlib $(NAN_LZO)/lib/$(DEBUG_DIR)lib$(LIBNAME).a
endif
@$(NANBLENDERHOME)/intern/tools/cpifdiff.sh *.h $(NAN_LZO)/minilzo

View File

@@ -1,123 +0,0 @@
============================================================================
miniLZO -- mini subset of the LZO real-time data compression library
============================================================================
Author : Markus Franz Xaver Johannes Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/opensource/lzo/
Version : 2.03
Date : 30 Apr 2008
I've created miniLZO for projects where it is inconvenient to
include (or require) the full LZO source code just because you
want to add a little bit of data compression to your application.
miniLZO implements the LZO1X-1 compressor and both the standard and
safe LZO1X decompressor. Apart from fast compression it also useful
for situations where you want to use pre-compressed data files (which
must have been compressed with LZO1X-999).
miniLZO consists of one C source file and three header files:
minilzo.c
minilzo.h, lzoconf.h, lzodefs.h
To use miniLZO just copy these files into your source directory, add
minilzo.c to your Makefile and #include minilzo.h from your program.
Note: you also must distribute this file (`README.LZO') with your project.
minilzo.o compiles to about 6 kB (using gcc or Visual C on a i386), and
the sources are about 30 kB when packed with zip - so there's no more
excuse that your application doesn't support data compression :-)
For more information, documentation, example programs and other support
files (like Makefiles and build scripts) please download the full LZO
package from
http://www.oberhumer.com/opensource/lzo/
Have fun,
Markus
P.S. minilzo.c is generated automatically from the LZO sources and
therefore functionality is completely identical
Appendix A: building miniLZO
----------------------------
miniLZO is written such a way that it should compile and run
out-of-the-box on most machines.
If you are running on a very unusual architecture and lzo_init() fails then
you should first recompile with `-DLZO_DEBUG' to see what causes the failure.
The most probable case is something like `sizeof(char *) != sizeof(long)'.
After identifying the problem you can compile by adding some defines
like `-DSIZEOF_CHAR_P=8' to your Makefile.
The best solution is (of course) using Autoconf - if your project uses
Autoconf anyway just add `-DMINILZO_HAVE_CONFIG_H' to your compiler
flags when compiling minilzo.c. See the LZO distribution for an example
how to set up configure.in.
Appendix B: list of public functions available in miniLZO
---------------------------------------------------------
Library initialization
lzo_init()
Compression
lzo1x_1_compress()
Decompression
lzo1x_decompress()
lzo1x_decompress_safe()
Checksum functions
lzo_adler32()
Version functions
lzo_version()
lzo_version_string()
lzo_version_date()
Portable (but slow) string functions
lzo_memcmp()
lzo_memcpy()
lzo_memmove()
lzo_memset()
Appendix C: suggested macros for `configure.in' when using Autoconf
-------------------------------------------------------------------
Checks for typedefs and structures
AC_CHECK_TYPE(ptrdiff_t,long)
AC_TYPE_SIZE_T
AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(long long)
AC_CHECK_SIZEOF(__int64)
AC_CHECK_SIZEOF(void *)
AC_CHECK_SIZEOF(size_t)
AC_CHECK_SIZEOF(ptrdiff_t)
Checks for compiler characteristics
AC_C_CONST
Checks for library functions
AC_CHECK_FUNCS(memcmp memcpy memmove memset)
Appendix D: Copyright
---------------------
LZO and miniLZO are Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002,
2003, 2004, 2005, 2006, 2007, 2008 Markus Franz Xaver Johannes Oberhumer
LZO and miniLZO are distributed under the terms of the GNU General
Public License (GPL). See the file COPYING.
Special licenses for commercial and other applications which
are not willing to accept the GNU General Public License
are available by contacting the author.

View File

@@ -1,417 +0,0 @@
/* lzoconf.h -- configuration for the LZO real-time data compression library
This file is part of the LZO real-time data compression library.
Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library 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.
The LZO 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/opensource/lzo/
*/
#ifndef __LZOCONF_H_INCLUDED
#define __LZOCONF_H_INCLUDED
#define LZO_VERSION 0x2030
#define LZO_VERSION_STRING "2.03"
#define LZO_VERSION_DATE "Apr 30 2008"
/* internal Autoconf configuration file - only used when building LZO */
#if defined(LZO_HAVE_CONFIG_H)
# include <config.h>
#endif
#include <limits.h>
#include <stddef.h>
/***********************************************************************
// LZO requires a conforming <limits.h>
************************************************************************/
#if !defined(CHAR_BIT) || (CHAR_BIT != 8)
# error "invalid CHAR_BIT"
#endif
#if !defined(UCHAR_MAX) || !defined(UINT_MAX) || !defined(ULONG_MAX)
# error "check your compiler installation"
#endif
#if (USHRT_MAX < 1) || (UINT_MAX < 1) || (ULONG_MAX < 1)
# error "your limits.h macros are broken"
#endif
/* get OS and architecture defines */
#ifndef __LZODEFS_H_INCLUDED
#include "lzodefs.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif
/***********************************************************************
// some core defines
************************************************************************/
#if !defined(LZO_UINT32_C)
# if (UINT_MAX < LZO_0xffffffffL)
# define LZO_UINT32_C(c) c ## UL
# else
# define LZO_UINT32_C(c) ((c) + 0U)
# endif
#endif
/* memory checkers */
#if !defined(__LZO_CHECKER)
# if defined(__BOUNDS_CHECKING_ON)
# define __LZO_CHECKER 1
# elif defined(__CHECKER__)
# define __LZO_CHECKER 1
# elif defined(__INSURE__)
# define __LZO_CHECKER 1
# elif defined(__PURIFY__)
# define __LZO_CHECKER 1
# endif
#endif
/***********************************************************************
// integral and pointer types
************************************************************************/
/* lzo_uint should match size_t */
#if !defined(LZO_UINT_MAX)
# if defined(LZO_ABI_LLP64) /* WIN64 */
# if defined(LZO_OS_WIN64)
typedef unsigned __int64 lzo_uint;
typedef __int64 lzo_int;
# else
typedef unsigned long long lzo_uint;
typedef long long lzo_int;
# endif
# define LZO_UINT_MAX 0xffffffffffffffffull
# define LZO_INT_MAX 9223372036854775807LL
# define LZO_INT_MIN (-1LL - LZO_INT_MAX)
# elif defined(LZO_ABI_IP32L64) /* MIPS R5900 */
typedef unsigned int lzo_uint;
typedef int lzo_int;
# define LZO_UINT_MAX UINT_MAX
# define LZO_INT_MAX INT_MAX
# define LZO_INT_MIN INT_MIN
# elif (ULONG_MAX >= LZO_0xffffffffL)
typedef unsigned long lzo_uint;
typedef long lzo_int;
# define LZO_UINT_MAX ULONG_MAX
# define LZO_INT_MAX LONG_MAX
# define LZO_INT_MIN LONG_MIN
# else
# error "lzo_uint"
# endif
#endif
/* Integral types with 32 bits or more. */
#if !defined(LZO_UINT32_MAX)
# if (UINT_MAX >= LZO_0xffffffffL)
typedef unsigned int lzo_uint32;
typedef int lzo_int32;
# define LZO_UINT32_MAX UINT_MAX
# define LZO_INT32_MAX INT_MAX
# define LZO_INT32_MIN INT_MIN
# elif (ULONG_MAX >= LZO_0xffffffffL)
typedef unsigned long lzo_uint32;
typedef long lzo_int32;
# define LZO_UINT32_MAX ULONG_MAX
# define LZO_INT32_MAX LONG_MAX
# define LZO_INT32_MIN LONG_MIN
# else
# error "lzo_uint32"
# endif
#endif
/* The larger type of lzo_uint and lzo_uint32. */
#if (LZO_UINT_MAX >= LZO_UINT32_MAX)
# define lzo_xint lzo_uint
#else
# define lzo_xint lzo_uint32
#endif
/* Memory model that allows to access memory at offsets of lzo_uint. */
#if !defined(__LZO_MMODEL)
# if (LZO_UINT_MAX <= UINT_MAX)
# define __LZO_MMODEL
# elif defined(LZO_HAVE_MM_HUGE_PTR)
# define __LZO_MMODEL_HUGE 1
# define __LZO_MMODEL __huge
# else
# define __LZO_MMODEL
# endif
#endif
/* no typedef here because of const-pointer issues */
#define lzo_bytep unsigned char __LZO_MMODEL *
#define lzo_charp char __LZO_MMODEL *
#define lzo_voidp void __LZO_MMODEL *
#define lzo_shortp short __LZO_MMODEL *
#define lzo_ushortp unsigned short __LZO_MMODEL *
#define lzo_uint32p lzo_uint32 __LZO_MMODEL *
#define lzo_int32p lzo_int32 __LZO_MMODEL *
#define lzo_uintp lzo_uint __LZO_MMODEL *
#define lzo_intp lzo_int __LZO_MMODEL *
#define lzo_xintp lzo_xint __LZO_MMODEL *
#define lzo_voidpp lzo_voidp __LZO_MMODEL *
#define lzo_bytepp lzo_bytep __LZO_MMODEL *
/* deprecated - use `lzo_bytep' instead of `lzo_byte *' */
#define lzo_byte unsigned char __LZO_MMODEL
typedef int lzo_bool;
/***********************************************************************
// function types
************************************************************************/
/* name mangling */
#if !defined(__LZO_EXTERN_C)
# ifdef __cplusplus
# define __LZO_EXTERN_C extern "C"
# else
# define __LZO_EXTERN_C extern
# endif
#endif
/* calling convention */
#if !defined(__LZO_CDECL)
# define __LZO_CDECL __lzo_cdecl
#endif
/* DLL export information */
#if !defined(__LZO_EXPORT1)
# define __LZO_EXPORT1
#endif
#if !defined(__LZO_EXPORT2)
# define __LZO_EXPORT2
#endif
/* __cdecl calling convention for public C and assembly functions */
#if !defined(LZO_PUBLIC)
# define LZO_PUBLIC(_rettype) __LZO_EXPORT1 _rettype __LZO_EXPORT2 __LZO_CDECL
#endif
#if !defined(LZO_EXTERN)
# define LZO_EXTERN(_rettype) __LZO_EXTERN_C LZO_PUBLIC(_rettype)
#endif
#if !defined(LZO_PRIVATE)
# define LZO_PRIVATE(_rettype) static _rettype __LZO_CDECL
#endif
/* function types */
typedef int
(__LZO_CDECL *lzo_compress_t) ( const lzo_bytep src, lzo_uint src_len,
lzo_bytep dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
typedef int
(__LZO_CDECL *lzo_decompress_t) ( const lzo_bytep src, lzo_uint src_len,
lzo_bytep dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
typedef int
(__LZO_CDECL *lzo_optimize_t) ( lzo_bytep src, lzo_uint src_len,
lzo_bytep dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
typedef int
(__LZO_CDECL *lzo_compress_dict_t)(const lzo_bytep src, lzo_uint src_len,
lzo_bytep dst, lzo_uintp dst_len,
lzo_voidp wrkmem,
const lzo_bytep dict, lzo_uint dict_len );
typedef int
(__LZO_CDECL *lzo_decompress_dict_t)(const lzo_bytep src, lzo_uint src_len,
lzo_bytep dst, lzo_uintp dst_len,
lzo_voidp wrkmem,
const lzo_bytep dict, lzo_uint dict_len );
/* Callback interface. Currently only the progress indicator ("nprogress")
* is used, but this may change in a future release. */
struct lzo_callback_t;
typedef struct lzo_callback_t lzo_callback_t;
#define lzo_callback_p lzo_callback_t __LZO_MMODEL *
/* malloc & free function types */
typedef lzo_voidp (__LZO_CDECL *lzo_alloc_func_t)
(lzo_callback_p self, lzo_uint items, lzo_uint size);
typedef void (__LZO_CDECL *lzo_free_func_t)
(lzo_callback_p self, lzo_voidp ptr);
/* a progress indicator callback function */
typedef void (__LZO_CDECL *lzo_progress_func_t)
(lzo_callback_p, lzo_uint, lzo_uint, int);
struct lzo_callback_t
{
/* custom allocators (set to 0 to disable) */
lzo_alloc_func_t nalloc; /* [not used right now] */
lzo_free_func_t nfree; /* [not used right now] */
/* a progress indicator callback function (set to 0 to disable) */
lzo_progress_func_t nprogress;
/* NOTE: the first parameter "self" of the nalloc/nfree/nprogress
* callbacks points back to this struct, so you are free to store
* some extra info in the following variables. */
lzo_voidp user1;
lzo_xint user2;
lzo_xint user3;
};
/***********************************************************************
// error codes and prototypes
************************************************************************/
/* Error codes for the compression/decompression functions. Negative
* values are errors, positive values will be used for special but
* normal events.
*/
#define LZO_E_OK 0
#define LZO_E_ERROR (-1)
#define LZO_E_OUT_OF_MEMORY (-2) /* [not used right now] */
#define LZO_E_NOT_COMPRESSIBLE (-3) /* [not used right now] */
#define LZO_E_INPUT_OVERRUN (-4)
#define LZO_E_OUTPUT_OVERRUN (-5)
#define LZO_E_LOOKBEHIND_OVERRUN (-6)
#define LZO_E_EOF_NOT_FOUND (-7)
#define LZO_E_INPUT_NOT_CONSUMED (-8)
#define LZO_E_NOT_YET_IMPLEMENTED (-9) /* [not used right now] */
#ifndef lzo_sizeof_dict_t
# define lzo_sizeof_dict_t ((unsigned)sizeof(lzo_bytep))
#endif
/* lzo_init() should be the first function you call.
* Check the return code !
*
* lzo_init() is a macro to allow checking that the library and the
* compiler's view of various types are consistent.
*/
#define lzo_init() __lzo_init_v2(LZO_VERSION,(int)sizeof(short),(int)sizeof(int),\
(int)sizeof(long),(int)sizeof(lzo_uint32),(int)sizeof(lzo_uint),\
(int)lzo_sizeof_dict_t,(int)sizeof(char *),(int)sizeof(lzo_voidp),\
(int)sizeof(lzo_callback_t))
LZO_EXTERN(int) __lzo_init_v2(unsigned,int,int,int,int,int,int,int,int,int);
/* version functions (useful for shared libraries) */
LZO_EXTERN(unsigned) lzo_version(void);
LZO_EXTERN(const char *) lzo_version_string(void);
LZO_EXTERN(const char *) lzo_version_date(void);
LZO_EXTERN(const lzo_charp) _lzo_version_string(void);
LZO_EXTERN(const lzo_charp) _lzo_version_date(void);
/* string functions */
LZO_EXTERN(int)
lzo_memcmp(const lzo_voidp _s1, const lzo_voidp _s2, lzo_uint _len);
LZO_EXTERN(lzo_voidp)
lzo_memcpy(lzo_voidp _dest, const lzo_voidp _src, lzo_uint _len);
LZO_EXTERN(lzo_voidp)
lzo_memmove(lzo_voidp _dest, const lzo_voidp _src, lzo_uint _len);
LZO_EXTERN(lzo_voidp)
lzo_memset(lzo_voidp _s, int _c, lzo_uint _len);
/* checksum functions */
LZO_EXTERN(lzo_uint32)
lzo_adler32(lzo_uint32 _adler, const lzo_bytep _buf, lzo_uint _len);
LZO_EXTERN(lzo_uint32)
lzo_crc32(lzo_uint32 _c, const lzo_bytep _buf, lzo_uint _len);
LZO_EXTERN(const lzo_uint32p)
lzo_get_crc32_table(void);
/* misc. */
LZO_EXTERN(int) _lzo_config_check(void);
typedef union { lzo_bytep p; lzo_uint u; } __lzo_pu_u;
typedef union { lzo_bytep p; lzo_uint32 u32; } __lzo_pu32_u;
typedef union { void *vp; lzo_bytep bp; lzo_uint32 u32; long l; } lzo_align_t;
/* align a char pointer on a boundary that is a multiple of `size' */
LZO_EXTERN(unsigned) __lzo_align_gap(const lzo_voidp _ptr, lzo_uint _size);
#define LZO_PTR_ALIGN_UP(_ptr,_size) \
((_ptr) + (lzo_uint) __lzo_align_gap((const lzo_voidp)(_ptr),(lzo_uint)(_size)))
/***********************************************************************
// deprecated macros - only for backward compatibility with LZO v1.xx
************************************************************************/
#if defined(LZO_CFG_COMPAT)
#define __LZOCONF_H 1
#if defined(LZO_ARCH_I086)
# define __LZO_i386 1
#elif defined(LZO_ARCH_I386)
# define __LZO_i386 1
#endif
#if defined(LZO_OS_DOS16)
# define __LZO_DOS 1
# define __LZO_DOS16 1
#elif defined(LZO_OS_DOS32)
# define __LZO_DOS 1
#elif defined(LZO_OS_WIN16)
# define __LZO_WIN 1
# define __LZO_WIN16 1
#elif defined(LZO_OS_WIN32)
# define __LZO_WIN 1
#endif
#define __LZO_CMODEL
#define __LZO_DMODEL
#define __LZO_ENTRY __LZO_CDECL
#define LZO_EXTERN_CDECL LZO_EXTERN
#define LZO_ALIGN LZO_PTR_ALIGN_UP
#define lzo_compress_asm_t lzo_compress_t
#define lzo_decompress_asm_t lzo_decompress_t
#endif /* LZO_CFG_COMPAT */
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* already included */
/* vim:set ts=4 et: */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,112 +0,0 @@
/* minilzo.h -- mini subset of the LZO real-time data compression library
This file is part of the LZO real-time data compression library.
Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library 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.
The LZO 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/opensource/lzo/
*/
/*
* NOTE:
* the full LZO package can be found at
* http://www.oberhumer.com/opensource/lzo/
*/
#ifndef __MINILZO_H
#define __MINILZO_H
#define MINILZO_VERSION 0x2030
#ifdef __LZOCONF_H
# error "you cannot use both LZO and miniLZO"
#endif
#undef LZO_HAVE_CONFIG_H
#include "lzoconf.h"
#if !defined(LZO_VERSION) || (LZO_VERSION != MINILZO_VERSION)
# error "version mismatch in header files"
#endif
#ifdef __cplusplus
extern "C" {
#endif
/***********************************************************************
//
************************************************************************/
/* Memory required for the wrkmem parameter.
* When the required size is 0, you can also pass a NULL pointer.
*/
#define LZO1X_MEM_COMPRESS LZO1X_1_MEM_COMPRESS
#define LZO1X_1_MEM_COMPRESS ((lzo_uint32) (16384L * lzo_sizeof_dict_t))
#define LZO1X_MEM_DECOMPRESS (0)
/* compression */
LZO_EXTERN(int)
lzo1x_1_compress ( const lzo_bytep src, lzo_uint src_len,
lzo_bytep dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
/* decompression */
LZO_EXTERN(int)
lzo1x_decompress ( const lzo_bytep src, lzo_uint src_len,
lzo_bytep dst, lzo_uintp dst_len,
lzo_voidp wrkmem /* NOT USED */ );
/* safe decompression with overrun testing */
LZO_EXTERN(int)
lzo1x_decompress_safe ( const lzo_bytep src, lzo_uint src_len,
lzo_bytep dst, lzo_uintp dst_len,
lzo_voidp wrkmem /* NOT USED */ );
#define LZO_OUT_LEN(size) ((size) + (size) / 16 + 64 + 3)
#define LZO_HEAP_ALLOC(var,size) \
lzo_align_t __LZO_MMODEL var [ ((size) + (sizeof(lzo_align_t) - 1)) / sizeof(lzo_align_t) ]
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* already included */

View File

@@ -25,6 +25,7 @@
# ***** END GPL LICENSE BLOCK *****
ADD_SUBDIRECTORY(audaspace)
ADD_SUBDIRECTORY(SoundSystem)
ADD_SUBDIRECTORY(string)
ADD_SUBDIRECTORY(ghost)
ADD_SUBDIRECTORY(guardedalloc)
@@ -38,7 +39,7 @@ ADD_SUBDIRECTORY(opennl)
ADD_SUBDIRECTORY(smoke)
IF(WITH_ELBEEM)
ADD_SUBDIRECTORY(elbeem)
ADD_SUBDIRECTORY(elbeem)
ENDIF(WITH_ELBEEM)
ADD_SUBDIRECTORY(bsp)

View File

@@ -32,7 +32,7 @@ SOURCEDIR = intern
# include nan_subdirs.mk
ALLDIRS = string ghost guardedalloc moto container memutil
ALLDIRS += decimation iksolver bsp opennl elbeem boolop smoke audaspace
ALLDIRS += decimation iksolver bsp SoundSystem opennl elbeem boolop smoke audaspace
all::
@for i in $(ALLDIRS); do \

View File

@@ -2,6 +2,7 @@
Import ('env')
SConscript(['audaspace/SConscript',
'SoundSystem/SConscript',
'string/SConscript',
'ghost/SConscript',
'guardedalloc/SConscript',

View File

@@ -24,17 +24,19 @@
#
# ***** END GPL LICENSE BLOCK *****
FILE(GLOB SRC stubs.c)
SET(INC . intern ../moto/include ../string dummy openal sdl)
SET(INC
.
..
../../../source/blender/makesdna
../../../source/blender/makesrna
)
IF(WITH_OPENAL)
FILE(GLOB SRC dummy/*.cpp intern/*.cpp openal/*.cpp sdl/*.cpp)
INCLUDE_DIRECTORIES(${OPENAL_INC} ${SDL_INC})
STRING(REGEX MATCH ".*ramework.*" FRAMEWORK ${OPENAL_INC})
IF(FRAMEWORK)
ADD_DEFINITIONS(-DAPPLE_FRAMEWORK_FIX)
ENDIF(FRAMEWORK)
ELSE(WITH_OPENAL)
FILE(GLOB SRC dummy/*.cpp intern/*.cpp)
ADD_DEFINITIONS(-DNO_SOUND)
ENDIF(WITH_OPENAL)
IF(WITH_INTERNATIONAL)
ADD_DEFINITIONS(-DWITH_FREETYPE2)
ENDIF(WITH_INTERNATIONAL)
BLENDERLIB_NOLIST(blenkernel_blc "${SRC}" "${INC}")
BLENDERLIB(bf_soundsystem "${SRC}" "${INC}")
#, libtype=['core','player'], priority = [20,140] )

View File

@@ -0,0 +1,70 @@
# -*- mode: gnumakefile; tab-width: 8; indent-tabs-mode: t; -*-
# vim: tabstop=8
#
# $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): GSR
#
# ***** END GPL LICENSE BLOCK *****
#
#
include nan_definitions.mk
LIBNAME = SoundSystem
SOURCEDIR = intern/SoundSystem
DIR = $(OCGDIR)/$(SOURCEDIR)
DIRS = intern
DIRS += dummy
ifneq ($(NAN_NO_OPENAL),true)
ifeq ($(OS),windows)
DIRS += openal sdl
endif
ifeq ($(OS),darwin)
DIRS += openal
endif
ifeq ($(OS),$(findstring $(OS), "linux freebsd solaris"))
DIRS += openal sdl
endif
ifeq ($(OS), irix)
DIRS += sdl
endif
else
export CPPFLAGS += -DNO_SOUND
endif
include nan_subdirs.mk
install: $(ALL_OR_DEBUG)
@[ -d $(NAN_SOUNDSYSTEM) ] || mkdir $(NAN_SOUNDSYSTEM)
@[ -d $(NAN_SOUNDSYSTEM)/include ] || mkdir $(NAN_SOUNDSYSTEM)/include
@[ -d $(NAN_SOUNDSYSTEM)/lib/$(DEBUG_DIR) ] || mkdir $(NAN_SOUNDSYSTEM)/lib/$(DEBUG_DIR)
@../tools/cpifdiff.sh $(DIR)/$(DEBUG_DIR)libSoundSystem.a $(NAN_SOUNDSYSTEM)/lib/$(DEBUG_DIR)
ifeq ($(OS),darwin)
ranlib $(NAN_SOUNDSYSTEM)/lib/$(DEBUG_DIR)libSoundSystem.a
endif
@../tools/cpifdiff.sh *.h $(NAN_SOUNDSYSTEM)/include/

View File

@@ -0,0 +1,20 @@
#!/usr/bin/python
Import ('env')
sources = env.Glob('dummy/*.cpp') + env.Glob('intern/*.cpp')
incs = '. intern ../moto/include ../string dummy openal sdl'
defs = ''
if env['WITH_BF_OPENAL']:
sources += env.Glob('openal/*.cpp') + env.Glob('sdl/*.cpp')
incs += ' ' + env['BF_OPENAL_INC']
incs += ' ' + env['BF_SDL_INC']
defs = 'USE_OPENAL'
else:
defs = 'NO_SOUND'
if not env['WITH_BF_SDL']:
defs += ' DISABLE_SDL'
env.BlenderLib ('bf_soundsystem', sources, Split(incs), Split(defs), libtype=['intern','player'], priority = [25,135] )

View File

@@ -0,0 +1,354 @@
/**
* $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 *****
*/
#ifndef SND_BLENDER_H
#define SND_BLENDER_H
#ifdef __cplusplus
extern "C" {
#endif
#include "SoundDefines.h"
#define SND_DECLARE_HANDLE(name) typedef struct name##__ { int unused; } *name
SND_DECLARE_HANDLE(SND_AudioDeviceInterfaceHandle);
SND_DECLARE_HANDLE(SND_SceneHandle);
SND_DECLARE_HANDLE(SND_ObjectHandle);
SND_DECLARE_HANDLE(SND_ListenerHandle);
/**
* set the specified type
*/
extern void SND_SetDeviceType(int device_type);
/**
* get an audiodevice
*/
extern SND_AudioDeviceInterfaceHandle SND_GetAudioDevice(void);
/**
* and let go of it
*/
extern void SND_ReleaseDevice(void);
/**
* check if playback is desired
*/
extern int SND_IsPlaybackWanted(SND_SceneHandle scene);
/**
* add memlocation to cache
*/
extern int SND_AddSample(SND_SceneHandle scene,
const char* filename,
void* memlocation,
int size);
/**
* remove all samples
*/
extern void SND_RemoveAllSamples(SND_SceneHandle scene);
/**
* forces the object to check its buffer, and fix it if it's wrong
*/
extern int SND_CheckBuffer(SND_SceneHandle scene, SND_ObjectHandle object);
/**
* Creates a scene, initializes it and returns a handle to that scene.
*
* @param audiodevice: handle to the audiodevice.
*/
extern SND_SceneHandle SND_CreateScene(SND_AudioDeviceInterfaceHandle audiodevice);
/**
* Stops all sounds, suspends the scene (so all resources will be freed) and deletes the scene.
*
* @param scene: handle to the soundscene.
*/
extern void SND_DeleteScene(SND_SceneHandle scene);
/**
* Adds a soundobject to the scene, gets the buffer the sample is loaded into.
*
* @param scene: handle to the soundscene.
* @param object: handle to soundobject.
*/
extern void SND_AddSound(SND_SceneHandle scene, SND_ObjectHandle object);
/**
* Removes a soundobject from the scene.
*
* @param scene: handle to the soundscene.
* @param object: handle to soundobject.
*/
extern void SND_RemoveSound(SND_SceneHandle scene, SND_ObjectHandle object);
/**
* Removes all soundobjects from the scene.
*
* @param scene: handle to the soundscene.
*/
extern void SND_RemoveAllSounds(SND_SceneHandle scene);
/**
* Stopss all soundobjects in the scene.
*
* @param scene: handle to the soundscene.
*/
extern void SND_StopAllSounds(SND_SceneHandle scene);
/**
* Updates the listener, checks the status of all soundobjects, builds a list of all active
* objects, updates the active objects.
*
* @param audiodevice: handle to the audiodevice.
* @param scene: handle to the soundscene.
*/
extern void SND_Proceed(SND_AudioDeviceInterfaceHandle audiodevice, SND_SceneHandle scene);
/**
* Returns a handle to the listener.
*
* @param scene: handle to the soundscene.
*/
extern SND_ListenerHandle SND_GetListener(SND_SceneHandle scene);
/**
* Sets the gain of the listener.
*
* @param scene: handle to the soundscene.
* @param gain: factor the gain gets multiplied with.
*/
extern void SND_SetListenerGain(SND_SceneHandle scene, double gain);
/**
* Sets a scaling to exaggerate or deemphasize the Doppler (pitch) shift resulting from the
* calculation.
* @attention $f' = dopplerfactor * f * frac{dopplervelocity - listener_velocity}{dopplervelocity + object_velocity}$
* @attention f: frequency in sample (soundobject)
* @attention f': effective Doppler shifted frequency
*
* @param object: handle to soundobject.
* @param dopplerfactor: the dopplerfactor.
*/
extern void SND_SetDopplerFactor(SND_SceneHandle scene, double dopplerfactor);
/**
* Sets the value of the propagation speed relative to which the source velocities are interpreted.
* @attention $f' = dopplerfactor * f * frac{dopplervelocity - listener_velocity}{dopplervelocity + object_velocity}$
* @attention f: frequency in sample (soundobject)
* @attention f': effective Doppler shifted frequency
*
* @param object: handle to soundobject.
* @param dopplervelocity: the dopplervelocity.
*/
extern void SND_SetDopplerVelocity(SND_SceneHandle scene, double dopplervelocity);
/**
* Creates a new soundobject and returns a handle to it.
*/
extern SND_ObjectHandle SND_CreateSound(void);
/**
* Deletes a soundobject.
*
* @param object: handle to soundobject.
*/
extern void SND_DeleteSound(SND_ObjectHandle object);
/**
* Sets a soundobject to SND_MUST_PLAY, so with the next proceed it will be updated and played.
*
* @param object: handle to soundobject.
*/
extern void SND_StartSound(SND_SceneHandle scene, SND_ObjectHandle object);
/**
* Sets a soundobject to SND_MUST_STOP, so with the next proceed it will be stopped.
*
* @param object: handle to soundobject.
*/
extern void SND_StopSound(SND_SceneHandle scene, SND_ObjectHandle object);
/**
* Sets a soundobject to SND_MUST_PAUSE, so with the next proceed it will be paused.
*
* @param object: handle to soundobject.
*/
extern void SND_PauseSound(SND_SceneHandle scene, SND_ObjectHandle object);
/**
* Sets the name of the sample to reference the soundobject to it.
*
* @param object: handle to soundobject.
* @param samplename: the name of the sample
*/
extern void SND_SetSampleName(SND_ObjectHandle object, char* samplename);
/**
* Sets the gain of a soundobject.
*
* @param object: handle to soundobject.
* @param gain: factor the gain gets multiplied with.
*/
extern void SND_SetGain(SND_ObjectHandle object, double gain);
/**
* Sets the minimum gain of a soundobject.
*
* @param object: handle to soundobject.
* @param minimumgain: lower threshold for the gain.
*/
extern void SND_SetMinimumGain(SND_ObjectHandle object, double minimumgain);
/**
* Sets the maximum gain of a soundobject.
*
* @param object: handle to soundobject.
* @param maximumgain: upper threshold for the gain.
*/
extern void SND_SetMaximumGain(SND_ObjectHandle object, double maximumgain);
/**
* Sets the rollofffactor. The rollofffactor is a per-Source parameter the application
* can use to increase or decrease the range of a source by decreasing or increasing the
* attenuation, respectively. The default value is 1. The implementation is free to optimize
* for a rollofffactor value of 0, which indicates that the application does not wish any
* distance attenuation on the respective Source.
*
* @param object: handle to soundobject.
* @param rollofffactor: the rollofffactor.
*/
extern void SND_SetRollOffFactor(SND_ObjectHandle object, double rollofffactor);
/**
* Sets the referencedistance at which the listener will experience gain.
* @attention G_dB = gain - 20 * log10(1 + rollofffactor * (dist - referencedistance)/referencedistance);
*
* @param object: handle to soundobject.
* @param distance: the reference distance.
*/
extern void SND_SetReferenceDistance(SND_ObjectHandle object, double referencedistance);
/**
* Sets the pitch of a soundobject.
*
* @param object: handle to soundobject.
* @param pitch: pitchingfactor: 2.0 for doubling the frequency, 0.5 for half the frequency.
*/
extern void SND_SetPitch(SND_ObjectHandle object, double pitch);
/**
* Sets the position a soundobject.
*
* @param object: handle to soundobject.
* @param position: position[3].
*/
extern void SND_SetPosition(SND_ObjectHandle object, double* position);
/**
* Sets the velocity of a soundobject.
*
* @param object: handle to soundobject.
* @param velocity: velocity[3].
*/
extern void SND_SetVelocity(SND_ObjectHandle object, double* velocity);
/**
* Sets the orientation of a soundobject.
*
* @param object: handle to soundobject.
* @param orientation: orientation[9].
*/
extern void SND_SetOrientation(SND_ObjectHandle object, double* orientation);
/**
* Sets the loopmode of a soundobject.
*
* @param object: handle to soundobject.
* @param loopmode type of the loop (SND_LOOP_OFF, SND_LOOP_NORMAL, SND_LOOP_BIDIRECTIONAL);
*/
extern void SND_SetLoopMode(SND_ObjectHandle object, int loopmode);
/**
* Sets the looppoints of a soundobject.
*
* @param object: handle to soundobject.
* @param loopstart startpoint of the loop
* @param loopend endpoint of the loop
*/
extern void SND_SetLoopPoints(SND_ObjectHandle object, unsigned int loopstart, unsigned int loopend);
/**
* Gets the gain of a soundobject.
*
* @param object: handle to soundobject.
*/
extern float SND_GetGain(SND_ObjectHandle object);
/**
* Gets the pitch of a soundobject.
*
* @param object: handle to soundobject.
*/
extern float SND_GetPitch(SND_ObjectHandle object);
/**
* Gets the looping of a soundobject.
* 0: SND_LOOP_OFF
* 1: SND_LOOP_NORMAL
* 2: SND_LOOP_BIDIRECTIONAL
*
* @param object: handle to soundobject.
*/
extern int SND_GetLoopMode(SND_ObjectHandle object);
/**
* Gets the playstate of a soundobject.
* SND_UNKNOWN = -1
* SND_INITIAL
* SND_MUST_PLAY
* SND_PLAYING
* SND_MUST_STOP
* SND_STOPPED
* SND_MUST_PAUSE
* SND_PAUSED
* SND_MUST_BE_DELETED
*
* @param object: handle to soundobject.
*/
extern int SND_GetPlaystate(SND_ObjectHandle object);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,83 @@
/*
* SND_CDObject.h
*
* Implementation for CD playback
*
* $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 *****
*/
#ifndef __SND_CDOBJECT_H
#define __SND_CDOBJECT_H
#include "SND_Object.h"
class SND_CDObject : public SND_Object
{
private:
/**
* Private to enforce singleton
*/
SND_CDObject();
SND_CDObject(const SND_CDObject&);
static SND_CDObject* m_instance;
MT_Scalar m_gain; /* the gain of the object */
int m_playmode; /* the way CD is played back (all, random, track, trackloop) */
int m_track; /* the track for 'track' and 'trackloop' */
int m_playstate; /* flag for current state of object */
bool m_modified;
bool m_used; /* flag for checking if we used the cd, if not don't
call the stop cd at the end */
public:
static bool CreateSystem();
static bool DisposeSystem();
static SND_CDObject* Instance();
~SND_CDObject();
void SetGain(MT_Scalar gain);
void SetPlaymode(int playmode);
void SetTrack(int track);
void SetPlaystate(int playstate);
void SetModified(bool modified);
void SetUsed();
bool GetUsed();
bool IsModified() const;
int GetTrack() const;
MT_Scalar GetGain() const;
int GetPlaymode() const;
int GetPlaystate() const;
};
#endif //__SND_CDOBJECT_H

View File

@@ -1,4 +1,9 @@
/*
* SND_DependKludge.h
*
* who needs what?
*
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
@@ -21,24 +26,25 @@
*
* The Original Code is: all of this file.
*
* Contributor(s): Matt Ebb
* Contributor(s): none yet.
*
* ***** END GPL LICENSE BLOCK *****
*/
#ifndef POINTDENSITY_H
#define POINTDENSITY_H
#ifndef HAVE_CONFIG_H
/**
* Make point density kd-trees for all point density textures in the scene
*/
#ifndef NO_SOUND
struct Render;
struct TexResult;
#if defined (_WIN32) && !defined(FREE_WINDOWS)
# define USE_OPENAL
#elif defined (__linux__) || (__FreeBSD__) || defined(__APPLE__) || defined(__sun)
# define USE_OPENAL
#else
# ifdef USE_OPENAL
# undef USE_OPENAL
# endif
#endif
void make_pointdensities(struct Render *re);
void free_pointdensities(struct Render *re);
int pointdensitytex(struct Tex *tex, float *texvec, struct TexResult *texres);
#endif /* POINTDENSITY_H */
#endif /* NO_SOUND */
#endif /* HAVE_CONFIG_H */

View File

@@ -0,0 +1,79 @@
/*
* SND_DeviceManager.h
*
* singleton for creating, switching and deleting audiodevices
*
* $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 *****
*/
#ifndef __SND_DEVICEMANAGER_H
#define __SND_DEVICEMANAGER_H
#include "SND_IAudioDevice.h"
class SND_DeviceManager
{
public :
/**
* a subscription is needed before instances are given away
* applications must call subscribe first, get an instance, and
* when they are finished with sound, unsubscribe
*/
static void Subscribe();
static void Unsubscribe();
static SND_IAudioDevice* Instance();
static void SetDeviceType(int device_type);
private :
/**
* Private to enforce singleton
*/
SND_DeviceManager();
SND_DeviceManager(const SND_DeviceManager&);
~SND_DeviceManager();
static SND_IAudioDevice* m_instance;
/**
* The type of device to be created on a call
* to Instance().
*/
static int m_device_type;
/**
* Remember the number of subscriptions.
* if 0, delete the device
*/
static int m_subscriptions;
};
#endif //__SND_DEVICEMANAGER_H

View File

@@ -0,0 +1,343 @@
/**
* $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 *****
*/
#ifndef SND_IAUDIODEVICE
#define SND_IAUDIODEVICE
#include "SND_SoundObject.h"
#include "SND_CDObject.h"
#include "SND_WaveCache.h"
#include "SND_WaveSlot.h"
#include "MT_Matrix3x3.h"
class SND_IAudioDevice
{
public:
/**
* constructor
*/
SND_IAudioDevice() {};
/**
* destructor
*/
virtual ~SND_IAudioDevice() {};
/**
* check to see if initialization was successfull
*
* @return indication of succes
*/
virtual bool IsInitialized()=0;
/**
* get the wavecache (which does sample (un)loading)
*
* @return pointer to the wavecache
*/
virtual SND_WaveCache* GetWaveCache() const =0;
/**
* loads a sample into the device
*
* @param samplename the name of the sample
* @param memlocation pointer where the sample is stored
* @param size size of the sample in memory
*
* @return pointer to the slot with sample data
*/
virtual SND_WaveSlot* LoadSample(const STR_String& samplename,
void* memlocation,
int size)=0;
/**
* remove a sample from the wavecache
*
* @param filename pointer to filename
*/
// virtual void RemoveSample(const char* filename)=0;
/**
* remove all samples from the wavecache
*/
virtual void RemoveAllSamples()=0;
/**
* get a new id from the device
*
* @param pObject pointer to soundobject
*
* @return indication of success
*/
virtual bool GetNewId(SND_SoundObject* pObject)=0;
/**
* clear an id
*
* @param pObject pointer to soundobject
*/
virtual void ClearId(SND_SoundObject* pObject)=0;
/**
* initialize the listener
*/
virtual void InitListener()=0;
/**
* set the value of the propagation speed relative to which the
* source velocities are interpreted.
* f' = DOPPLER_FACTOR * f * (DOPPLER_VELOCITY - Vl) / (DOPPLER_VELOCITY + Vo)
* f: frequency in sample (soundobject)
* f': effective Doppler shifted frequency
* Vl: velocity listener
* Vo: velocity soundobject
*
* @param dopplervelocity scaling factor for doppler effect
*/
virtual void SetDopplerVelocity(MT_Scalar dopplervelocity) const =0;
/**
* set a scaling to exaggerate or deemphasize the Doppler (pitch)
* shift resulting from the calculation.
* f' = DOPPLER_FACTOR * f * (DOPPLER_VELOCITY - Listener_velocity )/(DOPPLER_VELOCITY + object_velocity )
*
* @param dopplerfactor scaling factor for doppler effect
*/
virtual void SetDopplerFactor(MT_Scalar dopplerfactor) const =0;
/**
* set the roll-off factor
*
* @param rollofffactor a global volume scaling factor
*/
virtual void SetListenerRollOffFactor(MT_Scalar rollofffactor) const =0;
/**
* make the context the current one
*/
virtual void MakeCurrent() const =0;
/**
* update the device
*/
virtual void NextFrame() const =0;
/**
* set the volume of the listener.
*
* @param gain the mastergain
*/
virtual void SetListenerGain(float gain) const =0;
/**
* connect the buffer with the source
*
* @param id the id of the object
* @param buffer the buffer the sample is stored in
*/
virtual void SetObjectBuffer(int id, unsigned int buffer)=0;
/**
* pause playback of the cd
* @param id the id of the object
*
* @return the state the object is in
*/
virtual int GetPlayState(int id) =0;
/**
* play a sound belonging to an object.
*
* @param id the id of the object
*/
virtual void PlayObject(int id) =0;
/**
* stop a sound belonging to an object.
*
* @param id the id of the object
*/
virtual void StopObject(int id) const =0;
/**
* stop all sounds.
*/
virtual void StopAllObjects()=0;
/**
* pause the sound belonging to an object.
*
* @param id the id of the object
*/
virtual void PauseObject(int id) const =0;
/**
* set the sound to looping or non-looping.
*
* @param id the id of the object
* @param loopmode type of looping (no loop, normal, bidirectional)
*/
virtual void SetObjectLoop(int id, unsigned int loopmode) const =0;
/**
* set the looppoints of a sound
*
* @param id the id of the object
* @param loopstart the startpoint of the loop (in samples)
* @param loopend the endpoint of the loop (in samples)
*/
virtual void SetObjectLoopPoints(int id, unsigned int loopstart, unsigned int loopend) const =0;
/**
* set the pitch of the sound.
*
* @param id the id of the object
* @param pitch the pitch
*/
virtual void SetObjectPitch(int id, MT_Scalar pitch) const =0;
/**
* set the gain of the sound.
*
* @param id the id of the object
* @param gain the gain
*/
virtual void SetObjectGain(int id, MT_Scalar gain) const =0;
/**
* ROLLOFF_FACTOR is per-Source parameter the application can use to increase or decrease
* the range of a source by decreasing or increasing the attenuation, respectively. The
* default value is 1. The implementation is free to optimize for a ROLLOFF_FACTOR value
* of 0, which indicates that the application does not wish any distance attenuation on
* the respective Source.
*
* @param id the id of the object
* @param rolloff a per-source volume scaling factor
*/
virtual void SetObjectRollOffFactor(int id, MT_Scalar rolloff) const =0;
/**
* min_gain indicates the minimal gain which is always guaranteed for this sound
*
* @param id the id of the object
* @param mingain the minimum gain of the object
*/
virtual void SetObjectMinGain(int id, MT_Scalar mingain) const =0;
/**
* max_gain indicates the maximal gain which is always guaranteed for this sound
*
* @param id the id of the object
* @param maxgain the maximum gain of the object
*/
virtual void SetObjectMaxGain(int id, MT_Scalar maxgain) const =0;
/**
* set the distance at which the Listener will experience gain.
* G_dB = GAIN - 20*log10(1 + ROLLOFF_FACTOR*(dist-REFERENCE_DISTANCE)/REFERENCE_DISTANCE );
*
* @param id the id of the object
* @param referencedistance the distance at which the listener will start hearing
*/
virtual void SetObjectReferenceDistance(int id, MT_Scalar referencedistance) const =0;
/**
* set the position, velocity and orientation of a sound.
*
* @param id the id of the object
* @param position the position of the object
* @param velocity the velocity of the object
* @param orientation the orientation of the object
* @param lisposition the position of the listener
* @param rollofffactor the rollofffactor of the object
*/
virtual void SetObjectTransform(int id,
const MT_Vector3& position,
const MT_Vector3& velocity,
const MT_Matrix3x3& orientation,
const MT_Vector3& lisposition,
const MT_Scalar& rollofffactor) const =0;
/**
* make a sound 2D
*
* @param id the id of the object
*/
virtual void ObjectIs2D(int id) const =0;
/**
* tell the device we want cd suppport
*/
virtual void UseCD() const =0;
/**
* start playback of the cd
*
* @param track the tracknumber to start playback from
*/
virtual void PlayCD(int track) const =0;
/**
* pause playback of the cd (true == pause, false == resume)
*/
virtual void PauseCD(bool pause) const =0;
/**
* stop playback of the cd
*/
virtual void StopCD() const =0;
/**
* set the playbackmode of the cd
* SND_CD_ALL play all tracks
* SND_CD_TRACK play one track
* SND_CD_TRACKLOOP play one track looped
* SND_CD_RANDOM play all tracks in random order
*
* @param playmode playmode
*/
virtual void SetCDPlaymode(int playmode) const =0;
/**
* set the volume playback of the cd
*
* @param gain the gain
*/
virtual void SetCDGain(MT_Scalar gain) const =0;
virtual void StartUsingDSP() =0;
virtual float* GetSpectrum() =0;
virtual void StopUsingDSP() =0;
protected:
virtual void RevokeSoundObject(SND_SoundObject* pObject)=0;
};
#endif //SND_IAUDIODEVICE

View File

@@ -1,4 +1,9 @@
/**
/*
* SND_Object.h
*
* Abstract sound object
*
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
@@ -21,21 +26,29 @@
*
* The Original Code is: all of this file.
*
* Contributor(s): Matt Ebb, Raul Fernandez Hernandez (Farsthary).
* Contributor(s): none yet.
*
* ***** END GPL LICENSE BLOCK *****
*/
#ifndef BLI_VOXEL_H
#define BLI_VOXEL_H
#ifndef __SND_OBJECT_H
#define __SND_OBJECT_H
/* find the index number of a voxel, given x/y/z integer coords and resolution vector */
#define V_I(x, y, z, res) ( (z)*(res)[1]*(res)[0] + (y)*(res)[0] + (x) )
#include "GEN_List.h"
#include "MT_Matrix3x3.h"
#include "SoundDefines.h"
/* all input coordinates must be in bounding box 0.0 - 1.0 */
float voxel_sample_nearest(float *data, int *res, float *co);
float voxel_sample_trilinear(float *data, int *res, float *co);
float voxel_sample_triquadratic(float *data, int *res, float *co);
float voxel_sample_tricubic(float *data, int *res, float *co, int bspline);
/**
* SND_Object is an interface class for soundobjects, listeners and other
* kinds of sound related thingies.
*/
class SND_Object : public GEN_Link
{
public:
SND_Object() {};
virtual ~SND_Object() {};
};
#endif //__SND_OBJECT_H
#endif /* BLI_VOXEL_H */

View File

@@ -0,0 +1,104 @@
/*
* SND_Scene.h
*
* The scene for sounds.
*
* $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 *****
*/
#ifdef WIN32
#pragma warning (disable:4786) // get rid of stupid stl-visual compiler debug warning
#endif //WIN32
#ifndef __SND_SCENE_H
#define __SND_SCENE_H
#include "SoundDefines.h"
#include "SND_SoundObject.h"
#include "SND_CDObject.h"
#include "SND_SoundListener.h"
#include "SND_WaveSlot.h"
#include "MT_Vector3.h"
#include "MT_Matrix3x3.h"
#include "STR_String.h"
#include <set>
class SND_Scene
{
std::set<class SND_SoundObject*> m_soundobjects;
GEN_List m_activeobjects;
class SND_IAudioDevice* m_audiodevice;
class SND_WaveCache* m_wavecache;
class SND_SoundListener m_listener;
bool m_audio; // to check if audio works
bool m_audioplayback; // to check if audioplayback is wanted
void UpdateListener();
void BuildActiveList(MT_Scalar curtime);
void UpdateActiveObects();
void UpdateCD();
public:
SND_Scene(SND_IAudioDevice* adi);
~SND_Scene();
bool IsPlaybackWanted();
void AddActiveObject(SND_SoundObject* pObject, MT_Scalar curtime);
void RemoveActiveObject(SND_SoundObject* pObject);
void DeleteObjectWhenFinished(SND_SoundObject* pObject);
void Proceed();
int LoadSample(const STR_String& samplename,
void* memlocation,
int size);
void RemoveAllSamples();
bool CheckBuffer(SND_SoundObject* pObject);
bool IsSampleLoaded(STR_String& samplename);
void AddObject(SND_SoundObject* pObject);
bool SetCDObject(SND_CDObject* cdobject);
void DeleteObject(SND_SoundObject* pObject);
void RemoveAllObjects();
void StopAllObjects();
int GetObjectStatus(SND_SoundObject* pObject) const;
void SetListenerTransform(const MT_Vector3& pos,
const MT_Vector3& vel,
const MT_Matrix3x3& mat);
SND_SoundListener* GetListener();
};
#endif //__SND_SCENE_H

View File

@@ -0,0 +1,82 @@
/*
* SND_SoundListener.h
*
* A SoundListener is for sound what a camera is for vision.
*
* $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 *****
*/
#ifndef __SND_SOUNDLISTENER_H
#define __SND_SOUNDLISTENER_H
#include "SND_Object.h"
class SND_SoundListener : public SND_Object
{
public:
SND_SoundListener();
virtual ~SND_SoundListener();
void SetStateFlag(unsigned int stateflags);
void SetGain(MT_Scalar gain);
void SetPosition(const MT_Vector3& pos);
void SetVelocity(const MT_Vector3& vel);
void SetOrientation(const MT_Matrix3x3& ori);
void SetDopplerFactor(MT_Scalar dopplerfactor);
void SetDopplerVelocity(MT_Scalar dopplervelocity);
void SetScale(MT_Scalar scale);
void SetModified(bool modified);
bool IsModified() const;
unsigned int GetStateFlags() const;
MT_Scalar GetGain() const;
MT_Vector3 GetPosition() const;
MT_Vector3 GetVelocity() const;
MT_Matrix3x3 GetOrientation();
MT_Scalar GetDopplerFactor() const;
MT_Scalar GetDopplerVelocity() const;
MT_Scalar GetScale() const;
private:
void* m_listener;
bool m_modified;
MT_Scalar m_gain; /* overall gain */
MT_Vector3 m_position; /* position; left/right, up/down, in/out */
MT_Vector3 m_velocity; /* velocity of the listener */
MT_Matrix3x3 m_orientation; /* orientation of the listener */
MT_Scalar m_dopplerfactor; /* scaling factor for the Doppler (pitch) shift */
MT_Scalar m_dopplervelocity; /* factor for the reference velocity (for Dopplereffect) */
MT_Scalar m_scale;
};
#endif //__SND_SOUNDLISTENER_H

View File

@@ -0,0 +1,159 @@
/*
* SND_SoundObject.h
*
* Implementation of the abstract sound object
*
* $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 *****
*/
#ifndef __SND_SOUNDOBJECT_H
#define __SND_SOUNDOBJECT_H
#include "SND_Object.h"
#include "STR_String.h"
/**
* SND_SoundObject is a class for api independent sounddata storage conected to an actuator
*/
class SND_SoundObject : public SND_Object
{
private:
STR_String m_samplename; /* name of the sample */
STR_String m_objectname; /* name of the object */
unsigned int m_buffer;
bool m_active; /* is the object active or not? */
int m_id;
MT_Scalar m_lifespan; /* the lifespan of the sound seconds */
MT_Scalar m_timestamp;
MT_Scalar m_length; /* length of the sample in seconds */
MT_Scalar m_gain; /* the gain of the object */
MT_Scalar m_rollofffactor; /* the scaling factor to increase or decrease the range
of a source by decreasing or increasing the
attenuation, respectively */
MT_Scalar m_referencedistance;/* the distance at which the listener will experience
gain */
MT_Scalar m_mingain; /* indicates the minimal gain which is always guaranteed
for this source */
MT_Scalar m_maxgain; /* indicates the maximal gain which is always guaranteed
for this source */
MT_Scalar m_pitch; /* the pitch of the object */
MT_Vector3 m_position; /* position; left/right, up/down, in/out */
MT_Vector3 m_velocity; /* velocity of the object */
MT_Matrix3x3 m_orientation; /* orientation of the object */
unsigned int m_loopmode; /* loop normal or bidirectional? */
unsigned int m_loopstart; /* start of looppoint in samples! */
unsigned int m_loopend; /* end of looppoint in samples! */
bool m_is3d; /* is the object 3D or 2D? */
int m_playstate; /* flag for current state of object */
bool m_modified;
unsigned int m_running;
bool m_highpriority; /* may the sound be ditched when we run out of voices? */
public:
SND_SoundObject();
~SND_SoundObject();
void SetBuffer(unsigned int buffer);
void SetActive(bool active);
void StartSound();
void StopSound();
void PauseSound();
void DeleteWhenFinished();
void SetObjectName(STR_String objectname);
void SetSampleName(STR_String samplename);
void SetLength(MT_Scalar length);
void SetPitch(MT_Scalar pitch);
void SetGain(MT_Scalar gain);
void SetMinGain(MT_Scalar mingain);
void SetMaxGain(MT_Scalar maxgain);
void SetRollOffFactor(MT_Scalar rollofffactor);
void SetReferenceDistance(MT_Scalar distance);
void SetPosition(const MT_Vector3& pos);
void SetVelocity(const MT_Vector3& vel);
void SetOrientation(const MT_Matrix3x3& orient);
void SetLoopMode(unsigned int loopmode);
void SetLoopStart(unsigned int loopstart);
void SetLoopEnd(unsigned int loopend);
void Set3D(bool threedee);
void SetPlaystate(int playstate);
void SetHighPriority(bool priority);
void SetId(int id);
void SetLifeSpan();
void SetTimeStamp(MT_Scalar timestamp);
void SetModified(bool modified);
bool IsLifeSpanOver(MT_Scalar curtime) const;
bool IsActive() const;
bool IsModified() const;
bool IsHighPriority() const;
void InitRunning();
bool IsRunning() const;
void AddRunning();
int GetId() const;
MT_Scalar GetLifeSpan() const;
MT_Scalar GetTimestamp() const;
unsigned int GetBuffer();
const STR_String& GetSampleName();
const STR_String& GetObjectName();
MT_Scalar GetLength() const;
MT_Scalar GetGain() const;
MT_Scalar GetPitch() const;
MT_Scalar GetMinGain() const;
MT_Scalar GetMaxGain() const;
MT_Scalar GetRollOffFactor() const;
MT_Scalar GetReferenceDistance() const;
MT_Vector3 GetPosition() const;
MT_Vector3 GetVelocity() const;
MT_Matrix3x3 GetOrientation() const;
unsigned int GetLoopMode() const;
unsigned int GetLoopStart() const;
unsigned int GetLoopEnd() const;
bool Is3D() const;
int GetPlaystate() const;
};
#endif //__SND_SOUNDOBJECT_H

View File

@@ -0,0 +1,111 @@
/**
* $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 *****
*/
#ifndef SND_UTILS_H
#define SND_UTILS_H
#include "SND_WaveSlot.h"
#ifdef __cplusplus
extern "C"
{
#endif
typedef struct
{
unsigned char riff[4];
signed int size;
unsigned char type[4];
} WavFileHeader;
typedef struct
{
unsigned short format;
unsigned short numberofchannels;
unsigned int samplerate;
unsigned int bytespersec;
unsigned short blockalignment;
unsigned short bitrate;
} WavFmtHeader;
typedef struct
{
unsigned short size;
unsigned short samplesperblock;
} WavFmtExHeader;
typedef struct
{
unsigned int Manufacturer;
unsigned int Product;
unsigned int SamplePeriod;
unsigned int Note;
unsigned int FineTune;
unsigned int SMPTEFormat;
unsigned int SMPTEOffest;
unsigned int loops;
unsigned int SamplerData;
struct
{
unsigned int Identifier;
unsigned int Type;
unsigned int Start;
unsigned int End;
unsigned int Fraction;
unsigned int Count;
} Loop[1];
} WavSampleHeader;
typedef struct
{
unsigned char id[4];
unsigned int size;
} WavChunkHeader;
/**
* loads a sample and returns a pointer
*/
extern void* SND_LoadSample(char *filename);
extern bool SND_IsSampleValid(const STR_String& name, void* memlocation);
extern unsigned int SND_GetSampleFormat(void* sample);
extern unsigned int SND_GetNumberOfChannels(void* sample);
extern unsigned int SND_GetSampleRate(void* sample);
extern unsigned int SND_GetBitRate(void* sample);
extern unsigned int SND_GetNumberOfSamples(void* sample, unsigned int sample_length);
extern unsigned int SND_GetHeaderSize(void* sample, unsigned int sample_length);
extern unsigned int SND_GetExtraChunk(void* sample);
extern void SND_GetSampleInfo(signed char* sample, SND_WaveSlot* waveslot);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -1,4 +1,9 @@
/**
/*
* SND_WaveCache.h
*
* abstract wavecache, a way to organize samples
*
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
@@ -21,27 +26,41 @@
*
* The Original Code is: all of this file.
*
* Contributor(s): Matt Ebb.
* Contributor(s): none yet.
*
* ***** END GPL LICENSE BLOCK *****
*/
float vol_get_stepsize(struct ShadeInput *shi, int context);
float vol_get_density(struct ShadeInput *shi, float *co);
void vol_get_scattering(ShadeInput *shi, float *scatter_col, float *co, float stepsize, float density);
#ifdef WIN32
#pragma warning (disable:4786) // get rid of stupid stl-visual compiler debug warning
#endif //WIN32
void shade_volume_outside(ShadeInput *shi, ShadeResult *shr);
void shade_volume_inside(ShadeInput *shi, ShadeResult *shr);
void shade_volume_shadow(struct ShadeInput *shi, struct ShadeResult *shr, struct Isect *last_is);
#ifndef __SND_WAVECACHE_H
#define __SND_WAVECACHE_H
#define STEPSIZE_VIEW 0
#define STEPSIZE_SHADE 1
#include "SND_WaveSlot.h"
#include "SoundDefines.h"
#include "SND_SoundObject.h"
#include <map>
#define VOL_IS_BACKFACE 1
#define VOL_IS_SAMEMATERIAL 2
class SND_WaveCache
{
public:
SND_WaveCache();
virtual ~SND_WaveCache();
#define VOL_BOUNDS_DEPTH 0
#define VOL_BOUNDS_SS 1
SND_WaveSlot* GetWaveSlot(const STR_String& samplename);
void RemoveAllSamples();
void RemoveSample(const STR_String& samplename, int buffer);
private:
std::map<STR_String, SND_WaveSlot*> m_samplecache;
SND_WaveSlot* m_bufferList[NUM_BUFFERS];
void FreeSamples();
};
#endif //__SND_WAVECACHE_H
#define VOL_SHADE_OUTSIDE 0
#define VOL_SHADE_INSIDE 1

View File

@@ -0,0 +1,92 @@
/*
* SND_WaveSlot.cpp
*
* class for storing sample related information
*
* $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 *****
*/
#ifndef __SND_WAVESLOT_H
#define __SND_WAVESLOT_H
#include "STR_String.h"
class SND_WaveSlot
{
STR_String m_samplename;
bool m_loaded;
void* m_data;
unsigned int m_buffer;
unsigned int m_sampleformat;
unsigned int m_numberofchannels;
unsigned int m_samplerate;
unsigned int m_bitrate;
unsigned int m_numberofsamples;
unsigned int m_filesize;
public:
SND_WaveSlot(): m_loaded(false),
m_data(NULL),
m_buffer(0),
m_sampleformat(0),
m_numberofchannels(0),
m_samplerate(0),
m_bitrate(0),
m_numberofsamples(0),
m_filesize(0)
{};
~SND_WaveSlot();
void SetSampleName(STR_String samplename);
void SetLoaded(bool loaded);
void SetData(void* data);
void SetBuffer(unsigned int buffer);
void SetSampleFormat(unsigned int sampleformat);
void SetNumberOfChannels(unsigned int numberofchannels);
void SetSampleRate(unsigned int samplerate);
void SetBitRate(unsigned int bitrate);
void SetNumberOfSamples(unsigned int numberofsamples);
void SetFileSize(unsigned int filesize);
const STR_String& GetSampleName();
bool IsLoaded() const;
void* GetData();
unsigned int GetBuffer() const;
unsigned int GetSampleFormat() const;
unsigned int GetNumberOfChannels() const;
unsigned int GetSampleRate() const;
unsigned int GetBitRate() const;
unsigned int GetNumberOfSamples() const;
unsigned int GetFileSize() const;
};
#endif //__SND_WAVESLOT_H

View File

@@ -28,18 +28,21 @@
#
#
LIBNAME = blenkernel_blc
DIR = $(OCGDIR)/blenderplayer/$(LIBNAME)
LIBNAME = soundsystem
DIR = $(OCGDIR)/intern/SoundSystem
ALLTARGETS = $(OBJS) $(DIR)/$(DEBUG_DIR)SoundSystem
include nan_compile.mk
CFLAGS += $(LEVEL_2_C_WARNINGS)
CFLAGS += $(FIX_STUBS_WARNINGS)
CPPFLAGS += $(NAN_LEVEL_1_WARNINGS)
CPPFLAGS += $(OGL_CPPFLAGS)
CPPFLAGS += -I../../source/blender/makesdna
CPPFLAGS += -I../../source/blender/makesrna
CPPFLAGS += -I$(NAN_MOTO)/include
CPPFLAGS += -I.. -I../SND_BlenderWaveCache -I../SND_OpenAL
# path to our own external headerfiles
CPPFLAGS += -I..
TESTLIB = $(OCGDIR)/gameengine/OpenALSoundSystem/$(DEBUG_DIR)libOpenALSoundSystem.a
TESTLIB += $(OCGDIR)/gameengine/BlenderWaveCache/$(DEBUG_DIR)libBlenderWaveCache.a
TESTLIB += $(OCGDIR)/intern/SoundSystem/$(DEBUG_DIR)libsoundsystem.a
TESTLIB += $(NAN_OPENAL)/lib/libopenal.a
$(DIR)/$(DEBUG_DIR)SoundSystem: $(OBJS) $(TESTLIB)
$(CC) $(LDFLAGS) -o $@ $(OBJS) $(TESTLIB) -lm -pthread -ldl -lstdc++

View File

@@ -0,0 +1,154 @@
/* SND_test.c nov 2000
*
* testfile for the SND module
*
* janco verduin
*
* $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 *****
*/
#include "SND_C-api.h"
#include "BlenderWaveCacheCApi.h"
#include "OpenALC-Api.h"
#include <stdio.h>
#include <stdlib.h>
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#if defined(WIN32)
#include <io.h>
#else
#include <unistd.h>
#endif
#include <fcntl.h>
static int buf[3];
float oPos[3]={3.0, 0.0,-1.0};
float oVel[3]={0.0, 0.0, 1.0};
float oOri[6]={0.0, 0.0, 1.0, 0.0, 1.0, 0.0};
void* ReadFile(char *filename)
{
int file, filelen;
void *data = NULL;
#if defined(WIN32)
file = open(filename, O_BINARY|O_RDONLY);
#else
file = open(filename, 0|O_RDONLY);
#endif
if (file == -1) {
printf("can't open file.\n");
printf("press q for quit.\n");
}
else {
filelen = lseek(file, 0, SEEK_END);
lseek(file, 0, SEEK_SET);
if (filelen != 0){
data = malloc(filelen);
if (read(file, data, filelen) != filelen) {
free(data);
data = NULL;
}
}
close(file);
}
return (data);
}
int main(int argc, char* argv[])
{
int ch;
char* samplename = NULL;
void* sampleinmemory = NULL;
SND_CacheHandle wavecache = NULL;
SND_SceneHandle scene = NULL;
SND_ObjectHandle object = NULL;
wavecache = SND_GetWaveCache();
scene = SND_CreateOpenALScene(wavecache);
samplename = "2.wav";
sampleinmemory = ReadFile(samplename);
if (sampleinmemory) {
object = SND_CreateObject();
SND_AddMemoryLocation(samplename, sampleinmemory);
SND_SetSampleName(object, samplename);
SND_AddObject(scene, object);
printf("go your gang...\n");
printf("1: play\n");
printf("2: stop\n");
printf("q: quit\n");
}
do
{
ch = getchar();
ch = toupper(ch);
switch (ch)
{
case '1':
{
SND_SetPitch(object, 1.0);
SND_SetGain(object, 1.0);
SND_StartSound(object);
break;
}
case '2':
{
SND_StopSound(object);
break;
}
default:
break;
}
SND_Proceed(scene);
} while (ch != 'Q');
if (object) {
SND_RemoveObject(scene, object);
SND_DeleteObject(object);
}
SND_DeleteScene(scene);
SND_DeleteCache();
return 0;
}

View File

@@ -0,0 +1,107 @@
/*
* SoundDefines.h
*
* this is where all kinds of defines are stored
*
* $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 *****
*/
#ifndef __SOUNDDEFINES_H
#define __SOUNDDEFINES_H
/* the types of devices */
enum
{
snd_e_dummydevice = 0,
snd_e_openaldevice
};
/* general stuff */
#define NUM_BUFFERS 128
#define NUM_SOURCES 24 /* 24 is the limit for openal on windows, was 16 in 2.47 and previous */
/* openal related stuff */
#define AL_LOOPING 0x1007
/* activelist defines */
enum
{
SND_REMOVE_ACTIVE_OBJECT = 0,
SND_ADD_ACTIVE_OBJECT,
SND_DO_NOTHING
};
/* playstate flags */
enum
{
SND_UNKNOWN = -1,
SND_INITIAL,
SND_MUST_PLAY,
SND_PLAYING,
SND_MUST_STOP,
SND_STOPPED,
SND_MUST_PAUSE,
SND_PAUSED,
SND_MUST_RESUME,
SND_MUST_STOP_WHEN_FINISHED,
SND_MUST_BE_DELETED
};
/* loopmodes */
enum
{
SND_LOOP_OFF = 0,
SND_LOOP_NORMAL,
SND_LOOP_BIDIRECTIONAL
};
/* cd playstate flags */
enum
{
SND_CD_ALL = 0,
SND_CD_TRACK,
SND_CD_TRACKLOOP
};
/* sample types */
enum
{
SND_WAVE_FORMAT_UNKNOWN = 0,
SND_WAVE_FORMAT_PCM,
SND_WAVE_FORMAT_ADPCM,
SND_WAVE_FORMAT_ALAW = 6,
SND_WAVE_FORMAT_MULAW,
SND_WAVE_FORMAT_DIALOGIC_OKI_ADPCM = 17,
SND_WAVE_FORMAT_CONTROL_RES_VQLPC = 34,
SND_WAVE_FORMAT_GSM_610 = 49,
SND_WAVE_FORMAT_MPEG3 = 85
};
#endif //__SOUNDDEFINES_H

View File

@@ -28,16 +28,15 @@
#
#
LIBNAME = aud_fx
DIR = $(OCGDIR)/intern/audaspace
LIBNAME = DummySoundSystem
DIR = $(OCGDIR)/intern/$(LIBNAME)
include nan_compile.mk
CCFLAGS += $(LEVEL_1_CPP_WARNINGS)
CPPFLAGS += -I../ffmpeg
CPPFLAGS += -I$(NAN_STRING)/include
CPPFLAGS += -I$(NAN_MOTO)/include
CPPFLAGS += -I../intern
CPPFLAGS += -I../SDL
CPPFLAGS += -I../SRC
CPPFLAGS += -I..
CPPFLAGS += -I.

View File

@@ -1,4 +1,5 @@
/**
/*
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
@@ -21,25 +22,31 @@
*
* The Original Code is: all of this file.
*
* Contributor(s): Raul Fernandez Hernandez (Farsthary), Matt Ebb.
* Contributor(s): none yet.
*
* ***** END GPL LICENSE BLOCK *****
* SND_DummyDevice derived from SND_IAudioDevice
*/
#ifndef VOXELDATA_H
#define VOXELDATA_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
struct Render;
struct TexResult;
#ifdef WIN32
#pragma warning (disable:4786) // get rid of stupid stl-visual compiler debug warning
#endif //WIN32
typedef struct VoxelDataHeader
#include "SND_DummyDevice.h"
SND_DummyDevice::SND_DummyDevice()
{
int resolX, resolY, resolZ;
int frames;
} VoxelDataHeader;
}
SND_DummyDevice::~SND_DummyDevice()
{
#ifdef ONTKEVER
printf("SND_DummyDevice destructor");
#endif
}
void make_voxeldata(struct Render *re);
void free_voxeldata(struct Render *re);
int voxeldatatex(struct Tex *tex, float *texvec, struct TexResult *texres);
#endif /* VOXELDATA_H */

View File

@@ -0,0 +1,93 @@
/**
* $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 *****
*/
#ifndef SND_DUMMYDEVICE
#define SND_DUMMYDEVICE
#include "SND_AudioDevice.h"
class SND_DummyDevice : public SND_AudioDevice
{
public:
SND_DummyDevice();
~SND_DummyDevice();
bool Init() { return false; }
SND_WaveSlot* LoadSample(const STR_String& samplename,
void* memlocation,
int size) { return NULL; }
void InitListener() {};
void SetListenerGain(float gain) const {};
void SetDopplerVelocity(MT_Scalar dopplervelocity) const {};
void SetDopplerFactor(MT_Scalar dopplerfactor) const {};
void SetListenerRollOffFactor(MT_Scalar rollofffactor) const {};
void MakeCurrent() const {};
void NextFrame() const {};
void SetObjectBuffer(int id, unsigned int buffer) {};
int GetPlayState(int id) { return SND_UNKNOWN; }
void PlayObject(int id) {};
void StopObject(int id) const {};
void StopAllObjects() {};
void PauseObject(int id) const {};
void SetObjectLoop(int id, unsigned int loopmode) const {};
void SetObjectLoopPoints(int id, unsigned int loopstart, unsigned int loopend) const {};
void SetObjectPitch(int id, MT_Scalar pitch) const {};
void SetObjectGain(int id, MT_Scalar gain) const {};
void SetObjectMinGain(int id, MT_Scalar mingain) const {};
void SetObjectMaxGain(int id, MT_Scalar maxgain) const {};
void SetObjectRollOffFactor(int id, MT_Scalar rolloff) const {};
void SetObjectReferenceDistance(int id, MT_Scalar distance) const {};
void SetObjectTransform(int id,
const MT_Vector3& position,
const MT_Vector3& velocity,
const MT_Matrix3x3& orientation,
const MT_Vector3& lisposition,
const MT_Scalar& rollofffactor) const {};
void ObjectIs2D(int id) const {};
void PlayCD(int track) const {};
void PauseCD(bool pause) const {};
void StopCD() const {};
void SetCDPlaymode(int playmode) const {};
void SetCDGain(MT_Scalar gain) const {};
void StartUsingDSP() {};
float* GetSpectrum() { return NULL; }
void StopUsingDSP() {};
};
#endif //SND_DUMMYDEVICE

View File

@@ -22,23 +22,23 @@
#
# The Original Code is: all of this file.
#
# Contributor(s): GSR
# Contributor(s): none yet.
#
# ***** END GPL LICENSE BLOCK *****
#
#
LIBNAME = aud_jack
DIR = $(OCGDIR)/intern/audaspace
LIBNAME = SoundSystem
DIR = $(OCGDIR)/intern/SoundSystem
include nan_compile.mk
CCFLAGS += $(LEVEL_1_CPP_WARNINGS)
# If we are here, jack is enable.
CPPFLAGS += -DWITH_JACK
CPPFLAGS += $(NAN_JACKCFLAGS)
CPPFLAGS += -I../intern
CPPFLAGS += -I$(NAN_STRING)/include
CPPFLAGS += -I$(NAN_MOTO)/include
CPPFLAGS += -I../../../source/blender/include
CPPFLAGS += -I../dummy
CPPFLAGS += -I../openal
CPPFLAGS += -I..
CPPFLAGS += -I.

View File

@@ -0,0 +1,242 @@
/**
* $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 *****
*/
#include "SND_AudioDevice.h"
#include "SND_SoundObject.h"
#ifdef WIN32
// This warning tells us about truncation of __long__ stl-generated names.
// It can occasionally cause DevStudio to have internal compiler warnings.
#pragma warning( disable : 4786 )
#endif
SND_AudioDevice::SND_AudioDevice()
{
m_wavecache = NULL;
m_audio = false;
for (int i = 0; i < NUM_SOURCES; i++)
{
m_idObjectArray[i] = new SND_IdObject();
m_idObjectArray[i]->SetId(i);
m_idObjectArray[i]->SetSoundObject(NULL);
m_idObjectList.addTail(m_idObjectArray[i]);
}
}
SND_AudioDevice::~SND_AudioDevice()
{
for (int i = 0; i < NUM_SOURCES; i++)
{
delete m_idObjectArray[i];
m_idObjectArray[i] = NULL;
}
if (m_wavecache)
{
delete m_wavecache;
m_wavecache = NULL;
}
}
bool SND_AudioDevice::IsInitialized()
{
return m_audio;
}
SND_WaveCache* SND_AudioDevice::GetWaveCache() const
{
return m_wavecache;
}
/* seeks an unused id and returns it */
bool SND_AudioDevice::GetNewId(SND_SoundObject* pObject)
{
#ifdef ONTKEVER
printf("SND_AudioDevice::GetNewId\n");
#endif
bool result = false;
// first, get the oldest (the first) idobject
SND_IdObject* pIdObject = (SND_IdObject*)m_idObjectList.getHead();
if (pIdObject->isTail())
{
}
else
{
// find the first id object which doesn't have a high priority soundobject
bool ThisSoundMustStay = false;
bool OutOfIds = false;
do
{
// if no soundobject present, it's seat may be taken
if (pIdObject->GetSoundObject())
{
// and also if it ain't highprio
if (pIdObject->GetSoundObject()->IsHighPriority())
{
ThisSoundMustStay = true;
pIdObject = (SND_IdObject*)pIdObject->getNext();
// if the last one is a priority sound too, then there are no id's left
// and we won't add any new sounds
if (pIdObject->isTail())
OutOfIds = true;
}
else
{
ThisSoundMustStay = false;
}
}
else
{
ThisSoundMustStay = false;
}
} while (ThisSoundMustStay && !OutOfIds);
if (!OutOfIds)
{
SND_SoundObject* oldobject = pIdObject->GetSoundObject();
// revoke the old object if present
if (oldobject)
{
#ifdef ONTKEVER
printf("oldobject: %x\n", oldobject);
#endif
RevokeSoundObject(oldobject);
}
// set the new soundobject into the idobject
pIdObject->SetSoundObject(pObject);
// set the id into the soundobject
int id = pIdObject->GetId();
pObject->SetId(id);
// connect the new id to the buffer the sample is stored in
SetObjectBuffer(id, pObject->GetBuffer());
// remove the idobject from the list and add it in the back again
pIdObject->remove();
m_idObjectList.addTail(pIdObject);
result = true;
}
}
return result;
}
void SND_AudioDevice::ClearId(SND_SoundObject* pObject)
{
#ifdef ONTKEVER
printf("SND_AudioDevice::ClearId\n");
#endif
if (pObject)
{
int id = pObject->GetId();
if (id != -1)
{
// lets get the idobject belonging to the soundobject
SND_IdObject* pIdObject = m_idObjectArray[id];
SND_SoundObject* oldobject = pIdObject->GetSoundObject();
if (oldobject)
{
RevokeSoundObject(oldobject);
// clear the idobject from the soundobject
pIdObject->SetSoundObject(NULL);
}
// remove the idobject and place it in front
pIdObject->remove();
m_idObjectList.addHead(pIdObject);
}
}
}
void SND_AudioDevice::RevokeSoundObject(SND_SoundObject* pObject)
{
#ifdef ONTKEVER
printf("SND_AudioDevice::RevokeSoundObject\n");
#endif
// stop the soundobject
int id = pObject->GetId();
if (id >= 0 && id < NUM_SOURCES)
{
StopObject(id);
// remove the object from the 'activelist'
pObject->SetActive(false);
#ifdef ONTKEVER
printf("pObject->remove();\n");
#endif
}
// make sure its id is invalid
pObject->SetId(-1);
}
/*
void SND_AudioDevice::RemoveSample(const char* filename)
{
if (m_wavecache)
m_wavecache->RemoveSample(filename);
}
*/
void SND_AudioDevice::RemoveAllSamples()
{
if (m_wavecache)
m_wavecache->RemoveAllSamples();
}

View File

@@ -0,0 +1,115 @@
/**
* $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 *****
*/
#ifndef SND_AUDIODEVICE
#define SND_AUDIODEVICE
#include "SND_IAudioDevice.h"
#include "SoundDefines.h"
#include "SND_IdObject.h"
class SND_AudioDevice : public SND_IAudioDevice
{
public:
SND_AudioDevice();
virtual ~SND_AudioDevice();
virtual bool IsInitialized();
SND_WaveCache* GetWaveCache() const;
bool GetNewId(SND_SoundObject* pObject);
void ClearId(SND_SoundObject* pObject);
void UseCD() const {};
/* to be implemented in derived class
virtual SND_WaveSlot* LoadSample(const STR_String& samplename,
void* memlocation,
int size) =0;
*/
// void RemoveSample(const char* filename);
void RemoveAllSamples();
/* to be implemented in derived class
virtual void InitListener()=0;
virtual void SetListenerGain(float gain) const =0;
virtual void SetDopplerVelocity(MT_Scalar dopplervelocity) const =0;
virtual void SetDopplerFactor(MT_Scalar dopplerfactor) const =0;
virtual void SetListenerRollOffFactor(MT_Scalar rollofffactor) const =0;
virtual void MakeCurrent() const =0;
virtual void UpdateDevice() const =0;
virtual void SetObjectBuffer(int id, unsigned int buffer)=0;
virtual int GetPlayState(int id)=0;
virtual void PlayObject(int id)=0;
virtual void StopObject(int id) const =0;
virtual void StopAllObjects()=0;
virtual void PauseObject(int id) const =0;
virtual void SetObjectLoop(int id, bool loop) const =0;
virtual void SetObjectLoopPoints(int id, unsigned int loopstart, unsigned int loopend) const =0;
virtual void SetObjectPitch(int id, MT_Scalar pitch) const =0;
virtual void SetObjectGain(int id, MT_Scalar gain) const =0;
virtual void SetObjectRollOffFactor(int id, MT_Scalar rolloff) const =0;
virtual void SetObjectMinGain(int id, MT_Scalar mingain) const =0;
virtual void SetObjectMaxGain(int id, MT_Scalar maxgain) const =0;
virtual void SetObjectReferenceDistance(int id, MT_Scalar referencedistance) const =0;
virtual void SetObjectTransform(int id,
const MT_Vector3& position,
const MT_Vector3& velocity,
const MT_Matrix3x3& orientation,
const MT_Vector3& lisposition,
const MT_Scalar& rollofffactor) const =0;
virtual void ObjectIs2D(int id) const =0;
virtual void PlayCD(int track) const =0;
virtual void PauseCD(bool pause) const =0;
virtual void StopCD() const =0;
virtual void SetCDPlaymode(int playmode) const =0;
virtual void SetCDGain(MT_Scalar gain) const =0;
virtual float* GetSpectrum() =0;
*/
protected:
bool m_audio;
GEN_List m_idObjectList;
SND_IdObject* m_idObjectArray[NUM_SOURCES];
SND_WaveCache* m_wavecache;
private:
void RevokeSoundObject(SND_SoundObject* pObject);
};
#endif //SND_AUDIODEVICE

View File

@@ -0,0 +1,392 @@
/*
* SND_C-Api.cpp
*
* C Api for soundmodule
*
* $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 *****
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "SND_C-api.h"
#include "SND_DeviceManager.h"
#include "SND_Scene.h"
#ifdef WIN32
#pragma warning (disable:4786) // get rid of stupid stl-visual compiler debug warning
#endif //WIN32
void SND_SetDeviceType(int device_type)
{
SND_DeviceManager::SetDeviceType(device_type);
}
SND_AudioDeviceInterfaceHandle SND_GetAudioDevice()
{
SND_IAudioDevice* audiodevice = NULL;
SND_DeviceManager::Subscribe();
audiodevice = SND_DeviceManager::Instance();
if (!audiodevice->IsInitialized())
{
SND_DeviceManager::SetDeviceType(snd_e_dummydevice);
audiodevice = SND_DeviceManager::Instance();
}
return (SND_AudioDeviceInterfaceHandle)audiodevice;
}
void SND_ReleaseDevice()
{
SND_DeviceManager::Unsubscribe();
}
int SND_IsPlaybackWanted(SND_SceneHandle scene)
{
assert(scene);
bool result = ((SND_Scene*)scene)->IsPlaybackWanted();
return (int)result;
}
// create a scene
SND_SceneHandle SND_CreateScene(SND_AudioDeviceInterfaceHandle audiodevice)
{
// initialize sound scene and object
SND_Scene* scene = new SND_Scene((SND_IAudioDevice*)audiodevice);
return (SND_SceneHandle)scene;
}
void SND_DeleteScene(SND_SceneHandle scene)
{
assert(scene);
delete (SND_Scene*)scene;
}
int SND_AddSample(SND_SceneHandle scene,
const char* filename,
void* memlocation,
int size)
{
assert(scene);
assert(memlocation);
int buffer = ((SND_Scene*)scene)->LoadSample(filename, memlocation, size);
return buffer;
}
void SND_RemoveAllSamples(SND_SceneHandle scene)
{
assert(scene);
((SND_Scene*)scene)->RemoveAllSamples();
}
int SND_CheckBuffer(SND_SceneHandle scene, SND_ObjectHandle object)
{
assert(scene);
assert(object);
int result = (int)((SND_Scene*)scene)->CheckBuffer((SND_SoundObject*)object);
return result;
}
void SND_AddSound(SND_SceneHandle scene, SND_ObjectHandle object)
{
assert(scene);
assert(object);
((SND_Scene*)scene)->AddObject((SND_SoundObject *)object);
}
void SND_RemoveSound(SND_SceneHandle scene, SND_ObjectHandle object)
{
assert(scene);
assert(object);
((SND_Scene*)scene)->DeleteObject((SND_SoundObject *)object);
}
void SND_RemoveAllSounds(SND_SceneHandle scene)
{
assert(scene);
((SND_Scene*)scene)->RemoveAllObjects();
}
void SND_StopAllSounds(SND_SceneHandle scene)
{
assert(scene);
((SND_Scene*)scene)->StopAllObjects();
}
void SND_Proceed(SND_AudioDeviceInterfaceHandle audiodevice, SND_SceneHandle scene)
{
assert(scene);
((SND_Scene*)scene)->Proceed();
((SND_IAudioDevice*)audiodevice)->NextFrame();
}
SND_ListenerHandle SND_GetListener(SND_SceneHandle scene)
{
assert(scene);
return (SND_ListenerHandle)((SND_Scene*)scene)->GetListener();
}
void SND_SetListenerGain(SND_SceneHandle scene, double gain)
{
assert(scene);
SND_SoundListener* listener = ((SND_Scene*)scene)->GetListener();
listener->SetGain((MT_Scalar)gain);
}
void SND_SetDopplerFactor(SND_SceneHandle scene, double dopplerfactor)
{
assert(scene);
SND_SoundListener* listener = ((SND_Scene*)scene)->GetListener();
listener->SetDopplerFactor(dopplerfactor);
}
void SND_SetDopplerVelocity(SND_SceneHandle scene, double dopplervelocity)
{
assert(scene);
SND_SoundListener* listener = ((SND_Scene*)scene)->GetListener();
listener->SetDopplerVelocity(dopplervelocity);
}
// Object instantiation
SND_ObjectHandle SND_CreateSound()
{
return (SND_ObjectHandle)new SND_SoundObject();
}
void SND_DeleteSound(SND_ObjectHandle object)
{
assert(object);
delete (SND_SoundObject*)object;
}
// Object control
void SND_StartSound(SND_SceneHandle scene, SND_ObjectHandle object)
{
assert(scene);
assert(object);
((SND_Scene*)scene)->AddActiveObject((SND_SoundObject*)object, 0);
}
void SND_StopSound(SND_SceneHandle scene, SND_ObjectHandle object)
{
assert(scene);
assert(object);
((SND_Scene*)scene)->RemoveActiveObject((SND_SoundObject*)object);
}
void SND_PauseSound(SND_SceneHandle scene, SND_ObjectHandle object)
{
assert(scene);
assert(object);
((SND_Scene*)scene)->RemoveActiveObject((SND_SoundObject*)object);
}
void SND_SetSampleName(SND_ObjectHandle object, char* samplename)
{
assert(object);
STR_String name = samplename;
((SND_SoundObject*)object)->SetSampleName(name);
}
void SND_SetGain(SND_ObjectHandle object, double gain)
{
assert(object);
((SND_SoundObject*)object)->SetGain(gain);
}
void SND_SetMinimumGain(SND_ObjectHandle object, double minimumgain)
{
assert(object);
((SND_SoundObject*)object)->SetMinGain(minimumgain);
}
void SND_SetMaximumGain(SND_ObjectHandle object, double maximumgain)
{
assert(object);
((SND_SoundObject*)object)->SetMaxGain(maximumgain);
}
void SND_SetRollOffFactor(SND_ObjectHandle object, double rollofffactor)
{
assert(object);
((SND_SoundObject*)object)->SetRollOffFactor(rollofffactor);
}
void SND_SetReferenceDistance(SND_ObjectHandle object, double referencedistance)
{
assert(object);
((SND_SoundObject*)object)->SetReferenceDistance(referencedistance);
}
void SND_SetPitch(SND_ObjectHandle object, double pitch)
{
assert(object);
((SND_SoundObject*)object)->SetPitch(pitch);
}
void SND_SetPosition(SND_ObjectHandle object, double* position)
{
assert(object);
((SND_SoundObject*)object)->SetPosition(position);
}
void SND_SetVelocity(SND_ObjectHandle object, double* velocity)
{
assert(object);
((SND_SoundObject*)object)->SetVelocity(velocity);
}
void SND_SetOrientation(SND_ObjectHandle object, double* orientation)
{
assert(object);
((SND_SoundObject*)object)->SetOrientation(orientation);
}
void SND_SetLoopMode(SND_ObjectHandle object, int loopmode)
{
assert(object);
((SND_SoundObject*)object)->SetLoopMode(loopmode);
}
void SND_SetLoopPoints(SND_ObjectHandle object, unsigned int loopstart, unsigned int loopend)
{
assert(object);
((SND_SoundObject*)object)->SetLoopStart(loopstart);
((SND_SoundObject*)object)->SetLoopEnd(loopend);
}
float SND_GetGain(SND_ObjectHandle object)
{
assert(object);
MT_Scalar gain = ((SND_SoundObject*)object)->GetGain();
return (float) gain;
}
float SND_GetPitch(SND_ObjectHandle object)
{
assert(object);
MT_Scalar pitch = ((SND_SoundObject*)object)->GetPitch();
return (float) pitch;
}
int SND_GetLoopMode(SND_ObjectHandle object)
{
assert(object);
return ((SND_SoundObject*)object)->GetLoopMode();
}
int SND_GetPlaystate(SND_ObjectHandle object)
{
assert(object);
return ((SND_SoundObject*)object)->GetPlaystate();
}

View File

@@ -0,0 +1,182 @@
/*
* SND_CDObject.cpp
*
* Implementation for CD playback
*
* $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 *****
*/
#include "SND_CDObject.h"
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
SND_CDObject* SND_CDObject::m_instance = NULL;
bool SND_CDObject::CreateSystem()
{
bool result = false;
if (!m_instance)
{
m_instance = new SND_CDObject();
result = true;
}
return result;
}
bool SND_CDObject::DisposeSystem()
{
bool result = false;
if (m_instance)
{
delete m_instance;
m_instance = NULL;
result = true;
}
return result;
}
SND_CDObject* SND_CDObject::Instance()
{
return m_instance;
}
SND_CDObject::SND_CDObject()
{
m_gain = 1;
m_playmode = SND_CD_ALL;
m_track = 1;
m_playstate = SND_STOPPED;
m_used = false;
// don't set the cd standard on modified:
// if not used, we don't wanna touch it (performance)
m_modified = false;
}
SND_CDObject::~SND_CDObject()
{
}
void SND_CDObject::SetGain(MT_Scalar gain)
{
m_gain = gain;
m_modified = true;
}
void SND_CDObject::SetPlaymode(int playmode)
{
m_playmode = playmode;
}
void SND_CDObject::SetPlaystate(int playstate)
{
m_playstate = playstate;
}
void SND_CDObject::SetTrack(int track)
{
m_track = track;
}
int SND_CDObject::GetTrack() const
{
return m_track;
}
MT_Scalar SND_CDObject::GetGain() const
{
return m_gain;
}
int SND_CDObject::GetPlaystate() const
{
return m_playstate;
}
bool SND_CDObject::IsModified() const
{
return m_modified;
}
void SND_CDObject::SetModified(bool modified)
{
m_modified = modified;
}
int SND_CDObject::GetPlaymode() const
{
return m_playmode;
}
void SND_CDObject::SetUsed()
{
m_used = true;
}
bool SND_CDObject::GetUsed()
{
return m_used;
}

View File

@@ -0,0 +1,126 @@
/*
* SND_DeviceManager.h
*
* singleton for creating, switching and deleting audiodevices
*
* $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 *****
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "SND_DeviceManager.h"
#include "SND_DependKludge.h"
#include "SND_DummyDevice.h"
#ifdef USE_OPENAL
#include "SND_OpenALDevice.h"
#endif
SND_IAudioDevice* SND_DeviceManager::m_instance = NULL;
int SND_DeviceManager::m_subscriptions = 0;
#ifdef USE_OPENAL
int SND_DeviceManager::m_device_type = snd_e_openaldevice;
#else
int SND_DeviceManager::m_device_type = snd_e_dummydevice;
#endif
void SND_DeviceManager::Subscribe()
{
++m_subscriptions;
}
void SND_DeviceManager::Unsubscribe()
{
--m_subscriptions;
// only release memory if there is a m_instance but no subscriptions left
if (m_subscriptions == 0 && m_instance)
{
delete m_instance;
m_instance = NULL;
}
if (m_subscriptions < 0)
m_subscriptions = 0;
}
SND_IAudioDevice* SND_DeviceManager::Instance()
{
// only give away an instance if there are subscriptions
if (m_subscriptions)
{
// if there's no instance yet, set and create a new one
if (m_instance == NULL)
{
SetDeviceType(m_device_type);
}
return m_instance;
}
else
{
return NULL;
}
}
void SND_DeviceManager::SetDeviceType(int device_type)
{
// if we want to change devicetype, first delete the old one
if (m_instance)
{
delete m_instance;
m_instance = NULL;
}
// let's create the chosen device
switch (device_type)
{
#ifdef USE_OPENAL
case snd_e_openaldevice:
{
m_instance = new SND_OpenALDevice();
m_device_type = device_type;
break;
}
#endif
default:
{
m_instance = new SND_DummyDevice();
m_device_type = device_type;
break;
}
}
}

View File

@@ -0,0 +1,76 @@
/*
* SND_IdObject.cpp
*
* Object for storing runtime data, like id's, soundobjects etc
*
* $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 *****
*/
#include "SND_IdObject.h"
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
SND_IdObject::SND_IdObject()
{
}
SND_IdObject::~SND_IdObject()
{
}
SND_SoundObject* SND_IdObject::GetSoundObject()
{
return m_soundObject;
}
void SND_IdObject::SetSoundObject(SND_SoundObject* pObject)
{
m_soundObject = pObject;
}
int SND_IdObject::GetId()
{
return m_id;
}
void SND_IdObject::SetId(int id)
{
m_id = id;
}

View File

@@ -0,0 +1,58 @@
/*
* SND_IdObject.h
*
* Object for storing runtime data, like id's, soundobjects etc
*
* $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 *****
*/
#ifndef __SND_IDOBJECT_H
#define __SND_IDOBJECT_H
#include "SND_SoundObject.h"
#include "GEN_List.h"
#include "SoundDefines.h"
class SND_IdObject : public GEN_Link
{
SND_SoundObject* m_soundObject;
int m_id;
public:
SND_IdObject();
virtual ~SND_IdObject();
SND_SoundObject* GetSoundObject();
void SetSoundObject(SND_SoundObject* pObject);
int GetId();
void SetId(int id);
};
#endif //__SND_OBJECT_H

View File

@@ -0,0 +1,544 @@
/*
* SND_Scene.cpp
*
* The scene for sounds.
*
* $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 *****
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifdef WIN32
#pragma warning (disable:4786) // Get rid of stupid stl-visual compiler debug warning
#endif //WIN32
#include "SND_Scene.h"
#include "SND_DependKludge.h"
#include "SND_IAudioDevice.h"
#include <stdlib.h>
#include <iostream>
//static unsigned int tijd = 0;
SND_Scene::SND_Scene(SND_IAudioDevice* audiodevice)
: m_audiodevice(audiodevice)
{
if (m_audiodevice)
m_wavecache = m_audiodevice->GetWaveCache();
if (!m_wavecache || !audiodevice)
{
m_audio = false;
}
else
{
//if so, go ahead!
m_audio = true;
#ifdef ONTKEVER
printf("SND_Scene::SND_Scene() m_audio == true\n");
#endif
m_audiodevice->InitListener();
}
IsPlaybackWanted();
}
SND_Scene::~SND_Scene()
{
StopAllObjects();
}
// check if audioplayback is wanted
bool SND_Scene::IsPlaybackWanted()
{
/* Removed the functionality for checking if noaudio was provided on */
/* the commandline. */
if (m_audiodevice && m_wavecache)
{
m_audioplayback = true;
}
else
{
StopAllObjects();
m_audioplayback = false;
}
return m_audioplayback;
}
int SND_Scene::LoadSample(const STR_String& samplename,
void* memlocation,
int size)
{
int result = -1;
if (m_audiodevice)
{
SND_WaveSlot* waveslot = m_audiodevice->LoadSample(samplename, memlocation, size);
if (waveslot)
result = waveslot->GetBuffer();
}
return result;
}
void SND_Scene::RemoveAllSamples()
{
if (m_audio && m_audiodevice)
m_audiodevice->RemoveAllSamples();
}
bool SND_Scene::CheckBuffer(SND_SoundObject* pObject)
{
bool result = false;
if (pObject && m_wavecache)
{
SND_WaveSlot* waveslot = m_wavecache->GetWaveSlot(pObject->GetSampleName());
if (waveslot)
{
pObject->SetBuffer(waveslot->GetBuffer());
result = true;
}
}
return result;
}
bool SND_Scene::IsSampleLoaded(STR_String& samplename)
{
bool result = false;
if (samplename && m_wavecache)
{
SND_WaveSlot* waveslot = m_wavecache->GetWaveSlot(samplename);
if (waveslot && waveslot->IsLoaded())
result = true;
}
return result;
}
void SND_Scene::AddObject(SND_SoundObject* pObject)
{
if (m_audio)
{
STR_String samplename = pObject->GetSampleName();
SND_WaveSlot* slot = NULL;
// don't add the object if no valid sample is referenced
if (samplename != "")
{
// check if the sample is already loaded
slot = m_wavecache->GetWaveSlot(samplename);
}
if (slot)
{
pObject->SetBuffer(slot->GetBuffer());
// needed for expected lifespan of the sample, but ain't necesary anymore i think
MT_Scalar samplelength = slot->GetNumberOfSamples();
MT_Scalar samplerate = slot->GetSampleRate();
MT_Scalar soundlength = samplelength/samplerate;
pObject->SetLength(soundlength);
// add the object to the list
m_soundobjects.insert((SND_SoundObject*)pObject);
}
}
}
void SND_Scene::SetListenerTransform(const MT_Vector3& pos,
const MT_Vector3& vel,
const MT_Matrix3x3& ori)
{
if (m_audio)
{
GetListener()->SetPosition(pos);
GetListener()->SetVelocity(vel);
GetListener()->SetOrientation(ori);
}
}
void SND_Scene::UpdateListener()
{
// process the listener if modified
if (m_listener.IsModified())
{
m_audiodevice->SetListenerGain(m_listener.GetGain());
m_audiodevice->SetDopplerVelocity(m_listener.GetDopplerVelocity());
m_audiodevice->SetDopplerFactor(m_listener.GetDopplerFactor());
m_listener.SetModified(false);
}
}
void SND_Scene::AddActiveObject(SND_SoundObject* pObject, MT_Scalar curtime)
{
if (m_audio)
{
if (pObject)
{
#ifdef ONTKEVER
printf("SND_Scene::AddActiveObject\n");
#endif
// first check if the object is already on the list
if (pObject->IsActive())
{
pObject->SetTimeStamp(curtime);
pObject->StartSound();
}
else
{
pObject->SetTimeStamp(curtime);
// compute the expected lifespan
pObject->SetLifeSpan();
// lets give the new active-to-be object an id
if (m_audiodevice->GetNewId(pObject))
{
// and add the object
m_activeobjects.addTail(pObject);
pObject->StartSound();
pObject->SetActive(true);
}
}
}
}
}
void SND_Scene::RemoveActiveObject(SND_SoundObject* pObject)
{
if (m_audio)
{
if (pObject)
{
#ifdef ONTKEVER
printf("SND_Scene::RemoveActiveObject\n");
#endif
// if inactive, remove it from the list
if (pObject->IsActive())
{
// first make sure it is stopped
m_audiodevice->ClearId(pObject);
}
}
}
}
void SND_Scene::UpdateActiveObects()
{
// ++tijd;
SND_SoundObject* pObject;
// update only the objects that need to be updated
for (pObject = (SND_SoundObject*)m_activeobjects.getHead();
!pObject->isTail();
pObject = (SND_SoundObject*)pObject->getNext())
{
int id = pObject->GetId();
if (id >= 0)
{
if (pObject->Is3D())
{
// Get the global positions and velocity vectors
// of the listener and soundobject
MT_Vector3 op = pObject->GetPosition();
MT_Vector3 lp = m_listener.GetPosition();
MT_Vector3 position = op - lp;
// Calculate relative velocity in global coordinates
// of the sound with respect to the listener.
MT_Vector3 ov = pObject->GetVelocity();
MT_Vector3 lv = m_listener.GetVelocity();
MT_Vector3 velocity = ov - lv;
// Now map the object position and velocity into
// the local coordinates of the listener.
MT_Matrix3x3 lo = m_listener.GetOrientation();
MT_Vector3 local_sound_pos = position * lo;
MT_Vector3 local_sound_vel = velocity * lo;
m_audiodevice->SetObjectTransform(
id,
local_sound_pos,
local_sound_vel,
pObject->GetOrientation(), // make relative to listener!
lp,
pObject->GetRollOffFactor());
}
else
{
m_audiodevice->ObjectIs2D(id);
}
// update the situation
if (pObject->IsModified())
{
m_audiodevice->SetObjectPitch(id, pObject->GetPitch());
m_audiodevice->SetObjectGain(id, pObject->GetGain());
m_audiodevice->SetObjectMinGain(id, pObject->GetMinGain());
m_audiodevice->SetObjectMaxGain(id, pObject->GetMaxGain());
m_audiodevice->SetObjectReferenceDistance(id, pObject->GetReferenceDistance());
m_audiodevice->SetObjectRollOffFactor(id, pObject->GetRollOffFactor());
m_audiodevice->SetObjectLoop(id, pObject->GetLoopMode());
m_audiodevice->SetObjectLoopPoints(id, pObject->GetLoopStart(), pObject->GetLoopEnd());
pObject->SetModified(false);
}
pObject->AddRunning();
#ifdef ONTKEVER
STR_String naam = pObject->GetObjectName();
STR_String sample = pObject->GetSampleName();
int id = pObject->GetId();
int buffer = pObject->GetBuffer();
float gain = pObject->GetGain();
float pitch = pObject->GetPitch();
float timestamp = pObject->GetTimestamp();
printf("naam: %s, sample: %s \n", naam.Ptr(), sample.Ptr());
printf("id: %d, buffer: %d \n", id, buffer);
printf("gain: %f, pitch: %f, ts: %f \n\n", gain, pitch, timestamp);
#endif
#ifdef USE_OPENAL
// ok, properties Set. now see if it must play
switch (pObject->GetPlaystate()){
case SND_MUST_PLAY:
m_audiodevice->PlayObject(id);
pObject->SetPlaystate(SND_PLAYING);
break;
case SND_MUST_STOP:
RemoveActiveObject(pObject);
break;
case SND_MUST_PAUSE:
m_audiodevice->PauseObject(id);
pObject->SetPlaystate(SND_PAUSED);
break;
}
#endif
// check to see if the sound is still playing
// if not: release its id
int playstate = m_audiodevice->GetPlayState(id);
#ifdef ONTKEVER
if (playstate != 2)
printf("%d - ",playstate);
#endif
if ((playstate == SND_STOPPED) && !pObject->GetLoopMode())
{
RemoveActiveObject(pObject);
}
}
}
}
void SND_Scene::UpdateCD()
{
if (m_audiodevice)
{
SND_CDObject* pCD = SND_CDObject::Instance();
if (pCD)
{
int playstate = pCD->GetPlaystate();
switch (playstate)
{
case SND_MUST_PLAY:
{
// initialize the cd only when you need it
m_audiodevice->SetCDGain(pCD->GetGain());
m_audiodevice->SetCDPlaymode(pCD->GetPlaymode());
m_audiodevice->PlayCD(pCD->GetTrack());
pCD->SetPlaystate(SND_PLAYING);
pCD->SetUsed();
break;
}
case SND_MUST_PAUSE:
{
m_audiodevice->PauseCD(true);
pCD->SetPlaystate(SND_PAUSED);
break;
}
case SND_MUST_RESUME:
{
m_audiodevice->PauseCD(false);
pCD->SetPlaystate(SND_PLAYING);
break;
}
case SND_MUST_STOP:
{
m_audiodevice->StopCD();
pCD->SetPlaystate(SND_STOPPED);
break;
}
default:
{
}
}
// this one is only for realtime modifying settings
if (pCD->IsModified())
{
m_audiodevice->SetCDGain(pCD->GetGain());
pCD->SetModified(false);
}
}
}
}
void SND_Scene::Proceed()
{
if (m_audio && m_audioplayback)
{
m_audiodevice->MakeCurrent();
UpdateListener();
UpdateActiveObects();
UpdateCD();
// m_audiodevice->UpdateDevice();
}
}
void SND_Scene::DeleteObject(SND_SoundObject* pObject)
{
#ifdef ONTKEVER
printf("SND_Scene::DeleteObject\n");
#endif
if (pObject)
{
if (m_audiodevice)
m_audiodevice->ClearId(pObject);
// must remove object from m_activeList
std::set<SND_SoundObject*>::iterator set_it;
set_it = m_soundobjects.find(pObject);
if (set_it != m_soundobjects.end())
m_soundobjects.erase(set_it);
// release the memory
delete pObject;
pObject = NULL;
}
}
void SND_Scene::RemoveAllObjects()
{
#ifdef ONTKEVER
printf("SND_Scene::RemoveAllObjects\n");
#endif
StopAllObjects();
std::set<SND_SoundObject*>::iterator it = m_soundobjects.begin();
while (it != m_soundobjects.end())
{
delete (*it);
it++;
}
m_soundobjects.clear();
}
void SND_Scene::StopAllObjects()
{
if (m_audio)
{
#ifdef ONTKEVER
printf("SND_Scene::StopAllObjects\n");
#endif
SND_SoundObject* pObject;
for (pObject = (SND_SoundObject*)m_activeobjects.getHead();
!pObject->isTail();
pObject = (SND_SoundObject*)pObject->getNext())
{
m_audiodevice->ClearId(pObject);
}
}
}
SND_SoundListener* SND_Scene::GetListener()
{
return &m_listener;
}

View File

@@ -0,0 +1,185 @@
/*
* SND_SoundListener.cpp
*
* A SoundListener is for sound what a camera is for vision.
*
* $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 *****
*/
#include "SND_SoundListener.h"
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
SND_SoundListener::SND_SoundListener()
{
m_modified = true;
m_gain = 1.0;
m_dopplerfactor = 1.0;
m_dopplervelocity = 1.0;
m_scale = 1.0;
m_position[0] = 0.0;
m_position[1] = 0.0;
m_position[2] = 0.0;
m_velocity[0] = 0.0;
m_velocity[1] = 0.0;
m_velocity[2] = 0.0;
m_orientation[0][0] = 1.0;
m_orientation[0][1] = 0.0;
m_orientation[0][2] = 0.0;
m_orientation[1][0] = 0.0;
m_orientation[1][1] = 1.0;
m_orientation[1][2] = 0.0;
m_orientation[2][0] = 0.0;
m_orientation[2][1] = 0.0;
m_orientation[2][2] = 1.0;
}
SND_SoundListener::~SND_SoundListener()
{
; /* intentionally empty */
}
void SND_SoundListener::SetGain(MT_Scalar gain)
{
m_gain = gain;
m_modified = true;
}
void SND_SoundListener::SetPosition (const MT_Vector3& pos)
{
m_position = pos;
}
void SND_SoundListener::SetVelocity(const MT_Vector3& vel)
{
m_velocity = vel;
}
void SND_SoundListener::SetOrientation(const MT_Matrix3x3& ori)
{
m_orientation = ori;
}
void SND_SoundListener::SetDopplerFactor(MT_Scalar dopplerfactor)
{
m_dopplerfactor = dopplerfactor;
m_modified = true;
}
void SND_SoundListener::SetDopplerVelocity(MT_Scalar dopplervelocity)
{
m_dopplervelocity = dopplervelocity;
m_modified = true;
}
void SND_SoundListener::SetScale(MT_Scalar scale)
{
m_scale = scale;
m_modified = true;
}
MT_Scalar SND_SoundListener::GetGain() const
{
return m_gain;
}
MT_Vector3 SND_SoundListener::GetPosition() const
{
return m_position;
}
MT_Vector3 SND_SoundListener::GetVelocity() const
{
return m_velocity;
}
MT_Matrix3x3 SND_SoundListener::GetOrientation()
{
return m_orientation;
}
MT_Scalar SND_SoundListener::GetDopplerFactor() const
{
return m_dopplerfactor;
}
MT_Scalar SND_SoundListener::GetDopplerVelocity() const
{
return m_dopplervelocity;
}
MT_Scalar SND_SoundListener::GetScale() const
{
return m_scale;
}
bool SND_SoundListener::IsModified() const
{
return m_modified;
}
void SND_SoundListener::SetModified(bool modified)
{
m_modified = modified;
}

View File

@@ -0,0 +1,508 @@
/*
* SND_SoundObject.cpp
*
* Implementation of the abstract sound object
*
* $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 *****
*/
#include "SND_SoundObject.h"
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
SND_SoundObject::SND_SoundObject()// : m_modified(true)
{
m_samplename = "";
m_length = 0;
m_buffer = 0;
m_gain = 0.0;
m_pitch = 1.0;
m_mingain = 0.0;
m_maxgain = 1.0;
m_rollofffactor = 1.0;
m_referencedistance = 1.0;
m_position[0] = 0.0;
m_position[1] = 0.0;
m_position[2] = 0.0;
m_velocity[0] = 0.0;
m_velocity[1] = 0.0;
m_velocity[2] = 0.0;
m_orientation[0][0] = 1.0;
m_orientation[0][1] = 0.0;
m_orientation[0][2] = 0.0;
m_orientation[1][0] = 0.0;
m_orientation[1][1] = 1.0;
m_orientation[1][2] = 0.0;
m_orientation[2][0] = 0.0;
m_orientation[2][1] = 0.0;
m_orientation[2][2] = 1.0;
m_loopstart = 0;
m_loopend = 0;
m_loopmode = SND_LOOP_NORMAL;
m_is3d = true;
m_playstate = SND_INITIAL;
m_active = false;
m_id = -1;
m_lifespan = 0;
m_timestamp = 0;
m_modified = true;
m_running = 0;
m_highpriority = false;
}
SND_SoundObject::~SND_SoundObject()
{
}
void SND_SoundObject::StartSound()
{
if (m_id >= 0)
m_playstate = SND_MUST_PLAY;
}
void SND_SoundObject::StopSound()
{
if (m_id >= 0)
m_playstate = SND_MUST_STOP;
}
void SND_SoundObject::PauseSound()
{
if (m_id >= 0)
m_playstate = SND_MUST_PAUSE;
}
void SND_SoundObject::DeleteWhenFinished()
{
m_playstate = SND_MUST_BE_DELETED;
}
void SND_SoundObject::SetGain(MT_Scalar gain)
{
m_gain = gain;
m_modified = true;
}
void SND_SoundObject::SetMinGain(MT_Scalar mingain)
{
m_mingain = mingain;
m_modified = true;
}
void SND_SoundObject::SetMaxGain(MT_Scalar maxgain)
{
m_maxgain = maxgain;
m_modified = true;
}
void SND_SoundObject::SetRollOffFactor(MT_Scalar rollofffactor)
{
m_rollofffactor = rollofffactor;
m_modified = true;
}
void SND_SoundObject::SetReferenceDistance(MT_Scalar referencedistance)
{
m_referencedistance = referencedistance;
m_modified = true;
}
void SND_SoundObject::SetPitch(MT_Scalar pitch)
{
m_pitch = pitch;
m_modified = true;
}
void SND_SoundObject::SetLoopMode(unsigned int loopmode)
{
m_loopmode = loopmode;
m_modified = true;
}
void SND_SoundObject::SetLoopStart(unsigned int loopstart)
{
m_loopstart = loopstart;
m_modified = true;
}
void SND_SoundObject::SetLoopEnd(unsigned int loopend)
{
m_loopend = loopend;
m_modified = true;
}
void SND_SoundObject::Set3D(bool threedee)
{
m_is3d = threedee;
}
void SND_SoundObject::SetLifeSpan()
{
m_lifespan = m_length / m_pitch;
}
bool SND_SoundObject::IsLifeSpanOver(MT_Scalar curtime) const
{
bool result = false;
if ((curtime - m_timestamp) > m_lifespan)
result = true;
return result;
}
void SND_SoundObject::SetActive(bool active)
{
m_active = active;
if (!active)
{
m_playstate = SND_STOPPED;
(this)->remove();
}
}
void SND_SoundObject::SetBuffer(unsigned int buffer)
{
m_buffer = buffer;
}
void SND_SoundObject::SetObjectName(STR_String objectname)
{
m_objectname = objectname;
}
void SND_SoundObject::SetSampleName(STR_String samplename)
{
m_samplename = samplename;
}
void SND_SoundObject::SetLength(MT_Scalar length)
{
m_length = length;
}
void SND_SoundObject::SetPosition(const MT_Vector3& pos)
{
m_position = pos;
}
void SND_SoundObject::SetVelocity(const MT_Vector3& vel)
{
m_velocity = vel;
}
void SND_SoundObject::SetOrientation(const MT_Matrix3x3& orient)
{
m_orientation = orient;
}
void SND_SoundObject::SetPlaystate(int playstate)
{
m_playstate = playstate;
}
void SND_SoundObject::SetId(int id)
{
m_id = id;
}
void SND_SoundObject::SetTimeStamp(MT_Scalar timestamp)
{
m_timestamp = timestamp;
}
void SND_SoundObject::SetHighPriority(bool priority)
{
m_highpriority = priority;
}
bool SND_SoundObject::IsHighPriority() const
{
return m_highpriority;
}
bool SND_SoundObject::IsActive()const
{
return m_active;
}
int SND_SoundObject::GetId()const
{
return m_id;
}
MT_Scalar SND_SoundObject::GetLifeSpan()const
{
return m_lifespan;
}
MT_Scalar SND_SoundObject::GetTimestamp()const
{
return m_timestamp;
}
unsigned int SND_SoundObject::GetBuffer()
{
return m_buffer;
}
const STR_String& SND_SoundObject::GetSampleName()
{
return m_samplename;
}
const STR_String& SND_SoundObject::GetObjectName()
{
return m_objectname;
}
MT_Scalar SND_SoundObject::GetLength() const
{
return m_length;
}
MT_Scalar SND_SoundObject::GetGain() const
{
return m_gain;
}
MT_Scalar SND_SoundObject::GetPitch() const
{
return m_pitch;
}
MT_Scalar SND_SoundObject::GetMinGain() const
{
return m_mingain;
}
MT_Scalar SND_SoundObject::GetMaxGain() const
{
return m_maxgain;
}
MT_Scalar SND_SoundObject::GetRollOffFactor() const
{
return m_rollofffactor;
}
MT_Scalar SND_SoundObject::GetReferenceDistance() const
{
return m_referencedistance;
}
MT_Vector3 SND_SoundObject::GetPosition() const
{
return m_position;
}
MT_Vector3 SND_SoundObject::GetVelocity() const
{
return m_velocity;
}
MT_Matrix3x3 SND_SoundObject::GetOrientation() const
{
return m_orientation;
}
unsigned int SND_SoundObject::GetLoopMode() const
{
return m_loopmode;
}
unsigned int SND_SoundObject::GetLoopStart() const
{
return m_loopstart;
}
unsigned int SND_SoundObject::GetLoopEnd() const
{
return m_loopend;
}
bool SND_SoundObject::Is3D() const
{
return m_is3d;
}
int SND_SoundObject::GetPlaystate() const
{
return m_playstate;
}
bool SND_SoundObject::IsModified() const
{
return m_modified;
}
void SND_SoundObject::SetModified(bool modified)
{
m_modified = modified;
}
void SND_SoundObject::InitRunning()
{
m_running = 0;
}
bool SND_SoundObject::IsRunning() const
{
bool result = false;
if (m_running > 100)
result = true;
return result;
}
void SND_SoundObject::AddRunning()
{
++m_running;
}

View File

@@ -0,0 +1,424 @@
/*
* SND_Utils.cpp
*
* Util functions for soundthingies
*
* $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 *****
*/
#include "SND_Utils.h"
#include "SoundDefines.h"
#include "SND_DependKludge.h"
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <math.h>
#include <string.h>
#if defined(_WIN32)
#include <io.h>
#define open _open
#define read _read
#define close _close
#define write _write
#define lseek _lseek
#else
#include <unistd.h>
#endif
#define BUFFERSIZE 32
/*****************************************************************************
* Begin of temporary Endian stuff.
* I think there should be a central place to handle endian conversion but for
* the time being it suffices. Note that the defines come from the Blender
* source.
*****************************************************************************/
typedef enum
{
SND_endianBig = 0,
SND_endianLittle
} SND_TEndian;
#if defined(__BIG_ENDIAN__) || defined(__sparc) || defined(__sparc__)
const SND_TEndian SND_fEndian = SND_endianBig;
#else
const SND_TEndian SND_fEndian = SND_endianLittle;
#endif
/* This one swaps the bytes in a short */
#define SWITCH_SHORT(a) { \
char s_i, *p_i; \
p_i= (char *)&(a); \
s_i=p_i[0]; \
p_i[0] = p_i[1]; \
p_i[1] = s_i; }
/* This one rotates the bytes in an int */
#define SWITCH_INT(a) { \
char s_i, *p_i; \
p_i= (char *)&(a); \
s_i=p_i[0]; p_i[0]=p_i[3]; p_i[3]=s_i; \
s_i=p_i[1]; p_i[1]=p_i[2]; p_i[2]=s_i; }
/*****************************************************************************
* End of temporary Endian stuff.
*****************************************************************************/
/* loads a file */
void* SND_LoadSample(char *filename)
{
int file, filelen, buffersize = BUFFERSIZE;
void* data = NULL;
#if defined(WIN32)
file = open(filename, O_BINARY|O_RDONLY);
#else
file = open(filename, 0|O_RDONLY);
#endif
if (file == -1)
{
//printf("can't open file.\n");
//printf("press q for quit.\n");
}
else
{
filelen = lseek(file, 0, SEEK_END);
lseek(file, 0, SEEK_SET);
if (filelen != 0)
{
data = malloc(buffersize);
if (read(file, data, buffersize) != buffersize)
{
free(data);
data = NULL;
}
}
close(file);
}
return (data);
}
bool SND_IsSampleValid(const STR_String& name, void* memlocation)
{
bool result = false;
bool loadedsample = false;
char buffer[BUFFERSIZE];
if (!memlocation)
{
STR_String samplename = name;
memlocation = SND_LoadSample(samplename.Ptr());
if (memlocation)
loadedsample = true;
}
if (memlocation)
{
memcpy(&buffer, memlocation, BUFFERSIZE);
if(!(memcmp(buffer, "RIFF", 4) && memcmp(&(buffer[8]), "WAVEfmt ", 8)))
{
/* This was endian unsafe. See top of the file for the define. */
short shortbuf = *((short *) &buffer[20]);
if (SND_fEndian == SND_endianBig) SWITCH_SHORT(shortbuf);
if (shortbuf == SND_WAVE_FORMAT_PCM)
result = true;
}
}
if (loadedsample)
{
free(memlocation);
memlocation = NULL;
}
return result;
}
/* checks if the passed pointer is a valid sample */
static bool CheckSample(void* sample)
{
bool valid = false;
char buffer[32];
memcpy(buffer, sample, 16);
if(!(memcmp(buffer, "RIFF", 4) && memcmp(&(buffer[8]), "WAVEfmt ", 8)))
{
valid = true;
}
return valid;
}
/* gets the type of the sample (0 == unknown, 1 == PCM etc */
unsigned int SND_GetSampleFormat(void* sample)
{
short sampletype = 0;
if (CheckSample(sample))
{
memcpy(&sampletype, ((char*)sample) + 20, 2);
}
/* This was endian unsafe. See top of the file for the define. */
if (SND_fEndian == SND_endianBig) SWITCH_SHORT(sampletype);
return (unsigned int)sampletype;
}
/* gets the number of channels in a sample */
unsigned int SND_GetNumberOfChannels(void* sample)
{
short numberofchannels = 0;
if (CheckSample(sample))
{
memcpy(&numberofchannels, ((char*)sample) + 22, 2);
}
/* This was endian unsafe. See top of the file for the define. */
if (SND_fEndian == SND_endianBig) SWITCH_SHORT(numberofchannels);
return (unsigned int)numberofchannels;
}
/* gets the samplerate of a sample */
unsigned int SND_GetSampleRate(void* sample)
{
unsigned int samplerate = 0;
if (CheckSample(sample))
{
memcpy(&samplerate, ((char*)sample) + 24, 4);
}
/* This was endian unsafe. See top of the file for the define. */
if (SND_fEndian == SND_endianBig) SWITCH_INT(samplerate);
return samplerate;
}
/* gets the bitrate of a sample */
unsigned int SND_GetBitRate(void* sample)
{
short bitrate = 0;
if (CheckSample(sample))
{
memcpy(&bitrate, ((char*)sample) + 34, 2);
}
/* This was endian unsafe. See top of the file for the define. */
if (SND_fEndian == SND_endianBig) SWITCH_SHORT(bitrate);
return (unsigned int)bitrate;
}
/* gets the length of the actual sample data (without the header) */
unsigned int SND_GetNumberOfSamples(void* sample, unsigned int sample_length)
{
unsigned int chunklength, length = 0, offset;
unsigned short block_align;
if (CheckSample(sample))
{
memcpy(&chunklength, ((char*)sample) + 16, 4);
memcpy(&block_align, ((char*)sample) + 32, 2); /* always 2 or 4 it seems */
/* This was endian unsafe. See top of the file for the define. */
if (SND_fEndian == SND_endianBig)
{
SWITCH_INT(chunklength);
SWITCH_SHORT(block_align);
}
offset = 16 + chunklength + 4;
/* This seems very unsafe, what if data is never found (f.i. corrupt file)... */
// lets find "data"
while (memcmp(((char*)sample) + offset, "data", 4))
{
offset += block_align;
if (offset+block_align > sample_length) /* save us from crashing */
return 0;
}
offset += 4;
memcpy(&length, ((char*)sample) + offset, 4);
/* This was endian unsafe. See top of the file for the define. */
if (SND_fEndian == SND_endianBig) SWITCH_INT(length);
}
return length;
}
/* gets the size of the entire header (file - sampledata) */
unsigned int SND_GetHeaderSize(void* sample, unsigned int sample_length)
{
unsigned int chunklength, headersize = 0, offset = 16;
unsigned short block_align;
if (CheckSample(sample))
{
memcpy(&chunklength, ((char*)sample) + offset, 4);
memcpy(&block_align, ((char*)sample) + 32, 2); /* always 2 or 4 it seems */
/* This was endian unsafe. See top of the file for the define. */
if (SND_fEndian == SND_endianBig)
{
SWITCH_INT(chunklength);
SWITCH_SHORT(block_align);
}
offset = offset + chunklength + 4;
// lets find "data"
while (memcmp(((char*)sample) + offset, "data", 4))
{
offset += block_align;
if (offset+block_align > sample_length) /* save us from crashing */
return 0;
}
headersize = offset + 8;
}
return headersize;
}
unsigned int SND_GetExtraChunk(void* sample)
{
unsigned int extrachunk = 0, chunklength, offset = 16;
char data[4];
if (CheckSample(sample))
{
memcpy(&chunklength, ((char*)sample) + offset, 4);
offset = offset + chunklength + 4;
memcpy(data, ((char*)sample) + offset, 4);
// lets find "cue"
while (memcmp(data, "cue", 3))
{
offset += 4;
memcpy(data, ((char*)sample) + offset, 4);
}
}
return extrachunk;
}
void SND_GetSampleInfo(signed char* sample, SND_WaveSlot* waveslot)
{
WavFileHeader fileheader;
WavFmtHeader fmtheader;
WavFmtExHeader fmtexheader;
WavSampleHeader sampleheader;
WavChunkHeader chunkheader;
if (CheckSample(sample))
{
memcpy(&fileheader, sample, sizeof(WavFileHeader));
fileheader.size = SND_GetHeaderSize(sample, waveslot->GetFileSize());
if (fileheader.size) { /* this may fail for corrupt files */
sample += sizeof(WavFileHeader);
fileheader.size = ((fileheader.size+1) & ~1) - 4;
while ((fileheader.size > 0) && (memcpy(&chunkheader, sample, sizeof(WavChunkHeader))))
{
sample += sizeof(WavChunkHeader);
if (!memcmp(chunkheader.id, "fmt ", 4))
{
memcpy(&fmtheader, sample, sizeof(WavFmtHeader));
waveslot->SetSampleFormat(fmtheader.format);
if (fmtheader.format == 0x0001)
{
waveslot->SetNumberOfChannels(fmtheader.numberofchannels);
waveslot->SetBitRate(fmtheader.bitrate);
waveslot->SetSampleRate(fmtheader.samplerate);
sample += chunkheader.size;
}
else
{
memcpy(&fmtexheader, sample, sizeof(WavFmtExHeader));
sample += chunkheader.size;
}
}
else if (!memcmp(chunkheader.id, "data", 4))
{
if (fmtheader.format == 0x0001)
{
waveslot->SetNumberOfSamples(chunkheader.size);
sample += chunkheader.size;
}
else if (fmtheader.format == 0x0011)
{
//IMA ADPCM
}
else if (fmtheader.format == 0x0055)
{
//MP3 WAVE
}
}
else if (!memcmp(chunkheader.id, "smpl", 4))
{
memcpy(&sampleheader, sample, sizeof(WavSampleHeader));
//loop = sampleheader.loops;
sample += chunkheader.size;
}
else
sample += chunkheader.size;
sample += chunkheader.size & 1;
fileheader.size -= (((chunkheader.size + 1) & ~1) + 8);
}
}
}
}

View File

@@ -0,0 +1,138 @@
/*
* SND_WaveCache.cpp
*
* abstract wavecache, a way to organize samples
*
* $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 *****
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifdef WIN32
#pragma warning (disable:4786) // Get rid of stupid stl-visual compiler debug warning
#endif //WIN32
#include "SND_WaveCache.h"
#include <stdio.h>
#ifdef __APPLE__
# include <sys/malloc.h>
#else
# ifdef __FreeBSD__
# include <stdlib.h>
# else
# include <malloc.h>
# endif
#endif
SND_WaveCache::SND_WaveCache()
{
// do the buffer administration
for (int i = 0; i < NUM_BUFFERS; i++)
m_bufferList[i] = NULL;
}
SND_WaveCache::~SND_WaveCache()
{
// clean up the mess
FreeSamples();
RemoveAllSamples();
}
SND_WaveSlot* SND_WaveCache::GetWaveSlot(const STR_String& samplename)
{
SND_WaveSlot* waveslot = NULL;
std::map<STR_String, SND_WaveSlot*>::iterator find_result = m_samplecache.find(samplename);
// let's see if we have already loaded this sample
if (find_result != m_samplecache.end())
{
waveslot = (*find_result).second;
}
else
{
// so the sample wasn't loaded, so do it here
for (int bufnum = 0; bufnum < NUM_BUFFERS; bufnum++)
{
// find an empty buffer
if (m_bufferList[bufnum] == NULL)
{
waveslot = new SND_WaveSlot();
waveslot->SetSampleName(samplename);
waveslot->SetBuffer(bufnum);
m_bufferList[bufnum] = waveslot;
break;
}
}
m_samplecache.insert(std::pair<STR_String, SND_WaveSlot*>(samplename, waveslot));
}
return waveslot;
}
void SND_WaveCache::RemoveAllSamples()
{
// remove all samples
m_samplecache.clear();
// reset the list of buffers
for (int i = 0; i < NUM_BUFFERS; i++)
m_bufferList[i] = NULL;
}
void SND_WaveCache::RemoveSample(const STR_String& samplename, int buffer)
{
m_samplecache.erase(samplename);
m_bufferList[buffer] = NULL;
}
void SND_WaveCache::FreeSamples()
{
// iterate through the bufferlist and delete the waveslot if present
for (int i = 0; i < NUM_BUFFERS; i++)
{
if (m_bufferList[i])
{
delete m_bufferList[i];
m_bufferList[i] = NULL;
}
}
}

View File

@@ -0,0 +1,180 @@
/**
* $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 *****
*/
#include "SND_WaveSlot.h"
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
SND_WaveSlot::~SND_WaveSlot()
{
#ifdef ONTKEVER
printf("neeeeeee...\n");
#endif
}
void SND_WaveSlot::SetSampleName(STR_String samplename)
{
m_samplename = samplename;
}
void SND_WaveSlot::SetLoaded(bool loaded)
{
m_loaded = loaded;
}
void SND_WaveSlot::SetData(void* data)
{
m_data = data;
}
void SND_WaveSlot::SetBuffer(unsigned int buffer)
{
m_buffer = buffer;
}
void SND_WaveSlot::SetSampleFormat(unsigned int sampleformat)
{
m_sampleformat = sampleformat;
}
void SND_WaveSlot::SetNumberOfChannels(unsigned int numberofchannels)
{
m_numberofchannels = numberofchannels;
}
void SND_WaveSlot::SetSampleRate(unsigned int samplerate)
{
m_samplerate = samplerate;
}
void SND_WaveSlot::SetBitRate(unsigned int bitrate)
{
m_bitrate = bitrate;
}
void SND_WaveSlot::SetNumberOfSamples(unsigned int numberofsamples)
{
m_numberofsamples = numberofsamples;
}
void SND_WaveSlot::SetFileSize(unsigned int filesize)
{
m_filesize = filesize;
}
const STR_String& SND_WaveSlot::GetSampleName()
{
return m_samplename;
}
bool SND_WaveSlot::IsLoaded() const
{
return m_loaded;
}
void* SND_WaveSlot::GetData()
{
return m_data;
}
unsigned int SND_WaveSlot::GetBuffer() const
{
return m_buffer;
}
unsigned int SND_WaveSlot::GetSampleFormat() const
{
return m_sampleformat;
}
unsigned int SND_WaveSlot::GetNumberOfChannels() const
{
return m_numberofchannels;
}
unsigned int SND_WaveSlot::GetSampleRate() const
{
return m_samplerate;
}
unsigned int SND_WaveSlot::GetBitRate() const
{
return m_bitrate;
}
unsigned int SND_WaveSlot::GetNumberOfSamples() const
{
return m_numberofsamples;
}
unsigned int SND_WaveSlot::GetFileSize() const
{
return m_filesize;
}

View File

@@ -0,0 +1,206 @@
# Microsoft Developer Studio Project File - Name="SoundSystem" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Static Library" 0x0104
CFG=SoundSystem - Win32 Release
!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 "SoundSystem.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 "SoundSystem.mak" CFG="SoundSystem - Win32 Release"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "SoundSystem - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "SoundSystem - Win32 Debug" (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)" == "SoundSystem - 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 "..\..\..\..\obj\windows\intern\soundsystem"
# PROP Intermediate_Dir "..\..\..\..\obj\windows\intern\soundsystem"
# PROP Target_Dir ""
LINK32=link.exe -lib
# 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 "../../" /I "../../../../../lib/windows/string/include" /I "../../../../../lib/windows/moto/include" /I "../../dummy" /I "../../openal" /I "..\..\..\string" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /YX /J /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:"..\..\..\..\obj\windows\intern\soundsystem\libSoundSystem.lib"
# Begin Special Build Tool
SOURCE="$(InputPath)"
PostBuild_Cmds=ECHO Copying header files XCOPY /Y ..\..\*.h ..\..\..\..\..\lib\windows\SoundSystem\include\*.h ECHO Copying lib XCOPY /Y ..\..\..\..\obj\windows\intern\soundsystem\*.lib ..\..\..\..\..\lib\windows\SoundSystem\lib\*.a ECHO Done
# End Special Build Tool
!ELSEIF "$(CFG)" == "SoundSystem - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "SoundSystem___Win32_Debug"
# PROP BASE Intermediate_Dir "SoundSystem___Win32_Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "..\..\..\..\obj\windows\intern\soundsystem\debug"
# PROP Intermediate_Dir "..\..\..\..\obj\windows\intern\soundsystem\debug"
# PROP Target_Dir ""
LINK32=link.exe -lib
# 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 "../../" /I "../../../../../lib/windows/string/include" /I "../../../../../lib/windows/moto/include" /I "../../dummy" /I "../../openal" /I "..\..\..\string" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /YX /J /FD /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:"..\..\..\..\obj\windows\intern\soundsystem\debug\libSoundSystem.lib"
# Begin Special Build Tool
SOURCE="$(InputPath)"
PostBuild_Cmds=ECHO Copying header files XCOPY /Y ..\..\*.h ..\..\..\..\..\lib\windows\SoundSystem\include\*.h ECHO Copying lib XCOPY /Y ..\..\..\..\obj\windows\intern\soundsystem\debug\*.lib ..\..\..\..\..\lib\windows\SoundSystem\lib\debug\*.a ECHO Done
# End Special Build Tool
!ENDIF
# Begin Target
# Name "SoundSystem - Win32 Release"
# Name "SoundSystem - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\intern\SND_AudioDevice.cpp
# End Source File
# Begin Source File
SOURCE="..\..\intern\SND_C-api.cpp"
# End Source File
# Begin Source File
SOURCE=..\..\intern\SND_CDObject.cpp
# End Source File
# Begin Source File
SOURCE=..\..\intern\SND_DeviceManager.cpp
# End Source File
# Begin Source File
SOURCE=..\..\intern\SND_IdObject.cpp
# End Source File
# Begin Source File
SOURCE=..\..\intern\SND_Scene.cpp
# End Source File
# Begin Source File
SOURCE=..\..\intern\SND_SoundListener.cpp
# End Source File
# Begin Source File
SOURCE=..\..\intern\SND_SoundObject.cpp
# End Source File
# Begin Source File
SOURCE=..\..\intern\SND_Utils.cpp
# End Source File
# Begin Source File
SOURCE=..\..\intern\SND_WaveCache.cpp
# End Source File
# Begin Source File
SOURCE=..\..\intern\SND_WaveSlot.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\..\intern\SND_AudioDevice.h
# End Source File
# Begin Source File
SOURCE="..\..\SND_C-api.h"
# End Source File
# Begin Source File
SOURCE=..\..\SND_CDObject.h
# End Source File
# Begin Source File
SOURCE=..\..\SND_DependKludge.h
# End Source File
# Begin Source File
SOURCE=..\..\SND_DeviceManager.h
# End Source File
# Begin Source File
SOURCE=..\..\SND_IAudioDevice.h
# End Source File
# Begin Source File
SOURCE=..\..\intern\SND_IdObject.h
# End Source File
# Begin Source File
SOURCE=..\..\SND_Object.h
# End Source File
# Begin Source File
SOURCE=..\..\SND_Scene.h
# End Source File
# Begin Source File
SOURCE=..\..\SND_SoundListener.h
# End Source File
# Begin Source File
SOURCE=..\..\SND_SoundObject.h
# End Source File
# Begin Source File
SOURCE=..\..\SND_Utils.h
# End Source File
# Begin Source File
SOURCE=..\..\SND_WaveCache.h
# End Source File
# Begin Source File
SOURCE=..\..\SND_WaveSlot.h
# End Source File
# Begin Source File
SOURCE=..\..\SoundDefines.h
# End Source File
# End Group
# End Target
# End Project

View File

@@ -0,0 +1,103 @@
# Microsoft Developer Studio Project File - Name="DummySoundSystem" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Static Library" 0x0104
CFG=DummySoundSystem - Win32 Release
!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 "DummySoundSystem.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 "DummySoundSystem.mak" CFG="DummySoundSystem - Win32 Release"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "DummySoundSystem - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "DummySoundSystem - Win32 Debug" (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)" == "DummySoundSystem - 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 "..\..\..\..\..\obj\windows\intern\soundsystem\dummy"
# PROP Intermediate_Dir "..\..\..\..\..\obj\windows\intern\soundsystem\dummy"
# PROP Target_Dir ""
LINK32=link.exe -lib
# 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 "..\..\..\intern" /I "..\..\..\..\SoundSystem" /I "..\..\..\..\moto\include" /I "..\..\..\..\string" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /J /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:"..\..\..\..\..\obj\windows\intern\soundsystem\dummy\libDummySoundSystem.lib"
!ELSEIF "$(CFG)" == "DummySoundSystem - 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 "..\..\..\..\..\obj\windows\intern\soundsystem\dummy\debug"
# PROP Intermediate_Dir "..\..\..\..\..\obj\windows\intern\soundsystem\dummy\debug"
# PROP Target_Dir ""
LINK32=link.exe -lib
# 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 "..\..\..\intern" /I "..\..\..\..\SoundSystem" /I "..\..\..\..\moto\include" /I "..\..\..\..\string" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /J /FD /c
# SUBTRACT CPP /Fr
# 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:"..\..\..\..\..\obj\windows\intern\soundsystem\dummy\debug\libDummySoundSystem.lib"
!ENDIF
# Begin Target
# Name "DummySoundSystem - Win32 Release"
# Name "DummySoundSystem - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\..\dummy\SND_DummyDevice.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\..\..\dummy\SND_DummyDevice.h
# End Source File
# End Group
# End Target
# End Project

View File

@@ -0,0 +1,106 @@
# Microsoft Developer Studio Project File - Name="OpenALSoundSystem" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Static Library" 0x0104
CFG=OpenALSoundSystem - Win32 Release
!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 "OpenALSoundSystem.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 "OpenALSoundSystem.mak" CFG="OpenALSoundSystem - Win32 Release"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "OpenALSoundSystem - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "OpenALSoundSystem - Win32 Debug" (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)" == "OpenALSoundSystem - 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 "..\..\..\..\..\obj\windows\intern\soundsystem\openal"
# PROP Intermediate_Dir "..\..\..\..\..\obj\windows\intern\soundsystem\openal"
# PROP Target_Dir ""
LINK32=link.exe -lib
# 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 "..\..\..\intern" /I "..\..\..\..\SoundSystem" /I "..\..\..\..\SoundSystem\sdl" /I "..\..\..\..\moto\include" /I "..\..\..\..\string" /I "..\..\..\..\..\..\lib\windows\openal\include" /I "..\..\..\..\..\..\lib\windows\sdl\include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /YX /J /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:"..\..\..\..\..\obj\windows\intern\soundsystem\openal\libOpenALSoundSystem.lib"
!ELSEIF "$(CFG)" == "OpenALSoundSystem - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "OpenALSoundSystem___Win32_Debug"
# PROP BASE Intermediate_Dir "OpenALSoundSystem___Win32_Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "..\..\..\..\..\obj\windows\intern\soundsystem\openal\debug"
# PROP Intermediate_Dir "..\..\..\..\..\obj\windows\intern\soundsystem\openal\debug"
# PROP Target_Dir ""
LINK32=link.exe -lib
# 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 "..\..\..\intern" /I "..\..\..\..\SoundSystem" /I "..\..\..\..\SoundSystem\sdl" /I "..\..\..\..\moto\include" /I "..\..\..\..\string" /I "..\..\..\..\..\..\lib\windows\sdl\include" /I "..\..\..\..\..\..\lib\windows\openal\include" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /YX /J /FD /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:"..\..\..\..\..\obj\windows\intern\soundsystem\openal\debug\libOpenALSoundSystem.lib"
!ENDIF
# Begin Target
# Name "OpenALSoundSystem - Win32 Release"
# Name "OpenALSoundSystem - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\..\openal\SND_OpenALDevice.cpp
# End Source File
# Begin Source File
SOURCE=..\..\..\sdl\SND_SDLCDDevice.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\..\..\openal\SND_OpenALDevice.h
# End Source File
# End Group
# End Target
# End Project

View File

@@ -0,0 +1,339 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="SoundSystem"
ProjectGUID="{98330220-47A6-42E0-9DE4-AD0FF5D204D6}"
SccProjectName=""
SccLocalPath="">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Blender Debug|Win32"
OutputDirectory="..\..\..\..\..\build\msvc_7\intern\soundsystem\debug"
IntermediateDirectory="..\..\..\..\..\build\msvc_7\intern\soundsystem\debug"
ConfigurationType="4"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..;..\..\dummy;..\..\openal;..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\build\msvc_7\intern\moto\include"
PreprocessorDefinitions="_DEBUG,WIN32,_LIB"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
DefaultCharIsUnsigned="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderFile="..\..\..\..\..\build\msvc_7\intern\soundsystem\debug\SoundSystem.pch"
AssemblerListingLocation="..\..\..\..\..\build\msvc_7\intern\soundsystem\debug\"
ObjectFile="..\..\..\..\..\build\msvc_7\intern\soundsystem\debug\"
ProgramDataBaseFileName="..\..\..\..\..\build\msvc_7\intern\soundsystem\debug\"
WarningLevel="2"
SuppressStartupBanner="TRUE"
DebugInformationFormat="3"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\..\..\..\..\build\msvc_7\libs\intern\debug\libSoundSystem.lib"
SuppressStartupBanner="TRUE"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"
Description="Copying SND SoundSystem files library (debug target) to lib tree."
CommandLine="ECHO Copying header files
IF NOT EXIST ..\..\..\..\..\build\msvc_7\intern\SoundSystem\include MKDIR ..\..\..\..\..\build\msvc_7\intern\SoundSystem\include
XCOPY /Y ..\..\*.h ..\..\..\..\..\build\msvc_7\intern\SoundSystem\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\intern\soundsystem"
IntermediateDirectory="..\..\..\..\..\build\msvc_7\intern\soundsystem"
ConfigurationType="4"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..;..\..\dummy;..\..\openal;..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\build\msvc_7\intern\moto\include"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB"
StringPooling="TRUE"
RuntimeLibrary="0"
EnableFunctionLevelLinking="TRUE"
DefaultCharIsUnsigned="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderFile="..\..\..\..\..\build\msvc_7\intern\soundsystem\SoundSystem.pch"
AssemblerListingLocation="..\..\..\..\..\build\msvc_7\intern\soundsystem\"
ObjectFile="..\..\..\..\..\build\msvc_7\intern\soundsystem\"
ProgramDataBaseFileName="..\..\..\..\..\build\msvc_7\intern\soundsystem\"
WarningLevel="2"
SuppressStartupBanner="TRUE"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\..\..\..\..\build\msvc_7\libs\intern\libSoundSystem.lib"
SuppressStartupBanner="TRUE"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"
Description="Copying SND SoundSystem files library to lib tree."
CommandLine="ECHO Copying header files
IF NOT EXIST ..\..\..\..\..\build\msvc_7\intern\SoundSystem\include MKDIR ..\..\..\..\..\build\msvc_7\intern\SoundSystem\include
XCOPY /Y ..\..\*.h ..\..\..\..\..\build\msvc_7\intern\SoundSystem\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="3DPlugin Release|Win32"
OutputDirectory="..\..\..\..\..\build\msvc_7\intern\soundsystem\mtdll"
IntermediateDirectory="..\..\..\..\..\build\msvc_7\intern\soundsystem\mtdll"
ConfigurationType="4"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..;..\..\dummy;..\..\openal;..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\build\msvc_7\intern\moto\include"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB"
StringPooling="TRUE"
RuntimeLibrary="2"
EnableFunctionLevelLinking="TRUE"
DefaultCharIsUnsigned="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderFile="..\..\..\..\..\build\msvc_7\intern\soundsystem\mtdll\SoundSystem.pch"
AssemblerListingLocation="..\..\..\..\..\build\msvc_7\intern\soundsystem\mtdll\"
ObjectFile="..\..\..\..\..\build\msvc_7\intern\soundsystem\mtdll\"
ProgramDataBaseFileName="..\..\..\..\..\build\msvc_7\intern\soundsystem\mtdll\"
WarningLevel="2"
SuppressStartupBanner="TRUE"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\..\..\..\..\build\msvc_7\libs\intern\mtdll\libSoundSystem.lib"
SuppressStartupBanner="TRUE"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"
Description="Copying SND SoundSystem files library to lib tree."
CommandLine="ECHO Copying header files
IF NOT EXIST ..\..\..\..\..\build\msvc_7\intern\SoundSystem\include MKDIR ..\..\..\..\..\build\msvc_7\intern\SoundSystem\include
XCOPY /Y ..\..\*.h ..\..\..\..\..\build\msvc_7\intern\SoundSystem\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="3DPlugin Debug|Win32"
OutputDirectory="..\..\..\..\..\build\msvc_7\intern\soundsystem\mtdll\debug"
IntermediateDirectory="..\..\..\..\..\build\msvc_7\intern\soundsystem\mtdll\debug"
ConfigurationType="4"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..;..\..\dummy;..\..\openal;..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\build\msvc_7\intern\moto\include"
PreprocessorDefinitions="_DEBUG,WIN32,_LIB"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
DefaultCharIsUnsigned="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderFile="..\..\..\..\..\build\msvc_7\intern\soundsystem\mtdll\debug\SoundSystem.pch"
AssemblerListingLocation="..\..\..\..\..\build\msvc_7\intern\soundsystem\mtdll\debug\"
ObjectFile="..\..\..\..\..\build\msvc_7\intern\soundsystem\mtdll\debug\"
ProgramDataBaseFileName="..\..\..\..\..\build\msvc_7\intern\soundsystem\mtdll\debug\"
WarningLevel="2"
SuppressStartupBanner="TRUE"
DebugInformationFormat="3"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\..\..\..\..\build\msvc_7\libs\intern\mtdll\debug\libSoundSystem.lib"
SuppressStartupBanner="TRUE"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"
Description="Copying SND SoundSystem files library (debug target) to lib tree."
CommandLine="ECHO Copying header files
IF NOT EXIST ..\..\..\..\..\build\msvc_7\intern\SoundSystem\include MKDIR ..\..\..\..\..\build\msvc_7\intern\SoundSystem\include
XCOPY /Y ..\..\*.h ..\..\..\..\..\build\msvc_7\intern\SoundSystem\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="..\..\intern\SND_AudioDevice.cpp">
</File>
<File
RelativePath="..\..\intern\SND_C-api.cpp">
</File>
<File
RelativePath="..\..\intern\SND_CDObject.cpp">
</File>
<File
RelativePath="..\..\intern\SND_DeviceManager.cpp">
</File>
<File
RelativePath="..\..\intern\SND_IdObject.cpp">
</File>
<File
RelativePath="..\..\intern\SND_Scene.cpp">
</File>
<File
RelativePath="..\..\intern\SND_SoundListener.cpp">
</File>
<File
RelativePath="..\..\intern\SND_SoundObject.cpp">
</File>
<File
RelativePath="..\..\intern\SND_Utils.cpp">
</File>
<File
RelativePath="..\..\intern\SND_WaveCache.cpp">
</File>
<File
RelativePath="..\..\intern\SND_WaveSlot.cpp">
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl">
<File
RelativePath="..\..\intern\SND_AudioDevice.h">
</File>
<File
RelativePath="..\..\SND_C-api.h">
</File>
<File
RelativePath="..\..\SND_CDObject.h">
</File>
<File
RelativePath="..\..\SND_DependKludge.h">
</File>
<File
RelativePath="..\..\SND_DeviceManager.h">
</File>
<File
RelativePath="..\..\SND_IAudioDevice.h">
</File>
<File
RelativePath="..\..\intern\SND_IdObject.h">
</File>
<File
RelativePath="..\..\SND_Object.h">
</File>
<File
RelativePath="..\..\SND_Scene.h">
</File>
<File
RelativePath="..\..\SND_SoundListener.h">
</File>
<File
RelativePath="..\..\SND_SoundObject.h">
</File>
<File
RelativePath="..\..\SND_Utils.h">
</File>
<File
RelativePath="..\..\SND_WaveCache.h">
</File>
<File
RelativePath="..\..\SND_WaveSlot.h">
</File>
<File
RelativePath="..\..\SoundDefines.h">
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -0,0 +1,243 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="DummySoundSystem"
ProjectGUID="{FAF46346-65CC-4DB2-85C4-B99826F79D0C}"
SccProjectName=""
SccLocalPath="">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Blender Release|Win32"
OutputDirectory="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy"
IntermediateDirectory="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy"
ConfigurationType="4"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..\intern;..\..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\..\..\build\msvc_7\intern\moto\include"
PreprocessorDefinitions="WIN32,NDEBUG,_LIB"
StringPooling="TRUE"
RuntimeLibrary="0"
EnableFunctionLevelLinking="TRUE"
DefaultCharIsUnsigned="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderFile="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\DummySoundSystem.pch"
AssemblerListingLocation="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\"
ObjectFile="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\"
ProgramDataBaseFileName="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\"
WarningLevel="2"
SuppressStartupBanner="TRUE"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\..\..\..\..\..\build\msvc_7\libs\intern\libDummySoundSystem.lib"
SuppressStartupBanner="TRUE"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<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="Blender Debug|Win32"
OutputDirectory="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\debug"
IntermediateDirectory="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\debug"
ConfigurationType="4"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\intern;..\..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\..\..\build\msvc_7\intern\moto\include"
PreprocessorDefinitions="WIN32,_DEBUG,_LIB"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
DefaultCharIsUnsigned="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderFile="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\debug\DummySoundSystem.pch"
AssemblerListingLocation="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\debug\"
ObjectFile="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\debug\"
ProgramDataBaseFileName="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\debug\"
WarningLevel="2"
SuppressStartupBanner="TRUE"
DebugInformationFormat="3"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\..\..\..\..\..\build\msvc_7\libs\intern\debug\libDummySoundSystem.lib"
SuppressStartupBanner="TRUE"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<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="3DPlugin Release|Win32"
OutputDirectory="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\mtdll"
IntermediateDirectory="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\mtdll"
ConfigurationType="4"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..\intern;..\..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\..\..\build\msvc_7\intern\moto\include"
PreprocessorDefinitions="WIN32,NDEBUG,_LIB"
StringPooling="TRUE"
RuntimeLibrary="2"
EnableFunctionLevelLinking="TRUE"
DefaultCharIsUnsigned="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderFile="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\mtdll\DummySoundSystem.pch"
AssemblerListingLocation="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\mtdll\"
ObjectFile="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\mtdll\"
ProgramDataBaseFileName="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\mtdll\"
WarningLevel="2"
SuppressStartupBanner="TRUE"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\..\..\..\..\..\build\msvc_7\libs\intern\mtdll\libDummySoundSystem.lib"
SuppressStartupBanner="TRUE"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<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="3DPlugin Debug|Win32"
OutputDirectory="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\mtdll\debug"
IntermediateDirectory="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\mtdll\debug"
ConfigurationType="4"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\intern;..\..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\..\..\build\msvc_7\intern\moto\include"
PreprocessorDefinitions="WIN32,_DEBUG,_LIB"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
DefaultCharIsUnsigned="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderFile="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\mtdll\debug\DummySoundSystem.pch"
AssemblerListingLocation="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\mtdll\debug\"
ObjectFile="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\mtdll\debug\"
ProgramDataBaseFileName="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\mtdll\debug\"
WarningLevel="2"
SuppressStartupBanner="TRUE"
DebugInformationFormat="3"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\..\..\..\..\..\build\msvc_7\libs\intern\mtdll\debug\libDummySoundSystem.lib"
SuppressStartupBanner="TRUE"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<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="..\..\..\dummy\SND_DummyDevice.cpp">
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl">
<File
RelativePath="..\..\..\dummy\SND_DummyDevice.h">
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -0,0 +1,249 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="OpenALSoundSystem"
ProjectGUID="{213356A9-3A1F-41DA-9819-1297BCD17DEE}"
SccProjectName=""
SccLocalPath="">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Blender Debug|Win32"
OutputDirectory="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\debug"
IntermediateDirectory="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\debug"
ConfigurationType="4"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\sdl;..\..\..\intern;..\..\..\..\..\..\lib\windows\sdl\include;..\..\..\..\..\..\lib\windows\openal\include;..\..\..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\..\build\msvc_7\intern\string\include"
PreprocessorDefinitions="_DEBUG,WIN32,_LIB"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
DefaultCharIsUnsigned="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderFile="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\debug\OpenALSoundSystem.pch"
AssemblerListingLocation="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\debug\"
ObjectFile="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\debug\"
ProgramDataBaseFileName="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\debug\"
WarningLevel="2"
SuppressStartupBanner="TRUE"
DebugInformationFormat="3"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\..\..\..\..\..\build\msvc_7\libs\intern\debug\libOpenALSoundSystem.lib"
SuppressStartupBanner="TRUE"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<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\intern\soundsystem\openal"
IntermediateDirectory="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal"
ConfigurationType="4"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..\sdl;..\..\..\intern;..\..\..\..\..\..\lib\windows\sdl\include;..\..\..\..\..\..\lib\windows\openal\include;..\..\..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\..\build\msvc_7\intern\string\include"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB"
StringPooling="TRUE"
RuntimeLibrary="0"
EnableFunctionLevelLinking="TRUE"
DefaultCharIsUnsigned="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderFile="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\OpenALSoundSystem.pch"
AssemblerListingLocation="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\"
ObjectFile="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\"
ProgramDataBaseFileName="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\"
WarningLevel="2"
SuppressStartupBanner="TRUE"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\..\..\..\..\..\build\msvc_7\libs\intern\libOpenALSoundSystem.lib"
SuppressStartupBanner="TRUE"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<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="3DPlugin Release|Win32"
OutputDirectory="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\mtdll"
IntermediateDirectory="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\mtdll"
ConfigurationType="4"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..\sdl;..\..\..\intern;..\..\..\..\..\..\lib\windows\sdl\include;..\..\..\..\..\..\lib\windows\openal\include;..\..\..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\..\build\msvc_7\intern\string\include"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB"
StringPooling="TRUE"
RuntimeLibrary="2"
EnableFunctionLevelLinking="TRUE"
DefaultCharIsUnsigned="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderFile="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\mtdll\OpenALSoundSystem.pch"
AssemblerListingLocation="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\mtdll\"
ObjectFile="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\mtdll\"
ProgramDataBaseFileName="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\mtdll\"
WarningLevel="2"
SuppressStartupBanner="TRUE"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\..\..\..\..\..\build\msvc_7\libs\intern\mtdll\libOpenALSoundSystem.lib"
SuppressStartupBanner="TRUE"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<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="3DPlugin Debug|Win32"
OutputDirectory="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\mtdll\debug"
IntermediateDirectory="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\mtdll\debug"
ConfigurationType="4"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\sdl;..\..\..\intern;..\..\..\..\..\..\lib\windows\sdl\include;..\..\..\..\..\..\lib\windows\openal\include;..\..\..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\..\build\msvc_7\intern\string\include"
PreprocessorDefinitions="_DEBUG,WIN32,_LIB"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
DefaultCharIsUnsigned="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderFile="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\mtdll\debug\OpenALSoundSystem.pch"
AssemblerListingLocation="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\mtdll\debug\"
ObjectFile="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\mtdll\debug\"
ProgramDataBaseFileName="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\mtdll\debug\"
WarningLevel="2"
SuppressStartupBanner="TRUE"
DebugInformationFormat="3"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\..\..\..\..\..\build\msvc_7\libs\intern\mtdll\debug\libOpenALSoundSystem.lib"
SuppressStartupBanner="TRUE"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<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="..\..\..\openal\SND_OpenALDevice.cpp">
</File>
<File
RelativePath="..\..\..\sdl\SND_SDLCDDevice.cpp">
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl">
<File
RelativePath="..\..\..\openal\SND_OpenALDevice.h">
</File>
<File
RelativePath="..\..\..\sdl\SND_SDLCDDevice.h">
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -0,0 +1,447 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9,00"
Name="INT_SoundSystem"
ProjectGUID="{98330220-47A6-42E0-9DE4-AD0FF5D204D6}"
RootNamespace="SoundSystem"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Blender Debug|Win32"
OutputDirectory="..\..\..\..\..\build\msvc_9\intern\soundsystem\debug"
IntermediateDirectory="..\..\..\..\..\build\msvc_9\intern\soundsystem\debug"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..;..\..\dummy;..\..\openal;..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\intern\moto\include"
PreprocessorDefinitions="_DEBUG,WIN32,_LIB"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
DefaultCharIsUnsigned="true"
UsePrecompiledHeader="0"
PrecompiledHeaderFile="..\..\..\..\..\build\msvc_9\intern\soundsystem\debug\SoundSystem.pch"
AssemblerListingLocation="..\..\..\..\..\build\msvc_9\intern\soundsystem\debug\"
ObjectFile="..\..\..\..\..\build\msvc_9\intern\soundsystem\debug\"
ProgramDataBaseFileName="..\..\..\..\..\build\msvc_9\intern\soundsystem\debug\"
WarningLevel="2"
SuppressStartupBanner="true"
DebugInformationFormat="3"
CompileAs="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\..\..\..\..\build\msvc_9\libs\intern\debug\libSoundSystem.lib"
SuppressStartupBanner="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
Description="Copying SND SoundSystem files library (debug target) to lib tree."
CommandLine="ECHO Copying header files&#x0D;&#x0A;IF NOT EXIST ..\..\..\..\..\build\msvc_9\intern\SoundSystem\include MKDIR ..\..\..\..\..\build\msvc_9\intern\SoundSystem\include&#x0D;&#x0A;XCOPY /Y ..\..\*.h ..\..\..\..\..\build\msvc_9\intern\SoundSystem\include&#x0D;&#x0A;ECHO Done&#x0D;&#x0A;"
/>
</Configuration>
<Configuration
Name="Blender Release|Win32"
OutputDirectory="..\..\..\..\..\build\msvc_9\intern\soundsystem"
IntermediateDirectory="..\..\..\..\..\build\msvc_9\intern\soundsystem"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..;..\..\dummy;..\..\openal;..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\intern\moto\include"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB"
StringPooling="true"
RuntimeLibrary="0"
EnableFunctionLevelLinking="true"
DefaultCharIsUnsigned="true"
UsePrecompiledHeader="0"
PrecompiledHeaderFile="..\..\..\..\..\build\msvc_9\intern\soundsystem\SoundSystem.pch"
AssemblerListingLocation="..\..\..\..\..\build\msvc_9\intern\soundsystem\"
ObjectFile="..\..\..\..\..\build\msvc_9\intern\soundsystem\"
ProgramDataBaseFileName="..\..\..\..\..\build\msvc_9\intern\soundsystem\"
WarningLevel="2"
SuppressStartupBanner="true"
CompileAs="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\..\..\..\..\build\msvc_9\libs\intern\libSoundSystem.lib"
SuppressStartupBanner="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
Description="Copying SND SoundSystem files library to lib tree."
CommandLine="ECHO Copying header files&#x0D;&#x0A;IF NOT EXIST ..\..\..\..\..\build\msvc_9\intern\SoundSystem\include MKDIR ..\..\..\..\..\build\msvc_9\intern\SoundSystem\include&#x0D;&#x0A;XCOPY /Y ..\..\*.h ..\..\..\..\..\build\msvc_9\intern\SoundSystem\include&#x0D;&#x0A;ECHO Done&#x0D;&#x0A;"
/>
</Configuration>
<Configuration
Name="3DPlugin Release|Win32"
OutputDirectory="..\..\..\..\..\build\msvc_9\intern\soundsystem\mtdll"
IntermediateDirectory="..\..\..\..\..\build\msvc_9\intern\soundsystem\mtdll"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..;..\..\dummy;..\..\openal;..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\intern\moto\include"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB"
StringPooling="true"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
DefaultCharIsUnsigned="true"
UsePrecompiledHeader="0"
PrecompiledHeaderFile="..\..\..\..\..\build\msvc_9\intern\soundsystem\mtdll\SoundSystem.pch"
AssemblerListingLocation="..\..\..\..\..\build\msvc_9\intern\soundsystem\mtdll\"
ObjectFile="..\..\..\..\..\build\msvc_9\intern\soundsystem\mtdll\"
ProgramDataBaseFileName="..\..\..\..\..\build\msvc_9\intern\soundsystem\mtdll\"
WarningLevel="2"
SuppressStartupBanner="true"
CompileAs="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\..\..\..\..\build\msvc_9\libs\intern\mtdll\libSoundSystem.lib"
SuppressStartupBanner="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
Description="Copying SND SoundSystem files library to lib tree."
CommandLine="ECHO Copying header files&#x0D;&#x0A;IF NOT EXIST ..\..\..\..\..\build\msvc_9\intern\SoundSystem\include MKDIR ..\..\..\..\..\build\msvc_9\intern\SoundSystem\include&#x0D;&#x0A;XCOPY /Y ..\..\*.h ..\..\..\..\..\build\msvc_9\intern\SoundSystem\include&#x0D;&#x0A;ECHO Done&#x0D;&#x0A;"
/>
</Configuration>
<Configuration
Name="3DPlugin Debug|Win32"
OutputDirectory="..\..\..\..\..\build\msvc_9\intern\soundsystem\mtdll\debug"
IntermediateDirectory="..\..\..\..\..\build\msvc_9\intern\soundsystem\mtdll\debug"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..;..\..\dummy;..\..\openal;..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\intern\moto\include"
PreprocessorDefinitions="_DEBUG,WIN32,_LIB"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
DefaultCharIsUnsigned="true"
UsePrecompiledHeader="0"
PrecompiledHeaderFile="..\..\..\..\..\build\msvc_9\intern\soundsystem\mtdll\debug\SoundSystem.pch"
AssemblerListingLocation="..\..\..\..\..\build\msvc_9\intern\soundsystem\mtdll\debug\"
ObjectFile="..\..\..\..\..\build\msvc_9\intern\soundsystem\mtdll\debug\"
ProgramDataBaseFileName="..\..\..\..\..\build\msvc_9\intern\soundsystem\mtdll\debug\"
WarningLevel="2"
SuppressStartupBanner="true"
DebugInformationFormat="3"
CompileAs="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\..\..\..\..\build\msvc_9\libs\intern\mtdll\debug\libSoundSystem.lib"
SuppressStartupBanner="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
Description="Copying SND SoundSystem files library (debug target) to lib tree."
CommandLine="ECHO Copying header files&#x0D;&#x0A;IF NOT EXIST ..\..\..\..\..\build\msvc_9\intern\SoundSystem\include MKDIR ..\..\..\..\..\build\msvc_9\intern\SoundSystem\include&#x0D;&#x0A;XCOPY /Y ..\..\*.h ..\..\..\..\..\build\msvc_9\intern\SoundSystem\include&#x0D;&#x0A;ECHO Done&#x0D;&#x0A;"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
>
<File
RelativePath="..\..\intern\SND_AudioDevice.cpp"
>
</File>
<File
RelativePath="..\..\intern\SND_C-api.cpp"
>
</File>
<File
RelativePath="..\..\intern\SND_CDObject.cpp"
>
</File>
<File
RelativePath="..\..\intern\SND_DeviceManager.cpp"
>
</File>
<File
RelativePath="..\..\intern\SND_IdObject.cpp"
>
</File>
<File
RelativePath="..\..\intern\SND_Scene.cpp"
>
</File>
<File
RelativePath="..\..\intern\SND_SoundListener.cpp"
>
</File>
<File
RelativePath="..\..\intern\SND_SoundObject.cpp"
>
</File>
<File
RelativePath="..\..\intern\SND_Utils.cpp"
>
</File>
<File
RelativePath="..\..\intern\SND_WaveCache.cpp"
>
</File>
<File
RelativePath="..\..\intern\SND_WaveSlot.cpp"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl"
>
<File
RelativePath="..\..\intern\SND_AudioDevice.h"
>
</File>
<File
RelativePath="..\..\SND_C-api.h"
>
</File>
<File
RelativePath="..\..\SND_CDObject.h"
>
</File>
<File
RelativePath="..\..\SND_DependKludge.h"
>
</File>
<File
RelativePath="..\..\SND_DeviceManager.h"
>
</File>
<File
RelativePath="..\..\SND_IAudioDevice.h"
>
</File>
<File
RelativePath="..\..\intern\SND_IdObject.h"
>
</File>
<File
RelativePath="..\..\SND_Object.h"
>
</File>
<File
RelativePath="..\..\SND_Scene.h"
>
</File>
<File
RelativePath="..\..\SND_SoundListener.h"
>
</File>
<File
RelativePath="..\..\SND_SoundObject.h"
>
</File>
<File
RelativePath="..\..\SND_Utils.h"
>
</File>
<File
RelativePath="..\..\SND_WaveCache.h"
>
</File>
<File
RelativePath="..\..\SND_WaveSlot.h"
>
</File>
<File
RelativePath="..\..\SoundDefines.h"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -2,9 +2,9 @@
<VisualStudioProject
ProjectType="Visual C++"
Version="9,00"
Name="EXT_lzma"
ProjectGUID="{79D0B232-208C-F208-DA71-79B4AC088602}"
RootNamespace="lzma"
Name="INT_DummySoundSystem"
ProjectGUID="{FAF46346-65CC-4DB2-85C4-B99826F79D0C}"
RootNamespace="DummySoundSystem"
TargetFrameworkVersion="131072"
>
<Platforms>
@@ -15,85 +15,10 @@
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Blender Debug|Win32"
OutputDirectory="..\..\..\..\..\build\msvc_9\extern\lzma\debug"
IntermediateDirectory="..\..\..\..\..\build\msvc_9\extern\lzma\debug"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="_DEBUG;_LIB;WIN32"
ExceptionHandling="1"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
PrecompiledHeaderFile="..\..\..\..\..\build\msvc_9\extern\lzma\debug\lzma.pch"
AssemblerListingLocation="..\..\..\..\..\build\msvc_9\extern\lzma\debug\"
ObjectFile="..\..\..\..\..\build\msvc_9\extern\lzma\debug\"
ProgramDataBaseFileName="..\..\..\..\..\build\msvc_9\extern\lzma\debug\"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="4"
CompileAs="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\..\..\..\..\build\msvc_9\libs\extern\debug\lzma.lib"
SuppressStartupBanner="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Blender Release|Win32"
OutputDirectory="..\..\..\..\..\build\msvc_9\extern\lzma"
IntermediateDirectory="..\..\..\..\..\build\msvc_9\extern\lzma"
OutputDirectory="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy"
IntermediateDirectory="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -117,22 +42,20 @@
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="NDEBUG;_LIB;WIN32"
AdditionalIncludeDirectories="..\..\..\intern;..\..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\..\..\build\msvc_9\intern\moto\include"
PreprocessorDefinitions="WIN32,NDEBUG,_LIB"
StringPooling="true"
ExceptionHandling="0"
RuntimeLibrary="0"
EnableFunctionLevelLinking="true"
DefaultCharIsUnsigned="true"
UsePrecompiledHeader="0"
PrecompiledHeaderFile="..\..\..\..\..\build\msvc_9\extern\lzma\lzma.pch"
AssemblerListingLocation="..\..\..\..\..\build\msvc_9\extern\lzma\"
ObjectFile="..\..\..\..\..\build\msvc_9\extern\lzma\"
ProgramDataBaseFileName="..\..\..\..\..\build\msvc_9\extern\lzma\"
WarningLevel="3"
PrecompiledHeaderFile="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\DummySoundSystem.pch"
AssemblerListingLocation="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\"
ObjectFile="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\"
ProgramDataBaseFileName="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\"
WarningLevel="2"
SuppressStartupBanner="true"
DebugInformationFormat="1"
CompileAs="0"
/>
<Tool
@@ -148,7 +71,7 @@
/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\..\..\..\..\build\msvc_9\libs\extern\lzma.lib"
OutputFile="..\..\..\..\..\..\build\msvc_9\libs\intern\libDummySoundSystem.lib"
SuppressStartupBanner="true"
/>
<Tool
@@ -168,9 +91,9 @@
/>
</Configuration>
<Configuration
Name="3D Plugin Debug|Win32"
OutputDirectory="..\..\..\..\..\build\msvc_9\extern\lzma\mtdll\debug"
IntermediateDirectory="..\..\..\..\..\build\msvc_9\extern\lzma\mtdll\debug"
Name="Blender Debug|Win32"
OutputDirectory="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\debug"
IntermediateDirectory="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\debug"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -195,19 +118,19 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="_DEBUG;_LIB;WIN32"
ExceptionHandling="0"
AdditionalIncludeDirectories="..\..\..\intern;..\..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\..\..\build\msvc_9\intern\moto\include"
PreprocessorDefinitions="WIN32,_DEBUG,_LIB"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
RuntimeLibrary="1"
DefaultCharIsUnsigned="true"
UsePrecompiledHeader="0"
PrecompiledHeaderFile="..\..\..\..\..\build\msvc_9\extern\lzma\mtdll\debug\lzma.pch"
AssemblerListingLocation="..\..\..\..\..\build\msvc_9\extern\lzma\mtdll\debug\"
ObjectFile="..\..\..\..\..\build\msvc_9\extern\lzma\mtdll\debug\"
ProgramDataBaseFileName="..\..\..\..\..\build\msvc_9\extern\lzma\mtdll\debug\"
WarningLevel="3"
PrecompiledHeaderFile="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\debug\DummySoundSystem.pch"
AssemblerListingLocation="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\debug\"
ObjectFile="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\debug\"
ProgramDataBaseFileName="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\debug\"
WarningLevel="2"
SuppressStartupBanner="true"
DebugInformationFormat="4"
DebugInformationFormat="3"
CompileAs="0"
/>
<Tool
@@ -223,7 +146,7 @@
/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\..\..\..\..\build\msvc_9\libs\extern\mtdll\debug\lzma.lib"
OutputFile="..\..\..\..\..\..\build\msvc_9\libs\intern\debug\libDummySoundSystem.lib"
SuppressStartupBanner="true"
/>
<Tool
@@ -243,9 +166,9 @@
/>
</Configuration>
<Configuration
Name="3D Plugin Release|Win32"
OutputDirectory="..\..\..\..\..\build\msvc_9\extern\lzma\mtdll"
IntermediateDirectory="..\..\..\..\..\build\msvc_9\extern\lzma\mtdll"
Name="3DPlugin Release|Win32"
OutputDirectory="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\mtdll"
IntermediateDirectory="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\mtdll"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -269,22 +192,20 @@
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="NDEBUG;_LIB;WIN32"
AdditionalIncludeDirectories="..\..\..\intern;..\..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\..\..\build\msvc_9\intern\moto\include"
PreprocessorDefinitions="WIN32,NDEBUG,_LIB"
StringPooling="true"
ExceptionHandling="0"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
DefaultCharIsUnsigned="true"
UsePrecompiledHeader="0"
PrecompiledHeaderFile="..\..\..\..\..\build\msvc_9\extern\lzma\mtdll\lzma.pch"
AssemblerListingLocation="..\..\..\..\..\build\msvc_9\extern\lzma\mtdll\"
ObjectFile="..\..\..\..\..\build\msvc_9\extern\lzma\mtdll\"
ProgramDataBaseFileName="..\..\..\..\..\build\msvc_9\extern\lzma\mtdll\"
WarningLevel="3"
PrecompiledHeaderFile="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\mtdll\DummySoundSystem.pch"
AssemblerListingLocation="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\mtdll\"
ObjectFile="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\mtdll\"
ProgramDataBaseFileName="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\mtdll\"
WarningLevel="2"
SuppressStartupBanner="true"
DebugInformationFormat="1"
CompileAs="0"
/>
<Tool
@@ -300,7 +221,82 @@
/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\..\..\..\..\build\msvc_9\libs\extern\mtdll\lzma.lib"
OutputFile="..\..\..\..\..\..\build\msvc_9\libs\intern\mtdll\libDummySoundSystem.lib"
SuppressStartupBanner="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="3DPlugin Debug|Win32"
OutputDirectory="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\mtdll\debug"
IntermediateDirectory="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\mtdll\debug"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\intern;..\..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\..\..\build\msvc_9\intern\moto\include"
PreprocessorDefinitions="WIN32,_DEBUG,_LIB"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
DefaultCharIsUnsigned="true"
UsePrecompiledHeader="0"
PrecompiledHeaderFile="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\mtdll\debug\DummySoundSystem.pch"
AssemblerListingLocation="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\mtdll\debug\"
ObjectFile="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\mtdll\debug\"
ProgramDataBaseFileName="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\mtdll\debug\"
WarningLevel="2"
SuppressStartupBanner="true"
DebugInformationFormat="3"
CompileAs="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\..\..\..\..\..\build\msvc_9\libs\intern\mtdll\debug\libDummySoundSystem.lib"
SuppressStartupBanner="true"
/>
<Tool
@@ -325,57 +321,19 @@
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
>
<File
RelativePath="..\..\Alloc.c"
>
</File>
<File
RelativePath="..\..\LzFind.c"
>
</File>
<File
RelativePath="..\..\LzmaDec.c"
>
</File>
<File
RelativePath="..\..\LzmaEnc.c"
>
</File>
<File
RelativePath="..\..\LzmaLib.c"
RelativePath="..\..\..\dummy\SND_DummyDevice.cpp"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl"
>
<File
RelativePath="..\..\Alloc.h"
>
</File>
<File
RelativePath="..\..\LzFind.h"
>
</File>
<File
RelativePath="..\..\LzHash.h"
>
</File>
<File
RelativePath="..\..\LzmaDec.h"
>
</File>
<File
RelativePath="..\..\LzmaEnc.h"
>
</File>
<File
RelativePath="..\..\LzmaLib.h"
>
</File>
<File
RelativePath="..\..\Types.h"
RelativePath="..\..\..\dummy\SND_DummyDevice.h"
>
</File>
</Filter>

View File

@@ -2,9 +2,9 @@
<VisualStudioProject
ProjectType="Visual C++"
Version="9,00"
Name="EXT_lzo"
ProjectGUID="{8BFA4082-773B-D100-BC24-659083BA023F}"
RootNamespace="lzo"
Name="INT_OpenALSoundSystem"
ProjectGUID="{213356A9-3A1F-41DA-9819-1297BCD17DEE}"
RootNamespace="OpenALSoundSystem"
TargetFrameworkVersion="131072"
>
<Platforms>
@@ -17,8 +17,8 @@
<Configurations>
<Configuration
Name="Blender Debug|Win32"
OutputDirectory="..\..\..\..\..\build\msvc_9\extern\lzo\debug"
IntermediateDirectory="..\..\..\..\..\build\msvc_9\extern\lzo\debug"
OutputDirectory="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\debug"
IntermediateDirectory="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\debug"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -43,19 +43,19 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="_DEBUG;_LIB;WIN32"
ExceptionHandling="1"
AdditionalIncludeDirectories="..\..\..\sdl;..\..\..\intern;..\..\..\..\..\..\lib\windows\sdl\include;..\..\..\..\..\..\lib\windows\openal\include;..\..\..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\..\build\msvc_9\intern\string\include"
PreprocessorDefinitions="_DEBUG,WIN32,_LIB"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
DefaultCharIsUnsigned="true"
UsePrecompiledHeader="0"
PrecompiledHeaderFile="..\..\..\..\..\build\msvc_9\extern\lzo\debug\lzo.pch"
AssemblerListingLocation="..\..\..\..\..\build\msvc_9\extern\lzo\debug\"
ObjectFile="..\..\..\..\..\build\msvc_9\extern\lzo\debug\"
ProgramDataBaseFileName="..\..\..\..\..\build\msvc_9\extern\lzo\debug\"
WarningLevel="3"
PrecompiledHeaderFile="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\debug\OpenALSoundSystem.pch"
AssemblerListingLocation="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\debug\"
ObjectFile="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\debug\"
ProgramDataBaseFileName="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\debug\"
WarningLevel="2"
SuppressStartupBanner="true"
DebugInformationFormat="4"
DebugInformationFormat="3"
CompileAs="0"
/>
<Tool
@@ -71,7 +71,7 @@
/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\..\..\..\..\build\msvc_9\libs\extern\debug\lzo.lib"
OutputFile="..\..\..\..\..\..\build\msvc_9\libs\intern\debug\libOpenALSoundSystem.lib"
SuppressStartupBanner="true"
/>
<Tool
@@ -92,8 +92,8 @@
</Configuration>
<Configuration
Name="Blender Release|Win32"
OutputDirectory="..\..\..\..\..\build\msvc_9\extern\lzo"
IntermediateDirectory="..\..\..\..\..\build\msvc_9\extern\lzo"
OutputDirectory="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal"
IntermediateDirectory="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -117,22 +117,20 @@
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="NDEBUG;_LIB;WIN32"
AdditionalIncludeDirectories="..\..\..\sdl;..\..\..\intern;..\..\..\..\..\..\lib\windows\sdl\include;..\..\..\..\..\..\lib\windows\openal\include;..\..\..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\..\build\msvc_9\intern\string\include"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB"
StringPooling="true"
ExceptionHandling="0"
RuntimeLibrary="0"
EnableFunctionLevelLinking="true"
DefaultCharIsUnsigned="true"
UsePrecompiledHeader="0"
PrecompiledHeaderFile="..\..\..\..\..\build\msvc_9\extern\lzo\lzo.pch"
AssemblerListingLocation="..\..\..\..\..\build\msvc_9\extern\lzo\"
ObjectFile="..\..\..\..\..\build\msvc_9\extern\lzo\"
ProgramDataBaseFileName="..\..\..\..\..\build\msvc_9\extern\lzo\"
WarningLevel="3"
PrecompiledHeaderFile="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\OpenALSoundSystem.pch"
AssemblerListingLocation="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\"
ObjectFile="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\"
ProgramDataBaseFileName="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\"
WarningLevel="2"
SuppressStartupBanner="true"
DebugInformationFormat="1"
CompileAs="0"
/>
<Tool
@@ -148,7 +146,7 @@
/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\..\..\..\..\build\msvc_9\libs\extern\lzo.lib"
OutputFile="..\..\..\..\..\..\build\msvc_9\libs\intern\libOpenALSoundSystem.lib"
SuppressStartupBanner="true"
/>
<Tool
@@ -168,9 +166,84 @@
/>
</Configuration>
<Configuration
Name="3D Plugin Debug|Win32"
OutputDirectory="..\..\..\..\..\build\msvc_9\extern\lzo\mtdll\debug"
IntermediateDirectory="..\..\..\..\..\build\msvc_9\extern\lzo\mtdll\debug"
Name="3DPlugin Release|Win32"
OutputDirectory="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\mtdll"
IntermediateDirectory="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\mtdll"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..\sdl;..\..\..\intern;..\..\..\..\..\..\lib\windows\sdl\include;..\..\..\..\..\..\lib\windows\openal\include;..\..\..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\..\build\msvc_9\intern\string\include"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB"
StringPooling="true"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
DefaultCharIsUnsigned="true"
UsePrecompiledHeader="0"
PrecompiledHeaderFile="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\mtdll\OpenALSoundSystem.pch"
AssemblerListingLocation="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\mtdll\"
ObjectFile="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\mtdll\"
ProgramDataBaseFileName="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\mtdll\"
WarningLevel="2"
SuppressStartupBanner="true"
CompileAs="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\..\..\..\..\..\build\msvc_9\libs\intern\mtdll\libOpenALSoundSystem.lib"
SuppressStartupBanner="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="3DPlugin Debug|Win32"
OutputDirectory="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\mtdll\debug"
IntermediateDirectory="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\mtdll\debug"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -195,19 +268,19 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="_DEBUG;_LIB;WIN32"
ExceptionHandling="0"
AdditionalIncludeDirectories="..\..\..\sdl;..\..\..\intern;..\..\..\..\..\..\lib\windows\sdl\include;..\..\..\..\..\..\lib\windows\openal\include;..\..\..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\..\build\msvc_9\intern\string\include"
PreprocessorDefinitions="_DEBUG,WIN32,_LIB"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
DefaultCharIsUnsigned="true"
UsePrecompiledHeader="0"
PrecompiledHeaderFile="..\..\..\..\..\build\msvc_9\extern\lzo\mtdll\debug\lzo.pch"
AssemblerListingLocation="..\..\..\..\..\build\msvc_9\extern\lzo\mtdll\debug\"
ObjectFile="..\..\..\..\..\build\msvc_9\extern\lzo\mtdll\debug\"
ProgramDataBaseFileName="..\..\..\..\..\build\msvc_9\extern\lzo\mtdll\debug\"
WarningLevel="3"
PrecompiledHeaderFile="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\mtdll\debug\OpenALSoundSystem.pch"
AssemblerListingLocation="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\mtdll\debug\"
ObjectFile="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\mtdll\debug\"
ProgramDataBaseFileName="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\mtdll\debug\"
WarningLevel="2"
SuppressStartupBanner="true"
DebugInformationFormat="4"
DebugInformationFormat="3"
CompileAs="0"
/>
<Tool
@@ -223,84 +296,7 @@
/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\..\..\..\..\build\msvc_9\libs\extern\mtdll\debug\lzo.lib"
SuppressStartupBanner="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="3D Plugin Release|Win32"
OutputDirectory="..\..\..\..\..\build\msvc_9\extern\lzo\mtdll"
IntermediateDirectory="..\..\..\..\..\build\msvc_9\extern\lzo\mtdll"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="NDEBUG;_LIB;WIN32"
StringPooling="true"
ExceptionHandling="0"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
PrecompiledHeaderFile="..\..\..\..\..\build\msvc_9\extern\lzo\mtdll\lzo.pch"
AssemblerListingLocation="..\..\..\..\..\build\msvc_9\extern\lzo\mtdll\"
ObjectFile="..\..\..\..\..\build\msvc_9\extern\lzo\mtdll\"
ProgramDataBaseFileName="..\..\..\..\..\build\msvc_9\extern\lzo\mtdll\"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="1"
CompileAs="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\..\..\..\..\build\msvc_9\libs\extern\mtdll\lzo.lib"
OutputFile="..\..\..\..\..\..\build\msvc_9\libs\intern\mtdll\debug\libOpenALSoundSystem.lib"
SuppressStartupBanner="true"
/>
<Tool
@@ -325,25 +321,27 @@
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
>
<File
RelativePath="..\..\minilzo\minilzo.c"
RelativePath="..\..\..\openal\SND_OpenALDevice.cpp"
>
</File>
<File
RelativePath="..\..\..\sdl\SND_SDLCDDevice.cpp"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl"
>
<File
RelativePath="..\..\minilzo\lzoconf.h"
RelativePath="..\..\..\openal\SND_OpenALDevice.h"
>
</File>
<File
RelativePath="..\..\minilzo\lzodefs.h"
>
</File>
<File
RelativePath="..\..\minilzo\minilzo.h"
RelativePath="..\..\..\sdl\SND_SDLCDDevice.h"
>
</File>
</Filter>

View File

@@ -28,12 +28,17 @@
#
#
LIBNAME = aud_openal
DIR = $(OCGDIR)/intern/audaspace
LIBNAME = OpenALSoundSystem
DIR = $(OCGDIR)/intern/$(LIBNAME)
include nan_compile.mk
CCFLAGS += $(LEVEL_1_CPP_WARNINGS)
CPPFLAGS += -I$(NAN_OPENAL)/include
CPPFLAGS += -I$(NAN_STRING)/include
CPPFLAGS += -I$(NAN_MOTO)/include
CPPFLAGS += -I../intern
CPPFLAGS += -I..
CPPFLAGS += -I.
CPPFLAGS += -I../sdl

View File

@@ -0,0 +1,854 @@
/*
* $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 *****
* SND_OpenALDevice derived from SND_IAudioDevice
*/
#ifdef WIN32
#pragma warning (disable:4786) // get rid of stupid stl-visual compiler debug warning
#endif //WIN32
#include "SND_OpenALDevice.h"
#ifndef __APPLE__
#include "SND_SDLCDDevice.h"
#endif
#include "SoundDefines.h"
#include "SND_Utils.h"
#ifdef APPLE_FRAMEWORK_FIX
#include <al.h>
#include <alc.h>
#else
#include <AL/al.h>
#include <AL/alc.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#if defined(WIN32)
#include <io.h>
#else
#include <unistd.h>
#endif
#include <fcntl.h>
#include <signal.h>
/*************************** ALUT replacement *****************************/
/* instead of relying on alut, we just implement our own
* WAV loading functions, hopefully more reliable */
#include <stdlib.h>
typedef struct /* WAV File-header */
{
ALubyte Id[4];
ALsizei Size;
ALubyte Type[4];
} WAVFileHdr_Struct;
typedef struct /* WAV Fmt-header */
{
ALushort Format;
ALushort Channels;
ALuint SamplesPerSec;
ALuint BytesPerSec;
ALushort BlockAlign;
ALushort BitsPerSample;
} WAVFmtHdr_Struct;
typedef struct /* WAV FmtEx-header */
{
ALushort Size;
ALushort SamplesPerBlock;
} WAVFmtExHdr_Struct;
typedef struct /* WAV Smpl-header */
{
ALuint Manufacturer;
ALuint Product;
ALuint SamplePeriod;
ALuint Note;
ALuint FineTune;
ALuint SMPTEFormat;
ALuint SMPTEOffest;
ALuint Loops;
ALuint SamplerData;
struct
{
ALuint Identifier;
ALuint Type;
ALuint Start;
ALuint End;
ALuint Fraction;
ALuint Count;
} Loop[1];
} WAVSmplHdr_Struct;
typedef struct /* WAV Chunk-header */
{
ALubyte Id[4];
ALuint Size;
} WAVChunkHdr_Struct;
static void *SND_loadFileIntoMemory(const char *filename, int *len_r)
{
FILE *fp= fopen(filename, "rb");
void *data;
if (!fp) {
*len_r= -1;
return NULL;
}
fseek(fp, 0L, SEEK_END);
*len_r= ftell(fp);
fseek(fp, 0L, SEEK_SET);
data= malloc(*len_r);
if (!data) {
*len_r= -1;
return NULL;
}
if (fread(data, *len_r, 1, fp)!=1) {
*len_r= -1;
free(data);
return NULL;
}
return data;
}
#define TEST_SWITCH_INT(a) if(big_endian) { \
char s_i, *p_i; \
p_i= (char *)&(a); \
s_i=p_i[0]; p_i[0]=p_i[3]; p_i[3]=s_i; \
s_i=p_i[1]; p_i[1]=p_i[2]; p_i[2]=s_i; }
#define TEST_SWITCH_SHORT(a) if(big_endian) { \
char s_i, *p_i; \
p_i= (char *)&(a); \
s_i=p_i[0]; p_i[0]=p_i[1]; p_i[1]=s_i; }
static int stream_read(void *out, ALbyte **stream, ALsizei size, ALsizei *memsize)
{
if(size <= *memsize) {
memcpy(out, *stream, size);
return 1;
}
else {
memset(out, 0, size);
return 0;
}
}
static int stream_skip(ALbyte **stream, ALsizei size, ALsizei *memsize)
{
if(size <= *memsize) {
*stream += size;
*memsize -= size;
return 1;
}
else
return 0;
}
ALvoid SND_alutLoadWAVMemory(ALbyte *memory,ALsizei memsize,ALenum *format,ALvoid **data,ALsizei *size,ALsizei *freq,ALboolean *loop)
{
WAVChunkHdr_Struct ChunkHdr;
WAVFmtExHdr_Struct FmtExHdr;
WAVFileHdr_Struct FileHdr;
WAVSmplHdr_Struct SmplHdr;
WAVFmtHdr_Struct FmtHdr;
ALbyte *Stream= memory;
int test_endian= 1;
int big_endian= !((char*)&test_endian)[0];
*format=AL_FORMAT_MONO16;
*data=NULL;
*size=0;
*freq=22050;
*loop=AL_FALSE;
if(!Stream)
return;
stream_read(&FileHdr,&Stream,sizeof(WAVFileHdr_Struct),&memsize);
stream_skip(&Stream,sizeof(WAVFileHdr_Struct),&memsize);
TEST_SWITCH_INT(FileHdr.Size);
FileHdr.Size=((FileHdr.Size+1)&~1)-4;
while((FileHdr.Size!=0) && stream_read(&ChunkHdr,&Stream,sizeof(WAVChunkHdr_Struct),&memsize))
{
TEST_SWITCH_INT(ChunkHdr.Size);
stream_skip(&Stream,sizeof(WAVChunkHdr_Struct),&memsize);
if (!memcmp(ChunkHdr.Id,"fmt ",4))
{
stream_read(&FmtHdr,&Stream,sizeof(WAVFmtHdr_Struct),&memsize);
TEST_SWITCH_SHORT(FmtHdr.Format);
TEST_SWITCH_SHORT(FmtHdr.Channels);
TEST_SWITCH_INT(FmtHdr.SamplesPerSec);
TEST_SWITCH_INT(FmtHdr.BytesPerSec);
TEST_SWITCH_SHORT(FmtHdr.BlockAlign);
TEST_SWITCH_SHORT(FmtHdr.BitsPerSample);
if (FmtHdr.Format==0x0001)
{
*format=(FmtHdr.Channels==1?
(FmtHdr.BitsPerSample==8?AL_FORMAT_MONO8:AL_FORMAT_MONO16):
(FmtHdr.BitsPerSample==8?AL_FORMAT_STEREO8:AL_FORMAT_STEREO16));
*freq=FmtHdr.SamplesPerSec;
}
else
{
stream_read(&FmtExHdr,&Stream,sizeof(WAVFmtExHdr_Struct),&memsize);
TEST_SWITCH_SHORT(FmtExHdr.Size);
TEST_SWITCH_SHORT(FmtExHdr.SamplesPerBlock);
}
}
else if (!memcmp(ChunkHdr.Id,"data",4))
{
if (FmtHdr.Format==0x0001)
{
if((ALsizei)ChunkHdr.Size <= memsize)
{
*size=ChunkHdr.Size;
*data=malloc(ChunkHdr.Size+31);
if (*data) {
stream_read(*data,&Stream,ChunkHdr.Size,&memsize);
memset(((char *)*data)+ChunkHdr.Size,0,31);
if(FmtHdr.BitsPerSample == 16 && big_endian) {
int a, len= *size/2;
short *samples= (short*)*data;
for(a=0; a<len; a++) {
TEST_SWITCH_SHORT(samples[a])
}
}
}
}
}
else if (FmtHdr.Format==0x0011)
{
//IMA ADPCM
}
else if (FmtHdr.Format==0x0055)
{
//MP3 WAVE
}
}
else if (!memcmp(ChunkHdr.Id,"smpl",4))
{
stream_read(&SmplHdr,&Stream,sizeof(WAVSmplHdr_Struct),&memsize);
TEST_SWITCH_INT(SmplHdr.Manufacturer);
TEST_SWITCH_INT(SmplHdr.Product);
TEST_SWITCH_INT(SmplHdr.SamplePeriod);
TEST_SWITCH_INT(SmplHdr.Note);
TEST_SWITCH_INT(SmplHdr.FineTune);
TEST_SWITCH_INT(SmplHdr.SMPTEFormat);
TEST_SWITCH_INT(SmplHdr.SMPTEOffest);
TEST_SWITCH_INT(SmplHdr.Loops);
TEST_SWITCH_INT(SmplHdr.SamplerData);
*loop = (SmplHdr.Loops ? AL_TRUE : AL_FALSE);
}
if(!stream_skip(&Stream, ChunkHdr.Size + (ChunkHdr.Size&1), &memsize))
break;
FileHdr.Size-=(((ChunkHdr.Size+1)&~1)+8);
}
}
ALvoid SND_alutUnloadWAV(ALenum format,ALvoid *data,ALsizei size,ALsizei freq)
{
if (data)
free(data);
}
/************************ Device Implementation ****************************/
SND_OpenALDevice::SND_OpenALDevice()
: SND_AudioDevice(),
m_context(NULL),
m_device(NULL)
{
/* Removed the functionality for checking if noaudio was provided on */
/* the commandline. */
m_audio = true;
m_context = NULL;
m_buffersinitialized = false;
m_sourcesinitialized = false;
// let's check if we can get openal to initialize...
if (m_audio)
{
m_audio = false;
ALCdevice *dev = alcOpenDevice(NULL);
if (dev) {
m_context = alcCreateContext(dev, NULL);
if (m_context) {
#ifdef AL_VERSION_1_1
alcMakeContextCurrent((ALCcontext*)m_context);
#else
alcMakeContextCurrent(m_context);
#endif
m_audio = true;
m_device = dev;
#ifdef __linux__
/*
* SIGHUP Hack:
*
* On Linux, alcDestroyContext generates a SIGHUP (Hangup) when killing the OpenAL
* mixer thread, which kills Blender.
*
* So we set the signal to ignore....
*
* TODO: check if this applies to other platforms.
*
*/
signal(SIGHUP, SIG_IGN);
#endif
}
}
}
// then try to generate some buffers
if (m_audio)
{
// let openal generate its buffers
alGenBuffers(NUM_BUFFERS, m_buffers);
m_buffersinitialized = true;
for (int i = 0; i < NUM_BUFFERS; i++)
{
if (!alIsBuffer(m_buffers[i]))
{
//printf("\n\n WARNING: OpenAL returned with an error. Continuing without audio.\n\n");
m_audio = false;
break;
}
}
}
// next: the sources
if (m_audio)
{
#ifdef __APPLE__
ALenum alc_error = ALC_NO_ERROR; // openal_2.12
#else
ALenum alc_error = alcGetError(NULL); // openal_2.14+
#endif
// let openal generate its sources
if (alc_error == ALC_NO_ERROR)
{
int i;
for (i=0;i<NUM_SOURCES;i++)
m_sources[i] = 0;
alGenSources(NUM_SOURCES, m_sources);
m_sourcesinitialized = true;
}
}
// let's get us a wavecache
if (m_audio)
{
m_wavecache = new SND_WaveCache();
}
#ifndef __APPLE__
m_cdrom = new SND_SDLCDDevice();
#endif
}
void SND_OpenALDevice::UseCD(void) const
{
// we use SDL for CD, so we create the system
SND_CDObject::CreateSystem();
}
void SND_OpenALDevice::MakeCurrent() const
{
}
SND_OpenALDevice::~SND_OpenALDevice()
{
MakeCurrent();
if (m_sourcesinitialized)
{
for (int i = 0; i < NUM_SOURCES; i++)
alSourceStop(m_sources[i]);
alDeleteSources(NUM_SOURCES, m_sources);
m_sourcesinitialized = false;
}
if (m_buffersinitialized)
{
alDeleteBuffers(NUM_BUFFERS, m_buffers);
m_buffersinitialized = false;
}
if (m_context) {
MakeCurrent();
#ifdef AL_VERSION_1_1
alcDestroyContext((ALCcontext*)m_context);
#else
alcDestroyContext(m_context);
#endif
m_context = NULL;
}
#ifdef __linux__
// restore the signal state above.
signal(SIGHUP, SIG_DFL);
#endif
// let's see if we used the cd. if not, just leave it alone
SND_CDObject* pCD = SND_CDObject::Instance();
if (pCD)
{
this->StopCD();
SND_CDObject::DisposeSystem();
}
#ifndef __APPLE__
if (m_cdrom)
delete m_cdrom;
#endif
if (m_device)
alcCloseDevice((ALCdevice*) m_device);
}
SND_WaveSlot* SND_OpenALDevice::LoadSample(const STR_String& name,
void* memlocation,
int size)
{
SND_WaveSlot* waveslot = NULL;
STR_String samplename = name;
if (m_audio)
{
/* create the waveslot */
waveslot = m_wavecache->GetWaveSlot(samplename);
/* do we support this sample? */
if (SND_IsSampleValid(name, memlocation))
{
if (waveslot)
{
bool freemem = false;
int buffer = waveslot->GetBuffer();
void* data = NULL;
char loop = 'a';
int sampleformat, bitrate, numberofchannels;
ALenum al_error = alGetError();
ALsizei samplerate, numberofsamples; // openal_2.14+
/* Give them some safe defaults just incase */
bitrate = numberofchannels = 0;
if (!(size && memlocation)) {
memlocation = SND_loadFileIntoMemory(samplename.Ptr(), &size);
freemem = true;
}
/* load the sample from memory? */
if (size && memlocation)
{
waveslot->SetFileSize(size);
/* what was (our) buffer? */
int buffer = waveslot->GetBuffer();
/* get some info out of the sample */
SND_GetSampleInfo((signed char*)memlocation, waveslot);
numberofchannels = SND_GetNumberOfChannels(memlocation);
bitrate = SND_GetBitRate(memlocation);
/* load the sample into openal */
SND_alutLoadWAVMemory((ALbyte*)memlocation, size, &sampleformat, &data, &numberofsamples, &samplerate, &loop);
/* put it in the buffer */
alBufferData(m_buffers[buffer], sampleformat, data, numberofsamples, samplerate);
}
if(freemem)
free(memlocation);
/* fill the waveslot with info */
al_error = alGetError();
if (al_error == AL_NO_ERROR && m_buffers[buffer])
{
waveslot->SetData(data);
waveslot->SetSampleFormat(sampleformat);
waveslot->SetNumberOfChannels(numberofchannels);
waveslot->SetSampleRate(samplerate);
waveslot->SetBitRate(bitrate);
waveslot->SetNumberOfSamples(numberofsamples);
/* if the loading succeeded, mark the waveslot */
waveslot->SetLoaded(true);
}
else
{
/* or when it failed, free the waveslot */
m_wavecache->RemoveSample(waveslot->GetSampleName(), waveslot->GetBuffer());
waveslot = NULL;
}
/* and free the original stuff (copy was made in openal) */
SND_alutUnloadWAV(sampleformat, data, numberofsamples, samplerate);
}
}
else
{
/* sample not supported, remove waveslot */
m_wavecache->RemoveSample(waveslot->GetSampleName(), waveslot->GetBuffer());
waveslot = NULL;
}
}
return waveslot;
}
// listener's and general stuff //////////////////////////////////////////////////////
/* sets the global dopplervelocity */
void SND_OpenALDevice::SetDopplerVelocity(MT_Scalar dopplervelocity) const
{
alDopplerVelocity ((float)dopplervelocity);
}
/* sets the global dopplerfactor */
void SND_OpenALDevice::SetDopplerFactor(MT_Scalar dopplerfactor) const
{
alDopplerFactor ((float)dopplerfactor);
}
/* sets the global rolloff factor */
void SND_OpenALDevice::SetListenerRollOffFactor(MT_Scalar rollofffactor) const
{
// not implemented in openal
}
void SND_OpenALDevice::NextFrame() const
{
// CD
#ifndef __APPLE__
m_cdrom->NextFrame();
#endif
// not needed by openal
}
// set the gain for the listener
void SND_OpenALDevice::SetListenerGain(float gain) const
{
alListenerf (AL_GAIN, gain);
}
void SND_OpenALDevice::InitListener()
{
// initialize the listener with these values that won't change
// (as long as we can have only one listener)
// now we can superimpose all listeners on each other (for they
// have the same settings)
float lispos[3] = {0,0,0};
float lisvel[3] = {0,0,0};
float lisori[6] = {0,0,1,0,-1,0};
alListenerfv(AL_POSITION, lispos);
alListenerfv(AL_VELOCITY, lisvel);
alListenerfv(AL_ORIENTATION, lisori);
}
// source playstate stuff ////////////////////////////////////////////////////////////
/* sets the buffer */
void SND_OpenALDevice::SetObjectBuffer(int id, unsigned int buffer)
{
alSourcei (m_sources[id], AL_BUFFER, m_buffers[buffer]);
}
// check if the sound's still playing
int SND_OpenALDevice::GetPlayState(int id)
{
int alstate = 0;
int result = 0;
#ifdef __APPLE__
alGetSourcei(m_sources[id], AL_SOURCE_STATE, &alstate);
#else
alGetSourceiv(m_sources[id], AL_SOURCE_STATE, &alstate);
#endif
switch(alstate)
{
case AL_INITIAL:
{
result = SND_INITIAL;
break;
}
case AL_PLAYING:
{
result = SND_PLAYING;
break;
}
case AL_PAUSED:
{
result = SND_PAUSED;
break;
}
case AL_STOPPED:
{
result = SND_STOPPED;
break;
}
default:
result = SND_UNKNOWN;
}
return result;
}
// make the source play
void SND_OpenALDevice::PlayObject(int id)
{
alSourcePlay(m_sources[id]);
}
// make the source stop
void SND_OpenALDevice::StopObject(int id) const
{
float obpos[3] = {0,0,0};
float obvel[3] = {0,0,0};
alSourcefv(m_sources[id], AL_POSITION, obpos);
alSourcefv(m_sources[id], AL_VELOCITY, obvel);
alSourcef(m_sources[id], AL_GAIN, 1.0);
alSourcef(m_sources[id], AL_PITCH, 1.0);
alSourcei(m_sources[id], AL_LOOPING, AL_FALSE);
alSourceStop(m_sources[id]);
}
// stop all sources
void SND_OpenALDevice::StopAllObjects()
{
alSourceStopv(NUM_SOURCES, m_sources);
}
// pause the source
void SND_OpenALDevice::PauseObject(int id) const
{
alSourcePause(m_sources[id]);
}
// source properties stuff ////////////////////////////////////////////////////////////
// give openal the object's pitch
void SND_OpenALDevice::SetObjectPitch(int id, MT_Scalar pitch) const
{
alSourcef (m_sources[id], AL_PITCH, (float)pitch);
}
// give openal the object's gain
void SND_OpenALDevice::SetObjectGain(int id, MT_Scalar gain) const
{
alSourcef (m_sources[id], AL_GAIN, (float)gain);
}
// give openal the object's looping
void SND_OpenALDevice::SetObjectLoop(int id, unsigned int loopmode) const
{
if (loopmode == SND_LOOP_OFF)
{
//printf("%d - ", id);
alSourcei (m_sources[id], AL_LOOPING, AL_FALSE);
}
else
alSourcei (m_sources[id], AL_LOOPING, AL_TRUE);
}
void SND_OpenALDevice::SetObjectLoopPoints(int id, unsigned int loopstart, unsigned int loopend) const
{
}
void SND_OpenALDevice::SetObjectMinGain(int id, MT_Scalar mingain) const
{
alSourcef (m_sources[id], AL_MIN_GAIN, (float)mingain);
}
void SND_OpenALDevice::SetObjectMaxGain(int id, MT_Scalar maxgain) const
{
alSourcef (m_sources[id], AL_MAX_GAIN, (float)maxgain);
}
void SND_OpenALDevice::SetObjectRollOffFactor(int id, MT_Scalar rollofffactor) const
{
alSourcef (m_sources[id], AL_ROLLOFF_FACTOR, (float)rollofffactor);
}
void SND_OpenALDevice::SetObjectReferenceDistance(int id, MT_Scalar referencedistance) const
{
alSourcef (m_sources[id], AL_REFERENCE_DISTANCE, (float)referencedistance);
}
// give openal the object's position
void SND_OpenALDevice::ObjectIs2D(int id) const
{
float obpos[3] = {0,0,0};
float obvel[3] = {0,0,0};
alSourcefv(m_sources[id], AL_POSITION, obpos);
alSourcefv(m_sources[id], AL_VELOCITY, obvel);
}
void SND_OpenALDevice::SetObjectTransform(int id,
const MT_Vector3& position,
const MT_Vector3& velocity,
const MT_Matrix3x3& orientation,
const MT_Vector3& lisposition,
const MT_Scalar& rollofffactor) const
{
float obpos[3];
float obvel[3];
obpos[0] = (float)position[0] * (float)rollofffactor; //x (l/r)
obpos[1] = (float)position[1] * (float)rollofffactor;
obpos[2] = (float)position[2] * (float)rollofffactor;
alSourcefv(m_sources[id], AL_POSITION, obpos);
velocity.getValue(obvel);
alSourcefv(m_sources[id], AL_VELOCITY, obvel);
}
void SND_OpenALDevice::PlayCD(int track) const
{
#ifndef __APPLE__
m_cdrom->PlayCD(track);
#endif
}
void SND_OpenALDevice::PauseCD(bool pause) const
{
#ifndef __APPLE__
m_cdrom->PauseCD(pause);
#endif
}
void SND_OpenALDevice::StopCD() const
{
#ifndef __APPLE__
SND_CDObject* pCD = SND_CDObject::Instance();
if (pCD && pCD->GetUsed())
{
m_cdrom->StopCD();
}
#endif
}
void SND_OpenALDevice::SetCDPlaymode(int playmode) const
{
#ifndef __APPLE__
m_cdrom->SetCDPlaymode(playmode);
#endif
}
void SND_OpenALDevice::SetCDGain(MT_Scalar gain) const
{
#ifndef __APPLE__
m_cdrom->SetCDGain(gain);
#endif
}

View File

@@ -0,0 +1,107 @@
/**
* $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 *****
*/
#ifndef SND_OPENALDEVICE
#define SND_OPENALDEVICE
#include "SND_AudioDevice.h"
#include "SoundDefines.h"
struct SDL_CD;
class SND_OpenALDevice : public SND_AudioDevice
{
public:
SND_OpenALDevice();
virtual ~SND_OpenALDevice();
SND_WaveSlot* LoadSample(const STR_String& samplename,
void* memlocation,
int size);
void InitListener();
void SetListenerGain(float gain) const;
void SetDopplerVelocity(MT_Scalar dopplervelocity) const;
void SetDopplerFactor(MT_Scalar dopplerfactor) const;
void SetListenerRollOffFactor(MT_Scalar rollofffactor) const;
void MakeCurrent() const;
void NextFrame() const;
void UseCD() const;
void SetObjectBuffer(int id, unsigned int buffer);
int GetPlayState(int id);
void PlayObject(int id);
void StopObject(int id) const;
void StopAllObjects();
void PauseObject(int id) const;
void SetObjectLoop(int id, unsigned int loopmode) const;
void SetObjectLoopPoints(int id, unsigned int loopstart, unsigned int loopend) const;
void SetObjectPitch(int id, MT_Scalar pitch) const;
void SetObjectGain(int id, MT_Scalar gain) const;
void SetObjectMinGain(int id, MT_Scalar mingain) const;
void SetObjectMaxGain(int id, MT_Scalar maxgain) const;
void SetObjectRollOffFactor(int id, MT_Scalar rolloff) const;
void SetObjectReferenceDistance(int id, MT_Scalar distance) const;
void SetObjectTransform(int id,
const MT_Vector3& position,
const MT_Vector3& velocity,
const MT_Matrix3x3& orientation,
const MT_Vector3& lisposition,
const MT_Scalar& rollofffactor) const;
void ObjectIs2D(int id) const;
void PlayCD(int track) const;
void PauseCD(bool pause) const;
void StopCD() const;
void SetCDPlaymode(int playmode) const;
void SetCDGain(MT_Scalar gain) const;
void StartUsingDSP() {};
float* GetSpectrum() { return NULL; }
void StopUsingDSP() {};
private:
void* m_context;
void* m_device;
unsigned int m_buffers[NUM_BUFFERS];
unsigned int m_sources[NUM_SOURCES];
bool m_buffersinitialized;
bool m_sourcesinitialized;
#ifndef __APPLE__
class SND_SDLCDDevice* m_cdrom;
#endif
};
#endif //SND_OPENALDEVICE

View File

@@ -0,0 +1,67 @@
/* $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 *****
* FreeBSD 3.4 does not yet have pthread_cancel (3.5 and above do)
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifdef __FreeBSD__
#include <osreldate.h>
#if (__FreeBSD_version < 350000)
#include <pthread.h>
#define FD_READ 0x1
#define _FD_LOCK(_fd,_type,_ts) _thread_fd_lock(_fd, _type, _ts)
#define _FD_UNLOCK(_fd,_type) _thread_fd_unlock(_fd, _type)
int pthread_cancel(pthread_t pthread) {
pthread_exit(NULL);
return 0;
}
long fpathconf(int fd, int name)
{
long ret;
if ((ret = _FD_LOCK(fd, FD_READ, NULL)) == 0) {
ret = _thread_sys_fpathconf(fd, name);
_FD_UNLOCK(fd, FD_READ);
}
return ret;
}
#endif
int pthread_atfork(void *a, void *b, void *c) {
return 0;
}
#endif

View File

@@ -28,17 +28,16 @@
#
#
LIBNAME = aud_src
DIR = $(OCGDIR)/intern/audaspace
LIBNAME = SDLSoundSystem
DIR = $(OCGDIR)/intern/$(LIBNAME)
include nan_compile.mk
CCFLAGS += $(LEVEL_1_CPP_WARNINGS)
CPPFLAGS += -I$(LCGDIR)/samplerate/include/
CPPFLAGS += -I../ffmpeg
CPPFLAGS += -I../FX
CPPFLAGS += -I../SDL
CPPFLAGS += $(NAN_SDLCFLAGS)
CPPFLAGS += -I$(NAN_STRING)/include
CPPFLAGS += -I$(NAN_MOTO)/include
CPPFLAGS += -I../intern
CPPFLAGS += -I..
CPPFLAGS += -I.

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