read file content
| 9 | |
| 10 | // read file content |
| 11 | static uint8* ReadFile(IPlatformFile& PlatformFile, FString path, uint32& len) { |
| 12 | IFileHandle* FileHandle = PlatformFile.OpenRead(*path); |
| 13 | if (FileHandle) { |
| 14 | len = (uint32)FileHandle->Size(); |
| 15 | uint8* buf = new uint8[len]; |
| 16 | |
| 17 | FileHandle->Read(buf, len); |
| 18 | |
| 19 | // Close the file again |
| 20 | delete FileHandle; |
| 21 | |
| 22 | return buf; |
| 23 | } |
| 24 | |
| 25 | return nullptr; |
| 26 | } |
| 27 | |
| 28 | UMyGameInstance::UMyGameInstance() : state(nullptr) |
| 29 | { |