aboutsummaryrefslogtreecommitdiff
path: root/engines/glk/adrift/scmemos.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2019-09-17 20:09:37 -0700
committerPaul Gilbert2019-09-25 20:13:27 -0700
commit994afedd33de0e298425933945a47e6dacb3a138 (patch)
tree372c0dfa6c93216061c6b913b135111fa30d1218 /engines/glk/adrift/scmemos.cpp
parent0026f9ab5e18bc8eebcd6b7dc1973bcfab39e1dd (diff)
downloadscummvm-rg350-994afedd33de0e298425933945a47e6dacb3a138.tar.gz
scummvm-rg350-994afedd33de0e298425933945a47e6dacb3a138.tar.bz2
scummvm-rg350-994afedd33de0e298425933945a47e6dacb3a138.zip
GLK: ADRIFT: Encapsulation serialization code into their own classes
Diffstat (limited to 'engines/glk/adrift/scmemos.cpp')
-rw-r--r--engines/glk/adrift/scmemos.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/engines/glk/adrift/scmemos.cpp b/engines/glk/adrift/scmemos.cpp
index 88720f28bf..c26f6840c0 100644
--- a/engines/glk/adrift/scmemos.cpp
+++ b/engines/glk/adrift/scmemos.cpp
@@ -22,6 +22,7 @@
#include "glk/adrift/scare.h"
#include "glk/adrift/scprotos.h"
+#include "glk/adrift/serialization.h"
namespace Glk {
namespace Adrift {
@@ -201,7 +202,8 @@ void memo_save_game(sc_memo_setref_t memento, sc_gameref_t game) {
memo->length = 0;
/* Serialize the given game into this memo. */
- ser_save_game(game, memo_save_game_callback, memo);
+ SaveSerializer ser(game, memo_save_game_callback, memo);
+ ser.save();
/*
* If serialization worked (failure would be a surprise), advance the
@@ -263,7 +265,8 @@ sc_bool memo_load_game(sc_memo_setref_t memento, sc_gameref_t game) {
* Deserialize the given game from this memo; failure would be somewhat
* of a surprise here.
*/
- status = ser_load_game(game, memo_load_game_callback, memo);
+ LoadSerializer ser(game, memo_load_game_callback, memo);
+ status = ser.load();
if (!status)
sc_error("memo_load_game: warning: game load failed\n");