aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/glk/advsys/advsys.cpp9
-rw-r--r--engines/glk/advsys/advsys.h2
2 files changed, 9 insertions, 2 deletions
diff --git a/engines/glk/advsys/advsys.cpp b/engines/glk/advsys/advsys.cpp
index 0c62524db1..d5709d0619 100644
--- a/engines/glk/advsys/advsys.cpp
+++ b/engines/glk/advsys/advsys.cpp
@@ -35,13 +35,18 @@ void AdvSys::runGame() {
// TODO: play game
print("ADVINT v1.2 - Copyright (c) 1986, by David Betz\n");
-
deinitialize();
}
bool AdvSys::initialize() {
+ // Create a Glk window for the game
_window = glk_window_open(0, 0, 0, wintype_TextBuffer, 1);
- if (_window)
+ if (!_window)
+ return false;
+
+ // Load the game's header
+ _header.load(&_gameFile);
+ if (!_header._valid)
return false;
return true;
diff --git a/engines/glk/advsys/advsys.h b/engines/glk/advsys/advsys.h
index 0aeb14ed3e..3fdf39f482 100644
--- a/engines/glk/advsys/advsys.h
+++ b/engines/glk/advsys/advsys.h
@@ -25,6 +25,7 @@
#include "common/scummsys.h"
#include "glk/glk_api.h"
+#include "glk/advsys/game.h"
namespace Glk {
namespace AdvSys {
@@ -35,6 +36,7 @@ namespace AdvSys {
class AdvSys : public GlkAPI {
private:
winid_t _window;
+ Header _header;
private:
/**
* Engine initialization