uxn

Varvara Ordinator, written in ANSI C(SDL2)
git clone https://git.eamoncaddigan.net/uxn.git
Log | Files | Refs | README | LICENSE

commit fbd9c49f8447090783de75d63e581c3d75ce0bc1
parent d186b7a038215b77a93b3c6f2bde641e1eb65bf7
Author: Andrew Alderwick <andrew@alderwick.co.uk>
Date:   Thu, 20 Jan 2022 01:34:44 +0000

Fix resize when only width or height are set.

Diffstat:
Msrc/devices/screen.c | 11++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/devices/screen.c b/src/devices/screen.c @@ -133,12 +133,17 @@ screen_deo(Device *d, Uint8 port) { switch(port) { case 0x3: - case 0x5: if(!FIXED_SIZE) { - Uint16 w, h; + Uint16 w; DEVPEEK16(w, 0x2); + screen_resize(&uxn_screen, clamp(w, 1, 1024), uxn_screen.height); + } + break; + case 0x5: + if(!FIXED_SIZE) { + Uint16 h; DEVPEEK16(h, 0x4); - screen_resize(&uxn_screen, clamp(w, 1, 1024), clamp(h, 1, 1024)); + screen_resize(&uxn_screen, uxn_screen.width, clamp(h, 1, 1024)); } break; case 0xe: {