mirror of https://github.com/OpenRCT2/OpenRCT2.git
Remove snake_case from first chunk of Drawing (#19164)
* Remove snake_case from first chunk of Drawing * Address formatting
This commit is contained in:
parent
0d8924c6b0
commit
8a8d3105f3
|
@ -787,7 +787,7 @@ private:
|
||||||
window_relocate_windows(_width, _height);
|
window_relocate_windows(_width, _height);
|
||||||
}
|
}
|
||||||
|
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
|
|
||||||
// Check if the window has been resized in windowed mode and update the config file accordingly
|
// Check if the window has been resized in windowed mode and update the config file accordingly
|
||||||
int32_t nonWindowFlags =
|
int32_t nonWindowFlags =
|
||||||
|
|
|
@ -181,7 +181,7 @@ static void ShortcutRemoveTopBottomToolbarToggle()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ShortcutAdjustLand()
|
static void ShortcutAdjustLand()
|
||||||
|
@ -475,7 +475,7 @@ static void ShortcutScaleUp()
|
||||||
{
|
{
|
||||||
gConfigGeneral.WindowScale += 0.25f;
|
gConfigGeneral.WindowScale += 0.25f;
|
||||||
ConfigSaveDefault();
|
ConfigSaveDefault();
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
ContextTriggerResize();
|
ContextTriggerResize();
|
||||||
ContextUpdateCursorScale();
|
ContextUpdateCursorScale();
|
||||||
}
|
}
|
||||||
|
@ -485,7 +485,7 @@ static void ShortcutScaleDown()
|
||||||
gConfigGeneral.WindowScale -= 0.25f;
|
gConfigGeneral.WindowScale -= 0.25f;
|
||||||
gConfigGeneral.WindowScale = std::max(0.5f, gConfigGeneral.WindowScale);
|
gConfigGeneral.WindowScale = std::max(0.5f, gConfigGeneral.WindowScale);
|
||||||
ConfigSaveDefault();
|
ConfigSaveDefault();
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
ContextTriggerResize();
|
ContextTriggerResize();
|
||||||
ContextUpdateCursorScale();
|
ContextUpdateCursorScale();
|
||||||
}
|
}
|
||||||
|
@ -732,7 +732,7 @@ static void ShortcutToggleTransparentWater()
|
||||||
|
|
||||||
gConfigGeneral.TransparentWater ^= 1;
|
gConfigGeneral.TransparentWater ^= 1;
|
||||||
ConfigSaveDefault();
|
ConfigSaveDefault();
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
|
|
|
@ -33,7 +33,7 @@ namespace Graph
|
||||||
{ FontStyle::Small, TextAlignment::CENTRE });
|
{ FontStyle::Small, TextAlignment::CENTRE });
|
||||||
|
|
||||||
// Draw month mark
|
// Draw month mark
|
||||||
gfx_fill_rect(dpi, { screenCoords, screenCoords + ScreenCoordsXY{ 0, 3 } }, PALETTE_INDEX_10);
|
GfxFillRect(dpi, { screenCoords, screenCoords + ScreenCoordsXY{ 0, 3 } }, PALETTE_INDEX_10);
|
||||||
}
|
}
|
||||||
|
|
||||||
yearOver32 = (yearOver32 + 1) % 32;
|
yearOver32 = (yearOver32 + 1) % 32;
|
||||||
|
@ -57,11 +57,11 @@ namespace Graph
|
||||||
auto rightBottom1 = coords + ScreenCoordsXY{ 1, 1 };
|
auto rightBottom1 = coords + ScreenCoordsXY{ 1, 1 };
|
||||||
auto leftTop2 = lastCoords + ScreenCoordsXY{ 0, 1 };
|
auto leftTop2 = lastCoords + ScreenCoordsXY{ 0, 1 };
|
||||||
auto rightBottom2 = coords + ScreenCoordsXY{ 0, 1 };
|
auto rightBottom2 = coords + ScreenCoordsXY{ 0, 1 };
|
||||||
gfx_draw_line(dpi, { leftTop1, rightBottom1 }, PALETTE_INDEX_10);
|
GfxDrawLine(dpi, { leftTop1, rightBottom1 }, PALETTE_INDEX_10);
|
||||||
gfx_draw_line(dpi, { leftTop2, rightBottom2 }, PALETTE_INDEX_10);
|
GfxDrawLine(dpi, { leftTop2, rightBottom2 }, PALETTE_INDEX_10);
|
||||||
}
|
}
|
||||||
if (i == 0)
|
if (i == 0)
|
||||||
gfx_fill_rect(dpi, { coords, coords + ScreenCoordsXY{ 2, 2 } }, PALETTE_INDEX_10);
|
GfxFillRect(dpi, { coords, coords + ScreenCoordsXY{ 2, 2 } }, PALETTE_INDEX_10);
|
||||||
|
|
||||||
lastCoords = coords;
|
lastCoords = coords;
|
||||||
}
|
}
|
||||||
|
@ -83,10 +83,10 @@ namespace Graph
|
||||||
{
|
{
|
||||||
auto leftTop = lastCoords;
|
auto leftTop = lastCoords;
|
||||||
auto rightBottom = coords;
|
auto rightBottom = coords;
|
||||||
gfx_draw_line(dpi, { leftTop, rightBottom }, PALETTE_INDEX_21);
|
GfxDrawLine(dpi, { leftTop, rightBottom }, PALETTE_INDEX_21);
|
||||||
}
|
}
|
||||||
if (i == 0)
|
if (i == 0)
|
||||||
gfx_fill_rect(dpi, { coords - ScreenCoordsXY{ 1, 1 }, coords + ScreenCoordsXY{ 1, 1 } }, PALETTE_INDEX_21);
|
GfxFillRect(dpi, { coords - ScreenCoordsXY{ 1, 1 }, coords + ScreenCoordsXY{ 1, 1 } }, PALETTE_INDEX_21);
|
||||||
|
|
||||||
lastCoords = coords;
|
lastCoords = coords;
|
||||||
}
|
}
|
||||||
|
@ -170,7 +170,7 @@ namespace Graph
|
||||||
{ FontStyle::Small, TextAlignment::CENTRE });
|
{ FontStyle::Small, TextAlignment::CENTRE });
|
||||||
|
|
||||||
// Draw month mark
|
// Draw month mark
|
||||||
gfx_fill_rect(dpi, { screenCoords, screenCoords + ScreenCoordsXY{ 0, 3 } }, PALETTE_INDEX_10);
|
GfxFillRect(dpi, { screenCoords, screenCoords + ScreenCoordsXY{ 0, 3 } }, PALETTE_INDEX_10);
|
||||||
}
|
}
|
||||||
|
|
||||||
yearOver32 = (yearOver32 + 1) % 32;
|
yearOver32 = (yearOver32 + 1) % 32;
|
||||||
|
@ -196,11 +196,11 @@ namespace Graph
|
||||||
auto rightBottom1 = coords + ScreenCoordsXY{ 1, 1 };
|
auto rightBottom1 = coords + ScreenCoordsXY{ 1, 1 };
|
||||||
auto leftTop2 = lastCoords + ScreenCoordsXY{ 0, 1 };
|
auto leftTop2 = lastCoords + ScreenCoordsXY{ 0, 1 };
|
||||||
auto rightBottom2 = coords + ScreenCoordsXY{ 0, 1 };
|
auto rightBottom2 = coords + ScreenCoordsXY{ 0, 1 };
|
||||||
gfx_draw_line(dpi, { leftTop1, rightBottom1 }, PALETTE_INDEX_10);
|
GfxDrawLine(dpi, { leftTop1, rightBottom1 }, PALETTE_INDEX_10);
|
||||||
gfx_draw_line(dpi, { leftTop2, rightBottom2 }, PALETTE_INDEX_10);
|
GfxDrawLine(dpi, { leftTop2, rightBottom2 }, PALETTE_INDEX_10);
|
||||||
}
|
}
|
||||||
if (i == 0)
|
if (i == 0)
|
||||||
gfx_fill_rect(dpi, { coords, coords + ScreenCoordsXY{ 2, 2 } }, PALETTE_INDEX_10);
|
GfxFillRect(dpi, { coords, coords + ScreenCoordsXY{ 2, 2 } }, PALETTE_INDEX_10);
|
||||||
|
|
||||||
lastCoords = coords;
|
lastCoords = coords;
|
||||||
}
|
}
|
||||||
|
@ -224,10 +224,10 @@ namespace Graph
|
||||||
{
|
{
|
||||||
auto leftTop = lastCoords;
|
auto leftTop = lastCoords;
|
||||||
auto rightBottom = coords;
|
auto rightBottom = coords;
|
||||||
gfx_draw_line(dpi, { leftTop, rightBottom }, PALETTE_INDEX_21);
|
GfxDrawLine(dpi, { leftTop, rightBottom }, PALETTE_INDEX_21);
|
||||||
}
|
}
|
||||||
if (i == 0)
|
if (i == 0)
|
||||||
gfx_fill_rect(dpi, { coords - ScreenCoordsXY{ 1, 1 }, coords + ScreenCoordsXY{ 1, 1 } }, PALETTE_INDEX_21);
|
GfxFillRect(dpi, { coords - ScreenCoordsXY{ 1, 1 }, coords + ScreenCoordsXY{ 1, 1 } }, PALETTE_INDEX_21);
|
||||||
|
|
||||||
lastCoords = coords;
|
lastCoords = coords;
|
||||||
}
|
}
|
||||||
|
@ -253,12 +253,12 @@ namespace Graph
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
gfx_draw_dashed_line(dpi, { { info.coords.x, chartFrame.GetTop() }, info.coords }, DefaultDashedLength, 0);
|
GfxDrawDashedLine(dpi, { { info.coords.x, chartFrame.GetTop() }, info.coords }, DefaultDashedLength, 0);
|
||||||
gfx_draw_dashed_line(dpi, { { chartFrame.GetLeft() - 10, info.coords.y }, info.coords }, DefaultDashedLength, 0);
|
GfxDrawDashedLine(dpi, { { chartFrame.GetLeft() - 10, info.coords.y }, info.coords }, DefaultDashedLength, 0);
|
||||||
|
|
||||||
if (cursorPosition.y > info.coords.y)
|
if (cursorPosition.y > info.coords.y)
|
||||||
{
|
{
|
||||||
gfx_draw_dashed_line(dpi, { info.coords, { info.coords.x, cursorPosition.y } }, DefaultDashedLength, 0);
|
GfxDrawDashedLine(dpi, { info.coords, { info.coords.x, cursorPosition.y } }, DefaultDashedLength, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto ft = Formatter();
|
auto ft = Formatter();
|
||||||
|
@ -266,9 +266,8 @@ namespace Graph
|
||||||
DrawTextBasic(
|
DrawTextBasic(
|
||||||
dpi, info.coords - ScreenCoordsXY{ 0, 16 }, STR_FINANCES_SUMMARY_EXPENDITURE_VALUE, ft, { TextAlignment::CENTRE });
|
dpi, info.coords - ScreenCoordsXY{ 0, 16 }, STR_FINANCES_SUMMARY_EXPENDITURE_VALUE, ft, { TextAlignment::CENTRE });
|
||||||
|
|
||||||
gfx_fill_rect(
|
GfxFillRect(dpi, { { info.coords - ScreenCoordsXY{ 2, 2 } }, info.coords + ScreenCoordsXY{ 2, 2 } }, PALETTE_INDEX_10);
|
||||||
dpi, { { info.coords - ScreenCoordsXY{ 2, 2 } }, info.coords + ScreenCoordsXY{ 2, 2 } }, PALETTE_INDEX_10);
|
GfxFillRect(
|
||||||
gfx_fill_rect(
|
|
||||||
dpi, { { info.coords - ScreenCoordsXY{ 1, 1 } }, { info.coords + ScreenCoordsXY{ 1, 1 } } }, PALETTE_INDEX_21);
|
dpi, { { info.coords - ScreenCoordsXY{ 1, 1 } }, { info.coords + ScreenCoordsXY{ 1, 1 } } }, PALETTE_INDEX_21);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -237,7 +237,7 @@ void InGameConsole::WriteLine(const std::string& input, FormatToken colourFormat
|
||||||
|
|
||||||
void InGameConsole::Invalidate() const
|
void InGameConsole::Invalidate() const
|
||||||
{
|
{
|
||||||
gfx_set_dirty_blocks({ _consoleTopLeft, _consoleBottomRight });
|
GfxSetDirtyBlocks({ _consoleTopLeft, _consoleBottomRight });
|
||||||
}
|
}
|
||||||
|
|
||||||
void InGameConsole::Update()
|
void InGameConsole::Update()
|
||||||
|
@ -258,7 +258,7 @@ void InGameConsole::Update()
|
||||||
{
|
{
|
||||||
_lastMainViewport = mainViewport->viewPos;
|
_lastMainViewport = mainViewport->viewPos;
|
||||||
|
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -296,17 +296,17 @@ void InGameConsole::Draw(rct_drawpixelinfo* dpi) const
|
||||||
Invalidate();
|
Invalidate();
|
||||||
|
|
||||||
// Give console area a translucent effect.
|
// Give console area a translucent effect.
|
||||||
gfx_filter_rect(dpi, { _consoleTopLeft, _consoleBottomRight }, FilterPaletteID::Palette51);
|
GfxFilterRect(dpi, { _consoleTopLeft, _consoleBottomRight }, FilterPaletteID::Palette51);
|
||||||
|
|
||||||
// Make input area more opaque.
|
// Make input area more opaque.
|
||||||
gfx_filter_rect(
|
GfxFilterRect(
|
||||||
dpi, { { _consoleTopLeft.x, _consoleBottomRight.y - lineHeight - 10 }, _consoleBottomRight - ScreenCoordsXY{ 0, 1 } },
|
dpi, { { _consoleTopLeft.x, _consoleBottomRight.y - lineHeight - 10 }, _consoleBottomRight - ScreenCoordsXY{ 0, 1 } },
|
||||||
FilterPaletteID::Palette51);
|
FilterPaletteID::Palette51);
|
||||||
|
|
||||||
// Paint background colour.
|
// Paint background colour.
|
||||||
uint8_t backgroundColour = ThemeGetColour(WindowClass::Console, 0);
|
uint8_t backgroundColour = ThemeGetColour(WindowClass::Console, 0);
|
||||||
gfx_fill_rect_inset(dpi, { _consoleTopLeft, _consoleBottomRight }, backgroundColour, INSET_RECT_FLAG_FILL_NONE);
|
GfxFillRectInset(dpi, { _consoleTopLeft, _consoleBottomRight }, backgroundColour, INSET_RECT_FLAG_FILL_NONE);
|
||||||
gfx_fill_rect_inset(
|
GfxFillRectInset(
|
||||||
dpi, { _consoleTopLeft + ScreenCoordsXY{ 1, 1 }, _consoleBottomRight - ScreenCoordsXY{ 1, 1 } }, backgroundColour,
|
dpi, { _consoleTopLeft + ScreenCoordsXY{ 1, 1 }, _consoleBottomRight - ScreenCoordsXY{ 1, 1 } }, backgroundColour,
|
||||||
INSET_RECT_FLAG_BORDER_INSET);
|
INSET_RECT_FLAG_BORDER_INSET);
|
||||||
|
|
||||||
|
@ -333,7 +333,7 @@ void InGameConsole::Draw(rct_drawpixelinfo* dpi) const
|
||||||
{
|
{
|
||||||
auto caret = screenCoords + ScreenCoordsXY{ _caretScreenPosX, lineHeight };
|
auto caret = screenCoords + ScreenCoordsXY{ _caretScreenPosX, lineHeight };
|
||||||
uint8_t caretColour = ColourMapA[BASE_COLOUR(textColour)].lightest;
|
uint8_t caretColour = ColourMapA[BASE_COLOUR(textColour)].lightest;
|
||||||
gfx_fill_rect(dpi, { caret, caret + ScreenCoordsXY{ CONSOLE_CARET_WIDTH, 1 } }, caretColour);
|
GfxFillRect(dpi, { caret, caret + ScreenCoordsXY{ CONSOLE_CARET_WIDTH, 1 } }, caretColour);
|
||||||
}
|
}
|
||||||
|
|
||||||
// What about border colours?
|
// What about border colours?
|
||||||
|
@ -341,22 +341,22 @@ void InGameConsole::Draw(rct_drawpixelinfo* dpi) const
|
||||||
uint8_t borderColour2 = ColourMapA[BASE_COLOUR(backgroundColour)].mid_dark;
|
uint8_t borderColour2 = ColourMapA[BASE_COLOUR(backgroundColour)].mid_dark;
|
||||||
|
|
||||||
// Input area top border
|
// Input area top border
|
||||||
gfx_fill_rect(
|
GfxFillRect(
|
||||||
dpi,
|
dpi,
|
||||||
{ { _consoleTopLeft.x, _consoleBottomRight.y - lineHeight - 11 },
|
{ { _consoleTopLeft.x, _consoleBottomRight.y - lineHeight - 11 },
|
||||||
{ _consoleBottomRight.x, _consoleBottomRight.y - lineHeight - 11 } },
|
{ _consoleBottomRight.x, _consoleBottomRight.y - lineHeight - 11 } },
|
||||||
borderColour1);
|
borderColour1);
|
||||||
gfx_fill_rect(
|
GfxFillRect(
|
||||||
dpi,
|
dpi,
|
||||||
{ { _consoleTopLeft.x, _consoleBottomRight.y - lineHeight - 10 },
|
{ { _consoleTopLeft.x, _consoleBottomRight.y - lineHeight - 10 },
|
||||||
{ _consoleBottomRight.x, _consoleBottomRight.y - lineHeight - 10 } },
|
{ _consoleBottomRight.x, _consoleBottomRight.y - lineHeight - 10 } },
|
||||||
borderColour2);
|
borderColour2);
|
||||||
|
|
||||||
// Input area bottom border
|
// Input area bottom border
|
||||||
gfx_fill_rect(
|
GfxFillRect(
|
||||||
dpi, { { _consoleTopLeft.x, _consoleBottomRight.y - 1 }, { _consoleBottomRight.x, _consoleBottomRight.y - 1 } },
|
dpi, { { _consoleTopLeft.x, _consoleBottomRight.y - 1 }, { _consoleBottomRight.x, _consoleBottomRight.y - 1 } },
|
||||||
borderColour1);
|
borderColour1);
|
||||||
gfx_fill_rect(dpi, { { _consoleTopLeft.x, _consoleBottomRight.y }, _consoleBottomRight }, borderColour2);
|
GfxFillRect(dpi, { { _consoleTopLeft.x, _consoleBottomRight.y }, _consoleBottomRight }, borderColour2);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calculates the amount of visible lines, based on the console size, excluding the input line.
|
// Calculates the amount of visible lines, based on the console size, excluding the input line.
|
||||||
|
|
|
@ -569,7 +569,7 @@ namespace ThemeManager
|
||||||
CurrentTheme = theme;
|
CurrentTheme = theme;
|
||||||
CurrentThemePath.clear();
|
CurrentThemePath.clear();
|
||||||
|
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void LoadTheme(const std::string& path)
|
static void LoadTheme(const std::string& path)
|
||||||
|
|
|
@ -133,7 +133,7 @@ static void WidgetFrameDraw(rct_drawpixelinfo* dpi, rct_window& w, WidgetIndex w
|
||||||
uint8_t colour = w.colours[widget.colour];
|
uint8_t colour = w.colours[widget.colour];
|
||||||
|
|
||||||
// Draw the frame
|
// Draw the frame
|
||||||
gfx_fill_rect_inset(dpi, { leftTop, { r, b } }, colour, press);
|
GfxFillRectInset(dpi, { leftTop, { r, b } }, colour, press);
|
||||||
|
|
||||||
// Check if the window can be resized
|
// Check if the window can be resized
|
||||||
if (!(w.flags & WF_RESIZABLE))
|
if (!(w.flags & WF_RESIZABLE))
|
||||||
|
@ -164,7 +164,7 @@ static void WidgetResizeDraw(rct_drawpixelinfo* dpi, rct_window& w, WidgetIndex
|
||||||
uint8_t colour = w.colours[widget.colour];
|
uint8_t colour = w.colours[widget.colour];
|
||||||
|
|
||||||
// Draw the panel
|
// Draw the panel
|
||||||
gfx_fill_rect_inset(dpi, { leftTop, { r, b } }, colour, 0);
|
GfxFillRectInset(dpi, { leftTop, { r, b } }, colour, 0);
|
||||||
|
|
||||||
// Check if the window can be resized
|
// Check if the window can be resized
|
||||||
if (!(w.flags & WF_RESIZABLE))
|
if (!(w.flags & WF_RESIZABLE))
|
||||||
|
@ -199,12 +199,12 @@ static void WidgetButtonDraw(rct_drawpixelinfo* dpi, rct_window& w, WidgetIndex
|
||||||
if (static_cast<int32_t>(widget.image.ToUInt32()) == -2)
|
if (static_cast<int32_t>(widget.image.ToUInt32()) == -2)
|
||||||
{
|
{
|
||||||
// Draw border with no fill
|
// Draw border with no fill
|
||||||
gfx_fill_rect_inset(dpi, rect, colour, press | INSET_RECT_FLAG_FILL_NONE);
|
GfxFillRectInset(dpi, rect, colour, press | INSET_RECT_FLAG_FILL_NONE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw the border with fill
|
// Draw the border with fill
|
||||||
gfx_fill_rect_inset(dpi, rect, colour, press);
|
GfxFillRectInset(dpi, rect, colour, press);
|
||||||
|
|
||||||
WidgetDrawImage(dpi, w, widgetIndex);
|
WidgetDrawImage(dpi, w, widgetIndex);
|
||||||
}
|
}
|
||||||
|
@ -286,12 +286,12 @@ static void WidgetFlatButtonDraw(rct_drawpixelinfo* dpi, rct_window& w, WidgetIn
|
||||||
if (static_cast<int32_t>(widget.image.ToUInt32()) == -2)
|
if (static_cast<int32_t>(widget.image.ToUInt32()) == -2)
|
||||||
{
|
{
|
||||||
// Draw border with no fill
|
// Draw border with no fill
|
||||||
gfx_fill_rect_inset(dpi, rect, colour, INSET_RECT_FLAG_BORDER_INSET | INSET_RECT_FLAG_FILL_NONE);
|
GfxFillRectInset(dpi, rect, colour, INSET_RECT_FLAG_BORDER_INSET | INSET_RECT_FLAG_FILL_NONE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw the border with fill
|
// Draw the border with fill
|
||||||
gfx_fill_rect_inset(dpi, rect, colour, INSET_RECT_FLAG_BORDER_INSET);
|
GfxFillRectInset(dpi, rect, colour, INSET_RECT_FLAG_BORDER_INSET);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw image
|
// Draw image
|
||||||
|
@ -316,7 +316,7 @@ static void WidgetTextButton(rct_drawpixelinfo* dpi, rct_window& w, WidgetIndex
|
||||||
|
|
||||||
// Border
|
// Border
|
||||||
uint8_t press = WidgetIsPressed(w, widgetIndex) || WidgetIsActiveTool(w, widgetIndex) ? INSET_RECT_FLAG_BORDER_INSET : 0;
|
uint8_t press = WidgetIsPressed(w, widgetIndex) || WidgetIsActiveTool(w, widgetIndex) ? INSET_RECT_FLAG_BORDER_INSET : 0;
|
||||||
gfx_fill_rect_inset(dpi, rect, colour, press);
|
GfxFillRectInset(dpi, rect, colour, press);
|
||||||
|
|
||||||
// Button caption
|
// Button caption
|
||||||
if (widget.type != WindowWidgetType::TableHeader)
|
if (widget.type != WindowWidgetType::TableHeader)
|
||||||
|
@ -440,7 +440,7 @@ static void WidgetTextInset(rct_drawpixelinfo* dpi, rct_window& w, WidgetIndex w
|
||||||
// Get the colour
|
// Get the colour
|
||||||
uint8_t colour = w.colours[widget.colour];
|
uint8_t colour = w.colours[widget.colour];
|
||||||
|
|
||||||
gfx_fill_rect_inset(dpi, rect, colour, INSET_RECT_F_60);
|
GfxFillRectInset(dpi, rect, colour, INSET_RECT_F_60);
|
||||||
WidgetText(dpi, w, widgetIndex);
|
WidgetText(dpi, w, widgetIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -505,24 +505,24 @@ static void WidgetGroupboxDraw(rct_drawpixelinfo* dpi, rct_window& w, WidgetInde
|
||||||
uint8_t colour = w.colours[widget.colour] & 0x7F;
|
uint8_t colour = w.colours[widget.colour] & 0x7F;
|
||||||
|
|
||||||
// Border left of text
|
// Border left of text
|
||||||
gfx_fill_rect(dpi, { { l, t }, { l + 4, t } }, ColourMapA[colour].mid_dark);
|
GfxFillRect(dpi, { { l, t }, { l + 4, t } }, ColourMapA[colour].mid_dark);
|
||||||
gfx_fill_rect(dpi, { { l + 1, t + 1 }, { l + 4, t + 1 } }, ColourMapA[colour].lighter);
|
GfxFillRect(dpi, { { l + 1, t + 1 }, { l + 4, t + 1 } }, ColourMapA[colour].lighter);
|
||||||
|
|
||||||
// Border right of text
|
// Border right of text
|
||||||
gfx_fill_rect(dpi, { { textRight, t }, { r - 1, t } }, ColourMapA[colour].mid_dark);
|
GfxFillRect(dpi, { { textRight, t }, { r - 1, t } }, ColourMapA[colour].mid_dark);
|
||||||
gfx_fill_rect(dpi, { { textRight, t + 1 }, { r - 2, t + 1 } }, ColourMapA[colour].lighter);
|
GfxFillRect(dpi, { { textRight, t + 1 }, { r - 2, t + 1 } }, ColourMapA[colour].lighter);
|
||||||
|
|
||||||
// Border right
|
// Border right
|
||||||
gfx_fill_rect(dpi, { { r - 1, t + 1 }, { r - 1, b - 1 } }, ColourMapA[colour].mid_dark);
|
GfxFillRect(dpi, { { r - 1, t + 1 }, { r - 1, b - 1 } }, ColourMapA[colour].mid_dark);
|
||||||
gfx_fill_rect(dpi, { { r, t }, { r, b } }, ColourMapA[colour].lighter);
|
GfxFillRect(dpi, { { r, t }, { r, b } }, ColourMapA[colour].lighter);
|
||||||
|
|
||||||
// Border bottom
|
// Border bottom
|
||||||
gfx_fill_rect(dpi, { { l, b - 1 }, { r - 2, b - 1 } }, ColourMapA[colour].mid_dark);
|
GfxFillRect(dpi, { { l, b - 1 }, { r - 2, b - 1 } }, ColourMapA[colour].mid_dark);
|
||||||
gfx_fill_rect(dpi, { { l, b }, { r - 1, b } }, ColourMapA[colour].lighter);
|
GfxFillRect(dpi, { { l, b }, { r - 1, b } }, ColourMapA[colour].lighter);
|
||||||
|
|
||||||
// Border left
|
// Border left
|
||||||
gfx_fill_rect(dpi, { { l, t + 1 }, { l, b - 2 } }, ColourMapA[colour].mid_dark);
|
GfxFillRect(dpi, { { l, t + 1 }, { l, b - 2 } }, ColourMapA[colour].mid_dark);
|
||||||
gfx_fill_rect(dpi, { { l + 1, t + 2 }, { l + 1, b - 2 } }, ColourMapA[colour].lighter);
|
GfxFillRect(dpi, { { l + 1, t + 2 }, { l + 1, b - 2 } }, ColourMapA[colour].lighter);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -545,14 +545,14 @@ static void WidgetCaptionDraw(rct_drawpixelinfo* dpi, rct_window& w, WidgetIndex
|
||||||
if (w.flags & WF_10)
|
if (w.flags & WF_10)
|
||||||
press |= INSET_RECT_FLAG_FILL_MID_LIGHT;
|
press |= INSET_RECT_FLAG_FILL_MID_LIGHT;
|
||||||
|
|
||||||
gfx_fill_rect_inset(dpi, { topLeft, bottomRight }, colour, press);
|
GfxFillRectInset(dpi, { topLeft, bottomRight }, colour, press);
|
||||||
|
|
||||||
// Black caption bars look slightly green, this fixes that
|
// Black caption bars look slightly green, this fixes that
|
||||||
if (colour == 0)
|
if (colour == 0)
|
||||||
gfx_fill_rect(
|
GfxFillRect(
|
||||||
dpi, { { topLeft + ScreenCoordsXY{ 1, 1 } }, { bottomRight - ScreenCoordsXY{ 1, 1 } } }, ColourMapA[colour].dark);
|
dpi, { { topLeft + ScreenCoordsXY{ 1, 1 } }, { bottomRight - ScreenCoordsXY{ 1, 1 } } }, ColourMapA[colour].dark);
|
||||||
else
|
else
|
||||||
gfx_filter_rect(
|
GfxFilterRect(
|
||||||
dpi, { { topLeft + ScreenCoordsXY{ 1, 1 } }, { bottomRight - ScreenCoordsXY{ 1, 1 } } },
|
dpi, { { topLeft + ScreenCoordsXY{ 1, 1 } }, { bottomRight - ScreenCoordsXY{ 1, 1 } } },
|
||||||
FilterPaletteID::PaletteDarken3);
|
FilterPaletteID::PaletteDarken3);
|
||||||
|
|
||||||
|
@ -598,7 +598,7 @@ static void WidgetCloseboxDraw(rct_drawpixelinfo* dpi, rct_window& w, WidgetInde
|
||||||
uint8_t colour = w.colours[widget.colour];
|
uint8_t colour = w.colours[widget.colour];
|
||||||
|
|
||||||
// Draw the button
|
// Draw the button
|
||||||
gfx_fill_rect_inset(dpi, { topLeft, bottomRight }, colour, press);
|
GfxFillRectInset(dpi, { topLeft, bottomRight }, colour, press);
|
||||||
|
|
||||||
if (widget.text == STR_NONE)
|
if (widget.text == STR_NONE)
|
||||||
return;
|
return;
|
||||||
|
@ -629,7 +629,7 @@ static void WidgetCheckboxDraw(rct_drawpixelinfo* dpi, rct_window& w, WidgetInde
|
||||||
colour_t colour = w.colours[widget.colour];
|
colour_t colour = w.colours[widget.colour];
|
||||||
|
|
||||||
// checkbox
|
// checkbox
|
||||||
gfx_fill_rect_inset(dpi, { midLeft - ScreenCoordsXY{ 0, 5 }, midLeft + ScreenCoordsXY{ 9, 4 } }, colour, INSET_RECT_F_60);
|
GfxFillRectInset(dpi, { midLeft - ScreenCoordsXY{ 0, 5 }, midLeft + ScreenCoordsXY{ 9, 4 } }, colour, INSET_RECT_F_60);
|
||||||
|
|
||||||
if (WidgetIsDisabled(w, widgetIndex))
|
if (WidgetIsDisabled(w, widgetIndex))
|
||||||
{
|
{
|
||||||
|
@ -671,7 +671,7 @@ static void WidgetScrollDraw(rct_drawpixelinfo* dpi, rct_window& w, WidgetIndex
|
||||||
uint8_t colour = w.colours[widget.colour];
|
uint8_t colour = w.colours[widget.colour];
|
||||||
|
|
||||||
// Draw the border
|
// Draw the border
|
||||||
gfx_fill_rect_inset(dpi, { topLeft, bottomRight }, colour, INSET_RECT_F_60);
|
GfxFillRectInset(dpi, { topLeft, bottomRight }, colour, INSET_RECT_F_60);
|
||||||
|
|
||||||
// Inflate by -1
|
// Inflate by -1
|
||||||
topLeft.x++;
|
topLeft.x++;
|
||||||
|
@ -729,18 +729,18 @@ static void WidgetHScrollbarDraw(
|
||||||
{
|
{
|
||||||
colour &= 0x7F;
|
colour &= 0x7F;
|
||||||
// Trough
|
// Trough
|
||||||
gfx_fill_rect(dpi, { { l + SCROLLBAR_WIDTH, t }, { r - SCROLLBAR_WIDTH, b } }, ColourMapA[colour].lighter);
|
GfxFillRect(dpi, { { l + SCROLLBAR_WIDTH, t }, { r - SCROLLBAR_WIDTH, b } }, ColourMapA[colour].lighter);
|
||||||
gfx_fill_rect(dpi, { { l + SCROLLBAR_WIDTH, t }, { r - SCROLLBAR_WIDTH, b } }, 0x1000000 | ColourMapA[colour].mid_dark);
|
GfxFillRect(dpi, { { l + SCROLLBAR_WIDTH, t }, { r - SCROLLBAR_WIDTH, b } }, 0x1000000 | ColourMapA[colour].mid_dark);
|
||||||
gfx_fill_rect(dpi, { { l + SCROLLBAR_WIDTH, t + 2 }, { r - SCROLLBAR_WIDTH, t + 2 } }, ColourMapA[colour].mid_dark);
|
GfxFillRect(dpi, { { l + SCROLLBAR_WIDTH, t + 2 }, { r - SCROLLBAR_WIDTH, t + 2 } }, ColourMapA[colour].mid_dark);
|
||||||
gfx_fill_rect(dpi, { { l + SCROLLBAR_WIDTH, t + 3 }, { r - SCROLLBAR_WIDTH, t + 3 } }, ColourMapA[colour].lighter);
|
GfxFillRect(dpi, { { l + SCROLLBAR_WIDTH, t + 3 }, { r - SCROLLBAR_WIDTH, t + 3 } }, ColourMapA[colour].lighter);
|
||||||
gfx_fill_rect(dpi, { { l + SCROLLBAR_WIDTH, t + 7 }, { r - SCROLLBAR_WIDTH, t + 7 } }, ColourMapA[colour].mid_dark);
|
GfxFillRect(dpi, { { l + SCROLLBAR_WIDTH, t + 7 }, { r - SCROLLBAR_WIDTH, t + 7 } }, ColourMapA[colour].mid_dark);
|
||||||
gfx_fill_rect(dpi, { { l + SCROLLBAR_WIDTH, t + 8 }, { r - SCROLLBAR_WIDTH, t + 8 } }, ColourMapA[colour].lighter);
|
GfxFillRect(dpi, { { l + SCROLLBAR_WIDTH, t + 8 }, { r - SCROLLBAR_WIDTH, t + 8 } }, ColourMapA[colour].lighter);
|
||||||
|
|
||||||
// Left button
|
// Left button
|
||||||
{
|
{
|
||||||
uint8_t flags = (scroll.flags & HSCROLLBAR_LEFT_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0;
|
uint8_t flags = (scroll.flags & HSCROLLBAR_LEFT_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0;
|
||||||
|
|
||||||
gfx_fill_rect_inset(dpi, { { l, t }, { l + (SCROLLBAR_WIDTH - 1), b } }, colour, flags);
|
GfxFillRectInset(dpi, { { l, t }, { l + (SCROLLBAR_WIDTH - 1), b } }, colour, flags);
|
||||||
gfx_draw_string(dpi, { l + 1, t }, static_cast<const char*>(BlackLeftArrowString), {});
|
gfx_draw_string(dpi, { l + 1, t }, static_cast<const char*>(BlackLeftArrowString), {});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -750,14 +750,14 @@ static void WidgetHScrollbarDraw(
|
||||||
int16_t right = std::min(r - SCROLLBAR_WIDTH, l + scroll.h_thumb_right - 1);
|
int16_t right = std::min(r - SCROLLBAR_WIDTH, l + scroll.h_thumb_right - 1);
|
||||||
uint8_t flags = (scroll.flags & HSCROLLBAR_THUMB_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0;
|
uint8_t flags = (scroll.flags & HSCROLLBAR_THUMB_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0;
|
||||||
|
|
||||||
gfx_fill_rect_inset(dpi, { { left, t }, { right, b } }, colour, flags);
|
GfxFillRectInset(dpi, { { left, t }, { right, b } }, colour, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Right button
|
// Right button
|
||||||
{
|
{
|
||||||
uint8_t flags = (scroll.flags & HSCROLLBAR_RIGHT_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0;
|
uint8_t flags = (scroll.flags & HSCROLLBAR_RIGHT_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0;
|
||||||
|
|
||||||
gfx_fill_rect_inset(dpi, { { r - (SCROLLBAR_WIDTH - 1), t }, { r, b } }, colour, flags);
|
GfxFillRectInset(dpi, { { r - (SCROLLBAR_WIDTH - 1), t }, { r, b } }, colour, flags);
|
||||||
gfx_draw_string(dpi, { r - 6, t }, static_cast<const char*>(BlackRightArrowString), {});
|
gfx_draw_string(dpi, { r - 6, t }, static_cast<const char*>(BlackRightArrowString), {});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -767,28 +767,28 @@ static void WidgetVScrollbarDraw(
|
||||||
{
|
{
|
||||||
colour &= 0x7F;
|
colour &= 0x7F;
|
||||||
// Trough
|
// Trough
|
||||||
gfx_fill_rect(dpi, { { l, t + SCROLLBAR_WIDTH }, { r, b - SCROLLBAR_WIDTH } }, ColourMapA[colour].lighter);
|
GfxFillRect(dpi, { { l, t + SCROLLBAR_WIDTH }, { r, b - SCROLLBAR_WIDTH } }, ColourMapA[colour].lighter);
|
||||||
gfx_fill_rect(dpi, { { l, t + SCROLLBAR_WIDTH }, { r, b - SCROLLBAR_WIDTH } }, 0x1000000 | ColourMapA[colour].mid_dark);
|
GfxFillRect(dpi, { { l, t + SCROLLBAR_WIDTH }, { r, b - SCROLLBAR_WIDTH } }, 0x1000000 | ColourMapA[colour].mid_dark);
|
||||||
gfx_fill_rect(dpi, { { l + 2, t + SCROLLBAR_WIDTH }, { l + 2, b - SCROLLBAR_WIDTH } }, ColourMapA[colour].mid_dark);
|
GfxFillRect(dpi, { { l + 2, t + SCROLLBAR_WIDTH }, { l + 2, b - SCROLLBAR_WIDTH } }, ColourMapA[colour].mid_dark);
|
||||||
gfx_fill_rect(dpi, { { l + 3, t + SCROLLBAR_WIDTH }, { l + 3, b - SCROLLBAR_WIDTH } }, ColourMapA[colour].lighter);
|
GfxFillRect(dpi, { { l + 3, t + SCROLLBAR_WIDTH }, { l + 3, b - SCROLLBAR_WIDTH } }, ColourMapA[colour].lighter);
|
||||||
gfx_fill_rect(dpi, { { l + 7, t + SCROLLBAR_WIDTH }, { l + 7, b - SCROLLBAR_WIDTH } }, ColourMapA[colour].mid_dark);
|
GfxFillRect(dpi, { { l + 7, t + SCROLLBAR_WIDTH }, { l + 7, b - SCROLLBAR_WIDTH } }, ColourMapA[colour].mid_dark);
|
||||||
gfx_fill_rect(dpi, { { l + 8, t + SCROLLBAR_WIDTH }, { l + 8, b - SCROLLBAR_WIDTH } }, ColourMapA[colour].lighter);
|
GfxFillRect(dpi, { { l + 8, t + SCROLLBAR_WIDTH }, { l + 8, b - SCROLLBAR_WIDTH } }, ColourMapA[colour].lighter);
|
||||||
|
|
||||||
// Up button
|
// Up button
|
||||||
gfx_fill_rect_inset(
|
GfxFillRectInset(
|
||||||
dpi, { { l, t }, { r, t + (SCROLLBAR_WIDTH - 1) } }, colour,
|
dpi, { { l, t }, { r, t + (SCROLLBAR_WIDTH - 1) } }, colour,
|
||||||
((scroll.flags & VSCROLLBAR_UP_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0));
|
((scroll.flags & VSCROLLBAR_UP_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0));
|
||||||
gfx_draw_string(dpi, { l + 1, t - 1 }, static_cast<const char*>(BlackUpArrowString), {});
|
gfx_draw_string(dpi, { l + 1, t - 1 }, static_cast<const char*>(BlackUpArrowString), {});
|
||||||
|
|
||||||
// Thumb
|
// Thumb
|
||||||
gfx_fill_rect_inset(
|
GfxFillRectInset(
|
||||||
dpi,
|
dpi,
|
||||||
{ { l, std::max(t + SCROLLBAR_WIDTH, t + scroll.v_thumb_top - 1) },
|
{ { l, std::max(t + SCROLLBAR_WIDTH, t + scroll.v_thumb_top - 1) },
|
||||||
{ r, std::min(b - SCROLLBAR_WIDTH, t + scroll.v_thumb_bottom - 1) } },
|
{ r, std::min(b - SCROLLBAR_WIDTH, t + scroll.v_thumb_bottom - 1) } },
|
||||||
colour, ((scroll.flags & VSCROLLBAR_THUMB_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0));
|
colour, ((scroll.flags & VSCROLLBAR_THUMB_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0));
|
||||||
|
|
||||||
// Down button
|
// Down button
|
||||||
gfx_fill_rect_inset(
|
GfxFillRectInset(
|
||||||
dpi, { { l, b - (SCROLLBAR_WIDTH - 1) }, { r, b } }, colour,
|
dpi, { { l, b - (SCROLLBAR_WIDTH - 1) }, { r, b } }, colour,
|
||||||
((scroll.flags & VSCROLLBAR_DOWN_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0));
|
((scroll.flags & VSCROLLBAR_DOWN_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0));
|
||||||
gfx_draw_string(dpi, { l + 1, b - (SCROLLBAR_WIDTH - 1) }, static_cast<const char*>(BlackDownArrowString), {});
|
gfx_draw_string(dpi, { l + 1, b - (SCROLLBAR_WIDTH - 1) }, static_cast<const char*>(BlackDownArrowString), {});
|
||||||
|
@ -1138,8 +1138,8 @@ static void WidgetTextBoxDraw(rct_drawpixelinfo* dpi, rct_window& w, WidgetIndex
|
||||||
bool active = w.classification == gCurrentTextBox.window.classification && w.number == gCurrentTextBox.window.number
|
bool active = w.classification == gCurrentTextBox.window.classification && w.number == gCurrentTextBox.window.number
|
||||||
&& widgetIndex == gCurrentTextBox.widget_index;
|
&& widgetIndex == gCurrentTextBox.widget_index;
|
||||||
|
|
||||||
// gfx_fill_rect_inset(dpi, l, t, r, b, colour, 0x20 | (!active ? 0x40 : 0x00));
|
// GfxFillRectInset(dpi, l, t, r, b, colour, 0x20 | (!active ? 0x40 : 0x00));
|
||||||
gfx_fill_rect_inset(dpi, { topLeft, bottomRight }, colour, INSET_RECT_F_60);
|
GfxFillRectInset(dpi, { topLeft, bottomRight }, colour, INSET_RECT_F_60);
|
||||||
|
|
||||||
// Figure out where the text should be positioned vertically.
|
// Figure out where the text should be positioned vertically.
|
||||||
topLeft.y = w.windowPos.y + widget.textTop();
|
topLeft.y = w.windowPos.y + widget.textTop();
|
||||||
|
@ -1185,7 +1185,7 @@ static void WidgetTextBoxDraw(rct_drawpixelinfo* dpi, rct_window& w, WidgetIndex
|
||||||
{
|
{
|
||||||
colour = ColourMapA[w.colours[1]].mid_light;
|
colour = ColourMapA[w.colours[1]].mid_light;
|
||||||
auto y = topLeft.y + (widget.height() - 1);
|
auto y = topLeft.y + (widget.height() - 1);
|
||||||
gfx_fill_rect(dpi, { { cur_x, y }, { cur_x + width, y } }, colour + 5);
|
GfxFillRect(dpi, { { cur_x, y }, { cur_x + width, y } }, colour + 5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -621,7 +621,7 @@ void WindowDrawWidgets(rct_window& w, rct_drawpixelinfo* dpi)
|
||||||
WidgetIndex widgetIndex;
|
WidgetIndex widgetIndex;
|
||||||
|
|
||||||
if ((w.flags & WF_TRANSPARENT) && !(w.flags & WF_NO_BACKGROUND))
|
if ((w.flags & WF_TRANSPARENT) && !(w.flags & WF_NO_BACKGROUND))
|
||||||
gfx_filter_rect(
|
GfxFilterRect(
|
||||||
dpi, { w.windowPos, w.windowPos + ScreenCoordsXY{ w.width - 1, w.height - 1 } }, FilterPaletteID::Palette51);
|
dpi, { w.windowPos, w.windowPos + ScreenCoordsXY{ w.width - 1, w.height - 1 } }, FilterPaletteID::Palette51);
|
||||||
|
|
||||||
// todo: some code missing here? Between 006EB18C and 006EB260
|
// todo: some code missing here? Between 006EB18C and 006EB260
|
||||||
|
@ -650,7 +650,7 @@ void WindowDrawWidgets(rct_window& w, rct_drawpixelinfo* dpi)
|
||||||
|
|
||||||
if (w.flags & WF_WHITE_BORDER_MASK)
|
if (w.flags & WF_WHITE_BORDER_MASK)
|
||||||
{
|
{
|
||||||
gfx_fill_rect_inset(
|
GfxFillRectInset(
|
||||||
dpi, { w.windowPos, w.windowPos + ScreenCoordsXY{ w.width - 1, w.height - 1 } }, COLOUR_WHITE,
|
dpi, { w.windowPos, w.windowPos + ScreenCoordsXY{ w.width - 1, w.height - 1 } }, COLOUR_WHITE,
|
||||||
INSET_RECT_FLAG_FILL_NONE);
|
INSET_RECT_FLAG_FILL_NONE);
|
||||||
}
|
}
|
||||||
|
@ -672,7 +672,7 @@ static void WindowInvalidatePressedImageButton(const rct_window& w)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (WidgetIsPressed(w, widgetIndex) || WidgetIsActiveTool(w, widgetIndex))
|
if (WidgetIsPressed(w, widgetIndex) || WidgetIsActiveTool(w, widgetIndex))
|
||||||
gfx_set_dirty_blocks({ w.windowPos, w.windowPos + ScreenCoordsXY{ w.width, w.height } });
|
GfxSetDirtyBlocks({ w.windowPos, w.windowPos + ScreenCoordsXY{ w.width, w.height } });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -551,7 +551,7 @@ void CustomListView::MouseUp(const ScreenCoordsXY& pos)
|
||||||
void CustomListView::Paint(rct_window* w, rct_drawpixelinfo* dpi, const rct_scroll* scroll) const
|
void CustomListView::Paint(rct_window* w, rct_drawpixelinfo* dpi, const rct_scroll* scroll) const
|
||||||
{
|
{
|
||||||
auto paletteIndex = ColourMapA[w->colours[1]].mid_light;
|
auto paletteIndex = ColourMapA[w->colours[1]].mid_light;
|
||||||
gfx_fill_rect(dpi, { { dpi->x, dpi->y }, { dpi->x + dpi->width, dpi->y + dpi->height } }, paletteIndex);
|
GfxFillRect(dpi, { { dpi->x, dpi->y }, { dpi->x + dpi->width, dpi->y + dpi->height } }, paletteIndex);
|
||||||
|
|
||||||
int32_t y = ShowColumnHeaders ? COLUMN_HEADER_HEIGHT : 0;
|
int32_t y = ShowColumnHeaders ? COLUMN_HEADER_HEIGHT : 0;
|
||||||
for (size_t i = 0; i < Items.size(); i++)
|
for (size_t i = 0; i < Items.size(); i++)
|
||||||
|
@ -581,19 +581,19 @@ void CustomListView::Paint(rct_window* w, rct_drawpixelinfo* dpi, const rct_scro
|
||||||
auto isSelected = (SelectedCell && itemIndex == SelectedCell->Row);
|
auto isSelected = (SelectedCell && itemIndex == SelectedCell->Row);
|
||||||
if (isSelected)
|
if (isSelected)
|
||||||
{
|
{
|
||||||
gfx_filter_rect(
|
GfxFilterRect(
|
||||||
dpi, { { dpi->x, y }, { dpi->x + dpi->width, y + (LIST_ROW_HEIGHT - 1) } },
|
dpi, { { dpi->x, y }, { dpi->x + dpi->width, y + (LIST_ROW_HEIGHT - 1) } },
|
||||||
FilterPaletteID::PaletteDarken2);
|
FilterPaletteID::PaletteDarken2);
|
||||||
}
|
}
|
||||||
else if (isHighlighted)
|
else if (isHighlighted)
|
||||||
{
|
{
|
||||||
gfx_filter_rect(
|
GfxFilterRect(
|
||||||
dpi, { { dpi->x, y }, { dpi->x + dpi->width, y + (LIST_ROW_HEIGHT - 1) } },
|
dpi, { { dpi->x, y }, { dpi->x + dpi->width, y + (LIST_ROW_HEIGHT - 1) } },
|
||||||
FilterPaletteID::PaletteDarken2);
|
FilterPaletteID::PaletteDarken2);
|
||||||
}
|
}
|
||||||
else if (isStriped)
|
else if (isStriped)
|
||||||
{
|
{
|
||||||
gfx_fill_rect(
|
GfxFillRect(
|
||||||
dpi, { { dpi->x, y }, { dpi->x + dpi->width, y + (LIST_ROW_HEIGHT - 1) } },
|
dpi, { { dpi->x, y }, { dpi->x + dpi->width, y + (LIST_ROW_HEIGHT - 1) } },
|
||||||
ColourMapA[w->colours[1]].lighter | 0x1000000);
|
ColourMapA[w->colours[1]].lighter | 0x1000000);
|
||||||
}
|
}
|
||||||
|
@ -640,7 +640,7 @@ void CustomListView::Paint(rct_window* w, rct_drawpixelinfo* dpi, const rct_scro
|
||||||
y = scroll->v_top;
|
y = scroll->v_top;
|
||||||
|
|
||||||
auto bgColour = ColourMapA[w->colours[1]].mid_light;
|
auto bgColour = ColourMapA[w->colours[1]].mid_light;
|
||||||
gfx_fill_rect(dpi, { { dpi->x, y }, { dpi->x + dpi->width, y + 12 } }, bgColour);
|
GfxFillRect(dpi, { { dpi->x, y }, { dpi->x + dpi->width, y + 12 } }, bgColour);
|
||||||
|
|
||||||
int32_t x = 0;
|
int32_t x = 0;
|
||||||
for (int32_t j = 0; j < static_cast<int32_t>(Columns.size()); j++)
|
for (int32_t j = 0; j < static_cast<int32_t>(Columns.size()); j++)
|
||||||
|
@ -672,7 +672,7 @@ void CustomListView::PaintHeading(
|
||||||
{
|
{
|
||||||
boxFlags = INSET_RECT_FLAG_BORDER_INSET;
|
boxFlags = INSET_RECT_FLAG_BORDER_INSET;
|
||||||
}
|
}
|
||||||
gfx_fill_rect_inset(dpi, { pos, pos + ScreenCoordsXY{ size.width - 1, size.height - 1 } }, w->colours[1], boxFlags);
|
GfxFillRectInset(dpi, { pos, pos + ScreenCoordsXY{ size.width - 1, size.height - 1 } }, w->colours[1], boxFlags);
|
||||||
if (!text.empty())
|
if (!text.empty())
|
||||||
{
|
{
|
||||||
PaintCell(dpi, pos, size, text.c_str(), false);
|
PaintCell(dpi, pos, size, text.c_str(), false);
|
||||||
|
@ -722,32 +722,32 @@ void CustomListView::PaintSeperator(
|
||||||
// Draw light horizontal rule
|
// Draw light horizontal rule
|
||||||
auto lightLineLeftTop1 = ScreenCoordsXY{ left, lineY0 };
|
auto lightLineLeftTop1 = ScreenCoordsXY{ left, lineY0 };
|
||||||
auto lightLineRightBottom1 = ScreenCoordsXY{ strLeft, lineY0 };
|
auto lightLineRightBottom1 = ScreenCoordsXY{ strLeft, lineY0 };
|
||||||
gfx_draw_line(dpi, { lightLineLeftTop1, lightLineRightBottom1 }, lightColour);
|
GfxDrawLine(dpi, { lightLineLeftTop1, lightLineRightBottom1 }, lightColour);
|
||||||
|
|
||||||
auto lightLineLeftTop2 = ScreenCoordsXY{ strRight, lineY0 };
|
auto lightLineLeftTop2 = ScreenCoordsXY{ strRight, lineY0 };
|
||||||
auto lightLineRightBottom2 = ScreenCoordsXY{ right, lineY0 };
|
auto lightLineRightBottom2 = ScreenCoordsXY{ right, lineY0 };
|
||||||
gfx_draw_line(dpi, { lightLineLeftTop2, lightLineRightBottom2 }, lightColour);
|
GfxDrawLine(dpi, { lightLineLeftTop2, lightLineRightBottom2 }, lightColour);
|
||||||
|
|
||||||
// Draw dark horizontal rule
|
// Draw dark horizontal rule
|
||||||
auto darkLineLeftTop1 = ScreenCoordsXY{ left, lineY1 };
|
auto darkLineLeftTop1 = ScreenCoordsXY{ left, lineY1 };
|
||||||
auto darkLineRightBottom1 = ScreenCoordsXY{ strLeft, lineY1 };
|
auto darkLineRightBottom1 = ScreenCoordsXY{ strLeft, lineY1 };
|
||||||
gfx_draw_line(dpi, { darkLineLeftTop1, darkLineRightBottom1 }, darkColour);
|
GfxDrawLine(dpi, { darkLineLeftTop1, darkLineRightBottom1 }, darkColour);
|
||||||
|
|
||||||
auto darkLineLeftTop2 = ScreenCoordsXY{ strRight, lineY1 };
|
auto darkLineLeftTop2 = ScreenCoordsXY{ strRight, lineY1 };
|
||||||
auto darkLineRightBottom2 = ScreenCoordsXY{ right, lineY1 };
|
auto darkLineRightBottom2 = ScreenCoordsXY{ right, lineY1 };
|
||||||
gfx_draw_line(dpi, { darkLineLeftTop2, darkLineRightBottom2 }, darkColour);
|
GfxDrawLine(dpi, { darkLineLeftTop2, darkLineRightBottom2 }, darkColour);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Draw light horizontal rule
|
// Draw light horizontal rule
|
||||||
auto lightLineLeftTop1 = ScreenCoordsXY{ left, lineY0 };
|
auto lightLineLeftTop1 = ScreenCoordsXY{ left, lineY0 };
|
||||||
auto lightLineRightBottom1 = ScreenCoordsXY{ right, lineY0 };
|
auto lightLineRightBottom1 = ScreenCoordsXY{ right, lineY0 };
|
||||||
gfx_draw_line(dpi, { lightLineLeftTop1, lightLineRightBottom1 }, lightColour);
|
GfxDrawLine(dpi, { lightLineLeftTop1, lightLineRightBottom1 }, lightColour);
|
||||||
|
|
||||||
// Draw dark horizontal rule
|
// Draw dark horizontal rule
|
||||||
auto darkLineLeftTop1 = ScreenCoordsXY{ left, lineY1 };
|
auto darkLineLeftTop1 = ScreenCoordsXY{ left, lineY1 };
|
||||||
auto darkLineRightBottom1 = ScreenCoordsXY{ right, lineY1 };
|
auto darkLineRightBottom1 = ScreenCoordsXY{ right, lineY1 };
|
||||||
gfx_draw_line(dpi, { darkLineLeftTop1, darkLineRightBottom1 }, darkColour);
|
GfxDrawLine(dpi, { darkLineLeftTop1, darkLineRightBottom1 }, darkColour);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -553,7 +553,7 @@ namespace OpenRCT2::Ui::Windows
|
||||||
if (onDraw.is_function())
|
if (onDraw.is_function())
|
||||||
{
|
{
|
||||||
rct_drawpixelinfo widgetDpi;
|
rct_drawpixelinfo widgetDpi;
|
||||||
if (clip_drawpixelinfo(
|
if (ClipDrawPixelInfo(
|
||||||
&widgetDpi, &dpi, { windowPos.x + widget.left, windowPos.y + widget.top }, widget.width(),
|
&widgetDpi, &dpi, { windowPos.x + widget.left, windowPos.y + widget.top }, widget.width(),
|
||||||
widget.height()))
|
widget.height()))
|
||||||
{
|
{
|
||||||
|
|
|
@ -163,25 +163,25 @@ namespace OpenRCT2::Scripting
|
||||||
|
|
||||||
void box(int32_t x, int32_t y, int32_t width, int32_t height)
|
void box(int32_t x, int32_t y, int32_t width, int32_t height)
|
||||||
{
|
{
|
||||||
gfx_fill_rect_inset(&_dpi, { x, y, x + width - 1, y + height - 1 }, _colour.value_or(0), 0);
|
GfxFillRectInset(&_dpi, { x, y, x + width - 1, y + height - 1 }, _colour.value_or(0), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void well(int32_t x, int32_t y, int32_t width, int32_t height)
|
void well(int32_t x, int32_t y, int32_t width, int32_t height)
|
||||||
{
|
{
|
||||||
gfx_fill_rect_inset(
|
GfxFillRectInset(
|
||||||
&_dpi, { x, y, x + width - 1, y + height - 1 }, _colour.value_or(0),
|
&_dpi, { x, y, x + width - 1, y + height - 1 }, _colour.value_or(0),
|
||||||
INSET_RECT_FLAG_BORDER_INSET | INSET_RECT_FLAG_FILL_DONT_LIGHTEN);
|
INSET_RECT_FLAG_BORDER_INSET | INSET_RECT_FLAG_FILL_DONT_LIGHTEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
void clear()
|
void clear()
|
||||||
{
|
{
|
||||||
gfx_clear(&_dpi, _fill);
|
GfxClear(&_dpi, _fill);
|
||||||
}
|
}
|
||||||
|
|
||||||
void clip(int32_t x, int32_t y, int32_t width, int32_t height)
|
void clip(int32_t x, int32_t y, int32_t width, int32_t height)
|
||||||
{
|
{
|
||||||
rct_drawpixelinfo newDpi;
|
rct_drawpixelinfo newDpi;
|
||||||
clip_drawpixelinfo(&newDpi, &_dpi, { x, y }, width, height);
|
ClipDrawPixelInfo(&newDpi, &_dpi, { x, y }, width, height);
|
||||||
_dpi = newDpi;
|
_dpi = newDpi;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -210,7 +210,7 @@ namespace OpenRCT2::Scripting
|
||||||
|
|
||||||
void line(int32_t x1, int32_t y1, int32_t x2, int32_t y2)
|
void line(int32_t x1, int32_t y1, int32_t x2, int32_t y2)
|
||||||
{
|
{
|
||||||
gfx_draw_line(&_dpi, { { x1, y1 }, { x2, y2 } }, _stroke);
|
GfxDrawLine(&_dpi, { { x1, y1 }, { x2, y2 } }, _stroke);
|
||||||
}
|
}
|
||||||
|
|
||||||
void rect(int32_t x, int32_t y, int32_t width, int32_t height)
|
void rect(int32_t x, int32_t y, int32_t width, int32_t height)
|
||||||
|
@ -229,7 +229,7 @@ namespace OpenRCT2::Scripting
|
||||||
}
|
}
|
||||||
if (_fill != 0)
|
if (_fill != 0)
|
||||||
{
|
{
|
||||||
gfx_fill_rect(&_dpi, { x, y, x + width - 1, y + height - 1 }, _fill);
|
GfxFillRect(&_dpi, { x, y, x + width - 1, y + height - 1 }, _fill);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -384,7 +384,7 @@ namespace OpenRCT2::Title
|
||||||
ContextBroadcastIntent(&intent);
|
ContextBroadcastIntent(&intent);
|
||||||
ScenerySetDefaultPlacementConfiguration();
|
ScenerySetDefaultPlacementConfiguration();
|
||||||
News::InitQueue();
|
News::InitQueue();
|
||||||
load_palette();
|
LoadPalette();
|
||||||
gScreenAge = 0;
|
gScreenAge = 0;
|
||||||
gGamePaused = false;
|
gGamePaused = false;
|
||||||
gGameSpeed = 1;
|
gGameSpeed = 1;
|
||||||
|
|
|
@ -192,7 +192,7 @@ public:
|
||||||
void OnScrollDraw(int32_t scrollIndex, rct_drawpixelinfo& dpi) override
|
void OnScrollDraw(int32_t scrollIndex, rct_drawpixelinfo& dpi) override
|
||||||
{
|
{
|
||||||
auto dpiCoords = ScreenCoordsXY{ dpi.x, dpi.y };
|
auto dpiCoords = ScreenCoordsXY{ dpi.x, dpi.y };
|
||||||
gfx_fill_rect(
|
GfxFillRect(
|
||||||
&dpi, { dpiCoords, dpiCoords + ScreenCoordsXY{ dpi.width - 1, dpi.height - 1 } }, ColourMapA[colours[1]].mid_light);
|
&dpi, { dpiCoords, dpiCoords + ScreenCoordsXY{ dpi.width - 1, dpi.height - 1 } }, ColourMapA[colours[1]].mid_light);
|
||||||
|
|
||||||
auto assetPackManager = GetContext()->GetAssetPackManager();
|
auto assetPackManager = GetContext()->GetAssetPackManager();
|
||||||
|
@ -240,12 +240,12 @@ private:
|
||||||
auto fillRectangle = ScreenRect{ { 0, y }, { listWidth, y + ItemHeight - 1 } };
|
auto fillRectangle = ScreenRect{ { 0, y }, { listWidth, y + ItemHeight - 1 } };
|
||||||
if (isSelected)
|
if (isSelected)
|
||||||
{
|
{
|
||||||
gfx_fill_rect(&dpi, fillRectangle, ColourMapA[colours[1]].mid_dark);
|
GfxFillRect(&dpi, fillRectangle, ColourMapA[colours[1]].mid_dark);
|
||||||
stringId = STR_WINDOW_COLOUR_2_STRINGID;
|
stringId = STR_WINDOW_COLOUR_2_STRINGID;
|
||||||
}
|
}
|
||||||
else if (isHighlighted)
|
else if (isHighlighted)
|
||||||
{
|
{
|
||||||
gfx_fill_rect(&dpi, fillRectangle, ColourMapA[colours[1]].mid_dark);
|
GfxFillRect(&dpi, fillRectangle, ColourMapA[colours[1]].mid_dark);
|
||||||
}
|
}
|
||||||
|
|
||||||
DrawTextEllipsised(&dpi, { 16, y + 1 }, listWidth, stringId, ft);
|
DrawTextEllipsised(&dpi, { 16, y + 1 }, listWidth, stringId, ft);
|
||||||
|
@ -256,7 +256,7 @@ private:
|
||||||
|
|
||||||
void PaintCheckbox(rct_drawpixelinfo& dpi, const ScreenRect& rect, bool checked)
|
void PaintCheckbox(rct_drawpixelinfo& dpi, const ScreenRect& rect, bool checked)
|
||||||
{
|
{
|
||||||
gfx_fill_rect_inset(&dpi, rect, colours[1], INSET_RECT_F_E0);
|
GfxFillRectInset(&dpi, rect, colours[1], INSET_RECT_F_E0);
|
||||||
if (checked)
|
if (checked)
|
||||||
{
|
{
|
||||||
auto checkmark = Formatter();
|
auto checkmark = Formatter();
|
||||||
|
|
|
@ -69,27 +69,27 @@ public:
|
||||||
{
|
{
|
||||||
case WIDX_TOGGLE_SHOW_WIDE_PATHS:
|
case WIDX_TOGGLE_SHOW_WIDE_PATHS:
|
||||||
gPaintWidePathsAsGhost = !gPaintWidePathsAsGhost;
|
gPaintWidePathsAsGhost = !gPaintWidePathsAsGhost;
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WIDX_TOGGLE_SHOW_BLOCKED_TILES:
|
case WIDX_TOGGLE_SHOW_BLOCKED_TILES:
|
||||||
gPaintBlockedTiles = !gPaintBlockedTiles;
|
gPaintBlockedTiles = !gPaintBlockedTiles;
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WIDX_TOGGLE_SHOW_SEGMENT_HEIGHTS:
|
case WIDX_TOGGLE_SHOW_SEGMENT_HEIGHTS:
|
||||||
gShowSupportSegmentHeights = !gShowSupportSegmentHeights;
|
gShowSupportSegmentHeights = !gShowSupportSegmentHeights;
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WIDX_TOGGLE_SHOW_BOUND_BOXES:
|
case WIDX_TOGGLE_SHOW_BOUND_BOXES:
|
||||||
gPaintBoundingBoxes = !gPaintBoundingBoxes;
|
gPaintBoundingBoxes = !gPaintBoundingBoxes;
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WIDX_TOGGLE_SHOW_DIRTY_VISUALS:
|
case WIDX_TOGGLE_SHOW_DIRTY_VISUALS:
|
||||||
gShowDirtyVisuals = !gShowDirtyVisuals;
|
gShowDirtyVisuals = !gShowDirtyVisuals;
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -160,14 +160,13 @@ public:
|
||||||
if (colours[0] & COLOUR_FLAG_TRANSLUCENT)
|
if (colours[0] & COLOUR_FLAG_TRANSLUCENT)
|
||||||
{
|
{
|
||||||
translucent_window_palette palette = TranslucentWindowPalettes[BASE_COLOUR(colours[0])];
|
translucent_window_palette palette = TranslucentWindowPalettes[BASE_COLOUR(colours[0])];
|
||||||
gfx_filter_rect(&dpi, { leftTop, rightBottom }, palette.highlight);
|
GfxFilterRect(&dpi, { leftTop, rightBottom }, palette.highlight);
|
||||||
gfx_filter_rect(&dpi, { leftTop + shadowOffset, rightBottom + shadowOffset }, palette.shadow);
|
GfxFilterRect(&dpi, { leftTop + shadowOffset, rightBottom + shadowOffset }, palette.shadow);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gfx_fill_rect(&dpi, { leftTop, rightBottom }, ColourMapA[colours[0]].mid_dark);
|
GfxFillRect(&dpi, { leftTop, rightBottom }, ColourMapA[colours[0]].mid_dark);
|
||||||
gfx_fill_rect(
|
GfxFillRect(&dpi, { leftTop + shadowOffset, rightBottom + shadowOffset }, ColourMapA[colours[0]].lightest);
|
||||||
&dpi, { leftTop + shadowOffset, rightBottom + shadowOffset }, ColourMapA[colours[0]].lightest);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -176,7 +175,7 @@ public:
|
||||||
{
|
{
|
||||||
// Darken the cell's background slightly when highlighted
|
// Darken the cell's background slightly when highlighted
|
||||||
const ScreenCoordsXY rightBottom = screenCoords + ScreenCoordsXY{ ItemWidth - 1, ItemHeight - 1 };
|
const ScreenCoordsXY rightBottom = screenCoords + ScreenCoordsXY{ ItemWidth - 1, ItemHeight - 1 };
|
||||||
gfx_filter_rect(&dpi, { screenCoords, rightBottom }, FilterPaletteID::PaletteDarken3);
|
GfxFilterRect(&dpi, { screenCoords, rightBottom }, FilterPaletteID::PaletteDarken3);
|
||||||
}
|
}
|
||||||
|
|
||||||
StringId item = gDropdownItems[i].Format;
|
StringId item = gDropdownItems[i].Format;
|
||||||
|
|
|
@ -150,7 +150,7 @@ private:
|
||||||
{
|
{
|
||||||
window_close_all();
|
window_close_all();
|
||||||
gEditorStep = EditorStep::ObjectSelection;
|
gEditorStep = EditorStep::ObjectSelection;
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
void JumpBackToLandscapeEditor() const
|
void JumpBackToLandscapeEditor() const
|
||||||
|
@ -160,7 +160,7 @@ private:
|
||||||
ScenerySetDefaultPlacementConfiguration();
|
ScenerySetDefaultPlacementConfiguration();
|
||||||
gEditorStep = EditorStep::LandscapeEditor;
|
gEditorStep = EditorStep::LandscapeEditor;
|
||||||
ContextOpenWindow(WindowClass::Map);
|
ContextOpenWindow(WindowClass::Map);
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
void JumpBackToInventionListSetUp() const
|
void JumpBackToInventionListSetUp() const
|
||||||
|
@ -168,7 +168,7 @@ private:
|
||||||
window_close_all();
|
window_close_all();
|
||||||
ContextOpenWindow(WindowClass::EditorInventionList);
|
ContextOpenWindow(WindowClass::EditorInventionList);
|
||||||
gEditorStep = EditorStep::InventionsListSetUp;
|
gEditorStep = EditorStep::InventionsListSetUp;
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
void JumpBackToOptionsSelection() const
|
void JumpBackToOptionsSelection() const
|
||||||
|
@ -176,7 +176,7 @@ private:
|
||||||
window_close_all();
|
window_close_all();
|
||||||
ContextOpenWindow(WindowClass::EditorScenarioOptions);
|
ContextOpenWindow(WindowClass::EditorScenarioOptions);
|
||||||
gEditorStep = EditorStep::OptionsSelection;
|
gEditorStep = EditorStep::OptionsSelection;
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CheckObjectSelection() const
|
bool CheckObjectSelection() const
|
||||||
|
@ -230,7 +230,7 @@ private:
|
||||||
ContextShowError(STR_CANT_ADVANCE_TO_NEXT_EDITOR_STAGE, errorString, {});
|
ContextShowError(STR_CANT_ADVANCE_TO_NEXT_EDITOR_STAGE, errorString, {});
|
||||||
}
|
}
|
||||||
|
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
void JumpForwardToOptionsSelection() const
|
void JumpForwardToOptionsSelection() const
|
||||||
|
@ -238,7 +238,7 @@ private:
|
||||||
window_close_all();
|
window_close_all();
|
||||||
ContextOpenWindow(WindowClass::EditorScenarioOptions);
|
ContextOpenWindow(WindowClass::EditorScenarioOptions);
|
||||||
gEditorStep = EditorStep::OptionsSelection;
|
gEditorStep = EditorStep::OptionsSelection;
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
void JumpForwardToObjectiveSelection() const
|
void JumpForwardToObjectiveSelection() const
|
||||||
|
@ -246,7 +246,7 @@ private:
|
||||||
window_close_all();
|
window_close_all();
|
||||||
ContextOpenWindow(WindowClass::EditorObjectiveOptions);
|
ContextOpenWindow(WindowClass::EditorObjectiveOptions);
|
||||||
gEditorStep = EditorStep::ObjectiveSelection;
|
gEditorStep = EditorStep::ObjectiveSelection;
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
void JumpForwardToSaveScenario() const
|
void JumpForwardToSaveScenario() const
|
||||||
|
@ -255,7 +255,7 @@ private:
|
||||||
if (!savePrepareResult.Successful)
|
if (!savePrepareResult.Successful)
|
||||||
{
|
{
|
||||||
ContextShowError(STR_UNABLE_TO_SAVE_SCENARIO_FILE, savePrepareResult.Message, {});
|
ContextShowError(STR_UNABLE_TO_SAVE_SCENARIO_FILE, savePrepareResult.Message, {});
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -283,7 +283,7 @@ private:
|
||||||
auto previousWidget = widgets[WIDX_PREVIOUS_IMAGE];
|
auto previousWidget = widgets[WIDX_PREVIOUS_IMAGE];
|
||||||
auto leftTop = windowPos + ScreenCoordsXY{ previousWidget.left, previousWidget.top };
|
auto leftTop = windowPos + ScreenCoordsXY{ previousWidget.left, previousWidget.top };
|
||||||
auto rightBottom = windowPos + ScreenCoordsXY{ previousWidget.right, previousWidget.bottom };
|
auto rightBottom = windowPos + ScreenCoordsXY{ previousWidget.right, previousWidget.bottom };
|
||||||
gfx_filter_rect(&dpi, { leftTop, rightBottom }, FilterPaletteID::Palette51);
|
GfxFilterRect(&dpi, { leftTop, rightBottom }, FilterPaletteID::Palette51);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawLeftButton(rct_drawpixelinfo& dpi)
|
void DrawLeftButton(rct_drawpixelinfo& dpi)
|
||||||
|
@ -292,7 +292,7 @@ private:
|
||||||
+ ScreenCoordsXY{ widgets[WIDX_PREVIOUS_IMAGE].left + 1, widgets[WIDX_PREVIOUS_IMAGE].top + 1 };
|
+ ScreenCoordsXY{ widgets[WIDX_PREVIOUS_IMAGE].left + 1, widgets[WIDX_PREVIOUS_IMAGE].top + 1 };
|
||||||
const auto bottomRight = windowPos
|
const auto bottomRight = windowPos
|
||||||
+ ScreenCoordsXY{ widgets[WIDX_PREVIOUS_IMAGE].right - 1, widgets[WIDX_PREVIOUS_IMAGE].bottom - 1 };
|
+ ScreenCoordsXY{ widgets[WIDX_PREVIOUS_IMAGE].right - 1, widgets[WIDX_PREVIOUS_IMAGE].bottom - 1 };
|
||||||
gfx_fill_rect_inset(&dpi, { topLeft, bottomRight }, colours[1], INSET_RECT_F_30);
|
GfxFillRectInset(&dpi, { topLeft, bottomRight }, colours[1], INSET_RECT_F_30);
|
||||||
|
|
||||||
gfx_draw_sprite(
|
gfx_draw_sprite(
|
||||||
&dpi, ImageId(SPR_PREVIOUS),
|
&dpi, ImageId(SPR_PREVIOUS),
|
||||||
|
@ -321,7 +321,7 @@ private:
|
||||||
auto nextWidget = widgets[WIDX_NEXT_IMAGE];
|
auto nextWidget = widgets[WIDX_NEXT_IMAGE];
|
||||||
auto leftTop = windowPos + ScreenCoordsXY{ nextWidget.left, nextWidget.top };
|
auto leftTop = windowPos + ScreenCoordsXY{ nextWidget.left, nextWidget.top };
|
||||||
auto rightBottom = windowPos + ScreenCoordsXY{ nextWidget.right, nextWidget.bottom };
|
auto rightBottom = windowPos + ScreenCoordsXY{ nextWidget.right, nextWidget.bottom };
|
||||||
gfx_filter_rect(&dpi, { leftTop, rightBottom }, FilterPaletteID::Palette51);
|
GfxFilterRect(&dpi, { leftTop, rightBottom }, FilterPaletteID::Palette51);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawRightButton(rct_drawpixelinfo& dpi)
|
void DrawRightButton(rct_drawpixelinfo& dpi)
|
||||||
|
@ -329,7 +329,7 @@ private:
|
||||||
const auto topLeft = windowPos + ScreenCoordsXY{ widgets[WIDX_NEXT_IMAGE].left + 1, widgets[WIDX_NEXT_IMAGE].top + 1 };
|
const auto topLeft = windowPos + ScreenCoordsXY{ widgets[WIDX_NEXT_IMAGE].left + 1, widgets[WIDX_NEXT_IMAGE].top + 1 };
|
||||||
const auto bottomRight = windowPos
|
const auto bottomRight = windowPos
|
||||||
+ ScreenCoordsXY{ widgets[WIDX_NEXT_IMAGE].right - 1, widgets[WIDX_NEXT_IMAGE].bottom - 1 };
|
+ ScreenCoordsXY{ widgets[WIDX_NEXT_IMAGE].right - 1, widgets[WIDX_NEXT_IMAGE].bottom - 1 };
|
||||||
gfx_fill_rect_inset(&dpi, { topLeft, bottomRight }, colours[1], INSET_RECT_F_30);
|
GfxFillRectInset(&dpi, { topLeft, bottomRight }, colours[1], INSET_RECT_F_30);
|
||||||
|
|
||||||
gfx_draw_sprite(
|
gfx_draw_sprite(
|
||||||
&dpi, ImageId(SPR_NEXT),
|
&dpi, ImageId(SPR_NEXT),
|
||||||
|
|
|
@ -266,7 +266,7 @@ public:
|
||||||
{
|
{
|
||||||
// Draw background
|
// Draw background
|
||||||
uint8_t paletteIndex = ColourMapA[colours[1]].mid_light;
|
uint8_t paletteIndex = ColourMapA[colours[1]].mid_light;
|
||||||
gfx_clear(&dpi, paletteIndex);
|
GfxClear(&dpi, paletteIndex);
|
||||||
|
|
||||||
int16_t boxWidth = widgets[WIDX_RESEARCH_ORDER_SCROLL].width();
|
int16_t boxWidth = widgets[WIDX_RESEARCH_ORDER_SCROLL].width();
|
||||||
int32_t itemY = -SCROLLABLE_ROW_HEIGHT;
|
int32_t itemY = -SCROLLABLE_ROW_HEIGHT;
|
||||||
|
@ -295,7 +295,7 @@ public:
|
||||||
bottom = itemY;
|
bottom = itemY;
|
||||||
}
|
}
|
||||||
|
|
||||||
gfx_filter_rect(&dpi, { 0, top, boxWidth, bottom }, FilterPaletteID::PaletteDarken1);
|
GfxFilterRect(&dpi, { 0, top, boxWidth, bottom }, FilterPaletteID::PaletteDarken1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dragItem != nullptr && researchItem == *dragItem)
|
if (dragItem != nullptr && researchItem == *dragItem)
|
||||||
|
@ -365,7 +365,7 @@ public:
|
||||||
|
|
||||||
// Preview background
|
// Preview background
|
||||||
auto& bkWidget = widgets[WIDX_PREVIEW];
|
auto& bkWidget = widgets[WIDX_PREVIEW];
|
||||||
gfx_fill_rect(
|
GfxFillRect(
|
||||||
&dpi,
|
&dpi,
|
||||||
{ windowPos + ScreenCoordsXY{ bkWidget.left + 1, bkWidget.top + 1 },
|
{ windowPos + ScreenCoordsXY{ bkWidget.left + 1, bkWidget.top + 1 },
|
||||||
windowPos + ScreenCoordsXY{ bkWidget.right - 1, bkWidget.bottom - 1 } },
|
windowPos + ScreenCoordsXY{ bkWidget.right - 1, bkWidget.bottom - 1 } },
|
||||||
|
@ -395,7 +395,7 @@ public:
|
||||||
screenPos = windowPos + ScreenCoordsXY{ bkWidget.left + 1, bkWidget.top + 1 };
|
screenPos = windowPos + ScreenCoordsXY{ bkWidget.left + 1, bkWidget.top + 1 };
|
||||||
const auto clipWidth = bkWidget.width() - 1;
|
const auto clipWidth = bkWidget.width() - 1;
|
||||||
const auto clipHeight = bkWidget.height() - 1;
|
const auto clipHeight = bkWidget.height() - 1;
|
||||||
if (clip_drawpixelinfo(&clipDPI, &dpi, screenPos, clipWidth, clipHeight))
|
if (ClipDrawPixelInfo(&clipDPI, &dpi, screenPos, clipWidth, clipHeight))
|
||||||
{
|
{
|
||||||
object->DrawPreview(&clipDPI, clipWidth, clipHeight);
|
object->DrawPreview(&clipDPI, clipWidth, clipHeight);
|
||||||
}
|
}
|
||||||
|
|
|
@ -695,7 +695,7 @@ public:
|
||||||
bool ridePage = (GetSelectedObjectType() == ObjectType::Ride);
|
bool ridePage = (GetSelectedObjectType() == ObjectType::Ride);
|
||||||
|
|
||||||
uint8_t paletteIndex = ColourMapA[colours[1]].mid_light;
|
uint8_t paletteIndex = ColourMapA[colours[1]].mid_light;
|
||||||
gfx_clear(&dpi, paletteIndex);
|
GfxClear(&dpi, paletteIndex);
|
||||||
|
|
||||||
screenCoords.y = 0;
|
screenCoords.y = 0;
|
||||||
for (size_t i = 0; i < _listItems.size(); i++)
|
for (size_t i = 0; i < _listItems.size(); i++)
|
||||||
|
@ -705,8 +705,7 @@ public:
|
||||||
{
|
{
|
||||||
// Draw checkbox
|
// Draw checkbox
|
||||||
if (!(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) && !(*listItem.flags & 0x20))
|
if (!(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) && !(*listItem.flags & 0x20))
|
||||||
gfx_fill_rect_inset(
|
GfxFillRectInset(&dpi, { { 2, screenCoords.y }, { 11, screenCoords.y + 10 } }, colours[1], INSET_RECT_F_E0);
|
||||||
&dpi, { { 2, screenCoords.y }, { 11, screenCoords.y + 10 } }, colours[1], INSET_RECT_F_E0);
|
|
||||||
|
|
||||||
// Highlight background
|
// Highlight background
|
||||||
auto highlighted = i == static_cast<size_t>(selected_list_item)
|
auto highlighted = i == static_cast<size_t>(selected_list_item)
|
||||||
|
@ -714,7 +713,7 @@ public:
|
||||||
if (highlighted)
|
if (highlighted)
|
||||||
{
|
{
|
||||||
auto bottom = screenCoords.y + (SCROLLABLE_ROW_HEIGHT - 1);
|
auto bottom = screenCoords.y + (SCROLLABLE_ROW_HEIGHT - 1);
|
||||||
gfx_filter_rect(&dpi, { 0, screenCoords.y, width, bottom }, FilterPaletteID::PaletteDarken1);
|
GfxFilterRect(&dpi, { 0, screenCoords.y, width, bottom }, FilterPaletteID::PaletteDarken1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw checkmark
|
// Draw checkmark
|
||||||
|
@ -1003,7 +1002,7 @@ public:
|
||||||
|
|
||||||
// Preview background
|
// Preview background
|
||||||
const auto& previewWidget = widgets[WIDX_PREVIEW];
|
const auto& previewWidget = widgets[WIDX_PREVIEW];
|
||||||
gfx_fill_rect(
|
GfxFillRect(
|
||||||
&dpi,
|
&dpi,
|
||||||
{ windowPos + ScreenCoordsXY{ previewWidget.left + 1, previewWidget.top + 1 },
|
{ windowPos + ScreenCoordsXY{ previewWidget.left + 1, previewWidget.top + 1 },
|
||||||
windowPos + ScreenCoordsXY{ previewWidget.right - 1, previewWidget.bottom - 1 } },
|
windowPos + ScreenCoordsXY{ previewWidget.right - 1, previewWidget.bottom - 1 } },
|
||||||
|
@ -1056,7 +1055,7 @@ public:
|
||||||
auto screenPos = windowPos + ScreenCoordsXY{ previewWidget.left + 1, previewWidget.top + 1 };
|
auto screenPos = windowPos + ScreenCoordsXY{ previewWidget.left + 1, previewWidget.top + 1 };
|
||||||
_width = previewWidget.width() - 1;
|
_width = previewWidget.width() - 1;
|
||||||
int32_t _height = previewWidget.height() - 1;
|
int32_t _height = previewWidget.height() - 1;
|
||||||
if (clip_drawpixelinfo(&clipDPI, &dpi, screenPos, _width, _height))
|
if (ClipDrawPixelInfo(&clipDPI, &dpi, screenPos, _width, _height))
|
||||||
{
|
{
|
||||||
_loadedObject->DrawPreview(&clipDPI, _width, _height);
|
_loadedObject->DrawPreview(&clipDPI, _width, _height);
|
||||||
}
|
}
|
||||||
|
@ -1607,7 +1606,7 @@ void EditorLoadSelectedObjects()
|
||||||
if (_numSelectedObjectsForType[EnumValue(ObjectType::Water)] == 0)
|
if (_numSelectedObjectsForType[EnumValue(ObjectType::Water)] == 0)
|
||||||
{
|
{
|
||||||
// Reloads the default cyan water palette if no palette was selected.
|
// Reloads the default cyan water palette if no palette was selected.
|
||||||
load_palette();
|
LoadPalette();
|
||||||
}
|
}
|
||||||
if (showFallbackWarning)
|
if (showFallbackWarning)
|
||||||
ContextShowError(STR_OBJECT_SELECTION_FALLBACK_IMAGES_WARNING, STR_EMPTY, Formatter::Common());
|
ContextShowError(STR_OBJECT_SELECTION_FALLBACK_IMAGES_WARNING, STR_EMPTY, Formatter::Common());
|
||||||
|
|
|
@ -1051,7 +1051,7 @@ static void WindowEditorObjectiveOptionsRidesPaint(rct_window* w, rct_drawpixeli
|
||||||
static void WindowEditorObjectiveOptionsRidesScrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t scrollIndex)
|
static void WindowEditorObjectiveOptionsRidesScrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t scrollIndex)
|
||||||
{
|
{
|
||||||
int32_t colour = ColourMapA[w->colours[1]].mid_light;
|
int32_t colour = ColourMapA[w->colours[1]].mid_light;
|
||||||
gfx_fill_rect(dpi, { { dpi->x, dpi->y }, { dpi->x + dpi->width - 1, dpi->y + dpi->height - 1 } }, colour);
|
GfxFillRect(dpi, { { dpi->x, dpi->y }, { dpi->x + dpi->width - 1, dpi->y + dpi->height - 1 } }, colour);
|
||||||
|
|
||||||
for (int32_t i = 0; i < w->no_list_items; i++)
|
for (int32_t i = 0; i < w->no_list_items; i++)
|
||||||
{
|
{
|
||||||
|
@ -1061,14 +1061,14 @@ static void WindowEditorObjectiveOptionsRidesScrollpaint(rct_window* w, rct_draw
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Checkbox
|
// Checkbox
|
||||||
gfx_fill_rect_inset(dpi, { { 2, y }, { 11, y + 10 } }, w->colours[1], INSET_RECT_F_E0);
|
GfxFillRectInset(dpi, { { 2, y }, { 11, y + 10 } }, w->colours[1], INSET_RECT_F_E0);
|
||||||
|
|
||||||
// Highlighted
|
// Highlighted
|
||||||
auto stringId = STR_BLACK_STRING;
|
auto stringId = STR_BLACK_STRING;
|
||||||
if (i == w->selected_list_item)
|
if (i == w->selected_list_item)
|
||||||
{
|
{
|
||||||
stringId = STR_WINDOW_COLOUR_2_STRINGID;
|
stringId = STR_WINDOW_COLOUR_2_STRINGID;
|
||||||
gfx_filter_rect(dpi, { 0, y, w->width, y + 11 }, FilterPaletteID::PaletteDarken1);
|
GfxFilterRect(dpi, { 0, y, w->width, y + 11 }, FilterPaletteID::PaletteDarken1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Checkbox mark
|
// Checkbox mark
|
||||||
|
|
|
@ -62,34 +62,34 @@ public:
|
||||||
ScreenCoordsXY leftBottom{ leftTop.x, rightBottom.y };
|
ScreenCoordsXY leftBottom{ leftTop.x, rightBottom.y };
|
||||||
ScreenCoordsXY rightTop{ rightBottom.x, leftTop.y };
|
ScreenCoordsXY rightTop{ rightBottom.x, leftTop.y };
|
||||||
|
|
||||||
gfx_filter_rect(
|
GfxFilterRect(
|
||||||
&dpi, ScreenRect{ leftTop + ScreenCoordsXY{ 1, 1 }, rightBottom - ScreenCoordsXY{ 1, 1 } },
|
&dpi, ScreenRect{ leftTop + ScreenCoordsXY{ 1, 1 }, rightBottom - ScreenCoordsXY{ 1, 1 } },
|
||||||
FilterPaletteID::Palette45);
|
FilterPaletteID::Palette45);
|
||||||
gfx_filter_rect(&dpi, ScreenRect{ leftTop, rightBottom }, FilterPaletteID::PaletteGlassSaturatedRed);
|
GfxFilterRect(&dpi, ScreenRect{ leftTop, rightBottom }, FilterPaletteID::PaletteGlassSaturatedRed);
|
||||||
|
|
||||||
gfx_filter_rect(
|
GfxFilterRect(
|
||||||
&dpi, ScreenRect{ leftTop + ScreenCoordsXY{ 0, 2 }, leftBottom - ScreenCoordsXY{ 0, 2 } },
|
&dpi, ScreenRect{ leftTop + ScreenCoordsXY{ 0, 2 }, leftBottom - ScreenCoordsXY{ 0, 2 } },
|
||||||
FilterPaletteID::PaletteDarken3);
|
FilterPaletteID::PaletteDarken3);
|
||||||
gfx_filter_rect(
|
GfxFilterRect(
|
||||||
&dpi, ScreenRect{ rightTop + ScreenCoordsXY{ 0, 2 }, rightBottom - ScreenCoordsXY{ 0, 2 } },
|
&dpi, ScreenRect{ rightTop + ScreenCoordsXY{ 0, 2 }, rightBottom - ScreenCoordsXY{ 0, 2 } },
|
||||||
FilterPaletteID::PaletteDarken3);
|
FilterPaletteID::PaletteDarken3);
|
||||||
gfx_filter_rect(
|
GfxFilterRect(
|
||||||
&dpi, ScreenRect{ leftBottom + ScreenCoordsXY{ 2, 0 }, rightBottom - ScreenCoordsXY{ 2, 0 } },
|
&dpi, ScreenRect{ leftBottom + ScreenCoordsXY{ 2, 0 }, rightBottom - ScreenCoordsXY{ 2, 0 } },
|
||||||
FilterPaletteID::PaletteDarken3);
|
FilterPaletteID::PaletteDarken3);
|
||||||
gfx_filter_rect(
|
GfxFilterRect(
|
||||||
&dpi, ScreenRect{ leftTop + ScreenCoordsXY{ 2, 0 }, rightTop - ScreenCoordsXY{ 2, 0 } },
|
&dpi, ScreenRect{ leftTop + ScreenCoordsXY{ 2, 0 }, rightTop - ScreenCoordsXY{ 2, 0 } },
|
||||||
FilterPaletteID::PaletteDarken3);
|
FilterPaletteID::PaletteDarken3);
|
||||||
|
|
||||||
gfx_filter_rect(
|
GfxFilterRect(
|
||||||
&dpi, ScreenRect{ rightTop + ScreenCoordsXY{ 1, 1 }, rightTop + ScreenCoordsXY{ 1, 1 } },
|
&dpi, ScreenRect{ rightTop + ScreenCoordsXY{ 1, 1 }, rightTop + ScreenCoordsXY{ 1, 1 } },
|
||||||
FilterPaletteID::PaletteDarken3);
|
FilterPaletteID::PaletteDarken3);
|
||||||
gfx_filter_rect(
|
GfxFilterRect(
|
||||||
&dpi, ScreenRect{ rightTop + ScreenCoordsXY{ -1, 1 }, rightTop + ScreenCoordsXY{ -1, 1 } },
|
&dpi, ScreenRect{ rightTop + ScreenCoordsXY{ -1, 1 }, rightTop + ScreenCoordsXY{ -1, 1 } },
|
||||||
FilterPaletteID::PaletteDarken3);
|
FilterPaletteID::PaletteDarken3);
|
||||||
gfx_filter_rect(
|
GfxFilterRect(
|
||||||
&dpi, ScreenRect{ leftBottom + ScreenCoordsXY{ 1, -1 }, leftBottom + ScreenCoordsXY{ 1, -1 } },
|
&dpi, ScreenRect{ leftBottom + ScreenCoordsXY{ 1, -1 }, leftBottom + ScreenCoordsXY{ 1, -1 } },
|
||||||
FilterPaletteID::PaletteDarken3);
|
FilterPaletteID::PaletteDarken3);
|
||||||
gfx_filter_rect(
|
GfxFilterRect(
|
||||||
&dpi, ScreenRect{ rightBottom - ScreenCoordsXY{ 1, 1 }, rightBottom - ScreenCoordsXY{ 1, 1 } },
|
&dpi, ScreenRect{ rightBottom - ScreenCoordsXY{ 1, 1 }, rightBottom - ScreenCoordsXY{ 1, 1 } },
|
||||||
FilterPaletteID::PaletteDarken3);
|
FilterPaletteID::PaletteDarken3);
|
||||||
|
|
||||||
|
|
|
@ -371,7 +371,7 @@ public:
|
||||||
{
|
{
|
||||||
// Darken every even row
|
// Darken every even row
|
||||||
if (i % 2 == 0)
|
if (i % 2 == 0)
|
||||||
gfx_fill_rect(
|
GfxFillRect(
|
||||||
&dpi,
|
&dpi,
|
||||||
{ screenCoords - ScreenCoordsXY{ 0, 1 },
|
{ screenCoords - ScreenCoordsXY{ 0, 1 },
|
||||||
screenCoords + ScreenCoordsXY{ row_width, (TABLE_CELL_HEIGHT - 2) } },
|
screenCoords + ScreenCoordsXY{ row_width, (TABLE_CELL_HEIGHT - 2) } },
|
||||||
|
@ -425,7 +425,7 @@ public:
|
||||||
DrawTextBasic(
|
DrawTextBasic(
|
||||||
&dpi, screenCoords + ScreenCoordsXY{ EXPENDITURE_COLUMN_WIDTH, 0 }, format, ft, { TextAlignment::RIGHT });
|
&dpi, screenCoords + ScreenCoordsXY{ EXPENDITURE_COLUMN_WIDTH, 0 }, format, ft, { TextAlignment::RIGHT });
|
||||||
|
|
||||||
gfx_fill_rect(
|
GfxFillRect(
|
||||||
&dpi,
|
&dpi,
|
||||||
{ screenCoords + ScreenCoordsXY{ 10, -2 }, screenCoords + ScreenCoordsXY{ EXPENDITURE_COLUMN_WIDTH, -2 } },
|
{ screenCoords + ScreenCoordsXY{ 10, -2 }, screenCoords + ScreenCoordsXY{ EXPENDITURE_COLUMN_WIDTH, -2 } },
|
||||||
PALETTE_INDEX_10);
|
PALETTE_INDEX_10);
|
||||||
|
@ -541,7 +541,7 @@ public:
|
||||||
{
|
{
|
||||||
// Darken every even row
|
// Darken every even row
|
||||||
if (i % 2 == 0)
|
if (i % 2 == 0)
|
||||||
gfx_fill_rect(
|
GfxFillRect(
|
||||||
&dpi,
|
&dpi,
|
||||||
{ screenCoords - ScreenCoordsXY{ 0, 1 }, screenCoords + ScreenCoordsXY{ 121, (TABLE_CELL_HEIGHT - 2) } },
|
{ screenCoords - ScreenCoordsXY{ 0, 1 }, screenCoords + ScreenCoordsXY{ 121, (TABLE_CELL_HEIGHT - 2) } },
|
||||||
ColourMapA[colours[1]].lighter | 0x1000000);
|
ColourMapA[colours[1]].lighter | 0x1000000);
|
||||||
|
@ -551,7 +551,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
// Horizontal rule below expenditure / income table
|
// Horizontal rule below expenditure / income table
|
||||||
gfx_fill_rect_inset(
|
GfxFillRectInset(
|
||||||
&dpi, { windowPos + ScreenCoordsXY{ 8, 272 }, windowPos + ScreenCoordsXY{ 8 + 513, 272 + 1 } }, colours[1],
|
&dpi, { windowPos + ScreenCoordsXY{ 8, 272 }, windowPos + ScreenCoordsXY{ 8 + 513, 272 + 1 } }, colours[1],
|
||||||
INSET_RECT_FLAG_BORDER_INSET);
|
INSET_RECT_FLAG_BORDER_INSET);
|
||||||
|
|
||||||
|
@ -616,7 +616,7 @@ public:
|
||||||
ft);
|
ft);
|
||||||
|
|
||||||
// Graph
|
// Graph
|
||||||
gfx_fill_rect_inset(&dpi, { graphTopLeft, graphBottomRight }, colours[1], INSET_RECT_F_30);
|
GfxFillRectInset(&dpi, { graphTopLeft, graphBottomRight }, colours[1], INSET_RECT_F_30);
|
||||||
|
|
||||||
// Calculate the Y axis scale (log2 of highest [+/-]balance)
|
// Calculate the Y axis scale (log2 of highest [+/-]balance)
|
||||||
int32_t yAxisScale = 0;
|
int32_t yAxisScale = 0;
|
||||||
|
@ -646,7 +646,7 @@ public:
|
||||||
DrawTextBasic(
|
DrawTextBasic(
|
||||||
&dpi, coords + ScreenCoordsXY{ 70, 0 }, STR_FINANCES_FINANCIAL_GRAPH_CASH_VALUE, ft,
|
&dpi, coords + ScreenCoordsXY{ 70, 0 }, STR_FINANCES_FINANCIAL_GRAPH_CASH_VALUE, ft,
|
||||||
{ FontStyle::Small, TextAlignment::RIGHT });
|
{ FontStyle::Small, TextAlignment::RIGHT });
|
||||||
gfx_fill_rect_inset(
|
GfxFillRectInset(
|
||||||
&dpi, { coords + ScreenCoordsXY{ 70, 5 }, { graphTopLeft.x + 482, coords.y + 5 } }, colours[2],
|
&dpi, { coords + ScreenCoordsXY{ 70, 5 }, { graphTopLeft.x + 482, coords.y + 5 } }, colours[2],
|
||||||
INSET_RECT_FLAG_BORDER_INSET);
|
INSET_RECT_FLAG_BORDER_INSET);
|
||||||
coords.y += 39;
|
coords.y += 39;
|
||||||
|
@ -673,7 +673,7 @@ public:
|
||||||
DrawTextBasic(&dpi, graphTopLeft - ScreenCoordsXY{ 0, 11 }, STR_FINANCES_PARK_VALUE, ft);
|
DrawTextBasic(&dpi, graphTopLeft - ScreenCoordsXY{ 0, 11 }, STR_FINANCES_PARK_VALUE, ft);
|
||||||
|
|
||||||
// Graph
|
// Graph
|
||||||
gfx_fill_rect_inset(&dpi, { graphTopLeft, graphBottomRight }, colours[1], INSET_RECT_F_30);
|
GfxFillRectInset(&dpi, { graphTopLeft, graphBottomRight }, colours[1], INSET_RECT_F_30);
|
||||||
|
|
||||||
// Calculate the Y axis scale (log2 of highest [+/-]balance)
|
// Calculate the Y axis scale (log2 of highest [+/-]balance)
|
||||||
int32_t yAxisScale = 0;
|
int32_t yAxisScale = 0;
|
||||||
|
@ -703,7 +703,7 @@ public:
|
||||||
DrawTextBasic(
|
DrawTextBasic(
|
||||||
&dpi, coords + ScreenCoordsXY{ 70, 0 }, STR_FINANCES_FINANCIAL_GRAPH_CASH_VALUE, ft,
|
&dpi, coords + ScreenCoordsXY{ 70, 0 }, STR_FINANCES_FINANCIAL_GRAPH_CASH_VALUE, ft,
|
||||||
{ FontStyle::Small, TextAlignment::RIGHT });
|
{ FontStyle::Small, TextAlignment::RIGHT });
|
||||||
gfx_fill_rect_inset(
|
GfxFillRectInset(
|
||||||
&dpi, { coords + ScreenCoordsXY{ 70, 5 }, { graphTopLeft.x + 482, coords.y + 5 } }, colours[2],
|
&dpi, { coords + ScreenCoordsXY{ 70, 5 }, { graphTopLeft.x + 482, coords.y + 5 } }, colours[2],
|
||||||
INSET_RECT_FLAG_BORDER_INSET);
|
INSET_RECT_FLAG_BORDER_INSET);
|
||||||
coords.y += 39;
|
coords.y += 39;
|
||||||
|
@ -732,7 +732,7 @@ public:
|
||||||
gCurrentProfit >= 0 ? STR_FINANCES_WEEKLY_PROFIT_POSITIVE : STR_FINANCES_WEEKLY_PROFIT_LOSS, ft);
|
gCurrentProfit >= 0 ? STR_FINANCES_WEEKLY_PROFIT_POSITIVE : STR_FINANCES_WEEKLY_PROFIT_LOSS, ft);
|
||||||
|
|
||||||
// Graph
|
// Graph
|
||||||
gfx_fill_rect_inset(&dpi, { graphTopLeft, graphBottomRight }, colours[1], INSET_RECT_F_30);
|
GfxFillRectInset(&dpi, { graphTopLeft, graphBottomRight }, colours[1], INSET_RECT_F_30);
|
||||||
|
|
||||||
// Calculate the Y axis scale (log2 of highest [+/-]balance)
|
// Calculate the Y axis scale (log2 of highest [+/-]balance)
|
||||||
int32_t yAxisScale = 0;
|
int32_t yAxisScale = 0;
|
||||||
|
@ -762,7 +762,7 @@ public:
|
||||||
DrawTextBasic(
|
DrawTextBasic(
|
||||||
&dpi, screenPos + ScreenCoordsXY{ 70, 0 }, STR_FINANCES_FINANCIAL_GRAPH_CASH_VALUE, ft,
|
&dpi, screenPos + ScreenCoordsXY{ 70, 0 }, STR_FINANCES_FINANCIAL_GRAPH_CASH_VALUE, ft,
|
||||||
{ FontStyle::Small, TextAlignment::RIGHT });
|
{ FontStyle::Small, TextAlignment::RIGHT });
|
||||||
gfx_fill_rect_inset(
|
GfxFillRectInset(
|
||||||
&dpi, { screenPos + ScreenCoordsXY{ 70, 5 }, { graphTopLeft.x + 482, screenPos.y + 5 } }, colours[2],
|
&dpi, { screenPos + ScreenCoordsXY{ 70, 5 }, { graphTopLeft.x + 482, screenPos.y + 5 } }, colours[2],
|
||||||
INSET_RECT_FLAG_BORDER_INSET);
|
INSET_RECT_FLAG_BORDER_INSET);
|
||||||
screenPos.y += 39;
|
screenPos.y += 39;
|
||||||
|
|
|
@ -355,18 +355,18 @@ static void WindowGameBottomToolbarPaint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||||
// Draw panel grey backgrounds
|
// Draw panel grey backgrounds
|
||||||
auto leftTop = w->windowPos + ScreenCoordsXY{ leftWidget.left, leftWidget.top };
|
auto leftTop = w->windowPos + ScreenCoordsXY{ leftWidget.left, leftWidget.top };
|
||||||
auto rightBottom = w->windowPos + ScreenCoordsXY{ leftWidget.right, leftWidget.bottom };
|
auto rightBottom = w->windowPos + ScreenCoordsXY{ leftWidget.right, leftWidget.bottom };
|
||||||
gfx_filter_rect(dpi, { leftTop, rightBottom }, FilterPaletteID::Palette51);
|
GfxFilterRect(dpi, { leftTop, rightBottom }, FilterPaletteID::Palette51);
|
||||||
|
|
||||||
leftTop = w->windowPos + ScreenCoordsXY{ rightWidget.left, rightWidget.top };
|
leftTop = w->windowPos + ScreenCoordsXY{ rightWidget.left, rightWidget.top };
|
||||||
rightBottom = w->windowPos + ScreenCoordsXY{ rightWidget.right, rightWidget.bottom };
|
rightBottom = w->windowPos + ScreenCoordsXY{ rightWidget.right, rightWidget.bottom };
|
||||||
gfx_filter_rect(dpi, { leftTop, rightBottom }, FilterPaletteID::Palette51);
|
GfxFilterRect(dpi, { leftTop, rightBottom }, FilterPaletteID::Palette51);
|
||||||
|
|
||||||
if (ThemeGetFlags() & UITHEME_FLAG_USE_FULL_BOTTOM_TOOLBAR)
|
if (ThemeGetFlags() & UITHEME_FLAG_USE_FULL_BOTTOM_TOOLBAR)
|
||||||
{
|
{
|
||||||
// Draw grey background
|
// Draw grey background
|
||||||
leftTop = w->windowPos + ScreenCoordsXY{ middleWidget.left, middleWidget.top };
|
leftTop = w->windowPos + ScreenCoordsXY{ middleWidget.left, middleWidget.top };
|
||||||
rightBottom = w->windowPos + ScreenCoordsXY{ middleWidget.right, middleWidget.bottom };
|
rightBottom = w->windowPos + ScreenCoordsXY{ middleWidget.right, middleWidget.bottom };
|
||||||
gfx_filter_rect(dpi, { leftTop, rightBottom }, FilterPaletteID::Palette51);
|
GfxFilterRect(dpi, { leftTop, rightBottom }, FilterPaletteID::Palette51);
|
||||||
}
|
}
|
||||||
|
|
||||||
WindowDrawWidgets(*w, dpi);
|
WindowDrawWidgets(*w, dpi);
|
||||||
|
@ -393,7 +393,7 @@ static void WindowGameBottomToolbarDrawLeftPanel(rct_drawpixelinfo* dpi, rct_win
|
||||||
+ ScreenCoordsXY{ window_game_bottom_toolbar_widgets[WIDX_LEFT_OUTSET].right - 1,
|
+ ScreenCoordsXY{ window_game_bottom_toolbar_widgets[WIDX_LEFT_OUTSET].right - 1,
|
||||||
window_game_bottom_toolbar_widgets[WIDX_LEFT_OUTSET].bottom - 1 };
|
window_game_bottom_toolbar_widgets[WIDX_LEFT_OUTSET].bottom - 1 };
|
||||||
// Draw green inset rectangle on panel
|
// Draw green inset rectangle on panel
|
||||||
gfx_fill_rect_inset(dpi, { topLeft, bottomRight }, w->colours[1], INSET_RECT_F_30);
|
GfxFillRectInset(dpi, { topLeft, bottomRight }, w->colours[1], INSET_RECT_F_30);
|
||||||
|
|
||||||
// Figure out how much line height we have to work with.
|
// Figure out how much line height we have to work with.
|
||||||
uint32_t line_height = font_get_line_height(FontStyle::Medium);
|
uint32_t line_height = font_get_line_height(FontStyle::Medium);
|
||||||
|
@ -463,14 +463,13 @@ static void WindowGameBottomToolbarDrawParkRating(
|
||||||
int16_t bar_width;
|
int16_t bar_width;
|
||||||
|
|
||||||
bar_width = (factor * 114) / 255;
|
bar_width = (factor * 114) / 255;
|
||||||
gfx_fill_rect_inset(
|
GfxFillRectInset(
|
||||||
dpi, { coords + ScreenCoordsXY{ 1, 1 }, coords + ScreenCoordsXY{ 114, 9 } }, w->colours[1], INSET_RECT_F_30);
|
dpi, { coords + ScreenCoordsXY{ 1, 1 }, coords + ScreenCoordsXY{ 114, 9 } }, w->colours[1], INSET_RECT_F_30);
|
||||||
if (!(colour & BAR_BLINK) || game_is_paused() || (gCurrentRealTimeTicks & 8))
|
if (!(colour & BAR_BLINK) || game_is_paused() || (gCurrentRealTimeTicks & 8))
|
||||||
{
|
{
|
||||||
if (bar_width > 2)
|
if (bar_width > 2)
|
||||||
{
|
{
|
||||||
gfx_fill_rect_inset(
|
GfxFillRectInset(dpi, { coords + ScreenCoordsXY{ 2, 2 }, coords + ScreenCoordsXY{ bar_width - 1, 8 } }, colour, 0);
|
||||||
dpi, { coords + ScreenCoordsXY{ 2, 2 }, coords + ScreenCoordsXY{ bar_width - 1, 8 } }, colour, 0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -488,7 +487,7 @@ static void WindowGameBottomToolbarDrawRightPanel(rct_drawpixelinfo* dpi, rct_wi
|
||||||
+ ScreenCoordsXY{ window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].right - 1,
|
+ ScreenCoordsXY{ window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].right - 1,
|
||||||
window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].bottom - 1 };
|
window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].bottom - 1 };
|
||||||
// Draw green inset rectangle on panel
|
// Draw green inset rectangle on panel
|
||||||
gfx_fill_rect_inset(dpi, { topLeft, bottomRight }, w->colours[1], INSET_RECT_F_30);
|
GfxFillRectInset(dpi, { topLeft, bottomRight }, w->colours[1], INSET_RECT_F_30);
|
||||||
|
|
||||||
auto screenCoords = ScreenCoordsXY{ (window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].left
|
auto screenCoords = ScreenCoordsXY{ (window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].left
|
||||||
+ window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].right)
|
+ window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].right)
|
||||||
|
@ -561,7 +560,7 @@ static void WindowGameBottomToolbarDrawNewsItem(rct_drawpixelinfo* dpi, rct_wind
|
||||||
newsItem = News::GetItem(0);
|
newsItem = News::GetItem(0);
|
||||||
|
|
||||||
// Current news item
|
// Current news item
|
||||||
gfx_fill_rect_inset(
|
GfxFillRectInset(
|
||||||
dpi,
|
dpi,
|
||||||
{ w->windowPos + ScreenCoordsXY{ middleOutsetWidget->left + 1, middleOutsetWidget->top + 1 },
|
{ w->windowPos + ScreenCoordsXY{ middleOutsetWidget->left + 1, middleOutsetWidget->top + 1 },
|
||||||
w->windowPos + ScreenCoordsXY{ middleOutsetWidget->right - 1, middleOutsetWidget->bottom - 1 } },
|
w->windowPos + ScreenCoordsXY{ middleOutsetWidget->right - 1, middleOutsetWidget->bottom - 1 } },
|
||||||
|
@ -588,7 +587,7 @@ static void WindowGameBottomToolbarDrawNewsItem(rct_drawpixelinfo* dpi, rct_wind
|
||||||
break;
|
break;
|
||||||
|
|
||||||
rct_drawpixelinfo cliped_dpi;
|
rct_drawpixelinfo cliped_dpi;
|
||||||
if (!clip_drawpixelinfo(&cliped_dpi, dpi, screenCoords + ScreenCoordsXY{ 1, 1 }, 22, 22))
|
if (!ClipDrawPixelInfo(&cliped_dpi, dpi, screenCoords + ScreenCoordsXY{ 1, 1 }, 22, 22))
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -656,7 +655,7 @@ static void WindowGameBottomToolbarDrawMiddlePanel(rct_drawpixelinfo* dpi, rct_w
|
||||||
{
|
{
|
||||||
Widget* middleOutsetWidget = &window_game_bottom_toolbar_widgets[WIDX_MIDDLE_OUTSET];
|
Widget* middleOutsetWidget = &window_game_bottom_toolbar_widgets[WIDX_MIDDLE_OUTSET];
|
||||||
|
|
||||||
gfx_fill_rect_inset(
|
GfxFillRectInset(
|
||||||
dpi,
|
dpi,
|
||||||
{ w->windowPos + ScreenCoordsXY{ middleOutsetWidget->left + 1, middleOutsetWidget->top + 1 },
|
{ w->windowPos + ScreenCoordsXY{ middleOutsetWidget->left + 1, middleOutsetWidget->top + 1 },
|
||||||
w->windowPos + ScreenCoordsXY{ middleOutsetWidget->right - 1, middleOutsetWidget->bottom - 1 } },
|
w->windowPos + ScreenCoordsXY{ middleOutsetWidget->right - 1, middleOutsetWidget->bottom - 1 } },
|
||||||
|
|
|
@ -526,7 +526,7 @@ private:
|
||||||
widgHeight++;
|
widgHeight++;
|
||||||
|
|
||||||
rct_drawpixelinfo clipDpi;
|
rct_drawpixelinfo clipDpi;
|
||||||
if (!clip_drawpixelinfo(&clipDpi, &dpi, screenCoords, widgWidth, widgHeight))
|
if (!ClipDrawPixelInfo(&clipDpi, &dpi, screenCoords, widgWidth, widgHeight))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -782,7 +782,7 @@ private:
|
||||||
int32_t top = marqueeWidget.top + windowPos.y;
|
int32_t top = marqueeWidget.top + windowPos.y;
|
||||||
int32_t marqHeight = marqueeWidget.height();
|
int32_t marqHeight = marqueeWidget.height();
|
||||||
rct_drawpixelinfo dpiMarquee;
|
rct_drawpixelinfo dpiMarquee;
|
||||||
if (!clip_drawpixelinfo(&dpiMarquee, &dpi, { left, top }, marqWidth, marqHeight))
|
if (!ClipDrawPixelInfo(&dpiMarquee, &dpi, { left, top }, marqWidth, marqHeight))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1039,7 +1039,7 @@ private:
|
||||||
coords.y += 1;
|
coords.y += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
gfx_fill_rect_inset(
|
GfxFillRectInset(
|
||||||
&dpi, { coords + ScreenCoordsXY{ 61, 1 }, coords + ScreenCoordsXY{ 61 + 121, 9 } }, colours[1], INSET_RECT_F_30);
|
&dpi, { coords + ScreenCoordsXY{ 61, 1 }, coords + ScreenCoordsXY{ 61 + 121, 9 } }, colours[1], INSET_RECT_F_30);
|
||||||
|
|
||||||
if (!blinkFlag || game_is_paused() || (gCurrentRealTimeTicks & 8) == 0)
|
if (!blinkFlag || game_is_paused() || (gCurrentRealTimeTicks & 8) == 0)
|
||||||
|
@ -1050,7 +1050,7 @@ private:
|
||||||
if (value <= 2)
|
if (value <= 2)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
gfx_fill_rect_inset(
|
GfxFillRectInset(
|
||||||
&dpi, { coords + ScreenCoordsXY{ 63, 2 }, coords + ScreenCoordsXY{ 63 + value - 1, 8 } }, colour, 0);
|
&dpi, { coords + ScreenCoordsXY{ 63, 2 }, coords + ScreenCoordsXY{ 63 + value - 1, 8 } }, colour, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1155,7 +1155,7 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
screenCoords.y += LIST_ROW_HEIGHT + 9;
|
screenCoords.y += LIST_ROW_HEIGHT + 9;
|
||||||
gfx_fill_rect_inset(
|
GfxFillRectInset(
|
||||||
&dpi, { screenCoords - ScreenCoordsXY{ 0, 6 }, screenCoords + ScreenCoordsXY{ 179, -5 } }, colours[1],
|
&dpi, { screenCoords - ScreenCoordsXY{ 0, 6 }, screenCoords + ScreenCoordsXY{ 179, -5 } }, colours[1],
|
||||||
INSET_RECT_FLAG_BORDER_INSET);
|
INSET_RECT_FLAG_BORDER_INSET);
|
||||||
|
|
||||||
|
@ -1353,7 +1353,7 @@ private:
|
||||||
void OnScrollDrawRides(int32_t scrollIndex, rct_drawpixelinfo& dpi)
|
void OnScrollDrawRides(int32_t scrollIndex, rct_drawpixelinfo& dpi)
|
||||||
{
|
{
|
||||||
auto colour = ColourMapA[colours[1]].mid_light;
|
auto colour = ColourMapA[colours[1]].mid_light;
|
||||||
gfx_fill_rect(&dpi, { { dpi.x, dpi.y }, { dpi.x + dpi.width - 1, dpi.y + dpi.height - 1 } }, colour);
|
GfxFillRect(&dpi, { { dpi.x, dpi.y }, { dpi.x + dpi.width - 1, dpi.y + dpi.height - 1 } }, colour);
|
||||||
|
|
||||||
for (int32_t listIndex = 0; listIndex < no_list_items; listIndex++)
|
for (int32_t listIndex = 0; listIndex < no_list_items; listIndex++)
|
||||||
{
|
{
|
||||||
|
@ -1361,7 +1361,7 @@ private:
|
||||||
StringId stringId = STR_BLACK_STRING;
|
StringId stringId = STR_BLACK_STRING;
|
||||||
if (listIndex == selected_list_item)
|
if (listIndex == selected_list_item)
|
||||||
{
|
{
|
||||||
gfx_filter_rect(&dpi, { 0, y, 800, y + 9 }, FilterPaletteID::PaletteDarken1);
|
GfxFilterRect(&dpi, { 0, y, 800, y + 9 }, FilterPaletteID::PaletteDarken1);
|
||||||
stringId = STR_WINDOW_COLOUR_2_STRINGID;
|
stringId = STR_WINDOW_COLOUR_2_STRINGID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1441,7 +1441,7 @@ private:
|
||||||
screenCoords.y += LIST_ROW_HEIGHT * 2;
|
screenCoords.y += LIST_ROW_HEIGHT * 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
gfx_fill_rect_inset(
|
GfxFillRectInset(
|
||||||
&dpi, { screenCoords - ScreenCoordsXY{ 0, 6 }, screenCoords + ScreenCoordsXY{ 179, -5 } }, colours[1],
|
&dpi, { screenCoords - ScreenCoordsXY{ 0, 6 }, screenCoords + ScreenCoordsXY{ 179, -5 } }, colours[1],
|
||||||
INSET_RECT_FLAG_BORDER_INSET);
|
INSET_RECT_FLAG_BORDER_INSET);
|
||||||
|
|
||||||
|
|
|
@ -587,7 +587,7 @@ public:
|
||||||
|
|
||||||
void OnScrollDraw(int32_t scrollIndex, rct_drawpixelinfo& dpi) override
|
void OnScrollDraw(int32_t scrollIndex, rct_drawpixelinfo& dpi) override
|
||||||
{
|
{
|
||||||
gfx_fill_rect(
|
GfxFillRect(
|
||||||
&dpi, { { dpi.x, dpi.y }, { dpi.x + dpi.width - 1, dpi.y + dpi.height - 1 } }, ColourMapA[colours[1]].mid_light);
|
&dpi, { { dpi.x, dpi.y }, { dpi.x + dpi.width - 1, dpi.y + dpi.height - 1 } }, ColourMapA[colours[1]].mid_light);
|
||||||
switch (_selectedTab)
|
switch (_selectedTab)
|
||||||
{
|
{
|
||||||
|
@ -668,7 +668,7 @@ private:
|
||||||
StringId format = STR_BLACK_STRING;
|
StringId format = STR_BLACK_STRING;
|
||||||
if (index == _highlightedIndex)
|
if (index == _highlightedIndex)
|
||||||
{
|
{
|
||||||
gfx_filter_rect(&dpi, { 0, y, 800, y + SCROLLABLE_ROW_HEIGHT - 1 }, FilterPaletteID::PaletteDarken1);
|
GfxFilterRect(&dpi, { 0, y, 800, y + SCROLLABLE_ROW_HEIGHT - 1 }, FilterPaletteID::PaletteDarken1);
|
||||||
format = STR_WINDOW_COLOUR_2_STRINGID;
|
format = STR_WINDOW_COLOUR_2_STRINGID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -738,7 +738,7 @@ private:
|
||||||
StringId format = STR_BLACK_STRING;
|
StringId format = STR_BLACK_STRING;
|
||||||
if (index == _highlightedIndex)
|
if (index == _highlightedIndex)
|
||||||
{
|
{
|
||||||
gfx_filter_rect(&dpi, { 0, y, 800, y + SUMMARISED_GUEST_ROW_HEIGHT }, FilterPaletteID::PaletteDarken1);
|
GfxFilterRect(&dpi, { 0, y, 800, y + SUMMARISED_GUEST_ROW_HEIGHT }, FilterPaletteID::PaletteDarken1);
|
||||||
format = STR_WINDOW_COLOUR_2_STRINGID;
|
format = STR_WINDOW_COLOUR_2_STRINGID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -154,7 +154,7 @@ public:
|
||||||
Widget* widget = &window_install_track_widgets[WIDX_TRACK_PREVIEW];
|
Widget* widget = &window_install_track_widgets[WIDX_TRACK_PREVIEW];
|
||||||
auto screenPos = windowPos + ScreenCoordsXY{ widget->left + 1, widget->top + 1 };
|
auto screenPos = windowPos + ScreenCoordsXY{ widget->left + 1, widget->top + 1 };
|
||||||
int32_t colour = ColourMapA[colours[0]].darkest;
|
int32_t colour = ColourMapA[colours[0]].darkest;
|
||||||
gfx_fill_rect(&dpi, { screenPos, screenPos + ScreenCoordsXY{ 369, 216 } }, colour);
|
GfxFillRect(&dpi, { screenPos, screenPos + ScreenCoordsXY{ 369, 216 } }, colour);
|
||||||
|
|
||||||
rct_g1_element g1temp = {};
|
rct_g1_element g1temp = {};
|
||||||
g1temp.offset = _trackDesignPreviewPixels.data() + (_currentTrackPieceDirection * TRACK_PREVIEW_IMAGE_SIZE);
|
g1temp.offset = _trackDesignPreviewPixels.data() + (_currentTrackPieceDirection * TRACK_PREVIEW_IMAGE_SIZE);
|
||||||
|
|
|
@ -273,7 +273,7 @@ static void Select(const char* path)
|
||||||
{
|
{
|
||||||
InvokeCallback(MODAL_RESULT_OK, pathBuffer);
|
InvokeCallback(MODAL_RESULT_OK, pathBuffer);
|
||||||
window_close_by_class(WindowClass::Loadsave);
|
window_close_by_class(WindowClass::Loadsave);
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -293,7 +293,7 @@ static void Select(const char* path)
|
||||||
gFirstTimeSaving = false;
|
gFirstTimeSaving = false;
|
||||||
|
|
||||||
window_close_by_class(WindowClass::Loadsave);
|
window_close_by_class(WindowClass::Loadsave);
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
|
|
||||||
InvokeCallback(MODAL_RESULT_OK, pathBuffer);
|
InvokeCallback(MODAL_RESULT_OK, pathBuffer);
|
||||||
}
|
}
|
||||||
|
@ -309,7 +309,7 @@ static void Select(const char* path)
|
||||||
if (Editor::LoadLandscape(pathBuffer))
|
if (Editor::LoadLandscape(pathBuffer))
|
||||||
{
|
{
|
||||||
gCurrentLoadedPath = pathBuffer;
|
gCurrentLoadedPath = pathBuffer;
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
InvokeCallback(MODAL_RESULT_OK, pathBuffer);
|
InvokeCallback(MODAL_RESULT_OK, pathBuffer);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -327,7 +327,7 @@ static void Select(const char* path)
|
||||||
{
|
{
|
||||||
gCurrentLoadedPath = pathBuffer;
|
gCurrentLoadedPath = pathBuffer;
|
||||||
window_close_by_class(WindowClass::Loadsave);
|
window_close_by_class(WindowClass::Loadsave);
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
InvokeCallback(MODAL_RESULT_OK, pathBuffer);
|
InvokeCallback(MODAL_RESULT_OK, pathBuffer);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -976,7 +976,7 @@ public:
|
||||||
|
|
||||||
void OnScrollDraw(int32_t scrollIndex, rct_drawpixelinfo& dpi) override
|
void OnScrollDraw(int32_t scrollIndex, rct_drawpixelinfo& dpi) override
|
||||||
{
|
{
|
||||||
gfx_fill_rect(
|
GfxFillRect(
|
||||||
&dpi, { { dpi.x, dpi.y }, { dpi.x + dpi.width - 1, dpi.y + dpi.height - 1 } }, ColourMapA[colours[1]].mid_light);
|
&dpi, { { dpi.x, dpi.y }, { dpi.x + dpi.width - 1, dpi.y + dpi.height - 1 } }, ColourMapA[colours[1]].mid_light);
|
||||||
const int32_t listWidth = widgets[WIDX_SCROLL].width();
|
const int32_t listWidth = widgets[WIDX_SCROLL].width();
|
||||||
const int32_t dateAnchor = widgets[WIDX_SORT_DATE].left + maxDateWidth + DATE_TIME_GAP;
|
const int32_t dateAnchor = widgets[WIDX_SORT_DATE].left + maxDateWidth + DATE_TIME_GAP;
|
||||||
|
@ -996,7 +996,7 @@ public:
|
||||||
if (i == selected_list_item)
|
if (i == selected_list_item)
|
||||||
{
|
{
|
||||||
stringId = STR_WINDOW_COLOUR_2_STRINGID;
|
stringId = STR_WINDOW_COLOUR_2_STRINGID;
|
||||||
gfx_filter_rect(&dpi, { 0, y, listWidth, y + SCROLLABLE_ROW_HEIGHT }, FilterPaletteID::PaletteDarken1);
|
GfxFilterRect(&dpi, { 0, y, listWidth, y + SCROLLABLE_ROW_HEIGHT }, FilterPaletteID::PaletteDarken1);
|
||||||
}
|
}
|
||||||
// display a marker next to the currently loaded game file
|
// display a marker next to the currently loaded game file
|
||||||
if (_listItems[i].loaded)
|
if (_listItems[i].loaded)
|
||||||
|
|
|
@ -705,7 +705,7 @@ public:
|
||||||
|
|
||||||
void OnScrollDraw(int32_t scrollIndex, rct_drawpixelinfo& dpi) override
|
void OnScrollDraw(int32_t scrollIndex, rct_drawpixelinfo& dpi) override
|
||||||
{
|
{
|
||||||
gfx_clear(&dpi, PALETTE_INDEX_10);
|
GfxClear(&dpi, PALETTE_INDEX_10);
|
||||||
|
|
||||||
rct_g1_element g1temp = {};
|
rct_g1_element g1temp = {};
|
||||||
g1temp.offset = _mapImageData.data();
|
g1temp.offset = _mapImageData.data();
|
||||||
|
@ -893,7 +893,7 @@ public:
|
||||||
|
|
||||||
for (uint32_t i = 0; i < std::size(RideKeyColours); i++)
|
for (uint32_t i = 0; i < std::size(RideKeyColours); i++)
|
||||||
{
|
{
|
||||||
gfx_fill_rect(
|
GfxFillRect(
|
||||||
&dpi, { screenCoords + ScreenCoordsXY{ 0, 2 }, screenCoords + ScreenCoordsXY{ 6, 8 } },
|
&dpi, { screenCoords + ScreenCoordsXY{ 0, 2 }, screenCoords + ScreenCoordsXY{ 6, 8 } },
|
||||||
RideKeyColours[i]);
|
RideKeyColours[i]);
|
||||||
DrawTextBasic(&dpi, screenCoords + ScreenCoordsXY{ LIST_ROW_HEIGHT, 0 }, _mapLabels[i], {});
|
DrawTextBasic(&dpi, screenCoords + ScreenCoordsXY{ LIST_ROW_HEIGHT, 0 }, _mapLabels[i], {});
|
||||||
|
@ -1194,7 +1194,7 @@ private:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gfx_fill_rect(dpi, { leftTop, rightBottom }, colour);
|
GfxFillRect(dpi, { leftTop, rightBottom }, colour);
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint8_t GetGuestFlashColour()
|
static uint8_t GetGuestFlashColour()
|
||||||
|
@ -1232,13 +1232,13 @@ private:
|
||||||
|
|
||||||
MapCoordsXY c = TransformToMapCoords({ vehicle->x, vehicle->y });
|
MapCoordsXY c = TransformToMapCoords({ vehicle->x, vehicle->y });
|
||||||
|
|
||||||
gfx_fill_rect(dpi, { { c.x, c.y }, { c.x, c.y } }, PALETTE_INDEX_171);
|
GfxFillRect(dpi, { { c.x, c.y }, { c.x, c.y } }, PALETTE_INDEX_171);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The call to gfx_fill_rect was originally wrapped in sub_68DABD which made sure that arguments were ordered correctly,
|
* The call to GfxFillRect was originally wrapped in sub_68DABD which made sure that arguments were ordered correctly,
|
||||||
* but it doesn't look like it's ever necessary here so the call was removed.
|
* but it doesn't look like it's ever necessary here so the call was removed.
|
||||||
*/
|
*/
|
||||||
void PaintHudRectangle(rct_drawpixelinfo* dpi)
|
void PaintHudRectangle(rct_drawpixelinfo* dpi)
|
||||||
|
@ -1259,20 +1259,20 @@ private:
|
||||||
auto leftBottom = ScreenCoordsXY{ leftTop.x, rightBottom.y };
|
auto leftBottom = ScreenCoordsXY{ leftTop.x, rightBottom.y };
|
||||||
|
|
||||||
// top horizontal lines
|
// top horizontal lines
|
||||||
gfx_fill_rect(dpi, { leftTop, leftTop + ScreenCoordsXY{ 3, 0 } }, PALETTE_INDEX_56);
|
GfxFillRect(dpi, { leftTop, leftTop + ScreenCoordsXY{ 3, 0 } }, PALETTE_INDEX_56);
|
||||||
gfx_fill_rect(dpi, { rightTop - ScreenCoordsXY{ 3, 0 }, rightTop }, PALETTE_INDEX_56);
|
GfxFillRect(dpi, { rightTop - ScreenCoordsXY{ 3, 0 }, rightTop }, PALETTE_INDEX_56);
|
||||||
|
|
||||||
// left vertical lines
|
// left vertical lines
|
||||||
gfx_fill_rect(dpi, { leftTop, leftTop + ScreenCoordsXY{ 0, 3 } }, PALETTE_INDEX_56);
|
GfxFillRect(dpi, { leftTop, leftTop + ScreenCoordsXY{ 0, 3 } }, PALETTE_INDEX_56);
|
||||||
gfx_fill_rect(dpi, { leftBottom - ScreenCoordsXY{ 0, 3 }, leftBottom }, PALETTE_INDEX_56);
|
GfxFillRect(dpi, { leftBottom - ScreenCoordsXY{ 0, 3 }, leftBottom }, PALETTE_INDEX_56);
|
||||||
|
|
||||||
// bottom horizontal lines
|
// bottom horizontal lines
|
||||||
gfx_fill_rect(dpi, { leftBottom, leftBottom + ScreenCoordsXY{ 3, 0 } }, PALETTE_INDEX_56);
|
GfxFillRect(dpi, { leftBottom, leftBottom + ScreenCoordsXY{ 3, 0 } }, PALETTE_INDEX_56);
|
||||||
gfx_fill_rect(dpi, { rightBottom - ScreenCoordsXY{ 3, 0 }, rightBottom }, PALETTE_INDEX_56);
|
GfxFillRect(dpi, { rightBottom - ScreenCoordsXY{ 3, 0 }, rightBottom }, PALETTE_INDEX_56);
|
||||||
|
|
||||||
// right vertical lines
|
// right vertical lines
|
||||||
gfx_fill_rect(dpi, { rightTop, rightTop + ScreenCoordsXY{ 0, 3 } }, PALETTE_INDEX_56);
|
GfxFillRect(dpi, { rightTop, rightTop + ScreenCoordsXY{ 0, 3 } }, PALETTE_INDEX_56);
|
||||||
gfx_fill_rect(dpi, { rightBottom - ScreenCoordsXY{ 0, 3 }, rightBottom }, PALETTE_INDEX_56);
|
GfxFillRect(dpi, { rightBottom - ScreenCoordsXY{ 0, 3 }, rightBottom }, PALETTE_INDEX_56);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawTabImages(rct_drawpixelinfo* dpi)
|
void DrawTabImages(rct_drawpixelinfo* dpi)
|
||||||
|
|
|
@ -495,7 +495,7 @@ static void WindowMapgenBaseMouseup(rct_window* w, WidgetIndex widgetIndex)
|
||||||
mapgenSettings.wall = _wallTexture;
|
mapgenSettings.wall = _wallTexture;
|
||||||
|
|
||||||
MapGenGenerateBlank(&mapgenSettings);
|
MapGenGenerateBlank(&mapgenSettings);
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
break;
|
break;
|
||||||
case WIDX_MAP_SIZE_Y:
|
case WIDX_MAP_SIZE_Y:
|
||||||
_resizeDirection = ResizeDirection::Y;
|
_resizeDirection = ResizeDirection::Y;
|
||||||
|
@ -789,7 +789,7 @@ static void WindowMapgenRandomMouseup(rct_window* w, WidgetIndex widgetIndex)
|
||||||
mapgenSettings.simplex_octaves = 6;
|
mapgenSettings.simplex_octaves = 6;
|
||||||
|
|
||||||
MapGenGenerate(&mapgenSettings);
|
MapGenGenerate(&mapgenSettings);
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
break;
|
break;
|
||||||
case WIDX_RANDOM_TERRAIN:
|
case WIDX_RANDOM_TERRAIN:
|
||||||
_randomTerrain = !_randomTerrain;
|
_randomTerrain = !_randomTerrain;
|
||||||
|
@ -873,7 +873,7 @@ static void WindowMapgenSimplexMouseup(rct_window* w, WidgetIndex widgetIndex)
|
||||||
mapgenSettings.simplex_octaves = _simplex_octaves;
|
mapgenSettings.simplex_octaves = _simplex_octaves;
|
||||||
|
|
||||||
MapGenGenerate(&mapgenSettings);
|
MapGenGenerate(&mapgenSettings);
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1166,7 +1166,7 @@ static void WindowMapgenHeightmapGenerateMap()
|
||||||
mapgenSettings.simplex_low = _heightmapLow;
|
mapgenSettings.simplex_low = _heightmapLow;
|
||||||
mapgenSettings.simplex_high = _heightmapHigh;
|
mapgenSettings.simplex_high = _heightmapHigh;
|
||||||
MapGenGenerateFromHeightmap(&mapgenSettings);
|
MapGenGenerateFromHeightmap(&mapgenSettings);
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void WindowMapgenHeightmapLoadsaveCallback(int32_t result, const utf8* path)
|
static void WindowMapgenHeightmapLoadsaveCallback(int32_t result, const utf8* path)
|
||||||
|
|
|
@ -402,7 +402,7 @@ static void WindowMultiplayerInformationPaint(rct_window* w, rct_drawpixelinfo*
|
||||||
WindowMultiplayerDrawTabImages(w, dpi);
|
WindowMultiplayerDrawTabImages(w, dpi);
|
||||||
|
|
||||||
rct_drawpixelinfo clippedDPI;
|
rct_drawpixelinfo clippedDPI;
|
||||||
if (clip_drawpixelinfo(&clippedDPI, dpi, w->windowPos, w->width, w->height))
|
if (ClipDrawPixelInfo(&clippedDPI, dpi, w->windowPos, w->width, w->height))
|
||||||
{
|
{
|
||||||
dpi = &clippedDPI;
|
dpi = &clippedDPI;
|
||||||
|
|
||||||
|
@ -598,7 +598,7 @@ static void WindowMultiplayerPlayersScrollpaint(rct_window* w, rct_drawpixelinfo
|
||||||
colour_t colour = COLOUR_BLACK;
|
colour_t colour = COLOUR_BLACK;
|
||||||
if (listPosition == w->selected_list_item)
|
if (listPosition == w->selected_list_item)
|
||||||
{
|
{
|
||||||
gfx_filter_rect(
|
GfxFilterRect(
|
||||||
dpi, { 0, screenCoords.y, 800, screenCoords.y + SCROLLABLE_ROW_HEIGHT - 1 },
|
dpi, { 0, screenCoords.y, 800, screenCoords.y + SCROLLABLE_ROW_HEIGHT - 1 },
|
||||||
FilterPaletteID::PaletteDarken1);
|
FilterPaletteID::PaletteDarken1);
|
||||||
_buffer += network_get_player_name(player);
|
_buffer += network_get_player_name(player);
|
||||||
|
@ -872,7 +872,7 @@ static void WindowMultiplayerGroupsPaint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||||
|
|
||||||
screenPos.y += 20;
|
screenPos.y += 20;
|
||||||
|
|
||||||
gfx_fill_rect_inset(
|
GfxFillRectInset(
|
||||||
dpi, { screenPos - ScreenCoordsXY{ 0, 6 }, screenPos + ScreenCoordsXY{ 310, -5 } }, w->colours[1],
|
dpi, { screenPos - ScreenCoordsXY{ 0, 6 }, screenPos + ScreenCoordsXY{ 310, -5 } }, w->colours[1],
|
||||||
INSET_RECT_FLAG_BORDER_INSET);
|
INSET_RECT_FLAG_BORDER_INSET);
|
||||||
|
|
||||||
|
@ -895,14 +895,14 @@ static void WindowMultiplayerGroupsScrollpaint(rct_window* w, rct_drawpixelinfo*
|
||||||
auto screenCoords = ScreenCoordsXY{ 0, 0 };
|
auto screenCoords = ScreenCoordsXY{ 0, 0 };
|
||||||
|
|
||||||
auto dpiCoords = ScreenCoordsXY{ dpi->x, dpi->y };
|
auto dpiCoords = ScreenCoordsXY{ dpi->x, dpi->y };
|
||||||
gfx_fill_rect(
|
GfxFillRect(
|
||||||
dpi, { dpiCoords, dpiCoords + ScreenCoordsXY{ dpi->width - 1, dpi->height - 1 } }, ColourMapA[w->colours[1]].mid_light);
|
dpi, { dpiCoords, dpiCoords + ScreenCoordsXY{ dpi->width - 1, dpi->height - 1 } }, ColourMapA[w->colours[1]].mid_light);
|
||||||
|
|
||||||
for (int32_t i = 0; i < network_get_num_actions(); i++)
|
for (int32_t i = 0; i < network_get_num_actions(); i++)
|
||||||
{
|
{
|
||||||
if (i == w->selected_list_item)
|
if (i == w->selected_list_item)
|
||||||
{
|
{
|
||||||
gfx_filter_rect(
|
GfxFilterRect(
|
||||||
dpi, { 0, screenCoords.y, 800, screenCoords.y + SCROLLABLE_ROW_HEIGHT - 1 }, FilterPaletteID::PaletteDarken1);
|
dpi, { 0, screenCoords.y, 800, screenCoords.y + SCROLLABLE_ROW_HEIGHT - 1 }, FilterPaletteID::PaletteDarken1);
|
||||||
}
|
}
|
||||||
if (screenCoords.y > dpi->y + dpi->height)
|
if (screenCoords.y > dpi->y + dpi->height)
|
||||||
|
|
|
@ -455,7 +455,7 @@ public:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
gfx_clear(&dpi, ColourMapA[colours[1]].mid_light);
|
GfxClear(&dpi, ColourMapA[colours[1]].mid_light);
|
||||||
|
|
||||||
ScreenCoordsXY coords{ 1, 1 };
|
ScreenCoordsXY coords{ 1, 1 };
|
||||||
RideSelection* listItem = _windowNewRideListItems;
|
RideSelection* listItem = _windowNewRideListItems;
|
||||||
|
@ -466,7 +466,7 @@ public:
|
||||||
if (new_ride.SelectedRide == *listItem)
|
if (new_ride.SelectedRide == *listItem)
|
||||||
buttonFlags |= INSET_RECT_FLAG_BORDER_INSET;
|
buttonFlags |= INSET_RECT_FLAG_BORDER_INSET;
|
||||||
if (new_ride.HighlightedRide == *listItem || buttonFlags != 0)
|
if (new_ride.HighlightedRide == *listItem || buttonFlags != 0)
|
||||||
gfx_fill_rect_inset(
|
GfxFillRectInset(
|
||||||
&dpi, { coords, coords + ScreenCoordsXY{ 115, 115 } }, colours[1],
|
&dpi, { coords, coords + ScreenCoordsXY{ 115, 115 } }, colours[1],
|
||||||
INSET_RECT_FLAG_FILL_MID_LIGHT | buttonFlags);
|
INSET_RECT_FLAG_FILL_MID_LIGHT | buttonFlags);
|
||||||
|
|
||||||
|
|
|
@ -190,7 +190,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
// Background
|
// Background
|
||||||
gfx_fill_rect_inset(
|
GfxFillRectInset(
|
||||||
&dpi, { -1, y, 383, y + itemHeight - 1 }, colours[1],
|
&dpi, { -1, y, 383, y + itemHeight - 1 }, colours[1],
|
||||||
(INSET_RECT_FLAG_BORDER_INSET | INSET_RECT_FLAG_FILL_GREY));
|
(INSET_RECT_FLAG_BORDER_INSET | INSET_RECT_FLAG_FILL_GREY));
|
||||||
|
|
||||||
|
@ -221,7 +221,7 @@ public:
|
||||||
press = INSET_RECT_FLAG_BORDER_INSET;
|
press = INSET_RECT_FLAG_BORDER_INSET;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
gfx_fill_rect_inset(&dpi, { screenCoords, screenCoords + ScreenCoordsXY{ 23, 23 } }, colours[2], press);
|
GfxFillRectInset(&dpi, { screenCoords, screenCoords + ScreenCoordsXY{ 23, 23 } }, colours[2], press);
|
||||||
|
|
||||||
switch (newsItem.Type)
|
switch (newsItem.Type)
|
||||||
{
|
{
|
||||||
|
@ -232,7 +232,7 @@ public:
|
||||||
case News::ItemType::PeepOnRide:
|
case News::ItemType::PeepOnRide:
|
||||||
{
|
{
|
||||||
rct_drawpixelinfo cliped_dpi;
|
rct_drawpixelinfo cliped_dpi;
|
||||||
if (!clip_drawpixelinfo(&cliped_dpi, &dpi, screenCoords + ScreenCoordsXY{ 1, 1 }, 22, 22))
|
if (!ClipDrawPixelInfo(&cliped_dpi, &dpi, screenCoords + ScreenCoordsXY{ 1, 1 }, 22, 22))
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -298,7 +298,7 @@ public:
|
||||||
if (i == _pressedNewsItemIndex && _pressedButtonIndex == 2)
|
if (i == _pressedNewsItemIndex && _pressedButtonIndex == 2)
|
||||||
press = 0x20;
|
press = 0x20;
|
||||||
}
|
}
|
||||||
gfx_fill_rect_inset(&dpi, { screenCoords, screenCoords + ScreenCoordsXY{ 23, 23 } }, colours[2], press);
|
GfxFillRectInset(&dpi, { screenCoords, screenCoords + ScreenCoordsXY{ 23, 23 } }, colours[2], press);
|
||||||
gfx_draw_sprite(&dpi, ImageId(SPR_LOCATE), screenCoords);
|
gfx_draw_sprite(&dpi, ImageId(SPR_LOCATE), screenCoords);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -502,7 +502,7 @@ public:
|
||||||
void OnScrollDraw(const int32_t scrollIndex, rct_drawpixelinfo& dpi) override
|
void OnScrollDraw(const int32_t scrollIndex, rct_drawpixelinfo& dpi) override
|
||||||
{
|
{
|
||||||
auto dpiCoords = ScreenCoordsXY{ dpi.x, dpi.y };
|
auto dpiCoords = ScreenCoordsXY{ dpi.x, dpi.y };
|
||||||
gfx_fill_rect(
|
GfxFillRect(
|
||||||
&dpi, { dpiCoords, dpiCoords + ScreenCoordsXY{ dpi.width - 1, dpi.height - 1 } }, ColourMapA[colours[1]].mid_light);
|
&dpi, { dpiCoords, dpiCoords + ScreenCoordsXY{ dpi.width - 1, dpi.height - 1 } }, ColourMapA[colours[1]].mid_light);
|
||||||
const int32_t listWidth = widgets[WIDX_SCROLL].width();
|
const int32_t listWidth = widgets[WIDX_SCROLL].width();
|
||||||
|
|
||||||
|
@ -520,11 +520,11 @@ public:
|
||||||
{ listWidth, screenCoords.y + SCROLLABLE_ROW_HEIGHT - 1 } };
|
{ listWidth, screenCoords.y + SCROLLABLE_ROW_HEIGHT - 1 } };
|
||||||
// If hovering over item, change the color and fill the backdrop.
|
// If hovering over item, change the color and fill the backdrop.
|
||||||
if (i == selected_list_item)
|
if (i == selected_list_item)
|
||||||
gfx_fill_rect(&dpi, screenRect, ColourMapA[colours[1]].darker);
|
GfxFillRect(&dpi, screenRect, ColourMapA[colours[1]].darker);
|
||||||
else if (i == _highlightedIndex)
|
else if (i == _highlightedIndex)
|
||||||
gfx_fill_rect(&dpi, screenRect, ColourMapA[colours[1]].mid_dark);
|
GfxFillRect(&dpi, screenRect, ColourMapA[colours[1]].mid_dark);
|
||||||
else if ((i & 1) != 0) // odd / even check
|
else if ((i & 1) != 0) // odd / even check
|
||||||
gfx_fill_rect(&dpi, screenRect, ColourMapA[colours[1]].light);
|
GfxFillRect(&dpi, screenRect, ColourMapA[colours[1]].light);
|
||||||
|
|
||||||
// Draw the actual object entry's name...
|
// Draw the actual object entry's name...
|
||||||
screenCoords.x = NAME_COL_LEFT - 3;
|
screenCoords.x = NAME_COL_LEFT - 3;
|
||||||
|
|
|
@ -791,7 +791,7 @@ private:
|
||||||
case WIDX_SCALE_UP:
|
case WIDX_SCALE_UP:
|
||||||
gConfigGeneral.WindowScale += 0.25f;
|
gConfigGeneral.WindowScale += 0.25f;
|
||||||
ConfigSaveDefault();
|
ConfigSaveDefault();
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
ContextTriggerResize();
|
ContextTriggerResize();
|
||||||
ContextUpdateCursorScale();
|
ContextUpdateCursorScale();
|
||||||
break;
|
break;
|
||||||
|
@ -799,7 +799,7 @@ private:
|
||||||
gConfigGeneral.WindowScale -= 0.25f;
|
gConfigGeneral.WindowScale -= 0.25f;
|
||||||
gConfigGeneral.WindowScale = std::max(0.5f, gConfigGeneral.WindowScale);
|
gConfigGeneral.WindowScale = std::max(0.5f, gConfigGeneral.WindowScale);
|
||||||
ConfigSaveDefault();
|
ConfigSaveDefault();
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
ContextTriggerResize();
|
ContextTriggerResize();
|
||||||
ContextUpdateCursorScale();
|
ContextUpdateCursorScale();
|
||||||
break;
|
break;
|
||||||
|
@ -824,7 +824,7 @@ private:
|
||||||
ContextSetFullscreenMode(static_cast<int32_t>(OpenRCT2::Ui::FULLSCREEN_MODE::FULLSCREEN));
|
ContextSetFullscreenMode(static_cast<int32_t>(OpenRCT2::Ui::FULLSCREEN_MODE::FULLSCREEN));
|
||||||
|
|
||||||
ConfigSaveDefault();
|
ConfigSaveDefault();
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -835,7 +835,7 @@ private:
|
||||||
|
|
||||||
gConfigGeneral.FullscreenMode = static_cast<uint8_t>(dropdownIndex);
|
gConfigGeneral.FullscreenMode = static_cast<uint8_t>(dropdownIndex);
|
||||||
ConfigSaveDefault();
|
ConfigSaveDefault();
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case WIDX_DRAWING_ENGINE_DROPDOWN:
|
case WIDX_DRAWING_ENGINE_DROPDOWN:
|
||||||
|
@ -927,13 +927,13 @@ private:
|
||||||
case WIDX_TILE_SMOOTHING_CHECKBOX:
|
case WIDX_TILE_SMOOTHING_CHECKBOX:
|
||||||
gConfigGeneral.LandscapeSmoothing ^= 1;
|
gConfigGeneral.LandscapeSmoothing ^= 1;
|
||||||
ConfigSaveDefault();
|
ConfigSaveDefault();
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
break;
|
break;
|
||||||
case WIDX_GRIDLINES_CHECKBOX:
|
case WIDX_GRIDLINES_CHECKBOX:
|
||||||
{
|
{
|
||||||
gConfigGeneral.AlwaysShowGridlines ^= 1;
|
gConfigGeneral.AlwaysShowGridlines ^= 1;
|
||||||
ConfigSaveDefault();
|
ConfigSaveDefault();
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
rct_window* mainWindow = window_get_main();
|
rct_window* mainWindow = window_get_main();
|
||||||
if (mainWindow != nullptr)
|
if (mainWindow != nullptr)
|
||||||
{
|
{
|
||||||
|
@ -975,7 +975,7 @@ private:
|
||||||
gConfigGeneral.RenderWeatherGloom = gConfigGeneral.RenderWeatherEffects;
|
gConfigGeneral.RenderWeatherGloom = gConfigGeneral.RenderWeatherEffects;
|
||||||
ConfigSaveDefault();
|
ConfigSaveDefault();
|
||||||
Invalidate();
|
Invalidate();
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
break;
|
break;
|
||||||
case WIDX_SHOW_GUEST_PURCHASES_CHECKBOX:
|
case WIDX_SHOW_GUEST_PURCHASES_CHECKBOX:
|
||||||
gConfigGeneral.ShowGuestPurchases ^= 1;
|
gConfigGeneral.ShowGuestPurchases ^= 1;
|
||||||
|
@ -1195,7 +1195,7 @@ private:
|
||||||
gConfigGeneral.CurrencyFormat = static_cast<CurrencyType>(dropdownIndex);
|
gConfigGeneral.CurrencyFormat = static_cast<CurrencyType>(dropdownIndex);
|
||||||
}
|
}
|
||||||
ConfigSaveDefault();
|
ConfigSaveDefault();
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
break;
|
break;
|
||||||
case WIDX_DISTANCE_DROPDOWN:
|
case WIDX_DISTANCE_DROPDOWN:
|
||||||
gConfigGeneral.MeasurementFormat = static_cast<MeasurementFormat>(dropdownIndex);
|
gConfigGeneral.MeasurementFormat = static_cast<MeasurementFormat>(dropdownIndex);
|
||||||
|
@ -1207,7 +1207,7 @@ private:
|
||||||
{
|
{
|
||||||
gConfigGeneral.TemperatureFormat = static_cast<TemperatureUnit>(dropdownIndex);
|
gConfigGeneral.TemperatureFormat = static_cast<TemperatureUnit>(dropdownIndex);
|
||||||
ConfigSaveDefault();
|
ConfigSaveDefault();
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case WIDX_LANGUAGE_DROPDOWN:
|
case WIDX_LANGUAGE_DROPDOWN:
|
||||||
|
@ -1231,7 +1231,7 @@ private:
|
||||||
{
|
{
|
||||||
gConfigGeneral.Language = dropdownIndex + 1;
|
gConfigGeneral.Language = dropdownIndex + 1;
|
||||||
ConfigSaveDefault();
|
ConfigSaveDefault();
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1241,7 +1241,7 @@ private:
|
||||||
{
|
{
|
||||||
gConfigGeneral.DateFormat = static_cast<uint8_t>(dropdownIndex);
|
gConfigGeneral.DateFormat = static_cast<uint8_t>(dropdownIndex);
|
||||||
ConfigSaveDefault();
|
ConfigSaveDefault();
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1871,7 +1871,7 @@ private:
|
||||||
case WIDX_DEBUGGING_TOOLS:
|
case WIDX_DEBUGGING_TOOLS:
|
||||||
gConfigGeneral.DebuggingTools ^= 1;
|
gConfigGeneral.DebuggingTools ^= 1;
|
||||||
ConfigSaveDefault();
|
ConfigSaveDefault();
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
break;
|
break;
|
||||||
case WIDX_SAVE_PLUGIN_DATA_CHECKBOX:
|
case WIDX_SAVE_PLUGIN_DATA_CHECKBOX:
|
||||||
gConfigGeneral.SavePluginData ^= 1;
|
gConfigGeneral.SavePluginData ^= 1;
|
||||||
|
@ -2114,7 +2114,7 @@ private:
|
||||||
void UpdateHeightMarkers()
|
void UpdateHeightMarkers()
|
||||||
{
|
{
|
||||||
ConfigSaveDefault();
|
ConfigSaveDefault();
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t GetScrollPercentage(const Widget& widget, const rct_scroll& scroll)
|
uint8_t GetScrollPercentage(const Widget& widget, const rct_scroll& scroll)
|
||||||
|
|
|
@ -699,7 +699,7 @@ private:
|
||||||
DrawTextBasic(&dpi, screenPos + ScreenCoordsXY{ widget->left + 3, widget->top + 2 }, STR_PARK_RATING_LABEL, ft);
|
DrawTextBasic(&dpi, screenPos + ScreenCoordsXY{ widget->left + 3, widget->top + 2 }, STR_PARK_RATING_LABEL, ft);
|
||||||
|
|
||||||
// Graph border
|
// Graph border
|
||||||
gfx_fill_rect_inset(
|
GfxFillRectInset(
|
||||||
&dpi,
|
&dpi,
|
||||||
{ screenPos + ScreenCoordsXY{ widget->left + 4, widget->top + 15 },
|
{ screenPos + ScreenCoordsXY{ widget->left + 4, widget->top + 15 },
|
||||||
screenPos + ScreenCoordsXY{ widget->right - 4, widget->bottom - 4 } },
|
screenPos + ScreenCoordsXY{ widget->right - 4, widget->bottom - 4 } },
|
||||||
|
@ -715,7 +715,7 @@ private:
|
||||||
DrawTextBasic(
|
DrawTextBasic(
|
||||||
&dpi, screenPos + ScreenCoordsXY{ 10, 0 }, STR_GRAPH_AXIS_LABEL, ft,
|
&dpi, screenPos + ScreenCoordsXY{ 10, 0 }, STR_GRAPH_AXIS_LABEL, ft,
|
||||||
{ FontStyle::Small, TextAlignment::RIGHT });
|
{ FontStyle::Small, TextAlignment::RIGHT });
|
||||||
gfx_fill_rect_inset(
|
GfxFillRectInset(
|
||||||
&dpi, { screenPos + ScreenCoordsXY{ 15, 5 }, screenPos + ScreenCoordsXY{ width - 32, 5 } }, colours[2],
|
&dpi, { screenPos + ScreenCoordsXY{ 15, 5 }, screenPos + ScreenCoordsXY{ width - 32, 5 } }, colours[2],
|
||||||
INSET_RECT_FLAG_BORDER_INSET);
|
INSET_RECT_FLAG_BORDER_INSET);
|
||||||
screenPos.y += 20;
|
screenPos.y += 20;
|
||||||
|
@ -772,7 +772,7 @@ private:
|
||||||
DrawTextBasic(&dpi, screenPos + ScreenCoordsXY{ widget->left + 3, widget->top + 2 }, STR_GUESTS_IN_PARK_LABEL, ft);
|
DrawTextBasic(&dpi, screenPos + ScreenCoordsXY{ widget->left + 3, widget->top + 2 }, STR_GUESTS_IN_PARK_LABEL, ft);
|
||||||
|
|
||||||
// Graph border
|
// Graph border
|
||||||
gfx_fill_rect_inset(
|
GfxFillRectInset(
|
||||||
&dpi,
|
&dpi,
|
||||||
{ screenPos + ScreenCoordsXY{ widget->left + 4, widget->top + 15 },
|
{ screenPos + ScreenCoordsXY{ widget->left + 4, widget->top + 15 },
|
||||||
screenPos + ScreenCoordsXY{ widget->right - 4, widget->bottom - 4 } },
|
screenPos + ScreenCoordsXY{ widget->right - 4, widget->bottom - 4 } },
|
||||||
|
@ -788,7 +788,7 @@ private:
|
||||||
DrawTextBasic(
|
DrawTextBasic(
|
||||||
&dpi, screenPos + ScreenCoordsXY{ 10, 0 }, STR_GRAPH_AXIS_LABEL, ft,
|
&dpi, screenPos + ScreenCoordsXY{ 10, 0 }, STR_GRAPH_AXIS_LABEL, ft,
|
||||||
{ FontStyle::Small, TextAlignment::RIGHT });
|
{ FontStyle::Small, TextAlignment::RIGHT });
|
||||||
gfx_fill_rect_inset(
|
GfxFillRectInset(
|
||||||
&dpi, { screenPos + ScreenCoordsXY{ 15, 5 }, screenPos + ScreenCoordsXY{ width - 32, 5 } }, colours[2],
|
&dpi, { screenPos + ScreenCoordsXY{ 15, 5 }, screenPos + ScreenCoordsXY{ width - 32, 5 } }, colours[2],
|
||||||
INSET_RECT_FLAG_BORDER_INSET);
|
INSET_RECT_FLAG_BORDER_INSET);
|
||||||
screenPos.y += 20;
|
screenPos.y += 20;
|
||||||
|
|
|
@ -191,7 +191,7 @@ public:
|
||||||
{
|
{
|
||||||
hide_gridlines();
|
hide_gridlines();
|
||||||
ClearPatrolAreaToRender();
|
ClearPatrolAreaToRender();
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnToolDown(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override
|
void OnToolDown(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override
|
||||||
|
@ -240,7 +240,7 @@ private:
|
||||||
if (PatrolAreaToolIsActive())
|
if (PatrolAreaToolIsActive())
|
||||||
{
|
{
|
||||||
SetPatrolAreaToRender(_staffId);
|
SetPatrolAreaToRender(_staffId);
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -249,7 +249,7 @@ private:
|
||||||
show_gridlines();
|
show_gridlines();
|
||||||
input_set_flag(INPUT_FLAG_6, true);
|
input_set_flag(INPUT_FLAG_6, true);
|
||||||
SetPatrolAreaToRender(_staffId);
|
SetPatrolAreaToRender(_staffId);
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -937,7 +937,7 @@ static void WindowRideDrawTabVehicle(rct_drawpixelinfo* dpi, rct_window* w)
|
||||||
screenCoords += w->windowPos;
|
screenCoords += w->windowPos;
|
||||||
|
|
||||||
rct_drawpixelinfo clipDPI;
|
rct_drawpixelinfo clipDPI;
|
||||||
if (!clip_drawpixelinfo(&clipDPI, dpi, screenCoords, width, height))
|
if (!ClipDrawPixelInfo(&clipDPI, dpi, screenCoords, width, height))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -2952,7 +2952,7 @@ static void WindowRideVehicleScrollpaint(rct_window* w, rct_drawpixelinfo* dpi,
|
||||||
rct_ride_entry* rideEntry = ride->GetRideEntry();
|
rct_ride_entry* rideEntry = ride->GetRideEntry();
|
||||||
|
|
||||||
// Background
|
// Background
|
||||||
gfx_fill_rect(dpi, { { dpi->x, dpi->y }, { dpi->x + dpi->width, dpi->y + dpi->height } }, PALETTE_INDEX_12);
|
GfxFillRect(dpi, { { dpi->x, dpi->y }, { dpi->x + dpi->width, dpi->y + dpi->height } }, PALETTE_INDEX_12);
|
||||||
|
|
||||||
Widget* widget = &window_ride_vehicle_widgets[WIDX_VEHICLE_TRAINS_PREVIEW];
|
Widget* widget = &window_ride_vehicle_widgets[WIDX_VEHICLE_TRAINS_PREVIEW];
|
||||||
int32_t startX = std::max(2, (widget->width() - ((ride->NumTrains - 1) * 36)) / 2 - 25);
|
int32_t startX = std::max(2, (widget->width() - ((ride->NumTrains - 1) * 36)) / 2 - 25);
|
||||||
|
@ -3712,7 +3712,7 @@ static void WindowRideOperatingPaint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Horizontal rule between mode settings and depart settings
|
// Horizontal rule between mode settings and depart settings
|
||||||
gfx_fill_rect_inset(
|
GfxFillRectInset(
|
||||||
dpi,
|
dpi,
|
||||||
{ w->windowPos + ScreenCoordsXY{ window_ride_operating_widgets[WIDX_PAGE_BACKGROUND].left + 4, 103 },
|
{ w->windowPos + ScreenCoordsXY{ window_ride_operating_widgets[WIDX_PAGE_BACKGROUND].left + 4, 103 },
|
||||||
w->windowPos + ScreenCoordsXY{ window_ride_operating_widgets[WIDX_PAGE_BACKGROUND].right - 5, 104 } },
|
w->windowPos + ScreenCoordsXY{ window_ride_operating_widgets[WIDX_PAGE_BACKGROUND].right - 5, 104 } },
|
||||||
|
@ -3767,7 +3767,7 @@ static void WindowRideLocateMechanic(rct_window* w)
|
||||||
static void WindowRideMaintenanceDrawBar(
|
static void WindowRideMaintenanceDrawBar(
|
||||||
rct_window* w, rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, int32_t value, int32_t colour)
|
rct_window* w, rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, int32_t value, int32_t colour)
|
||||||
{
|
{
|
||||||
gfx_fill_rect_inset(dpi, { coords, coords + ScreenCoordsXY{ 149, 8 } }, w->colours[1], INSET_RECT_F_30);
|
GfxFillRectInset(dpi, { coords, coords + ScreenCoordsXY{ 149, 8 } }, w->colours[1], INSET_RECT_F_30);
|
||||||
if (colour & BAR_BLINK)
|
if (colour & BAR_BLINK)
|
||||||
{
|
{
|
||||||
colour &= ~BAR_BLINK;
|
colour &= ~BAR_BLINK;
|
||||||
|
@ -3778,7 +3778,7 @@ static void WindowRideMaintenanceDrawBar(
|
||||||
value = ((186 * ((value * 2) & 0xFF)) >> 8) & 0xFF;
|
value = ((186 * ((value * 2) & 0xFF)) >> 8) & 0xFF;
|
||||||
if (value > 2)
|
if (value > 2)
|
||||||
{
|
{
|
||||||
gfx_fill_rect_inset(dpi, { coords + ScreenCoordsXY{ 2, 1 }, coords + ScreenCoordsXY{ value + 1, 7 } }, colour, 0);
|
GfxFillRectInset(dpi, { coords + ScreenCoordsXY{ 2, 1 }, coords + ScreenCoordsXY{ value + 1, 7 } }, colour, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4873,7 +4873,7 @@ static void WindowRideColourPaint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||||
// Track / shop item preview
|
// Track / shop item preview
|
||||||
const auto& trackPreviewWidget = window_ride_colour_widgets[WIDX_TRACK_PREVIEW];
|
const auto& trackPreviewWidget = window_ride_colour_widgets[WIDX_TRACK_PREVIEW];
|
||||||
if (trackPreviewWidget.type != WindowWidgetType::Empty)
|
if (trackPreviewWidget.type != WindowWidgetType::Empty)
|
||||||
gfx_fill_rect(
|
GfxFillRect(
|
||||||
dpi,
|
dpi,
|
||||||
{ { w->windowPos + ScreenCoordsXY{ trackPreviewWidget.left + 1, trackPreviewWidget.top + 1 } },
|
{ { w->windowPos + ScreenCoordsXY{ trackPreviewWidget.left + 1, trackPreviewWidget.top + 1 } },
|
||||||
{ w->windowPos + ScreenCoordsXY{ trackPreviewWidget.right - 1, trackPreviewWidget.bottom - 1 } } },
|
{ w->windowPos + ScreenCoordsXY{ trackPreviewWidget.right - 1, trackPreviewWidget.bottom - 1 } } },
|
||||||
|
@ -4943,12 +4943,12 @@ static void WindowRideColourPaint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||||
const auto& entrancePreviewWidget = w->widgets[WIDX_ENTRANCE_PREVIEW];
|
const auto& entrancePreviewWidget = w->widgets[WIDX_ENTRANCE_PREVIEW];
|
||||||
if (entrancePreviewWidget.type != WindowWidgetType::Empty)
|
if (entrancePreviewWidget.type != WindowWidgetType::Empty)
|
||||||
{
|
{
|
||||||
if (clip_drawpixelinfo(
|
if (ClipDrawPixelInfo(
|
||||||
&clippedDpi, dpi,
|
&clippedDpi, dpi,
|
||||||
w->windowPos + ScreenCoordsXY{ entrancePreviewWidget.left + 1, entrancePreviewWidget.top + 1 },
|
w->windowPos + ScreenCoordsXY{ entrancePreviewWidget.left + 1, entrancePreviewWidget.top + 1 },
|
||||||
entrancePreviewWidget.width(), entrancePreviewWidget.height()))
|
entrancePreviewWidget.width(), entrancePreviewWidget.height()))
|
||||||
{
|
{
|
||||||
gfx_clear(&clippedDpi, PALETTE_INDEX_12);
|
GfxClear(&clippedDpi, PALETTE_INDEX_12);
|
||||||
|
|
||||||
auto stationObj = ride->GetStationObject();
|
auto stationObj = ride->GetStationObject();
|
||||||
if (stationObj != nullptr && stationObj->BaseImageId != ImageIndexUndefined)
|
if (stationObj != nullptr && stationObj->BaseImageId != ImageIndexUndefined)
|
||||||
|
@ -4992,7 +4992,7 @@ static void WindowRideColourScrollpaint(rct_window* w, rct_drawpixelinfo* dpi, i
|
||||||
auto vehicleColour = ride_get_vehicle_colour(*ride, w->vehicleIndex);
|
auto vehicleColour = ride_get_vehicle_colour(*ride, w->vehicleIndex);
|
||||||
|
|
||||||
// Background colour
|
// Background colour
|
||||||
gfx_fill_rect(dpi, { { dpi->x, dpi->y }, { dpi->x + dpi->width - 1, dpi->y + dpi->height - 1 } }, PALETTE_INDEX_12);
|
GfxFillRect(dpi, { { dpi->x, dpi->y }, { dpi->x + dpi->width - 1, dpi->y + dpi->height - 1 } }, PALETTE_INDEX_12);
|
||||||
|
|
||||||
// ?
|
// ?
|
||||||
auto screenCoords = ScreenCoordsXY{ vehiclePreviewWidget->width() / 2, vehiclePreviewWidget->height() - 15 };
|
auto screenCoords = ScreenCoordsXY{ vehiclePreviewWidget->width() / 2, vehiclePreviewWidget->height() - 15 };
|
||||||
|
@ -5273,7 +5273,7 @@ static void CancelScenerySelection()
|
||||||
main_w->viewport->flags &= ~(VIEWPORT_FLAG_HIDE_VERTICAL | VIEWPORT_FLAG_HIDE_BASE);
|
main_w->viewport->flags &= ~(VIEWPORT_FLAG_HIDE_VERTICAL | VIEWPORT_FLAG_HIDE_BASE);
|
||||||
}
|
}
|
||||||
|
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
tool_cancel();
|
tool_cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5305,7 +5305,7 @@ static void SetupScenerySelection(rct_window* w)
|
||||||
w_main->viewport->flags |= (VIEWPORT_FLAG_HIDE_VERTICAL | VIEWPORT_FLAG_HIDE_BASE);
|
w_main->viewport->flags |= (VIEWPORT_FLAG_HIDE_VERTICAL | VIEWPORT_FLAG_HIDE_BASE);
|
||||||
}
|
}
|
||||||
|
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -5344,7 +5344,7 @@ static void TrackDesignCallback(int32_t result, [[maybe_unused]] const utf8* pat
|
||||||
{
|
{
|
||||||
track_repository_scan();
|
track_repository_scan();
|
||||||
}
|
}
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -5635,7 +5635,7 @@ static void WindowRideMeasurementsPaint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||||
|
|
||||||
widgetCoords.x = w->windowPos.x + 4;
|
widgetCoords.x = w->windowPos.x + 4;
|
||||||
widgetCoords.y = w->windowPos.y + window_ride_measurements_widgets[WIDX_SELECT_NEARBY_SCENERY].bottom + 17;
|
widgetCoords.y = w->windowPos.y + window_ride_measurements_widgets[WIDX_SELECT_NEARBY_SCENERY].bottom + 17;
|
||||||
gfx_fill_rect_inset(
|
GfxFillRectInset(
|
||||||
dpi, { widgetCoords, { w->windowPos.x + 312, widgetCoords.y + 1 } }, w->colours[1], INSET_RECT_FLAG_BORDER_INSET);
|
dpi, { widgetCoords, { w->windowPos.x + 312, widgetCoords.y + 1 } }, w->colours[1], INSET_RECT_FLAG_BORDER_INSET);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -5684,7 +5684,7 @@ static void WindowRideMeasurementsPaint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||||
screenCoords.y += 2 * LIST_ROW_HEIGHT;
|
screenCoords.y += 2 * LIST_ROW_HEIGHT;
|
||||||
|
|
||||||
// Horizontal rule
|
// Horizontal rule
|
||||||
gfx_fill_rect_inset(
|
GfxFillRectInset(
|
||||||
dpi, { screenCoords - ScreenCoordsXY{ 0, 6 }, screenCoords + ScreenCoordsXY{ 303, -5 } }, w->colours[1],
|
dpi, { screenCoords - ScreenCoordsXY{ 0, 6 }, screenCoords + ScreenCoordsXY{ 303, -5 } }, w->colours[1],
|
||||||
INSET_RECT_FLAG_BORDER_INSET);
|
INSET_RECT_FLAG_BORDER_INSET);
|
||||||
|
|
||||||
|
@ -6120,7 +6120,7 @@ static void WindowRideGraphsPaint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||||
*/
|
*/
|
||||||
static void WindowRideGraphsScrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t scrollIndex)
|
static void WindowRideGraphsScrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t scrollIndex)
|
||||||
{
|
{
|
||||||
gfx_clear(dpi, ColourMapA[COLOUR_SATURATED_GREEN].darker);
|
GfxClear(dpi, ColourMapA[COLOUR_SATURATED_GREEN].darker);
|
||||||
|
|
||||||
auto widget = &window_ride_graphs_widgets[WIDX_GRAPH];
|
auto widget = &window_ride_graphs_widgets[WIDX_GRAPH];
|
||||||
auto ride = get_ride(w->rideId);
|
auto ride = get_ride(w->rideId);
|
||||||
|
@ -6151,11 +6151,11 @@ static void WindowRideGraphsScrollpaint(rct_window* w, rct_drawpixelinfo* dpi, i
|
||||||
{
|
{
|
||||||
auto coord1 = ScreenCoordsXY{ x, dpi->y };
|
auto coord1 = ScreenCoordsXY{ x, dpi->y };
|
||||||
auto coord2 = ScreenCoordsXY{ x, dpi->y + dpi->height - 1 };
|
auto coord2 = ScreenCoordsXY{ x, dpi->y + dpi->height - 1 };
|
||||||
gfx_fill_rect(dpi, { coord1, coord2 }, lightColour);
|
GfxFillRect(dpi, { coord1, coord2 }, lightColour);
|
||||||
gfx_fill_rect(dpi, { coord1 + ScreenCoordsXY{ 16, 0 }, coord2 + ScreenCoordsXY{ 16, 0 } }, darkColour);
|
GfxFillRect(dpi, { coord1 + ScreenCoordsXY{ 16, 0 }, coord2 + ScreenCoordsXY{ 16, 0 } }, darkColour);
|
||||||
gfx_fill_rect(dpi, { coord1 + ScreenCoordsXY{ 32, 0 }, coord2 + ScreenCoordsXY{ 32, 0 } }, darkColour);
|
GfxFillRect(dpi, { coord1 + ScreenCoordsXY{ 32, 0 }, coord2 + ScreenCoordsXY{ 32, 0 } }, darkColour);
|
||||||
gfx_fill_rect(dpi, { coord1 + ScreenCoordsXY{ 48, 0 }, coord2 + ScreenCoordsXY{ 48, 0 } }, darkColour);
|
GfxFillRect(dpi, { coord1 + ScreenCoordsXY{ 48, 0 }, coord2 + ScreenCoordsXY{ 48, 0 } }, darkColour);
|
||||||
gfx_fill_rect(dpi, { coord1 + ScreenCoordsXY{ 64, 0 }, coord2 + ScreenCoordsXY{ 64, 0 } }, darkColour);
|
GfxFillRect(dpi, { coord1 + ScreenCoordsXY{ 64, 0 }, coord2 + ScreenCoordsXY{ 64, 0 } }, darkColour);
|
||||||
}
|
}
|
||||||
time += 5;
|
time += 5;
|
||||||
}
|
}
|
||||||
|
@ -6177,7 +6177,7 @@ static void WindowRideGraphsScrollpaint(rct_window* w, rct_drawpixelinfo* dpi, i
|
||||||
{
|
{
|
||||||
// Minor / major line
|
// Minor / major line
|
||||||
int32_t colour = yUnit == 0 ? lightColour : darkColour;
|
int32_t colour = yUnit == 0 ? lightColour : darkColour;
|
||||||
gfx_fill_rect(dpi, { { dpi->x, y }, { dpi->x + dpi->width - 1, y } }, colour);
|
GfxFillRect(dpi, { { dpi->x, y }, { dpi->x + dpi->width - 1, y } }, colour);
|
||||||
|
|
||||||
int16_t scaled_yUnit = yUnit;
|
int16_t scaled_yUnit = yUnit;
|
||||||
// Scale modifier
|
// Scale modifier
|
||||||
|
@ -6260,8 +6260,7 @@ static void WindowRideGraphsScrollpaint(rct_window* w, rct_drawpixelinfo* dpi, i
|
||||||
const bool previousMeasurement = x > measurement->current_item;
|
const bool previousMeasurement = x > measurement->current_item;
|
||||||
|
|
||||||
// Draw the current line in grey.
|
// Draw the current line in grey.
|
||||||
gfx_fill_rect(
|
GfxFillRect(dpi, { { x, firstPoint }, { x, secondPoint } }, previousMeasurement ? PALETTE_INDEX_17 : PALETTE_INDEX_21);
|
||||||
dpi, { { x, firstPoint }, { x, secondPoint } }, previousMeasurement ? PALETTE_INDEX_17 : PALETTE_INDEX_21);
|
|
||||||
|
|
||||||
// Draw red over extreme values (if supported by graph type).
|
// Draw red over extreme values (if supported by graph type).
|
||||||
if (listType == GRAPH_VERTICAL || listType == GRAPH_LATERAL)
|
if (listType == GRAPH_VERTICAL || listType == GRAPH_LATERAL)
|
||||||
|
@ -6273,7 +6272,7 @@ static void WindowRideGraphsScrollpaint(rct_window* w, rct_drawpixelinfo* dpi, i
|
||||||
{
|
{
|
||||||
const auto redLineTop = ScreenCoordsXY{ x, std::max(firstPoint, intensityThresholdNegative) };
|
const auto redLineTop = ScreenCoordsXY{ x, std::max(firstPoint, intensityThresholdNegative) };
|
||||||
const auto redLineBottom = ScreenCoordsXY{ x, std::max(secondPoint, intensityThresholdNegative) };
|
const auto redLineBottom = ScreenCoordsXY{ x, std::max(secondPoint, intensityThresholdNegative) };
|
||||||
gfx_fill_rect(dpi, { redLineTop, redLineBottom }, redLineColour);
|
GfxFillRect(dpi, { redLineTop, redLineBottom }, redLineColour);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Line exceeds positive threshold (at top of graph).
|
// Line exceeds positive threshold (at top of graph).
|
||||||
|
@ -6281,7 +6280,7 @@ static void WindowRideGraphsScrollpaint(rct_window* w, rct_drawpixelinfo* dpi, i
|
||||||
{
|
{
|
||||||
const auto redLineTop = ScreenCoordsXY{ x, std::min(firstPoint, intensityThresholdPositive) };
|
const auto redLineTop = ScreenCoordsXY{ x, std::min(firstPoint, intensityThresholdPositive) };
|
||||||
const auto redLineBottom = ScreenCoordsXY{ x, std::min(secondPoint, intensityThresholdPositive) };
|
const auto redLineBottom = ScreenCoordsXY{ x, std::min(secondPoint, intensityThresholdPositive) };
|
||||||
gfx_fill_rect(dpi, { redLineTop, redLineBottom }, redLineColour);
|
GfxFillRect(dpi, { redLineTop, redLineBottom }, redLineColour);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1505,7 +1505,7 @@ public:
|
||||||
auto screenCoords = ScreenCoordsXY{ windowPos.x + widget->left + 1, windowPos.y + widget->top + 1 };
|
auto screenCoords = ScreenCoordsXY{ windowPos.x + widget->left + 1, windowPos.y + widget->top + 1 };
|
||||||
widgetWidth = widget->width() - 1;
|
widgetWidth = widget->width() - 1;
|
||||||
widgetHeight = widget->height() - 1;
|
widgetHeight = widget->height() - 1;
|
||||||
if (clip_drawpixelinfo(&clipdpi, &dpi, screenCoords, widgetWidth, widgetHeight))
|
if (ClipDrawPixelInfo(&clipdpi, &dpi, screenCoords, widgetWidth, widgetHeight))
|
||||||
{
|
{
|
||||||
DrawTrackPiece(&clipdpi, rideIndex, trackType, trackDirection, liftHillAndInvertedState, widgetWidth, widgetHeight);
|
DrawTrackPiece(&clipdpi, rideIndex, trackType, trackDirection, liftHillAndInvertedState, widgetWidth, widgetHeight);
|
||||||
}
|
}
|
||||||
|
|
|
@ -526,8 +526,7 @@ public:
|
||||||
void OnScrollDraw(int32_t scrollIndex, rct_drawpixelinfo& dpi) override
|
void OnScrollDraw(int32_t scrollIndex, rct_drawpixelinfo& dpi) override
|
||||||
{
|
{
|
||||||
auto dpiCoords = ScreenCoordsXY{ dpi.x, dpi.y };
|
auto dpiCoords = ScreenCoordsXY{ dpi.x, dpi.y };
|
||||||
gfx_fill_rect(
|
GfxFillRect(&dpi, { dpiCoords, dpiCoords + ScreenCoordsXY{ dpi.width, dpi.height } }, ColourMapA[colours[1]].mid_light);
|
||||||
&dpi, { dpiCoords, dpiCoords + ScreenCoordsXY{ dpi.width, dpi.height } }, ColourMapA[colours[1]].mid_light);
|
|
||||||
|
|
||||||
auto y = 0;
|
auto y = 0;
|
||||||
for (size_t i = 0; i < _rideList.size(); i++)
|
for (size_t i = 0; i < _rideList.size(); i++)
|
||||||
|
@ -536,7 +535,7 @@ public:
|
||||||
if (i == static_cast<size_t>(selected_list_item))
|
if (i == static_cast<size_t>(selected_list_item))
|
||||||
{
|
{
|
||||||
// Background highlight
|
// Background highlight
|
||||||
gfx_filter_rect(&dpi, { 0, y, 800, y + SCROLLABLE_ROW_HEIGHT - 1 }, FilterPaletteID::PaletteDarken1);
|
GfxFilterRect(&dpi, { 0, y, 800, y + SCROLLABLE_ROW_HEIGHT - 1 }, FilterPaletteID::PaletteDarken1);
|
||||||
format = (_quickDemolishMode ? STR_LIGHTPINK_STRINGID : STR_WINDOW_COLOUR_2_STRINGID);
|
format = (_quickDemolishMode ? STR_LIGHTPINK_STRINGID : STR_WINDOW_COLOUR_2_STRINGID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -555,7 +555,7 @@ static void WindowScenarioselectPaint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||||
static void WindowScenarioselectScrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t scrollIndex)
|
static void WindowScenarioselectScrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t scrollIndex)
|
||||||
{
|
{
|
||||||
uint8_t paletteIndex = ColourMapA[w->colours[1]].mid_light;
|
uint8_t paletteIndex = ColourMapA[w->colours[1]].mid_light;
|
||||||
gfx_clear(dpi, paletteIndex);
|
GfxClear(dpi, paletteIndex);
|
||||||
|
|
||||||
StringId highlighted_format = ScenarioSelectUseSmallFont() ? STR_WHITE_STRING : STR_WINDOW_COLOUR_2_STRINGID;
|
StringId highlighted_format = ScenarioSelectUseSmallFont() ? STR_WHITE_STRING : STR_WINDOW_COLOUR_2_STRINGID;
|
||||||
StringId unhighlighted_format = ScenarioSelectUseSmallFont() ? STR_WHITE_STRING : STR_BLACK_STRING;
|
StringId unhighlighted_format = ScenarioSelectUseSmallFont() ? STR_WHITE_STRING : STR_BLACK_STRING;
|
||||||
|
@ -593,7 +593,7 @@ static void WindowScenarioselectScrollpaint(rct_window* w, rct_drawpixelinfo* dp
|
||||||
bool isHighlighted = w->highlighted_scenario == scenario;
|
bool isHighlighted = w->highlighted_scenario == scenario;
|
||||||
if (isHighlighted)
|
if (isHighlighted)
|
||||||
{
|
{
|
||||||
gfx_filter_rect(dpi, { 0, y, w->width, y + scenarioItemHeight - 1 }, FilterPaletteID::PaletteDarken1);
|
GfxFilterRect(dpi, { 0, y, w->width, y + scenarioItemHeight - 1 }, FilterPaletteID::PaletteDarken1);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isCompleted = scenario->highscore != nullptr;
|
bool isCompleted = scenario->highscore != nullptr;
|
||||||
|
@ -668,21 +668,21 @@ static void DrawCategoryHeading(
|
||||||
int32_t lineY = y + 4;
|
int32_t lineY = y + 4;
|
||||||
auto lightLineLeftTop1 = ScreenCoordsXY{ left, lineY };
|
auto lightLineLeftTop1 = ScreenCoordsXY{ left, lineY };
|
||||||
auto lightLineRightBottom1 = ScreenCoordsXY{ strLeft, lineY };
|
auto lightLineRightBottom1 = ScreenCoordsXY{ strLeft, lineY };
|
||||||
gfx_draw_line(dpi, { lightLineLeftTop1, lightLineRightBottom1 }, lightColour);
|
GfxDrawLine(dpi, { lightLineLeftTop1, lightLineRightBottom1 }, lightColour);
|
||||||
|
|
||||||
auto lightLineLeftTop2 = ScreenCoordsXY{ strRight, lineY };
|
auto lightLineLeftTop2 = ScreenCoordsXY{ strRight, lineY };
|
||||||
auto lightLineRightBottom2 = ScreenCoordsXY{ right, lineY };
|
auto lightLineRightBottom2 = ScreenCoordsXY{ right, lineY };
|
||||||
gfx_draw_line(dpi, { lightLineLeftTop2, lightLineRightBottom2 }, lightColour);
|
GfxDrawLine(dpi, { lightLineLeftTop2, lightLineRightBottom2 }, lightColour);
|
||||||
|
|
||||||
// Draw dark horizontal rule
|
// Draw dark horizontal rule
|
||||||
lineY++;
|
lineY++;
|
||||||
auto darkLineLeftTop1 = ScreenCoordsXY{ left, lineY };
|
auto darkLineLeftTop1 = ScreenCoordsXY{ left, lineY };
|
||||||
auto darkLineRightBottom1 = ScreenCoordsXY{ strLeft, lineY };
|
auto darkLineRightBottom1 = ScreenCoordsXY{ strLeft, lineY };
|
||||||
gfx_draw_line(dpi, { darkLineLeftTop1, darkLineRightBottom1 }, darkColour);
|
GfxDrawLine(dpi, { darkLineLeftTop1, darkLineRightBottom1 }, darkColour);
|
||||||
|
|
||||||
auto darkLineLeftTop2 = ScreenCoordsXY{ strRight, lineY };
|
auto darkLineLeftTop2 = ScreenCoordsXY{ strRight, lineY };
|
||||||
auto darkLineRightBottom2 = ScreenCoordsXY{ right, lineY };
|
auto darkLineRightBottom2 = ScreenCoordsXY{ right, lineY };
|
||||||
gfx_draw_line(dpi, { darkLineLeftTop2, darkLineRightBottom2 }, darkColour);
|
GfxDrawLine(dpi, { darkLineLeftTop2, darkLineRightBottom2 }, darkColour);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void InitialiseListItems(rct_window* w)
|
static void InitialiseListItems(rct_window* w)
|
||||||
|
|
|
@ -1289,7 +1289,7 @@ private:
|
||||||
|
|
||||||
void ContentScrollDraw(rct_drawpixelinfo& dpi)
|
void ContentScrollDraw(rct_drawpixelinfo& dpi)
|
||||||
{
|
{
|
||||||
gfx_clear(&dpi, ColourMapA[colours[1]].mid_light);
|
GfxClear(&dpi, ColourMapA[colours[1]].mid_light);
|
||||||
|
|
||||||
auto numColumns = GetNumColumns();
|
auto numColumns = GetNumColumns();
|
||||||
auto tabIndex = _activeTabIndex;
|
auto tabIndex = _activeTabIndex;
|
||||||
|
@ -1309,7 +1309,7 @@ private:
|
||||||
{
|
{
|
||||||
if (_selectedScenery == currentSceneryGlobal)
|
if (_selectedScenery == currentSceneryGlobal)
|
||||||
{
|
{
|
||||||
gfx_fill_rect_inset(
|
GfxFillRectInset(
|
||||||
&dpi, { topLeft, topLeft + ScreenCoordsXY{ SCENERY_BUTTON_WIDTH - 1, SCENERY_BUTTON_HEIGHT - 1 } },
|
&dpi, { topLeft, topLeft + ScreenCoordsXY{ SCENERY_BUTTON_WIDTH - 1, SCENERY_BUTTON_HEIGHT - 1 } },
|
||||||
colours[1], INSET_RECT_FLAG_FILL_MID_LIGHT);
|
colours[1], INSET_RECT_FLAG_FILL_MID_LIGHT);
|
||||||
}
|
}
|
||||||
|
@ -1318,20 +1318,20 @@ private:
|
||||||
{
|
{
|
||||||
if (tabSelectedScenery == currentSceneryGlobal)
|
if (tabSelectedScenery == currentSceneryGlobal)
|
||||||
{
|
{
|
||||||
gfx_fill_rect_inset(
|
GfxFillRectInset(
|
||||||
&dpi, { topLeft, topLeft + ScreenCoordsXY{ SCENERY_BUTTON_WIDTH - 1, SCENERY_BUTTON_HEIGHT - 1 } },
|
&dpi, { topLeft, topLeft + ScreenCoordsXY{ SCENERY_BUTTON_WIDTH - 1, SCENERY_BUTTON_HEIGHT - 1 } },
|
||||||
colours[1], (INSET_RECT_FLAG_BORDER_INSET | INSET_RECT_FLAG_FILL_MID_LIGHT));
|
colours[1], (INSET_RECT_FLAG_BORDER_INSET | INSET_RECT_FLAG_FILL_MID_LIGHT));
|
||||||
}
|
}
|
||||||
else if (_selectedScenery == currentSceneryGlobal)
|
else if (_selectedScenery == currentSceneryGlobal)
|
||||||
{
|
{
|
||||||
gfx_fill_rect_inset(
|
GfxFillRectInset(
|
||||||
&dpi, { topLeft, topLeft + ScreenCoordsXY{ SCENERY_BUTTON_WIDTH - 1, SCENERY_BUTTON_HEIGHT - 1 } },
|
&dpi, { topLeft, topLeft + ScreenCoordsXY{ SCENERY_BUTTON_WIDTH - 1, SCENERY_BUTTON_HEIGHT - 1 } },
|
||||||
colours[1], INSET_RECT_FLAG_FILL_MID_LIGHT);
|
colours[1], INSET_RECT_FLAG_FILL_MID_LIGHT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rct_drawpixelinfo clipdpi;
|
rct_drawpixelinfo clipdpi;
|
||||||
if (clip_drawpixelinfo(
|
if (ClipDrawPixelInfo(
|
||||||
&clipdpi, &dpi, topLeft + ScreenCoordsXY{ 1, 1 }, SCENERY_BUTTON_WIDTH - 2, SCENERY_BUTTON_HEIGHT - 2))
|
&clipdpi, &dpi, topLeft + ScreenCoordsXY{ 1, 1 }, SCENERY_BUTTON_WIDTH - 2, SCENERY_BUTTON_HEIGHT - 2))
|
||||||
{
|
{
|
||||||
DrawSceneryItem(clipdpi, currentSceneryGlobal);
|
DrawSceneryItem(clipdpi, currentSceneryGlobal);
|
||||||
|
|
|
@ -397,7 +397,7 @@ static void WindowServerListPaint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||||
static void WindowServerListScrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t scrollIndex)
|
static void WindowServerListScrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t scrollIndex)
|
||||||
{
|
{
|
||||||
uint8_t paletteIndex = ColourMapA[w->colours[1]].mid_light;
|
uint8_t paletteIndex = ColourMapA[w->colours[1]].mid_light;
|
||||||
gfx_clear(dpi, paletteIndex);
|
GfxClear(dpi, paletteIndex);
|
||||||
|
|
||||||
auto& listWidget = w->widgets[WIDX_LIST];
|
auto& listWidget = w->widgets[WIDX_LIST];
|
||||||
int32_t width = listWidget.width();
|
int32_t width = listWidget.width();
|
||||||
|
@ -415,7 +415,7 @@ static void WindowServerListScrollpaint(rct_window* w, rct_drawpixelinfo* dpi, i
|
||||||
// Draw hover highlight
|
// Draw hover highlight
|
||||||
if (highlighted)
|
if (highlighted)
|
||||||
{
|
{
|
||||||
gfx_filter_rect(dpi, { 0, screenCoords.y, width, screenCoords.y + ITEM_HEIGHT }, FilterPaletteID::PaletteDarken1);
|
GfxFilterRect(dpi, { 0, screenCoords.y, width, screenCoords.y + ITEM_HEIGHT }, FilterPaletteID::PaletteDarken1);
|
||||||
_version = serverDetails.Version;
|
_version = serverDetails.Version;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -298,7 +298,7 @@ public:
|
||||||
void OnScrollDraw(int32_t scrollIndex, rct_drawpixelinfo& dpi) override
|
void OnScrollDraw(int32_t scrollIndex, rct_drawpixelinfo& dpi) override
|
||||||
{
|
{
|
||||||
auto dpiCoords = ScreenCoordsXY{ dpi.x, dpi.y };
|
auto dpiCoords = ScreenCoordsXY{ dpi.x, dpi.y };
|
||||||
gfx_fill_rect(
|
GfxFillRect(
|
||||||
&dpi, { dpiCoords, dpiCoords + ScreenCoordsXY{ dpi.width - 1, dpi.height - 1 } }, ColourMapA[colours[1]].mid_light);
|
&dpi, { dpiCoords, dpiCoords + ScreenCoordsXY{ dpi.width - 1, dpi.height - 1 } }, ColourMapA[colours[1]].mid_light);
|
||||||
|
|
||||||
// TODO: the line below is a workaround for what is presumably a bug with dpi->width
|
// TODO: the line below is a workaround for what is presumably a bug with dpi->width
|
||||||
|
@ -500,8 +500,8 @@ private:
|
||||||
void DrawSeparator(rct_drawpixelinfo& dpi, int32_t y, int32_t scrollWidth)
|
void DrawSeparator(rct_drawpixelinfo& dpi, int32_t y, int32_t scrollWidth)
|
||||||
{
|
{
|
||||||
const int32_t top = y + (SCROLLABLE_ROW_HEIGHT / 2) - 1;
|
const int32_t top = y + (SCROLLABLE_ROW_HEIGHT / 2) - 1;
|
||||||
gfx_fill_rect(&dpi, { { 0, top }, { scrollWidth, top } }, ColourMapA[colours[0]].mid_dark);
|
GfxFillRect(&dpi, { { 0, top }, { scrollWidth, top } }, ColourMapA[colours[0]].mid_dark);
|
||||||
gfx_fill_rect(&dpi, { { 0, top + 1 }, { scrollWidth, top + 1 } }, ColourMapA[colours[0]].lightest);
|
GfxFillRect(&dpi, { { 0, top + 1 }, { scrollWidth, top + 1 } }, ColourMapA[colours[0]].lightest);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawItem(
|
void DrawItem(
|
||||||
|
@ -511,7 +511,7 @@ private:
|
||||||
if (isHighlighted)
|
if (isHighlighted)
|
||||||
{
|
{
|
||||||
format = STR_WINDOW_COLOUR_2_STRINGID;
|
format = STR_WINDOW_COLOUR_2_STRINGID;
|
||||||
gfx_filter_rect(&dpi, { 0, y - 1, scrollWidth, y + (SCROLLABLE_ROW_HEIGHT - 2) }, FilterPaletteID::PaletteDarken1);
|
GfxFilterRect(&dpi, { 0, y - 1, scrollWidth, y + (SCROLLABLE_ROW_HEIGHT - 2) }, FilterPaletteID::PaletteDarken1);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto bindingOffset = (scrollWidth * 2) / 3;
|
auto bindingOffset = (scrollWidth * 2) / 3;
|
||||||
|
|
|
@ -554,7 +554,7 @@ private:
|
||||||
widgetHeight++;
|
widgetHeight++;
|
||||||
|
|
||||||
rct_drawpixelinfo clip_dpi;
|
rct_drawpixelinfo clip_dpi;
|
||||||
if (!clip_drawpixelinfo(&clip_dpi, dpi, screenCoords, widgetWidth, widgetHeight))
|
if (!ClipDrawPixelInfo(&clip_dpi, dpi, screenCoords, widgetWidth, widgetHeight))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -143,7 +143,7 @@ public:
|
||||||
{
|
{
|
||||||
show_gridlines();
|
show_gridlines();
|
||||||
SetPatrolAreaToRender(GetSelectedStaffType());
|
SetPatrolAreaToRender(GetSelectedStaffType());
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case WIDX_STAFF_LIST_MAP:
|
case WIDX_STAFF_LIST_MAP:
|
||||||
|
@ -370,7 +370,7 @@ public:
|
||||||
void OnScrollDraw(int32_t scrollIndex, rct_drawpixelinfo& dpi) override
|
void OnScrollDraw(int32_t scrollIndex, rct_drawpixelinfo& dpi) override
|
||||||
{
|
{
|
||||||
auto dpiCoords = ScreenCoordsXY{ dpi.x, dpi.y };
|
auto dpiCoords = ScreenCoordsXY{ dpi.x, dpi.y };
|
||||||
gfx_fill_rect(
|
GfxFillRect(
|
||||||
&dpi, { dpiCoords, dpiCoords + ScreenCoordsXY{ dpi.width - 1, dpi.height - 1 } }, ColourMapA[colours[1]].mid_light);
|
&dpi, { dpiCoords, dpiCoords + ScreenCoordsXY{ dpi.width - 1, dpi.height - 1 } }, ColourMapA[colours[1]].mid_light);
|
||||||
|
|
||||||
// How much space do we have for the name and action columns? (Discount scroll area and icons.)
|
// How much space do we have for the name and action columns? (Discount scroll area and icons.)
|
||||||
|
@ -399,7 +399,7 @@ public:
|
||||||
|
|
||||||
if (i == _highlightedIndex)
|
if (i == _highlightedIndex)
|
||||||
{
|
{
|
||||||
gfx_filter_rect(&dpi, { 0, y, 800, y + (SCROLLABLE_ROW_HEIGHT - 1) }, FilterPaletteID::PaletteDarken1);
|
GfxFilterRect(&dpi, { 0, y, 800, y + (SCROLLABLE_ROW_HEIGHT - 1) }, FilterPaletteID::PaletteDarken1);
|
||||||
format = (_quickFireMode ? STR_LIGHTPINK_STRINGID : STR_WINDOW_COLOUR_2_STRINGID);
|
format = (_quickFireMode ? STR_LIGHTPINK_STRINGID : STR_WINDOW_COLOUR_2_STRINGID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -473,7 +473,7 @@ public:
|
||||||
hide_gridlines();
|
hide_gridlines();
|
||||||
tool_cancel();
|
tool_cancel();
|
||||||
ClearPatrolAreaToRender();
|
ClearPatrolAreaToRender();
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -565,7 +565,7 @@ private:
|
||||||
auto widgetIndex = WIDX_STAFF_LIST_HANDYMEN_TAB + tabIndex;
|
auto widgetIndex = WIDX_STAFF_LIST_HANDYMEN_TAB + tabIndex;
|
||||||
const auto& widget = widgets[widgetIndex];
|
const auto& widget = widgets[widgetIndex];
|
||||||
rct_drawpixelinfo clippedDpi;
|
rct_drawpixelinfo clippedDpi;
|
||||||
if (clip_drawpixelinfo(
|
if (ClipDrawPixelInfo(
|
||||||
&clippedDpi, &dpi, windowPos + ScreenCoordsXY{ widget.left + 1, widget.top + 1 },
|
&clippedDpi, &dpi, windowPos + ScreenCoordsXY{ widget.left + 1, widget.top + 1 },
|
||||||
widget.right - widget.left - 1, widget.bottom - widget.top - 1))
|
widget.right - widget.left - 1, widget.bottom - widget.top - 1))
|
||||||
{
|
{
|
||||||
|
|
|
@ -225,7 +225,7 @@ public:
|
||||||
// +13 for cursor when max length.
|
// +13 for cursor when max length.
|
||||||
gfx_wrap_string(wrapped_string, WW - (24 + 13), FontStyle::Medium, &no_lines);
|
gfx_wrap_string(wrapped_string, WW - (24 + 13), FontStyle::Medium, &no_lines);
|
||||||
|
|
||||||
gfx_fill_rect_inset(
|
GfxFillRectInset(
|
||||||
&dpi, { { windowPos.x + 10, screenCoords.y }, { windowPos.x + WW - 10, screenCoords.y + 10 * (no_lines + 1) + 3 } },
|
&dpi, { { windowPos.x + 10, screenCoords.y }, { windowPos.x + WW - 10, screenCoords.y + 10 * (no_lines + 1) + 3 } },
|
||||||
colours[1], INSET_RECT_F_60);
|
colours[1], INSET_RECT_F_60);
|
||||||
|
|
||||||
|
@ -267,7 +267,7 @@ public:
|
||||||
{
|
{
|
||||||
uint8_t colour = ColourMapA[colours[1]].mid_light;
|
uint8_t colour = ColourMapA[colours[1]].mid_light;
|
||||||
// TODO: palette index addition
|
// TODO: palette index addition
|
||||||
gfx_fill_rect(
|
GfxFillRect(
|
||||||
&dpi, { { cursorX, screenCoords.y + 9 }, { cursorX + textWidth, screenCoords.y + 9 } }, colour + 5);
|
&dpi, { { cursorX, screenCoords.y + 9 }, { cursorX + textWidth, screenCoords.y + 9 } }, colour + 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -322,10 +322,10 @@ private:
|
||||||
int width = compositionWidth;
|
int width = compositionWidth;
|
||||||
int height = 10;
|
int height = 10;
|
||||||
|
|
||||||
gfx_fill_rect(
|
GfxFillRect(
|
||||||
&dpi, { screenCoords - ScreenCoordsXY{ 1, 1 }, screenCoords + ScreenCoordsXY{ width + 1, height + 1 } },
|
&dpi, { screenCoords - ScreenCoordsXY{ 1, 1 }, screenCoords + ScreenCoordsXY{ width + 1, height + 1 } },
|
||||||
PALETTE_INDEX_12);
|
PALETTE_INDEX_12);
|
||||||
gfx_fill_rect(&dpi, { screenCoords, screenCoords + ScreenCoordsXY{ width, height } }, PALETTE_INDEX_0);
|
GfxFillRect(&dpi, { screenCoords, screenCoords + ScreenCoordsXY{ width, height } }, PALETTE_INDEX_0);
|
||||||
gfx_draw_string(&dpi, screenCoords, static_cast<const char*>(gTextInput->ImeBuffer), { COLOUR_DARK_GREEN });
|
gfx_draw_string(&dpi, screenCoords, static_cast<const char*>(gTextInput->ImeBuffer), { COLOUR_DARK_GREEN });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -276,22 +276,22 @@ public:
|
||||||
if (width < min_width)
|
if (width < min_width)
|
||||||
{
|
{
|
||||||
width = min_width;
|
width = min_width;
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
}
|
}
|
||||||
if (height < min_height)
|
if (height < min_height)
|
||||||
{
|
{
|
||||||
height = min_height;
|
height = min_height;
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
}
|
}
|
||||||
if (width > max_width)
|
if (width > max_width)
|
||||||
{
|
{
|
||||||
width = max_width;
|
width = max_width;
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
}
|
}
|
||||||
if (height > max_height)
|
if (height > max_height)
|
||||||
{
|
{
|
||||||
height = max_height;
|
height = max_height;
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (_selected_tab == WINDOW_THEMES_TAB_FEATURES)
|
else if (_selected_tab == WINDOW_THEMES_TAB_FEATURES)
|
||||||
|
@ -304,22 +304,22 @@ public:
|
||||||
if (width < min_width)
|
if (width < min_width)
|
||||||
{
|
{
|
||||||
width = min_width;
|
width = min_width;
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
}
|
}
|
||||||
if (height < min_height)
|
if (height < min_height)
|
||||||
{
|
{
|
||||||
height = min_height;
|
height = min_height;
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
}
|
}
|
||||||
if (width > max_width)
|
if (width > max_width)
|
||||||
{
|
{
|
||||||
width = max_width;
|
width = max_width;
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
}
|
}
|
||||||
if (height > max_height)
|
if (height > max_height)
|
||||||
{
|
{
|
||||||
height = max_height;
|
height = max_height;
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -766,9 +766,9 @@ public:
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ((colours[1] & 0x80) == 0)
|
if ((colours[1] & 0x80) == 0)
|
||||||
// gfx_fill_rect(dpi, dpi->x, dpi->y, dpi->x + dpi->width - 1, dpi->y + dpi->height - 1,
|
// GfxFillRect(dpi, dpi->x, dpi->y, dpi->x + dpi->width - 1, dpi->y + dpi->height - 1,
|
||||||
// ColourMapA[colours[1]].mid_light);
|
// ColourMapA[colours[1]].mid_light);
|
||||||
gfx_clear(&dpi, ColourMapA[colours[1]].mid_light);
|
GfxClear(&dpi, ColourMapA[colours[1]].mid_light);
|
||||||
screenCoords.y = 0;
|
screenCoords.y = 0;
|
||||||
for (int32_t i = 0; i < GetColourSchemeTabCount(); i++)
|
for (int32_t i = 0; i < GetColourSchemeTabCount(); i++)
|
||||||
{
|
{
|
||||||
|
@ -791,16 +791,16 @@ public:
|
||||||
{
|
{
|
||||||
translucent_window_palette windowPalette = TranslucentWindowPalettes[BASE_COLOUR(colour)];
|
translucent_window_palette windowPalette = TranslucentWindowPalettes[BASE_COLOUR(colour)];
|
||||||
|
|
||||||
gfx_filter_rect(&dpi, { leftTop, rightBottom }, windowPalette.highlight);
|
GfxFilterRect(&dpi, { leftTop, rightBottom }, windowPalette.highlight);
|
||||||
gfx_filter_rect(&dpi, { leftTop + yPixelOffset, rightBottom + yPixelOffset }, windowPalette.shadow);
|
GfxFilterRect(&dpi, { leftTop + yPixelOffset, rightBottom + yPixelOffset }, windowPalette.shadow);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
colour = ColourMapA[colours[1]].mid_dark;
|
colour = ColourMapA[colours[1]].mid_dark;
|
||||||
gfx_fill_rect(&dpi, { leftTop, rightBottom }, colour);
|
GfxFillRect(&dpi, { leftTop, rightBottom }, colour);
|
||||||
|
|
||||||
colour = ColourMapA[colours[1]].lightest;
|
colour = ColourMapA[colours[1]].lightest;
|
||||||
gfx_fill_rect(&dpi, { leftTop + yPixelOffset, rightBottom + yPixelOffset }, colour);
|
GfxFillRect(&dpi, { leftTop + yPixelOffset, rightBottom + yPixelOffset }, colour);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -818,7 +818,7 @@ public:
|
||||||
|
|
||||||
ScreenCoordsXY topLeft{ _button_offset_x + 12 * j, screenCoords.y + _check_offset_y };
|
ScreenCoordsXY topLeft{ _button_offset_x + 12 * j, screenCoords.y + _check_offset_y };
|
||||||
ScreenCoordsXY bottomRight{ _button_offset_x + 12 * j + 9, screenCoords.y + _check_offset_y + 10 };
|
ScreenCoordsXY bottomRight{ _button_offset_x + 12 * j + 9, screenCoords.y + _check_offset_y + 10 };
|
||||||
gfx_fill_rect_inset(&dpi, { topLeft, bottomRight }, colours[1], INSET_RECT_F_E0);
|
GfxFillRectInset(&dpi, { topLeft, bottomRight }, colours[1], INSET_RECT_F_E0);
|
||||||
if (colour & COLOUR_FLAG_TRANSLUCENT)
|
if (colour & COLOUR_FLAG_TRANSLUCENT)
|
||||||
{
|
{
|
||||||
gfx_draw_string(
|
gfx_draw_string(
|
||||||
|
|
|
@ -1531,7 +1531,7 @@ public:
|
||||||
void OnScrollDraw(int32_t scrollIndex, rct_drawpixelinfo& dpi) override
|
void OnScrollDraw(int32_t scrollIndex, rct_drawpixelinfo& dpi) override
|
||||||
{
|
{
|
||||||
const int32_t listWidth = widgets[WIDX_LIST].width();
|
const int32_t listWidth = widgets[WIDX_LIST].width();
|
||||||
gfx_fill_rect(
|
GfxFillRect(
|
||||||
&dpi, { { dpi.x, dpi.y }, { dpi.x + dpi.width - 1, dpi.y + dpi.height - 1 } }, ColourMapA[colours[1]].mid_light);
|
&dpi, { { dpi.x, dpi.y }, { dpi.x + dpi.width - 1, dpi.y + dpi.height - 1 } }, ColourMapA[colours[1]].mid_light);
|
||||||
|
|
||||||
// Show usage hint when nothing is selected
|
// Show usage hint when nothing is selected
|
||||||
|
@ -1565,12 +1565,12 @@ public:
|
||||||
// Draw row background colour
|
// Draw row background colour
|
||||||
auto fillRectangle = ScreenRect{ { 0, screenCoords.y }, { listWidth, screenCoords.y + SCROLLABLE_ROW_HEIGHT - 1 } };
|
auto fillRectangle = ScreenRect{ { 0, screenCoords.y }, { listWidth, screenCoords.y + SCROLLABLE_ROW_HEIGHT - 1 } };
|
||||||
if (selectedRow)
|
if (selectedRow)
|
||||||
gfx_fill_rect(&dpi, fillRectangle, ColourMapA[colours[1]].mid_dark);
|
GfxFillRect(&dpi, fillRectangle, ColourMapA[colours[1]].mid_dark);
|
||||||
else if (hoveredRow)
|
else if (hoveredRow)
|
||||||
gfx_fill_rect(&dpi, fillRectangle, ColourMapA[colours[1]].mid_dark | 0x1000000);
|
GfxFillRect(&dpi, fillRectangle, ColourMapA[colours[1]].mid_dark | 0x1000000);
|
||||||
// Zebra stripes
|
// Zebra stripes
|
||||||
else if (((windowTileInspectorElementCount - i) & 1) == 0)
|
else if (((windowTileInspectorElementCount - i) & 1) == 0)
|
||||||
gfx_fill_rect(&dpi, fillRectangle, ColourMapA[colours[1]].light | 0x1000000);
|
GfxFillRect(&dpi, fillRectangle, ColourMapA[colours[1]].light | 0x1000000);
|
||||||
|
|
||||||
const StringId stringFormat = (selectedRow || hoveredRow) ? STR_WHITE_STRING : STR_WINDOW_COLOUR_2_STRINGID;
|
const StringId stringFormat = (selectedRow || hoveredRow) ? STR_WHITE_STRING : STR_WINDOW_COLOUR_2_STRINGID;
|
||||||
auto checkboxFormatter = Formatter();
|
auto checkboxFormatter = Formatter();
|
||||||
|
@ -1578,7 +1578,7 @@ public:
|
||||||
checkboxFormatter.Add<char*>(CheckBoxMarkString);
|
checkboxFormatter.Add<char*>(CheckBoxMarkString);
|
||||||
|
|
||||||
// Draw checkbox and check if visible
|
// Draw checkbox and check if visible
|
||||||
gfx_fill_rect_inset(&dpi, { { 2, screenCoords.y }, { 15, screenCoords.y + 11 } }, colours[1], INSET_RECT_F_E0);
|
GfxFillRectInset(&dpi, { { 2, screenCoords.y }, { 15, screenCoords.y + 11 } }, colours[1], INSET_RECT_F_E0);
|
||||||
if (!tileElement->IsInvisible())
|
if (!tileElement->IsInvisible())
|
||||||
{
|
{
|
||||||
auto eyeFormatter = Formatter();
|
auto eyeFormatter = Formatter();
|
||||||
|
|
|
@ -271,7 +271,7 @@ public:
|
||||||
|
|
||||||
void OnDraw(rct_drawpixelinfo& dpi) override
|
void OnDraw(rct_drawpixelinfo& dpi) override
|
||||||
{
|
{
|
||||||
gfx_filter_rect(&dpi, _filterRect, FilterPaletteID::Palette51);
|
GfxFilterRect(&dpi, _filterRect, FilterPaletteID::Palette51);
|
||||||
DrawWidgets(dpi);
|
DrawWidgets(dpi);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -81,20 +81,20 @@ public:
|
||||||
int32_t bottom = windowPos.y + height - 1;
|
int32_t bottom = windowPos.y + height - 1;
|
||||||
|
|
||||||
// Background
|
// Background
|
||||||
gfx_filter_rect(&dpi, { { left + 1, top + 1 }, { right - 1, bottom - 1 } }, FilterPaletteID::Palette45);
|
GfxFilterRect(&dpi, { { left + 1, top + 1 }, { right - 1, bottom - 1 } }, FilterPaletteID::Palette45);
|
||||||
gfx_filter_rect(&dpi, { { left + 1, top + 1 }, { right - 1, bottom - 1 } }, FilterPaletteID::PaletteGlassLightOrange);
|
GfxFilterRect(&dpi, { { left + 1, top + 1 }, { right - 1, bottom - 1 } }, FilterPaletteID::PaletteGlassLightOrange);
|
||||||
|
|
||||||
// Sides
|
// Sides
|
||||||
gfx_filter_rect(&dpi, { { left + 0, top + 2 }, { left + 0, bottom - 2 } }, FilterPaletteID::PaletteDarken3);
|
GfxFilterRect(&dpi, { { left + 0, top + 2 }, { left + 0, bottom - 2 } }, FilterPaletteID::PaletteDarken3);
|
||||||
gfx_filter_rect(&dpi, { { right + 0, top + 2 }, { right + 0, bottom - 2 } }, FilterPaletteID::PaletteDarken3);
|
GfxFilterRect(&dpi, { { right + 0, top + 2 }, { right + 0, bottom - 2 } }, FilterPaletteID::PaletteDarken3);
|
||||||
gfx_filter_rect(&dpi, { { left + 2, bottom + 0 }, { right - 2, bottom + 0 } }, FilterPaletteID::PaletteDarken3);
|
GfxFilterRect(&dpi, { { left + 2, bottom + 0 }, { right - 2, bottom + 0 } }, FilterPaletteID::PaletteDarken3);
|
||||||
gfx_filter_rect(&dpi, { { left + 2, top + 0 }, { right - 2, top + 0 } }, FilterPaletteID::PaletteDarken3);
|
GfxFilterRect(&dpi, { { left + 2, top + 0 }, { right - 2, top + 0 } }, FilterPaletteID::PaletteDarken3);
|
||||||
|
|
||||||
// Corners
|
// Corners
|
||||||
gfx_filter_pixel(&dpi, { left + 1, top + 1 }, FilterPaletteID::PaletteDarken3);
|
GfxFilterPixel(&dpi, { left + 1, top + 1 }, FilterPaletteID::PaletteDarken3);
|
||||||
gfx_filter_pixel(&dpi, { right - 1, top + 1 }, FilterPaletteID::PaletteDarken3);
|
GfxFilterPixel(&dpi, { right - 1, top + 1 }, FilterPaletteID::PaletteDarken3);
|
||||||
gfx_filter_pixel(&dpi, { left + 1, bottom - 1 }, FilterPaletteID::PaletteDarken3);
|
GfxFilterPixel(&dpi, { left + 1, bottom - 1 }, FilterPaletteID::PaletteDarken3);
|
||||||
gfx_filter_pixel(&dpi, { right - 1, bottom - 1 }, FilterPaletteID::PaletteDarken3);
|
GfxFilterPixel(&dpi, { right - 1, bottom - 1 }, FilterPaletteID::PaletteDarken3);
|
||||||
|
|
||||||
// Text
|
// Text
|
||||||
left = windowPos.x + ((width + 1) / 2) - 1;
|
left = windowPos.x + ((width + 1) / 2) - 1;
|
||||||
|
|
|
@ -292,7 +292,7 @@ public:
|
||||||
|
|
||||||
// Draw mini tile preview
|
// Draw mini tile preview
|
||||||
rct_drawpixelinfo clippedDpi;
|
rct_drawpixelinfo clippedDpi;
|
||||||
if (clip_drawpixelinfo(&clippedDpi, &dpi, this->windowPos + ScreenCoordsXY{ 4, 18 }, 168, 78))
|
if (ClipDrawPixelInfo(&clippedDpi, &dpi, this->windowPos + ScreenCoordsXY{ 4, 18 }, 168, 78))
|
||||||
{
|
{
|
||||||
rct_g1_element g1temp = {};
|
rct_g1_element g1temp = {};
|
||||||
g1temp.offset = _miniPreview.data();
|
g1temp.offset = _miniPreview.data();
|
||||||
|
|
|
@ -474,7 +474,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
auto screenPos = windowPos + ScreenCoordsXY{ tdWidget.left + 1, tdWidget.top + 1 };
|
auto screenPos = windowPos + ScreenCoordsXY{ tdWidget.left + 1, tdWidget.top + 1 };
|
||||||
gfx_fill_rect(&dpi, { screenPos, screenPos + ScreenCoordsXY{ 369, 216 } }, colour); // TODO Check dpi
|
GfxFillRect(&dpi, { screenPos, screenPos + ScreenCoordsXY{ 369, 216 } }, colour); // TODO Check dpi
|
||||||
|
|
||||||
if (_loadedTrackDesignIndex != trackIndex)
|
if (_loadedTrackDesignIndex != trackIndex)
|
||||||
{
|
{
|
||||||
|
@ -669,7 +669,7 @@ public:
|
||||||
void OnScrollDraw(const int32_t scrollIndex, rct_drawpixelinfo& dpi) override
|
void OnScrollDraw(const int32_t scrollIndex, rct_drawpixelinfo& dpi) override
|
||||||
{
|
{
|
||||||
uint8_t paletteIndex = ColourMapA[colours[0]].mid_light;
|
uint8_t paletteIndex = ColourMapA[colours[0]].mid_light;
|
||||||
gfx_clear(&dpi, paletteIndex);
|
GfxClear(&dpi, paletteIndex);
|
||||||
|
|
||||||
auto screenCoords = ScreenCoordsXY{ 0, 0 };
|
auto screenCoords = ScreenCoordsXY{ 0, 0 };
|
||||||
size_t listIndex = 0;
|
size_t listIndex = 0;
|
||||||
|
@ -689,7 +689,7 @@ public:
|
||||||
if (listIndex == static_cast<size_t>(selected_list_item))
|
if (listIndex == static_cast<size_t>(selected_list_item))
|
||||||
{
|
{
|
||||||
// Highlight
|
// Highlight
|
||||||
gfx_filter_rect(
|
GfxFilterRect(
|
||||||
&dpi, { screenCoords, { width, screenCoords.y + SCROLLABLE_ROW_HEIGHT - 1 } },
|
&dpi, { screenCoords, { width, screenCoords.y + SCROLLABLE_ROW_HEIGHT - 1 } },
|
||||||
FilterPaletteID::PaletteDarken1);
|
FilterPaletteID::PaletteDarken1);
|
||||||
stringId = STR_WINDOW_COLOUR_2_STRINGID;
|
stringId = STR_WINDOW_COLOUR_2_STRINGID;
|
||||||
|
@ -714,7 +714,7 @@ public:
|
||||||
if (listIndex == static_cast<size_t>(selected_list_item))
|
if (listIndex == static_cast<size_t>(selected_list_item))
|
||||||
{
|
{
|
||||||
// Highlight
|
// Highlight
|
||||||
gfx_filter_rect(
|
GfxFilterRect(
|
||||||
&dpi, { screenCoords, { width, screenCoords.y + SCROLLABLE_ROW_HEIGHT - 1 } },
|
&dpi, { screenCoords, { width, screenCoords.y + SCROLLABLE_ROW_HEIGHT - 1 } },
|
||||||
FilterPaletteID::PaletteDarken1);
|
FilterPaletteID::PaletteDarken1);
|
||||||
stringId = STR_WINDOW_COLOUR_2_STRINGID;
|
stringId = STR_WINDOW_COLOUR_2_STRINGID;
|
||||||
|
|
|
@ -123,7 +123,7 @@ public:
|
||||||
_previousClipSelectionB = gClipSelectionB;
|
_previousClipSelectionB = gClipSelectionB;
|
||||||
gClipSelectionA = { 0, 0 };
|
gClipSelectionA = { 0, 0 };
|
||||||
gClipSelectionB = { MAXIMUM_MAP_SIZE_BIG - 1, MAXIMUM_MAP_SIZE_BIG - 1 };
|
gClipSelectionB = { MAXIMUM_MAP_SIZE_BIG - 1, MAXIMUM_MAP_SIZE_BIG - 1 };
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
break;
|
break;
|
||||||
case WIDX_CLIP_CLEAR:
|
case WIDX_CLIP_CLEAR:
|
||||||
if (IsActive())
|
if (IsActive())
|
||||||
|
@ -133,7 +133,7 @@ public:
|
||||||
}
|
}
|
||||||
gClipSelectionA = { 0, 0 };
|
gClipSelectionA = { 0, 0 };
|
||||||
gClipSelectionB = { MAXIMUM_MAP_SIZE_BIG - 1, MAXIMUM_MAP_SIZE_BIG - 1 };
|
gClipSelectionB = { MAXIMUM_MAP_SIZE_BIG - 1, MAXIMUM_MAP_SIZE_BIG - 1 };
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -249,7 +249,7 @@ public:
|
||||||
gClipSelectionB = gMapSelectPositionB;
|
gClipSelectionB = gMapSelectPositionB;
|
||||||
_toolActive = false;
|
_toolActive = false;
|
||||||
tool_cancel();
|
tool_cancel();
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnPrepareDraw() override
|
void OnPrepareDraw() override
|
||||||
|
|
|
@ -113,7 +113,7 @@ namespace Editor
|
||||||
viewport_init_all();
|
viewport_init_all();
|
||||||
rct_window* mainWindow = OpenEditorWindows();
|
rct_window* mainWindow = OpenEditorWindows();
|
||||||
mainWindow->SetLocation(TileCoordsXYZ{ 75, 75, 14 }.ToCoordsXYZ());
|
mainWindow->SetLocation(TileCoordsXYZ{ 75, 75, 14 }.ToCoordsXYZ());
|
||||||
load_palette();
|
LoadPalette();
|
||||||
gScreenAge = 0;
|
gScreenAge = 0;
|
||||||
gScenarioName = language_get_string(STR_MY_NEW_SCENARIO);
|
gScenarioName = language_get_string(STR_MY_NEW_SCENARIO);
|
||||||
}
|
}
|
||||||
|
@ -172,7 +172,7 @@ namespace Editor
|
||||||
viewport_init_all();
|
viewport_init_all();
|
||||||
rct_window* mainWindow = OpenEditorWindows();
|
rct_window* mainWindow = OpenEditorWindows();
|
||||||
mainWindow->SetLocation(TileCoordsXYZ{ 75, 75, 14 }.ToCoordsXYZ());
|
mainWindow->SetLocation(TileCoordsXYZ{ 75, 75, 14 }.ToCoordsXYZ());
|
||||||
load_palette();
|
LoadPalette();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -193,7 +193,7 @@ namespace Editor
|
||||||
viewport_init_all();
|
viewport_init_all();
|
||||||
rct_window* mainWindow = OpenEditorWindows();
|
rct_window* mainWindow = OpenEditorWindows();
|
||||||
mainWindow->SetLocation(TileCoordsXYZ{ 75, 75, 14 }.ToCoordsXYZ());
|
mainWindow->SetLocation(TileCoordsXYZ{ 75, 75, 14 }.ToCoordsXYZ());
|
||||||
load_palette();
|
LoadPalette();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -423,7 +423,7 @@ namespace Editor
|
||||||
windowManager->BroadcastIntent(Intent(INTENT_ACTION_REFRESH_NEW_RIDES));
|
windowManager->BroadcastIntent(Intent(INTENT_ACTION_REFRESH_NEW_RIDES));
|
||||||
|
|
||||||
gWindowUpdateTicks = 0;
|
gWindowUpdateTicks = 0;
|
||||||
load_palette();
|
LoadPalette();
|
||||||
|
|
||||||
windowManager->BroadcastIntent(Intent(INTENT_ACTION_CLEAR_TILE_INSPECTOR_CLIPBOARD));
|
windowManager->BroadcastIntent(Intent(INTENT_ACTION_CLEAR_TILE_INSPECTOR_CLIPBOARD));
|
||||||
}
|
}
|
||||||
|
|
|
@ -448,7 +448,7 @@ static void ReplaceSelectedWaterPalette(const ObjectRepositoryItem* item)
|
||||||
auto newPaletteEntry = ObjectEntryDescriptor(*item);
|
auto newPaletteEntry = ObjectEntryDescriptor(*item);
|
||||||
if (objectManager.GetLoadedObject(newPaletteEntry) != nullptr || objectManager.LoadObject(newPaletteEntry) != nullptr)
|
if (objectManager.GetLoadedObject(newPaletteEntry) != nullptr || objectManager.LoadObject(newPaletteEntry) != nullptr)
|
||||||
{
|
{
|
||||||
load_palette();
|
LoadPalette();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -486,14 +486,14 @@ void finish_object_selection()
|
||||||
set_every_ride_type_invented();
|
set_every_ride_type_invented();
|
||||||
set_every_ride_entry_invented();
|
set_every_ride_entry_invented();
|
||||||
gEditorStep = EditorStep::RollercoasterDesigner;
|
gEditorStep = EditorStep::RollercoasterDesigner;
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
set_all_scenery_items_invented();
|
set_all_scenery_items_invented();
|
||||||
ScenerySetDefaultPlacementConfiguration();
|
ScenerySetDefaultPlacementConfiguration();
|
||||||
gEditorStep = EditorStep::LandscapeEditor;
|
gEditorStep = EditorStep::LandscapeEditor;
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -491,7 +491,7 @@ void game_load_init()
|
||||||
|
|
||||||
gWindowUpdateTicks = 0;
|
gWindowUpdateTicks = 0;
|
||||||
|
|
||||||
load_palette();
|
LoadPalette();
|
||||||
|
|
||||||
if (!gOpenRCT2Headless)
|
if (!gOpenRCT2Headless)
|
||||||
{
|
{
|
||||||
|
|
|
@ -84,7 +84,7 @@ void GameState::InitAll(const TileCoordsXY& mapSize)
|
||||||
auto intent = Intent(INTENT_ACTION_CLEAR_TILE_INSPECTOR_CLIPBOARD);
|
auto intent = Intent(INTENT_ACTION_CLEAR_TILE_INSPECTOR_CLIPBOARD);
|
||||||
ContextBroadcastIntent(&intent);
|
ContextBroadcastIntent(&intent);
|
||||||
|
|
||||||
load_palette();
|
LoadPalette();
|
||||||
|
|
||||||
CheatsReset();
|
CheatsReset();
|
||||||
ClearRestrictedScenery();
|
ClearRestrictedScenery();
|
||||||
|
|
|
@ -54,7 +54,7 @@ void intro_update()
|
||||||
gIntroState = IntroState::PublisherBegin;
|
gIntroState = IntroState::PublisherBegin;
|
||||||
[[fallthrough]];
|
[[fallthrough]];
|
||||||
case IntroState::PublisherBegin:
|
case IntroState::PublisherBegin:
|
||||||
load_palette();
|
LoadPalette();
|
||||||
|
|
||||||
// Set the Y for the Infogrames logo
|
// Set the Y for the Infogrames logo
|
||||||
_introStateCounter = -580;
|
_introStateCounter = -580;
|
||||||
|
@ -160,7 +160,7 @@ void intro_update()
|
||||||
break;
|
break;
|
||||||
case IntroState::Finish:
|
case IntroState::Finish:
|
||||||
gIntroState = IntroState::None;
|
gIntroState = IntroState::None;
|
||||||
load_palette();
|
LoadPalette();
|
||||||
OpenRCT2::Audio::PlayTitleMusic();
|
OpenRCT2::Audio::PlayTitleMusic();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -178,13 +178,13 @@ void intro_draw(rct_drawpixelinfo* dpi)
|
||||||
case IntroState::Disclaimer2:
|
case IntroState::Disclaimer2:
|
||||||
break;
|
break;
|
||||||
case IntroState::PublisherBegin:
|
case IntroState::PublisherBegin:
|
||||||
gfx_clear(dpi, BACKROUND_COLOUR_DARK);
|
GfxClear(dpi, BACKROUND_COLOUR_DARK);
|
||||||
break;
|
break;
|
||||||
case IntroState::PublisherScroll:
|
case IntroState::PublisherScroll:
|
||||||
gfx_clear(dpi, BACKROUND_COLOUR_DARK);
|
GfxClear(dpi, BACKROUND_COLOUR_DARK);
|
||||||
|
|
||||||
// Draw a white rectangle for the logo background (gives a bit of white margin)
|
// Draw a white rectangle for the logo background (gives a bit of white margin)
|
||||||
gfx_fill_rect(
|
GfxFillRect(
|
||||||
dpi,
|
dpi,
|
||||||
{ { (screenWidth / 2) - 320 + 50, _introStateCounter + 50 },
|
{ { (screenWidth / 2) - 320 + 50, _introStateCounter + 50 },
|
||||||
{ (screenWidth / 2) - 320 + 50 + 540, _introStateCounter + 50 + 425 } },
|
{ (screenWidth / 2) - 320 + 50 + 540, _introStateCounter + 50 + 425 } },
|
||||||
|
@ -197,11 +197,11 @@ void intro_draw(rct_drawpixelinfo* dpi)
|
||||||
gfx_draw_sprite(dpi, ImageId(SPR_INTRO_INFOGRAMES_11), { (screenWidth / 2) - 320 + 319, _introStateCounter + 319 });
|
gfx_draw_sprite(dpi, ImageId(SPR_INTRO_INFOGRAMES_11), { (screenWidth / 2) - 320 + 319, _introStateCounter + 319 });
|
||||||
break;
|
break;
|
||||||
case IntroState::DeveloperBegin:
|
case IntroState::DeveloperBegin:
|
||||||
gfx_clear(dpi, BACKROUND_COLOUR_DARK);
|
GfxClear(dpi, BACKROUND_COLOUR_DARK);
|
||||||
gfx_transpose_palette(PALETTE_G1_IDX_DEVELOPER, 255);
|
GfxTransposePalette(PALETTE_G1_IDX_DEVELOPER, 255);
|
||||||
break;
|
break;
|
||||||
case IntroState::DeveloperScroll:
|
case IntroState::DeveloperScroll:
|
||||||
gfx_clear(dpi, BACKROUND_COLOUR_DARK);
|
GfxClear(dpi, BACKROUND_COLOUR_DARK);
|
||||||
|
|
||||||
// Draw Chris Sawyer logo
|
// Draw Chris Sawyer logo
|
||||||
gfx_draw_sprite(dpi, ImageId(SPR_INTRO_CHRIS_SAWYER_00), { (screenWidth / 2) - 320 + 70, _introStateCounter });
|
gfx_draw_sprite(dpi, ImageId(SPR_INTRO_CHRIS_SAWYER_00), { (screenWidth / 2) - 320 + 70, _introStateCounter });
|
||||||
|
@ -210,11 +210,11 @@ void intro_draw(rct_drawpixelinfo* dpi)
|
||||||
case IntroState::LogoFadeIn:
|
case IntroState::LogoFadeIn:
|
||||||
if (_introStateCounter <= 0xFF00)
|
if (_introStateCounter <= 0xFF00)
|
||||||
{
|
{
|
||||||
gfx_transpose_palette(PALETTE_G1_IDX_LOGO, (_introStateCounter >> 8) & 0xFF);
|
GfxTransposePalette(PALETTE_G1_IDX_LOGO, (_introStateCounter >> 8) & 0xFF);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gfx_transpose_palette(PALETTE_G1_IDX_LOGO, 255);
|
GfxTransposePalette(PALETTE_G1_IDX_LOGO, 255);
|
||||||
}
|
}
|
||||||
screen_intro_draw_logo(dpi);
|
screen_intro_draw_logo(dpi);
|
||||||
break;
|
break;
|
||||||
|
@ -224,16 +224,16 @@ void intro_draw(rct_drawpixelinfo* dpi)
|
||||||
case IntroState::LogoFadeOut:
|
case IntroState::LogoFadeOut:
|
||||||
if (_introStateCounter >= 0)
|
if (_introStateCounter >= 0)
|
||||||
{
|
{
|
||||||
gfx_transpose_palette(PALETTE_G1_IDX_LOGO, (_introStateCounter >> 8) & 0xFF);
|
GfxTransposePalette(PALETTE_G1_IDX_LOGO, (_introStateCounter >> 8) & 0xFF);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gfx_transpose_palette(PALETTE_G1_IDX_LOGO, 0);
|
GfxTransposePalette(PALETTE_G1_IDX_LOGO, 0);
|
||||||
}
|
}
|
||||||
screen_intro_draw_logo(dpi);
|
screen_intro_draw_logo(dpi);
|
||||||
break;
|
break;
|
||||||
case IntroState::Clear:
|
case IntroState::Clear:
|
||||||
gfx_clear(dpi, BACKROUND_COLOUR_DARK);
|
GfxClear(dpi, BACKROUND_COLOUR_DARK);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -293,7 +293,7 @@ static void screen_intro_draw_logo(rct_drawpixelinfo* dpi)
|
||||||
drawing_engine_invalidate_image(SPR_INTRO_LOGO_11);
|
drawing_engine_invalidate_image(SPR_INTRO_LOGO_11);
|
||||||
drawing_engine_invalidate_image(SPR_INTRO_LOGO_21);
|
drawing_engine_invalidate_image(SPR_INTRO_LOGO_21);
|
||||||
|
|
||||||
gfx_clear(dpi, BACKROUND_COLOUR_LOGO);
|
GfxClear(dpi, BACKROUND_COLOUR_LOGO);
|
||||||
gfx_draw_sprite(dpi, ImageId(SPR_INTRO_LOGO_00), { imageX + 0, 0 });
|
gfx_draw_sprite(dpi, ImageId(SPR_INTRO_LOGO_00), { imageX + 0, 0 });
|
||||||
gfx_draw_sprite(dpi, ImageId(SPR_INTRO_LOGO_10), { imageX + 220, 0 });
|
gfx_draw_sprite(dpi, ImageId(SPR_INTRO_LOGO_10), { imageX + 220, 0 });
|
||||||
gfx_draw_sprite(dpi, ImageId(SPR_INTRO_LOGO_20), { imageX + 440, 0 });
|
gfx_draw_sprite(dpi, ImageId(SPR_INTRO_LOGO_20), { imageX + 440, 0 });
|
||||||
|
|
|
@ -69,7 +69,7 @@ GameActions::Result BannerSetNameAction::Execute() const
|
||||||
ContextBroadcastIntent(&intent);
|
ContextBroadcastIntent(&intent);
|
||||||
|
|
||||||
scrolling_text_invalidate();
|
scrolling_text_invalidate();
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
|
|
||||||
return GameActions::Result();
|
return GameActions::Result();
|
||||||
}
|
}
|
||||||
|
|
|
@ -378,7 +378,7 @@ void CheatSetAction::SetGrassLength(int32_t length) const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CheatSetAction::WaterPlants() const
|
void CheatSetAction::WaterPlants() const
|
||||||
|
@ -394,7 +394,7 @@ void CheatSetAction::WaterPlants() const
|
||||||
}
|
}
|
||||||
} while (TileElementIteratorNext(&it));
|
} while (TileElementIteratorNext(&it));
|
||||||
|
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CheatSetAction::FixVandalism() const
|
void CheatSetAction::FixVandalism() const
|
||||||
|
@ -413,7 +413,7 @@ void CheatSetAction::FixVandalism() const
|
||||||
it.element->AsPath()->SetIsBroken(false);
|
it.element->AsPath()->SetIsBroken(false);
|
||||||
} while (TileElementIteratorNext(&it));
|
} while (TileElementIteratorNext(&it));
|
||||||
|
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CheatSetAction::RemoveLitter() const
|
void CheatSetAction::RemoveLitter() const
|
||||||
|
@ -440,7 +440,7 @@ void CheatSetAction::RemoveLitter() const
|
||||||
|
|
||||||
} while (TileElementIteratorNext(&it));
|
} while (TileElementIteratorNext(&it));
|
||||||
|
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CheatSetAction::FixBrokenRides() const
|
void CheatSetAction::FixBrokenRides() const
|
||||||
|
@ -674,7 +674,7 @@ void CheatSetAction::RemoveAllGuests() const
|
||||||
}
|
}
|
||||||
|
|
||||||
window_invalidate_by_class(WindowClass::Ride);
|
window_invalidate_by_class(WindowClass::Ride);
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CheatSetAction::SetStaffSpeed(uint8_t value) const
|
void CheatSetAction::SetStaffSpeed(uint8_t value) const
|
||||||
|
|
|
@ -45,7 +45,7 @@ GameActions::Result ClimateSetAction::Execute() const
|
||||||
{
|
{
|
||||||
gClimate = ClimateType{ _climate };
|
gClimate = ClimateType{ _climate };
|
||||||
|
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
|
|
||||||
return GameActions::Result();
|
return GameActions::Result();
|
||||||
}
|
}
|
||||||
|
|
|
@ -94,7 +94,7 @@ GameActions::Result GuestSetNameAction::Execute() const
|
||||||
// Easter egg functions are for guests only
|
// Easter egg functions are for guests only
|
||||||
guest->HandleEasterEggName();
|
guest->HandleEasterEggName();
|
||||||
|
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
|
|
||||||
auto intent = Intent(INTENT_ACTION_REFRESH_GUEST_LIST);
|
auto intent = Intent(INTENT_ACTION_REFRESH_GUEST_LIST);
|
||||||
ContextBroadcastIntent(&intent);
|
ContextBroadcastIntent(&intent);
|
||||||
|
|
|
@ -72,7 +72,7 @@ GameActions::Result MapChangeSizeAction::Execute() const
|
||||||
ParkCalculateSize();
|
ParkCalculateSize();
|
||||||
|
|
||||||
windowManager->BroadcastIntent(Intent(INTENT_ACTION_MAP));
|
windowManager->BroadcastIntent(Intent(INTENT_ACTION_MAP));
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
return GameActions::Result();
|
return GameActions::Result();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,7 @@ GameActions::Result ParkSetNameAction::Execute() const
|
||||||
{
|
{
|
||||||
park.Name = _name;
|
park.Name = _name;
|
||||||
scrolling_text_invalidate();
|
scrolling_text_invalidate();
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
}
|
}
|
||||||
return GameActions::Result();
|
return GameActions::Result();
|
||||||
}
|
}
|
||||||
|
|
|
@ -169,7 +169,7 @@ GameActions::Result RideDemolishAction::DemolishRide(Ride& ride) const
|
||||||
windowManager->BroadcastIntent(Intent(INTENT_ACTION_REFRESH_GUEST_LIST));
|
windowManager->BroadcastIntent(Intent(INTENT_ACTION_REFRESH_GUEST_LIST));
|
||||||
|
|
||||||
scrolling_text_invalidate();
|
scrolling_text_invalidate();
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
|
@ -102,15 +102,15 @@ GameActions::Result RideSetAppearanceAction::Execute() const
|
||||||
{
|
{
|
||||||
case RideSetAppearanceType::TrackColourMain:
|
case RideSetAppearanceType::TrackColourMain:
|
||||||
ride->track_colour[_index].main = _value;
|
ride->track_colour[_index].main = _value;
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
break;
|
break;
|
||||||
case RideSetAppearanceType::TrackColourAdditional:
|
case RideSetAppearanceType::TrackColourAdditional:
|
||||||
ride->track_colour[_index].additional = _value;
|
ride->track_colour[_index].additional = _value;
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
break;
|
break;
|
||||||
case RideSetAppearanceType::TrackColourSupports:
|
case RideSetAppearanceType::TrackColourSupports:
|
||||||
ride->track_colour[_index].supports = _value;
|
ride->track_colour[_index].supports = _value;
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
break;
|
break;
|
||||||
case RideSetAppearanceType::VehicleColourBody:
|
case RideSetAppearanceType::VehicleColourBody:
|
||||||
ride->vehicle_colours[_index].Body = _value;
|
ride->vehicle_colours[_index].Body = _value;
|
||||||
|
@ -136,7 +136,7 @@ GameActions::Result RideSetAppearanceAction::Execute() const
|
||||||
break;
|
break;
|
||||||
case RideSetAppearanceType::EntranceStyle:
|
case RideSetAppearanceType::EntranceStyle:
|
||||||
ride->entrance_style = _value;
|
ride->entrance_style = _value;
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
break;
|
break;
|
||||||
case RideSetAppearanceType::SellingItemColourIsRandom:
|
case RideSetAppearanceType::SellingItemColourIsRandom:
|
||||||
ride->SetLifecycleFlag(RIDE_LIFECYCLE_RANDOM_SHOP_COLOURS, static_cast<bool>(_value));
|
ride->SetLifecycleFlag(RIDE_LIFECYCLE_RANDOM_SHOP_COLOURS, static_cast<bool>(_value));
|
||||||
|
|
|
@ -82,7 +82,7 @@ GameActions::Result RideSetNameAction::Execute() const
|
||||||
}
|
}
|
||||||
|
|
||||||
scrolling_text_invalidate();
|
scrolling_text_invalidate();
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
|
|
||||||
// Refresh windows that display ride name
|
// Refresh windows that display ride name
|
||||||
auto windowManager = OpenRCT2::GetContext()->GetUiContext()->GetWindowManager();
|
auto windowManager = OpenRCT2::GetContext()->GetUiContext()->GetWindowManager();
|
||||||
|
|
|
@ -226,7 +226,7 @@ GameActions::Result RideSetSettingAction::Execute() const
|
||||||
case RideSetSetting::RideType:
|
case RideSetSetting::RideType:
|
||||||
ride->type = _value;
|
ride->type = _value;
|
||||||
ride->UpdateRideTypeForAllPieces();
|
ride->UpdateRideTypeForAllPieces();
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -204,7 +204,7 @@ GameActions::Result RideSetVehicleAction::Execute() const
|
||||||
intent.putExtra(INTENT_EXTRA_RIDE_ID, _rideIndex.ToUnderlying());
|
intent.putExtra(INTENT_EXTRA_RIDE_ID, _rideIndex.ToUnderlying());
|
||||||
ContextBroadcastIntent(&intent);
|
ContextBroadcastIntent(&intent);
|
||||||
|
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -88,6 +88,6 @@ GameActions::Result SignSetNameAction::Execute() const
|
||||||
}
|
}
|
||||||
|
|
||||||
scrolling_text_invalidate();
|
scrolling_text_invalidate();
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
return GameActions::Result();
|
return GameActions::Result();
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,6 +63,6 @@ GameActions::Result StaffFireAction::Execute() const
|
||||||
window_close_by_class(WindowClass::FirePrompt);
|
window_close_by_class(WindowClass::FirePrompt);
|
||||||
peep_sprite_remove(staff);
|
peep_sprite_remove(staff);
|
||||||
// Due to patrol areas best to invalidate the whole screen on removal of staff
|
// Due to patrol areas best to invalidate the whole screen on removal of staff
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
return GameActions::Result();
|
return GameActions::Result();
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,6 +70,6 @@ GameActions::Result StaffSetColourAction::Execute() const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
return GameActions::Result();
|
return GameActions::Result();
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,7 +82,7 @@ GameActions::Result StaffSetNameAction::Execute() const
|
||||||
return GameActions::Result(GameActions::Status::Unknown, STR_CANT_NAME_GUEST, STR_NONE);
|
return GameActions::Result(GameActions::Status::Unknown, STR_CANT_NAME_GUEST, STR_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
|
|
||||||
auto intent = Intent(INTENT_ACTION_REFRESH_STAFF_LIST);
|
auto intent = Intent(INTENT_ACTION_REFRESH_STAFF_LIST);
|
||||||
ContextBroadcastIntent(&intent);
|
ContextBroadcastIntent(&intent);
|
||||||
|
|
|
@ -94,7 +94,7 @@ GameActions::Result StaffSetPatrolAreaAction::QueryExecute(bool executing) const
|
||||||
break;
|
break;
|
||||||
case StaffSetPatrolAreaMode::ClearAll:
|
case StaffSetPatrolAreaMode::ClearAll:
|
||||||
staff->ClearPatrolArea();
|
staff->ClearPatrolArea();
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
UpdateConsolidatedPatrolAreas();
|
UpdateConsolidatedPatrolAreas();
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
# include <immintrin.h>
|
# include <immintrin.h>
|
||||||
|
|
||||||
void mask_avx2(
|
void MaskAvx2(
|
||||||
int32_t width, int32_t height, const uint8_t* RESTRICT maskSrc, const uint8_t* RESTRICT colourSrc, uint8_t* RESTRICT dst,
|
int32_t width, int32_t height, const uint8_t* RESTRICT maskSrc, const uint8_t* RESTRICT colourSrc, uint8_t* RESTRICT dst,
|
||||||
int32_t maskWrap, int32_t colourWrap, int32_t dstWrap)
|
int32_t maskWrap, int32_t colourWrap, int32_t dstWrap)
|
||||||
{
|
{
|
||||||
|
@ -38,7 +38,7 @@ void mask_avx2(
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mask_scalar(width, height, maskSrc, colourSrc, dst, maskWrap, colourWrap, dstWrap);
|
MaskScalar(width, height, maskSrc, colourSrc, dst, maskWrap, colourWrap, dstWrap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ void mask_avx2(
|
||||||
# error You have to compile this file with AVX2 enabled, when targeting x86!
|
# error You have to compile this file with AVX2 enabled, when targeting x86!
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
void mask_avx2(
|
void MaskAvx2(
|
||||||
int32_t width, int32_t height, const uint8_t* RESTRICT maskSrc, const uint8_t* RESTRICT colourSrc, uint8_t* RESTRICT dst,
|
int32_t width, int32_t height, const uint8_t* RESTRICT maskSrc, const uint8_t* RESTRICT colourSrc, uint8_t* RESTRICT dst,
|
||||||
int32_t maskWrap, int32_t colourWrap, int32_t dstWrap)
|
int32_t maskWrap, int32_t colourWrap, int32_t dstWrap)
|
||||||
{
|
{
|
||||||
|
|
|
@ -78,7 +78,7 @@ template<DrawBlendOp TBlendOp> static void FASTCALL DrawBMPSprite(rct_drawpixeli
|
||||||
* rct2: 0x0067A690
|
* rct2: 0x0067A690
|
||||||
* @param imageId Only flags are used.
|
* @param imageId Only flags are used.
|
||||||
*/
|
*/
|
||||||
void FASTCALL gfx_bmp_sprite_to_buffer(rct_drawpixelinfo& dpi, const DrawSpriteArgs& args)
|
void FASTCALL GfxBmpSpriteToBuffer(rct_drawpixelinfo& dpi, const DrawSpriteArgs& args)
|
||||||
{
|
{
|
||||||
auto imageId = args.Image;
|
auto imageId = args.Image;
|
||||||
|
|
||||||
|
|
|
@ -156,7 +156,7 @@ static void read_and_convert_gxdat(IStream* stream, size_t count, bool is_rctc,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void mask_scalar(
|
void MaskScalar(
|
||||||
int32_t width, int32_t height, const uint8_t* RESTRICT maskSrc, const uint8_t* RESTRICT colourSrc, uint8_t* RESTRICT dst,
|
int32_t width, int32_t height, const uint8_t* RESTRICT maskSrc, const uint8_t* RESTRICT colourSrc, uint8_t* RESTRICT dst,
|
||||||
int32_t maskWrap, int32_t colourWrap, int32_t dstWrap)
|
int32_t maskWrap, int32_t colourWrap, int32_t dstWrap)
|
||||||
{
|
{
|
||||||
|
@ -628,7 +628,7 @@ void FASTCALL gfx_sprite_to_buffer(rct_drawpixelinfo& dpi, const DrawSpriteArgs&
|
||||||
}
|
}
|
||||||
else if (!(args.SourceImage.flags & G1_FLAG_1))
|
else if (!(args.SourceImage.flags & G1_FLAG_1))
|
||||||
{
|
{
|
||||||
gfx_bmp_sprite_to_buffer(dpi, args);
|
GfxBmpSpriteToBuffer(dpi, args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -689,7 +689,7 @@ void FASTCALL gfx_draw_sprite_raw_masked_software(
|
||||||
int32_t colourWrap = imgColour->width - width;
|
int32_t colourWrap = imgColour->width - width;
|
||||||
int32_t dstWrap = ((dpi->width + dpi->pitch) - width);
|
int32_t dstWrap = ((dpi->width + dpi->pitch) - width);
|
||||||
|
|
||||||
mask_fn(width, height, maskSrc, colourSrc, dst, maskWrap, colourWrap, dstWrap);
|
MaskFn(width, height, maskSrc, colourSrc, dst, maskWrap, colourWrap, dstWrap);
|
||||||
}
|
}
|
||||||
|
|
||||||
const rct_g1_element* gfx_get_g1_element(const ImageId imageId)
|
const rct_g1_element* gfx_get_g1_element(const ImageId imageId)
|
||||||
|
|
|
@ -554,33 +554,33 @@ ImageCatalogue ImageId::GetCatalogue() const
|
||||||
return ImageCatalogue::UNKNOWN;
|
return ImageCatalogue::UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
void (*mask_fn)(
|
void (*MaskFn)(
|
||||||
int32_t width, int32_t height, const uint8_t* RESTRICT maskSrc, const uint8_t* RESTRICT colourSrc, uint8_t* RESTRICT dst,
|
int32_t width, int32_t height, const uint8_t* RESTRICT maskSrc, const uint8_t* RESTRICT colourSrc, uint8_t* RESTRICT dst,
|
||||||
int32_t maskWrap, int32_t colourWrap, int32_t dstWrap)
|
int32_t maskWrap, int32_t colourWrap, int32_t dstWrap)
|
||||||
= nullptr;
|
= nullptr;
|
||||||
|
|
||||||
void mask_init()
|
void MaskInit()
|
||||||
{
|
{
|
||||||
if (avx2_available())
|
if (avx2_available())
|
||||||
{
|
{
|
||||||
log_verbose("registering AVX2 mask function");
|
log_verbose("registering AVX2 mask function");
|
||||||
mask_fn = mask_avx2;
|
MaskFn = MaskAvx2;
|
||||||
}
|
}
|
||||||
else if (sse41_available())
|
else if (sse41_available())
|
||||||
{
|
{
|
||||||
log_verbose("registering SSE4.1 mask function");
|
log_verbose("registering SSE4.1 mask function");
|
||||||
mask_fn = mask_sse4_1;
|
MaskFn = MaskSse4_1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
log_verbose("registering scalar mask function");
|
log_verbose("registering scalar mask function");
|
||||||
mask_fn = mask_scalar;
|
MaskFn = MaskScalar;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void gfx_filter_pixel(rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, FilterPaletteID palette)
|
void GfxFilterPixel(rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, FilterPaletteID palette)
|
||||||
{
|
{
|
||||||
gfx_filter_rect(dpi, { coords, coords }, palette);
|
GfxFilterRect(dpi, { coords, coords }, palette);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -589,7 +589,7 @@ void gfx_filter_pixel(rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, Filt
|
||||||
* a1 (ebx)
|
* a1 (ebx)
|
||||||
* product (cl)
|
* product (cl)
|
||||||
*/
|
*/
|
||||||
void gfx_transpose_palette(int32_t pal, uint8_t product)
|
void GfxTransposePalette(int32_t pal, uint8_t product)
|
||||||
{
|
{
|
||||||
const rct_g1_element* g1 = gfx_get_g1_element(pal);
|
const rct_g1_element* g1 = gfx_get_g1_element(pal);
|
||||||
if (g1 != nullptr)
|
if (g1 != nullptr)
|
||||||
|
@ -615,7 +615,7 @@ void gfx_transpose_palette(int32_t pal, uint8_t product)
|
||||||
*
|
*
|
||||||
* rct2: 0x006837E3
|
* rct2: 0x006837E3
|
||||||
*/
|
*/
|
||||||
void load_palette()
|
void LoadPalette()
|
||||||
{
|
{
|
||||||
if (gOpenRCT2NoGraphics)
|
if (gOpenRCT2NoGraphics)
|
||||||
{
|
{
|
||||||
|
@ -649,16 +649,16 @@ void load_palette()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
UpdatePalette(gGamePalette, 10, 236);
|
UpdatePalette(gGamePalette, 10, 236);
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* rct2: 0x006ED7E5
|
* rct2: 0x006ED7E5
|
||||||
*/
|
*/
|
||||||
void gfx_invalidate_screen()
|
void GfxInvalidateScreen()
|
||||||
{
|
{
|
||||||
gfx_set_dirty_blocks({ { 0, 0 }, { ContextGetWidth(), ContextGetHeight() } });
|
GfxSetDirtyBlocks({ { 0, 0 }, { ContextGetWidth(), ContextGetHeight() } });
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -670,7 +670,7 @@ void gfx_invalidate_screen()
|
||||||
* height (dx)
|
* height (dx)
|
||||||
* drawpixelinfo (edi)
|
* drawpixelinfo (edi)
|
||||||
*/
|
*/
|
||||||
bool clip_drawpixelinfo(
|
bool ClipDrawPixelInfo(
|
||||||
rct_drawpixelinfo* dst, rct_drawpixelinfo* src, const ScreenCoordsXY& coords, int32_t width, int32_t height)
|
rct_drawpixelinfo* dst, rct_drawpixelinfo* src, const ScreenCoordsXY& coords, int32_t width, int32_t height)
|
||||||
{
|
{
|
||||||
int32_t right = coords.x + width;
|
int32_t right = coords.x + width;
|
||||||
|
@ -720,7 +720,7 @@ bool clip_drawpixelinfo(
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void gfx_invalidate_pickedup_peep()
|
void GfxInvalidatePickedUpPeep()
|
||||||
{
|
{
|
||||||
auto imageId = gPickupPeepImage;
|
auto imageId = gPickupPeepImage;
|
||||||
if (imageId.HasValue())
|
if (imageId.HasValue())
|
||||||
|
@ -732,12 +732,12 @@ void gfx_invalidate_pickedup_peep()
|
||||||
int32_t top = gPickupPeepY + g1->y_offset;
|
int32_t top = gPickupPeepY + g1->y_offset;
|
||||||
int32_t right = left + g1->width;
|
int32_t right = left + g1->width;
|
||||||
int32_t bottom = top + g1->height;
|
int32_t bottom = top + g1->height;
|
||||||
gfx_set_dirty_blocks({ { left, top }, { right, bottom } });
|
GfxSetDirtyBlocks({ { left, top }, { right, bottom } });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void gfx_draw_pickedup_peep(rct_drawpixelinfo* dpi)
|
void GfxDrawPickedUpPeep(rct_drawpixelinfo* dpi)
|
||||||
{
|
{
|
||||||
if (gPickupPeepImage.HasValue())
|
if (gPickupPeepImage.HasValue())
|
||||||
{
|
{
|
||||||
|
@ -853,7 +853,7 @@ void RefreshVideo(bool recreateWindow)
|
||||||
}
|
}
|
||||||
|
|
||||||
drawing_engine_set_palette(gPalette);
|
drawing_engine_set_palette(gPalette);
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ToggleWindowedMode()
|
void ToggleWindowedMode()
|
||||||
|
|
|
@ -474,31 +474,31 @@ extern int32_t gPickupPeepY;
|
||||||
|
|
||||||
extern bool gTinyFontAntiAliased;
|
extern bool gTinyFontAntiAliased;
|
||||||
|
|
||||||
bool clip_drawpixelinfo(
|
bool ClipDrawPixelInfo(
|
||||||
rct_drawpixelinfo* dst, rct_drawpixelinfo* src, const ScreenCoordsXY& coords, int32_t width, int32_t height);
|
rct_drawpixelinfo* dst, rct_drawpixelinfo* src, const ScreenCoordsXY& coords, int32_t width, int32_t height);
|
||||||
void gfx_set_dirty_blocks(const ScreenRect& rect);
|
void GfxSetDirtyBlocks(const ScreenRect& rect);
|
||||||
void gfx_invalidate_screen();
|
void GfxInvalidateScreen();
|
||||||
|
|
||||||
// palette
|
// palette
|
||||||
void gfx_transpose_palette(int32_t pal, uint8_t product);
|
void GfxTransposePalette(int32_t pal, uint8_t product);
|
||||||
void load_palette();
|
void LoadPalette();
|
||||||
|
|
||||||
// other
|
// other
|
||||||
void gfx_clear(rct_drawpixelinfo* dpi, uint8_t paletteIndex);
|
void GfxClear(rct_drawpixelinfo* dpi, uint8_t paletteIndex);
|
||||||
void gfx_filter_pixel(rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, FilterPaletteID palette);
|
void GfxFilterPixel(rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, FilterPaletteID palette);
|
||||||
void gfx_invalidate_pickedup_peep();
|
void GfxInvalidatePickedUpPeep();
|
||||||
void gfx_draw_pickedup_peep(rct_drawpixelinfo* dpi);
|
void GfxDrawPickedUpPeep(rct_drawpixelinfo* dpi);
|
||||||
|
|
||||||
// line
|
// line
|
||||||
void gfx_draw_line(rct_drawpixelinfo* dpi, const ScreenLine& line, int32_t colour);
|
void GfxDrawLine(rct_drawpixelinfo* dpi, const ScreenLine& line, int32_t colour);
|
||||||
void gfx_draw_line_software(rct_drawpixelinfo* dpi, const ScreenLine& line, int32_t colour);
|
void GfxDrawLineSoftware(rct_drawpixelinfo* dpi, const ScreenLine& line, int32_t colour);
|
||||||
void gfx_draw_dashed_line(
|
void GfxDrawDashedLine(
|
||||||
rct_drawpixelinfo* dpi, const ScreenLine& screenLine, const int32_t dashedLineSegmentLength, const int32_t color);
|
rct_drawpixelinfo* dpi, const ScreenLine& screenLine, const int32_t dashedLineSegmentLength, const int32_t color);
|
||||||
|
|
||||||
// rect
|
// rect
|
||||||
void gfx_fill_rect(rct_drawpixelinfo* dpi, const ScreenRect& rect, int32_t colour);
|
void GfxFillRect(rct_drawpixelinfo* dpi, const ScreenRect& rect, int32_t colour);
|
||||||
void gfx_fill_rect_inset(rct_drawpixelinfo* dpi, const ScreenRect& rect, int32_t colour, uint8_t flags);
|
void GfxFillRectInset(rct_drawpixelinfo* dpi, const ScreenRect& rect, int32_t colour, uint8_t flags);
|
||||||
void gfx_filter_rect(rct_drawpixelinfo* dpi, const ScreenRect& rect, FilterPaletteID palette);
|
void GfxFilterRect(rct_drawpixelinfo* dpi, const ScreenRect& rect, FilterPaletteID palette);
|
||||||
|
|
||||||
// sprite
|
// sprite
|
||||||
bool gfx_load_g1(const OpenRCT2::IPlatformEnvironment& env);
|
bool gfx_load_g1(const OpenRCT2::IPlatformEnvironment& env);
|
||||||
|
@ -513,7 +513,7 @@ void gfx_set_g1_element(ImageIndex imageId, const rct_g1_element* g1);
|
||||||
std::optional<rct_gx> GfxLoadGx(const std::vector<uint8_t>& buffer);
|
std::optional<rct_gx> GfxLoadGx(const std::vector<uint8_t>& buffer);
|
||||||
bool is_csg_loaded();
|
bool is_csg_loaded();
|
||||||
void FASTCALL gfx_sprite_to_buffer(rct_drawpixelinfo& dpi, const DrawSpriteArgs& args);
|
void FASTCALL gfx_sprite_to_buffer(rct_drawpixelinfo& dpi, const DrawSpriteArgs& args);
|
||||||
void FASTCALL gfx_bmp_sprite_to_buffer(rct_drawpixelinfo& dpi, const DrawSpriteArgs& args);
|
void FASTCALL GfxBmpSpriteToBuffer(rct_drawpixelinfo& dpi, const DrawSpriteArgs& args);
|
||||||
void FASTCALL gfx_rle_sprite_to_buffer(rct_drawpixelinfo& dpi, const DrawSpriteArgs& args);
|
void FASTCALL gfx_rle_sprite_to_buffer(rct_drawpixelinfo& dpi, const DrawSpriteArgs& args);
|
||||||
void FASTCALL gfx_draw_sprite(rct_drawpixelinfo* dpi, const ImageId image_id, const ScreenCoordsXY& coords);
|
void FASTCALL gfx_draw_sprite(rct_drawpixelinfo* dpi, const ImageId image_id, const ScreenCoordsXY& coords);
|
||||||
void FASTCALL
|
void FASTCALL
|
||||||
|
@ -565,18 +565,18 @@ ImageId scrolling_text_setup(
|
||||||
|
|
||||||
size_t g1_calculate_data_size(const rct_g1_element* g1);
|
size_t g1_calculate_data_size(const rct_g1_element* g1);
|
||||||
|
|
||||||
void mask_scalar(
|
void MaskScalar(
|
||||||
int32_t width, int32_t height, const uint8_t* RESTRICT maskSrc, const uint8_t* RESTRICT colourSrc, uint8_t* RESTRICT dst,
|
int32_t width, int32_t height, const uint8_t* RESTRICT maskSrc, const uint8_t* RESTRICT colourSrc, uint8_t* RESTRICT dst,
|
||||||
int32_t maskWrap, int32_t colourWrap, int32_t dstWrap);
|
int32_t maskWrap, int32_t colourWrap, int32_t dstWrap);
|
||||||
void mask_sse4_1(
|
void MaskSse4_1(
|
||||||
int32_t width, int32_t height, const uint8_t* RESTRICT maskSrc, const uint8_t* RESTRICT colourSrc, uint8_t* RESTRICT dst,
|
int32_t width, int32_t height, const uint8_t* RESTRICT maskSrc, const uint8_t* RESTRICT colourSrc, uint8_t* RESTRICT dst,
|
||||||
int32_t maskWrap, int32_t colourWrap, int32_t dstWrap);
|
int32_t maskWrap, int32_t colourWrap, int32_t dstWrap);
|
||||||
void mask_avx2(
|
void MaskAvx2(
|
||||||
int32_t width, int32_t height, const uint8_t* RESTRICT maskSrc, const uint8_t* RESTRICT colourSrc, uint8_t* RESTRICT dst,
|
int32_t width, int32_t height, const uint8_t* RESTRICT maskSrc, const uint8_t* RESTRICT colourSrc, uint8_t* RESTRICT dst,
|
||||||
int32_t maskWrap, int32_t colourWrap, int32_t dstWrap);
|
int32_t maskWrap, int32_t colourWrap, int32_t dstWrap);
|
||||||
void mask_init();
|
void MaskInit();
|
||||||
|
|
||||||
extern void (*mask_fn)(
|
extern void (*MaskFn)(
|
||||||
int32_t width, int32_t height, const uint8_t* RESTRICT maskSrc, const uint8_t* RESTRICT colourSrc, uint8_t* RESTRICT dst,
|
int32_t width, int32_t height, const uint8_t* RESTRICT maskSrc, const uint8_t* RESTRICT colourSrc, uint8_t* RESTRICT dst,
|
||||||
int32_t maskWrap, int32_t colourWrap, int32_t dstWrap);
|
int32_t maskWrap, int32_t colourWrap, int32_t dstWrap);
|
||||||
|
|
||||||
|
|
|
@ -72,7 +72,7 @@ static void gfx_draw_line_on_buffer(rct_drawpixelinfo* dpi, char colour, const S
|
||||||
* colour (ebp)
|
* colour (ebp)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void gfx_draw_line_software(rct_drawpixelinfo* dpi, const ScreenLine& line, int32_t colour)
|
void GfxDrawLineSoftware(rct_drawpixelinfo* dpi, const ScreenLine& line, int32_t colour)
|
||||||
{
|
{
|
||||||
int32_t x1 = line.GetX1();
|
int32_t x1 = line.GetX1();
|
||||||
int32_t x2 = line.GetX2();
|
int32_t x2 = line.GetX2();
|
||||||
|
|
|
@ -151,7 +151,7 @@ void drawing_engine_set_vsync(bool vsync)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void gfx_set_dirty_blocks(const ScreenRect& rect)
|
void GfxSetDirtyBlocks(const ScreenRect& rect)
|
||||||
{
|
{
|
||||||
auto drawingEngine = GetDrawingEngine();
|
auto drawingEngine = GetDrawingEngine();
|
||||||
if (drawingEngine != nullptr)
|
if (drawingEngine != nullptr)
|
||||||
|
@ -160,7 +160,7 @@ void gfx_set_dirty_blocks(const ScreenRect& rect)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void gfx_clear(rct_drawpixelinfo* dpi, uint8_t paletteIndex)
|
void GfxClear(rct_drawpixelinfo* dpi, uint8_t paletteIndex)
|
||||||
{
|
{
|
||||||
auto drawingEngine = dpi->DrawingEngine;
|
auto drawingEngine = dpi->DrawingEngine;
|
||||||
if (drawingEngine != nullptr)
|
if (drawingEngine != nullptr)
|
||||||
|
@ -170,7 +170,7 @@ void gfx_clear(rct_drawpixelinfo* dpi, uint8_t paletteIndex)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void gfx_fill_rect(rct_drawpixelinfo* dpi, const ScreenRect& rect, int32_t colour)
|
void GfxFillRect(rct_drawpixelinfo* dpi, const ScreenRect& rect, int32_t colour)
|
||||||
{
|
{
|
||||||
auto drawingEngine = dpi->DrawingEngine;
|
auto drawingEngine = dpi->DrawingEngine;
|
||||||
if (drawingEngine != nullptr)
|
if (drawingEngine != nullptr)
|
||||||
|
@ -180,7 +180,7 @@ void gfx_fill_rect(rct_drawpixelinfo* dpi, const ScreenRect& rect, int32_t colou
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void gfx_filter_rect(rct_drawpixelinfo* dpi, const ScreenRect& rect, FilterPaletteID palette)
|
void GfxFilterRect(rct_drawpixelinfo* dpi, const ScreenRect& rect, FilterPaletteID palette)
|
||||||
{
|
{
|
||||||
auto drawingEngine = dpi->DrawingEngine;
|
auto drawingEngine = dpi->DrawingEngine;
|
||||||
if (drawingEngine != nullptr)
|
if (drawingEngine != nullptr)
|
||||||
|
@ -190,7 +190,7 @@ void gfx_filter_rect(rct_drawpixelinfo* dpi, const ScreenRect& rect, FilterPalet
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void gfx_draw_line(rct_drawpixelinfo* dpi, const ScreenLine& line, int32_t colour)
|
void GfxDrawLine(rct_drawpixelinfo* dpi, const ScreenLine& line, int32_t colour)
|
||||||
{
|
{
|
||||||
auto drawingEngine = dpi->DrawingEngine;
|
auto drawingEngine = dpi->DrawingEngine;
|
||||||
if (drawingEngine != nullptr)
|
if (drawingEngine != nullptr)
|
||||||
|
@ -200,7 +200,7 @@ void gfx_draw_line(rct_drawpixelinfo* dpi, const ScreenLine& line, int32_t colou
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void gfx_draw_dashed_line(
|
void GfxDrawDashedLine(
|
||||||
rct_drawpixelinfo* dpi, const ScreenLine& screenLine, const int32_t dashedLineSegmentLength, const int32_t color)
|
rct_drawpixelinfo* dpi, const ScreenLine& screenLine, const int32_t dashedLineSegmentLength, const int32_t color)
|
||||||
{
|
{
|
||||||
assert(dashedLineSegmentLength > 0);
|
assert(dashedLineSegmentLength > 0);
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
* colour (ebp)
|
* colour (ebp)
|
||||||
* flags (si)
|
* flags (si)
|
||||||
*/
|
*/
|
||||||
void gfx_fill_rect_inset(rct_drawpixelinfo* dpi, const ScreenRect& rect, int32_t colour, uint8_t flags)
|
void GfxFillRectInset(rct_drawpixelinfo* dpi, const ScreenRect& rect, int32_t colour, uint8_t flags)
|
||||||
{
|
{
|
||||||
const auto leftTop = ScreenCoordsXY{ rect.GetLeft(), rect.GetTop() };
|
const auto leftTop = ScreenCoordsXY{ rect.GetLeft(), rect.GetTop() };
|
||||||
const auto leftBottom = ScreenCoordsXY{ rect.GetLeft(), rect.GetBottom() };
|
const auto leftBottom = ScreenCoordsXY{ rect.GetLeft(), rect.GetBottom() };
|
||||||
|
@ -45,32 +45,32 @@ void gfx_fill_rect_inset(rct_drawpixelinfo* dpi, const ScreenRect& rect, int32_t
|
||||||
|
|
||||||
if (flags & INSET_RECT_FLAG_BORDER_NONE)
|
if (flags & INSET_RECT_FLAG_BORDER_NONE)
|
||||||
{
|
{
|
||||||
gfx_filter_rect(dpi, rect, palette.base);
|
GfxFilterRect(dpi, rect, palette.base);
|
||||||
}
|
}
|
||||||
else if (flags & INSET_RECT_FLAG_BORDER_INSET)
|
else if (flags & INSET_RECT_FLAG_BORDER_INSET)
|
||||||
{
|
{
|
||||||
// Draw outline of box
|
// Draw outline of box
|
||||||
gfx_filter_rect(dpi, { leftTop, leftBottom }, palette.highlight);
|
GfxFilterRect(dpi, { leftTop, leftBottom }, palette.highlight);
|
||||||
gfx_filter_rect(dpi, { leftTop, rightTop }, palette.highlight);
|
GfxFilterRect(dpi, { leftTop, rightTop }, palette.highlight);
|
||||||
gfx_filter_rect(dpi, { rightTop, rightBottom }, palette.shadow);
|
GfxFilterRect(dpi, { rightTop, rightBottom }, palette.shadow);
|
||||||
gfx_filter_rect(dpi, { leftBottom, rightBottom }, palette.shadow);
|
GfxFilterRect(dpi, { leftBottom, rightBottom }, palette.shadow);
|
||||||
|
|
||||||
if (!(flags & INSET_RECT_FLAG_FILL_NONE))
|
if (!(flags & INSET_RECT_FLAG_FILL_NONE))
|
||||||
{
|
{
|
||||||
gfx_filter_rect(dpi, { leftTop + ScreenCoordsXY{ 1, 1 }, rightBottom - ScreenCoordsXY{ 1, 1 } }, palette.base);
|
GfxFilterRect(dpi, { leftTop + ScreenCoordsXY{ 1, 1 }, rightBottom - ScreenCoordsXY{ 1, 1 } }, palette.base);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Draw outline of box
|
// Draw outline of box
|
||||||
gfx_filter_rect(dpi, { leftTop, leftBottom }, palette.shadow);
|
GfxFilterRect(dpi, { leftTop, leftBottom }, palette.shadow);
|
||||||
gfx_filter_rect(dpi, { leftTop, rightTop }, palette.shadow);
|
GfxFilterRect(dpi, { leftTop, rightTop }, palette.shadow);
|
||||||
gfx_filter_rect(dpi, { rightTop, rightBottom }, palette.highlight);
|
GfxFilterRect(dpi, { rightTop, rightBottom }, palette.highlight);
|
||||||
gfx_filter_rect(dpi, { leftBottom, rightBottom }, palette.highlight);
|
GfxFilterRect(dpi, { leftBottom, rightBottom }, palette.highlight);
|
||||||
|
|
||||||
if (!(flags & INSET_RECT_FLAG_FILL_NONE))
|
if (!(flags & INSET_RECT_FLAG_FILL_NONE))
|
||||||
{
|
{
|
||||||
gfx_filter_rect(
|
GfxFilterRect(
|
||||||
dpi, { leftTop + ScreenCoordsXY{ 1, 1 }, { rightBottom - ScreenCoordsXY{ 1, 1 } } }, palette.base);
|
dpi, { leftTop + ScreenCoordsXY{ 1, 1 }, { rightBottom - ScreenCoordsXY{ 1, 1 } } }, palette.base);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -93,15 +93,15 @@ void gfx_fill_rect_inset(rct_drawpixelinfo* dpi, const ScreenRect& rect, int32_t
|
||||||
|
|
||||||
if (flags & INSET_RECT_FLAG_BORDER_NONE)
|
if (flags & INSET_RECT_FLAG_BORDER_NONE)
|
||||||
{
|
{
|
||||||
gfx_fill_rect(dpi, rect, fill);
|
GfxFillRect(dpi, rect, fill);
|
||||||
}
|
}
|
||||||
else if (flags & INSET_RECT_FLAG_BORDER_INSET)
|
else if (flags & INSET_RECT_FLAG_BORDER_INSET)
|
||||||
{
|
{
|
||||||
// Draw outline of box
|
// Draw outline of box
|
||||||
gfx_fill_rect(dpi, { leftTop, leftBottom }, shadow);
|
GfxFillRect(dpi, { leftTop, leftBottom }, shadow);
|
||||||
gfx_fill_rect(dpi, { leftTop + ScreenCoordsXY{ 1, 0 }, rightTop }, shadow);
|
GfxFillRect(dpi, { leftTop + ScreenCoordsXY{ 1, 0 }, rightTop }, shadow);
|
||||||
gfx_fill_rect(dpi, { rightTop + ScreenCoordsXY{ 0, 1 }, rightBottom - ScreenCoordsXY{ 0, 1 } }, hilight);
|
GfxFillRect(dpi, { rightTop + ScreenCoordsXY{ 0, 1 }, rightBottom - ScreenCoordsXY{ 0, 1 } }, hilight);
|
||||||
gfx_fill_rect(dpi, { leftBottom + ScreenCoordsXY{ 1, 0 }, rightBottom }, hilight);
|
GfxFillRect(dpi, { leftBottom + ScreenCoordsXY{ 1, 0 }, rightBottom }, hilight);
|
||||||
|
|
||||||
if (!(flags & INSET_RECT_FLAG_FILL_NONE))
|
if (!(flags & INSET_RECT_FLAG_FILL_NONE))
|
||||||
{
|
{
|
||||||
|
@ -116,16 +116,16 @@ void gfx_fill_rect_inset(rct_drawpixelinfo* dpi, const ScreenRect& rect, int32_t
|
||||||
fill = ColourMapA[colour].lighter;
|
fill = ColourMapA[colour].lighter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
gfx_fill_rect(dpi, { leftTop + ScreenCoordsXY{ 1, 1 }, rightBottom - ScreenCoordsXY{ 1, 1 } }, fill);
|
GfxFillRect(dpi, { leftTop + ScreenCoordsXY{ 1, 1 }, rightBottom - ScreenCoordsXY{ 1, 1 } }, fill);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Draw outline of box
|
// Draw outline of box
|
||||||
gfx_fill_rect(dpi, { leftTop, leftBottom - ScreenCoordsXY{ 0, 1 } }, hilight);
|
GfxFillRect(dpi, { leftTop, leftBottom - ScreenCoordsXY{ 0, 1 } }, hilight);
|
||||||
gfx_fill_rect(dpi, { leftTop + ScreenCoordsXY{ 1, 0 }, rightTop - ScreenCoordsXY{ 1, 0 } }, hilight);
|
GfxFillRect(dpi, { leftTop + ScreenCoordsXY{ 1, 0 }, rightTop - ScreenCoordsXY{ 1, 0 } }, hilight);
|
||||||
gfx_fill_rect(dpi, { rightTop, rightBottom - ScreenCoordsXY{ 0, 1 } }, shadow);
|
GfxFillRect(dpi, { rightTop, rightBottom - ScreenCoordsXY{ 0, 1 } }, shadow);
|
||||||
gfx_fill_rect(dpi, { leftBottom, rightBottom }, shadow);
|
GfxFillRect(dpi, { leftBottom, rightBottom }, shadow);
|
||||||
|
|
||||||
if (!(flags & INSET_RECT_FLAG_FILL_NONE))
|
if (!(flags & INSET_RECT_FLAG_FILL_NONE))
|
||||||
{
|
{
|
||||||
|
@ -133,7 +133,7 @@ void gfx_fill_rect_inset(rct_drawpixelinfo* dpi, const ScreenRect& rect, int32_t
|
||||||
{
|
{
|
||||||
fill = ColourMapA[COLOUR_BLACK].light;
|
fill = ColourMapA[COLOUR_BLACK].light;
|
||||||
}
|
}
|
||||||
gfx_fill_rect(dpi, { leftTop + ScreenCoordsXY{ 1, 1 }, rightBottom - ScreenCoordsXY{ 1, 1 } }, fill);
|
GfxFillRect(dpi, { leftTop + ScreenCoordsXY{ 1, 1 }, rightBottom - ScreenCoordsXY{ 1, 1 } }, fill);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
# include <immintrin.h>
|
# include <immintrin.h>
|
||||||
|
|
||||||
void mask_sse4_1(
|
void MaskSse4_1(
|
||||||
int32_t width, int32_t height, const uint8_t* RESTRICT maskSrc, const uint8_t* RESTRICT colourSrc, uint8_t* RESTRICT dst,
|
int32_t width, int32_t height, const uint8_t* RESTRICT maskSrc, const uint8_t* RESTRICT colourSrc, uint8_t* RESTRICT dst,
|
||||||
int32_t maskWrap, int32_t colourWrap, int32_t dstWrap)
|
int32_t maskWrap, int32_t colourWrap, int32_t dstWrap)
|
||||||
{
|
{
|
||||||
|
@ -52,7 +52,7 @@ void mask_sse4_1(
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mask_scalar(width, height, maskSrc, colourSrc, dst, maskWrap, colourWrap, dstWrap);
|
MaskScalar(width, height, maskSrc, colourSrc, dst, maskWrap, colourWrap, dstWrap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ void mask_sse4_1(
|
||||||
# error You have to compile this file with SSE4.1 enabled, when targeting x86!
|
# error You have to compile this file with SSE4.1 enabled, when targeting x86!
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
void mask_sse4_1(
|
void MaskSse4_1(
|
||||||
int32_t width, int32_t height, const uint8_t* RESTRICT maskSrc, const uint8_t* RESTRICT colourSrc, uint8_t* RESTRICT dst,
|
int32_t width, int32_t height, const uint8_t* RESTRICT maskSrc, const uint8_t* RESTRICT colourSrc, uint8_t* RESTRICT dst,
|
||||||
int32_t maskWrap, int32_t colourWrap, int32_t dstWrap)
|
int32_t maskWrap, int32_t colourWrap, int32_t dstWrap)
|
||||||
{
|
{
|
||||||
|
|
|
@ -104,12 +104,12 @@ static void DrawText(
|
||||||
|
|
||||||
if (paint.UnderlineText == TextUnderline::On)
|
if (paint.UnderlineText == TextUnderline::On)
|
||||||
{
|
{
|
||||||
gfx_fill_rect(
|
GfxFillRect(
|
||||||
dpi, { { alignedCoords + ScreenCoordsXY{ 0, 11 } }, { alignedCoords + ScreenCoordsXY{ width, 11 } } },
|
dpi, { { alignedCoords + ScreenCoordsXY{ 0, 11 } }, { alignedCoords + ScreenCoordsXY{ width, 11 } } },
|
||||||
gTextPalette[1]);
|
gTextPalette[1]);
|
||||||
if (gTextPalette[2] != 0)
|
if (gTextPalette[2] != 0)
|
||||||
{
|
{
|
||||||
gfx_fill_rect(
|
GfxFillRect(
|
||||||
dpi, { { alignedCoords + ScreenCoordsXY{ 1, 12 } }, { alignedCoords + ScreenCoordsXY{ width + 1, 12 } } },
|
dpi, { { alignedCoords + ScreenCoordsXY{ 1, 12 } }, { alignedCoords + ScreenCoordsXY{ width + 1, 12 } } },
|
||||||
gTextPalette[2]);
|
gTextPalette[2]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -705,7 +705,7 @@ void X8DrawingContext::FilterRect(
|
||||||
|
|
||||||
void X8DrawingContext::DrawLine(rct_drawpixelinfo* dpi, uint32_t colour, const ScreenLine& line)
|
void X8DrawingContext::DrawLine(rct_drawpixelinfo* dpi, uint32_t colour, const ScreenLine& line)
|
||||||
{
|
{
|
||||||
gfx_draw_line_software(dpi, line, colour);
|
GfxDrawLineSoftware(dpi, line, colour);
|
||||||
}
|
}
|
||||||
|
|
||||||
void X8DrawingContext::DrawSprite(rct_drawpixelinfo* dpi, const ImageId imageId, int32_t x, int32_t y)
|
void X8DrawingContext::DrawSprite(rct_drawpixelinfo* dpi, const ImageId imageId, int32_t x, int32_t y)
|
||||||
|
|
|
@ -2630,7 +2630,7 @@ void peep_update_names(bool realNames)
|
||||||
|
|
||||||
auto intent = Intent(INTENT_ACTION_REFRESH_GUEST_LIST);
|
auto intent = Intent(INTENT_ACTION_REFRESH_GUEST_LIST);
|
||||||
ContextBroadcastIntent(&intent);
|
ContextBroadcastIntent(&intent);
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
void increment_guests_in_park()
|
void increment_guests_in_park()
|
||||||
|
|
|
@ -141,18 +141,18 @@ void chat_draw(rct_drawpixelinfo* dpi, uint8_t chatBackgroundColor)
|
||||||
ScreenCoordsXY topLeft{ _chatLeft, _chatTop };
|
ScreenCoordsXY topLeft{ _chatLeft, _chatTop };
|
||||||
ScreenCoordsXY bottomRight{ _chatRight, _chatBottom };
|
ScreenCoordsXY bottomRight{ _chatRight, _chatBottom };
|
||||||
ScreenCoordsXY bottomLeft{ _chatLeft, _chatBottom };
|
ScreenCoordsXY bottomLeft{ _chatLeft, _chatBottom };
|
||||||
gfx_set_dirty_blocks(
|
GfxSetDirtyBlocks(
|
||||||
{ topLeft - ScreenCoordsXY{ 0, 5 }, bottomRight + ScreenCoordsXY{ 0, 5 } }); // Background area + Textbox
|
{ topLeft - ScreenCoordsXY{ 0, 5 }, bottomRight + ScreenCoordsXY{ 0, 5 } }); // Background area + Textbox
|
||||||
gfx_filter_rect(
|
GfxFilterRect(
|
||||||
dpi, { topLeft - ScreenCoordsXY{ 0, 5 }, bottomRight + ScreenCoordsXY{ 0, 5 } },
|
dpi, { topLeft - ScreenCoordsXY{ 0, 5 }, bottomRight + ScreenCoordsXY{ 0, 5 } },
|
||||||
FilterPaletteID::Palette51); // Opaque grey background
|
FilterPaletteID::Palette51); // Opaque grey background
|
||||||
gfx_fill_rect_inset(
|
GfxFillRectInset(
|
||||||
dpi, { topLeft - ScreenCoordsXY{ 0, 5 }, bottomRight + ScreenCoordsXY{ 0, 5 } }, chatBackgroundColor,
|
dpi, { topLeft - ScreenCoordsXY{ 0, 5 }, bottomRight + ScreenCoordsXY{ 0, 5 } }, chatBackgroundColor,
|
||||||
INSET_RECT_FLAG_FILL_NONE);
|
INSET_RECT_FLAG_FILL_NONE);
|
||||||
gfx_fill_rect_inset(
|
GfxFillRectInset(
|
||||||
dpi, { topLeft + ScreenCoordsXY{ 1, -4 }, bottomRight - ScreenCoordsXY{ 1, inputLineHeight + 6 } },
|
dpi, { topLeft + ScreenCoordsXY{ 1, -4 }, bottomRight - ScreenCoordsXY{ 1, inputLineHeight + 6 } },
|
||||||
chatBackgroundColor, INSET_RECT_FLAG_BORDER_INSET);
|
chatBackgroundColor, INSET_RECT_FLAG_BORDER_INSET);
|
||||||
gfx_fill_rect_inset(
|
GfxFillRectInset(
|
||||||
dpi, { bottomLeft + ScreenCoordsXY{ 1, -inputLineHeight - 5 }, bottomRight + ScreenCoordsXY{ -1, 4 } },
|
dpi, { bottomLeft + ScreenCoordsXY{ 1, -inputLineHeight - 5 }, bottomRight + ScreenCoordsXY{ -1, 4 } },
|
||||||
chatBackgroundColor,
|
chatBackgroundColor,
|
||||||
INSET_RECT_FLAG_BORDER_INSET); // Textbox
|
INSET_RECT_FLAG_BORDER_INSET); // Textbox
|
||||||
|
@ -173,7 +173,7 @@ void chat_draw(rct_drawpixelinfo* dpi, uint8_t chatBackgroundColor)
|
||||||
lineBuffer.assign(chat_history_get(i));
|
lineBuffer.assign(chat_history_get(i));
|
||||||
auto lineCh = lineBuffer.c_str();
|
auto lineCh = lineBuffer.c_str();
|
||||||
stringHeight = chat_history_draw_string(dpi, lineCh, screenCoords, _chatWidth - 10) + 5;
|
stringHeight = chat_history_draw_string(dpi, lineCh, screenCoords, _chatWidth - 10) + 5;
|
||||||
gfx_set_dirty_blocks(
|
GfxSetDirtyBlocks(
|
||||||
{ { screenCoords - ScreenCoordsXY{ 0, stringHeight } }, { screenCoords + ScreenCoordsXY{ _chatWidth, 20 } } });
|
{ { screenCoords - ScreenCoordsXY{ 0, stringHeight } }, { screenCoords + ScreenCoordsXY{ _chatWidth, 20 } } });
|
||||||
|
|
||||||
if ((screenCoords.y - stringHeight) < 50)
|
if ((screenCoords.y - stringHeight) < 50)
|
||||||
|
@ -195,7 +195,7 @@ void chat_draw(rct_drawpixelinfo* dpi, uint8_t chatBackgroundColor)
|
||||||
ft.Add<const char*>(lineCh);
|
ft.Add<const char*>(lineCh);
|
||||||
inputLineHeight = DrawTextWrapped(
|
inputLineHeight = DrawTextWrapped(
|
||||||
dpi, screenCoords + ScreenCoordsXY{ 0, 3 }, _chatWidth - 10, STR_STRING, ft, { TEXT_COLOUR_255 });
|
dpi, screenCoords + ScreenCoordsXY{ 0, 3 }, _chatWidth - 10, STR_STRING, ft, { TEXT_COLOUR_255 });
|
||||||
gfx_set_dirty_blocks({ screenCoords, { screenCoords + ScreenCoordsXY{ _chatWidth, inputLineHeight + 15 } } });
|
GfxSetDirtyBlocks({ screenCoords, { screenCoords + ScreenCoordsXY{ _chatWidth, inputLineHeight + 15 } } });
|
||||||
|
|
||||||
// TODO: Show caret if the input text has multiple lines
|
// TODO: Show caret if the input text has multiple lines
|
||||||
if (_chatCaretTicks < 15 && gfx_get_string_width(lineBuffer, FontStyle::Medium) < (_chatWidth - 10))
|
if (_chatCaretTicks < 15 && gfx_get_string_width(lineBuffer, FontStyle::Medium) < (_chatWidth - 10))
|
||||||
|
@ -204,7 +204,7 @@ void chat_draw(rct_drawpixelinfo* dpi, uint8_t chatBackgroundColor)
|
||||||
int32_t caretX = screenCoords.x + gfx_get_string_width(lineBuffer, FontStyle::Medium);
|
int32_t caretX = screenCoords.x + gfx_get_string_width(lineBuffer, FontStyle::Medium);
|
||||||
int32_t caretY = screenCoords.y + 14;
|
int32_t caretY = screenCoords.y + 14;
|
||||||
|
|
||||||
gfx_fill_rect(dpi, { { caretX, caretY }, { caretX + 6, caretY + 1 } }, PALETTE_INDEX_56);
|
GfxFillRect(dpi, { { caretX, caretY }, { caretX + 6, caretY + 1 } }, PALETTE_INDEX_56);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1067,7 +1067,7 @@ static int32_t cc_set(InteractiveConsole& console, const arguments_t& argv)
|
||||||
float newScale = static_cast<float>(0.001 * std::trunc(1000 * double_val[0]));
|
float newScale = static_cast<float>(0.001 * std::trunc(1000 * double_val[0]));
|
||||||
gConfigGeneral.WindowScale = std::clamp(newScale, 0.5f, 5.0f);
|
gConfigGeneral.WindowScale = std::clamp(newScale, 0.5f, 5.0f);
|
||||||
ConfigSaveDefault();
|
ConfigSaveDefault();
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
ContextTriggerResize();
|
ContextTriggerResize();
|
||||||
ContextUpdateCursorScale();
|
ContextUpdateCursorScale();
|
||||||
console.Execute("get window_scale");
|
console.Execute("get window_scale");
|
||||||
|
@ -1184,7 +1184,7 @@ static int32_t cc_set(InteractiveConsole& console, const arguments_t& argv)
|
||||||
console.WriteLineError("Invalid variable.");
|
console.WriteLineError("Invalid variable.");
|
||||||
}
|
}
|
||||||
|
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1264,7 +1264,7 @@ static int32_t cc_load_object(InteractiveConsole& console, const arguments_t& ar
|
||||||
ContextBroadcastIntent(&intent);
|
ContextBroadcastIntent(&intent);
|
||||||
|
|
||||||
gWindowUpdateTicks = 0;
|
gWindowUpdateTicks = 0;
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
console.WriteLine("Object file loaded.");
|
console.WriteLine("Object file loaded.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1405,7 +1405,7 @@ static int32_t cc_remove_park_fences(InteractiveConsole& console, [[maybe_unused
|
||||||
}
|
}
|
||||||
} while (TileElementIteratorNext(&it));
|
} while (TileElementIteratorNext(&it));
|
||||||
|
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
|
|
||||||
console.WriteFormatLine("Park fences have been removed.");
|
console.WriteFormatLine("Park fences have been removed.");
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -844,7 +844,7 @@ void viewport_render(
|
||||||
#ifdef DEBUG_SHOW_DIRTY_BOX
|
#ifdef DEBUG_SHOW_DIRTY_BOX
|
||||||
// FIXME g_viewport_list doesn't exist anymore
|
// FIXME g_viewport_list doesn't exist anymore
|
||||||
if (viewport != g_viewport_list)
|
if (viewport != g_viewport_list)
|
||||||
gfx_fill_rect_inset(dpi, { dirtyBoxTopLeft, dirtyBoxTopRight }, 0x2, INSET_RECT_F_30);
|
GfxFillRectInset(dpi, { dirtyBoxTopLeft, dirtyBoxTopRight }, 0x2, INSET_RECT_F_30);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -935,7 +935,7 @@ static void viewport_paint_column(PaintSession& session)
|
||||||
{
|
{
|
||||||
colour = COLOUR_BLACK;
|
colour = COLOUR_BLACK;
|
||||||
}
|
}
|
||||||
gfx_clear(&session.DPI, colour);
|
GfxClear(&session.DPI, colour);
|
||||||
}
|
}
|
||||||
|
|
||||||
PaintDrawStructs(session);
|
PaintDrawStructs(session);
|
||||||
|
@ -1107,7 +1107,7 @@ static void viewport_paint_weather_gloom(rct_drawpixelinfo* dpi)
|
||||||
auto y = dpi->y;
|
auto y = dpi->y;
|
||||||
auto w = zoomLevel.ApplyInversedTo(dpi->width) - 1;
|
auto w = zoomLevel.ApplyInversedTo(dpi->width) - 1;
|
||||||
auto h = zoomLevel.ApplyInversedTo(dpi->height) - 1;
|
auto h = zoomLevel.ApplyInversedTo(dpi->height) - 1;
|
||||||
gfx_filter_rect(dpi, ScreenRect(x, y, x + w, y + h), paletteId);
|
GfxFilterRect(dpi, ScreenRect(x, y, x + w, y + h), paletteId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1975,7 +1975,7 @@ void viewport_invalidate(const rct_viewport* viewport, const ScreenRect& screenR
|
||||||
bottomRight = { viewport->zoom.ApplyInversedTo(bottomRight.x), viewport->zoom.ApplyInversedTo(bottomRight.y) };
|
bottomRight = { viewport->zoom.ApplyInversedTo(bottomRight.x), viewport->zoom.ApplyInversedTo(bottomRight.y) };
|
||||||
bottomRight += viewport->pos;
|
bottomRight += viewport->pos;
|
||||||
|
|
||||||
gfx_set_dirty_blocks({ topLeft, bottomRight });
|
GfxSetDirtyBlocks({ topLeft, bottomRight });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -547,8 +547,8 @@ void widget_invalidate(rct_window& w, WidgetIndex widgetIndex)
|
||||||
if (widget.left == -2)
|
if (widget.left == -2)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
gfx_set_dirty_blocks({ { w.windowPos + ScreenCoordsXY{ widget.left, widget.top } },
|
GfxSetDirtyBlocks({ { w.windowPos + ScreenCoordsXY{ widget.left, widget.top } },
|
||||||
{ w.windowPos + ScreenCoordsXY{ widget.right + 1, widget.bottom + 1 } } });
|
{ w.windowPos + ScreenCoordsXY{ widget.right + 1, widget.bottom + 1 } } });
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename TPred> static void widget_invalidate_by_condition(TPred pred)
|
template<typename TPred> static void widget_invalidate_by_condition(TPred pred)
|
||||||
|
@ -1732,7 +1732,7 @@ void window_resize_gui(int32_t width, int32_t height)
|
||||||
optionsWind->windowPos.x = width - 80;
|
optionsWind->windowPos.x = width - 80;
|
||||||
}
|
}
|
||||||
|
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -25,7 +25,7 @@ void rct_window::ScrollToViewport()
|
||||||
|
|
||||||
void rct_window::Invalidate()
|
void rct_window::Invalidate()
|
||||||
{
|
{
|
||||||
gfx_set_dirty_blocks({ windowPos, windowPos + ScreenCoordsXY{ width, height } });
|
GfxSetDirtyBlocks({ windowPos, windowPos + ScreenCoordsXY{ width, height } });
|
||||||
}
|
}
|
||||||
|
|
||||||
void rct_window::RemoveViewport()
|
void rct_window::RemoveViewport()
|
||||||
|
|
|
@ -209,7 +209,7 @@ void NetworkBase::Close()
|
||||||
scriptEngine.RemoveNetworkPlugins();
|
scriptEngine.RemoveNetworkPlugins();
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
|
|
||||||
_requireClose = false;
|
_requireClose = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,7 @@ void WaterObject::Load()
|
||||||
_legacyType.palette_index_1 = _legacyType.image_id + 1;
|
_legacyType.palette_index_1 = _legacyType.image_id + 1;
|
||||||
_legacyType.palette_index_2 = _legacyType.image_id + 4;
|
_legacyType.palette_index_2 = _legacyType.image_id + 4;
|
||||||
|
|
||||||
load_palette();
|
LoadPalette();
|
||||||
}
|
}
|
||||||
|
|
||||||
void WaterObject::Unload()
|
void WaterObject::Unload()
|
||||||
|
|
|
@ -626,28 +626,28 @@ static void PaintPSImageWithBoundingBoxes(rct_drawpixelinfo* dpi, PaintStruct* p
|
||||||
const auto screenCoordBackBottom = Translate3DTo2DWithZ(rotation, backBottom);
|
const auto screenCoordBackBottom = Translate3DTo2DWithZ(rotation, backBottom);
|
||||||
|
|
||||||
// bottom square
|
// bottom square
|
||||||
gfx_draw_line(dpi, { screenCoordFrontBottom, screenCoordLeftBottom }, colour);
|
GfxDrawLine(dpi, { screenCoordFrontBottom, screenCoordLeftBottom }, colour);
|
||||||
gfx_draw_line(dpi, { screenCoordBackBottom, screenCoordLeftBottom }, colour);
|
GfxDrawLine(dpi, { screenCoordBackBottom, screenCoordLeftBottom }, colour);
|
||||||
gfx_draw_line(dpi, { screenCoordBackBottom, screenCoordRightBottom }, colour);
|
GfxDrawLine(dpi, { screenCoordBackBottom, screenCoordRightBottom }, colour);
|
||||||
gfx_draw_line(dpi, { screenCoordFrontBottom, screenCoordRightBottom }, colour);
|
GfxDrawLine(dpi, { screenCoordFrontBottom, screenCoordRightBottom }, colour);
|
||||||
|
|
||||||
// vertical back + sides
|
// vertical back + sides
|
||||||
gfx_draw_line(dpi, { screenCoordBackTop, screenCoordBackBottom }, colour);
|
GfxDrawLine(dpi, { screenCoordBackTop, screenCoordBackBottom }, colour);
|
||||||
gfx_draw_line(dpi, { screenCoordLeftTop, screenCoordLeftBottom }, colour);
|
GfxDrawLine(dpi, { screenCoordLeftTop, screenCoordLeftBottom }, colour);
|
||||||
gfx_draw_line(dpi, { screenCoordRightTop, screenCoordRightBottom }, colour);
|
GfxDrawLine(dpi, { screenCoordRightTop, screenCoordRightBottom }, colour);
|
||||||
|
|
||||||
// top square back
|
// top square back
|
||||||
gfx_draw_line(dpi, { screenCoordBackTop, screenCoordLeftTop }, colour);
|
GfxDrawLine(dpi, { screenCoordBackTop, screenCoordLeftTop }, colour);
|
||||||
gfx_draw_line(dpi, { screenCoordBackTop, screenCoordRightTop }, colour);
|
GfxDrawLine(dpi, { screenCoordBackTop, screenCoordRightTop }, colour);
|
||||||
|
|
||||||
gfx_draw_sprite(dpi, imageId, { x, y });
|
gfx_draw_sprite(dpi, imageId, { x, y });
|
||||||
|
|
||||||
// vertical front
|
// vertical front
|
||||||
gfx_draw_line(dpi, { screenCoordFrontTop, screenCoordFrontBottom }, colour);
|
GfxDrawLine(dpi, { screenCoordFrontTop, screenCoordFrontBottom }, colour);
|
||||||
|
|
||||||
// top square
|
// top square
|
||||||
gfx_draw_line(dpi, { screenCoordFrontTop, screenCoordLeftTop }, colour);
|
GfxDrawLine(dpi, { screenCoordFrontTop, screenCoordLeftTop }, colour);
|
||||||
gfx_draw_line(dpi, { screenCoordFrontTop, screenCoordRightTop }, colour);
|
GfxDrawLine(dpi, { screenCoordFrontTop, screenCoordRightTop }, colour);
|
||||||
}
|
}
|
||||||
|
|
||||||
static ImageId PaintPSColourifyImage(const PaintStruct* ps, ImageId imageId, uint32_t viewFlags)
|
static ImageId PaintPSColourifyImage(const PaintStruct* ps, ImageId imageId, uint32_t viewFlags)
|
||||||
|
|
|
@ -57,8 +57,8 @@ void Painter::Paint(IDrawingEngine& de)
|
||||||
DrawOpenRCT2(dpi, { 0, _uiContext->GetHeight() - 20 });
|
DrawOpenRCT2(dpi, { 0, _uiContext->GetHeight() - 20 });
|
||||||
}
|
}
|
||||||
|
|
||||||
gfx_draw_pickedup_peep(dpi);
|
GfxDrawPickedUpPeep(dpi);
|
||||||
gfx_invalidate_pickedup_peep();
|
GfxInvalidatePickedUpPeep();
|
||||||
|
|
||||||
de.PaintWeather();
|
de.PaintWeather();
|
||||||
}
|
}
|
||||||
|
@ -97,7 +97,7 @@ void Painter::PaintReplayNotice(rct_drawpixelinfo* dpi, const char* text)
|
||||||
gfx_draw_string(dpi, screenCoords, buffer, { COLOUR_SATURATED_RED });
|
gfx_draw_string(dpi, screenCoords, buffer, { COLOUR_SATURATED_RED });
|
||||||
|
|
||||||
// Make area dirty so the text doesn't get drawn over the last
|
// Make area dirty so the text doesn't get drawn over the last
|
||||||
gfx_set_dirty_blocks({ screenCoords, screenCoords + ScreenCoordsXY{ stringWidth, 16 } });
|
GfxSetDirtyBlocks({ screenCoords, screenCoords + ScreenCoordsXY{ stringWidth, 16 } });
|
||||||
}
|
}
|
||||||
|
|
||||||
void Painter::PaintFPS(rct_drawpixelinfo* dpi)
|
void Painter::PaintFPS(rct_drawpixelinfo* dpi)
|
||||||
|
@ -115,7 +115,7 @@ void Painter::PaintFPS(rct_drawpixelinfo* dpi)
|
||||||
gfx_draw_string(dpi, screenCoords, buffer);
|
gfx_draw_string(dpi, screenCoords, buffer);
|
||||||
|
|
||||||
// Make area dirty so the text doesn't get drawn over the last
|
// Make area dirty so the text doesn't get drawn over the last
|
||||||
gfx_set_dirty_blocks({ { screenCoords - ScreenCoordsXY{ 16, 4 } }, { dpi->lastStringPos.x + 16, 16 } });
|
GfxSetDirtyBlocks({ { screenCoords - ScreenCoordsXY{ 16, 4 } }, { dpi->lastStringPos.x + 16, 16 } });
|
||||||
}
|
}
|
||||||
|
|
||||||
void Painter::MeasureFPS()
|
void Painter::MeasureFPS()
|
||||||
|
|
|
@ -2344,7 +2344,7 @@ int32_t scenario_save(u8string_view path, int32_t flags)
|
||||||
Formatter ft;
|
Formatter ft;
|
||||||
ft.Add<const char*>(e.what());
|
ft.Add<const char*>(e.what());
|
||||||
ContextShowError(STR_FILE_DIALOG_TITLE_SAVE_SCENARIO, STR_STRING, ft);
|
ContextShowError(STR_FILE_DIALOG_TITLE_SAVE_SCENARIO, STR_STRING, ft);
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
|
|
||||||
auto ctx = OpenRCT2::GetContext();
|
auto ctx = OpenRCT2::GetContext();
|
||||||
auto uictx = ctx->GetUiContext();
|
auto uictx = ctx->GetUiContext();
|
||||||
|
@ -2367,7 +2367,7 @@ int32_t scenario_save(u8string_view path, int32_t flags)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
|
|
||||||
if (result && !(flags & S6_SAVE_FLAG_AUTOMATIC))
|
if (result && !(flags & S6_SAVE_FLAG_AUTOMATIC))
|
||||||
{
|
{
|
||||||
|
|
|
@ -47,7 +47,7 @@ namespace Platform
|
||||||
|
|
||||||
InitTicks();
|
InitTicks();
|
||||||
bitcount_init();
|
bitcount_init();
|
||||||
mask_init();
|
MaskInit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4549,7 +4549,7 @@ void ride_update_vehicle_colours(const Ride& ride)
|
||||||
{
|
{
|
||||||
if (ride.type == RIDE_TYPE_SPACE_RINGS || ride.GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_VEHICLE_IS_INTEGRAL))
|
if (ride.type == RIDE_TYPE_SPACE_RINGS || ride.GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_VEHICLE_IS_INTEGRAL))
|
||||||
{
|
{
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int32_t i = 0; i <= OpenRCT2::Limits::MaxTrainsPerRide; i++)
|
for (int32_t i = 0; i <= OpenRCT2::Limits::MaxTrainsPerRide; i++)
|
||||||
|
|
|
@ -118,7 +118,7 @@ void track_design_save_select_nearby_scenery(RideId rideIndex)
|
||||||
}
|
}
|
||||||
} while (TileElementIteratorNext(&it));
|
} while (TileElementIteratorNext(&it));
|
||||||
|
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -128,7 +128,7 @@ void track_design_save_select_nearby_scenery(RideId rideIndex)
|
||||||
void track_design_save_reset_scenery()
|
void track_design_save_reset_scenery()
|
||||||
{
|
{
|
||||||
track_design_save_init();
|
track_design_save_init();
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool track_design_save_contains_tile_element(const TileElement* tileElement)
|
bool track_design_save_contains_tile_element(const TileElement* tileElement)
|
||||||
|
|
|
@ -273,7 +273,7 @@ namespace OpenRCT2::Scripting
|
||||||
if (park.Name != value)
|
if (park.Name != value)
|
||||||
{
|
{
|
||||||
park.Name = std::move(value);
|
park.Name = std::move(value);
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -291,7 +291,7 @@ namespace OpenRCT2::Scripting
|
||||||
gParkFlags |= mask;
|
gParkFlags |= mask;
|
||||||
else
|
else
|
||||||
gParkFlags &= ~mask;
|
gParkFlags &= ~mask;
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::shared_ptr<ScParkMessage>> ScPark::messages_get() const
|
std::vector<std::shared_ptr<ScParkMessage>> ScPark::messages_get() const
|
||||||
|
|
|
@ -321,7 +321,7 @@ bool TitleScreen::TryLoadSequence(bool loadPreview)
|
||||||
gConfigInterface.CurrentTitleSequencePreset = configId;
|
gConfigInterface.CurrentTitleSequencePreset = configId;
|
||||||
}
|
}
|
||||||
_currentSequence = targetSequence;
|
_currentSequence = targetSequence;
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
targetSequence = (targetSequence + 1) % numSequences;
|
targetSequence = (targetSequence + 1) % numSequences;
|
||||||
|
@ -446,7 +446,7 @@ void DrawOpenRCT2(rct_drawpixelinfo* dpi, const ScreenCoordsXY& screenCoords)
|
||||||
|
|
||||||
// Invalidate screen area
|
// Invalidate screen area
|
||||||
int16_t width = static_cast<int16_t>(gfx_get_string_width(buffer, FontStyle::Medium));
|
int16_t width = static_cast<int16_t>(gfx_get_string_width(buffer, FontStyle::Medium));
|
||||||
gfx_set_dirty_blocks(
|
GfxSetDirtyBlocks(
|
||||||
{ screenCoords, screenCoords + ScreenCoordsXY{ width, 30 } }); // 30 is an arbitrary height to catch both strings
|
{ screenCoords, screenCoords + ScreenCoordsXY{ width, 30 } }); // 30 is an arbitrary height to catch both strings
|
||||||
|
|
||||||
// Write platform information
|
// Write platform information
|
||||||
|
|
|
@ -163,7 +163,7 @@ void ClimateUpdate()
|
||||||
{
|
{
|
||||||
gClimateCurrent.WeatherGloom = ClimateStepWeatherLevel(
|
gClimateCurrent.WeatherGloom = ClimateStepWeatherLevel(
|
||||||
gClimateCurrent.WeatherGloom, gClimateNext.WeatherGloom);
|
gClimateCurrent.WeatherGloom, gClimateNext.WeatherGloom);
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -211,7 +211,7 @@ void ClimateForceWeather(WeatherType weather)
|
||||||
ClimateUpdate();
|
ClimateUpdate();
|
||||||
|
|
||||||
// In case of change in gloom level force a complete redraw
|
// In case of change in gloom level force a complete redraw
|
||||||
gfx_invalidate_screen();
|
GfxInvalidateScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClimateUpdateSound()
|
void ClimateUpdateSound()
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue