MCPcopy Create free account
hub / github.com/EasyRPG/Player / UploadSavegameStep2

Method UploadSavegameStep2

src/platform/emscripten/interface.cpp:91–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89}
90
91bool 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
114bool Emscripten_Interface_Private::UploadSoundfontStep2(std::string filename, int buffer_addr, int size) {
115 auto fs = Game_Config::GetSoundfontFilesystem();

Callers

nothing calls this directly

Calls 1

OpenOutputStreamMethod · 0.80

Tested by

no test coverage detected