X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=interpreters%2Ffrotz%2Fglkscreen.c;h=2d72bfdd11ae8f66b690df268ec0b04d26821bfd;hb=a3d8dbef8ec2442280d6085d43601bf4ba6cadf9;hp=f7c8e08b30e5b7386a542001a532187c4132c775;hpb=75009f8f40bbb580194e1722db76f4644bf18641;p=projects%2Fchimara%2Fchimara.git diff --git a/interpreters/frotz/glkscreen.c b/interpreters/frotz/glkscreen.c index f7c8e08..2d72bfd 100644 --- a/interpreters/frotz/glkscreen.c +++ b/interpreters/frotz/glkscreen.c @@ -263,8 +263,6 @@ void smartstatusline (void) int roomlen, scorelen, scoreofs; int len, tmp; - statusline[curx - 1] = 0; /* terminate! */ - packspaces(statusline, packed); //strcpy(packed, statusline); len = os_string_length(packed); @@ -351,22 +349,38 @@ void screen_char (zchar c) else { if (cury == 1) { - if (curx < sizeof statusline) + if (curx <= ((sizeof statusline / sizeof(zchar)) - 1)) + { statusline[curx - 1] = c; - curx++; - if (curx <= h_screen_cols) + statusline[curx] = 0; + } + if (curx < h_screen_cols) + { + glk_put_char_uni(c); + } + else if (curx == h_screen_cols) + { glk_put_char_uni(c); + glk_window_move_cursor(gos_curwin, curx-1, cury-1); + } else + { smartstatusline(); + } + curx ++; } else { - glk_put_char_uni(c); - curx++; - if (curx > h_screen_cols) { - curx = 1; - cury++; + if (curx < h_screen_cols) + { + glk_put_char_uni(c); + } + else if (curx == (h_screen_cols)) + { + glk_put_char_uni(c); + glk_window_move_cursor(gos_curwin, curx-1, cury-1); } + curx++; } } } @@ -882,6 +896,10 @@ void z_show_status (void) glk_set_window(gos_upper); gos_curwin = gos_upper; +#ifdef GARGLK + garglk_set_reversevideo(TRUE); +#endif /* GARGLK */ + curx = cury = 1; glk_window_move_cursor(gos_upper, 0, 0);