Merge from trunk -r 22040:23000.

This commit is contained in:
Arystanbek Dyussenov 2009-10-19 16:20:12 +00:00
parent 4fd7eb1c2d
commit a1af978b1c
1214 changed files with 92715 additions and 47341 deletions

@ -42,11 +42,28 @@ MACRO(SETUP_LIBDIRS)
if(COMMAND cmake_policy) if(COMMAND cmake_policy)
CMAKE_POLICY(SET CMP0003 NEW) CMAKE_POLICY(SET CMP0003 NEW)
endif(COMMAND cmake_policy) endif(COMMAND cmake_policy)
LINK_DIRECTORIES(${PYTHON_LIBPATH} ${SDL_LIBPATH} ${JPEG_LIBPATH} ${PNG_LIBPATH} ${ZLIB_LIBPATH} ${ICONV_LIBPATH} ${OPENEXR_LIBPATH} ${QUICKTIME_LIBPATH} ${FFMPEG_LIBPATH})
LINK_DIRECTORIES(${FREETYPE_LIBPATH}) LINK_DIRECTORIES(${JPEG_LIBPATH} ${PNG_LIBPATH} ${ZLIB_LIBPATH} ${FREETYPE_LIBPATH} ${LIBSAMPLERATE_LIBPATH})
IF(WITH_PYTHON)
LINK_DIRECTORIES(${PYTHON_LIBPATH})
ENDIF(WITH_PYTHON)
IF(WITH_INTERNATIONAL) IF(WITH_INTERNATIONAL)
LINK_DIRECTORIES(${ICONV_LIBPATH})
LINK_DIRECTORIES(${GETTEXT_LIBPATH}) LINK_DIRECTORIES(${GETTEXT_LIBPATH})
ENDIF(WITH_INTERNATIONAL) 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) IF(WITH_OPENAL)
LINK_DIRECTORIES(${OPENAL_LIBPATH}) LINK_DIRECTORIES(${OPENAL_LIBPATH})
ENDIF(WITH_OPENAL) ENDIF(WITH_OPENAL)
@ -55,6 +72,15 @@ MACRO(SETUP_LIBDIRS)
LINK_DIRECTORIES(${PCRE_LIBPATH}) LINK_DIRECTORIES(${PCRE_LIBPATH})
LINK_DIRECTORIES(${EXPAT_LIBPATH}) LINK_DIRECTORIES(${EXPAT_LIBPATH})
ENDIF(WITH_OPENCOLLADA) ENDIF(WITH_OPENCOLLADA)
IF(WITH_JACK)
LINK_DIRECTORIES(${JACK_LIBPATH})
ENDIF(WITH_JACK)
IF(WITH_SNDFILE)
LINK_DIRECTORIES(${SNDFILE_LIBPATH})
ENDIF(WITH_SNDFILE)
IF(WITH_FFTW3)
LINK_DIRECTORIES(${FFTW3_LIBPATH})
ENDIF(WITH_FFTW3)
IF(WIN32) IF(WIN32)
LINK_DIRECTORIES(${PTHREADS_LIBPATH}) LINK_DIRECTORIES(${PTHREADS_LIBPATH})
@ -64,48 +90,48 @@ ENDMACRO(SETUP_LIBDIRS)
MACRO(SETUP_LIBLINKS MACRO(SETUP_LIBLINKS
target) target)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS} ") SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS} ")
#TARGET_LINK_LIBRARIES(${target} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${PYTHON_LIB} ${PYTHON_LINKFLAGS} ${JPEG_LIB} ${PNG_LIB} ${ZLIB_LIB} ${SDL_LIB} ${LLIBS}) #TARGET_LINK_LIBRARIES(${target} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${PYTHON_LIB} ${PYTHON_LINKFLAGS} ${JPEG_LIB} ${PNG_LIB} ${ZLIB_LIB} ${SDL_LIBRARY} ${LLIBS})
TARGET_LINK_LIBRARIES(${target} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${PYTHON_LINKFLAGS} ${JPEG_LIBRARY} ${PNG_LIBRARIES} ${ZLIB_LIBRARIES} ${SDL_LIB} ${LLIBS}) TARGET_LINK_LIBRARIES(${target} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${PYTHON_LINKFLAGS} ${JPEG_LIBRARY} ${PNG_LIBRARIES} ${ZLIB_LIBRARIES} ${LLIBS})
# since we are using the local libs for python when compiling msvc projects, we need to add _d when compiling debug versions # since we are using the local libs for python when compiling msvc projects, we need to add _d when compiling debug versions
IF(WIN32) IF(WIN32)
TARGET_LINK_LIBRARIES(${target} debug ${PYTHON_LIB}_d)
TARGET_LINK_LIBRARIES(${target} debug ${PYTHON_LIB}_d) TARGET_LINK_LIBRARIES(${target} optimized ${PYTHON_LIB})
TARGET_LINK_LIBRARIES(${target} optimized ${PYTHON_LIB})
ELSE(WIN32) ELSE(WIN32)
TARGET_LINK_LIBRARIES(${target} ${PYTHON_LIB})
TARGET_LINK_LIBRARIES(${target} ${PYTHON_LIB})
ENDIF(WIN32) 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} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${PYTHON_LINKFLAGS} ${JPEG_LIB} ${PNG_LIB} ${ZLIB_LIB} ${SDL_LIB} ${LLIBS}) TARGET_LINK_LIBRARIES(${target} ${FREETYPE_LIBRARY} ${LIBSAMPLERATE_LIB})
TARGET_LINK_LIBRARIES(${target} ${FREETYPE_LIB})
# since we are using the local libs for python when compiling msvc projects, we need to add _d when compiling debug versions # since we are using the local libs for python when compiling msvc projects, we need to add _d when compiling debug versions
IF(WIN32) IF(WIN32)
TARGET_LINK_LIBRARIES(${target} debug ${PYTHON_LIB}_d)
TARGET_LINK_LIBRARIES(${target} debug ${PYTHON_LIB}_d) TARGET_LINK_LIBRARIES(${target} optimized ${PYTHON_LIB})
ELSE(WIN32)
TARGET_LINK_LIBRARIES(${target} optimized ${PYTHON_LIB}) TARGET_LINK_LIBRARIES(${target} ${PYTHON_LIB})
ELSE(WIN32)
TARGET_LINK_LIBRARIES(${target} ${PYTHON_LIB})
ENDIF(WIN32) ENDIF(WIN32)
IF(WITH_INTERNATIONAL) IF(WITH_INTERNATIONAL)
TARGET_LINK_LIBRARIES(${target} ${GETTEXT_LIB}) TARGET_LINK_LIBRARIES(${target} ${GETTEXT_LIB})
ENDIF(WITH_INTERNATIONAL) ENDIF(WITH_INTERNATIONAL)
IF(WITH_OPENAL) IF(WITH_OPENAL)
TARGET_LINK_LIBRARIES(${target} ${OPENAL_LIB}) TARGET_LINK_LIBRARIES(${target} ${OPENAL_LIBRARY})
ENDIF(WITH_OPENAL) 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) IF(WIN32)
TARGET_LINK_LIBRARIES(${target} ${ICONV_LIB}) TARGET_LINK_LIBRARIES(${target} ${ICONV_LIB})
ENDIF(WIN32) ENDIF(WIN32)
@ -127,3 +153,4 @@ MACRO(SETUP_LIBLINKS
TARGET_LINK_LIBRARIES(${target} ${PTHREADS_LIB}) TARGET_LINK_LIBRARIES(${target} ${PTHREADS_LIB})
ENDIF(WIN32) ENDIF(WIN32)
ENDMACRO(SETUP_LIBLINKS) ENDMACRO(SETUP_LIBLINKS)

@ -53,21 +53,27 @@ SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib)
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Set default config options # Set default config options
OPTION(WITH_PLAYER "Build Player" OFF) OPTION(WITH_PLAYER "Build Player" OFF)
OPTION(WITH_GAMEENGINE "Enable Game Engine" ON) OPTION(WITH_GAMEENGINE "Enable Game Engine" ON)
OPTION(WITH_BULLET "Enable Bullet (Physics Engine)" ON) OPTION(WITH_BULLET "Enable Bullet (Physics Engine)" ON)
OPTION(WITH_INTERNATIONAL "Enable I18N (International fonts and text)" ON) OPTION(WITH_INTERNATIONAL "Enable I18N (International fonts and text)" ON)
OPTION(WITH_ELBEEM "Enable Elbeem (Fluid Simulation)" ON) OPTION(WITH_ELBEEM "Enable Elbeem (Fluid Simulation)" ON)
OPTION(WITH_QUICKTIME "Enable Quicktime Support" OFF) OPTION(WITH_QUICKTIME "Enable Quicktime Support" OFF)
OPTION(WITH_OPENEXR "Enable OpenEXR Support (http://www.openexr.com)" ON) OPTION(WITH_OPENEXR "Enable OpenEXR Support (http://www.openexr.com)" ON)
OPTION(WITH_DDS "Enable DDS Support" ON) OPTION(WITH_DDS "Enable DDS Support" ON)
OPTION(WITH_FFMPEG "Enable FFMPeg Support (http://ffmpeg.mplayerhq.hu/)" OFF) OPTION(WITH_FFMPEG "Enable FFMPeg Support (http://ffmpeg.mplayerhq.hu/)" OFF)
OPTION(WITH_PYTHON "Enable Embedded Python API" ON) OPTION(WITH_PYTHON "Enable Embedded Python API" ON)
OPTION(WITH_SDL "Enable SDL for sound and joystick support" 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_OPENJPEG "Enable OpenJpeg Support (http://www.openjpeg.org/)" OFF)
OPTION(WITH_OPENAL "Enable OpenAL Support (http://www.openal.org)" ON) 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_OPENMP "Enable OpenMP (has to be supported by the compiler)" OFF)
OPTION(WITH_WEBPLUGIN "Enable Web Plugin (Unix only)" 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_OPENCOLLADA "Enable OpenCollada Support (http://www.opencollada.org/)" OFF) OPTION(WITH_OPENCOLLADA "Enable OpenCollada Support (http://www.opencollada.org/)" OFF)
IF(NOT WITH_GAMEENGINE AND WITH_PLAYER) IF(NOT WITH_GAMEENGINE AND WITH_PLAYER)
@ -94,13 +100,25 @@ IF(UNIX AND NOT APPLE)
FIND_PACKAGE(OpenAL) FIND_PACKAGE(OpenAL)
IF(OPENAL_FOUND) IF(OPENAL_FOUND)
SET(WITH_OPENAL ON) SET(WITH_OPENAL ON)
SET(OPENAL_LIB ${OPENAL_LIBRARY})
SET(OPENAL_INC ${OPENAL_INCLUDE_DIR})
ELSE(OPENAL_FOUND) ELSE(OPENAL_FOUND)
SET(WITH_OPENAL OFF) SET(WITH_OPENAL OFF)
ENDIF(OPENAL_FOUND) ENDIF(OPENAL_FOUND)
ENDIF(WITH_OPENAL) 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)
FIND_LIBRARY(INTL_LIBRARY FIND_LIBRARY(INTL_LIBRARY
NAMES intl NAMES intl
PATHS PATHS
@ -111,34 +129,34 @@ IF(UNIX AND NOT APPLE)
PATHS PATHS
/sw/lib /sw/lib
) )
IF(INTL_LIBRARY AND ICONV_LIBRARY) IF(INTL_LIBRARY AND ICONV_LIBRARY)
SET(GETTEXT_LIB ${INTL_LIBRARY} ${ICONV_LIBRARY}) SET(GETTEXT_LIB ${INTL_LIBRARY} ${ICONV_LIBRARY})
ENDIF(INTL_LIBRARY AND ICONV_LIBRARY) ENDIF(INTL_LIBRARY AND ICONV_LIBRARY)
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_PACKAGE(PythonLibs) FIND_PACKAGE(Freetype)
SET(PYTHON_INC "${PYTHON_INCLUDE_PATH}" CACHE STRING "") # UNSET(FREETYPE_INCLUDE_DIRS CACHE) # cant use
SET(PYTHON_LIB "${PYTHON_LIBRARIES}" CACHE STRING "")
FIND_PACKAGE(PythonInterp) # No way to set py31. remove for now.
SET(PYTHON_BINARY ${PYTHON_EXECUTABLE} CACHE STRING "") # 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") SET(PYTHON_LINKFLAGS "-Xlinker -export-dynamic")
IF(WITH_SDL) IF(WITH_SDL)
FIND_PACKAGE(SDL) FIND_PACKAGE(SDL)
SET(SDL_INC ${SDL_INCLUDE_DIR}) # UNSET(SDLMAIN_LIBRARY CACHE)
SET(SDL_LIB ${SDL_LIBRARY}) IF(NOT SDL_FOUND)
SET(WITH_SDL OFF)
ENDIF(NOT SDL_FOUND)
ENDIF(WITH_SDL) ENDIF(WITH_SDL)
IF(WITH_OPENCOLLADA) IF(WITH_OPENCOLLADA)
@ -170,6 +188,18 @@ IF(UNIX AND NOT APPLE)
SET(FFMPEG_INC ${FFMPEG}/include) SET(FFMPEG_INC ${FFMPEG}/include)
SET(FFMPEG_LIB avformat avcodec avutil avdevice swscale) SET(FFMPEG_LIB avformat avcodec avutil avdevice swscale)
SET(FFMPEG_LIBPATH ${FFMPEG}/lib) 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(LIBSAMPLERATE /usr)
SET(LIBSAMPLERATE_INC ${LIBSAMPLERATE}/include)
SET(LIBSAMPLERATE_LIB samplerate)
SET(LIBSAMPLERATE_LIBPATH ${LIBSAMPLERATE}/lib)
FIND_PACKAGE(JPEG REQUIRED) FIND_PACKAGE(JPEG REQUIRED)
@ -177,7 +207,13 @@ IF(UNIX AND NOT APPLE)
FIND_PACKAGE(ZLIB REQUIRED) FIND_PACKAGE(ZLIB REQUIRED)
SET(LLIBS "-lXi -lutil -lc -lm -lpthread -lstdc++ -lX11 -ldl") # 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) IF(WITH_OPENMP)
SET(LLIBS "${LLIBS} -lgomp") SET(LLIBS "${LLIBS} -lgomp")
@ -191,7 +227,8 @@ IF(UNIX AND NOT APPLE)
SET(PLATFORM_LINKFLAGS "-pthread") SET(PLATFORM_LINKFLAGS "-pthread")
# Better warnings # Better warnings
SET(C_WARNINGS "-Wall -Wno-char-subscripts -Wpointer-arith -Wcast-align -Wnested-externs -Wdeclaration-after-statement") SET(C_WARNINGS "-Wall -Wno-char-subscripts -Wpointer-arith -Wcast-align -Wdeclaration-after-statement")
SET(CXX_WARNINGS "-Wall -Wno-invalid-offsetof -Wno-sign-compare")
INCLUDE_DIRECTORIES(${JPEG_INCLUDE_DIR} ${PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} ) INCLUDE_DIRECTORIES(${JPEG_INCLUDE_DIR} ${PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} )
ENDIF(UNIX AND NOT APPLE) ENDIF(UNIX AND NOT APPLE)
@ -210,10 +247,10 @@ IF(WIN32)
ENDIF(CMAKE_CL_64) ENDIF(CMAKE_CL_64)
SET(PYTHON ${LIBDIR}/python) SET(PYTHON ${LIBDIR}/python)
SET(PYTHON_VERSION 2.6) SET(PYTHON_VERSION 3.1)
SET(PYTHON_INC "${PYTHON}/include/python${PYTHON_VERSION}") SET(PYTHON_INC "${PYTHON}/include/python${PYTHON_VERSION}")
SET(PYTHON_BINARY python) # SET(PYTHON_BINARY python) # not used yet
SET(PYTHON_LIB python26) SET(PYTHON_LIB python31)
SET(PYTHON_LIBPATH ${PYTHON}/lib) SET(PYTHON_LIBPATH ${PYTHON}/lib)
IF(CMAKE_CL_64) IF(CMAKE_CL_64)
@ -221,13 +258,27 @@ IF(WIN32)
ELSE(CMAKE_CL_64) ELSE(CMAKE_CL_64)
#SET(WITH_OPENAL ON) #SET(WITH_OPENAL ON)
SET(OPENAL ${LIBDIR}/openal) SET(OPENAL ${LIBDIR}/openal)
SET(OPENAL_INC ${OPENAL}/include ${OPENAL}/include/AL) SET(OPENAL_INCLUDE_DIR ${OPENAL}/include)
SET(OPENAL_LIB openal_static) SET(OPENAL_LIBRARY wrap_oal)
SET(OPENAL_LIBPATH ${OPENAL}/lib) SET(OPENAL_LIBPATH ${OPENAL}/lib)
ENDIF(CMAKE_CL_64) 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)
IF(WITH_SNDFILE)
SET(SNDFILE ${LIBDIR}/sndfile)
SET(SNDFILE_INC ${SNDFILE}/include)
SET(SNDFILE_LIB libsndfile-1)
SET(SNDFILE_LIBPATH ${SNDFILE}/lib)
ENDIF(WITH_SNDFILE)
IF(CMAKE_CL_64) IF(CMAKE_CL_64)
SET(PNG_LIBRARIES libpng) SET(PNG_LIBRARIES libpng)
ELSE(CMAKE_CL_64) ELSE(CMAKE_CL_64)
SET(PNG_LIBRARIES libpng_st) SET(PNG_LIBRARIES libpng_st)
ENDIF(CMAKE_CL_64) ENDIF(CMAKE_CL_64)
@ -235,7 +286,11 @@ IF(WIN32)
SET(ZLIB ${LIBDIR}/zlib) SET(ZLIB ${LIBDIR}/zlib)
SET(ZLIB_INC ${ZLIB}/include) SET(ZLIB_INC ${ZLIB}/include)
SET(ZLIB_LIBRARIES zlib) 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(ZLIB_LIBPATH ${ZLIB}/lib)
SET(PTHREADS ${LIBDIR}/pthreads) SET(PTHREADS ${LIBDIR}/pthreads)
@ -248,30 +303,37 @@ IF(WIN32)
SET(ICONV_LIB iconv) SET(ICONV_LIB iconv)
SET(ICONV_LIBPATH ${ICONV}/lib) 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 ${LIBDIR}/gettext)
SET(GETTEXT_INC ${GETTEXT}/include) SET(GETTEXT_INC ${GETTEXT}/include)
IF(CMAKE_CL_64) IF(CMAKE_CL_64)
SET(GETTEXT_LIB gettextlib) SET(GETTEXT_LIB gettext)
ELSE(CMAKE_CL_64) ELSE(CMAKE_CL_64)
SET(GETTEXT_LIB gnu_gettext) SET(GETTEXT_LIB gnu_gettext)
ENDIF(CMAKE_CL_64) ENDIF(CMAKE_CL_64)
SET(GETTEXT_LIBPATH ${GETTEXT}/lib) SET(GETTEXT_LIBPATH ${GETTEXT}/lib)
SET(FREETYPE ${LIBDIR}/freetype) SET(FREETYPE ${LIBDIR}/freetype)
SET(FREETYPE_INC ${FREETYPE}/include ${FREETYPE}/include/freetype2) SET(FREETYPE_INCLUDE_DIRS ${FREETYPE}/include ${FREETYPE}/include/freetype2)
SET(FREETYPE_LIBPATH ${FREETYPE}/lib) SET(FREETYPE_LIBPATH ${FREETYPE}/lib)
SET(FREETYPE_LIB freetype2ST) SET(FREETYPE_LIBRARY freetype2ST)
SET(OPENEXR ${LIBDIR}/openexr) SET(OPENEXR ${LIBDIR}/openexr)
SET(OPENEXR_INC ${OPENEXR}/include ${OPENEXR}/include/IlmImf ${OPENEXR}/include/Iex ${OPENEXR}/include/Imath) SET(OPENEXR_INC ${OPENEXR}/include ${OPENEXR}/include/IlmImf ${OPENEXR}/include/Iex ${OPENEXR}/include/Imath)
SET(OPENEXR_LIB Iex Half IlmImf Imath IlmThread) SET(OPENEXR_LIB Iex Half IlmImf Imath IlmThread)
IF (MSVC80) IF (MSVC80)
SET(OPENEXR_LIBPATH ${OPENEXR}/lib_vs2005) SET(OPENEXR_LIBPATH ${OPENEXR}/lib_vs2005)
ELSE (MSVC80) ELSE (MSVC80)
SET(OPENEXR_LIBPATH ${OPENEXR}/lib_msvc) SET(OPENEXR_LIBPATH ${OPENEXR}/lib_msvc)
ENDIF(MSVC80) ENDIF(MSVC80)
IF (MSVC90) IF (MSVC90)
SET(OPENEXR_LIBPATH ${OPENEXR}/lib_vs2008) SET(OPENEXR_LIBPATH ${OPENEXR}/lib_vs2008)
ENDIF(MSVC90) ENDIF(MSVC90)
@ -281,19 +343,20 @@ IF(WIN32)
SET(QUICKTIME_LIBPATH ${QUICKTIME}/Libraries) SET(QUICKTIME_LIBPATH ${QUICKTIME}/Libraries)
SET(FFMPEG ${LIBDIR}/ffmpeg) SET(FFMPEG ${LIBDIR}/ffmpeg)
SET(FFMPEG_INC ${FFMPEG}/include) SET(FFMPEG_INC ${FFMPEG}/include ${FFMPEG}/include/msvc)
SET(FFMPEG_LIB avcodec-52 avformat-52 avdevice-52 avutil-50 swscale-0) SET(FFMPEG_LIB avcodec-52 avformat-52 avdevice-52 avutil-50 swscale-0)
SET(FFMPEG_LIBPATH ${FFMPEG}/lib) SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
SET(LIBSAMPLERATE ${LIBDIR}/samplerate)
SET(LIBSAMPLERATE_INC ${LIBSAMPLERATE}/include)
SET(LIBSAMPLERATE_LIB libsamplerate)
SET(LIBSAMPLERATE_LIBPATH ${LIBSAMPLERATE}/lib)
IF(CMAKE_CL_64) IF(CMAKE_CL_64)
SET(LLIBS kernel32 user32 vfw32 winmm ws2_32 ) SET(LLIBS kernel32 user32 vfw32 winmm ws2_32 )
ELSE(CMAKE_CL_64) ELSE(CMAKE_CL_64)
SET(LLIBS kernel32 user32 gdi32 comdlg32 advapi32 shell32 ole32 oleaut32 uuid ws2_32 vfw32 winmm) SET(LLIBS kernel32 user32 gdi32 comdlg32 advapi32 shell32 ole32 oleaut32 uuid ws2_32 vfw32 winmm)
ENDIF(CMAKE_CL_64) ENDIF(CMAKE_CL_64)
IF(WITH_OPENAL)
SET(LLIBS ${LLIBS} dxguid)
ENDIF(WITH_OPENAL)
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_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_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)
@ -310,8 +373,8 @@ IF(WIN32)
ENDIF(WITH_OPENMP) ENDIF(WITH_OPENMP)
SET(SDL ${LIBDIR}/sdl) SET(SDL ${LIBDIR}/sdl)
SET(SDL_INC ${SDL}/include) SET(SDL_INCLUDE_DIR ${SDL}/include)
SET(SDL_LIB SDL) SET(SDL_LIBRARY SDL)
SET(SDL_LIBPATH ${SDL}/lib) SET(SDL_LIBPATH ${SDL}/lib)
SET(PNG "${LIBDIR}/png") SET(PNG "${LIBDIR}/png")
@ -328,10 +391,11 @@ IF(WIN32)
SET(WINTAB_INC ${LIBDIR}/wintab/include) SET(WINTAB_INC ${LIBDIR}/wintab/include)
IF(CMAKE_CL_64) IF(CMAKE_CL_64)
SET(PLATFORM_LINKFLAGS "/MANIFEST:NO /MANIFESTUAC:NO /MACHINE:X64 /NODEFAULTLIB:libc.lib;MSVCRT.lib ") SET(PLATFORM_LINKFLAGS "/MACHINE:X64 /NODEFAULTLIB:libc.lib;MSVCRT.lib ")
ELSE(CMAKE_CL_64) ELSE(CMAKE_CL_64)
SET(PLATFORM_LINKFLAGS "/NODEFAULTLIB:libc.lib ") SET(PLATFORM_LINKFLAGS "/NODEFAULTLIB:libc.lib ")
ENDIF(CMAKE_CL_64) ENDIF(CMAKE_CL_64)
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:libcmt.lib;libc.lib ") SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:libcmt.lib;libc.lib ")
ENDIF(WIN32) ENDIF(WIN32)
@ -346,13 +410,24 @@ IF(APPLE)
FIND_PACKAGE(OpenAL) FIND_PACKAGE(OpenAL)
IF(OPENAL_FOUND) IF(OPENAL_FOUND)
SET(WITH_OPENAL ON) SET(WITH_OPENAL ON)
SET(OPENAL_LIB ${OPENAL_LIBRARY})
SET(OPENAL_INC ${OPENAL_INCLUDE_DIR})
ELSE(OPENAL_FOUND) ELSE(OPENAL_FOUND)
SET(WITH_OPENAL OFF) SET(WITH_OPENAL OFF)
ENDIF(OPENAL_FOUND) ENDIF(OPENAL_FOUND)
ENDIF(WITH_OPENAL) 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)
@ -361,7 +436,7 @@ IF(APPLE)
SET(PYTHON ${LIBDIR}/python) SET(PYTHON ${LIBDIR}/python)
SET(PYTHON_INC "${PYTHON}/include/python${PYTHON_VERSION}" CACHE STRING "") SET(PYTHON_INC "${PYTHON}/include/python${PYTHON_VERSION}" CACHE STRING "")
SET(PYTHON_BINARY "${PYTHON}/bin/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_LIB python${PYTHON_VERSION})
SET(PYTHON_LIBPATH "${PYTHON}/lib/python${PYTHON_VERSION}" CACHE STRING "") SET(PYTHON_LIBPATH "${PYTHON}/lib/python${PYTHON_VERSION}" CACHE STRING "")
# SET(PYTHON_LINKFLAGS "-u _PyMac_Error") # won't build with this enabled # SET(PYTHON_LINKFLAGS "-u _PyMac_Error") # won't build with this enabled
@ -371,7 +446,7 @@ IF(APPLE)
SET(PYTHON /System/Library/Frameworks/Python.framework/Versions/) SET(PYTHON /System/Library/Frameworks/Python.framework/Versions/)
SET(PYTHON_VERSION 2.5) SET(PYTHON_VERSION 2.5)
SET(PYTHON_INC "${PYTHON}${PYTHON_VERSION}/include/python${PYTHON_VERSION}" CACHE STRING "") 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_BINARY ${PYTHON}${PYTHON_VERSION}/bin/python${PYTHON_VERSION} CACHE STRING "") # not used yet
SET(PYTHON_LIB "") SET(PYTHON_LIB "")
SET(PYTHON_LIBPATH ${PYTHON}${PYTHON_VERSION}/lib/python${PYTHON_VERSION}/config CACHE STRING "") SET(PYTHON_LIBPATH ${PYTHON}${PYTHON_VERSION}/lib/python${PYTHON_VERSION}/config CACHE STRING "")
SET(PYTHON_LINKFLAGS "-u _PyMac_Error -framework System -framework Python") SET(PYTHON_LINKFLAGS "-u _PyMac_Error -framework System -framework Python")
@ -381,6 +456,13 @@ IF(APPLE)
SET(GETTEXT_INC "${GETTEXT}/include") SET(GETTEXT_INC "${GETTEXT}/include")
SET(GETTEXT_LIB intl iconv) SET(GETTEXT_LIB intl iconv)
SET(GETTEXT_LIBPATH ${GETTEXT}/lib) SET(GETTEXT_LIBPATH ${GETTEXT}/lib)
IF(WITH_FFTW3)
SET(FFTW3 ${LIBDIR}/fftw3)
SET(FFTW3_INC ${FFTW3}/include)
SET(FFTW3_LIB libfftw)
SET(FFTW3_LIBPATH ${FFTW3}/lib)
ENDIF(WITH_FFTW3)
SET(PNG_LIBRARIES png) SET(PNG_LIBRARIES png)
SET(JPEG_LIBRARY jpeg) SET(JPEG_LIBRARY jpeg)
@ -390,19 +472,25 @@ IF(APPLE)
SET(ZLIB_LIBRARIES z) SET(ZLIB_LIBRARIES z)
SET(FREETYPE ${LIBDIR}/freetype) SET(FREETYPE ${LIBDIR}/freetype)
SET(FREETYPE_INC ${FREETYPE}/include ${FREETYPE}/include/freetype2) SET(FREETYPE_INCLUDE_DIRS ${FREETYPE}/include ${FREETYPE}/include/freetype2)
SET(FREETYPE_LIBPATH ${FREETYPE}/lib) SET(FREETYPE_LIBPATH ${FREETYPE}/lib)
SET(FREETYPE_LIB freetype) SET(FREETYPE_LIBRARY freetype)
SET(OPENEXR ${LIBDIR}/openexr) SET(OPENEXR ${LIBDIR}/openexr)
SET(OPENEXR_INC ${OPENEXR}/include/OpenEXR ${OPENEXR}/include) SET(OPENEXR_INC ${OPENEXR}/include/OpenEXR ${OPENEXR}/include)
IF(CMAKE_OSX_ARCHITECTURES MATCHES i386) SET(OPENEXR_LIB Iex Half IlmImf Imath IlmThread)
SET(OPENEXR_LIB Iex Half IlmImf Imath IlmThread)
ELSE(CMAKE_OSX_ARCHITECTURES MATCHES i386)
SET(OPENEXR_LIB Iex Half IlmImf Imath)
ENDIF(CMAKE_OSX_ARCHITECTURES MATCHES i386)
SET(OPENEXR_LIBPATH ${OPENEXR}/lib) SET(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(LIBSAMPLERATE ${LIBDIR}/samplerate)
SET(LIBSAMPLERATE_INC ${LIBSAMPLERATE}/include)
SET(LIBSAMPLERATE_LIB samplerate)
SET(LIBSAMPLERATE_LIBPATH ${LIBSAMPLERATE}/lib)
SET(LLIBS stdc++ SystemStubs) SET(LLIBS stdc++ SystemStubs)
SET(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing") SET(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing")
@ -415,8 +503,8 @@ IF(APPLE)
ENDIF(WITH_OPENMP) ENDIF(WITH_OPENMP)
SET(SDL ${LIBDIR}/sdl) SET(SDL ${LIBDIR}/sdl)
SET(SDL_INC ${SDL}/include) SET(SDL_INCLUDE_DIR ${SDL}/include)
SET(SDL_LIB SDL) SET(SDL_LIBRARY SDL)
SET(SDL_LIBPATH ${SDL}/lib) SET(SDL_LIBPATH ${SDL}/lib)
SET(PNG "${LIBDIR}/png") SET(PNG "${LIBDIR}/png")
@ -438,6 +526,17 @@ IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
SET(BINRELOC_INC ${BINRELOC}/include) SET(BINRELOC_INC ${BINRELOC}/include)
ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux") 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. # Common.
@ -460,16 +559,18 @@ ENDIF(WITH_WEBPLUGIN)
# Configure OpenGL. # Configure OpenGL.
FIND_PACKAGE(OpenGL) FIND_PACKAGE(OpenGL)
INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR}) 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 # 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_C_FLAGS "${CMAKE_C_FLAGS} ${PLATFORM_CFLAGS} ${C_WARNINGS}")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${PLATFORM_CFLAGS} ") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${PLATFORM_CFLAGS} ${CXX_WARNINGS}")
# better not define flags here but this is a debugging option thats off by default.
IF(WITH_CXX_GUARDEDALLOC)
SET(CMAKE_CXX_FLAGS " -DWITH_CXX_GUARDEDALLOC -I${CMAKE_SOURCE_DIR}/intern/guardedalloc ${CMAKE_CXX_FLAGS}")
ENDIF(WITH_CXX_GUARDEDALLOC)
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Libraries # Libraries
@ -487,5 +588,6 @@ ADD_SUBDIRECTORY(source/creator)
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Blender Player # Blender Player
IF(WITH_PLAYER) IF(WITH_PLAYER)
ADD_SUBDIRECTORY(blenderplayer) ADD_SUBDIRECTORY(source/blenderplayer)
ENDIF(WITH_PLAYER) ENDIF(WITH_PLAYER)

