aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/objects
diff options
context:
space:
mode:
Diffstat (limited to 'engines/titanic/objects')
-rw-r--r--engines/titanic/objects/project_item.cpp12
-rw-r--r--engines/titanic/objects/saveable_object.cpp2
2 files changed, 8 insertions, 6 deletions
diff --git a/engines/titanic/objects/project_item.cpp b/engines/titanic/objects/project_item.cpp
index 599af89057..ee3cb3f28d 100644
--- a/engines/titanic/objects/project_item.cpp
+++ b/engines/titanic/objects/project_item.cpp
@@ -28,11 +28,14 @@
namespace Titanic {
void CProjectItem::save(SimpleFile *file, int indent) const {
- error("TODO");
+ file->writeNumberLine(6, indent);
+
}
void CProjectItem::load(SimpleFile *file) {
- error("TODO");
+ file->readNumber();
+
+
}
void CProjectItem::loadGame(int slotId) {
@@ -43,7 +46,7 @@ void CProjectItem::loadGame(int slotId) {
clear();
// Open either an existing savegame slot or the new game template
- if (slotId > 0) {
+ if (slotId >= 0) {
saveFile = g_system->getSavefileManager()->openForLoading(
Common::String::format("slot%d.gam", slotId));
file.open(saveFile);
@@ -109,8 +112,7 @@ CProjectItem *CProjectItem::loadData(SimpleFile *file) {
// TODO: Validate this is correct
root = dynamic_cast<CProjectItem *>(item);
assert(root);
-
- _filename = root->_filename;
+ root->_filename = _filename;
}
// Load the data for the item
diff --git a/engines/titanic/objects/saveable_object.cpp b/engines/titanic/objects/saveable_object.cpp
index 25bd1645b5..201fe1085e 100644
--- a/engines/titanic/objects/saveable_object.cpp
+++ b/engines/titanic/objects/saveable_object.cpp
@@ -33,7 +33,7 @@ Common::HashMap<Common::String, CSaveableObject::CreateFunction> *
CSaveableObject::_classList = nullptr;
#define DEFFN(T) CSaveableObject *Function##T() { return new T(); }
-#define ADDFN(T) (*_classList)["TEST"] = Function##T
+#define ADDFN(T) (*_classList)[#T] = Function##T
DEFFN(List);
DEFFN(ListItem);