Main Page | Data Structures | Directories | File List | Data Fields | Globals

pbar.h

Go to the documentation of this file.
00001 /* pbar.h: handles rate-of-change indicators 
00002  * This file is part of lincity.
00003  * Lincity is copyright (c) I J Peters 1995-1997, (c) Greg Sharp 1997-2001.
00004  * Portions copyright (c) 2001 Corey Keasling.
00005  * ---------------------------------------------------------------------- */
00006 
00007 #ifndef _pbar_h
00008 #define _pbar_h
00009 
00010 #include "geometry.h"
00011 
00012 void init_pbars (void);
00013 void pbars_full_refresh (void);
00014 void init_pbar_text (void);
00015 void draw_pbar (Rect* b, char* graphic);
00016 void draw_pbars (void);
00017 void clear_pbar_text (Rect* pbar);
00018 void write_pbar_int (Rect* b, int val);
00019 void write_pbar_text (Rect* b, char * s);
00020 void refresh_pbars (void);
00021 void refresh_population_text (void);
00022 
00023 void update_pbar (int pbar_num, int value, int month_flag);
00024 void update_pbars_daily(void);
00025 void update_pbars_monthly(void);
00026 int compute_pbar_offset (Rect* b, int val);
00027 void draw_pbar_new (Rect* b, int val);
00028 void pbar_mouse(int rawx, int rawy, int button);
00029 
00030 /* Constants */
00031 
00032 #define PBAR_POP_X      (PBAR_AREA_X + 4)
00033 #define PBAR_POP_Y      (PBAR_AREA_Y + 4)
00034 #define PBAR_TECH_X     PBAR_POP_X
00035 #define PBAR_TECH_Y     PBAR_POP_Y+(PBAR_H+1)
00036 #define PBAR_FOOD_X     PBAR_POP_X
00037 #define PBAR_FOOD_Y     PBAR_POP_Y+(PBAR_H+1)*2
00038 #define PBAR_JOBS_X     PBAR_POP_X
00039 #define PBAR_JOBS_Y     PBAR_POP_Y+(PBAR_H+1)*3
00040 #define PBAR_COAL_X     PBAR_POP_X
00041 #define PBAR_COAL_Y     PBAR_POP_Y+(PBAR_H+1)*4
00042 #define PBAR_GOODS_X    PBAR_POP_X
00043 #define PBAR_GOODS_Y    PBAR_POP_Y+(PBAR_H+1)*5
00044 #define PBAR_ORE_X      PBAR_POP_X
00045 #define PBAR_ORE_Y      PBAR_POP_Y+(PBAR_H+1)*6
00046 #define PBAR_STEEL_X    PBAR_POP_X
00047 #define PBAR_STEEL_Y    PBAR_POP_Y+(PBAR_H+1)*7
00048 #define PBAR_MONEY_X    PBAR_POP_X
00049 #define PBAR_MONEY_Y    PBAR_POP_Y+(PBAR_H+1)*8
00050 
00051 /* Type:Position constants for pbars struct */
00052 
00053 #define PPOP 0
00054 #define PTECH 1
00055 #define PFOOD 2
00056 #define PJOBS 3
00057 #define PMONEY 4
00058 #define PCOAL 5
00059 #define PGOODS 6
00060 #define PORE 7
00061 #define PSTEEL 8
00062 
00063 
00064 #define NUM_PBARS 9
00065 
00066 /* Number of elements per pbar */
00067 #define PBAR_DATA_SIZE 12
00068 
00069 struct pbar_st 
00070 {
00071     int oldtot;
00072     int tot;
00073     int diff;
00074 
00075     int data_size;
00076     int data[PBAR_DATA_SIZE];
00077 };
00078 
00079 extern struct pbar_st pbars[NUM_PBARS];
00080 
00081 #endif
00082 
00083 
00084 
00085 

Generated on Sun Dec 26 11:23:26 2004 for lincity by  doxygen 1.3.9.1