@ -31,6 +31,7 @@
import platform as pltfrm import platform as pltfrm
# Need a better way to do this. Automagical maybe is not the best thing, maybe it is.
if pltfrm.architecture()[0] == '64bit': if pltfrm.architecture()[0] == '64bit':
bitness = 64 bitness = 64
else: else:
@ -59,7 +60,6 @@ B = tools.Blender
platform = sys.platform platform = sys.platform
quickie = None quickie = None
quickdebug = None quickdebug = None
nsis_build = None
##### BEGIN SETUP ##### ##### BEGIN SETUP #####
@ -207,7 +207,6 @@ if env['WITH_BF_OPENMP'] == 1:
env.Append(CCFLAGS=['-fopenmp']) env.Append(CCFLAGS=['-fopenmp'])
env.Append(CPPFLAGS=['-fopenmp']) env.Append(CPPFLAGS=['-fopenmp'])
env.Append(CXXFLAGS=['-fopenmp']) env.Append(CXXFLAGS=['-fopenmp'])
# env.Append(LINKFLAGS=['-fprofile-generate'])
#check for additional debug libnames #check for additional debug libnames
@ -301,7 +300,6 @@ if env['WITH_BF_SDL'] == False and env['OURPLATFORM'] in ('win32-vc', 'win32-min
env['PLATFORM_LINKFLAGS'].append('/ENTRY:main') env['PLATFORM_LINKFLAGS'].append('/ENTRY:main')
# lastly we check for root_build_dir ( we should not do before, otherwise we might do wrong builddir # 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.root_build_dir = env['BF_BUILDDIR']
B.doc_build_dir = env['BF_DOCDIR'] B.doc_build_dir = env['BF_DOCDIR']
if not B.root_build_dir[-1]==os.sep: if not B.root_build_dir[-1]==os.sep:
@ -392,7 +390,7 @@ SConscript(B.root_build_dir+'/source/SConscript')
# libraries to give as objects to linking phase # libraries to give as objects to linking phase
mainlist = [] mainlist = []
for tp in B.possible_types: for tp in B.possible_types:
if not tp == 'player' and not tp == 'player2': if not tp == 'player':
mainlist += B.create_blender_liblist(env, tp) mainlist += B.create_blender_liblist(env, tp)
if B.arguments.get('BF_PRIORITYLIST', '0')=='1': if B.arguments.get('BF_PRIORITYLIST', '0')=='1':
@ -402,14 +400,11 @@ dobj = B.buildinfo(env, "dynamic") + B.resources
thestatlibs, thelibincs = B.setup_staticlibs(env) thestatlibs, thelibincs = B.setup_staticlibs(env)
thesyslibs = B.setup_syslibs(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']: 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') env.BlenderProg(B.root_build_dir, "blender", dobj + mainlist, [], thestatlibs + thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blender')
if env['WITH_BF_PLAYER']: if env['WITH_BF_PLAYER']:
playerlist = B.create_blender_liblist(env, 'player') playerlist = B.create_blender_liblist(env, 'player')
playerlist = playerlist[0:2] + [mainlist[0]] + mainlist[2:] + [playerlist[2]]
env.BlenderProg(B.root_build_dir, "blenderplayer", dobj + playerlist, [], thestatlibs + thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blenderplayer') env.BlenderProg(B.root_build_dir, "blenderplayer", dobj + playerlist, [], thestatlibs + thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blenderplayer')
##### Now define some targets ##### Now define some targets
@ -424,8 +419,6 @@ if env['OURPLATFORM']=='darwin':
bundle = '%s.app' % prg[0] bundle = '%s.app' % prg[0]
bundledir = os.path.dirname(bundle) bundledir = os.path.dirname(bundle)
for dp, dn, df in os.walk(bundle): for dp, dn, df in os.walk(bundle):
if 'CVS' in dn:
dn.remove('CVS')
if '.svn' in dn: if '.svn' in dn:
dn.remove('.svn') dn.remove('.svn')
dir=env['BF_INSTALLDIR']+dp[len(bundledir):] dir=env['BF_INSTALLDIR']+dp[len(bundledir):]
@ -442,8 +435,6 @@ scriptinstall = []
if env['OURPLATFORM']!='darwin': if env['OURPLATFORM']!='darwin':
for dp, dn, df in os.walk('bin/.blender'): for dp, dn, df in os.walk('bin/.blender'):
if 'CVS' in dn:
dn.remove('CVS')
if '.svn' in dn: if '.svn' in dn:
dn.remove('.svn') dn.remove('.svn')
@ -470,8 +461,6 @@ if env['OURPLATFORM']!='darwin':
scriptpaths=['release/scripts', 'release/ui', 'release/io'] scriptpaths=['release/scripts', 'release/ui', 'release/io']
for scriptpath in scriptpaths: for scriptpath in scriptpaths:
for dp, dn, df in os.walk(scriptpath): for dp, dn, df in os.walk(scriptpath):
if 'CVS' in dn:
dn.remove('CVS')
if '.svn' in dn: if '.svn' in dn:
dn.remove('.svn') dn.remove('.svn')
dir=env['BF_INSTALLDIR']+'/.blender/'+os.path.basename(scriptpath)+dp[len(scriptpath):] dir=env['BF_INSTALLDIR']+'/.blender/'+os.path.basename(scriptpath)+dp[len(scriptpath):]
@ -484,8 +473,6 @@ if env['OURPLATFORM']=='linux2':
icontargetlist = [] icontargetlist = []
for tp, tn, tf in os.walk('release/freedesktop/icons'): for tp, tn, tf in os.walk('release/freedesktop/icons'):
if 'CVS' in tn:
tn.remove('CVS')
if '.svn' in tn: if '.svn' in tn:
tn.remove('.svn') tn.remove('.svn')
for f in tf: for f in tf:
@ -508,8 +495,6 @@ if env['OURPLATFORM']=='linuxcross':
pluglist = [] pluglist = []
plugtargetlist = [] plugtargetlist = []
for tp, tn, tf in os.walk('release/plugins'): for tp, tn, tf in os.walk('release/plugins'):
if 'CVS' in tn:
tn.remove('CVS')
if '.svn' in tn: if '.svn' in tn:
tn.remove('.svn') tn.remove('.svn')
for f in tf: for f in tf:
@ -540,8 +525,6 @@ for targetdir,srcfile in zip(plugtargetlist, pluglist):
textlist = [] textlist = []
texttargetlist = [] texttargetlist = []
for tp, tn, tf in os.walk('release/text'): for tp, tn, tf in os.walk('release/text'):
if 'CVS' in tn:
tn.remove('CVS')
if '.svn' in tn: if '.svn' in tn:
tn.remove('.svn') tn.remove('.svn')
for f in tf: for f in tf:
@ -573,8 +556,8 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc'):
if env['WITH_BF_PYTHON']: if env['WITH_BF_PYTHON']:
ver = env["BF_PYTHON_VERSION"].replace(".", "") ver = env["BF_PYTHON_VERSION"].replace(".", "")
dllsources.append('#release/windows/extra/python' + ver + '.zip') dllsources.append('${LCGDIR}/release/python' + ver + '.zip')
dllsources.append('#release/windows/extra/zlib.pyd') dllsources.append('${LCGDIR}/release/zlib.pyd')
if env['BF_DEBUG']: if env['BF_DEBUG']:
dllsources.append('${BF_PYTHON_LIBPATH}/${BF_PYTHON_LIB}_d.dll') dllsources.append('${BF_PYTHON_LIBPATH}/${BF_PYTHON_LIB}_d.dll')
else: else:
@ -584,17 +567,19 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc'):
pass # we link statically to iconv on win64 pass # we link statically to iconv on win64
else: else:
dllsources += ['${BF_ICONV_LIBPATH}/iconv.dll'] dllsources += ['${BF_ICONV_LIBPATH}/iconv.dll']
if env['WITH_BF_OPENAL']:
dllsources.append('${LCGDIR}/openal/lib/OpenAL32.dll')
dllsources.append('${LCGDIR}/openal/lib/wrap_oal.dll')
if env['WITH_BF_SNDFILE']:
dllsources.append('${LCGDIR}/sndfile/lib/libsndfile-1.dll')
if env['WITH_BF_FFMPEG']: if env['WITH_BF_FFMPEG']:
dllsources += ['${LCGDIR}/ffmpeg/lib/avcodec-52.dll', dllsources += ['${LCGDIR}/ffmpeg/lib/avcodec-52.dll',
'${LCGDIR}/ffmpeg/lib/avformat-52.dll', '${LCGDIR}/ffmpeg/lib/avformat-52.dll',
'${LCGDIR}/ffmpeg/lib/avdevice-52.dll', '${LCGDIR}/ffmpeg/lib/avdevice-52.dll',
'${LCGDIR}/ffmpeg/lib/avutil-50.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'] '${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) windlls = env.Install(dir=env['BF_INSTALLDIR'], source = dllsources)
allinstall += windlls allinstall += windlls

@ -1,10 +1,3 @@
#
# 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 import commands
# IMPORTANT NOTE : OFFICIAL BUILDS SHOULD BE DONE WITH SDKs # IMPORTANT NOTE : OFFICIAL BUILDS SHOULD BE DONE WITH SDKs
@ -27,27 +20,33 @@ else :
LCGDIR = '#../lib/darwin-8.x.i386' LCGDIR = '#../lib/darwin-8.x.i386'
LIBDIR = '${LCGDIR}' LIBDIR = '${LCGDIR}'
BF_PYTHON_VERSION = '3.1'
if MAC_PROC== 'powerpc' and BF_PYTHON_VERSION == '2.3': if MAC_PROC== 'powerpc' and BF_PYTHON_VERSION == '2.3':
MAC_MIN_VERS = '10.3' MAC_MIN_VERS = '10.3'
MACOSX_SDK='/Developer/SDKs/MacOSX10.3.9.sdk' MACOSX_SDK='/Developer/SDKs/MacOSX10.3.9.sdk'
elif MAC_CUR_VER=='10.4': else:
MAC_MIN_VERS = '10.4' MAC_MIN_VERS = '10.4'
MACOSX_SDK='/Developer/SDKs/MacOSX10.4u.sdk' MACOSX_SDK='/Developer/SDKs/MacOSX10.4u.sdk'
else:
MAC_MIN_VERS = '10.5'
MACOSX_SDK='/Developer/SDKs/MacOSX10.5.sdk'
# enable ffmpeg support # enable ffmpeg support
WITH_BF_FFMPEG = True # -DWITH_FFMPEG WITH_BF_FFMPEG = True # -DWITH_FFMPEG
BF_FFMPEG = "#extern/ffmpeg" FFMPEG_PRECOMPILED = False
BF_FFMPEG_INC = '${BF_FFMPEG}' if FFMPEG_PRECOMPILED:
if USE_SDK==True: # use precompiled ffmpeg in /lib
BF_FFMPEG_EXTRA = '-isysroot '+MACOSX_SDK+' -mmacosx-version-min='+MAC_MIN_VERS BF_FFMPEG = LIBDIR + '/ffmpeg'
#BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib' BF_FFMPEG_INC = "#extern/ffmpeg"
#BF_FFMPEG_LIB = 'avformat.a avcodec.a avutil.a' BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
BF_FFMPEG_LIB = 'avcodec avdevice avformat avutil mp3lame swscale x264 xvidcore'
BF_PYTHON_VERSION = '3.1' else:
# use ffmpeg in extern
BF_FFMPEG = "#extern/ffmpeg"
BF_FFMPEG_INC = '${BF_FFMPEG}'
if USE_SDK==True:
BF_FFMPEG_EXTRA = '-isysroot '+MACOSX_SDK+' -mmacosx-version-min='+MAC_MIN_VERS
BF_XVIDCORE_CONFIG = '--disable-assembly' # currently causes errors, even with yasm installed
BF_X264_CONFIG = '--disable-pthread'
if BF_PYTHON_VERSION=='3.1': if BF_PYTHON_VERSION=='3.1':
# python 3.1 uses precompiled libraries in bf svn /lib by default # python 3.1 uses precompiled libraries in bf svn /lib by default
@ -57,7 +56,7 @@ if BF_PYTHON_VERSION=='3.1':
# BF_PYTHON_BINARY = '${BF_PYTHON}/bin/python${BF_PYTHON_VERSION}' # BF_PYTHON_BINARY = '${BF_PYTHON}/bin/python${BF_PYTHON_VERSION}'
BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION}' BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION}'
BF_PYTHON_LIBPATH = '${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: else:
# python 2.5 etc. uses built-in framework # python 2.5 etc. uses built-in framework
@ -73,18 +72,13 @@ else:
BF_PYTHON_BINARY = '${BF_PYTHON}${BF_PYTHON_VERSION}/bin/python${BF_PYTHON_VERSION}' BF_PYTHON_BINARY = '${BF_PYTHON}${BF_PYTHON_VERSION}/bin/python${BF_PYTHON_VERSION}'
BF_PYTHON_LIB = '' BF_PYTHON_LIB = ''
BF_PYTHON_LIBPATH = '${BF_PYTHON}${BF_PYTHON_VERSION}/lib/python${BF_PYTHON_VERSION}/config' 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': 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' BF_QUIET = '1'
WITH_BF_OPENMP = '0' WITH_BF_OPENMP = '0'
# Note : should be true, but openal simply dont work on intel
if MAC_PROC == 'i386':
WITH_BF_OPENAL = False
else:
WITH_BF_OPENAL = True
#different lib must be used following version of gcc #different lib must be used following version of gcc
# for gcc 3.3 # for gcc 3.3
#BF_OPENAL = LIBDIR + '/openal' #BF_OPENAL = LIBDIR + '/openal'
@ -106,6 +100,24 @@ BF_CXX = '/usr'
WITH_BF_STATICCXX = False WITH_BF_STATICCXX = False
BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a' BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
BF_LIBSAMPLERATE = LIBDIR + '/samplerate'
BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
BF_LIBSAMPLERATE_LIB = 'samplerate'
BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
# TODO - set proper paths here (add precompiled to lib/ ? )
WITH_BF_JACK = False
BF_JACK = '/usr'
BF_JACK_INC = '${BF_JACK}/include/jack'
BF_JACK_LIB = 'jack'
BF_JACK_LIBPATH = '${BF_JACK}/lib'
WITH_BF_SNDFILE = False
BF_SNDFILE = LIBDIR + '/sndfile'
BF_SNDFILE_INC = '${BF_SNDFILE}/include'
BF_SNDFILE_LIB = 'sndfile'
BF_SNDFILE_LIBPATH = '${BF_SNDFILE}/lib'
WITH_BF_SDL = True WITH_BF_SDL = True
BF_SDL = LIBDIR + '/sdl' #$(shell sdl-config --prefix) BF_SDL = LIBDIR + '/sdl' #$(shell sdl-config --prefix)
BF_SDL_INC = '${BF_SDL}/include' #$(shell $(BF_SDL)/bin/sdl-config --cflags) BF_SDL_INC = '${BF_SDL}/include' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
@ -151,13 +163,19 @@ BF_GETTEXT_LIB = 'intl'
BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib' BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
WITH_BF_GAMEENGINE=True WITH_BF_GAMEENGINE=True
WITH_BF_PLAYER=True WITH_BF_PLAYER = False
WITH_BF_BULLET = True WITH_BF_BULLET = True
BF_BULLET = '#extern/bullet2/src' BF_BULLET = '#extern/bullet2/src'
BF_BULLET_INC = '${BF_BULLET}' BF_BULLET_INC = '${BF_BULLET}'
BF_BULLET_LIB = 'extern_bullet' BF_BULLET_LIB = 'extern_bullet'
WITH_BF_FFTW3 = False
BF_FFTW3 = LIBDIR + '/fftw3'
BF_FFTW3_INC = '${BF_FFTW3}/include'
BF_FFTW3_LIB = 'libfftw3'
BF_FFTW3_LIBPATH = '${BF_FFTW3}/lib'
#WITH_BF_NSPR = True #WITH_BF_NSPR = True
#BF_NSPR = $(LIBDIR)/nspr #BF_NSPR = $(LIBDIR)/nspr
#BF_NSPR_INC = -I$(BF_NSPR)/include -I$(BF_NSPR)/include/nspr #BF_NSPR_INC = -I$(BF_NSPR)/include -I$(BF_NSPR)/include/nspr
@ -193,14 +211,14 @@ BF_ICONV_LIB = 'iconv'
WITH_BF_STATICOPENGL = True WITH_BF_STATICOPENGL = True
BF_OPENGL_LIB = 'GL GLU' BF_OPENGL_LIB = 'GL GLU'
BF_OPENGL_LIBPATH = '/System/Library/Frameworks/OpenGL.framework/Libraries' BF_OPENGL_LIBPATH = '/System/Library/Frameworks/OpenGL.framework/Libraries'
BF_OPENGL_LINKFLAGS = '-framework OpenGL' BF_OPENGL_LINKFLAGS = ['-framework', 'OpenGL']
CFLAGS = ['-pipe','-fPIC','-funsigned-char'] CFLAGS = ['-pipe','-fPIC','-funsigned-char']
CPPFLAGS = ['-fpascal-strings'] CPPFLAGS = ['-fpascal-strings']
CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fpascal-strings'] CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fpascal-strings']
CXXFLAGS = [ '-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 #note to build succesfully on 10.3.9 SDK you need to patch 10.3.9 by adding the SystemStubs.a lib from 10.4
LLIBS = ['stdc++', 'SystemStubs'] LLIBS = ['stdc++', 'SystemStubs']
@ -209,12 +227,12 @@ LLIBS = ['stdc++', 'SystemStubs']
if MAC_MIN_VERS == '10.3': if MAC_MIN_VERS == '10.3':
CFLAGS = ['-fuse-cxa-atexit']+CFLAGS CFLAGS = ['-fuse-cxa-atexit']+CFLAGS
CXXFLAGS = ['-fuse-cxa-atexit']+CXXFLAGS CXXFLAGS = ['-fuse-cxa-atexit']+CXXFLAGS
PLATFORM_LINKFLAGS = '-fuse-cxa-atexit '+PLATFORM_LINKFLAGS PLATFORM_LINKFLAGS = ['-fuse-cxa-atexit']+PLATFORM_LINKFLAGS
LLIBS.append('crt3.o') LLIBS.append('crt3.o')
if USE_SDK==True: if USE_SDK==True:
SDK_FLAGS=['-isysroot', MACOSX_SDK,'-mmacosx-version-min='+MAC_MIN_VERS] 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 CCFLAGS=SDK_FLAGS+CCFLAGS
CXXFLAGS=SDK_FLAGS+CXXFLAGS CXXFLAGS=SDK_FLAGS+CXXFLAGS

@ -24,6 +24,11 @@ BF_CXX = '/usr'
WITH_BF_STATICCXX = 'false' WITH_BF_STATICCXX = 'false'
BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a' BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
BF_LIBSAMPLERATE = LCGDIR+'/samplerate'
BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
BF_LIBSAMPLERATE_LIB = 'samplerate'
BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
WITH_BF_SDL = 'true' WITH_BF_SDL = 'true'
BF_SDL = LCGDIR+'/sdl' #$(shell sdl-config --prefix) BF_SDL = LCGDIR+'/sdl' #$(shell sdl-config --prefix)
BF_SDL_INC = '${BF_SDL}/include/SDL' #$(shell $(BF_SDL)/bin/sdl-config --cflags) BF_SDL_INC = '${BF_SDL}/include/SDL' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
@ -73,6 +78,7 @@ BF_GETTEXT_LIB = 'gettextpo intl'
BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib' BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
WITH_BF_GAMEENGINE='false' WITH_BF_GAMEENGINE='false'
WITH_BF_PLAYER = 'false'
WITH_BF_BULLET = 'true' WITH_BF_BULLET = 'true'
BF_BULLET = '#extern/bullet2/src' BF_BULLET = '#extern/bullet2/src'

@ -22,6 +22,23 @@ BF_CXX = '/usr'
WITH_BF_STATICCXX = False WITH_BF_STATICCXX = False
BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a' BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
BF_LIBSAMPLERATE = '/usr'
BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
BF_LIBSAMPLERATE_LIB = 'samplerate'
BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
WITH_BF_JACK = False
BF_JACK = '/usr'
BF_JACK_INC = '${BF_JACK}/include/jack'
BF_JACK_LIB = 'jack'
BF_JACK_LIBPATH = '${BF_JACK}/lib'
WITH_BF_SNDFILE = False
BF_SNDFILE = '/usr'
BF_SNDFILE_INC = '${BF_SNDFILE}/include/sndfile'
BF_SNDFILE_LIB = 'sndfile'
BF_SNDFILE_LIBPATH = '${BF_SNDFILE}/lib'
WITH_BF_SDL = True WITH_BF_SDL = True
BF_SDL = '/usr' #$(shell sdl-config --prefix) BF_SDL = '/usr' #$(shell sdl-config --prefix)
BF_SDL_INC = '${BF_SDL}/include/SDL' #$(shell $(BF_SDL)/bin/sdl-config --cflags) BF_SDL_INC = '${BF_SDL}/include/SDL' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
@ -67,30 +84,13 @@ BF_GETTEXT_LIB = 'gettextlib'
BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib' BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
WITH_BF_GAMEENGINE = True WITH_BF_GAMEENGINE = True
WITH_BF_PLAYER = True WITH_BF_PLAYER = False
WITH_BF_BULLET = True WITH_BF_BULLET = True
BF_BULLET = '#extern/bullet2/src' BF_BULLET = '#extern/bullet2/src'
BF_BULLET_INC = '${BF_BULLET}' BF_BULLET_INC = '${BF_BULLET}'
BF_BULLET_LIB = 'extern_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 # enable freetype2 support for text objects
BF_FREETYPE = '/usr' BF_FREETYPE = '/usr'
BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2' BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2'
@ -130,6 +130,12 @@ BF_OPENJPEG_LIB = ''
BF_OPENJPEG_INC = '${BF_OPENJPEG}' BF_OPENJPEG_INC = '${BF_OPENJPEG}'
BF_OPENJPEG_LIBPATH='${BF_OPENJPEG}/lib' BF_OPENJPEG_LIBPATH='${BF_OPENJPEG}/lib'
WITH_BF_FFTW3 = False
BF_FFTW3 = LIBDIR + '/usr'
BF_FFTW3_INC = '${BF_FFTW3}/include'
BF_FFTW3_LIB = 'fftw3'
BF_FFTW3_LIBPATH = '${BF_FFTW3}/lib'
WITH_BF_REDCODE = False WITH_BF_REDCODE = False
BF_REDCODE = '#extern/libredcode' BF_REDCODE = '#extern/libredcode'
BF_REDCODE_LIB = '' BF_REDCODE_LIB = ''
@ -178,8 +184,9 @@ REL_CCFLAGS = ['-O2']
##ARFLAGSQUIET = ru ##ARFLAGSQUIET = ru
## ##
C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement'] C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement']
CC_WARN = ['-Wall'] CC_WARN = ['-Wall']
CXX_WARN = ['-Wno-invalid-offsetof', '-Wno-sign-compare']
##FIX_STUBS_WARNINGS = -Wno-unused ##FIX_STUBS_WARNINGS = -Wno-unused

@ -22,6 +22,11 @@ BF_CXX = '/usr'
WITH_BF_STATICCXX = False WITH_BF_STATICCXX = False
BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a' BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
BF_LIBSAMPLERATE = LIBDIR + '/samplerate'
BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
BF_LIBSAMPLERATE_LIB = 'samplerate'
BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
WITH_BF_SDL = True WITH_BF_SDL = True
BF_SDL = LIBDIR + '/sdl' BF_SDL = LIBDIR + '/sdl'
BF_SDL_INC = '${BF_SDL}/include' BF_SDL_INC = '${BF_SDL}/include'
@ -73,6 +78,7 @@ BF_GETTEXT_LIB = 'gnu_gettext'
BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib' BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
WITH_BF_GAMEENGINE = False WITH_BF_GAMEENGINE = False
WITH_BF_PLAYER = False
WITH_BF_BULLET = True WITH_BF_BULLET = True
BF_BULLET = '#extern/bullet2/src' BF_BULLET = '#extern/bullet2/src'

@ -16,6 +16,11 @@ WITH_BF_OPENAL = False
#BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib' #BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
#BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a' #BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
BF_LIBSAMPLERATE = '/usr/local'
BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
BF_LIBSAMPLERATE_LIB = 'samplerate'
BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
WITH_BF_SDL = True WITH_BF_SDL = True
BF_SDL = '/usr/local' #$(shell sdl-config --prefix) BF_SDL = '/usr/local' #$(shell sdl-config --prefix)
BF_SDL_INC = '${BF_SDL}/include/SDL' #$(shell $(BF_SDL)/bin/sdl-config --cflags) BF_SDL_INC = '${BF_SDL}/include/SDL' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
@ -60,6 +65,7 @@ BF_GETTEXT_LIB = 'intl iconv'
BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib' BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
WITH_BF_GAMEENGINE=False WITH_BF_GAMEENGINE=False
WITH_BF_PLAYER = False
WITH_BF_BULLET = True WITH_BF_BULLET = True
BF_BULLET = '#extern/bullet2/src' BF_BULLET = '#extern/bullet2/src'

@ -22,6 +22,11 @@ BF_CXX = '/usr'
WITH_BF_STATICCXX = False WITH_BF_STATICCXX = False
BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a' BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
BF_LIBSAMPLERATE = '/usr/local'
BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
BF_LIBSAMPLERATE_LIB = 'samplerate'
BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
WITH_BF_SDL = True WITH_BF_SDL = True
BF_SDL = '/usr/local' #$(shell sdl-config --prefix) BF_SDL = '/usr/local' #$(shell sdl-config --prefix)
BF_SDL_INC = '${BF_SDL}/include/SDL' #$(shell $(BF_SDL)/bin/sdl-config --cflags) BF_SDL_INC = '${BF_SDL}/include/SDL' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
@ -68,6 +73,7 @@ BF_GETTEXT_LIB = 'gettextlib'
BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib' BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
WITH_BF_GAMEENGINE=False WITH_BF_GAMEENGINE=False
WITH_BF_PLAYER = False
WITH_BF_BULLET = True WITH_BF_BULLET = True
BF_BULLET = '#extern/bullet2/src' BF_BULLET = '#extern/bullet2/src'
@ -108,7 +114,7 @@ BF_ICONV_LIB = 'iconv'
BF_ICONV_LIBPATH = '${BF_ICONV}/lib' BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
# enable ffmpeg support # enable ffmpeg support
WITH_BF_FFMPEG = False # -DWITH_FFMPEG WITH_BF_FFMPEG = True # -DWITH_FFMPEG
BF_FFMPEG = '/usr/local' BF_FFMPEG = '/usr/local'
BF_FFMPEG_INC = '${BF_FFMPEG}/include' BF_FFMPEG_INC = '${BF_FFMPEG}/include'
BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib' BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'

@ -3,31 +3,40 @@ LIBDIR = "${LCGDIR}"
BF_PYTHON = LIBDIR + '/python' BF_PYTHON = LIBDIR + '/python'
BF_PYTHON_VERSION = '3.1' BF_PYTHON_VERSION = '3.1'
#BF_PYTHON_VERSION = '2.6'
#BF_PYTHON_VERSION = '2.6'
WITH_BF_STATICPYTHON = False WITH_BF_STATICPYTHON = False
BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}' BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}'
BF_PYTHON_BINARY = 'python' 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_LIB = 'python${BF_PYTHON_VERSION[0]}${BF_PYTHON_VERSION[2]}'
BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib' BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib'
BF_PYTHON_LIB_STATIC = '${BF_PYTHON}/lib/libpython${BF_PYTHON_VERSION[0]}${BF_PYTHON_VERSION[2]}.a' BF_PYTHON_LIB_STATIC = '${BF_PYTHON}/lib/libpython${BF_PYTHON_VERSION[0]}${BF_PYTHON_VERSION[2]}.a'
WITH_BF_OPENAL = True WITH_BF_OPENAL = True
WITH_BF_STATICOPENAL = False
BF_OPENAL = LIBDIR + '/openal' BF_OPENAL = LIBDIR + '/openal'
BF_OPENAL_INC = '${BF_OPENAL}/include' BF_OPENAL_INC = '${BF_OPENAL}/include'
BF_OPENAL_LIB = 'dxguid openal_static' BF_OPENAL_LIB = 'wrap_oal'
BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib' BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
# Warning, this static lib configuration is untested! users of this OS please confirm.
BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
WITH_BF_FFMPEG = False WITH_BF_FFMPEG = False
BF_FFMPEG_LIB = 'avformat swscale avcodec avutil avdevice xvidcore x264' BF_FFMPEG_LIB = 'avformat-52 avcodec-52 avdevice-52 avutil-50 swscale-0'
BF_FFMPEG_LIBPATH = LIBDIR + '/gcc/ffmpeg/lib' BF_FFMPEG_LIBPATH = LIBDIR + '/ffmpeg/lib'
BF_FFMPEG_INC = LIBDIR + '/gcc/ffmpeg/include' BF_FFMPEG_INC = LIBDIR + '/ffmpeg/include'
BF_LIBSAMPLERATE = LIBDIR + '/samplerate'
BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
BF_LIBSAMPLERATE_LIB = 'libsamplerate'
BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
WITH_BF_JACK = False
BF_JACK = LIBDIR + '/jack'
BF_JACK_INC = '${BF_JACK}/include'
BF_JACK_LIB = 'libjack'
BF_JACK_LIBPATH = '${BF_JACK}/lib'
WITH_BF_SNDFILE = False
BF_SNDFILE = LIBDIR + '/sndfile'
BF_SNDFILE_INC = '${BF_SNDFILE}/include'
BF_SNDFILE_LIB = 'libsndfile-1'
BF_SNDFILE_LIBPATH = '${BF_SNDFILE}/lib'
WITH_BF_SDL = True WITH_BF_SDL = True
BF_SDL = LIBDIR + '/sdl' BF_SDL = LIBDIR + '/sdl'
@ -81,6 +90,7 @@ BF_GETTEXT_LIB = 'gnu_gettext'
BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib' BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
WITH_BF_GAMEENGINE = False WITH_BF_GAMEENGINE = False
WITH_BF_PLAYER = False
WITH_BF_BULLET = True WITH_BF_BULLET = True
BF_BULLET = '#extern/bullet2/src' BF_BULLET = '#extern/bullet2/src'
@ -90,20 +100,6 @@ BF_BULLET_LIB = 'extern_bullet'
BF_WINTAB = LIBDIR + '/wintab' BF_WINTAB = LIBDIR + '/wintab'
BF_WINTAB_INC = '${BF_WINTAB}/INCLUDE' 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 # enable freetype2 support for text objects
BF_FREETYPE = LIBDIR + '/gcc/freetype' BF_FREETYPE = LIBDIR + '/gcc/freetype'
BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2' BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2'

