mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-14 16:33:52 +00:00
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:
parent
d2a7d79f60
commit
ef787624fe
2 changed files with 11 additions and 6 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue