File diff r2185:83c584e8be30 → r2186:5ee653b1b5e1
graph_gui.c
Show inline comments
 
/* $Id$ */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "table/strings.h"
 
#include "functions.h"
 
#include "window.h"
 
#include "gui.h"
 
#include "gfx.h"
 
#include "player.h"
 
#include "economy.h"
 
#include "signs.h"
 
#include "strings.h"
 
#include "debug.h"
 
#include "variables.h"
 

	
 
static uint _legend_excludebits;
 
static uint _legend_cargobits;
 

	
 
/************************/
 
/* GENERIC GRAPH DRAWER */
 
/************************/
 

	
 
enum {GRAPH_NUM = 16};
 

	
 
typedef struct GraphDrawer {
 
	uint sel; // bitmask of the players *excluded* (e.g. 11111111 means that no players are shown)
 
	byte num_dataset;
 
	byte num_on_x_axis;
 
	byte month;
 
	byte year;
 
	bool include_neg;
 
	byte num_vert_lines;
 
	uint16 unk61A;
 
	uint16 unk61C;
 
	int left, top;
 
	uint height;
 
	StringID format_str_y_axis;
 
	byte color_3, color_2, bg_line_color;
 
	byte colors[GRAPH_NUM];
 
	uint64 cost[GRAPH_NUM][24]; // last 2 years
 
} GraphDrawer;
 

	
 
#define INVALID_VALUE 0x80000000
 

	
 
static void DrawGraph(GraphDrawer *gw)
 
{
 

	
 
	int i,j,k;
 
	uint x,y,old_x,old_y;