Skip to content

Commit

Permalink
v1.1.5: I forgot to ensure that the Garglk extensions were only calle…
Browse files Browse the repository at this point in the history
…d if the Glk library supports them
  • Loading branch information
curiousdannii committed Oct 29, 2020
1 parent 679197f commit 61d4946
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ifvms",
"title": "ifvms.js",
"version": "1.1.4",
"version": "1.1.5",
"description": "The Interactive Fiction Virtual Machines Suite - in Javascript",
"author": "Dannii Willis <curiousdannii@gmail.com>",
"license": "MIT",
Expand Down
12 changes: 9 additions & 3 deletions src/zvm/io.js
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ module.exports = {
if (this.version3)
{
this.statuswin = Glk.glk_window_open(this.mainwin, 0x12, 1, 4, 202)
if (this.statuswin)
if (this.statuswin && this.Glk.glk_gestalt(0x1100, 0))
{
Glk.garglk_set_reversevideo_stream(Glk.glk_window_get_stream(this.statuswin), 1)
}
Expand All @@ -409,7 +409,10 @@ module.exports = {
{
// Clean up after restarting
Glk.glk_stylehint_clear(0, 0, 8)
Glk.garglk_set_zcolors_stream(this.mainwin.str, this.io.fg, this.io.bg)
if (this.Glk.glk_gestalt(0x1100, 0))
{
Glk.garglk_set_zcolors_stream(this.mainwin.str, this.io.fg, this.io.bg)
}
Glk.glk_window_clear(this.mainwin)
if (this.upperwin)
{
Expand Down Expand Up @@ -1004,7 +1007,10 @@ module.exports = {
Glk.glk_stylehint_set(4, 0, 8, this.io.bg)
}
this.upperwin = Glk.glk_window_open( this.mainwin, 0x12, io.maxheight, 4, 203 );
Glk.garglk_set_zcolors_stream(this.upperwin.str, this.io.fg, this.io.bg)
if (this.Glk.glk_gestalt(0x1100, 0))
{
Glk.garglk_set_zcolors_stream(this.upperwin.str, this.io.fg, this.io.bg)
}
Glk.glk_stylehint_clear(4, 0, 8)
}
else
Expand Down

0 comments on commit 61d4946

Please sign in to comment.