commit e02a0e440f67f3e6a2247ed40878f620e4d66e9d
parent 09f435216178c0749118e3700de9861b5e232e70
Author: neauoire <aliceffekt@gmail.com>
Date: Sun, 28 Mar 2021 12:14:37 -0700
Tiny fix, condensed things a bit
Diffstat:
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/emulator.c b/src/emulator.c
@@ -151,10 +151,10 @@ loadtheme(Uint8 *addr)
int i;
for(i = 0; i < 4; ++i) {
Uint8
- r = (*(addr + i / 2) >> (!(i % 2) * 4)) & 0x0f,
- g = (*(addr + 2 + i / 2) >> (!(i % 2) * 4)) & 0x0f,
- b = (*(addr + 4 + i / 2) >> (!(i % 2) * 4)) & 0x0f;
- theme[i] = ((r << 4) << 16) + ((g << 4) << 8) + (b << 4);
+ r = (*(addr + i / 2) >> (!(i % 2) << 2)) & 0x0f,
+ g = (*(addr + 2 + i / 2) >> (!(i % 2) << 2)) & 0x0f,
+ b = (*(addr + 4 + i / 2) >> (!(i % 2) << 2)) & 0x0f;
+ theme[i] = (r << 20) + (g << 12) + (b << 4);
}
screen.reqdraw = 1;
}