Merge branch 'master' into openal

This commit is contained in:
Robert Beckebans 2013-01-05 00:13:51 +01:00
commit b55d668c5c
5 changed files with 60 additions and 34 deletions

View file

@ -665,7 +665,7 @@ void I_InitSoundChannel( int channel, int numOutputChannels_ ) {
activeSound_t *soundchannel = &activeSounds[ channel ]; activeSound_t *soundchannel = &activeSounds[ channel ];
// RB: fixed non-aggregates cannot be initialized with initializer list // RB: fixed non-aggregates cannot be initialized with initializer list
#if (_WIN32_WINNT >= 0x0602 /*_WIN32_WINNT_WIN8*/) #if defined(USE_WINRT) //(_WIN32_WINNT >= 0x0602 /*_WIN32_WINNT_WIN8*/)
X3DAUDIO_VECTOR ZeroVector( 0.0f, 0.0f, 0.0f ); X3DAUDIO_VECTOR ZeroVector( 0.0f, 0.0f, 0.0f );
#else #else
X3DAUDIO_VECTOR ZeroVector = { 0.0f, 0.0f, 0.0f }; X3DAUDIO_VECTOR ZeroVector = { 0.0f, 0.0f, 0.0f };
@ -735,7 +735,7 @@ void I_InitSound() {
int i; int i;
// RB: non-aggregates cannot be initialized with initializer list // RB: non-aggregates cannot be initialized with initializer list
#if (_WIN32_WINNT >= 0x0602 /*_WIN32_WINNT_WIN8*/) #if defined(USE_WINRT) // (_WIN32_WINNT >= 0x0602 /*_WIN32_WINNT_WIN8*/)
X3DAUDIO_VECTOR ZeroVector( 0.0f, 0.0f, 0.0f ); X3DAUDIO_VECTOR ZeroVector( 0.0f, 0.0f, 0.0f );
#else #else
X3DAUDIO_VECTOR ZeroVector = { 0.0f, 0.0f, 0.0f }; X3DAUDIO_VECTOR ZeroVector = { 0.0f, 0.0f, 0.0f };
@ -836,7 +836,7 @@ void I_InitMusic(void)
voiceFormat.cbSize = 0; voiceFormat.cbSize = 0;
// RB: XAUDIO2_VOICE_MUSIC not available on Windows 8 SDK // RB: XAUDIO2_VOICE_MUSIC not available on Windows 8 SDK
#if (_WIN32_WINNT < 0x0602 /*_WIN32_WINNT_WIN8*/) #if !defined(USE_WINRT) //(_WIN32_WINNT < 0x0602 /*_WIN32_WINNT_WIN8*/)
soundSystemLocal.hardware.GetIXAudio2()->CreateSourceVoice( &pMusicSourceVoice, (WAVEFORMATEX *)&voiceFormat, XAUDIO2_VOICE_MUSIC ); soundSystemLocal.hardware.GetIXAudio2()->CreateSourceVoice( &pMusicSourceVoice, (WAVEFORMATEX *)&voiceFormat, XAUDIO2_VOICE_MUSIC );
#endif #endif
// RB end // RB end

View file

@ -13,7 +13,7 @@ option(SDL2
"Use SDL2 instead of SDL1.2" OFF) "Use SDL2 instead of SDL1.2" OFF)
option(OPENAL option(OPENAL
"Use OpenAL soft instead of XAudio2" ON) "Use OpenAL soft instead of XAudio2" OFF)
if(MSVC) if(MSVC)
#message(STATUS CMAKE_ROOT: ${CMAKE_ROOT}) #message(STATUS CMAKE_ROOT: ${CMAKE_ROOT})
@ -93,15 +93,41 @@ elseif(MSVC)
# Omit Frame Pointers # Omit Frame Pointers
# "/Oy", # "/Oy",
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /D _DEBUG /MP /MTd") # if(MSVC_VERSION EQUAL 1700)
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MP /Oi /Oy /MT") # #message(STATUS "$ENV{LIBPATH}")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /MP /Oi /MTd")
set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} /MP /Oi /Oy /MT") # find_path(Windows_winmd_DIR NAMES Windows.winmd
# HINTS
# C:/Program Files (x86)/Windows Kits/8.0/References/CommonConfiguration/Neutral
# PATH_SUFFIXES "Neutral")
# message(STATUS "${Windows_winmd_DIR}")
# #set(WINRT_OPTIONS "/ZW /D USE_WINRT /AI \"C:\Program Files (x86)\Windows Kits\8.0\References\CommonConfiguration\Neutral\"")
# #set(WINRT_OPTIONS "/ZW /D USE_WINRT /AI \"$ENV{LIBPATH}\" ")
# set(WINRT_OPTIONS "/ZW /D USE_WINRT")
# set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /D _DEBUG /MP ${WINRT_OPTIONS}")
# set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MP /Oi /Oy ${WINRT_OPTIONS}")
# set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /MP /Oi ${WINRT_OPTIONS}")
# set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} /MP /Oi /Oy ${WINRT_OPTIONS}")
# set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MP ${WINRT_OPTIONS}")
# set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MP /Oi /Oy ${WINRT_OPTIONS}")
# set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /MP ${WINRT_OPTIONS}")
# set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /MP /Oi /Oy ${WINRT_OPTIONS}")
# else()
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /D _DEBUG /MP /MTd")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MP /Oi /Oy /MT")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /MP /Oi /MTd")
set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} /MP /Oi /Oy /MT")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MP /MTd")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MP /Oi /Oy /MT")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /MP /MTd")
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /MP /Oi /Oy /MT")
# endif()
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MP /MTd")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MP /Oi /Oy /MT")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /MP /MTd")
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /MP /Oi /Oy /MT")
add_definitions(-DWIN32 add_definitions(-DWIN32
-D_WINDOWS -D_WINDOWS
@ -1031,24 +1057,24 @@ include_directories(
if(MSVC) if(MSVC)
if(MSVC_VERSION EQUAL 1700) # if(MSVC_VERSION EQUAL 1700)
set(DirectX_LIBRARIES # set(DirectX_LIBRARIES
dinput8 # dinput8
dsound # dsound
dxguid # dxguid
#dxerr # #dxerr
Xinput # Xinput
xaudio2.lib # xaudio2.lib
) # )
if(NOT OPENAL) # if(NOT OPENAL)
list(APPEND DirectX_LIBRARIES xaudio2.lib) # list(APPEND DirectX_LIBRARIES xaudio2.lib)
endif() # endif()
else() # else()
find_package(DirectX REQUIRED) find_package(DirectX REQUIRED)
include_directories(${DirectX_INCLUDE_DIR}) include_directories(${DirectX_INCLUDE_DIR})
endif() #endif()
if(OPENAL) if(OPENAL)
add_definitions(-DUSE_OPENAL) add_definitions(-DUSE_OPENAL)

View file

@ -3,7 +3,7 @@
Doom 3 BFG Edition GPL Source Code Doom 3 BFG Edition GPL Source Code
Copyright (C) 1993-2012 id Software LLC, a ZeniMax Media company. Copyright (C) 1993-2012 id Software LLC, a ZeniMax Media company.
Copyright (C) 2012 Robert Beckebans Copyright (C) 2013 Robert Beckebans
This file is part of the Doom 3 BFG Edition GPL Source Code ("Doom 3 BFG Edition Source Code"). This file is part of the Doom 3 BFG Edition GPL Source Code ("Doom 3 BFG Edition Source Code").
@ -74,7 +74,7 @@ void listDevices_f( const idCmdArgs& args )
} }
// RB: not available on Windows 8 SDK // RB: not available on Windows 8 SDK
#if (_WIN32_WINNT >= 0x0602 /*_WIN32_WINNT_WIN8*/) #if defined(USE_WINRT) //(_WIN32_WINNT >= 0x0602 /*_WIN32_WINNT_WIN8*/)
// FIXME // FIXME
@ -217,7 +217,7 @@ void idSoundHardware_XAudio2::Init()
DWORD xAudioCreateFlags = 0; DWORD xAudioCreateFlags = 0;
// RB: not available on Windows 8 SDK // RB: not available on Windows 8 SDK
#if (_WIN32_WINNT < 0x0602 /*_WIN32_WINNT_WIN8*/) && defined(_DEBUG) #if !defined(USE_WINRT) && defined(_DEBUG) // (_WIN32_WINNT < 0x0602 /*_WIN32_WINNT_WIN8*/) && defined(_DEBUG)
xAudioCreateFlags |= XAUDIO2_DEBUG_ENGINE; xAudioCreateFlags |= XAUDIO2_DEBUG_ENGINE;
#endif #endif
// RB end // RB end
@ -227,7 +227,7 @@ void idSoundHardware_XAudio2::Init()
// RB: not available on Windows 8 SDK // RB: not available on Windows 8 SDK
if( FAILED( XAudio2Create( &pXAudio2, xAudioCreateFlags, xAudioProcessor ) ) ) if( FAILED( XAudio2Create( &pXAudio2, xAudioCreateFlags, xAudioProcessor ) ) )
{ {
#if (_WIN32_WINNT < 0x0602 /*_WIN32_WINNT_WIN8*/) && defined(_DEBUG) #if !defined(USE_WINRT) && defined(_DEBUG) // (_WIN32_WINNT < 0x0602 /*_WIN32_WINNT_WIN8*/) && defined(_DEBUG)
if( xAudioCreateFlags & XAUDIO2_DEBUG_ENGINE ) if( xAudioCreateFlags & XAUDIO2_DEBUG_ENGINE )
{ {
// in case the debug engine isn't installed // in case the debug engine isn't installed
@ -258,7 +258,7 @@ void idSoundHardware_XAudio2::Init()
soundEngineCallback.hardware = this; soundEngineCallback.hardware = this;
// RB: not available on Windows 8 SDK // RB: not available on Windows 8 SDK
#if (_WIN32_WINNT >= 0x0602 /*_WIN32_WINNT_WIN8*/) #if defined(USE_WINRT) //(_WIN32_WINNT >= 0x0602 /*_WIN32_WINNT_WIN8*/)
// FIXME // FIXME

View file

@ -108,7 +108,7 @@ typedef enum
#define OPERATION_SET 1 #define OPERATION_SET 1
// RB: not available on Windows 8 SDK // RB: not available on Windows 8 SDK
#if (_WIN32_WINNT < 0x0602 /*_WIN32_WINNT_WIN8*/) #if !defined(USE_WINRT) // (_WIN32_WINNT < 0x0602 /*_WIN32_WINNT_WIN8*/)
#include <dxsdkver.h> #include <dxsdkver.h>
#endif #endif
// RB end // RB end
@ -118,7 +118,7 @@ typedef enum
#include <X3DAudio.h> #include <X3DAudio.h>
// RB: not available on Windows 8 SDK // RB: not available on Windows 8 SDK
#if (_WIN32_WINNT < 0x0602 /*_WIN32_WINNT_WIN8*/) #if !defined(USE_WINRT) // (_WIN32_WINNT < 0x0602 /*_WIN32_WINNT_WIN8*/)
#include <xma2defs.h> #include <xma2defs.h>
#endif #endif
// RB end // RB end

View file

@ -31,7 +31,7 @@ If you have questions concerning this license or the applicable additional terms
// RB: <DxErr.h> not available on Windows 8 SDK // RB: <DxErr.h> not available on Windows 8 SDK
#if defined(__MINGW32__) #if defined(__MINGW32__)
#include <sal.h> #include <sal.h>
#elif (_WIN32_WINNT < 0x0602 /*_WIN32_WINNT_WIN8*/) #elif !defined(USE_WINRT) // (_WIN32_WINNT < 0x0602 /*_WIN32_WINNT_WIN8*/)
#include <DxErr.h> #include <DxErr.h>
#endif #endif
// RB end // RB end