| 35 | using namespace OpenRCT2; |
| 36 | |
| 37 | static bool LoadFileToBuffer(MemoryStream& stream, const std::string& filePath) |
| 38 | { |
| 39 | FILE* fp = fopen(filePath.c_str(), "rb"); |
| 40 | EXPECT_NE(fp, nullptr); |
| 41 | if (fp == nullptr) |
| 42 | return false; |
| 43 | |
| 44 | uint8_t buf[1024]; |
| 45 | size_t bytesRead = fread(buf, 1, sizeof(buf), fp); |
| 46 | while (bytesRead > 0) |
| 47 | { |
| 48 | stream.Write(buf, bytesRead); |
| 49 | bytesRead = fread(buf, 1, sizeof(buf), fp); |
| 50 | } |
| 51 | fclose(fp); |
| 52 | |
| 53 | return true; |
| 54 | } |
| 55 | |
| 56 | static void GameInit(bool retainSpatialIndices) |
| 57 | { |