MCPcopy Create free account
hub / github.com/crownengine/crown / SaveGame

Method SaveGame

src/device/save_game.cpp:210–233  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

208
209 ///
210 SaveGame(Allocator &a, const char *save_dir)
211 : _allocator(&a)
212 , _filesystem(a)
213 , _requests_queue(a)
214 , _next_token(0)
215 , _exit(false)
216 , _has_save_dir(save_dir != NULL && save_dir[0] != '\0')
217 {
218 CE_ENSURE(s_save_game == NULL);
219
220 if (_has_save_dir) {
221 _filesystem.set_prefix(save_dir);
222 CreateResult cr = _filesystem.create_directory("");
223 if (cr.error == CreateResult::UNKNOWN)
224 logw(SAVE_GAME, "Unable to create save directory '%s'", save_dir);
225 }
226
227#if CROWN_PLATFORM_EMSCRIPTEN
228 if (_has_save_dir)
229 html5_save_game_init(save_dir);
230#endif
231
232 _thread.start([](void *thiz) { return ((SaveGame *)thiz)->run(); }, this);
233 }
234
235 ///
236 ~SaveGame()

Callers

nothing calls this directly

Calls 5

html5_save_game_initFunction · 0.85
set_prefixMethod · 0.80
create_directoryMethod · 0.45
startMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected