From 1fc637f07d78809834058959e96c9d891f1c5985 Mon Sep 17 00:00:00 2001 From: gez Date: Sun, 14 Aug 2011 10:03:19 +0000 Subject: [PATCH] * Updated to ZDoom r3278: - Backported FMOD Ex 4.34 fixes from gzdoom-macosx. (With changes to continue to allow compilation with 4.22-4.28.) - Added ammo1capacity and ammo2capacity to drawnumber. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1239 b0f79afe-0144-0410-b225-9a4edf0717df --- specs/fmod_version.txt | 2 +- src/g_shared/sbarinfo_commands.cpp | 24 ++++++++++++++++++++++++ src/sound/fmodsound.cpp | 23 +++++++++++++++++++++-- src/svnrevision.h | 4 ++-- src/win32/win32gliface.cpp | 1 + src/win32/win32video.cpp | 1 + wadsrc/static/menudef.txt | 1 + 7 files changed, 51 insertions(+), 5 deletions(-) diff --git a/specs/fmod_version.txt b/specs/fmod_version.txt index c285c50b..1016b938 100644 --- a/specs/fmod_version.txt +++ b/specs/fmod_version.txt @@ -1,3 +1,3 @@ -This version of ZDoom must be compiled with any version between 4.22 and 4.28 inclusive. +This version of ZDoom must be compiled with any version between 4.22 and 4.28 inclusive or 4.34. Use of the latest 4.26 is recommended though due to technical issues with 4.28. diff --git a/src/g_shared/sbarinfo_commands.cpp b/src/g_shared/sbarinfo_commands.cpp index f31a5f77..8b62359f 100644 --- a/src/g_shared/sbarinfo_commands.cpp +++ b/src/g_shared/sbarinfo_commands.cpp @@ -890,6 +890,10 @@ class CommandDrawNumber : public CommandDrawString value = AMMO1; else if(sc.Compare("ammo2")) value = AMMO2; + else if(sc.Compare("ammo1capacity")) + value = AMMO1CAPACITY; + else if(sc.Compare("ammo2capacity")) + value = AMMO2CAPACITY; else if(sc.Compare("score")) value = SCORE; else if(sc.Compare("ammo")) //request the next string to be an ammo type @@ -1124,6 +1128,24 @@ class CommandDrawNumber : public CommandDrawString num = 0; break; } + case AMMO1CAPACITY: + if(statusBar->ammo1 == NULL) //no ammo, do not draw + { + str = ""; + return; + } + else + num = statusBar->ammo1->MaxAmount; + break; + case AMMO2CAPACITY: + if(statusBar->ammo2 == NULL) //no ammo, do not draw + { + str = ""; + return; + } + else + num = statusBar->ammo2->MaxAmount; + break; case AMMOCAPACITY: { AInventory* item = statusBar->CPlayer->mo->FindInventory(inventoryItem); @@ -1283,6 +1305,8 @@ class CommandDrawNumber : public CommandDrawString AMMO1, AMMO2, AMMO, + AMMO1CAPACITY, + AMMO2CAPACITY, AMMOCAPACITY, FRAGS, INVENTORY, diff --git a/src/sound/fmodsound.cpp b/src/sound/fmodsound.cpp index 308e6db9..e1a15bb2 100644 --- a/src/sound/fmodsound.cpp +++ b/src/sound/fmodsound.cpp @@ -75,6 +75,10 @@ extern HWND Window; #define SPECTRUM_SIZE 256 +#if FMOD_VERSION < 0x43400 +#define FMOD_OPENSTATE_PLAYING FMOD_OPENSTATE_STREAMING +#endif + // TYPES ------------------------------------------------------------------- struct FEnumList @@ -157,7 +161,9 @@ static const FEnumList OutputNames[] = { "Windows Multimedia", FMOD_OUTPUTTYPE_WINMM }, { "WinMM", FMOD_OUTPUTTYPE_WINMM }, { "WaveOut", FMOD_OUTPUTTYPE_WINMM }, +#if FMOD_VERSION < 0x43400 { "OpenAL", FMOD_OUTPUTTYPE_OPENAL }, +#endif { "WASAPI", FMOD_OUTPUTTYPE_WASAPI }, { "ASIO", FMOD_OUTPUTTYPE_ASIO }, @@ -165,6 +171,9 @@ static const FEnumList OutputNames[] = { "OSS", FMOD_OUTPUTTYPE_OSS }, { "ALSA", FMOD_OUTPUTTYPE_ALSA }, { "ESD", FMOD_OUTPUTTYPE_ESD }, +#if FMOD_VERSION >= 0x43400 + { "PulseAudio", FMOD_OUTPUTTYPE_PULSEAUDIO }, +#endif { "SDL", 666 }, // Mac @@ -388,12 +397,17 @@ public: bool is; FMOD_OPENSTATE openstate = FMOD_OPENSTATE_MAX; bool starving; + bool diskbusy; if (Stream == NULL) { return true; } +#if FMOD_VERSION < 0x43400 if (FMOD_OK != Stream->getOpenState(&openstate, NULL, &starving)) +#else + if (FMOD_OK != Stream->getOpenState(&openstate, NULL, &starving, &diskbusy)) +#endif { openstate = FMOD_OPENSTATE_ERROR; } @@ -436,7 +450,7 @@ public: Owner->Sys->setStreamBufferSize(16*1024, FMOD_TIMEUNIT_RAWBYTES); return result != FMOD_OK; } - if (JustStarted && openstate == FMOD_OPENSTATE_STREAMING) + if (JustStarted && openstate == FMOD_OPENSTATE_PLAYING) { JustStarted = false; } @@ -480,14 +494,19 @@ public: unsigned int percentbuffered; unsigned int position; bool starving; + bool diskbusy; float volume; float frequency; bool paused; bool isplaying; +#if FMOD_VERSION < 0x43400 if (FMOD_OK == Stream->getOpenState(&openstate, &percentbuffered, &starving)) +#else + if (FMOD_OK == Stream->getOpenState(&openstate, &percentbuffered, &starving, &diskbusy)) +#endif { - stats = (openstate <= FMOD_OPENSTATE_STREAMING ? OpenStateNames[openstate] : "Unknown state"); + stats = (openstate <= FMOD_OPENSTATE_PLAYING ? OpenStateNames[openstate] : "Unknown state"); stats.AppendFormat(",%3d%% buffered, %s", percentbuffered, starving ? "Starving" : "Well-fed"); } if (Channel == NULL) diff --git a/src/svnrevision.h b/src/svnrevision.h index 07f43474..635ac4cc 100644 --- a/src/svnrevision.h +++ b/src/svnrevision.h @@ -3,5 +3,5 @@ // This file was automatically generated by the // updaterevision tool. Do not edit by hand. -#define ZD_SVN_REVISION_STRING "3276" -#define ZD_SVN_REVISION_NUMBER 3276 +#define ZD_SVN_REVISION_STRING "3278" +#define ZD_SVN_REVISION_NUMBER 3278 diff --git a/src/win32/win32gliface.cpp b/src/win32/win32gliface.cpp index 629eb349..2c6af906 100644 --- a/src/win32/win32gliface.cpp +++ b/src/win32/win32gliface.cpp @@ -155,6 +155,7 @@ void Win32GLVideo::MakeModesList() void Win32GLVideo::StartModeIterator(int bits, bool fs) { + Printf("Win32GLVideo::StartModeIterator(%x, %u)\n", bits, fs); m_IteratorMode = m_Modes; // I think it's better to ignore the game-side settings of bit depth. // The GL renderer will always default to 32 bits, except in compatibility mode diff --git a/src/win32/win32video.cpp b/src/win32/win32video.cpp index d82744ef..572afa5a 100644 --- a/src/win32/win32video.cpp +++ b/src/win32/win32video.cpp @@ -582,6 +582,7 @@ void Win32Video::ScaleModes (int doubling) void Win32Video::StartModeIterator (int bits, bool fs) { + Printf("Win32Video::StartModeIterator(%x, %u)\n", bits, fs); m_IteratorMode = m_Modes; m_IteratorBits = bits; m_IteratorFS = fs; diff --git a/wadsrc/static/menudef.txt b/wadsrc/static/menudef.txt index f7e0b51b..73928b8b 100644 --- a/wadsrc/static/menudef.txt +++ b/wadsrc/static/menudef.txt @@ -1266,6 +1266,7 @@ OptionString SoundOutputsUnix "ALSA", "ALSA" "SDL", "SDL" "ESD", "ESD" + "PulseAudio", "PulseAudio" "No sound", "No sound" }