@ -4,7 +4,7 @@ LIBDIR = '${LCGDIR}'
# enable ffmpeg support # enable ffmpeg support
WITH_BF_FFMPEG = True # -DWITH_FFMPEG WITH_BF_FFMPEG = True # -DWITH_FFMPEG
BF_FFMPEG = LIBDIR +'/ffmpeg' BF_FFMPEG = LIBDIR +'/ffmpeg'
BF_FFMPEG_INC = '${BF_FFMPEG}/include' BF_FFMPEG_INC = '${BF_FFMPEG}/include ${BF_FFMPEG}/include/msvc'
BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib' BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
BF_FFMPEG_LIB = 'avformat-52.lib avcodec-52.lib avdevice-52.lib avutil-50.lib swscale-0.lib' BF_FFMPEG_LIB = 'avformat-52.lib avcodec-52.lib avdevice-52.lib avutil-50.lib swscale-0.lib'
@ -16,18 +16,10 @@ BF_PYTHON_LIB = 'python31'
BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib' BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib'
WITH_BF_OPENAL = True WITH_BF_OPENAL = True
WITH_BF_STATICOPENAL = False
BF_OPENAL = LIBDIR + '/openal' BF_OPENAL = LIBDIR + '/openal'
BF_OPENAL_INC = '${BF_OPENAL}/include ${BF_OPENAL}/include/AL ' BF_OPENAL_INC = '${BF_OPENAL}/include '
BF_OPENAL_LIB = 'dxguid openal_static' BF_OPENAL_LIB = 'wrap_oal'
BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib' BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
# Warning, this static lib configuration is untested! users of this OS please confirm.
BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
# TODO - are these useful on win32?
# BF_CXX = '/usr'
# WITH_BF_STATICCXX = False
# BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
WITH_BF_ICONV = True WITH_BF_ICONV = True
BF_ICONV = LIBDIR + '/iconv' BF_ICONV = LIBDIR + '/iconv'
@ -35,6 +27,23 @@ BF_ICONV_INC = '${BF_ICONV}/include'
BF_ICONV_LIB = 'iconv' BF_ICONV_LIB = 'iconv'
BF_ICONV_LIBPATH = '${BF_ICONV}/lib' BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
BF_LIBSAMPLERATE = LIBDIR + '/samplerate'
BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
BF_LIBSAMPLERATE_LIB = 'libsamplerate'
BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
WITH_BF_JACK = False
BF_JACK = LIBDIR + '/jack'
BF_JACK_INC = '${BF_JACK}/include'
BF_JACK_LIB = 'libjack'
BF_JACK_LIBPATH = '${BF_JACK}/lib'
WITH_BF_SNDFILE = False
BF_SNDFILE = LIBDIR + '/sndfile'
BF_SNDFILE_INC = '${BF_SNDFILE}/include'
BF_SNDFILE_LIB = 'libsndfile-1'
BF_SNDFILE_LIBPATH = '${BF_SNDFILE}/lib'
WITH_BF_SDL = True WITH_BF_SDL = True
BF_SDL = LIBDIR + '/sdl' BF_SDL = LIBDIR + '/sdl'
BF_SDL_INC = '${BF_SDL}/include' BF_SDL_INC = '${BF_SDL}/include'
@ -88,7 +97,7 @@ BF_GETTEXT_LIB = 'gnu_gettext'
BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib' BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
WITH_BF_GAMEENGINE = True WITH_BF_GAMEENGINE = True
WITH_BF_PLAYER = True WITH_BF_PLAYER = False
WITH_BF_BULLET = True WITH_BF_BULLET = True
BF_BULLET = '#extern/bullet2/src' BF_BULLET = '#extern/bullet2/src'
@ -100,23 +109,6 @@ BF_WINTAB_INC = '${BF_WINTAB}/INCLUDE'
WITH_BF_BINRELOC = False 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 # enable freetype2 support for text objects
BF_WITH_FREETYPE = True BF_WITH_FREETYPE = True
BF_FREETYPE = LIBDIR + '/freetype' BF_FREETYPE = LIBDIR + '/freetype'
@ -136,6 +128,12 @@ BF_OPENJPEG_LIB = ''
BF_OPENJPEG_INC = '${BF_OPENJPEG}' BF_OPENJPEG_INC = '${BF_OPENJPEG}'
BF_OPENJPEG_LIBPATH='${BF_OPENJPEG}/lib' BF_OPENJPEG_LIBPATH='${BF_OPENJPEG}/lib'
WITH_BF_FFTW3 = False
BF_FFTW3 = LIBDIR + '/fftw3'
BF_FFTW3_INC = '${BF_FFTW3}/include'
BF_FFTW3_LIB = 'libfftw'
BF_FFTW3_LIBPATH = '${BF_FFTW3}/lib'
WITH_BF_REDCODE = False WITH_BF_REDCODE = False
BF_REDCODE_INC = '#extern' BF_REDCODE_INC = '#extern'
@ -161,6 +159,7 @@ CXX = 'cl.exe'
CCFLAGS = ['/nologo', '/Ob1', '/J', '/W3', '/Gd', '/wd4244', '/wd4305', '/wd4800', '/wd4065', '/wd4267'] CCFLAGS = ['/nologo', '/Ob1', '/J', '/W3', '/Gd', '/wd4244', '/wd4305', '/wd4800', '/wd4065', '/wd4267']
CXXFLAGS = ['/EHsc'] CXXFLAGS = ['/EHsc']
BGE_CXXFLAGS = ['/O2', '/EHsc', '/GR', '/fp:fast', '/arch:SSE']
BF_DEBUG_CCFLAGS = ['/Zi', '/FR${TARGET}.sbr'] BF_DEBUG_CCFLAGS = ['/Zi', '/FR${TARGET}.sbr']

