| 89 | } |
| 90 | |
| 91 | bool Emscripten_Interface_Private::UploadSavegameStep2(int slot, int buffer_addr, int size) { |
| 92 | auto fs = FileFinder::Save(); |
| 93 | std::string name = Scene_Save::GetSaveFilename(fs, slot); |
| 94 | |
| 95 | std::istream is(new Filesystem_Stream::InputMemoryStreamBufView(lcf::Span<uint8_t>(reinterpret_cast<uint8_t*>(buffer_addr), size))); |
| 96 | |
| 97 | if (!lcf::LSD_Reader::Load(is)) { |
| 98 | Output::Warning("Selected file is not a valid savegame"); |
| 99 | return false; |
| 100 | } |
| 101 | |
| 102 | { |
| 103 | auto os = fs.OpenOutputStream(name); |
| 104 | if (!os) |
| 105 | return false; |
| 106 | os.write(reinterpret_cast<char*>(buffer_addr), size); |
| 107 | } |
| 108 | |
| 109 | AsyncHandler::SaveFilesystem(); |
| 110 | |
| 111 | return true; |
| 112 | } |
| 113 | |
| 114 | bool Emscripten_Interface_Private::UploadSoundfontStep2(std::string filename, int buffer_addr, int size) { |
| 115 | auto fs = Game_Config::GetSoundfontFilesystem(); |
nothing calls this directly
no test coverage detected