Use ScreenCoordsXY on Graph::Draw

This commit is contained in:
Tulio Leao 2021-03-27 00:16:22 -03:00
parent d34dc3c924
commit eab297f9ff
3 changed files with 10 additions and 9 deletions

View File

@ -287,12 +287,12 @@ namespace Graph
}
void Draw(
rct_drawpixelinfo* dpi, const money32* history, const int32_t count, const int32_t baseX, const int32_t baseY,
rct_drawpixelinfo* dpi, const money32* history, const int32_t count, const ScreenCoordsXY& screenCoords,
const int32_t modifier, const int32_t offset)
{
DrawMonths(dpi, history, count, baseX, baseY);
DrawLineA(dpi, history, count, baseX, baseY, modifier, offset);
DrawLineB(dpi, history, count, baseX, baseY, modifier, offset);
DrawHoveredValue(dpi, history, count, baseX, baseY, modifier, offset);
DrawMonths(dpi, history, count, screenCoords.x, screenCoords.y);
DrawLineA(dpi, history, count, screenCoords.x, screenCoords.y, modifier, offset);
DrawLineB(dpi, history, count, screenCoords.x, screenCoords.y, modifier, offset);
DrawHoveredValue(dpi, history, count, screenCoords.x, screenCoords.y, modifier, offset);
}
} // namespace Graph

View File

@ -12,12 +12,13 @@
#include <openrct2/common.h>
#include <openrct2/drawing/Drawing.h>
#include <openrct2/world/Location.hpp>
namespace Graph
{
void Draw(rct_drawpixelinfo* dpi, uint8_t* history, int32_t count, int32_t baseX, int32_t baseY);
void Draw(
rct_drawpixelinfo* dpi, const money32* history, const int32_t count, const int32_t baseX, const int32_t baseY,
rct_drawpixelinfo* dpi, const money32* history, const int32_t count, const ScreenCoordsXY& coords,
const int32_t modifier, const int32_t offset);
} // namespace Graph

View File

@ -760,7 +760,7 @@ static void window_finances_financial_graph_paint(rct_window* w, rct_drawpixelin
// X axis labels and values
coords = graphTopLeft + ScreenCoordsXY{ 98, 17 };
Graph::Draw(dpi, gCashHistory, 64, coords.x, coords.y, yAxisScale, 128);
Graph::Draw(dpi, gCashHistory, 64, coords, yAxisScale, 128);
}
#pragma endregion
@ -863,7 +863,7 @@ static void window_finances_park_value_graph_paint(rct_window* w, rct_drawpixeli
// X axis labels and values
coords = graphTopLeft + ScreenCoordsXY{ 98, 17 };
Graph::Draw(dpi, gParkValueHistory, 64, coords.x, coords.y, yAxisScale, 0);
Graph::Draw(dpi, gParkValueHistory, 64, coords, yAxisScale, 0);
}
#pragma endregion
@ -967,7 +967,7 @@ static void window_finances_profit_graph_paint(rct_window* w, rct_drawpixelinfo*
// X axis labels and values
screenPos = graphTopLeft + ScreenCoordsXY{ 98, 17 };
Graph::Draw(dpi, gWeeklyProfitHistory, 64, screenPos.x, screenPos.y, yAxisScale, 128);
Graph::Draw(dpi, gWeeklyProfitHistory, 64, screenPos, yAxisScale, 128);
}
#pragma endregion