@ -16,13 +16,10 @@ BF_PYTHON_LIB = 'python31'
BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib' BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib'
WITH_BF_OPENAL = False WITH_BF_OPENAL = False
WITH_BF_STATICOPENAL = False
BF_OPENAL = LIBDIR + '/openal' BF_OPENAL = LIBDIR + '/openal'
BF_OPENAL_INC = '${BF_OPENAL}/include ${BF_OPENAL}/include/AL ' BF_OPENAL_INC = '${BF_OPENAL}/include '
BF_OPENAL_LIB = 'dxguid openal_static' BF_OPENAL_LIB = 'wrap_oal'
BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib' BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
# Warning, this static lib configuration is untested! users of this OS please confirm.
BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
# TODO - are these useful on win32? # TODO - are these useful on win32?
# BF_CXX = '/usr' # BF_CXX = '/usr'
@ -35,6 +32,11 @@ BF_ICONV_INC = '${BF_ICONV}/include'
BF_ICONV_LIB = 'iconv' BF_ICONV_LIB = 'iconv'
BF_ICONV_LIBPATH = '${BF_ICONV}/lib' BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
BF_LIBSAMPLERATE = LIBDIR + '/samplerate'
BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
BF_LIBSAMPLERATE_LIB = 'libsamplerate'
BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
WITH_BF_SDL = True WITH_BF_SDL = True
BF_SDL = LIBDIR + '/sdl' BF_SDL = LIBDIR + '/sdl'
BF_SDL_INC = '${BF_SDL}/include' BF_SDL_INC = '${BF_SDL}/include'
@ -139,6 +141,12 @@ BF_OPENJPEG_LIB = ''
BF_OPENJPEG_INC = '${BF_OPENJPEG}' BF_OPENJPEG_INC = '${BF_OPENJPEG}'
BF_OPENJPEG_LIBPATH='${BF_OPENJPEG}/lib' BF_OPENJPEG_LIBPATH='${BF_OPENJPEG}/lib'
WITH_BF_FFTW3 = True
BF_FFTW3 = LIBDIR + '/fftw3'
BF_FFTW3_INC = '${BF_FFTW3}/include'
BF_FFTW3_LIB = 'libfftw'
BF_FFTW3_LIBPATH = '${BF_FFTW3}/lib'
WITH_BF_REDCODE = False WITH_BF_REDCODE = False
BF_REDCODE_INC = '#extern' BF_REDCODE_INC = '#extern'
@ -165,6 +173,7 @@ CXX = 'cl.exe'
CFLAGS = [] CFLAGS = []
CCFLAGS = ['/nologo', '/Ob1', '/J', '/W3', '/Gd', '/wd4244', '/wd4305', '/wd4800', '/wd4065', '/wd4267'] CCFLAGS = ['/nologo', '/Ob1', '/J', '/W3', '/Gd', '/wd4244', '/wd4305', '/wd4800', '/wd4065', '/wd4267']
CXXFLAGS = ['/EHsc'] CXXFLAGS = ['/EHsc']
BGE_CXXFLAGS = ['/O2', '/EHsc', '/GR', '/fp:fast', '/arch:SSE2']
BF_DEBUG_CCFLAGS = ['/Zi', '/FR${TARGET}.sbr'] BF_DEBUG_CCFLAGS = ['/Zi', '/FR${TARGET}.sbr']

