| 37 | // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= |
| 38 | |
| 39 | void Game_Destiny::Load() |
| 40 | { |
| 41 | // Do not load Destiny whether player cannot find "Destiny.dll" |
| 42 | if (! FileFinder::Game().Exists(DESTINY_DLL)) |
| 43 | { |
| 44 | return; |
| 45 | } |
| 46 | |
| 47 | uint32_t dllVersion = 0; |
| 48 | uint32_t language = 0; |
| 49 | uint32_t gameVersion = 0; |
| 50 | uint32_t extra = 0; |
| 51 | uint32_t dwordSize = 0; |
| 52 | uint32_t floatSize = 0; |
| 53 | uint32_t stringSize = 0; |
| 54 | |
| 55 | #ifndef EMSCRIPTEN |
| 56 | Filesystem_Stream::InputStream exe = FileFinder::Game().OpenFile(EXE_NAME); |
| 57 | |
| 58 | if (exe) |
| 59 | { |
| 60 | exe.seekg(0x00030689, std::ios_base::beg); |
| 61 | exe.read(reinterpret_cast<char*>(&stringSize), sizeof(uint32_t)); |
| 62 | exe.seekg(1, std::ios_base::cur); |
| 63 | exe.read(reinterpret_cast<char*>(&floatSize), sizeof(uint32_t)); |
| 64 | exe.seekg(1, std::ios_base::cur); |
| 65 | exe.read(reinterpret_cast<char*>(&dwordSize), sizeof(uint32_t)); |
| 66 | exe.seekg(1, std::ios_base::cur); |
| 67 | exe.read(reinterpret_cast<char*>(&extra), sizeof(uint32_t)); |
| 68 | exe.seekg(1, std::ios_base::cur); |
| 69 | exe.read(reinterpret_cast<char*>(&gameVersion), sizeof(uint32_t)); |
| 70 | exe.seekg(1, std::ios_base::cur); |
| 71 | exe.read(reinterpret_cast<char*>(&language), sizeof(uint32_t)); |
| 72 | exe.seekg(1, std::ios_base::cur); |
| 73 | exe.read(reinterpret_cast<char*>(&dllVersion), sizeof(uint32_t)); |
| 74 | exe.seekg(1, std::ios_base::cur); |
| 75 | } |
| 76 | #else |
| 77 | // TODO [XGB]: Find to manage Destiny initialization parameters on Emscripten |
| 78 | dllVersion = 0x20000; |
| 79 | language = Destiny::Language::ENGLISH; |
| 80 | gameVersion = 0x20000107; |
| 81 | extra = 0x01; |
| 82 | dwordSize = floatSize = stringSize = 0x64; |
| 83 | #endif // !EMSCRIPTEN |
| 84 | |
| 85 | Initialize(dllVersion, language, gameVersion, extra, dwordSize, floatSize, stringSize); |
| 86 | } |
| 87 | |
| 88 | Game_Destiny::Game_Destiny() |
| 89 | { |