Files
wowdecomp/Engine/Source/Base/FileCache.cpp
T
SatyandClaude Opus 5.5 2e5f2331a5 Implement Engine/Source/Base FileCache
BaseFileDestroy; PrefetchNode/UncachableNode (constructor and destructor
inline); statics s_activeFiles, s_uncachableFiles, s_critSect. Empty
BaseFileInitialize, IBaseFileWaitForLoad, SFile::CreateOverlapped and
SFile::DestroyOverlapped (folded, docs/0x005EEB70.md, docs/0x00632050.md).
SOVERLAPPED in SFile2-Core.h.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-09-24 03:33:50 +02:00

47 lines
1.0 KiB
C++

#include <cstdint>
#include "Engine/Source/Base/FileCache.h"
#include "Storm/H/stpl.h"
#include "Storm/H/storm.h"
#include "Storm/Source/W32/SLock.h"
// STATIC: 0x00B415F0
static TSHashTable<PrefetchNode, HASHKEY_STRI> s_activeFiles;
// STATIC: 0x00B41618
static TSHashTable<UncachableNode, HASHKEY_STRI> s_uncachableFiles;
// STATIC: 0x00B41640
static SCritSect s_critSect;
static void STORMAPI IBaseFileWaitForLoad(SOVERLAPPED* overlapped) {
}
// INLINED
PrefetchNode::PrefetchNode() {
this->buffer = nullptr;
this->refCount = 0;
SFile::CreateOverlapped(&this->overlapped);
}
// INLINED
PrefetchNode::~PrefetchNode() {
if (this->buffer) {
IBaseFileWaitForLoad(&this->overlapped);
SMemFree(this->buffer, __FILE__, __LINE__, 0);
}
SFile::DestroyOverlapped(&this->overlapped);
}
void BaseFileInitialize() {
}
// VERIFY: 3f61d363 manual
// OFFSET: 0x0047C600
void BaseFileDestroy() {
s_critSect.Enter();
s_activeFiles.Clear();
s_uncachableFiles.Clear();
s_critSect.Leave();
}