mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-09 23:50:25 +00:00
(svn r8330) -Codechange: Remove num_x and num_dataset from DrawGraph.
This commit is contained in:
parent
e371c67199
commit
17c71f4557
@ -67,7 +67,6 @@ static void DrawGraph(const GraphDrawer *gw)
|
|||||||
{
|
{
|
||||||
uint x,y,old_x,old_y;
|
uint x,y,old_x,old_y;
|
||||||
int right;
|
int right;
|
||||||
int num_x, num_dataset;
|
|
||||||
const int64 *row_ptr, *col_ptr;
|
const int64 *row_ptr, *col_ptr;
|
||||||
int64 mx;
|
int64 mx;
|
||||||
int adj_height;
|
int adj_height;
|
||||||
@ -122,27 +121,26 @@ static void DrawGraph(const GraphDrawer *gw)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
assert(gw->num_on_x_axis > 0);
|
assert(gw->num_on_x_axis > 0);
|
||||||
|
assert(gw->num_dataset > 0);
|
||||||
num_dataset = gw->num_dataset;
|
|
||||||
assert(num_dataset > 0);
|
|
||||||
|
|
||||||
row_ptr = gw->cost[0];
|
row_ptr = gw->cost[0];
|
||||||
mx = 0;
|
mx = 0;
|
||||||
/* bit selection for the showing of various players, base max element
|
/* bit selection for the showing of various players, base max element
|
||||||
* on to-be shown player-information. This way the graph can scale */
|
* on to-be shown player-information. This way the graph can scale */
|
||||||
sel = gw->sel;
|
sel = gw->sel;
|
||||||
do {
|
for (int i = 0; i < gw->num_dataset; i++) {
|
||||||
if (!(sel&1)) {
|
if (!(sel&1)) {
|
||||||
num_x = gw->num_on_x_axis;
|
|
||||||
assert(num_x > 0);
|
|
||||||
col_ptr = row_ptr;
|
col_ptr = row_ptr;
|
||||||
do {
|
for (int i = 0; i < gw->num_on_x_axis; i++) {
|
||||||
if (*col_ptr != INVALID_VALUE) {
|
if (*col_ptr != INVALID_VALUE) {
|
||||||
mx = max(mx, *col_ptr);
|
mx = max(mx, *col_ptr);
|
||||||
}
|
}
|
||||||
} while (col_ptr++, --num_x);
|
col_ptr++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} while (sel>>=1, row_ptr+=24, --num_dataset);
|
sel >>= 1;
|
||||||
|
row_ptr += 24;
|
||||||
|
}
|
||||||
|
|
||||||
/* setup scaling */
|
/* setup scaling */
|
||||||
y_scaling = INVALID_VALUE;
|
y_scaling = INVALID_VALUE;
|
||||||
|
Loading…
Reference in New Issue
Block a user