From d1d9a2ae518784b01828f8306ac6228f8b5eae59 Mon Sep 17 00:00:00 2001 From: Brandon Wright Date: Wed, 27 Mar 2019 15:42:40 -0500 Subject: [PATCH] Change variable names to make sense. --- gfx.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gfx.h b/gfx.h index 90dfbf2e..e2acc14a 100644 --- a/gfx.h +++ b/gfx.h @@ -165,9 +165,9 @@ inline uint16 COLOR_ADD(uint16 C1, uint16 C2) inline uint16 COLOR_SUB (uint16 C1, uint16 C2) { - int r = (C1 & (THIRD_COLOR_MASK | FIRST_COLOR_MASK)) | ((0x20 << 0) | (0x20 << RED_SHIFT_BITS)); - int b = C2 & (THIRD_COLOR_MASK | FIRST_COLOR_MASK); - int rb = r - b; + int rb1 = (C1 & (THIRD_COLOR_MASK | FIRST_COLOR_MASK)) | ((0x20 << 0) | (0x20 << RED_SHIFT_BITS)); + int rb2 = C2 & (THIRD_COLOR_MASK | FIRST_COLOR_MASK); + int rb = rb1 - rb2; int rbcarry = rb & ((0x20 << RED_SHIFT_BITS) | (0x20 << 0)); int g = ((C1 & (SECOND_COLOR_MASK)) | (0x20 << GREEN_SHIFT_BITS)) - (C2 & (SECOND_COLOR_MASK)); int rgbsaturate = (rbcarry >> 5) * 0x1f + ((g & (0x20 << GREEN_SHIFT_BITS)) >> GREEN_SHIFT_BITS) * MAX_GREEN;