commit d098eee

Devine Lu Linvega  ·  2025-01-21 00:27:32 +0000 UTC
parent e26707c
(screen.c) Removed unnecessary variables
1 files changed,  +2, -5
+2, -5
 1@@ -65,22 +65,19 @@ screen_palette(void)
 2 void
 3 screen_resize(Uint16 width, Uint16 height, int scale)
 4 {
 5-	Uint8 *bg, *fg;
 6 	Uint32 *pixels = NULL;
 7-	int dim_change;
 8 	clamp(width, 8, 0x800);
 9 	clamp(height, 8, 0x800);
10 	clamp(scale, 1, 3);
11-	dim_change = uxn_screen.width != width || uxn_screen.height != height;
12 	/* Pixels */
13 	pixels = realloc(uxn_screen.pixels, width * height * sizeof(Uint32) * scale * scale);
14 	if(!pixels) return;
15 	uxn_screen.pixels = pixels;
16 	uxn_screen.scale = scale;
17 	/* layers */
18-	if(dim_change) {
19+	if(uxn_screen.width != width || uxn_screen.height != height) {
20 		int i, length = MAR2(width) * MAR2(height);
21-		bg = malloc(length), fg = malloc(length);
22+		Uint8 *bg = malloc(length), *fg = malloc(length);
23 		if(!bg || !fg || !pixels) {
24 			free(bg), free(fg);
25 			return;