refactor: name M2 sequence flag, replace empty loop with std::advance

- m2_loader: define kM2SeqFlagEmbeddedData (0x20) with why-comment —
  when clear, keyframe data lives in external .anim files and M2 offsets
  are file-relative (reading them from M2 produces garbage). Replaces
  3 bare hex literals across parseAnimTrack and ribbon emitter parsing
- audio_engine: replace empty for-loop iterator advance with
  std::advance() for clarity
This commit is contained in:
Kelsi 2026-03-30 14:59:03 -07:00
parent d2a7d79f60
commit ef787624fe
2 changed files with 11 additions and 6 deletions

View file

@ -8,6 +8,7 @@
#include <cstring>
#include <cstdlib>
#include <iterator>
#include <memory>
#include <unordered_map>
@ -104,7 +105,7 @@ static bool decodeWavCached(const std::vector<uint8_t>& wavData, DecodedWavCache
constexpr size_t kMaxCachedSounds = 256;
if (gDecodedWavCache.size() >= kMaxCachedSounds) {
auto it = gDecodedWavCache.begin();
for (size_t n = gDecodedWavCache.size() / 2; n > 0; --n, ++it) {}
std::advance(it, gDecodedWavCache.size() / 2);
gDecodedWavCache.erase(gDecodedWavCache.begin(), it);
}
gDecodedWavCache.emplace(key, entry);