forked from rosebudai/OpenRCT2-Web
Merge pull request #25815 from Gymnasiast/refactor/palette-renames
Move ColourMap to its own file
This commit is contained in:
41 files changed
+272
-187
No files matched your search
@@ -19,6 +19,7 @@
|
||||
#include <openrct2/Version.h>
|
||||
#include <openrct2/config/Config.h>
|
||||
#include <openrct2/core/UTF8.h>
|
||||
#include <openrct2/drawing/ColourMap.h>
|
||||
#include <openrct2/drawing/Drawing.h>
|
||||
#include <openrct2/drawing/Rectangle.h>
|
||||
#include <openrct2/interface/Colour.h>
|
||||
@@ -377,13 +378,13 @@ void InGameConsole::Draw(RenderTarget& rt) const
|
||||
if (_consoleCaretTicks < kConsoleCaretFlashThreshold)
|
||||
{
|
||||
auto caret = screenCoords + ScreenCoordsXY{ _caretScreenPosX, lineHeight };
|
||||
auto caretColour = ColourMapA[textColour.colour].lightest;
|
||||
auto caretColour = getColourMap(textColour.colour).lightest;
|
||||
Rectangle::fill(rt, { caret, caret + ScreenCoordsXY{ kConsoleCaretWidth, 1 } }, caretColour);
|
||||
}
|
||||
|
||||
// What about border colours?
|
||||
auto borderColour1 = ColourMapA[backgroundColour.colour].light;
|
||||
auto borderColour2 = ColourMapA[backgroundColour.colour].midDark;
|
||||
auto borderColour1 = getColourMap(backgroundColour.colour).light;
|
||||
auto borderColour2 = getColourMap(backgroundColour.colour).midDark;
|
||||
|
||||
// Input area top border
|
||||
Rectangle::fill(
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include <openrct2/Input.h>
|
||||
#include <openrct2/SpriteIds.h>
|
||||
#include <openrct2/config/Config.h>
|
||||
#include <openrct2/drawing/ColourMap.h>
|
||||
#include <openrct2/drawing/Drawing.h>
|
||||
#include <openrct2/drawing/Rectangle.h>
|
||||
#include <openrct2/drawing/Text.h>
|
||||
@@ -515,24 +516,24 @@ namespace OpenRCT2::Ui
|
||||
uint8_t colour = w.colours[widget.colour].colour;
|
||||
|
||||
// Border left of text
|
||||
Rectangle::fill(rt, { { l, t }, { l + 4, t } }, ColourMapA[colour].midDark);
|
||||
Rectangle::fill(rt, { { l + 1, t + 1 }, { l + 4, t + 1 } }, ColourMapA[colour].lighter);
|
||||
Rectangle::fill(rt, { { l, t }, { l + 4, t } }, getColourMap(colour).midDark);
|
||||
Rectangle::fill(rt, { { l + 1, t + 1 }, { l + 4, t + 1 } }, getColourMap(colour).lighter);
|
||||
|
||||
// Border right of text
|
||||
Rectangle::fill(rt, { { textRight, t }, { r - 1, t } }, ColourMapA[colour].midDark);
|
||||
Rectangle::fill(rt, { { textRight, t + 1 }, { r - 2, t + 1 } }, ColourMapA[colour].lighter);
|
||||
Rectangle::fill(rt, { { textRight, t }, { r - 1, t } }, getColourMap(colour).midDark);
|
||||
Rectangle::fill(rt, { { textRight, t + 1 }, { r - 2, t + 1 } }, getColourMap(colour).lighter);
|
||||
|
||||
// Border right
|
||||
Rectangle::fill(rt, { { r - 1, t + 1 }, { r - 1, b - 1 } }, ColourMapA[colour].midDark);
|
||||
Rectangle::fill(rt, { { r, t }, { r, b } }, ColourMapA[colour].lighter);
|
||||
Rectangle::fill(rt, { { r - 1, t + 1 }, { r - 1, b - 1 } }, getColourMap(colour).midDark);
|
||||
Rectangle::fill(rt, { { r, t }, { r, b } }, getColourMap(colour).lighter);
|
||||
|
||||
// Border bottom
|
||||
Rectangle::fill(rt, { { l, b - 1 }, { r - 2, b - 1 } }, ColourMapA[colour].midDark);
|
||||
Rectangle::fill(rt, { { l, b }, { r - 1, b } }, ColourMapA[colour].lighter);
|
||||
Rectangle::fill(rt, { { l, b - 1 }, { r - 2, b - 1 } }, getColourMap(colour).midDark);
|
||||
Rectangle::fill(rt, { { l, b }, { r - 1, b } }, getColourMap(colour).lighter);
|
||||
|
||||
// Border left
|
||||
Rectangle::fill(rt, { { l, t + 1 }, { l, b - 2 } }, ColourMapA[colour].midDark);
|
||||
Rectangle::fill(rt, { { l + 1, t + 2 }, { l + 1, b - 2 } }, ColourMapA[colour].lighter);
|
||||
Rectangle::fill(rt, { { l, t + 1 }, { l, b - 2 } }, getColourMap(colour).midDark);
|
||||
Rectangle::fill(rt, { { l + 1, t + 2 }, { l + 1, b - 2 } }, getColourMap(colour).lighter);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -562,7 +563,7 @@ namespace OpenRCT2::Ui
|
||||
if (colour.colour == COLOUR_BLACK)
|
||||
Rectangle::fill(
|
||||
rt, { { topLeft + ScreenCoordsXY{ 1, 1 } }, { bottomRight - ScreenCoordsXY{ 1, 1 } } },
|
||||
ColourMapA[colour.colour].dark);
|
||||
getColourMap(colour.colour).dark);
|
||||
else
|
||||
Rectangle::filter(
|
||||
rt, { { topLeft + ScreenCoordsXY{ 1, 1 } }, { bottomRight - ScreenCoordsXY{ 1, 1 } } },
|
||||
@@ -768,17 +769,17 @@ namespace OpenRCT2::Ui
|
||||
colour.flags.set(ColourFlag::translucent, false);
|
||||
|
||||
// Trough
|
||||
Rectangle::fill(rt, { { l + kScrollBarWidth, t }, { r - kScrollBarWidth, b } }, ColourMapA[colour.colour].lighter);
|
||||
Rectangle::fill(rt, { { l + kScrollBarWidth, t }, { r - kScrollBarWidth, b } }, getColourMap(colour.colour).lighter);
|
||||
Rectangle::fill(
|
||||
rt, { { l + kScrollBarWidth, t }, { r - kScrollBarWidth, b } }, ColourMapA[colour.colour].midDark, true);
|
||||
rt, { { l + kScrollBarWidth, t }, { r - kScrollBarWidth, b } }, getColourMap(colour.colour).midDark, true);
|
||||
Rectangle::fill(
|
||||
rt, { { l + kScrollBarWidth, t + 2 }, { r - kScrollBarWidth, t + 2 } }, ColourMapA[colour.colour].midDark);
|
||||
rt, { { l + kScrollBarWidth, t + 2 }, { r - kScrollBarWidth, t + 2 } }, getColourMap(colour.colour).midDark);
|
||||
Rectangle::fill(
|
||||
rt, { { l + kScrollBarWidth, t + 3 }, { r - kScrollBarWidth, t + 3 } }, ColourMapA[colour.colour].lighter);
|
||||
rt, { { l + kScrollBarWidth, t + 3 }, { r - kScrollBarWidth, t + 3 } }, getColourMap(colour.colour).lighter);
|
||||
Rectangle::fill(
|
||||
rt, { { l + kScrollBarWidth, t + 7 }, { r - kScrollBarWidth, t + 7 } }, ColourMapA[colour.colour].midDark);
|
||||
rt, { { l + kScrollBarWidth, t + 7 }, { r - kScrollBarWidth, t + 7 } }, getColourMap(colour.colour).midDark);
|
||||
Rectangle::fill(
|
||||
rt, { { l + kScrollBarWidth, t + 8 }, { r - kScrollBarWidth, t + 8 } }, ColourMapA[colour.colour].lighter);
|
||||
rt, { { l + kScrollBarWidth, t + 8 }, { r - kScrollBarWidth, t + 8 } }, getColourMap(colour.colour).lighter);
|
||||
|
||||
// Left button
|
||||
{
|
||||
@@ -815,17 +816,17 @@ namespace OpenRCT2::Ui
|
||||
colour.flags.set(ColourFlag::translucent, false);
|
||||
|
||||
// Trough
|
||||
Rectangle::fill(rt, { { l, t + kScrollBarWidth }, { r, b - kScrollBarWidth } }, ColourMapA[colour.colour].lighter);
|
||||
Rectangle::fill(rt, { { l, t + kScrollBarWidth }, { r, b - kScrollBarWidth } }, getColourMap(colour.colour).lighter);
|
||||
Rectangle::fill(
|
||||
rt, { { l, t + kScrollBarWidth }, { r, b - kScrollBarWidth } }, ColourMapA[colour.colour].midDark, true);
|
||||
rt, { { l, t + kScrollBarWidth }, { r, b - kScrollBarWidth } }, getColourMap(colour.colour).midDark, true);
|
||||
Rectangle::fill(
|
||||
rt, { { l + 2, t + kScrollBarWidth }, { l + 2, b - kScrollBarWidth } }, ColourMapA[colour.colour].midDark);
|
||||
rt, { { l + 2, t + kScrollBarWidth }, { l + 2, b - kScrollBarWidth } }, getColourMap(colour.colour).midDark);
|
||||
Rectangle::fill(
|
||||
rt, { { l + 3, t + kScrollBarWidth }, { l + 3, b - kScrollBarWidth } }, ColourMapA[colour.colour].lighter);
|
||||
rt, { { l + 3, t + kScrollBarWidth }, { l + 3, b - kScrollBarWidth } }, getColourMap(colour.colour).lighter);
|
||||
Rectangle::fill(
|
||||
rt, { { l + 7, t + kScrollBarWidth }, { l + 7, b - kScrollBarWidth } }, ColourMapA[colour.colour].midDark);
|
||||
rt, { { l + 7, t + kScrollBarWidth }, { l + 7, b - kScrollBarWidth } }, getColourMap(colour.colour).midDark);
|
||||
Rectangle::fill(
|
||||
rt, { { l + 8, t + kScrollBarWidth }, { l + 8, b - kScrollBarWidth } }, ColourMapA[colour.colour].lighter);
|
||||
rt, { { l + 8, t + kScrollBarWidth }, { l + 8, b - kScrollBarWidth } }, getColourMap(colour.colour).lighter);
|
||||
|
||||
// Up button
|
||||
Rectangle::fillInset(
|
||||
@@ -873,11 +874,11 @@ namespace OpenRCT2::Ui
|
||||
if (widgetIsDisabled(w, widgetIndex))
|
||||
{
|
||||
// Draw greyed out (light border bottom right shadow)
|
||||
auto mappedColour = ColourMapA[colour].lighter;
|
||||
auto mappedColour = getColourMap(colour).lighter;
|
||||
GfxDrawSpriteSolid(rt, image, screenCoords + ScreenCoordsXY{ 1, 1 }, mappedColour);
|
||||
|
||||
// Draw greyed out (dark)
|
||||
mappedColour = ColourMapA[colour].midLight;
|
||||
mappedColour = getColourMap(colour).midLight;
|
||||
GfxDrawSpriteSolid(rt, image, screenCoords, mappedColour);
|
||||
}
|
||||
else
|
||||
@@ -1209,7 +1210,7 @@ namespace OpenRCT2::Ui
|
||||
|
||||
if (Windows::TextBoxCaretIsFlashed())
|
||||
{
|
||||
auto colour = ColourMapA[w.colours[1].colour].midLight;
|
||||
auto colour = getColourMap(w.colours[1].colour).midLight;
|
||||
auto y = topLeft.y + 1 + widget.height() - 5;
|
||||
Rectangle::fill(rt, { { curX, y }, { curX + width, y } }, static_cast<PaletteIndex>(EnumValue(colour) + 5));
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include <numeric>
|
||||
#include <openrct2/Context.h>
|
||||
#include <openrct2/core/String.hpp>
|
||||
#include <openrct2/drawing/ColourMap.h>
|
||||
#include <openrct2/drawing/Drawing.h>
|
||||
#include <openrct2/drawing/Rectangle.h>
|
||||
#include <openrct2/localisation/Formatter.h>
|
||||
@@ -567,7 +568,7 @@ void CustomListView::MouseUp(const ScreenCoordsXY& pos)
|
||||
|
||||
void CustomListView::Paint(WindowBase* w, RenderTarget& rt, const ScrollArea* scroll) const
|
||||
{
|
||||
auto paletteIndex = ColourMapA[w->colours[1].colour].midLight;
|
||||
auto paletteIndex = getColourMap(w->colours[1].colour).midLight;
|
||||
Rectangle::fill(rt, { { rt.x, rt.y }, { rt.x + rt.width, rt.y + rt.height } }, paletteIndex);
|
||||
|
||||
int32_t y = ShowColumnHeaders ? kColumnHeaderHeight : 0;
|
||||
@@ -610,7 +611,7 @@ void CustomListView::Paint(WindowBase* w, RenderTarget& rt, const ScrollArea* sc
|
||||
{
|
||||
Rectangle::fill(
|
||||
rt, { { rt.x, y }, { rt.x + rt.width, y + (kListRowHeight - 1) } },
|
||||
ColourMapA[w->colours[1].colour].lighter, true);
|
||||
getColourMap(w->colours[1].colour).lighter, true);
|
||||
}
|
||||
|
||||
// Columns
|
||||
@@ -654,7 +655,7 @@ void CustomListView::Paint(WindowBase* w, RenderTarget& rt, const ScrollArea* sc
|
||||
{
|
||||
y = scroll->contentOffsetY;
|
||||
|
||||
auto bgColour = ColourMapA[w->colours[1].colour].midLight;
|
||||
auto bgColour = getColourMap(w->colours[1].colour).midLight;
|
||||
Rectangle::fill(rt, { { rt.x, y }, { rt.x + rt.width, y + 12 } }, bgColour);
|
||||
|
||||
int32_t x = 0;
|
||||
@@ -717,8 +718,8 @@ void CustomListView::PaintSeparator(RenderTarget& rt, const ScreenCoordsXY& pos,
|
||||
auto lineY1 = lineY0 + 1;
|
||||
|
||||
auto baseColour = ParentWindow->colours[1];
|
||||
auto lightColour = ColourMapA[baseColour.colour].lighter;
|
||||
auto darkColour = ColourMapA[baseColour.colour].midDark;
|
||||
auto lightColour = getColourMap(baseColour.colour).lighter;
|
||||
auto darkColour = getColourMap(baseColour.colour).midDark;
|
||||
|
||||
if (hasText)
|
||||
{
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include <openrct2/AssetPackManager.h>
|
||||
#include <openrct2/Context.h>
|
||||
#include <openrct2/SpriteIds.h>
|
||||
#include <openrct2/drawing/ColourMap.h>
|
||||
#include <openrct2/drawing/Drawing.h>
|
||||
#include <openrct2/drawing/Rectangle.h>
|
||||
#include <openrct2/drawing/Text.h>
|
||||
@@ -197,7 +198,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
auto rtCoords = ScreenCoordsXY{ rt.x, rt.y };
|
||||
Rectangle::fill(
|
||||
rt, { rtCoords, rtCoords + ScreenCoordsXY{ rt.width - 1, rt.height - 1 } },
|
||||
ColourMapA[colours[1].colour].midLight);
|
||||
getColourMap(colours[1].colour).midLight);
|
||||
|
||||
auto assetPackManager = GetContext()->GetAssetPackManager();
|
||||
if (assetPackManager == nullptr)
|
||||
@@ -244,12 +245,12 @@ namespace OpenRCT2::Ui::Windows
|
||||
auto fillRectangle = ScreenRect{ { 0, y }, { listWidth, y + ItemHeight - 1 } };
|
||||
if (isSelected)
|
||||
{
|
||||
Rectangle::fill(rt, fillRectangle, ColourMapA[colours[1].colour].midDark);
|
||||
Rectangle::fill(rt, fillRectangle, getColourMap(colours[1].colour).midDark);
|
||||
stringId = STR_WINDOW_COLOUR_2_STRINGID;
|
||||
}
|
||||
else if (isHighlighted)
|
||||
{
|
||||
Rectangle::fill(rt, fillRectangle, ColourMapA[colours[1].colour].midDark);
|
||||
Rectangle::fill(rt, fillRectangle, getColourMap(colours[1].colour).midDark);
|
||||
}
|
||||
|
||||
DrawTextEllipsised(rt, { 16, y + 1 }, listWidth, stringId, ft);
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <openrct2/SpriteIds.h>
|
||||
#include <openrct2/config/Config.h>
|
||||
#include <openrct2/core/BitSet.hpp>
|
||||
#include <openrct2/drawing/ColourMap.h>
|
||||
#include <openrct2/drawing/Drawing.h>
|
||||
#include <openrct2/drawing/Rectangle.h>
|
||||
#include <openrct2/interface/ColourWithFlags.h>
|
||||
@@ -134,9 +135,10 @@ namespace OpenRCT2::Ui::Windows
|
||||
}
|
||||
else
|
||||
{
|
||||
Rectangle::fill(rt, { leftTop, rightBottom }, ColourMapA[colours[0].colour].midDark);
|
||||
Rectangle::fill(rt, { leftTop, rightBottom }, getColourMap(colours[0].colour).midDark);
|
||||
Rectangle::fill(
|
||||
rt, { leftTop + shadowOffset, rightBottom + shadowOffset }, ColourMapA[colours[0].colour].lightest);
|
||||
rt, { leftTop + shadowOffset, rightBottom + shadowOffset },
|
||||
getColourMap(colours[0].colour).lightest);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include <openrct2/Input.h>
|
||||
#include <openrct2/OpenRCT2.h>
|
||||
#include <openrct2/SpriteIds.h>
|
||||
#include <openrct2/drawing/ColourMap.h>
|
||||
#include <openrct2/drawing/Drawing.h>
|
||||
#include <openrct2/drawing/Rectangle.h>
|
||||
#include <openrct2/interface/ColourWithFlags.h>
|
||||
@@ -275,7 +276,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
const auto& gameState = getGameState();
|
||||
|
||||
// Draw background
|
||||
auto paletteIndex = ColourMapA[colours[1].colour].midLight;
|
||||
auto paletteIndex = getColourMap(colours[1].colour).midLight;
|
||||
GfxClear(rt, paletteIndex);
|
||||
|
||||
int16_t boxWidth = widgets[WIDX_RESEARCH_ORDER_SCROLL].width() - 1;
|
||||
@@ -379,7 +380,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
rt,
|
||||
{ windowPos + ScreenCoordsXY{ bkWidget.left + 1, bkWidget.top + 1 },
|
||||
windowPos + ScreenCoordsXY{ bkWidget.right - 1, bkWidget.bottom - 1 } },
|
||||
ColourMapA[colours[1].colour].darkest);
|
||||
getColourMap(colours[1].colour).darkest);
|
||||
|
||||
auto* researchItem = WindowEditorInventionsListDragGetItem();
|
||||
if (researchItem == nullptr || researchItem->IsNull())
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include <openrct2/core/EnumUtils.hpp>
|
||||
#include <openrct2/core/Path.hpp>
|
||||
#include <openrct2/core/String.hpp>
|
||||
#include <openrct2/drawing/ColourMap.h>
|
||||
#include <openrct2/drawing/Drawing.h>
|
||||
#include <openrct2/drawing/Rectangle.h>
|
||||
#include <openrct2/localisation/Formatter.h>
|
||||
@@ -732,7 +733,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
ScreenCoordsXY screenCoords;
|
||||
bool ridePage = (GetSelectedObjectType() == ObjectType::ride);
|
||||
|
||||
auto paletteIndex = ColourMapA[colours[1].colour].midLight;
|
||||
auto paletteIndex = getColourMap(colours[1].colour).midLight;
|
||||
GfxClear(rt, paletteIndex);
|
||||
|
||||
screenCoords.y = 0;
|
||||
@@ -1067,7 +1068,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
rt,
|
||||
{ windowPos + ScreenCoordsXY{ previewWidget.left + 1, previewWidget.top + 1 },
|
||||
windowPos + ScreenCoordsXY{ previewWidget.right - 1, previewWidget.bottom - 1 } },
|
||||
ColourMapA[colours[1].colour].darkest);
|
||||
getColourMap(colours[1].colour).darkest);
|
||||
|
||||
// Draw number of selected items
|
||||
if (!(gLegacyScene == LegacyScene::trackDesignsManager))
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <openrct2/SpriteIds.h>
|
||||
#include <openrct2/actions/ParkEntrancePlaceAction.h>
|
||||
#include <openrct2/audio/Audio.h>
|
||||
#include <openrct2/drawing/ColourMap.h>
|
||||
#include <openrct2/drawing/Drawing.h>
|
||||
#include <openrct2/drawing/Rectangle.h>
|
||||
#include <openrct2/object/EntranceObject.h>
|
||||
@@ -318,7 +319,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
|
||||
void onScrollDraw(int32_t scrollIndex, RenderTarget& rt) override
|
||||
{
|
||||
GfxClear(rt, ColourMapA[colours[1].colour].midLight);
|
||||
GfxClear(rt, getColourMap(colours[1].colour).midLight);
|
||||
|
||||
ScreenCoordsXY coords{ 1, 1 };
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include <openrct2/actions/ParkSetNameAction.h>
|
||||
#include <openrct2/actions/ScenarioSetSettingAction.h>
|
||||
#include <openrct2/core/String.hpp>
|
||||
#include <openrct2/drawing/ColourMap.h>
|
||||
#include <openrct2/drawing/Drawing.h>
|
||||
#include <openrct2/drawing/Font.h>
|
||||
#include <openrct2/drawing/Rectangle.h>
|
||||
@@ -2338,7 +2339,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
*/
|
||||
void RidesOnScrollDraw(RenderTarget& rt, int32_t scrollIndex)
|
||||
{
|
||||
auto colour = ColourMapA[colours[1].colour].midLight;
|
||||
auto colour = getColourMap(colours[1].colour).midLight;
|
||||
Rectangle::fill(rt, { { rt.x, rt.y }, { rt.x + rt.width - 1, rt.y + rt.height - 1 } }, colour);
|
||||
|
||||
for (int32_t i = 0; i < static_cast<int32_t>(_rideableRides.size()); i++)
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <openrct2/GameState.h>
|
||||
#include <openrct2/SpriteIds.h>
|
||||
#include <openrct2/actions/ParkSetLoanAction.h>
|
||||
#include <openrct2/drawing/ColourMap.h>
|
||||
#include <openrct2/drawing/Drawing.h>
|
||||
#include <openrct2/drawing/Rectangle.h>
|
||||
#include <openrct2/localisation/Formatter.h>
|
||||
@@ -415,7 +416,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
rt,
|
||||
{ screenCoords - ScreenCoordsXY{ 0, 1 },
|
||||
screenCoords + ScreenCoordsXY{ row_width, (kTableCellHeight - 2) } },
|
||||
ColourMapA[colours[1].colour].lighter, true);
|
||||
getColourMap(colours[1].colour).lighter, true);
|
||||
|
||||
screenCoords.y += kTableCellHeight;
|
||||
}
|
||||
@@ -609,7 +610,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
Rectangle::fill(
|
||||
rt,
|
||||
{ screenCoords - ScreenCoordsXY{ 0, 1 }, screenCoords + ScreenCoordsXY{ 121, (kTableCellHeight - 2) } },
|
||||
ColourMapA[colours[1].colour].lighter, true);
|
||||
getColourMap(colours[1].colour).lighter, true);
|
||||
|
||||
DrawTextBasic(rt, screenCoords - ScreenCoordsXY{ 0, 1 }, _windowFinancesSummaryRowLabels[i]);
|
||||
screenCoords.y += kTableCellHeight;
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <openrct2/config/Config.h>
|
||||
#include <openrct2/core/EnumUtils.hpp>
|
||||
#include <openrct2/core/String.hpp>
|
||||
#include <openrct2/drawing/ColourMap.h>
|
||||
#include <openrct2/drawing/Drawing.h>
|
||||
#include <openrct2/drawing/Rectangle.h>
|
||||
#include <openrct2/entity/Guest.h>
|
||||
@@ -1355,7 +1356,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
|
||||
void onScrollDrawRides(int32_t scrollIndex, RenderTarget& rt)
|
||||
{
|
||||
auto colour = ColourMapA[colours[1].colour].midLight;
|
||||
auto colour = getColourMap(colours[1].colour).midLight;
|
||||
Rectangle::fill(rt, { { rt.x, rt.y }, { rt.x + rt.width - 1, rt.y + rt.height - 1 } }, colour);
|
||||
|
||||
for (int32_t listIndex = 0; listIndex < static_cast<int32_t>(_riddenRides.size()); listIndex++)
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <openrct2/SpriteIds.h>
|
||||
#include <openrct2/core/Numerics.hpp>
|
||||
#include <openrct2/core/String.hpp>
|
||||
#include <openrct2/drawing/ColourMap.h>
|
||||
#include <openrct2/drawing/Drawing.h>
|
||||
#include <openrct2/drawing/Rectangle.h>
|
||||
#include <openrct2/entity/EntityList.h>
|
||||
@@ -576,7 +577,8 @@ namespace OpenRCT2::Ui::Windows
|
||||
void onScrollDraw(int32_t scrollIndex, RenderTarget& rt) override
|
||||
{
|
||||
Rectangle::fill(
|
||||
rt, { { rt.x, rt.y }, { rt.x + rt.width - 1, rt.y + rt.height - 1 } }, ColourMapA[colours[1].colour].midLight);
|
||||
rt, { { rt.x, rt.y }, { rt.x + rt.width - 1, rt.y + rt.height - 1 } },
|
||||
getColourMap(colours[1].colour).midLight);
|
||||
switch (_selectedTab)
|
||||
{
|
||||
case TabId::Individual:
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <openrct2/core/File.h>
|
||||
#include <openrct2/core/Path.hpp>
|
||||
#include <openrct2/core/UnitConversion.h>
|
||||
#include <openrct2/drawing/ColourMap.h>
|
||||
#include <openrct2/drawing/Drawing.h>
|
||||
#include <openrct2/drawing/Rectangle.h>
|
||||
#include <openrct2/localisation/Formatter.h>
|
||||
@@ -157,7 +158,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
// Track preview
|
||||
Widget* widget = &widgets[WIDX_TRACK_PREVIEW];
|
||||
auto screenPos = windowPos + ScreenCoordsXY{ widget->left + 1, widget->top + 1 };
|
||||
auto colour = ColourMapA[colours[0].colour].darkest;
|
||||
auto colour = getColourMap(colours[0].colour).darkest;
|
||||
Rectangle::fill(rt, { screenPos, screenPos + ScreenCoordsXY{ 369, 216 } }, colour);
|
||||
|
||||
G1Element g1temp = {};
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include <openrct2/core/Guard.hpp>
|
||||
#include <openrct2/core/Path.hpp>
|
||||
#include <openrct2/core/String.hpp>
|
||||
#include <openrct2/drawing/ColourMap.h>
|
||||
#include <openrct2/drawing/Drawing.h>
|
||||
#include <openrct2/drawing/Rectangle.h>
|
||||
#include <openrct2/interface/ColourWithFlags.h>
|
||||
@@ -462,7 +463,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
|
||||
if (targetType == PreviewImageType::screenshot)
|
||||
{
|
||||
auto colour = ColourMapA[colours[1].colour].dark;
|
||||
auto colour = getColourMap(colours[1].colour).dark;
|
||||
GfxDrawSpriteSolid(rt, ImageId(SPR_G2_LOGO_MONO_DITHERED), imagePos, colour);
|
||||
}
|
||||
|
||||
@@ -1080,7 +1081,8 @@ namespace OpenRCT2::Ui::Windows
|
||||
void onScrollDraw(int32_t scrollIndex, RenderTarget& rt) override
|
||||
{
|
||||
Rectangle::fill(
|
||||
rt, { { rt.x, rt.y }, { rt.x + rt.width - 1, rt.y + rt.height - 1 } }, ColourMapA[colours[1].colour].midLight);
|
||||
rt, { { rt.x, rt.y }, { rt.x + rt.width - 1, rt.y + rt.height - 1 } },
|
||||
getColourMap(colours[1].colour).midLight);
|
||||
|
||||
const int32_t listWidth = widgets[WIDX_SCROLL].width() - 1;
|
||||
const auto sizeColumnLeft = widgets[WIDX_SORT_SIZE].left;
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include <openrct2/config/Config.h>
|
||||
#include <openrct2/core/FileSystem.hpp>
|
||||
#include <openrct2/core/UnitConversion.h>
|
||||
#include <openrct2/drawing/ColourMap.h>
|
||||
#include <openrct2/drawing/Drawing.h>
|
||||
#include <openrct2/localisation/Formatter.h>
|
||||
#include <openrct2/object/ObjectManager.h>
|
||||
@@ -28,6 +29,7 @@
|
||||
#include <openrct2/world/map_generator/MapGen.h>
|
||||
#include <openrct2/world/map_generator/PngTerrainGenerator.h>
|
||||
|
||||
using namespace OpenRCT2::Drawing;
|
||||
using namespace OpenRCT2::World;
|
||||
|
||||
namespace OpenRCT2::Ui::Windows
|
||||
@@ -299,7 +301,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
pressedWidgets |= 1LL << (WIDX_TAB_1 + page);
|
||||
}
|
||||
|
||||
void DrawTabImage(Drawing::RenderTarget& rt, int32_t newPage, int32_t spriteIndex)
|
||||
void DrawTabImage(RenderTarget& rt, int32_t newPage, int32_t spriteIndex)
|
||||
{
|
||||
WidgetIndex widgetIndex = WIDX_TAB_1 + newPage;
|
||||
|
||||
@@ -317,7 +319,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
}
|
||||
}
|
||||
|
||||
void DrawTabImages(Drawing::RenderTarget& rt)
|
||||
void DrawTabImages(RenderTarget& rt)
|
||||
{
|
||||
DrawTabImage(rt, WINDOW_MAPGEN_PAGE_BASE, SPR_TAB_GEARS_0);
|
||||
DrawTabImage(rt, WINDOW_MAPGEN_PAGE_TERRAIN, SPR_G2_MAP_GEN_TERRAIN_TAB);
|
||||
@@ -597,7 +599,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
// clang-format on
|
||||
}
|
||||
|
||||
void BaseDraw(Drawing::RenderTarget& rt)
|
||||
void BaseDraw(RenderTarget& rt)
|
||||
{
|
||||
drawWidgets(rt);
|
||||
DrawTabImages(rt);
|
||||
@@ -759,7 +761,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
setWidgetDisabled(WIDX_TREE_ALTITUDE_MAX_DOWN, !_settings.trees || isFlatland);
|
||||
}
|
||||
|
||||
void ForestsDraw(Drawing::RenderTarget& rt)
|
||||
void ForestsDraw(RenderTarget& rt)
|
||||
{
|
||||
drawWidgets(rt);
|
||||
DrawTabImages(rt);
|
||||
@@ -863,7 +865,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
}
|
||||
}
|
||||
|
||||
void SimplexDraw(Drawing::RenderTarget& rt)
|
||||
void SimplexDraw(RenderTarget& rt)
|
||||
{
|
||||
drawWidgets(rt);
|
||||
DrawTabImages(rt);
|
||||
@@ -973,7 +975,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
setCheckboxValue(WIDX_HEIGHTMAP_NORMALIZE, _settings.normalize_height);
|
||||
}
|
||||
|
||||
void HeightmapDraw(Drawing::RenderTarget& rt)
|
||||
void HeightmapDraw(RenderTarget& rt)
|
||||
{
|
||||
const auto enabledColour = colours[1];
|
||||
const auto disabledColour = enabledColour.withFlag(ColourFlag::inset, true);
|
||||
@@ -1159,7 +1161,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
}
|
||||
}
|
||||
|
||||
void DrawDropdownButton(Drawing::RenderTarget& rt, WidgetIndex widgetIndex, ImageId image)
|
||||
void DrawDropdownButton(RenderTarget& rt, WidgetIndex widgetIndex, ImageId image)
|
||||
{
|
||||
const auto& widget = widgets[widgetIndex];
|
||||
ScreenCoordsXY pos = { windowPos.x + widget.left, windowPos.y + widget.top };
|
||||
@@ -1167,12 +1169,12 @@ namespace OpenRCT2::Ui::Windows
|
||||
{
|
||||
// Draw greyed out (light border bottom right shadow)
|
||||
auto colour = colours[widget.colour].colour;
|
||||
auto paletteIndex = ColourMapA[colour].lighter;
|
||||
auto paletteIndex = getColourMap(colour).lighter;
|
||||
GfxDrawSpriteSolid(rt, image, pos + ScreenCoordsXY{ 1, 1 }, paletteIndex);
|
||||
|
||||
// Draw greyed out (dark)
|
||||
colour = colours[widget.colour].colour;
|
||||
paletteIndex = ColourMapA[colour].midLight;
|
||||
paletteIndex = getColourMap(colour).midLight;
|
||||
GfxDrawSpriteSolid(rt, image, pos, paletteIndex);
|
||||
}
|
||||
else
|
||||
@@ -1181,7 +1183,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
}
|
||||
}
|
||||
|
||||
void DrawDropdownButtons(Drawing::RenderTarget& rt, WidgetIndex floorWidgetIndex, WidgetIndex edgeWidgetIndex)
|
||||
void DrawDropdownButtons(RenderTarget& rt, WidgetIndex floorWidgetIndex, WidgetIndex edgeWidgetIndex)
|
||||
{
|
||||
auto& objManager = GetContext()->GetObjectManager();
|
||||
const auto* surfaceObj = objManager.GetLoadedObject<TerrainSurfaceObject>(_settings.landTexture);
|
||||
@@ -1223,7 +1225,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
SetPressedTab();
|
||||
}
|
||||
|
||||
void TerrainDraw(Drawing::RenderTarget& rt)
|
||||
void TerrainDraw(RenderTarget& rt)
|
||||
{
|
||||
drawWidgets(rt);
|
||||
DrawTabImages(rt);
|
||||
@@ -1334,7 +1336,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
SetPressedTab();
|
||||
}
|
||||
|
||||
void WaterDraw(Drawing::RenderTarget& rt)
|
||||
void WaterDraw(RenderTarget& rt)
|
||||
{
|
||||
drawWidgets(rt);
|
||||
DrawTabImages(rt);
|
||||
@@ -1446,7 +1448,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
}
|
||||
}
|
||||
|
||||
void onDraw(Drawing::RenderTarget& rt) override
|
||||
void onDraw(RenderTarget& rt) override
|
||||
{
|
||||
switch (page)
|
||||
{
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <openrct2/actions/NetworkModifyGroupAction.h>
|
||||
#include <openrct2/config/Config.h>
|
||||
#include <openrct2/core/String.hpp>
|
||||
#include <openrct2/drawing/ColourMap.h>
|
||||
#include <openrct2/drawing/Drawing.h>
|
||||
#include <openrct2/drawing/Rectangle.h>
|
||||
#include <openrct2/interface/ColourWithFlags.h>
|
||||
@@ -396,7 +397,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
auto rtCoords = ScreenCoordsXY{ rt.x, rt.y };
|
||||
Rectangle::fill(
|
||||
rt, { rtCoords, rtCoords + ScreenCoordsXY{ rt.width - 1, rt.height - 1 } },
|
||||
ColourMapA[colours[1].colour].midLight);
|
||||
getColourMap(colours[1].colour).midLight);
|
||||
|
||||
for (int32_t i = 0; i < Network::GetNumActions(); i++)
|
||||
{
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <openrct2/audio/Audio.h>
|
||||
#include <openrct2/config/Config.h>
|
||||
#include <openrct2/core/String.hpp>
|
||||
#include <openrct2/drawing/ColourMap.h>
|
||||
#include <openrct2/drawing/Drawing.h>
|
||||
#include <openrct2/drawing/Rectangle.h>
|
||||
#include <openrct2/localisation/Formatter.h>
|
||||
@@ -496,7 +497,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
return;
|
||||
}
|
||||
|
||||
GfxClear(rt, ColourMapA[colours[1].colour].midLight);
|
||||
GfxClear(rt, getColourMap(colours[1].colour).midLight);
|
||||
|
||||
ScreenCoordsXY coords{ 1, 1 };
|
||||
RideSelection* listItem = _windowNewRideListItems;
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <openrct2/SpriteIds.h>
|
||||
#include <openrct2/audio/Audio.h>
|
||||
#include <openrct2/config/Config.h>
|
||||
#include <openrct2/drawing/ColourMap.h>
|
||||
#include <openrct2/drawing/Drawing.h>
|
||||
#include <openrct2/drawing/Rectangle.h>
|
||||
#include <openrct2/entity/EntityRegistry.h>
|
||||
@@ -462,7 +463,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
int32_t y = 0;
|
||||
int32_t i = 0;
|
||||
|
||||
const auto backgroundPaletteIndex = ColourMapA[colours[3].colour].light;
|
||||
const auto backgroundPaletteIndex = getColourMap(colours[3].colour).light;
|
||||
// Fill the scrollbar gap if no scrollbar is visible
|
||||
const bool scrollbarVisible = scrolls[0].contentHeight > widgets[WIDX_SCROLL].height() - 1;
|
||||
const auto scrollbarFill = scrollbarVisible ? 0 : kScrollBarWidth;
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include <openrct2/core/Http.h>
|
||||
#include <openrct2/core/Json.hpp>
|
||||
#include <openrct2/core/String.hpp>
|
||||
#include <openrct2/drawing/ColourMap.h>
|
||||
#include <openrct2/drawing/Drawing.h>
|
||||
#include <openrct2/drawing/Rectangle.h>
|
||||
#include <openrct2/localisation/Formatter.h>
|
||||
@@ -515,7 +516,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
auto rtCoords = ScreenCoordsXY{ rt.x, rt.y };
|
||||
Rectangle::fill(
|
||||
rt, { rtCoords, rtCoords + ScreenCoordsXY{ rt.width - 1, rt.height - 1 } },
|
||||
ColourMapA[colours[1].colour].midLight);
|
||||
getColourMap(colours[1].colour).midLight);
|
||||
const int32_t listWidth = widgets[WIDX_SCROLL].width() - 1;
|
||||
|
||||
for (int32_t i = 0; i < numListItems; i++)
|
||||
@@ -532,11 +533,11 @@ namespace OpenRCT2::Ui::Windows
|
||||
{ listWidth, screenCoords.y + kScrollableRowHeight - 1 } };
|
||||
// If hovering over item, change the color and fill the backdrop.
|
||||
if (i == selectedListItem)
|
||||
Rectangle::fill(rt, screenRect, ColourMapA[colours[1].colour].darker);
|
||||
Rectangle::fill(rt, screenRect, getColourMap(colours[1].colour).darker);
|
||||
else if (i == _highlightedIndex)
|
||||
Rectangle::fill(rt, screenRect, ColourMapA[colours[1].colour].midDark);
|
||||
Rectangle::fill(rt, screenRect, getColourMap(colours[1].colour).midDark);
|
||||
else if ((i & 1) != 0) // odd / even check
|
||||
Rectangle::fill(rt, screenRect, ColourMapA[colours[1].colour].light);
|
||||
Rectangle::fill(rt, screenRect, getColourMap(colours[1].colour).light);
|
||||
|
||||
// Draw the actual object entry's name...
|
||||
screenCoords.x = kNameColLeft - 3;
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <openrct2/core/EnumUtils.hpp>
|
||||
#include <openrct2/core/File.h>
|
||||
#include <openrct2/core/String.hpp>
|
||||
#include <openrct2/drawing/ColourMap.h>
|
||||
#include <openrct2/drawing/Drawing.h>
|
||||
#include <openrct2/drawing/IDrawingEngine.h>
|
||||
#include <openrct2/drawing/ScrollingText.h>
|
||||
@@ -58,6 +59,7 @@ extern void ImportPersistentData();
|
||||
|
||||
using namespace OpenRCT2;
|
||||
using namespace OpenRCT2::Audio;
|
||||
using namespace OpenRCT2::Drawing;
|
||||
|
||||
namespace OpenRCT2::Ui::Windows
|
||||
{
|
||||
@@ -629,7 +631,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
CommonPrepareDrawAfter();
|
||||
}
|
||||
|
||||
void onDraw(Drawing::RenderTarget& rt) override
|
||||
void onDraw(RenderTarget& rt) override
|
||||
{
|
||||
drawWidgets(rt);
|
||||
DrawTabImages(rt);
|
||||
@@ -1019,7 +1021,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
widgets[WIDX_FRAME_RATE_LIMIT].text = kFrameRateLimitStringIds[activeItem];
|
||||
}
|
||||
|
||||
void DisplayDraw(Drawing::RenderTarget& rt)
|
||||
void DisplayDraw(RenderTarget& rt)
|
||||
{
|
||||
auto ft = Formatter();
|
||||
ft.Add<int32_t>(static_cast<int32_t>(Config::Get().general.windowScale * 100));
|
||||
@@ -1073,7 +1075,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
Config::Get().general.upperCaseBanners ^= 1;
|
||||
Config::Save();
|
||||
invalidate();
|
||||
Drawing::ScrollingText::invalidate();
|
||||
ScrollingText::invalidate();
|
||||
break;
|
||||
case WIDX_DISABLE_LIGHTNING_EFFECT_CHECKBOX:
|
||||
Config::Get().general.disableLightningEffect ^= 1;
|
||||
@@ -2225,7 +2227,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
widgets[WIDX_ASSET_PACKS].bottom = widgets[WIDX_GROUP_ADVANCED].bottom - 6;
|
||||
}
|
||||
|
||||
void AdvancedDraw(Drawing::RenderTarget& rt)
|
||||
void AdvancedDraw(RenderTarget& rt)
|
||||
{
|
||||
auto ft = Formatter();
|
||||
ft.Add<int32_t>(Config::Get().general.autosaveAmount);
|
||||
@@ -2302,7 +2304,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
Dropdown::Flag::StayOpen, num_items, widget->width() - 4);
|
||||
}
|
||||
|
||||
void DrawTabImages(Drawing::RenderTarget& rt)
|
||||
void DrawTabImages(RenderTarget& rt)
|
||||
{
|
||||
DrawTabImage(rt, WINDOW_OPTIONS_PAGE_DISPLAY, SPR_G2_MONITOR_TAB_START);
|
||||
DrawTabImage(rt, WINDOW_OPTIONS_PAGE_RENDERING, SPR_G2_TAB_TREE);
|
||||
@@ -2314,7 +2316,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
DrawTabImage(rt, WINDOW_OPTIONS_PAGE_ADVANCED, SPR_TAB_WRENCH_0);
|
||||
}
|
||||
|
||||
void DrawTabImage(Drawing::RenderTarget& rt, int32_t p, int32_t spriteIndex)
|
||||
void DrawTabImage(RenderTarget& rt, int32_t p, int32_t spriteIndex)
|
||||
{
|
||||
WidgetIndex widgetIndex = WIDX_FIRST_TAB + p;
|
||||
Widget* widget = &widgets[widgetIndex];
|
||||
@@ -2339,10 +2341,10 @@ namespace OpenRCT2::Ui::Windows
|
||||
|
||||
// Draw greyed out (light border bottom right shadow)
|
||||
GfxDrawSpriteSolid(
|
||||
rt, ImageId(spriteIndex), screenCoords + ScreenCoordsXY{ 1, 1 }, ColourMapA[windowColour].lighter);
|
||||
rt, ImageId(spriteIndex), screenCoords + ScreenCoordsXY{ 1, 1 }, getColourMap(windowColour).lighter);
|
||||
|
||||
// Draw greyed out (dark)
|
||||
GfxDrawSpriteSolid(rt, ImageId(spriteIndex), screenCoords, ColourMapA[windowColour].midLight);
|
||||
GfxDrawSpriteSolid(rt, ImageId(spriteIndex), screenCoords, getColourMap(windowColour).midLight);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
#include <openrct2/config/Config.h>
|
||||
#include <openrct2/core/String.hpp>
|
||||
#include <openrct2/core/UnitConversion.h>
|
||||
#include <openrct2/drawing/ColourMap.h>
|
||||
#include <openrct2/drawing/Drawing.h>
|
||||
#include <openrct2/drawing/Rectangle.h>
|
||||
#include <openrct2/entity/EntityList.h>
|
||||
@@ -5259,7 +5260,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
if (!isMusicActivated)
|
||||
return;
|
||||
|
||||
auto paletteIndex = ColourMapA[colours[1].colour].midLight;
|
||||
auto paletteIndex = getColourMap(colours[1].colour).midLight;
|
||||
GfxClear(rt, paletteIndex);
|
||||
|
||||
auto* musicObj = ride->getMusicObject();
|
||||
@@ -6042,7 +6043,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
|
||||
void GraphsOnScrollDraw(RenderTarget& rt, int32_t scrollIndex)
|
||||
{
|
||||
GfxClear(rt, ColourMapA[COLOUR_SATURATED_GREEN].darker);
|
||||
GfxClear(rt, getColourMap(COLOUR_SATURATED_GREEN).darker);
|
||||
|
||||
auto widget = &widgets[WIDX_GRAPH];
|
||||
auto ride = GetRide(rideId);
|
||||
@@ -6063,8 +6064,8 @@ namespace OpenRCT2::Ui::Windows
|
||||
}
|
||||
|
||||
// Vertical grid lines
|
||||
const auto lightColour = ColourMapA[COLOUR_SATURATED_GREEN].midLight;
|
||||
const auto darkColour = ColourMapA[COLOUR_SATURATED_GREEN].midDark;
|
||||
const auto lightColour = getColourMap(COLOUR_SATURATED_GREEN).midLight;
|
||||
const auto darkColour = getColourMap(COLOUR_SATURATED_GREEN).midDark;
|
||||
|
||||
int32_t time = 0;
|
||||
for (int32_t x = 0; x < rt.x + rt.width; x += 80)
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include <openrct2/actions/RideDemolishAction.h>
|
||||
#include <openrct2/actions/RideSetStatusAction.h>
|
||||
#include <openrct2/core/String.hpp>
|
||||
#include <openrct2/drawing/ColourMap.h>
|
||||
#include <openrct2/drawing/Drawing.h>
|
||||
#include <openrct2/drawing/Rectangle.h>
|
||||
#include <openrct2/interface/Colour.h>
|
||||
@@ -628,7 +629,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
{
|
||||
auto rtCoords = ScreenCoordsXY{ rt.x, rt.y };
|
||||
Rectangle::fill(
|
||||
rt, { rtCoords, rtCoords + ScreenCoordsXY{ rt.width, rt.height } }, ColourMapA[colours[1].colour].midLight);
|
||||
rt, { rtCoords, rtCoords + ScreenCoordsXY{ rt.width, rt.height } }, getColourMap(colours[1].colour).midLight);
|
||||
|
||||
auto y = 0;
|
||||
for (size_t i = 0; i < _rideList.size(); i++)
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <openrct2/audio/Audio.h>
|
||||
#include <openrct2/config/Config.h>
|
||||
#include <openrct2/core/FileStream.h>
|
||||
#include <openrct2/drawing/ColourMap.h>
|
||||
#include <openrct2/drawing/Drawing.h>
|
||||
#include <openrct2/drawing/Rectangle.h>
|
||||
#include <openrct2/interface/ColourWithFlags.h>
|
||||
@@ -542,7 +543,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
|
||||
void onScrollDraw(int32_t scrollIndex, RenderTarget& rt) override
|
||||
{
|
||||
auto paletteIndex = ColourMapA[colours[1].colour].midLight;
|
||||
auto paletteIndex = getColourMap(colours[1].colour).midLight;
|
||||
GfxClear(rt, paletteIndex);
|
||||
|
||||
StringId highlighted_format = STR_WINDOW_COLOUR_2_STRINGID;
|
||||
@@ -639,8 +640,8 @@ namespace OpenRCT2::Ui::Windows
|
||||
void DrawCategoryHeading(RenderTarget& rt, int32_t left, int32_t right, int32_t y, StringId stringId) const
|
||||
{
|
||||
auto baseColour = colours[1];
|
||||
auto lightColour = ColourMapA[baseColour.colour].lighter;
|
||||
auto darkColour = ColourMapA[baseColour.colour].midDark;
|
||||
auto lightColour = getColourMap(baseColour.colour).lighter;
|
||||
auto darkColour = getColourMap(baseColour.colour).midDark;
|
||||
|
||||
// Draw string
|
||||
int32_t centreX = (left + right) / 2;
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include <openrct2/config/Config.h>
|
||||
#include <openrct2/core/Guard.hpp>
|
||||
#include <openrct2/core/String.hpp>
|
||||
#include <openrct2/drawing/ColourMap.h>
|
||||
#include <openrct2/drawing/Drawing.h>
|
||||
#include <openrct2/drawing/Rectangle.h>
|
||||
#include <openrct2/localisation/Formatter.h>
|
||||
@@ -1708,7 +1709,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
|
||||
void onScrollDraw(int32_t scrollIndex, RenderTarget& rt) override
|
||||
{
|
||||
GfxClear(rt, ColourMapA[colours[1].colour].midLight);
|
||||
GfxClear(rt, getColourMap(colours[1].colour).midLight);
|
||||
|
||||
auto numColumns = GetNumColumns();
|
||||
auto tabIndex = _activeTabIndex;
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include <openrct2/SpriteIds.h>
|
||||
#include <openrct2/config/Config.h>
|
||||
#include <openrct2/core/Json.hpp>
|
||||
#include <openrct2/drawing/ColourMap.h>
|
||||
#include <openrct2/drawing/Drawing.h>
|
||||
#include <openrct2/drawing/Rectangle.h>
|
||||
#include <openrct2/interface/Colour.h>
|
||||
@@ -328,7 +329,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
|
||||
void onScrollDraw(int32_t scrollIndex, RenderTarget& rt) override
|
||||
{
|
||||
auto paletteIndex = ColourMapA[colours[1].colour].midLight;
|
||||
auto paletteIndex = getColourMap(colours[1].colour).midLight;
|
||||
GfxClear(rt, paletteIndex);
|
||||
|
||||
auto& listWidget = widgets[WIDX_LIST];
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <openrct2-ui/input/ShortcutManager.h>
|
||||
#include <openrct2-ui/interface/Widget.h>
|
||||
#include <openrct2/SpriteIds.h>
|
||||
#include <openrct2/drawing/ColourMap.h>
|
||||
#include <openrct2/drawing/Drawing.h>
|
||||
#include <openrct2/drawing/Rectangle.h>
|
||||
#include <openrct2/localisation/Formatter.h>
|
||||
@@ -302,7 +303,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
auto rtCoords = ScreenCoordsXY{ rt.x, rt.y };
|
||||
Rectangle::fill(
|
||||
rt, { rtCoords, rtCoords + ScreenCoordsXY{ rt.width - 1, rt.height - 1 } },
|
||||
ColourMapA[colours[1].colour].midLight);
|
||||
getColourMap(colours[1].colour).midLight);
|
||||
|
||||
// TODO: the line below is a workaround for what is presumably a bug with rt->width
|
||||
// see https://github.com/OpenRCT2/OpenRCT2/issues/11238 for details
|
||||
@@ -504,8 +505,8 @@ namespace OpenRCT2::Ui::Windows
|
||||
void DrawSeparator(RenderTarget& rt, int32_t y, int32_t scrollWidth)
|
||||
{
|
||||
const int32_t top = y + (kScrollableRowHeight / 2) - 1;
|
||||
Rectangle::fill(rt, { { 0, top }, { scrollWidth, top } }, ColourMapA[colours[1].colour].midDark);
|
||||
Rectangle::fill(rt, { { 0, top + 1 }, { scrollWidth, top + 1 } }, ColourMapA[colours[1].colour].lightest);
|
||||
Rectangle::fill(rt, { { 0, top }, { scrollWidth, top } }, getColourMap(colours[1].colour).midDark);
|
||||
Rectangle::fill(rt, { { 0, top + 1 }, { scrollWidth, top + 1 } }, getColourMap(colours[1].colour).lightest);
|
||||
}
|
||||
|
||||
void DrawItem(RenderTarget& rt, int32_t y, int32_t scrollWidth, const ShortcutStringPair& shortcut, bool isHighlighted)
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include <openrct2/config/Config.h>
|
||||
#include <openrct2/core/EnumUtils.hpp>
|
||||
#include <openrct2/core/String.hpp>
|
||||
#include <openrct2/drawing/ColourMap.h>
|
||||
#include <openrct2/drawing/Drawing.h>
|
||||
#include <openrct2/drawing/Rectangle.h>
|
||||
#include <openrct2/entity/EntityList.h>
|
||||
@@ -372,7 +373,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
auto rtCoords = ScreenCoordsXY{ rt.x, rt.y };
|
||||
Rectangle::fill(
|
||||
rt, { rtCoords, rtCoords + ScreenCoordsXY{ rt.width - 1, rt.height - 1 } },
|
||||
ColourMapA[colours[1].colour].midLight);
|
||||
getColourMap(colours[1].colour).midLight);
|
||||
|
||||
// How much space do we have for the name and action columns? (Discount scroll area and icons.)
|
||||
const int32_t nonIconSpace = widgets[WIDX_STAFF_LIST_LIST].width() - 1 - 15 - 68;
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include <openrct2/Input.h>
|
||||
#include <openrct2/core/String.hpp>
|
||||
#include <openrct2/core/UTF8.h>
|
||||
#include <openrct2/drawing/ColourMap.h>
|
||||
#include <openrct2/drawing/Drawing.h>
|
||||
#include <openrct2/drawing/Rectangle.h>
|
||||
#include <openrct2/localisation/Formatting.h>
|
||||
@@ -269,7 +270,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
|
||||
if (_cursorBlink > 15)
|
||||
{
|
||||
auto colour = ColourMapA[colours[1].colour].midLight;
|
||||
auto colour = getColourMap(colours[1].colour).midLight;
|
||||
// TODO: palette index addition
|
||||
Rectangle::fill(
|
||||
rt, { { cursorX, screenCoords.y + 9 }, { cursorX + textWidth, screenCoords.y + 9 } },
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include <openrct2/Game.h>
|
||||
#include <openrct2/Input.h>
|
||||
#include <openrct2/SpriteIds.h>
|
||||
#include <openrct2/drawing/ColourMap.h>
|
||||
#include <openrct2/drawing/Drawing.h>
|
||||
#include <openrct2/drawing/Rectangle.h>
|
||||
#include <openrct2/interface/ColourWithFlags.h>
|
||||
@@ -723,9 +724,8 @@ namespace OpenRCT2::Ui::Windows
|
||||
return;
|
||||
|
||||
if (!colours[1].flags.has(ColourFlag::translucent))
|
||||
// Rectangle::fill(rt, rt->x, rt->y, rt->x + rt->width - 1, rt->y + rt->height - 1,
|
||||
// ColourMapA[colours[1].colour].midLight);
|
||||
GfxClear(rt, ColourMapA[colours[1].colour].midLight);
|
||||
GfxClear(rt, getColourMap(colours[1].colour).midLight);
|
||||
|
||||
screenCoords.y = 0;
|
||||
for (int32_t i = 0; i < GetColourSchemeTabCount(); i++)
|
||||
{
|
||||
@@ -769,10 +769,10 @@ namespace OpenRCT2::Ui::Windows
|
||||
}
|
||||
else
|
||||
{
|
||||
auto fillColour = ColourMapA[colours[1].colour].midDark;
|
||||
auto fillColour = getColourMap(colours[1].colour).midDark;
|
||||
Rectangle::fill(rt, { leftTop, rightBottom }, fillColour);
|
||||
|
||||
fillColour = ColourMapA[colours[1].colour].lightest;
|
||||
fillColour = getColourMap(colours[1].colour).lightest;
|
||||
Rectangle::fill(rt, { leftTop + yPixelOffset, rightBottom + yPixelOffset }, fillColour);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <openrct2/SpriteIds.h>
|
||||
#include <openrct2/actions/TileModifyAction.h>
|
||||
#include <openrct2/core/Guard.hpp>
|
||||
#include <openrct2/drawing/ColourMap.h>
|
||||
#include <openrct2/drawing/Drawing.h>
|
||||
#include <openrct2/drawing/Rectangle.h>
|
||||
#include <openrct2/localisation/Formatter.h>
|
||||
@@ -1587,7 +1588,8 @@ static uint64_t PageDisabledWidgets[] = {
|
||||
{
|
||||
const int32_t listWidth = widgets[WIDX_LIST].width() - 1;
|
||||
Rectangle::fill(
|
||||
rt, { { rt.x, rt.y }, { rt.x + rt.width - 1, rt.y + rt.height - 1 } }, ColourMapA[colours[1].colour].midLight);
|
||||
rt, { { rt.x, rt.y }, { rt.x + rt.width - 1, rt.y + rt.height - 1 } },
|
||||
getColourMap(colours[1].colour).midLight);
|
||||
|
||||
// Show usage hint when nothing is selected
|
||||
if (!_tileSelected)
|
||||
@@ -1621,12 +1623,12 @@ static uint64_t PageDisabledWidgets[] = {
|
||||
auto fillRectangle = ScreenRect{ { 0, screenCoords.y },
|
||||
{ listWidth, screenCoords.y + kScrollableRowHeight - 1 } };
|
||||
if (selectedRow)
|
||||
Rectangle::fill(rt, fillRectangle, ColourMapA[colours[1].colour].midDark);
|
||||
Rectangle::fill(rt, fillRectangle, getColourMap(colours[1].colour).midDark);
|
||||
else if (hoveredRow)
|
||||
Rectangle::fill(rt, fillRectangle, ColourMapA[colours[1].colour].midDark, true);
|
||||
Rectangle::fill(rt, fillRectangle, getColourMap(colours[1].colour).midDark, true);
|
||||
// Zebra stripes
|
||||
else if (((windowTileInspectorElementCount - i) & 1) == 0)
|
||||
Rectangle::fill(rt, fillRectangle, ColourMapA[colours[1].colour].light, true);
|
||||
Rectangle::fill(rt, fillRectangle, getColourMap(colours[1].colour).light, true);
|
||||
|
||||
StringId stringFormat = STR_WINDOW_COLOUR_2_STRINGID;
|
||||
if (selectedRow || hoveredRow)
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include <openrct2/config/Config.h>
|
||||
#include <openrct2/core/String.hpp>
|
||||
#include <openrct2/core/UnitConversion.h>
|
||||
#include <openrct2/drawing/ColourMap.h>
|
||||
#include <openrct2/drawing/Drawing.h>
|
||||
#include <openrct2/drawing/IDrawingEngine.h>
|
||||
#include <openrct2/drawing/Rectangle.h>
|
||||
@@ -471,7 +472,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
|
||||
// Track preview
|
||||
auto& tdWidget = widgets[WIDX_TRACK_PREVIEW];
|
||||
auto colour = ColourMapA[colours[0].colour].darkest;
|
||||
auto colour = getColourMap(colours[0].colour).darkest;
|
||||
u8string path = _trackDesigns[trackIndex].path;
|
||||
|
||||
// Show track file path (in debug mode)
|
||||
@@ -676,7 +677,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
|
||||
void onScrollDraw(const int32_t scrollIndex, RenderTarget& rt) override
|
||||
{
|
||||
auto paletteIndex = ColourMapA[colours[0].colour].midLight;
|
||||
auto paletteIndex = getColourMap(colours[0].colour).midLight;
|
||||
GfxClear(rt, paletteIndex);
|
||||
|
||||
auto screenCoords = ScreenCoordsXY{ 0, 0 };
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
#include "core/Path.hpp"
|
||||
#include "core/String.hpp"
|
||||
#include "core/Timer.hpp"
|
||||
#include "drawing/ColourMap.h"
|
||||
#include "drawing/Drawing.h"
|
||||
#include "drawing/IDrawingEngine.h"
|
||||
#include "drawing/Image.h"
|
||||
@@ -563,7 +564,7 @@ namespace OpenRCT2
|
||||
{
|
||||
if (!gOpenRCT2NoGraphics)
|
||||
{
|
||||
ColoursInitMaps();
|
||||
Drawing::initColourMaps();
|
||||
}
|
||||
|
||||
WindowInitAll();
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
/*****************************************************************************
|
||||
* Copyright (c) 2014-2026 OpenRCT2 developers
|
||||
*
|
||||
* For a complete list of all authors, please refer to contributors.md
|
||||
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
|
||||
*
|
||||
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "ColourMap.h"
|
||||
|
||||
#include "../SpriteIds.h"
|
||||
#include "../core/Guard.hpp"
|
||||
|
||||
// FIXME: only included for GfxGetG1Element()
|
||||
#include "Drawing.h"
|
||||
|
||||
namespace OpenRCT2::Drawing
|
||||
{
|
||||
constexpr uint8_t kIndexColour0 = 243;
|
||||
constexpr uint8_t kIndexColour1 = 245;
|
||||
constexpr uint8_t kIndexDarkest = 245;
|
||||
constexpr uint8_t kIndexDarker = 246;
|
||||
constexpr uint8_t kIndexDark = 247;
|
||||
constexpr uint8_t kIndexMidDark = 248;
|
||||
constexpr uint8_t kIndexMidLight = 249;
|
||||
constexpr uint8_t kIndexLight = 250;
|
||||
constexpr uint8_t kIndexLighter = 251;
|
||||
constexpr uint8_t kIndexLightest = 252;
|
||||
constexpr uint8_t kIndexColour10 = 253;
|
||||
constexpr uint8_t kIndexColour11 = 254;
|
||||
|
||||
static std::array<ColourShadeMap, COLOUR_COUNT> _colourMap = {};
|
||||
|
||||
void initColourMaps()
|
||||
{
|
||||
// Get colour maps from g1
|
||||
for (int32_t i = 0; i < COLOUR_COUNT; i++)
|
||||
{
|
||||
// Get palette index in g1 / g2
|
||||
const auto paletteIndex = (i < kColourNumOriginal) ? SPR_PALETTE_2_START
|
||||
: SPR_G2_PALETTE_BEGIN - kColourNumOriginal;
|
||||
const auto* g1 = GfxGetG1Element(paletteIndex + i);
|
||||
if (g1 != nullptr)
|
||||
{
|
||||
_colourMap[i].colour0 = static_cast<PaletteIndex>(g1->offset[kIndexColour0]);
|
||||
_colourMap[i].colour1 = static_cast<PaletteIndex>(g1->offset[kIndexColour1]);
|
||||
_colourMap[i].darkest = static_cast<PaletteIndex>(g1->offset[kIndexDarkest]);
|
||||
_colourMap[i].darker = static_cast<PaletteIndex>(g1->offset[kIndexDarker]);
|
||||
_colourMap[i].dark = static_cast<PaletteIndex>(g1->offset[kIndexDark]);
|
||||
_colourMap[i].midDark = static_cast<PaletteIndex>(g1->offset[kIndexMidDark]);
|
||||
_colourMap[i].midLight = static_cast<PaletteIndex>(g1->offset[kIndexMidLight]);
|
||||
_colourMap[i].light = static_cast<PaletteIndex>(g1->offset[kIndexLight]);
|
||||
_colourMap[i].lighter = static_cast<PaletteIndex>(g1->offset[kIndexLighter]);
|
||||
_colourMap[i].lightest = static_cast<PaletteIndex>(g1->offset[kIndexLightest]);
|
||||
_colourMap[i].colour10 = static_cast<PaletteIndex>(g1->offset[kIndexColour10]);
|
||||
_colourMap[i].colour11 = static_cast<PaletteIndex>(g1->offset[kIndexColour11]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ColourShadeMap getColourMap(colour_t colour)
|
||||
{
|
||||
Guard::Assert(colour < _colourMap.size());
|
||||
return _colourMap[colour];
|
||||
}
|
||||
} // namespace OpenRCT2::Drawing
|
||||
@@ -0,0 +1,39 @@
|
||||
/*****************************************************************************
|
||||
* Copyright (c) 2014-2026 OpenRCT2 developers
|
||||
*
|
||||
* For a complete list of all authors, please refer to contributors.md
|
||||
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
|
||||
*
|
||||
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
||||
*****************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
using colour_t = uint8_t;
|
||||
|
||||
namespace OpenRCT2::Drawing
|
||||
{
|
||||
enum class PaletteIndex : uint8_t;
|
||||
|
||||
struct ColourShadeMap
|
||||
{
|
||||
PaletteIndex colour0;
|
||||
PaletteIndex colour1;
|
||||
PaletteIndex darkest;
|
||||
PaletteIndex darker;
|
||||
PaletteIndex dark;
|
||||
PaletteIndex midDark;
|
||||
PaletteIndex midLight;
|
||||
PaletteIndex light;
|
||||
PaletteIndex lighter;
|
||||
PaletteIndex lightest;
|
||||
PaletteIndex colour10;
|
||||
PaletteIndex colour11;
|
||||
};
|
||||
|
||||
ColourShadeMap getColourMap(colour_t colour);
|
||||
|
||||
void initColourMaps();
|
||||
} // namespace OpenRCT2::Drawing
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "../core/String.hpp"
|
||||
#include "../core/UTF8.h"
|
||||
#include "../core/UnicodeChar.h"
|
||||
#include "../drawing/ColourMap.h"
|
||||
#include "../drawing/Drawing.h"
|
||||
#include "../drawing/IDrawingContext.h"
|
||||
#include "../drawing/IDrawingEngine.h"
|
||||
@@ -296,7 +297,7 @@ static void ColourCharacter(TextColour colour, bool withOutline, TextColours& te
|
||||
static void ColourCharacterWindow(colour_t colour, bool withOutline, TextColours& textPalette)
|
||||
{
|
||||
TextColours mapping = {
|
||||
ColourMapA[colour].colour11,
|
||||
getColourMap(colour).colour11,
|
||||
PaletteIndex::pi0,
|
||||
PaletteIndex::pi0,
|
||||
};
|
||||
@@ -761,18 +762,18 @@ static void TTFProcessInitialColour(ColourWithFlags colour, TextDrawInfo* info)
|
||||
switch (info->darkness)
|
||||
{
|
||||
case TextDarkness::extraDark:
|
||||
newPalette.fill = ColourMapA[colour.colour].dark;
|
||||
newPalette.shadowOutline = ColourMapA[colour.colour].midLight;
|
||||
newPalette.fill = getColourMap(colour.colour).dark;
|
||||
newPalette.shadowOutline = getColourMap(colour.colour).midLight;
|
||||
break;
|
||||
|
||||
case TextDarkness::dark:
|
||||
newPalette.fill = ColourMapA[colour.colour].midDark;
|
||||
newPalette.shadowOutline = ColourMapA[colour.colour].light;
|
||||
newPalette.fill = getColourMap(colour.colour).midDark;
|
||||
newPalette.shadowOutline = getColourMap(colour.colour).light;
|
||||
break;
|
||||
|
||||
case TextDarkness::regular:
|
||||
newPalette.fill = ColourMapA[colour.colour].midLight;
|
||||
newPalette.shadowOutline = ColourMapA[colour.colour].lighter;
|
||||
newPalette.fill = getColourMap(colour.colour).midLight;
|
||||
newPalette.shadowOutline = getColourMap(colour.colour).lighter;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "../interface/Colour.h"
|
||||
#include "../interface/ColourWithFlags.h"
|
||||
#include "../world/Location.hpp"
|
||||
#include "ColourMap.h"
|
||||
#include "Drawing.h"
|
||||
#include "IDrawingContext.h"
|
||||
#include "IDrawingEngine.h"
|
||||
@@ -94,15 +95,15 @@ namespace OpenRCT2::Drawing::Rectangle
|
||||
PaletteIndex shadow, fill, hilight;
|
||||
if (brightness == FillBrightness::dark)
|
||||
{
|
||||
shadow = ColourMapA[colour.colour].dark;
|
||||
fill = ColourMapA[colour.colour].midLight;
|
||||
hilight = ColourMapA[colour.colour].lighter;
|
||||
shadow = getColourMap(colour.colour).dark;
|
||||
fill = getColourMap(colour.colour).midLight;
|
||||
hilight = getColourMap(colour.colour).lighter;
|
||||
}
|
||||
else
|
||||
{
|
||||
shadow = ColourMapA[colour.colour].midDark;
|
||||
fill = ColourMapA[colour.colour].light;
|
||||
hilight = ColourMapA[colour.colour].lighter;
|
||||
shadow = getColourMap(colour.colour).midDark;
|
||||
fill = getColourMap(colour.colour).light;
|
||||
hilight = getColourMap(colour.colour).lighter;
|
||||
}
|
||||
|
||||
switch (borderStyle)
|
||||
@@ -122,7 +123,7 @@ namespace OpenRCT2::Drawing::Rectangle
|
||||
{
|
||||
if (fillMode != FillMode::dontLightenWhenInset)
|
||||
{
|
||||
fill = ColourMapA[colour.colour].lighter;
|
||||
fill = getColourMap(colour.colour).lighter;
|
||||
}
|
||||
Rectangle::fill(rt, { leftTop + ScreenCoordsXY{ 1, 1 }, rightBottom - ScreenCoordsXY{ 1, 1 } }, fill);
|
||||
}
|
||||
|
||||
@@ -18,50 +18,6 @@
|
||||
|
||||
using namespace OpenRCT2::Drawing;
|
||||
|
||||
ColourShadeMap ColourMapA[COLOUR_COUNT] = {};
|
||||
|
||||
enum
|
||||
{
|
||||
INDEX_COLOUR_0 = 243,
|
||||
INDEX_COLOUR_1 = 245,
|
||||
INDEX_DARKEST = 245,
|
||||
INDEX_DARKER = 246,
|
||||
INDEX_DARK = 247,
|
||||
INDEX_MID_DARK = 248,
|
||||
INDEX_MID_LIGHT = 249,
|
||||
INDEX_LIGHT = 250,
|
||||
INDEX_LIGHTER = 251,
|
||||
INDEX_LIGHTEST = 252,
|
||||
INDEX_COLOUR_10 = 253,
|
||||
INDEX_COLOUR_11 = 254,
|
||||
};
|
||||
|
||||
void ColoursInitMaps()
|
||||
{
|
||||
// Get colour maps from g1
|
||||
for (int32_t i = 0; i < COLOUR_COUNT; i++)
|
||||
{
|
||||
// Get palette index in g1 / g2
|
||||
const auto paletteIndex = (i < kColourNumOriginal) ? SPR_PALETTE_2_START : SPR_G2_PALETTE_BEGIN - kColourNumOriginal;
|
||||
const auto* g1 = GfxGetG1Element(paletteIndex + i);
|
||||
if (g1 != nullptr)
|
||||
{
|
||||
ColourMapA[i].colour0 = static_cast<PaletteIndex>(g1->offset[INDEX_COLOUR_0]);
|
||||
ColourMapA[i].colour1 = static_cast<PaletteIndex>(g1->offset[INDEX_COLOUR_1]);
|
||||
ColourMapA[i].darkest = static_cast<PaletteIndex>(g1->offset[INDEX_DARKEST]);
|
||||
ColourMapA[i].darker = static_cast<PaletteIndex>(g1->offset[INDEX_DARKER]);
|
||||
ColourMapA[i].dark = static_cast<PaletteIndex>(g1->offset[INDEX_DARK]);
|
||||
ColourMapA[i].midDark = static_cast<PaletteIndex>(g1->offset[INDEX_MID_DARK]);
|
||||
ColourMapA[i].midLight = static_cast<PaletteIndex>(g1->offset[INDEX_MID_LIGHT]);
|
||||
ColourMapA[i].light = static_cast<PaletteIndex>(g1->offset[INDEX_LIGHT]);
|
||||
ColourMapA[i].lighter = static_cast<PaletteIndex>(g1->offset[INDEX_LIGHTER]);
|
||||
ColourMapA[i].lightest = static_cast<PaletteIndex>(g1->offset[INDEX_LIGHTEST]);
|
||||
ColourMapA[i].colour10 = static_cast<PaletteIndex>(g1->offset[INDEX_COLOUR_10]);
|
||||
ColourMapA[i].colour11 = static_cast<PaletteIndex>(g1->offset[INDEX_COLOUR_11]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace OpenRCT2::Colour
|
||||
{
|
||||
static const EnumMap<colour_t> LookupTable{
|
||||
|
||||
@@ -124,26 +124,6 @@ constexpr uint8_t kColourNumNormal = 54;
|
||||
constexpr colour_t kTextColour254 = 254;
|
||||
constexpr colour_t kTextColour255 = 255;
|
||||
|
||||
struct ColourShadeMap
|
||||
{
|
||||
OpenRCT2::Drawing::PaletteIndex colour0;
|
||||
OpenRCT2::Drawing::PaletteIndex colour1;
|
||||
OpenRCT2::Drawing::PaletteIndex darkest;
|
||||
OpenRCT2::Drawing::PaletteIndex darker;
|
||||
OpenRCT2::Drawing::PaletteIndex dark;
|
||||
OpenRCT2::Drawing::PaletteIndex midDark;
|
||||
OpenRCT2::Drawing::PaletteIndex midLight;
|
||||
OpenRCT2::Drawing::PaletteIndex light;
|
||||
OpenRCT2::Drawing::PaletteIndex lighter;
|
||||
OpenRCT2::Drawing::PaletteIndex lightest;
|
||||
OpenRCT2::Drawing::PaletteIndex colour10;
|
||||
OpenRCT2::Drawing::PaletteIndex colour11;
|
||||
};
|
||||
|
||||
extern ColourShadeMap ColourMapA[COLOUR_COUNT];
|
||||
|
||||
void ColoursInitMaps();
|
||||
|
||||
namespace OpenRCT2::Colour
|
||||
{
|
||||
colour_t FromString(std::string_view s, colour_t defaultValue = COLOUR_BLACK);
|
||||
|
||||
@@ -242,6 +242,7 @@
|
||||
<ClInclude Include="core\ZipStream.hpp" />
|
||||
<ClInclude Include="Date.h" />
|
||||
<ClInclude Include="Diagnostic.h" />
|
||||
<ClInclude Include="drawing\ColourMap.h" />
|
||||
<ClInclude Include="drawing\ColourPalette.h" />
|
||||
<ClInclude Include="drawing\Drawing.h" />
|
||||
<ClInclude Include="drawing\Drawing.String.h" />
|
||||
@@ -828,6 +829,7 @@
|
||||
<ClCompile Include="Date.cpp" />
|
||||
<ClCompile Include="Diagnostic.cpp" />
|
||||
<ClCompile Include="drawing\AVX2Drawing.cpp" />
|
||||
<ClCompile Include="drawing\ColourMap.cpp" />
|
||||
<ClCompile Include="drawing\Drawing.cpp" />
|
||||
<ClCompile Include="drawing\Drawing.Sprite.BMP.cpp" />
|
||||
<ClCompile Include="drawing\Drawing.Sprite.cpp" />
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "../../core/EnumUtils.hpp"
|
||||
#include "../../core/Numerics.hpp"
|
||||
#include "../../core/UTF8.h"
|
||||
#include "../../drawing/ColourMap.h"
|
||||
#include "../../drawing/Drawing.h"
|
||||
#include "../../drawing/ScrollingText.h"
|
||||
#include "../../interface/Viewport.h"
|
||||
@@ -309,7 +310,7 @@ static void PaintLargeSceneryScrollingText(
|
||||
PROFILED_FUNCTION();
|
||||
|
||||
auto textColour = isGhost ? static_cast<colour_t>(COLOUR_GREY) : tileElement.GetSecondaryColour();
|
||||
auto textPaletteIndex = direction == 0 ? ColourMapA[textColour].midDark : ColourMapA[textColour].light;
|
||||
auto textPaletteIndex = direction == 0 ? getColourMap(textColour).midDark : getColourMap(textColour).light;
|
||||
|
||||
auto banner = tileElement.GetBanner();
|
||||
if (banner == nullptr)
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "../../Game.h"
|
||||
#include "../../GameState.h"
|
||||
#include "../../config/Config.h"
|
||||
#include "../../drawing/ColourMap.h"
|
||||
#include "../../drawing/Drawing.h"
|
||||
#include "../../drawing/ScrollingText.h"
|
||||
#include "../../interface/Colour.h"
|
||||
@@ -172,7 +173,7 @@ static void PaintWallScrollingText(
|
||||
return;
|
||||
|
||||
auto textColour = isGhost ? static_cast<colour_t>(COLOUR_GREY) : wallElement.GetSecondaryColour();
|
||||
auto textPaletteIndex = direction == 0 ? ColourMapA[textColour].midDark : ColourMapA[textColour].light;
|
||||
auto textPaletteIndex = direction == 0 ? getColourMap(textColour).midDark : getColourMap(textColour).light;
|
||||
|
||||
auto ft = Formatter();
|
||||
banner->formatTextTo(ft);
|
||||
|
||||
Reference in new issue
Block a user