#include <config.h>
#include <zakdef.h>
#include <stdio.h>
#include <mem_compat.h>
#include <logging.h>
#include <locking.h>
#include <ui.h>
#include <stack.h>
#include <globals.h>
Go to the source code of this file.
Functions | |
void | addGraphicUpdate (graphicupdate_t entity) |
add an item that needs updating in the display | |
void | removeGraphicUpdate (graphicupdate_t entity) |
remove and item that needs updating in the display | |
UInt8 | checkGraphicUpdate (graphicupdate_t entity) |
check that a graphic entity needs changing | |
UInt8 | checkAnyGraphicUpdate (void) |
check that any graphic item needs repainting | |
void | clearGraphicUpdate (void) |
clear the need update fields in their entirety | |
char * | getDate (char *temp) |
Get the date in the game. | |
void * | getIndexOf (char *ary, Int16 addit, Int16 key) |
find a key in an array. | |
UInt8 | getDisasterLevel (void) |
Get the disaster level setting of the game. | |
void | setDisasterLevel (UInt8 value) |
Set The disaster Level of the game. | |
UInt8 | getDifficultyLevel (void) |
Get the difficulty level of the game. | |
void | setDifficultyLevel (UInt8 value) |
Set the difficulty level of the game. | |
Int16 | ResizeWorld (UInt32 size) |
make the world of a certain size | |
Int16 | InitWorld (void) |
initialize the world variables | |
welem_t | getWorld (UInt32 pos) |
get the item on the surface of the world | |
void | setWorld (UInt32 pos, welem_t value) |
set the object at the position to the value in question | |
void | setWorldAndFlag (UInt32 pos, welem_t value, selem_t status) |
set the world field and field flag | |
selem_t | getWorldFlags (UInt32 pos) |
get the flag corresponding to the game location | |
void | setWorldFlags (UInt32 pos, selem_t value) |
set the flag corresponding to the game location | |
void | andWorldFlags (UInt32 pos, selem_t value) |
and the value with the current location of the map world flags | |
void | orWorldFlags (UInt32 pos, selem_t value) |
or the value with the current location of the map world flags | |
void | getWorldAndFlag (UInt32 pos, welem_t *world, selem_t *flag) |
get the values of the field and it's flag | |
void | PurgeWorld (void) |
free all the game related structures | |
UInt32 | scaleNumber (UInt32 old_value, Char *scale) |
scale a number down using the K,M,B scale | |
void | setGameBit (gamestatusbit_t bit, UInt8 value) |
set one of the savegame status bits | |
UInt8 | getGameBit (gamestatusbit_t bit) |
get one of the savegame status bits | |
Variables | |
stat_to_value | statvalues [] |
the statistic to value array | |
GameStruct | game |
this is the central game struct | |
vGameStruct | vgame |
This is the volatile game structure (memoizing to reduce op/s). | |
vGameVisuals | visuals |
the game 'visuals' - tilesize and the likes | |
void * | worldPtr |
the world pointer | |
void * | flagPtr |
the flags pointer | |
void * | growablePtr |
the growable pointer | |
AppConfig_t | gameConfig |
This is the game configuration. | |
UInt16 | needchange |
the varaible used to record what elements of the world need change |
This contains routines for working on the difficulty, disaster level of the simulation, as well as displaying the date.
Definition in file globals.c.
|
add an item that needs updating in the display
Definition at line 74 of file globals.c. References graphicupdate_t, gu_all, and needchange. Referenced by doButtonEvent(), RedrawAllFields(), Sim_Distribute_Specific(), Sim_DoPhase(), and SpendMoney(). |
|
and the value with the current location of the map world flags
Definition at line 324 of file globals.c. References flagPtr, MapMul, selem_t, and UInt32. Referenced by DoDistribute(). |
|
check that any graphic item needs repainting
Definition at line 108 of file globals.c. References needchange. |
|
check that a graphic entity needs changing
Definition at line 98 of file globals.c. References graphicupdate_t, and needchange. Referenced by performPaintDisplay(). |
|
Get the date in the game.
Definition at line 129 of file globals.c. References getMonthsElapsed, getMonthString(), and UInt16. Referenced by UIDrawDate(), and UIPaintDate(). |
|
Get the difficulty level of the game.
Definition at line 187 of file globals.c. Referenced by ConfigureNewGame(), NewGame(), and setupOptions(). |
|
Get the disaster level setting of the game.
Definition at line 166 of file globals.c. Referenced by DoRandomDisaster(), and setupOptions(). |
|
get one of the savegame status bits
Definition at line 410 of file globals.c. References gamestatusbit_t. |
|
find a key in an array. Array is an array of possibly structs with key as the first element
Definition at line 151 of file globals.c. References Int16. |
|
get the item on the surface of the world
Definition at line 254 of file globals.c. References MapMul, UInt32, welem_t, and worldPtr. Referenced by Build_Bulldoze(), Build_Destroy(), Build_Generic(), Build_Generic4(), Build_PowerLine(), Build_Rail(), Build_Road(), Build_WaterPipe(), BurnField(), CheckNextTo1(), CreateDragon(), CreateForest(), CreateMeteor(), CreateMonster(), CreateWaste(), DistributeUnvisited(), DoCommitmentNasties(), DoDistribute(), DoNastyStuffTo(), DoRandomDisaster(), DowngradeZone(), ExistsNextto(), GetGraphicNumber(), GetRandomZone(), GetZoneScore(), RenderMaps(), UpdateDisasters(), and UpdateVolatiles(). |
|
get the values of the field and it's flag
Definition at line 351 of file globals.c. References flagPtr, MapMul, selem_t, UInt32, welem_t, and worldPtr. Referenced by DrawFieldWithoutInit(), hoverUpdate(), and querySetup(). |
|
get the flag corresponding to the game location
Definition at line 298 of file globals.c. References flagPtr, MapMul, selem_t, and UInt32. Referenced by DistributeUnvisited(), DoDistribute(), GetZoneScore(), SetSupplied(), and UIDrawPlayArea(). |
|
initialize the world variables
Definition at line 243 of file globals.c. Referenced by PCityMain(). |
|
or the value with the current location of the map world flags
Definition at line 337 of file globals.c. References flagPtr, MapMul, selem_t, and UInt32. Referenced by DrawFieldWithoutInit(), and SetSupplied(). |
|
remove and item that needs updating in the display
Definition at line 87 of file globals.c. References graphicupdate_t, and needchange. |
|
make the world of a certain size This, naturally erases the current world map.
Definition at line 212 of file globals.c. References flagPtr, gMemSet, Int32, LockZone(), lz_flags, lz_world, seOutOfMemory, UInt32, UnlockZone(), and worldPtr. Referenced by setMapSize(). |
|
scale a number down using the K,M,B scale Don't use the value returned for any math! it's for display only.
Definition at line 378 of file globals.c. Referenced by UIPaintCredits(), UIPaintPopulation(), and updateBudgetValue(). |
|
Set the difficulty level of the game.
Definition at line 197 of file globals.c. References UInt8. Referenced by cnCreateButtonPressed(), NewGame(), and saveOptions(). |
|
Set The disaster Level of the game.
Definition at line 176 of file globals.c. References UInt8. Referenced by cnCreateButtonPressed(), InitGameStruct(), NewGame(), and saveOptions(). |
|
set one of the savegame status bits
Definition at line 398 of file globals.c. References gamestatusbit_t, and UInt8. |
|
set the object at the position to the value in question
Definition at line 268 of file globals.c. References MapMul, UInt32, welem_t, and worldPtr. Referenced by DowngradeZone(). |
|
set the world field and field flag
Definition at line 283 of file globals.c. References flagPtr, MapMul, selem_t, UInt32, welem_t, and worldPtr. Referenced by Build_Destroy(), Build_Generic(), Build_Generic4(), Build_PowerLine(), Build_Rail(), Build_Road(), Build_WaterPipe(), BurnField(), CreateForest(), CreateFullRiver(), CreateMeteor(), CreateWaste(), and UpdateDisasters(). |
|
set the flag corresponding to the game location
|
|
Initial value: { CONFIG_VERSION, DEFAULT_APPCONFIG }
|
|
Initial value: { { st_cashflow, bc_cashflow }, { st_pollution, bc_pollution }, { st_crime, bc_crime }, { st_residential, bc_value_residential }, { st_commercial, bc_value_commercial }, { st_industrial, bc_value_industrial }, { st_tail, 0 } } this is used to produce the graphs. As all the values in the BuildCount array are 32bit values and all the statistic items are 16 bit values an amount of shifting is done to the build count value once it exceeds the maximum 16bit value |