diff options
| author | Elijah Thomas <42302100+elijah-thomas774@users.noreply.github.com> | 2024-05-31 19:31:21 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-31 19:31:21 -0400 |
| commit | f9e13b1bb5511e05ff416807ad3109423655dedd (patch) | |
| tree | 8d028ceccb7c99ef6ecbf5e37bbb733b98386a9e /src/DynamicLink.cpp | |
| parent | 71f3416cb5dd658bab6198016291e9cca3c6e4af (diff) | |
| parent | f612e9902fc8b7aacab368757d0d7efc9164006f (diff) | |
Merge pull request #43 from robojumper/nw4r_db
Nw4r db
Diffstat (limited to 'src/DynamicLink.cpp')
| -rw-r--r-- | src/DynamicLink.cpp | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/src/DynamicLink.cpp b/src/DynamicLink.cpp index 2c7947c0..ec9fd045 100644 --- a/src/DynamicLink.cpp +++ b/src/DynamicLink.cpp @@ -320,35 +320,25 @@ const char *DynamicModuleControl::getModuleTypeString() const { } DbMapFile::~DbMapFile() { - if (unk_0) { + if (mMapFileHandle != nullptr) { Unregister(); } } -namespace nw4r { -namespace db { -// TODO -typedef struct MapFile { -} MapFile; -extern MapFile *MapFile_RegistOnDvd(void *arg, const char *buf, const OSModuleInfo *info); -extern void *MapFile_Unregist(MapFile *); -} // namespace db -} // namespace nw4r - void DbMapFile::RegisterOnDvd(const char *path, const OSModuleInfo *info) { if (mDvd::IsExistPath(path)) { - unk_0 = (UNKWORD)nw4r::db::MapFile_RegistOnDvd(((int *)this) + 1, path, info); + mMapFileHandle = nw4r::db::MapFile_RegistOnDvd(&mMapFile, path, info); } else { - unk_0 = 0xffffffff; + mMapFileHandle = (nw4r::db::MapFileHandle)0xffffffff; } } void DbMapFile::Unregister() { - if (unk_0 != 0) { - if (unk_0 != 0xffffffff) { - nw4r::db::MapFile_Unregist((nw4r::db::MapFile *)unk_0); + if (mMapFileHandle != nullptr) { + if ((u32)mMapFileHandle != 0xffffffff) { + nw4r::db::MapFile_Unregist(mMapFileHandle); } - unk_0 = 0; + mMapFileHandle = nullptr; } } |
