diff options
author | Paul Gilbert | 2019-06-04 19:22:37 -0700 |
---|---|---|
committer | Paul Gilbert | 2019-06-09 15:00:46 -0700 |
commit | f35176d7262eb0ccd739e231ca24232d640f9f84 (patch) | |
tree | f67e7e8dae104b7356a28964b485984d2cf5764e /engines/glk/advsys | |
parent | 0e17d1c1dbf718cb25fdc4b70638c93f427036a5 (diff) | |
download | scummvm-rg350-f35176d7262eb0ccd739e231ca24232d640f9f84.tar.gz scummvm-rg350-f35176d7262eb0ccd739e231ca24232d640f9f84.tar.bz2 scummvm-rg350-f35176d7262eb0ccd739e231ca24232d640f9f84.zip |
GLK: ADVSYS: Basic initialization and header loading in-game
Diffstat (limited to 'engines/glk/advsys')
-rw-r--r-- | engines/glk/advsys/advsys.cpp | 9 | ||||
-rw-r--r-- | engines/glk/advsys/advsys.h | 2 |
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 |