@ -37,3 +37,6 @@ ADD_SUBDIRECTORY(glew)
IF(WITH_OPENJPEG) IF(WITH_OPENJPEG)
ADD_SUBDIRECTORY(libopenjpeg) ADD_SUBDIRECTORY(libopenjpeg)
ENDIF(WITH_OPENJPEG) ENDIF(WITH_OPENJPEG)
ADD_SUBDIRECTORY(lzo)
ADD_SUBDIRECTORY(lzma)

8
extern/Makefile vendored

@ -54,6 +54,14 @@ ifeq ($(WITH_OPENJPEG), true)
DIRS += libopenjpeg DIRS += libopenjpeg
endif endif
ifeq ($(WITH_LZO), true)
DIRS += lzo/minilzo
endif
ifeq ($(WITH_LZMA), true)
DIRS += lzma
endif
TARGET = solid TARGET = solid
all:: all::

4
extern/SConscript vendored

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

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

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

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

127
extern/lzma/Alloc.c vendored Normal file

@ -0,0 +1,127 @@
/* 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 Normal file

@ -0,0 +1,32 @@
/* 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

34
extern/lzma/CMakeLists.txt vendored Normal file

@ -0,0 +1,34 @@
# $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 Normal file

@ -0,0 +1,751 @@
/* 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 Normal file

@ -0,0 +1,107 @@
/* 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 Normal file

@ -0,0 +1,54 @@
/* 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 Normal file

File diff suppressed because it is too large Load Diff

223
extern/lzma/LzmaDec.h vendored Normal file

@ -0,0 +1,223 @@
/* 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 Normal file

File diff suppressed because it is too large Load Diff

72
extern/lzma/LzmaEnc.h vendored Normal file

@ -0,0 +1,72 @@
/* 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 Normal file

@ -0,0 +1,46 @@
/* 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 Normal file

@ -0,0 +1,135 @@
/* 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 Normal file

@ -0,0 +1,46 @@
#
# $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)

9
extern/lzma/SConscript vendored Normal file

@ -0,0 +1,9 @@
#!/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 Normal file

@ -0,0 +1,208 @@
/* 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

236
extern/lzma/history.txt vendored Normal file

@ -0,0 +1,236 @@
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 Ñ++ 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 Normal file

@ -0,0 +1,594 @@
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

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

34
extern/lzo/CMakeLists.txt vendored Normal file

@ -0,0 +1,34 @@
# $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 )

9
extern/lzo/SConscript vendored Normal file

@ -0,0 +1,9 @@
#!/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] )

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

340
extern/lzo/minilzo/COPYING vendored Normal file

@ -0,0 +1,340 @@
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.

40
extern/lzo/minilzo/Makefile vendored Normal file

@ -0,0 +1,40 @@
#
# $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

123
extern/lzo/minilzo/README.LZO vendored Normal file

@ -0,0 +1,123 @@
============================================================================
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.

417
extern/lzo/minilzo/lzoconf.h vendored Normal file

@ -0,0 +1,417 @@
/* 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: */

