A stab at fmodex support on windows. To use, install 'FMOD Ex Programmers API' to its defualt program files directory, and run develop.py with -DFMODEX:BOOL=ON set. That /should/ be all it takes.

This commit is contained in:
Shyotl
2011-12-22 18:01:07 -06:00
parent 6920bee5e2
commit c73414f1a1
14 changed files with 1914 additions and 31 deletions

View File

@@ -7,7 +7,15 @@ include(Boost)
include(DBusGlib)
include(DirectX)
include(ELFIO)
include(FMOD)
if(FMODEX)
include(FMODEX)
if(FMODEX)
set(FMOD OFF)
endif(FMODEX)
endif(FMODEX)
if(NOT FMODEX)
include(FMOD)
endif(NOT FMODEX)
include(OPENAL)
include(HUNSPELL)
include(FindOpenGL)
@@ -1168,7 +1176,6 @@ if (WINDOWS)
comdlg32
${DINPUT_LIBRARY}
${DXGUID_LIBRARY}
fmodvc
gdi32
kernel32
odbc32
@@ -1182,6 +1189,13 @@ if (WINDOWS)
winspool
)
if(FMODEX)
list(APPEND viewer_LIBRARIES ${FMODEX_LIBRARY})
endif(FMODEX)
if(FMOD)
list(APPEND viewer_LIBRARIES ${FMOD_LIBRARY})
endif(FMOD)
find_library(INTEL_MEMOPS_LIBRARY
NAMES ll_intel_memops
PATHS
@@ -1288,13 +1302,23 @@ if (OPENAL)
set(LLSTARTUP_COMPILE_FLAGS "${LLSTARTUP_COMPILE_FLAGS} -DLL_OPENAL")
endif (OPENAL)
if (FMOD)
set(LLSTARTUP_COMPILE_FLAGS "${LLSTARTUP_COMPILE_FLAGS} -DLL_FMOD")
if (FMOD OR FMODEX)
if(FMODEX)
set(LLSTARTUP_COMPILE_FLAGS "${LLSTARTUP_COMPILE_FLAGS} -DLL_FMODEX")
endif(FMODEX)
if(FMOD)
set(LLSTARTUP_COMPILE_FLAGS "${LLSTARTUP_COMPILE_FLAGS} -DLL_FMOD")
endif(FMOD)
if (NOT WINDOWS)
set(fmodwrapper_SOURCE_FILES fmodwrapper.cpp)
add_library(fmodwrapper SHARED ${fmodwrapper_SOURCE_FILES})
set(fmodwrapper_needed_LIBRARIES ${FMOD_LIBRARY})
if(FMODEX)
set(fmodwrapper_needed_LIBRARIES ${FMODEX_LIBRARY})
endif(FMODEX)
if(FMOD)
set(fmodwrapper_needed_LIBRARIES "${fmodwrapper_needed_LIBRARIES} ${FMOD_LIBRARY}")
endif(FMOD)
if (DARWIN)
list(APPEND fmodwrapper_needed_LIBRARIES ${CARBON_LIBRARY})
set_target_properties(
@@ -1308,7 +1332,7 @@ if (FMOD)
set(FMODWRAPPER_LIBRARY fmodwrapper)
target_link_libraries(fmodwrapper ${fmodwrapper_needed_LIBRARIES})
endif (NOT WINDOWS)
endif (FMOD)
endif (FMOD OR FMODEX)
set_source_files_properties(llstartup.cpp PROPERTIES COMPILE_FLAGS "${LLSTARTUP_COMPILE_FLAGS}")
@@ -1347,9 +1371,13 @@ if (WINDOWS)
set(release_flags "/MAP:Release/${VIEWER_BINARY_NAME}.map")
endif()
if (FMODEX)
set(EXTRA_LINKER_FLAGS "/DELAYLOAD:fmodex.dll")
endif (FMODEX)
set_target_properties(${VIEWER_BINARY_NAME}
PROPERTIES
LINK_FLAGS "/debug /NODEFAULTLIB:LIBCMT /SUBSYSTEM:WINDOWS ${GOOGLE_PERFTOOLS_LINKER_FLAGS}"
LINK_FLAGS "/debug /NODEFAULTLIB:LIBCMT /SUBSYSTEM:WINDOWS ${GOOGLE_PERFTOOLS_LINKER_FLAGS} ${EXTRA_LINKER_FLAGS}"
LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMT;LIBCMTD;MSVCRT\""
LINK_FLAGS_RELEASE ${release_flags}
)

View File

@@ -32,12 +32,24 @@
extern "C"
{
#if LL_FMODEX
void FSOUND_Sound_Init(void);
#endif
#if LL_FMOD
void FSOUND_Init(void);
#endif
}
void* fmodwrapper(void)
{
// When building the fmodwrapper library, the linker doesn't seem to want to bring in libfmod.a unless I explicitly
// reference at least one symbol in the library. This seemed like the simplest way.
return (void*)&FSOUND_Init;
void *ret = NULL;
#if LL_FMODEX
ret = (void*)&FSOUND_Sound_Init;
#endif
#if LL_FMOD
ret = (void*)&FSOUND_Init;
#endif
return ret;
}

View File

@@ -43,7 +43,11 @@
#include "llviewermedia_streamingaudio.h"
#include "llaudioengine.h"
#ifdef LL_FMOD
#if LL_FMODEX
# include "llaudioengine_fmodex.h"
#endif
#if LL_FMOD
# include "llaudioengine_fmod.h"
#endif
@@ -666,6 +670,17 @@ bool idle_startup()
}
#endif
#ifdef LL_FMODEX
if (!gAudiop
#if !LL_WINDOWS
&& NULL == getenv("LL_BAD_FMODEX_DRIVER")
#endif // !LL_WINDOWS
)
{
gAudiop = (LLAudioEngine *) new LLAudioEngine_FMODEX();
}
#endif
#ifdef LL_FMOD
if (!gAudiop
#if !LL_WINDOWS