-void save_game(struct World * world) {
-// Save game data to game file.
- FILE * file = fopen("savefile", "w");
- write_uint32_bigendian(world->seed, file);
- write_uint32_bigendian(world->turn, file);
- write_uint16_bigendian(world->player->y, file);
- write_uint16_bigendian(world->player->x, file);
- write_uint16_bigendian(world->monster->y, file);
- write_uint16_bigendian(world->monster->x, file);
- fclose(file); }
-
-void toggle_window (struct WinMeta * win_meta, struct Win * win) {
-// Toggle display of window win.
- if (0 != win->frame.curses_win)
- suspend_win(win_meta, win);
- else
- append_win(win_meta, win); }
-
-void scroll_pad (struct WinMeta * win_meta, char dir) {
-// Try to scroll pad left or right.
- if ('+' == dir)
- reset_pad_offset(win_meta, win_meta->pad_offset + 1);
- else if ('-' == dir)
- reset_pad_offset(win_meta, win_meta->pad_offset - 1); }
-
-void growshrink_active_window (struct WinMeta * win_meta, char change) {
-// Grow or shrink active window horizontally or vertically by one cell size.
- if (0 != win_meta->active) {
- uint16_t height = win_meta->active->frame.size.y;
- uint16_t width = win_meta->active->frame.size.x;
- if (change == '-')
- height--;
- else if (change == '+')
- height++;
- else if (change == '_')
- width--;
- else if (change == '*')
- width++;
- resize_active_win (win_meta, height, width); } }
-