1807
extern/lzo/minilzo/lzodefs.h vendored Normal file

File diff suppressed because it is too large Load Diff

4112
extern/lzo/minilzo/minilzo.c vendored Normal file

File diff suppressed because it is too large Load Diff

112
extern/lzo/minilzo/minilzo.h vendored Normal file

@ -0,0 +1,112 @@
/* 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 */

@ -24,7 +24,7 @@
# #
# ***** END GPL LICENSE BLOCK ***** # ***** END GPL LICENSE BLOCK *****
ADD_SUBDIRECTORY(SoundSystem) ADD_SUBDIRECTORY(audaspace)
ADD_SUBDIRECTORY(string) ADD_SUBDIRECTORY(string)
ADD_SUBDIRECTORY(ghost) ADD_SUBDIRECTORY(ghost)
ADD_SUBDIRECTORY(guardedalloc) ADD_SUBDIRECTORY(guardedalloc)
@ -35,6 +35,7 @@ ADD_SUBDIRECTORY(decimation)
ADD_SUBDIRECTORY(iksolver) ADD_SUBDIRECTORY(iksolver)
ADD_SUBDIRECTORY(boolop) ADD_SUBDIRECTORY(boolop)
ADD_SUBDIRECTORY(opennl) ADD_SUBDIRECTORY(opennl)
ADD_SUBDIRECTORY(smoke)
IF(WITH_ELBEEM) IF(WITH_ELBEEM)
ADD_SUBDIRECTORY(elbeem) ADD_SUBDIRECTORY(elbeem)

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

