#include <zakdef.h>
#include <compilerpragmas.h>
Go to the source code of this file.
Defines | |
#define | SETAUTOBULLDOZE(X) setGameBit(sb_autobulldoze, (X)) |
#define | GETAUTOBULLDOZE() getGameBit(sb_autobulldoze) |
#define | SETMINIMAPVISIBLE(X) setGameBit(sb_showminimap, (X)) |
#define | GETMINIMAPVISIBLE() getGameBit(sb_showminimap) |
#define | SETMINIMAPDETAILED(X) setGameBit(sb_detailedminimap, (X)) |
#define | GETMINIMAPDETAILED() getGameBit(sb_detailedminimap) |
Enumerations | |
enum | graphicupdate_t { gu_playarea = (1), gu_credits = (1<<1), gu_population = (1<<2), gu_date = (1<<3), gu_location = (1<<4), gu_buildicon = (1<<5), gu_speed = (1<<6), gu_desires = (1<<7), gu_all = (1<<8) } |
thye types of things that need a graphic update More... | |
enum | gamestatusbit_t { sb_autobulldoze = (1), sb_showminimap = (1<<1), sb_detailedminimap = (1<<2) } |
these fields are to control game options. More... | |
Functions | |
EXPORT char * | getDate (char *temp) |
Get the date in the game. | |
EXPORT UInt32 | scaleNumber (UInt32 old_value, Char *scale) |
scale a number down using the K,M,B scale | |
EXPORT void * | getIndexOf (char *ary, Int16 addit, Int16 key) |
find a key in an array. | |
EXPORT UInt8 | getDisasterLevel (void) |
Get the disaster level setting of the game. | |
EXPORT void | setDisasterLevel (UInt8 value) |
Set The disaster Level of the game. | |
EXPORT UInt8 | getDifficultyLevel (void) |
Get the difficulty level of the game. | |
EXPORT void | setDifficultyLevel (UInt8 value) |
Set the difficulty level of the game. | |
EXPORT Int16 | InitWorld (void) |
initialize the world variables | |
EXPORT Int16 | ResizeWorld (UInt32 size) |
make the world of a certain size | |
EXPORT void | PurgeWorld (void) |
free all the game related structures | |
EXPORT welem_t | getWorld (UInt32 pos) |
get the item on the surface of the world | |
EXPORT void | setWorld (UInt32 pos, welem_t value) |
set the object at the position to the value in question | |
EXPORT selem_t | getWorldFlags (UInt32 pos) |
get the flag corresponding to the game location | |
EXPORT void | setWorldFlags (UInt32 pos, selem_t value) |
set the flag corresponding to the game location | |
EXPORT void | orWorldFlags (UInt32 pos, selem_t value) |
or the value with the current location of the map world flags | |
EXPORT void | andWorldFlags (UInt32 pos, selem_t value) |
and the value with the current location of the map world flags | |
EXPORT void | getWorldAndFlag (UInt32 pos, welem_t *world, selem_t *flag) |
get the values of the field and it's flag | |
EXPORT void | setWorldAndFlag (UInt32 pos, welem_t value, selem_t status) |
set the world field and field flag | |
EXPORT void | addGraphicUpdate (graphicupdate_t entity) |
add an item that needs updating in the display | |
EXPORT void | removeGraphicUpdate (graphicupdate_t entity) |
remove and item that needs updating in the display | |
EXPORT UInt8 | checkGraphicUpdate (graphicupdate_t entity) |
check that a graphic entity needs changing | |
EXPORT UInt8 | checkAnyGraphicUpdate (void) |
check that any graphic item needs repainting | |
EXPORT void | clearGraphicUpdate (void) |
clear the need update fields in their entirety | |
EXPORT void | setGameBit (gamestatusbit_t bit, UInt8 value) |
set one of the savegame status bits | |
EXPORT UInt8 | getGameBit (gamestatusbit_t bit) |
get one of the savegame status bits | |
EXPORT void | PackBits (void *src, void *dest, UInt8 nbits, UInt32 count) |
pack from src->dest count of the nbits-lowest order bits | |
EXPORT void | UnpackBits (void *src, void *dest, UInt8 nbits, UInt32 count) |
unpack from src->dest the number of bits into the count specified | |
Variables | |
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 | |
AppConfig_t | gameConfig |
This is the game configuration. | |
void * | worldPtr |
the world pointer | |
void * | flagPtr |
the flags pointer | |
void * | growablePtr |
the growable pointer |
Definition in file globals.h.
|
get the Auto Bulldoze flag Definition at line 53 of file globals.h. Referenced by IsBulldozable(), and setupOptions(). |
|
get if the minimap is supposed to be detailed Definition at line 61 of file globals.h. Referenced by setupOptions(). |
|
get if the minimap is visible Definition at line 57 of file globals.h. Referenced by CheckTextClick(), performPaintDisplay(), setupOptions(), UIPaintPlayArea(), and UIScrollDisplay(). |
|
set the Auto Bulldoze flag Definition at line 51 of file globals.h. Referenced by InitGameStruct(), and saveOptions(). |
|
set to show the minimap in a detailed form Definition at line 59 of file globals.h. Referenced by saveOptions(). |
|
set if the minimap is visible Definition at line 55 of file globals.h. Referenced by saveOptions(). |
|
these fields are to control game options.
Definition at line 44 of file globals.h. Referenced by getGameBit(), and setGameBit(). |
|
thye types of things that need a graphic update This list contains all the items that may need to be updated as a result of changes to the simulation state. It is inteded to defer the repainting of the screen until the end. By doing this we reduce the number of painting calls significantly; it only checks what needs to be done and performs it. By doing this we allow multi-threading of the simulation routine. It simply tags what needs to be painted and a separate drawing thread can take care of it. This is a significant departure from previous implementations where we repainted the items at the direct request of the command.
Definition at line 29 of file globals.h. Referenced by addGraphicUpdate(), checkGraphicUpdate(), and removeGraphicUpdate(). |
|
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(). |
|
pack from src->dest count of the nbits-lowest order bits
|
|
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
|
|
unpack from src->dest the number of bits into the count specified
|