From: Timo Korvola Date: Sun, 18 Feb 2018 14:36:08 +0000 (+0200) Subject: Clean up a bit. X-Git-Url: https://scope-eye.net/git/?a=commitdiff_plain;h=217626d7c7f2e5f18b048101db581296c088709f;p=liskon_frotz.git Clean up a bit. Add resize_screen to frotz.h. Remove its declarations from .c files. Also remove an unused declaration. #42: Handle terminal resizing --- diff --git a/src/common/fastmem.c b/src/common/fastmem.c index eaec73f..8ad1ee8 100644 --- a/src/common/fastmem.c +++ b/src/common/fastmem.c @@ -51,7 +51,6 @@ extern void seed_random (int); extern void restart_screen (void); -extern void resize_screen (void); extern void refresh_text_style (void); extern void call (zword, int, zword *, int); extern void split_window (zword); diff --git a/src/common/frotz.h b/src/common/frotz.h index 89626a1..de8ea44 100644 --- a/src/common/frotz.h +++ b/src/common/frotz.h @@ -789,6 +789,9 @@ int os_string_width (const zchar *); void os_init_setup (void); void os_warn (const char *, ...); +/* Front ends call this if the terminal size changes. */ +void resize_screen(void); + /* This is callable only from resize_screen. */ bool os_repaint_window (int win, int ypos_old, int ypos_new, int xpos, int ysize, int xsize); diff --git a/src/curses/ux_screen.c b/src/curses/ux_screen.c index b8ce68a..070b68d 100644 --- a/src/curses/ux_screen.c +++ b/src/curses/ux_screen.c @@ -33,9 +33,7 @@ #include "ux_frotz.h" -extern void resize_screen(void); extern void restart_header(void); -extern void restart_screen(void); static WINDOW *saved_screen = NULL; @@ -188,7 +186,7 @@ bool os_repaint_window(int win, int ypos_old, int ypos_new, int xpos, { int lines, cols; if (!saved_screen) - return false; + return FALSE; getmaxyx(saved_screen, lines, cols); ypos_old--, ypos_new--, xpos--; if (xpos + xsize > cols) @@ -207,7 +205,7 @@ bool os_repaint_window(int win, int ypos_old, int ypos_new, int xpos, move(y, x); } if (xsize <= 0 || ysize <= 0) - return false; + return FALSE; return copywin(saved_screen, stdscr, ypos_old, xpos, ypos_new, xpos, ypos_new + ysize - 1, xpos + xsize - 1, FALSE) != ERR; }