commit ea5da14
Devine Lu Linvega
·
2025-04-09 01:40:00 +0000 UTC
parent 1ffb60b
Cleanup
2 files changed,
+4,
-7
+2,
-0
1@@ -72,6 +72,8 @@ screen_apply(int width, int height)
2 clamp(height, 8, 0x800);
3 length = MAR2(width) * MAR2(height);
4 uxn_screen.bg = realloc(uxn_screen.bg, length), uxn_screen.fg = realloc(uxn_screen.fg, length);
5+ uxn_screen.pixels = realloc(uxn_screen.pixels,
6+ width * height * sizeof(Uint32) * uxn_screen.zoom * uxn_screen.zoom);
7 uxn_screen.width = width, uxn_screen.height = height;
8 screen_change(0, 0, width, height);
9 uxn_screen.resize = 1;
+2,
-7
1@@ -86,14 +86,9 @@ emu_resize(void)
2 {
3 int width = uxn_screen.width * uxn_screen.zoom;
4 int height = uxn_screen.height * uxn_screen.zoom;
5- XResizeWindow(display, window, width, height);
6- uxn_screen.pixels = realloc(uxn_screen.pixels,
7- uxn_screen.width * uxn_screen.height * sizeof(Uint32) * uxn_screen.zoom * uxn_screen.zoom);
8+ if(ximage) XDestroyImage(ximage);
9 ximage = XCreateImage(display, DefaultVisual(display, 0), DefaultDepth(display, DefaultScreen(display)), ZPixmap, 0, (char *)uxn_screen.pixels, width, height, 32, 0);
10- uxn_screen.x1 = uxn_screen.y1 = 0;
11- uxn_screen.x2 = uxn_screen.width;
12- uxn_screen.y2 = uxn_screen.height;
13- emu_repaint();
14+ XResizeWindow(display, window, width, height);
15 uxn_screen.resize = 0;
16 }
17