diff options
Diffstat (limited to 'engines/glk/tads')
-rw-r--r-- | engines/glk/tads/tads.cpp | 30 | ||||
-rw-r--r-- | engines/glk/tads/tads.h | 4 |
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 |