@ -1,7 +1,7 @@
#!/usr/bin/python #!/usr/bin/python
Import ('env') Import ('env')
SConscript(['SoundSystem/SConscript', SConscript(['audaspace/SConscript',
'string/SConscript', 'string/SConscript',
'ghost/SConscript', 'ghost/SConscript',
'guardedalloc/SConscript', 'guardedalloc/SConscript',
@ -11,7 +11,8 @@ SConscript(['SoundSystem/SConscript',
'decimation/SConscript', 'decimation/SConscript',
'iksolver/SConscript', 'iksolver/SConscript',
'boolop/SConscript', 'boolop/SConscript',
'opennl/SConscript']) 'opennl/SConscript',
'smoke/SConscript'])
# NEW_CSG was intended for intern/csg, but # NEW_CSG was intended for intern/csg, but
# getting it to compile is difficult # getting it to compile is difficult

@ -1,42 +0,0 @@
# $Id$
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# The Original Code is Copyright (C) 2006, Blender Foundation
# All rights reserved.
#
# The Original Code is: all of this file.
#
# Contributor(s): Jacques Beaurain.
#
# ***** END GPL LICENSE BLOCK *****
SET(INC . intern ../moto/include ../string dummy openal sdl)
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)
BLENDERLIB(bf_soundsystem "${SRC}" "${INC}")
#, libtype=['core','player'], priority = [20,140] )

@ -1,20 +0,0 @@
#!/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] )

@ -1,354 +0,0 @@
/**
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL LICENSE BLOCK *****
*/
#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

@ -1,83 +0,0 @@
/*
* 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

@ -1,79 +0,0 @@
/*
* 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

@ -1,343 +0,0 @@
/**
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL LICENSE BLOCK *****
*/
#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

@ -1,104 +0,0 @@
/*
* 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

@ -1,82 +0,0 @@
/*
* 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

@ -1,159 +0,0 @@
/*
* 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

@ -1,111 +0,0 @@
/**
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL LICENSE BLOCK *****
*/
#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

@ -1,66 +0,0 @@
/*
* SND_WaveCache.h
*
* 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 WIN32
#pragma warning (disable:4786) // get rid of stupid stl-visual compiler debug warning
#endif //WIN32
#ifndef __SND_WAVECACHE_H
#define __SND_WAVECACHE_H
#include "SND_WaveSlot.h"
#include "SoundDefines.h"
#include "SND_SoundObject.h"
#include <map>
class SND_WaveCache
{
public:
SND_WaveCache();
virtual ~SND_WaveCache();
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

@ -1,92 +0,0 @@
/*
* 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

@ -1,48 +0,0 @@
#
# $Id$
#
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
#
# The Original Code is: all of this file.
#
# Contributor(s): none yet.
#
# ***** END GPL LICENSE BLOCK *****
#
#
LIBNAME = soundsystem
DIR = $(OCGDIR)/intern/SoundSystem
ALLTARGETS = $(OBJS) $(DIR)/$(DEBUG_DIR)SoundSystem
include nan_compile.mk
CPPFLAGS += $(NAN_LEVEL_1_WARNINGS)
CPPFLAGS += -I$(NAN_MOTO)/include
CPPFLAGS += -I.. -I../SND_BlenderWaveCache -I../SND_OpenAL
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++

@ -1,154 +0,0 @@
/* 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;
}

@ -1,107 +0,0 @@
/*
* 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

@ -1,93 +0,0 @@
/**
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL LICENSE BLOCK *****
*/
#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

@ -1,242 +0,0 @@
/**
* $Id$
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL LICENSE BLOCK *****
*/
#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();
}

@ -1,115 +0,0 @@
/**
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL LICENSE BLOCK *****
*/
#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

@ -1,392 +0,0 @@
/*
* 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();
}

@ -1,182 +0,0 @@
/*
* 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;
}

@ -1,126 +0,0 @@
/*
* 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;
}
}
}

@ -1,76 +0,0 @@
/*
* 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;
}

@ -1,58 +0,0 @@
/*
* 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

@ -1,544 +0,0 @@
/*
* 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;
}

@ -1,185 +0,0 @@
/*
* 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;
}

@ -1,508 +0,0 @@
/*
* 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;
}

@ -1,424 +0,0 @@
/*
* 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);
}
}
}
}

@ -1,138 +0,0 @@
/*
* 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;
}
}
}

@ -1,180 +0,0 @@
/**
* $Id$
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL LICENSE BLOCK *****
*/
#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;
}

@ -1,206 +0,0 @@
# 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

@ -1,103 +0,0 @@
# 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

@ -1,106 +0,0 @@
# 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

@ -1,339 +0,0 @@
<?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>

@ -1,243 +0,0 @@
<?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>

@ -1,249 +0,0 @@
<?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>

@ -1,447 +0,0 @@
<?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>

@ -1,864 +0,0 @@
/*
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL LICENSE BLOCK *****
* 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
#elif defined(_WIN32)
// alcGetError has no arguments on windows
ALenum alc_error = alcGetError(); // openal_2.14+
#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
{
#ifdef WIN32
alcMakeContextCurrent(m_context);
#endif
}
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};
#ifdef WIN32
float lisori[6] = {0,1,0,0,0,1};
#else
float lisori[6] = {0,0,1,0,-1,0};
#endif
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
}

@ -1,107 +0,0 @@
/**
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL LICENSE BLOCK *****
*/
#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

@ -1,67 +0,0 @@
/* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL LICENSE BLOCK *****
* 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

@ -1,171 +0,0 @@
/*
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL LICENSE BLOCK *****
* SND_SDLCDDevice
*/
#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 "MT_Scalar.h"
#include "SND_SDLCDDevice.h"
#include "SoundDefines.h"
#ifndef DISABLE_SDL
#include <SDL.h>
#else
#include <stdio.h>
#endif
SND_SDLCDDevice::SND_SDLCDDevice() :
m_cdrom(NULL),
m_cdplaying(false),
m_cdtrack(0),
m_cdplaymode(SND_CD_TRACK),
m_frame(0)
{
init();
}
void SND_SDLCDDevice::init()
{
#ifdef DISABLE_SDL
fprintf(stderr, "Blender compiled without SDL, no CDROM support\n");
return;
#else
if (SDL_InitSubSystem(SDL_INIT_CDROM))
{
fprintf(stderr, "Error initializing CDROM\n");
return;
}
/* Check for CD drives */
if(!SDL_CDNumDrives())
{
/* None found */
fprintf(stderr, "No CDROM devices available\n");
return;
}
/* Open the default drive */
m_cdrom = SDL_CDOpen(0);
/* Did if open? Check if cdrom is NULL */
if(!m_cdrom)
{
fprintf(stderr, "Couldn't open drive: %s\n", SDL_GetError());
return;
}
#endif
}
SND_SDLCDDevice::~SND_SDLCDDevice()
{
#ifndef DISABLE_SDL
StopCD();
SDL_CDClose(m_cdrom);
#endif
}
void SND_SDLCDDevice::NextFrame()
{
#ifndef DISABLE_SDL
m_frame++;
m_frame &= 127;
if (!m_frame && m_cdrom && m_cdplaying && SDL_CDStatus(m_cdrom) == CD_STOPPED)
{
switch (m_cdplaymode)
{
case SND_CD_ALL:
if (m_cdtrack < m_cdrom->numtracks)
PlayCD(m_cdtrack + 1);
else
m_cdplaying = false;
break;
default:
case SND_CD_TRACK:
m_cdplaying = false;
break;
case SND_CD_TRACKLOOP:
PlayCD(m_cdtrack);
break;
}
}
#endif
}
void SND_SDLCDDevice::PlayCD(int track)
{
#ifndef DISABLE_SDL
if ( m_cdrom && CD_INDRIVE(SDL_CDStatus(m_cdrom)) ) {
SDL_CDPlayTracks(m_cdrom, track-1, 0, track, 0);
m_cdplaying = true;
m_cdtrack = track;
}
#endif
}
void SND_SDLCDDevice::PauseCD(bool pause)
{
#ifndef DISABLE_SDL
if (!m_cdrom)
return;
if (pause)
SDL_CDPause(m_cdrom);
else
SDL_CDResume(m_cdrom);
#endif
}
void SND_SDLCDDevice::StopCD()
{
#ifndef DISABLE_SDL
if (m_cdrom)
SDL_CDStop(m_cdrom);
m_cdplaying = false;
#endif
}
void SND_SDLCDDevice::SetCDPlaymode(int playmode)
{
m_cdplaymode = playmode;
}
void SND_SDLCDDevice::SetCDGain(MT_Scalar gain)
{
}

