Main Page   Data Structures   File List   Data Fields   Globals   Related Pages  

source/ui.h File Reference

the user interface routines that need defining in any implementation More...

#include <zakdef.h>
#include <build.h>

Go to the source code of this file.

Functions

void UIProblemNotify (problem_t problem)
 notify that theres a problem in the city.

void UIDisplayError1 (char *message)
 Display and error dialog with one parameter.

void UIInitDrawing (void)
 Initialize the drawing area.

void UIFinishDrawing (void)
 finish up using the drawing area

void UIUnlockScreen (void)
 unlock the screen, allow any paused repainting to happen

void UILockScreen (void)
 lock the screen, pause any painting operations to happen

void UIPostLoadGame (void)
 UI post load game handler.

void UIInitGraphic (void)
 initialize the graphics

void UIGotoForm (Int16)
void UIPaintCredits (void)
 Draw the amount of credits on screen.

void UIPaintPopulation (void)
 Draw the population on screen.

void UIPaintDate (void)
 Draw the date on screen.

void UIPaintLocation (void)
 Draw the map position on screen.

void UIPaintBuildIcon (void)
 Update the build icon on screen.

void UIPaintSpeed (void)
 Draw the speed icon on screen.

void UIPaintDesires (void)
 Paint the desires on the display.

void UIPaintPlayArea (void)
 draw the play area

void UISetUpGraphic (void)
 Setup the graphics.

void UICheckMoney (void)
 Check if we've got dosh to do what we're asking to do.

void UIScrollDisplay (dirType direction)
 scroll the map in the appropriate direction

void _UIDrawRect (Int16 nTop, Int16 nLeft, Int16 nHeight, Int16 nWidth)
 in theory draw a rectangle.

void UIPaintField (UInt16 xpos, UInt16 ypos, welem_t nGraphic)
 draw a field

void UIPaintSpecialObject (UInt16 xpos, UInt16 ypos, Int8 i)
 Draw a special object.

void UIPaintSpecialUnit (UInt16 xpos, UInt16 ypos, Int8 i)
 draw a special unit on the screen

void UIPaintCursor (UInt16 xpos, UInt16 ypos)
 draw a cursor at the location specified

void UIPaintPowerLoss (UInt16 xpos, UInt16 ypos)
 Draw a power loss overlay on the screen at the specified location.

void UIPaintWaterLoss (UInt16 xpos, UInt16 ypos)
 Draw a water loss overlay on the screen at the specified location.

BuildCode UIGetSelectedBuildItem (void)
 get the selected item to build

void MapHasJumped (void)
 the map has jumped to another location

UInt32 GetRandomNumber (UInt32 max)
 get a random number between 0 and max

void UIPaintMapField (UInt16 xpos, UInt16 ypos, welem_t elem)
 update an individual position on the map

void UIPaintMapStatus (UInt16 xpos, UInt16 ypos, welem_t world, selem_t status)
 update a map status position

Int8 UIClipped (UInt16 xpos, UInt16 ypos)
 check if the map location is being clipped by the game

void UIMapResize (void)
 map being resized, do UI related elements

void UIUpdateMap (UInt16 xpos, UInt16 ypos)
 update a map location


Detailed Description

the user interface routines that need defining in any implementation

These are all the functions that need implementing if you want to make the game work.

Definition in file ui.h.


Function Documentation

UInt32 GetRandomNumber UInt32    max
 

get a random number between 0 and max

Parameters:
max  the maximum limit of the value to obtain
Returns:
the random number

Definition at line 1868 of file simcity.c.

References UInt32.

Referenced by CreateDragon(), CreateForest(), CreateForests(), CreateFullRiver(), CreateMeteor(), CreateMonster(), DoCommitmentNasties(), DoNastyStuffTo(), DoRandomDisaster(), DoSpecificDisaster(), GetRandomZone(), MeteorDisaster(), MonsterCheckSurrounded(), MoveAllObjects(), and UpdateDisasters().

void MapHasJumped void   
 

the map has jumped to another location

Ensure that the scroll bars are moved correctly.

Definition at line 2273 of file simcity.c.

References main_window::drawing, mw, main_window::sc_hor, and main_window::sc_vert.

Referenced by doOpen(), DoSpecificDisaster(), and ImportOneFromGame().

void UICheckMoney void   
 

Check if we've got dosh to do what we're asking to do.

unused

Definition at line 2263 of file simcity.c.

Referenced by Sim_DoPhase().

Int8 UIClipped UInt16    xpos,
UInt16    ypos
 

check if the map location is being clipped by the game

Parameters:
xpos  the x position on the map
ypos  the y position on the map
Returns:
true if the point on the map is clipped, and therefore not visible

Definition at line 2175 of file simcity.c.

References UInt16.

Referenced by DrawFieldWithoutInit(), PaintLossIcon(), UIPaintField(), UIPaintSpecialObject(), and UIPaintSpecialUnit().

void UIDisplayError1 char *    error
 

Display and error dialog with one parameter.

Parameters:
error  the message to use in the dialog

Definition at line 1423 of file simcity.c.

References mw, and main_window::window.

Referenced by BuildSomething(), and UIProblemNotify().

void UIFinishDrawing void   
 

finish up using the drawing area

unused

Definition at line 1440 of file simcity.c.

Referenced by DrawCross(), DrawField(), performPaintDisplay(), and UIScrollDisplay().

BuildCode UIGetSelectedBuildItem void   
 

get the selected item to build

Returns:
the item that is selected.

Definition at line 1202 of file simcity.c.

Referenced by BuildSomething().

void UIGotoForm Int16    n
 

unused

Definition at line 929 of file simcity.c.

References Int16.

Referenced by hBudget(), and hMap().

