diff --git a/engine/MUNGA/AUDSEQ.cpp b/engine/MUNGA/AUDSEQ.cpp index f66f4ff..9df6360 100644 --- a/engine/MUNGA/AUDSEQ.cpp +++ b/engine/MUNGA/AUDSEQ.cpp @@ -475,7 +475,8 @@ void // // #99 probe: PER-SEQUENCE throttle. A single shared counter here hid the // alarm sequence entirely -- the busy sequences ate every slot. - if (getenv("BT_ATTRBIND_LOG") && isLooped) { if (runProbeCount < 6) + static const int s_seqDiag = (getenv("BT_ATTRBIND_LOG") != 0); // hot path: resolve once + if (s_seqDiag && isLooped) { if (runProbeCount < 6) { ++runProbeCount; DEBUG_STREAM << "[seqrun] seq=" << (void *)this << " isRunning=" << (int)isRunning @@ -494,7 +495,7 @@ void Check(audioControlEventIterator); control_event = audioControlEventIterator->GetCurrent(); - if (getenv("BT_ATTRBIND_LOG")) { static int s_nr=0; + if (s_seqDiag) { static int s_nr=0; if (control_event != NULL && !IsEventReady(control_event) && (s_nr++ % 500)==0) { AudioTime off(startTime); @@ -539,7 +540,7 @@ void // Send the controller to the connected audio component // Check(control_event); - if (getenv("BT_ATTRBIND_LOG")) { static int s_se=0; if (s_se++<60) + if (s_seqDiag) { static int s_se=0; if (s_se++<60) DEBUG_STREAM << "[seqsend] seq=" << (void *)this << " -> comp=" << (void *)audioComponentSocket.GetCurrent() << " ctl=" << (int)control_event->audioControlID diff --git a/engine/MUNGA/AUDWTHR.cpp b/engine/MUNGA/AUDWTHR.cpp index 9deb1eb..ded3eaf 100644 --- a/engine/MUNGA/AUDWTHR.cpp +++ b/engine/MUNGA/AUDWTHR.cpp @@ -112,7 +112,8 @@ void { Check(this); Check(audioComponentSocket.GetCurrent()); - if (getenv("BT_ATTRBIND_LOG")) { static int s_iw=0; if ((s_iw++ % 400)==0) + static const int s_idleDiag = (getenv("BT_ATTRBIND_LOG") != 0); // hot path: resolve once + if (s_idleDiag) { static int s_iw=0; if ((s_iw++ % 400)==0) DEBUG_STREAM << "[idlewatch] #" << s_iw << " comp=" << (void *)audioComponentSocket.GetCurrent() << std::endl; } audioComponentSocket.GetCurrent()->ReceiveControl( diff --git a/scratchpad/night8/preship.sh b/scratchpad/night8/preship.sh new file mode 100644 index 0000000..e1c73f3 --- /dev/null +++ b/scratchpad/night8/preship.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +# Pre-ship smoke: combat, no diagnostics, measure frame time + confirm no crash. +set -x +. /c/git/bt411/scratchpad/night6/bench_common.sh +cd /c/git/bt411/content || exit 1 +taskkill //F //IM btl4.exe > /dev/null 2>&1 +sleep 2 +sed "s/^map=.*/map=grass/; s/^time=.*/time=day/" MP.EGG > SHIP.EGG +rm -f preship.log +export BT_SPAWN_ENEMY=2 BT_AUTOFIRE=1 BT_GOTO=enemy BT_GOTO_STOP=40 +bt_launch preship.log SHIP.EGG 0x03 +sleep 120 +taskkill //F //IM btl4.exe > /dev/null 2>&1 +sleep 2