@ -0,0 +1,64 @@
# $Id$
# ***** BEGIN LGPL LICENSE BLOCK *****
#
# Copyright 2009 Jörg Hermann Müller
#
# This file is part of AudaSpace.
#
# AudaSpace is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# AudaSpace 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 Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
#
# ***** END LGPL LICENSE BLOCK *****
SET(INC . intern FX SRC ${PTHREADS_INC} ${LIBSAMPLERATE_INC})
FILE(GLOB SRC intern/*.cpp intern/*.h FX/*.cpp SRC/*.cpp)
IF(WITH_FFMPEG)
SET(INC ${INC} ffmpeg ${FFMPEG_INC})
FILE(GLOB FFMPEGSRC ffmpeg/*.cpp)
ADD_DEFINITIONS(-DWITH_FFMPEG)
ENDIF(WITH_FFMPEG)
IF(WITH_SDL)
SET(INC ${INC} SDL ${SDL_INCLUDE_DIR})
FILE(GLOB SDLSRC SDL/*.cpp)
ADD_DEFINITIONS(-DWITH_SDL)
ENDIF(WITH_SDL)
IF(WITH_OPENAL)
SET(INC ${INC} OpenAL ${OPENAL_INCLUDE_DIR})
FILE(GLOB OPENALSRC OpenAL/*.cpp)
ADD_DEFINITIONS(-DWITH_OPENAL)
STRING(REGEX MATCH ".*ramework.*" FRAMEWORK ${OPENAL_INCLUDE_DIR})
IF(FRAMEWORK)
ADD_DEFINITIONS(-DAPPLE_FRAMEWORK_FIX)
ENDIF(FRAMEWORK)
ENDIF(WITH_OPENAL)
IF(WITH_JACK)
SET(INC ${INC} jack ${JACK_INC})
FILE(GLOB JACKSRC jack/*.cpp)
ADD_DEFINITIONS(-DWITH_JACK)
ENDIF(WITH_JACK)
IF(WITH_SNDFILE)
SET(INC ${INC} sndfile ${SNDFILE_INC})
FILE(GLOB SNDFILESRC sndfile/*.cpp)
ADD_DEFINITIONS(-DWITH_SNDFILE)
ENDIF(WITH_SNDFILE)
SET(SRC ${SRC} ${FFMPEGSRC} ${SNDFILESRC} ${SDLSRC} ${OPENALSRC} ${JACKSRC})
BLENDERLIB(bf_audaspace "${SRC}" "${INC}")

674
intern/audaspace/COPYING Normal file

@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. 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
them 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 prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. 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.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey 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;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If 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 convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU 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 that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
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.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
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.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
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
state 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) <year> <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 3 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, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program 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, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU 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 Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

@ -0,0 +1,165 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.

@ -0,0 +1,58 @@
/*
* $Id$
*
* ***** BEGIN LGPL LICENSE BLOCK *****
*
* Copyright 2009 Jörg Hermann Müller
*
* This file is part of AudaSpace.
*
* AudaSpace is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* AudaSpace 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
*
* ***** END LGPL LICENSE BLOCK *****
*/
#include "AUD_DelayFactory.h"
#include "AUD_DelayReader.h"
#include "AUD_Space.h"
AUD_DelayFactory::AUD_DelayFactory(AUD_IFactory* factory, float delay) :
AUD_EffectFactory(factory),
m_delay(delay) {}
AUD_DelayFactory::AUD_DelayFactory(float delay) :
AUD_EffectFactory(0),
m_delay(delay) {}
float AUD_DelayFactory::getDelay()
{
return m_delay;
}
void AUD_DelayFactory::setDelay(float delay)
{
m_delay = delay;
}
AUD_IReader* AUD_DelayFactory::createReader()
{
AUD_IReader* reader = getReader();
if(reader != 0)
{
reader = new AUD_DelayReader(reader, m_delay); AUD_NEW("reader")
}
return reader;
}

@ -0,0 +1,70 @@
/*
* $Id$
*
* ***** BEGIN LGPL LICENSE BLOCK *****
*
* Copyright 2009 Jörg Hermann Müller
*
* This file is part of AudaSpace.
*
* AudaSpace is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* AudaSpace 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
*
* ***** END LGPL LICENSE BLOCK *****
*/
#ifndef AUD_DELAYFACTORY
#define AUD_DELAYFACTORY
#include "AUD_EffectFactory.h"
/**
* This factory plays another factory delayed.
*/
class AUD_DelayFactory : public AUD_EffectFactory
{
private:
/**
* The delay in samples.
*/
float m_delay;
public:
/**
* Creates a new delay factory.
* \param factory The input factory.
* \param delay The desired delay in seconds.
*/
AUD_DelayFactory(AUD_IFactory* factory = 0, float delay = 0);
/**
* Creates a new delay factory.
* \param delay The desired delay in seconds.
*/
AUD_DelayFactory(float delay);
/**
* Returns the delay in seconds.
*/
float getDelay();
/**
* Sets the delay.
* \param delay The new delay value in seconds.
*/
void setDelay(float delay);
virtual AUD_IReader* createReader();
};
#endif //AUD_DELAYFACTORY

@ -0,0 +1,111 @@
/*
* $Id$
*
* ***** BEGIN LGPL LICENSE BLOCK *****
*
* Copyright 2009 Jörg Hermann Müller
*
* This file is part of AudaSpace.
*
* AudaSpace is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* AudaSpace 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
*
* ***** END LGPL LICENSE BLOCK *****
*/
#include "AUD_DelayReader.h"
#include "AUD_Buffer.h"
#include <cstring>
AUD_DelayReader::AUD_DelayReader(AUD_IReader* reader, float delay) :
AUD_EffectReader(reader)
{
m_delay = (int)(delay * reader->getSpecs().rate);
m_remdelay = m_delay;
m_buffer = new AUD_Buffer(); AUD_NEW("buffer")
}
AUD_DelayReader::~AUD_DelayReader()
{
delete m_buffer; AUD_DELETE("buffer")
}
void AUD_DelayReader::seek(int position)
{
if(position < 0)
return;
if(position < m_delay)
{
m_remdelay = m_delay - position;
m_reader->seek(0);
}
else
{
m_remdelay = 0;
m_reader->seek(position - m_delay);
}
}
int AUD_DelayReader::getLength()
{
int len = m_reader->getLength();
if(len < 0)
return len;
return len+m_delay;
}
int AUD_DelayReader::getPosition()
{
if(m_remdelay > 0)
return m_delay-m_remdelay;
return m_reader->getPosition() + m_delay;
}
void AUD_DelayReader::read(int & length, sample_t* & buffer)
{
if(m_remdelay > 0)
{
int samplesize = AUD_SAMPLE_SIZE(m_reader->getSpecs());
if(m_buffer->getSize() < length*samplesize)
m_buffer->resize(length*samplesize);
if(length > m_remdelay)
{
if(getSpecs().format == AUD_FORMAT_U8)
memset(m_buffer->getBuffer(), 0x80, m_remdelay*samplesize);
else
memset(m_buffer->getBuffer(), 0, m_remdelay*samplesize);
int len = length - m_remdelay;
m_reader->read(len, buffer);
memcpy(m_buffer->getBuffer()+m_remdelay*samplesize,
buffer, len*samplesize);
if(len < length-m_remdelay)
length = m_remdelay + len;
m_remdelay = 0;
}
else
{
if(getSpecs().format == AUD_FORMAT_U8)
memset(m_buffer->getBuffer(), 0x80, length*samplesize);
else
memset(m_buffer->getBuffer(), 0, length*samplesize);
m_remdelay -= length;
}
buffer = m_buffer->getBuffer();
}
else
m_reader->read(length, buffer);
}

@ -0,0 +1,73 @@
/*
* $Id$
*
* ***** BEGIN LGPL LICENSE BLOCK *****
*
* Copyright 2009 Jörg Hermann Müller
*
* This file is part of AudaSpace.
*
* AudaSpace is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* AudaSpace 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
*
* ***** END LGPL LICENSE BLOCK *****
*/
#ifndef AUD_DELAYREADER
#define AUD_DELAYREADER
#include "AUD_EffectReader.h"
class AUD_Buffer;
/**
* This class reads another reader and changes it's delay.
*/
class AUD_DelayReader : public AUD_EffectReader
{
private:
/**
* The playback buffer.
*/
AUD_Buffer *m_buffer;
/**
* The delay level.
*/
int m_delay;
/**
* The remaining delay for playback.
*/
int m_remdelay;
public:
/**
* Creates a new delay reader.
* \param reader The reader to read from.
* \param delay The delay in seconds.
* \exception AUD_Exception Thrown if the reader specified is NULL.
*/
AUD_DelayReader(AUD_IReader* reader, float delay);
/**
* Destroys the reader.
*/
virtual ~AUD_DelayReader();
virtual void seek(int position);
virtual int getLength();
virtual int getPosition();
virtual void read(int & length, sample_t* & buffer);
};
#endif //AUD_DELAYREADER

@ -0,0 +1,158 @@
/*
* $Id$
*
* ***** BEGIN LGPL LICENSE BLOCK *****
*
* Copyright 2009 Jörg Hermann Müller
*
* This file is part of AudaSpace.
*
* AudaSpace is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* AudaSpace 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
*
* ***** END LGPL LICENSE BLOCK *****
*/
#include "AUD_DoubleReader.h"
#include "AUD_Buffer.h"
#include <cstring>
AUD_DoubleReader::AUD_DoubleReader(AUD_IReader* reader1,
AUD_IReader* reader2) :
m_reader1(reader1), m_reader2(reader2)
{
try
{
if(!reader1)
AUD_THROW(AUD_ERROR_READER);
if(!reader2)
AUD_THROW(AUD_ERROR_READER);
AUD_Specs s1, s2;
s1 = reader1->getSpecs();
s2 = reader2->getSpecs();
if(memcmp(&s1, &s2, sizeof(AUD_Specs)) != 0)
AUD_THROW(AUD_ERROR_READER);
}
catch(AUD_Exception e)
{
if(reader1)
{
delete reader1; AUD_DELETE("reader")
}
if(reader2)
{
delete reader2; AUD_DELETE("reader")
}
throw;
}
m_buffer = new AUD_Buffer(); AUD_NEW("buffer")
m_finished1 = false;
}
AUD_DoubleReader::~AUD_DoubleReader()
{
delete m_reader1; AUD_DELETE("reader")
delete m_reader2; AUD_DELETE("reader")
delete m_buffer; AUD_DELETE("buffer")
}
bool AUD_DoubleReader::isSeekable()
{
return false;
}
void AUD_DoubleReader::seek(int position)
{
int length1 = m_reader1->getLength();
if(position < 0)
position = 0;
if(position < length1)
{
m_reader1->seek(position);
m_reader2->seek(0);
m_finished1 = false;
}
else
{
m_reader2->seek(position-length1);
m_finished1 = true;
}
}
int AUD_DoubleReader::getLength()
{
int len1 = m_reader1->getLength();
int len2 = m_reader2->getLength();
if(len1 < 0 || len2 < 0)
return -1;
return len1 + len2;
}
int AUD_DoubleReader::getPosition()
{
return m_reader1->getPosition() + m_reader2->getPosition();
}
AUD_Specs AUD_DoubleReader::getSpecs()
{
return m_reader1->getSpecs();
}
AUD_ReaderType AUD_DoubleReader::getType()
{
if(m_reader1->getType() == AUD_TYPE_BUFFER &&
m_reader2->getType() == AUD_TYPE_BUFFER)
return AUD_TYPE_BUFFER;
return AUD_TYPE_STREAM;
}
bool AUD_DoubleReader::notify(AUD_Message &message)
{
return m_reader1->notify(message) | m_reader2->notify(message);
}
void AUD_DoubleReader::read(int & length, sample_t* & buffer)
{
if(!m_finished1)
{
int len = length;
m_reader1->read(len, buffer);
if(len < length)
{
int samplesize = AUD_SAMPLE_SIZE(m_reader1->getSpecs());
if(m_buffer->getSize() < length * samplesize)
m_buffer->resize(length * samplesize);
memcpy(m_buffer->getBuffer(), buffer, len*samplesize);
len = length - len;
length -= len;
m_reader2->read(len, buffer);
memcpy(m_buffer->getBuffer() + length*samplesize,
buffer, len*samplesize);
length += len;
buffer = m_buffer->getBuffer();
m_finished1 = true;
}
}
else
{
m_reader2->read(length, buffer);
}
}

@ -0,0 +1,83 @@
/*
* $Id$
*
* ***** BEGIN LGPL LICENSE BLOCK *****
*
* Copyright 2009 Jörg Hermann Müller
*
* This file is part of AudaSpace.
*
* AudaSpace is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* AudaSpace 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
*
* ***** END LGPL LICENSE BLOCK *****
*/
#ifndef AUD_DOUBLEREADER
#define AUD_DOUBLEREADER
#include "AUD_IReader.h"
class AUD_Buffer;
/**
* This reader plays two readers with the same specs sequently.
*/
class AUD_DoubleReader : public AUD_IReader
{
private:
/**
* The first reader.
*/
AUD_IReader* m_reader1;
/**
* The second reader.
*/
AUD_IReader* m_reader2;
/**
* Whether we've reached the end of the first reader.
*/
bool m_finished1;
/**
* The playback buffer for the intersecting part.
*/
AUD_Buffer* m_buffer;
public:
/**
* Creates a new ping pong reader.
* \param reader1 The first reader to read from.
* \param reader2 The second reader to read from.
* \exception AUD_Exception Thrown if one of the reader specified is NULL
* or the specs from the readers differ.
*/
AUD_DoubleReader(AUD_IReader* reader1, AUD_IReader* reader2);
/**
* Destroys the reader.
*/
virtual ~AUD_DoubleReader();
virtual bool isSeekable();
virtual void seek(int position);
virtual int getLength();
virtual int getPosition();
virtual AUD_Specs getSpecs();
virtual AUD_ReaderType getType();
virtual bool notify(AUD_Message &message);
virtual void read(int & length, sample_t* & buffer);
};
#endif //AUD_DOUBLEREADER

@ -0,0 +1,50 @@
/*
* $Id$
*
* ***** BEGIN LGPL LICENSE BLOCK *****
*
* Copyright 2009 Jörg Hermann Müller
*
* This file is part of AudaSpace.
*
* AudaSpace is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* AudaSpace 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
*
* ***** END LGPL LICENSE BLOCK *****
*/
#include "AUD_EffectFactory.h"
#include "AUD_IReader.h"
AUD_IReader* AUD_EffectFactory::getReader()
{
if(m_factory != 0)
return m_factory->createReader();
return 0;
}
AUD_EffectFactory::AUD_EffectFactory(AUD_IFactory* factory)
{
m_factory = factory;
}
void AUD_EffectFactory::setFactory(AUD_IFactory* factory)
{
m_factory = factory;
}
AUD_IFactory* AUD_EffectFactory::getFactory()
{
return m_factory;
}

@ -0,0 +1,76 @@
/*
* $Id$
*
* ***** BEGIN LGPL LICENSE BLOCK *****
*
* Copyright 2009 Jörg Hermann Müller
*
* This file is part of AudaSpace.
*
* AudaSpace is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* AudaSpace 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
*
* ***** END LGPL LICENSE BLOCK *****
*/
#ifndef AUD_EFFECTFACTORY
#define AUD_EFFECTFACTORY
#include "AUD_IFactory.h"
/**
* This factory is a base class for all effect factories that take one other
* factory as input.
*/
class AUD_EffectFactory : public AUD_IFactory
{
protected:
/**
* If there is no reader it is created out of this factory.
*/
AUD_IFactory* m_factory;
/**
* Returns the reader created out of the factory.
* This method can be used for the createReader function of the implementing
* classes.
* \return The reader created out of the factory or NULL if there is none.
*/
AUD_IReader* getReader();
public:
/**
* Creates a new factory.
* \param factory The input factory.
*/
AUD_EffectFactory(AUD_IFactory* factory);
/**
* Destroys the factory.
*/
virtual ~AUD_EffectFactory() {}
/**
* Sets the input factory.
* \param factory The input factory.
*/
void setFactory(AUD_IFactory* factory);
/**
* Returns the saved factory.
* \return The factory or NULL if there has no factory been saved.
*/
AUD_IFactory* getFactory();
};
#endif //AUD_EFFECTFACTORY

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