aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2018-11-27 21:35:47 -0800
committerPaul Gilbert2018-12-08 19:05:59 -0800
commitd2836360fbf4f8ec5f90cbaba99002bb23e0aeb6 (patch)
treef536449857007cf9975877688de6cb8bf261ee34
parent75f4d34070a874437f6f339bac590f99d4b28f65 (diff)
downloadscummvm-rg350-d2836360fbf4f8ec5f90cbaba99002bb23e0aeb6.tar.gz
scummvm-rg350-d2836360fbf4f8ec5f90cbaba99002bb23e0aeb6.tar.bz2
scummvm-rg350-d2836360fbf4f8ec5f90cbaba99002bb23e0aeb6.zip
GLK: TADS: GLK window initialization
-rw-r--r--engines/glk/tads/tads.cpp30
-rw-r--r--engines/glk/tads/tads.h4
2 files changed, 34 insertions, 0 deletions
diff --git a/engines/glk/tads/tads.cpp b/engines/glk/tads/tads.cpp
index 8301813231..aa309279e7 100644
--- a/engines/glk/tads/tads.cpp
+++ b/engines/glk/tads/tads.cpp
@@ -28,6 +28,36 @@ namespace Glk {
namespace TADS {
TADS::TADS(OSystem *syst, const GlkGameDescription &gameDesc) : GlkAPI(syst, gameDesc) {
+ /*
+ * GLK Initialization
+ */
+ mainwin = glk_window_open(0, 0, 0, wintype_TextBuffer, 0);
+
+ if (!mainwin)
+ error("fatal: could not open window!\n");
+
+ // get default colors for main window
+ if (!glk_style_measure(mainwin, style_Normal, stylehint_TextColor, &mainfg))
+ mainfg = 0;
+
+ if (!glk_style_measure(mainwin, style_Normal, stylehint_BackColor, &mainbg))
+ mainbg = 0;
+
+ // get default colors for status window
+ statuswin = glk_window_open(mainwin, winmethod_Above | winmethod_Fixed, 1,
+ wintype_TextGrid, 0);
+
+ if (!glk_style_measure(statuswin, style_Normal, stylehint_TextColor, &statusfg))
+ statusfg = 0;
+
+ if (!glk_style_measure(statuswin, style_Normal, stylehint_BackColor, &statusbg))
+ statusbg = 0;
+
+ // close status window; reopened on request
+ glk_window_close(statuswin, 0);
+ statuswin = nullptr;
+
+ glk_set_window(mainwin);
}
Common::Error TADS::loadGameData(strid_t file) {
diff --git a/engines/glk/tads/tads.h b/engines/glk/tads/tads.h
index 8582897c1d..0f1565aaa9 100644
--- a/engines/glk/tads/tads.h
+++ b/engines/glk/tads/tads.h
@@ -33,6 +33,10 @@ namespace TADS {
* tads game interpreter
*/
class TADS : public GlkAPI {
+protected:
+ winid_t mainwin, statuswin;
+ glui32 mainfg, mainbg;
+ glui32 statusfg, statusbg;
public:
/**
* Constructor