Browse code

Tiny fix, condensed things a bit

neauoire authored on 28/03/2021 19:14:37
Showing 1 changed files
... ...
@@ -151,10 +151,10 @@ loadtheme(Uint8 *addr)
151 151
 	int i;
152 152
 	for(i = 0; i < 4; ++i) {
153 153
 		Uint8
154
-			r = (*(addr + i / 2) >> (!(i % 2) * 4)) & 0x0f,
155
-			g = (*(addr + 2 + i / 2) >> (!(i % 2) * 4)) & 0x0f,
156
-			b = (*(addr + 4 + i / 2) >> (!(i % 2) * 4)) & 0x0f;
157
-		theme[i] = ((r << 4) << 16) + ((g << 4) << 8) + (b << 4);
154
+			r = (*(addr + i / 2) >> (!(i % 2) << 2)) & 0x0f,
155
+			g = (*(addr + 2 + i / 2) >> (!(i % 2) << 2)) & 0x0f,
156
+			b = (*(addr + 4 + i / 2) >> (!(i % 2) << 2)) & 0x0f;
157
+		theme[i] = (r << 20) + (g << 12) + (b << 4);
158 158
 	}
159 159
 	screen.reqdraw = 1;
160 160
 }