]> skyeroc.xyz Git - dgamelaunch/commitdiff
Match bg color bits to fg colors now, to save future compatibility headaches
authorsbkelley <sb24kelley@gmail.com>
Thu, 18 Jun 2026 04:07:44 +0000 (00:07 -0400)
committersbkelley <sb24kelley@gmail.com>
Thu, 18 Jun 2026 21:03:01 +0000 (17:03 -0400)
dgamelaunch.c

index 8e46116d4898c872ce27917ce973eb91293fa9e6..27babad0a957e7b5c90558eb714b3ecc26a0770c 100644 (file)
@@ -1928,7 +1928,7 @@ initcurses ()
 
 int color_pair_idx(int fg, int bg)
 {
-  int bgbits = (7 & bg) << 4;
+  int bgbits = (((1 & bg) << 2) | (2 & bg) | ((4 & bg) >> 2)) << 4;
   /* Swap bits 1 and 3 to line up with original color remap (+1) */
   int fgbits = (8 & fg) | ((1 & fg) << 2) | (2 & fg) | ((4 & fg) >> 2);
   return (bgbits | fgbits) + 1;