X-Git-Url: https://plomlompom.com/repos/berlin_corona.txt?a=blobdiff_plain;f=src%2Froguelike.c;h=0d1e96b60966338f4b5e7bba283cd4e64d49334d;hb=d7c46fb1de25edd8782fbc7642be71e5e54deab2;hp=021bfe71e4abb51283c5823fb26136604f5a5b1d;hpb=4f8360fb6aad70ba208ca60f0d9c94590b222530;p=plomrogue diff --git a/src/roguelike.c b/src/roguelike.c index 021bfe7..0d1e96b 100644 --- a/src/roguelike.c +++ b/src/roguelike.c @@ -1,3 +1,4 @@ +#include "roguelike.h" #include #include #include @@ -6,7 +7,6 @@ #include #include "windows.h" #include "draw_wins.h" -#include "roguelike.h" #include "keybindings.h" #include "readwrite.h" #include "actors.h" @@ -110,17 +110,12 @@ void scroll_pad (struct WinMeta * win_meta, char dir) { 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); } } + struct yx_uint16 size = win_meta->active->frame.size; + if (change == '-') size.y--; + else if (change == '+') size.y++; + else if (change == '_') size.x--; + else if (change == '*') size.x++; + resize_active_win (win_meta, size); } } unsigned char meta_keys(int key, struct World * world, struct WinMeta * win_meta, struct Win * win_keys, struct Win * win_map, struct Win * win_info, struct Win * win_log) {