aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/titanic/detection_tables.h2
-rw-r--r--engines/titanic/game_manager.cpp1
-rw-r--r--engines/titanic/main_game_window.cpp2
-rw-r--r--engines/titanic/objects/project_item.cpp12
-rw-r--r--engines/titanic/objects/saveable_object.cpp2
-rw-r--r--engines/titanic/screen_manager.cpp3
-rw-r--r--engines/titanic/titanic.cpp3
7 files changed, 16 insertions, 9 deletions
diff --git a/engines/titanic/detection_tables.h b/engines/titanic/detection_tables.h
index dab7bd5462..e9cdcab334 100644
--- a/engines/titanic/detection_tables.h
+++ b/engines/titanic/detection_tables.h
@@ -27,7 +27,7 @@ static const TitanicGameDescription gameDescriptions[] = {
{
"titanic",
0,
- AD_ENTRY1s("a.st", "b283436d90974fdc81accc95dbd8e61c", 15405985),
+ AD_ENTRY1s("newgame.st", "c276f2661f0d0a547445a65db78b2292", 87227),
Common::EN_ANY,
Common::kPlatformWindows,
ADGF_NO_FLAGS,
diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
index 94e1ad3fb2..d29180ff6b 100644
--- a/engines/titanic/game_manager.cpp
+++ b/engines/titanic/game_manager.cpp
@@ -21,6 +21,7 @@
*/
#include "titanic/game_manager.h"
+#include "titanic/screen_manager.h"
namespace Titanic {
diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp
index 41eb825543..c4eec39445 100644
--- a/engines/titanic/main_game_window.cpp
+++ b/engines/titanic/main_game_window.cpp
@@ -48,7 +48,7 @@ bool CMainGameWindow::Create() {
void CMainGameWindow::applicationStarting() {
// Set up the game project, and get game slot
- int saveSlot = selectSavegame();
+ int saveSlot = loadGame();
assert(_project);
// Set the video mode
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);
diff --git a/engines/titanic/screen_manager.cpp b/engines/titanic/screen_manager.cpp
index 9df9fc3075..0846b81b60 100644
--- a/engines/titanic/screen_manager.cpp
+++ b/engines/titanic/screen_manager.cpp
@@ -45,6 +45,9 @@ CScreenManager::CScreenManager(TitanicEngine *vm): _vm(vm) {
_mouseCursor = nullptr;
_textCursor = nullptr;
_fontNumber = 0;
+ // TODO: Further initialization
+
+ _screenManagerPtr = this;
}
CScreenManager::~CScreenManager() {
diff --git a/engines/titanic/titanic.cpp b/engines/titanic/titanic.cpp
index 57f3c7df0c..d998ec5837 100644
--- a/engines/titanic/titanic.cpp
+++ b/engines/titanic/titanic.cpp
@@ -52,8 +52,9 @@ void TitanicEngine::initialize() {
DebugMan.addDebugChannel(kDebugSound, "sound", "Sound and Music handling");
CSaveableObject::initClassList();
- _window = new CMainGameWindow(this);
_screenManager = new OSScreenManager(this);
+ _window = new CMainGameWindow(this);
+ _window->applicationStarting();
}
Common::Error TitanicEngine::run() {