Scrub 'OLD code' comment framing and a getenv warning from tooling

The vk_capture_perf_test comments described its synchronous reference
arm as "the OLD code"; it is a deliberately-constructed slow baseline
the test compares against, not removed history -- reworded to say so.

Replace the last std::getenv (tone_source.hpp) with
GetEnvironmentVariableA, dropping the C4996 deprecation warning from
every audio-tone build, and drop the now-unused cstdint/cstdlib
includes. Generalize a game-name aside in the header comment.
This commit is contained in:
2026-07-12 09:17:52 +02:00
parent 4636f4bb64
commit 246289e386
2 changed files with 14 additions and 15 deletions

View File

@@ -1,13 +1,11 @@
// Configurable WASAPI sine-tone render source, shared by coop_tone.exe and the audio
// render-hook self-test. Opens a shared-mode render client at a requested format
// (sample rate / channels / bits / float vs PCM) using AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM,
// so it can render formats that differ from the device mix format -- exactly how games
// like Godot render 44100 Hz on a 48000 Hz endpoint, the case the hook must detect.
// so it can render formats that differ from the device mix format -- exactly the case a
// game rendering 44100 Hz on a 48000 Hz endpoint creates, which the hook must detect.
#pragma once
#include <cmath>
#include <cstdint>
#include <cstdlib>
#include <windows.h>
@@ -91,7 +89,8 @@ public:
// Optional: give each channel genuinely different content (a per-channel frequency scale),
// so a downstream test can *recover* the channel count by correlation (identical channels
// are ambiguous: 2ch@R looks like 1ch@2R). Off by default -> the usual single-tone source.
if (const char* d = std::getenv("COOP_TONE_DISTINCT_CH"); d != nullptr && d[0] == '1')
char d[2] = {};
if (GetEnvironmentVariableA("COOP_TONE_DISTINCT_CH", d, sizeof(d)) > 0 && d[0] == '1')
{
distinct_ = true;
}