Main Page   Data Structures   File List   Data Fields   Globals   Related Pages  

source/drawing.c File Reference

routines to deal with drawing More...

#include <locking.h>
#include <ui.h>
#include <zakdef.h>
#include <globals.h>
#include <drawing.h>
#include <simulation.h>

Go to the source code of this file.

Functions

void InitGraphic (void)
 initialize the graphics.

void Goto (UInt16 x, UInt16 y, goto_code center)
 Set the map position to that location.

void RedrawAllFields (void)
 Draw everything on the screen.

void ScrollDisplay (dirType direction)
 Scroll the map in the direction specified.

void MoveCursor (dirType direction)
 Move the cursor in the location specified.

void DrawField (UInt16 xpos, UInt16 ypos)
 Draw the field at the specified location.

void DrawCross (UInt16 xpos, UInt16 ypos, UInt16 xsize, UInt16 ysize)
 Draw all zones around the point that is being painted.

void DrawFieldWithoutInit (UInt16 xpos, UInt16 ypos)
 draw a field without initializing something.

welem_t GetGraphicNumber (UInt32 pos)
 Get the graphic to use for the position in question.


Detailed Description

routines to deal with drawing

This module contains all the routines that are used to paint and place items on the display

Definition in file drawing.c.


Function Documentation

void DrawCross UInt16    xpos,
UInt16    ypos,
UInt16    xsize,
UInt16    ysize
 

Draw all zones around the point that is being painted.

Parameters:
xpos  horizontal position
ypos  vertical position
xsize  the size on the x-axis
ysize  the size on the y-axis

Definition at line 149 of file drawing.c.

References DrawFieldWithoutInit(), getMapHeight, getMapWidth, UIFinishDrawing(), UIInitDrawing(), and UInt16.

Referenced by Build_Defence(), Build_Destroy(), Build_Generic(), Build_Generic4(), Build_PowerLine(), Build_Rail(), Build_Road(), Build_WaterPipe(), BurnField(), CreateWaste(), MoveAllObjects(), RemoveAllDefence(), and RemoveDefence().

void DrawField UInt16    xpos,
UInt16    ypos
 

Draw the field at the specified location.

Parameters:
xpos  horizontal position
ypos  vertical position

Definition at line 139 of file drawing.c.

References DrawFieldWithoutInit(), UIFinishDrawing(), UIInitDrawing(), and UInt16.

Referenced by CreateDragon(), CreateMonster(), MoveAllObjects(), and MoveCursor().

void DrawFieldWithoutInit UInt16    xpos,
UInt16    ypos
 

draw a field without initializing something.

ONLY call this function if you make sure to call UIInitDrawing and UIFinishDrawing in the caller Also remember to call (Un)lockWorld (2 functions)

This function will not try to draw outside the bounds of the current world, or the defined 'clipping region'

Parameters:
xpos  horizontal position
ypos  vertical position

Definition at line 177 of file drawing.c.

References CarryPower(), CarryWater(), GetGraphicNumber(), getMapHeight, getMapWidth, getWorldAndFlag(), Int8, NUM_OF_OBJECTS, NUM_OF_UNITS, orWorldFlags(), PAINTEDBIT, POWEREDBIT, selem_t, UIClipped(), UInt16, UInt32, UIPaintCursor(), UIPaintField(), UIPaintMapField(), UIPaintMapStatus(), UIPaintPowerLoss(), UIPaintSpecialObject(), UIPaintSpecialUnit(), UIPaintWaterLoss(), WATEREDBIT, welem_t, and WORLDPOS.

Referenced by DowngradeZone(), DrawCross(), DrawField(), UIDrawPlayArea(), UIPaintPlayArea(), and UIScrollDisplay().

welem_t GetGraphicNumber UInt32    pos
 

Get the graphic to use for the position in question.

Parameters:
pos  index into map array
Returns:
the graphic to paint at this location

Definition at line 229 of file drawing.c.

References getWorld(), IsPowerLine(), IsRail(), IsRoad(), IsWaterPipe(), UInt32, and welem_t.

Referenced by BuildSomething(), and DrawFieldWithoutInit().

void Goto UInt16    x,
UInt16    y,
goto_code    center
 

Set the map position to that location.

Todo:
should only do visuals and location.

Definition at line 24 of file drawing.c.

References getMapHeight, getMapWidth, goto_code, Int16, Int8, RedrawAllFields(), and UInt16.

Referenced by DoSpecificDisaster(), hMap(), and scrollbar().

void MoveCursor dirType    direction
 

Move the cursor in the location specified.

Parameters:
direction  the direction to scroll map in

Definition at line 93 of file drawing.c.

References dirType, DrawField(), dtDown, dtLeft, dtRight, dtUp, getMapHeight, getMapWidth, LockZone(), lz_flags, lz_world, ScrollDisplay(), UInt16, and UnlockZone().

void RedrawAllFields void   
 

Draw everything on the screen.

The Game area, Credits and population.

Definition at line 48 of file drawing.c.

References addGraphicUpdate(), and gu_all.

Referenced by CreateMeteor(), DrawGame(), Goto(), and UIScrollDisplay().

void ScrollDisplay dirType    direction
 

Scroll the map in the direction specified.

Parameters:
direction  the direction to scroll map in

Definition at line 54 of file drawing.c.

References dirType, dtDown, dtLeft, dtRight, dtUp, getMapHeight, getMapWidth, Int8, and UIScrollDisplay().

Referenced by doButtonEvent(), and MoveCursor().


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