From 6258a76b960357bb72a32c0f09580503ff3fee66 Mon Sep 17 00:00:00 2001 From: Duncan Frost Date: Sun, 17 Aug 2014 10:52:12 +0100 Subject: [PATCH] Fixes upside down graph --- src/graph.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/graph.c b/src/graph.c index d29dab4415..9cb39f564c 100644 --- a/src/graph.c +++ b/src/graph.c @@ -54,7 +54,7 @@ static void graph_draw_line_a_uint8(rct_drawpixelinfo *dpi, uint8 *history, int x = baseX; for (i = count - 1; i >= 0; i--) { if (history[i] != 0 && history[i] != 255) { - y = baseY + (history[i] * 100) / 256; + y = baseY + ((255 - history[i]) * 100) / 256; if (lastX != -1) { gfx_draw_line(dpi, lastX + 1, lastY + 1, x + 1, y + 1, 10); @@ -78,7 +78,7 @@ static void graph_draw_line_b_uint8(rct_drawpixelinfo *dpi, uint8 *history, int x = baseX; for (i = count - 1; i >= 0; i--) { if (history[i] != 0 && history[i] != 255) { - y = baseY + (history[i] * 100) / 256; + y = baseY + ((255 - history[i]) * 100) / 256; if (lastX != -1) gfx_draw_line(dpi, lastX, lastY, x, y, 21);