diff --git a/engine/MUNGA_L4/L4AUDLVL.cpp b/engine/MUNGA_L4/L4AUDLVL.cpp index 2c3aaee..53c5c3d 100644 --- a/engine/MUNGA_L4/L4AUDLVL.cpp +++ b/engine/MUNGA_L4/L4AUDLVL.cpp @@ -141,7 +141,7 @@ void if (sourceState == AL_INITIAL) { alSourcei(sourceSet.sources[i],AL_BUFFER,AL_getBuffer(info.bufferIndex)); - { static int s_a=0; if (getenv("BT_AUDIO_LOG") && s_a++<8) DEBUG_STREAM << "[audio] SetupPatch attach bank=" << (int)bankID << " patch=" << (int)patchID << " buf=" << info.bufferIndex << "\n" << std::flush; } + { static int s_a=0; if (getenv("BT_AUDIO_LOG") && s_a++<24) DEBUG_STREAM << "[audio] SetupPatch src=" << sourceSet.sources[i] << " file=" << (info.file?info.file:"?") << " loop=" << (info.loop==ForceStatic?0:1) << "\n" << std::flush; } alSourcei(sourceSet.sources[i],AL_SOURCE_RELATIVE,AL_TRUE); AudioRenderer *render = application->GetAudioRenderer(); @@ -190,7 +190,7 @@ void PatchLevelOfDetail::PlayNote(SourceSet sourceSet) if (state != AL_PLAYING) { alSourcePlay(sourceSet.sources[i]); - { static int s_p=0; if (getenv("BT_AUDIO_LOG") && s_p++<8) DEBUG_STREAM << "[audio] PlayNote alSourcePlay src=" << sourceSet.sources[i] << "\n" << std::flush; } + { static int s_p=0; if (getenv("BT_AUDIO_LOG") && s_p++<30) DEBUG_STREAM << "[audio] PlayNote alSourcePlay src=" << sourceSet.sources[i] << "\n" << std::flush; } } ALenum error = alGetError(); @@ -205,6 +205,7 @@ void PatchLevelOfDetail::PlayNote(SourceSet sourceSet) void PatchLevelOfDetail::StopNote(SourceSet sourceSet) { + { static int s_s=0; if (getenv("BT_AUDIO_LOG") && s_s++<30) DEBUG_STREAM << "[audio] StopNote count=" << sourceSet.count << " src0=" << (sourceSet.count>0?sourceSet.sources[0]:0) << "\n" << std::flush; } if (sourceSet.count >0 && sourceSet.sources != NULL) { alSourceStopv(sourceSet.count, sourceSet.sources); diff --git a/game/reconstructed/heat.hpp b/game/reconstructed/heat.hpp index b1959b0..9228691 100644 --- a/game/reconstructed/heat.hpp +++ b/game/reconstructed/heat.hpp @@ -97,7 +97,13 @@ public: : audioWatcherSocket(0), videoWatcherSocket(0), gaugeWatcherSocket(0) { levelA = levelB = levels; level = 0; } void Initialize(int levels) { levelA = levelB = levels; level = 0; } - void SetLevel(int n) { if (n != level) { level = n; NotifyWatchers(); } } + // StateIndicator::SetState semantics: oldState (levelB@0x10) := currentState + // BEFORE the change, so the audio watcher's StateChanged(oldState,newState) is + // correct -- this is what the inverse/STOP AudioStateTriggers key on (old_state == + // firing/charging state) to StopNote a looping charge/sustain/loading sample when + // the weapon leaves that state. (In the binary levelB@0x10 IS oldState; the + // weapon's LevelCountB() reading @0x10 is that same authentic oldState.) + void SetLevel(int n) { levelB = level; if (n != level) { level = n; NotifyWatchers(); } } int GetLevel() const { return level; } int Level() const { return level; } int LevelCountB() const { return levelB; } // +0x10 (the weapon update-record "reset" source)