ref: 3eca2d7cf3299e9e45b0f66ddb6b5c45c0966ce9
parent: 5754da507d148841c0173a483c2e03c4a7e703e9
author: Clownacy <Clownacy@users.noreply.github.com>
date: Thu Feb 21 15:56:27 EST 2019
Add all GetCortBoxColor calls back (also I found a vanilla bug)
--- a/src/Back.cpp
+++ b/src/Back.cpp
@@ -14,9 +14,13 @@
BACK gBack;
int gWaterY;
+static unsigned long color_black;
BOOL InitBack(const char *fName, int type)
{
+ // Unused, hilariously
+ color_black = GetCortBoxColor(RGB(0, 0, 0x10));
+
//Get width and height
char path[PATH_LENGTH];
sprintf(path, "%s/%s.pbm", gDataPath, fName);
--- a/src/Game.cpp
+++ b/src/Game.cpp
@@ -267,6 +267,7 @@
int anime = 0;
int char_type = 0;
int time_counter = 0;
+ unsigned long back_color = GetCortBoxColor(RGB(0x20, 0x20, 0x20));
//Set state
bContinue = IsProfile();
@@ -356,7 +357,7 @@
anime = 0;
//Draw title
- CortBox(&grcGame, 0x202020);
+ CortBox(&grcGame, back_color);
//Draw version
PutBitmap3(&grcGame, (WINDOW_WIDTH - 120) / 2, WINDOW_HEIGHT - 24, &rcVersion, SURFACE_ID_TEXT_BOX);
@@ -443,7 +444,9 @@
{
int frame_x = 0;
int frame_y = 0;
-
+
+ unsigned long color = GetCortBoxColor(RGB(0, 0, 0x20));
+
bool swPlay = true;
//Reset stuff
@@ -525,7 +528,7 @@
}
ProcFade();
- CortBox(&grcFull, 0x000020);
+ CortBox(&grcFull, color);
GetFramePosition(&frame_x, &frame_y);
PutBack(frame_x, frame_y);
PutStage_Back(frame_x, frame_y);
--- a/src/TextScr.cpp
+++ b/src/TextScr.cpp
@@ -46,9 +46,17 @@
RECT gRect_line = {0, 0, 216, 16};
+#ifdef FIX_BUGS
+static unsigned long nod_color;
+#endif
+
//Initialize and end tsc
BOOL InitTextScript2()
{
+#ifdef FIX_BUGS
+ nod_color = GetCortBoxColor(RGB(0xFE, 0xFF, 0xFF));
+#endif
+
//Clear flags
gTS.mode = 0;
g_GameFlags &= ~0x04;
@@ -456,7 +464,18 @@
rect.top = gTS.ypos_line[gTS.line % 4] + gTS.rcText.top + gTS.offsetY;
rect.right = rect.left + 5;
rect.bottom = rect.top + 11;
- CortBox(&rect, 0xFFFFFE);
+#ifdef FIX_BUGS
+ CortBox(&rect, nod_color);
+
+ // This is how the Linux port fixed this, but it isn't done
+ // the way Pixel would do it (he only calls GetCortBoxColor
+ // once, during init functions, so our fix does it that way
+ // instead).
+ // Also, the red/blue values are swapped for some reason.
+ //CortBox(&rect, GetCortBoxColor(RGB(0xFF, 0xFF, 0xFE));
+#else
+ CortBox(&rect, RGB(0xFE, 0xFF, 0xFF));
+#endif
}
//Draw GIT