void UIInitDrawing void   
 

Initialize the drawing area.

unused

Definition at line 1432 of file simcity.c.

Referenced by DrawCross(), DrawField(), performPaintDisplay(), and UIScrollDisplay().

void UIInitGraphic void   
 

initialize the graphics

Todo:
fix this routine.

Definition at line 1211 of file simcity.c.

References image_pms::filename, image_pixmaps, image_pms::mask, mw, PATHSEARCH, image_pms::pm, searchForFile(), and main_window::window.

Referenced by InitGraphic().

void UILockScreen void   
 

lock the screen, pause any painting operations to happen

unused

Definition at line 1460 of file simcity.c.

Referenced by CreateMeteor().

void UIMapResize void   
 

map being resized, do UI related elements

The resizing of the map corresponds to recreating the backing map area as well as the backing play area.

Definition at line 359 of file map.c.

References clearPaintedFlag(), getMapHeight, getMapWidth, mw, main_window::p_play, and resizeMap().

Referenced by PostLoadGame(), and setMapSize().

void UIPaintCursor UInt16    xpos,
UInt16    ypos
 

draw a cursor at the location specified

Parameters:
xpos  the xposition
ypos  the y position

Definition at line 1544 of file simcity.c.

References UInt16.

Referenced by DrawFieldWithoutInit(), and UIScrollDisplay().

void UIPaintField UInt16    xpos,
UInt16    ypos,
welem_t    nGraphic
 

draw a field

Parameters:
xpos  the horizontal position
ypos  the vertical position
nGraphic  the item to paint

Definition at line 1683 of file simcity.c.

References main_window::drawing, HORIZONTAL_TILESIZE, mw, main_window::p_play, main_window::p_zones, UInt16, and welem_t.

Referenced by DrawFieldWithoutInit().

void UIPaintMapField UInt16    xpos,
UInt16    ypos,
welem_t    elem
 

update an individual position on the map

this would consist of painting it's location, as well as the power and water items for that location. It is the map version of UIDrawField.

Parameters:
xpos  the x position
ypos  the y position
elem  the item to paint on the map

Definition at line 374 of file map.c.

References tag_pmh::allmap, doPixPaint(), pmh, UIDrawMapZone(), UInt16, and welem_t.

Referenced by BuildSomething(), and DrawFieldWithoutInit().

void UIPaintMapStatus UInt16    xpos,
UInt16    ypos,
welem_t    world,
selem_t    status
 

update a map status position

Parameters:
xpos  the x position on the map
ypos  the y position on the map
world  the world pointer
status  the status of the zone

Definition at line 365 of file map.c.

References checkCommon(), POWEREDBIT, selem_t, UInt16, updatePower(), updateWater(), WATEREDBIT, and welem_t.

Referenced by BuildSomething(), and DrawFieldWithoutInit().

void UIPaintPowerLoss UInt16    xpos,
UInt16    ypos
 

Draw a power loss overlay on the screen at the specified location.

The field has already been determined to not have power

Definition at line 1607 of file simcity.c.

References DrawOverlay(), and UInt16.

Referenced by DrawFieldWithoutInit().

void UIPaintSpecialObject UInt16    xpos,
UInt16    ypos,
Int8    i
 

Draw a special object.

Parameters:
xpos  the horizontal position
ypos  the vertical position
i  the item to draw

Definition at line 1651 of file simcity.c.

References main_window::drawing, Int8, mw, main_window::p_monsters, main_window::p_monsters_m, main_window::p_play, and UInt16.

Referenced by DrawFieldWithoutInit().

void UIPaintSpecialUnit UInt16    xpos,
UInt16    ypos,
Int8    i
 

draw a special unit on the screen

Parameters:
i  the unit number being painted (index)
xpos  the x position of the unit in tiles
ypos  the y position of the unit in tiles

Definition at line 1619 of file simcity.c.

References main_window::drawing, Int8, mw, main_window::p_play, main_window::p_units, main_window::p_units_m, and UInt16.

Referenced by DrawFieldWithoutInit().

void UIPaintWaterLoss UInt16    xpos,
UInt16    ypos
 

Draw a water loss overlay on the screen at the specified location.

The Field has already been determined to not have water.

Definition at line 1596 of file simcity.c.

References DrawOverlay(), and UInt16.

Referenced by DrawFieldWithoutInit().

void UIPostLoadGame void   
 

UI post load game handler.

unused

Definition at line 919 of file simcity.c.

Referenced by PostLoadGame().

void UIProblemNotify problem_t    problem
 

notify that theres a problem in the city.

Parameters:
problem  the problem to notify.

Definition at line 1390 of file simcity.c.

References peFineOnMoney, peFineOnPower, peFineOnWater, peLowOnMoney, peLowOnPower, peLowOnWater, peOutOfMoney, peOutOfPower, peOutOfWater, problem_t, and UIDisplayError1().

Referenced by Build_Bulldoze(), Build_Generic(), Build_Generic4(), Build_PowerLine(), Build_Rail(), Build_Road(), Build_WaterPipe(), DoDistribute(), and UICheckMoney().

void UIScrollDisplay dirType    direction
 

scroll the map in the appropriate direction

Todo:
double buffer to improve the rendering of the screen!

Definition at line 1780 of file simcity.c.

References dirType, main_window::drawing, mw, and RedrawAllFields().

Referenced by ScrollDisplay().

void UIUpdateMap UInt16    xpos,
UInt16    ypos
 

update a map location

Caused when the content on the map changes

Parameters:
xpos  the xposition on the map that changed
ypos  the y position on the map that changed

Definition at line 353 of file map.c.

References UInt16.


Generated on Mon Aug 30 19:44:18 2004 for pocketcity by doxygen1.2.18