From 3eca2d7cf3299e9e45b0f66ddb6b5c45c0966ce9 Mon Sep 17 00:00:00 2001 From: Clownacy Date: Thu, 21 Feb 2019 20:56:27 +0000 Subject: [PATCH] Add all GetCortBoxColor calls back (also I found a vanilla bug) --- src/Back.cpp | 4 ++++ src/Game.cpp | 9 ++++++--- src/TextScr.cpp | 21 ++++++++++++++++++++- 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/src/Back.cpp b/src/Back.cpp index af73fb9a..8cfe234d 100644 --- 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); diff --git a/src/Game.cpp b/src/Game.cpp index 916af633..4022fe3f 100644 --- a/src/Game.cpp +++ b/src/Game.cpp @@ -267,6 +267,7 @@ int ModeTitle() 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 @@ int ModeTitle() 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 ModeAction() { 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 @@ int ModeAction() } ProcFade(); - CortBox(&grcFull, 0x000020); + CortBox(&grcFull, color); GetFramePosition(&frame_x, &frame_y); PutBack(frame_x, frame_y); PutStage_Back(frame_x, frame_y); diff --git a/src/TextScr.cpp b/src/TextScr.cpp index 98c67b3d..d65d579f 100644 --- a/src/TextScr.cpp +++ b/src/TextScr.cpp @@ -46,9 +46,17 @@ char text[0x100]; 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 @@ void PutTextScript() 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