Fix resize when only width or height are set.

This commit is contained in:
Andrew Alderwick 2022-01-20 01:34:44 +00:00
parent d186b7a038
commit fbd9c49f84
1 changed files with 8 additions and 3 deletions

View File

@ -133,12 +133,17 @@ screen_deo(Device *d, Uint8 port)
{ {
switch(port) { switch(port) {
case 0x3: case 0x3:
if(!FIXED_SIZE) {
Uint16 w;
DEVPEEK16(w, 0x2);
screen_resize(&uxn_screen, clamp(w, 1, 1024), uxn_screen.height);
}
break;
case 0x5: case 0x5:
if(!FIXED_SIZE) { if(!FIXED_SIZE) {
Uint16 w, h; Uint16 h;
DEVPEEK16(w, 0x2);
DEVPEEK16(h, 0x4); 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; break;
case 0xe: { case 0xe: {