Mercurial > hg > openttd
changeset 5771:ee8916154ac7 draft
(svn r8322) -Codechange: Rename unk61A and unk61C to something a little more descriptive.
author | maedhros <maedhros@openttd.org> |
---|---|
date | Sun, 21 Jan 2007 19:19:25 +0000 |
parents | 4b671cf12da6 |
children | 68fe6750b520 |
files | src/graph_gui.cpp |
diffstat | 1 files changed, 19 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/src/graph_gui.cpp +++ b/src/graph_gui.cpp @@ -33,12 +33,19 @@ uint sel; // bitmask of the players *excluded* (e.g. 11111111 means that no players are shown) byte num_dataset; byte num_on_x_axis; + bool include_neg; + byte num_vert_lines; + + /* The starting month and year that values are plotted against. If month is + * 0xFF, use x_values_start and x_values_increment below instead. */ byte month; Year year; - bool include_neg; - byte num_vert_lines; - uint16 unk61A; - uint16 unk61C; + + /* These values are used if the graph is being plotted against values + * rather than the dates specified by month and year. */ + uint16 x_values_start; + uint16 x_values_increment; + int left, top; uint height; StringID format_str_y_axis; @@ -171,14 +178,14 @@ } else { x = gw->left + 52; y = gw->top + gw->height + 1; - j = gw->unk61A; - i = gw->num_on_x_axis;assert(i>0); - do { - SetDParam(0, j); + uint16 label = gw->x_values_start; + + for (int i = 0; i < gw->num_on_x_axis; i++) { + SetDParam(0, label); DrawString(x, y, STR_01CB, GRAPH_AXIS_LABEL_COLOUR); - j += gw->unk61C; + label += gw->x_values_increment; x += 22; - } while (--i); + } } /* draw lines and dots */ @@ -712,8 +719,8 @@ gd.num_on_x_axis = 20; gd.num_vert_lines = 20; gd.month = 0xFF; - gd.unk61A = 10; - gd.unk61C = 10; + gd.x_values_start = 10; + gd.x_values_increment = 10; for (i = 0; i != NUM_CARGO; i++) { /* Since the buttons have no text, no images,