display.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define TGA_FILE_NOT_FOUND   13
#define TGA_BAD_IMAGE_TYPE   14
#define TGA_BAD_DIMENSION   15
#define TGA_BAD_BITS   16
#define TGA_BAD_DATA   17

Functions

void InitGL (int Width, int Height)
 main OpenGL initialization function
void UpdateAnimation (CWorld *ThisWorld)
 main animation routine
void DrawGLScene (CWorld *ThisWorld)
 main in-game drawing function
void DrawTiles (CWorld *ThisWorld)
 draw the background tiles
void DrawObjects (CWorld *ThisWorld)
 draw game world objects
void DrawStripe (float top, float bottom, float alpha)
 draw a horizontal stripe on the screen
void DrawCircle (float radius)
 draw a circle on the screen
void DrawStar (float radius)
 draw a 'star' on the screen
void DrawDisc (float radius)
 draw a disc on the screen
void InitStripeAlpha (void)
 utility function to set the drawing stripe to full alpha
void DrawBarGraph (float top, float bottom, float left, float right, float fillPercent)
 draws a 2D bar graph on the screen at a specified level
void DrawHUD (CWorld *ThisWorld)
 draw the heads-up display
void renderBitmapString (float x, float y, float z, void *font, char *string)
void InitTextures ()
 load textres from disk
GLuint LoadTextureRAW (const char *filename, int wrap)
 load a texture from disk
GLuint LoadTextureTGA (const char *filename, int wrap)
 loads a targa image
GLuint GetTexture (int texID)
 return the texture handle associated with a texture ID
GLuint GetFrame (int animID, int frame)
 gets the OpenGL texture ID associated with a particular frame of animation
int GetTotalFrames (int animID)
 returns the total number of frames contained in an animation
CAnimationGetAnimation (int animID)
 returns a pointer to an animation object, given it's animation ID


Define Documentation

#define TGA_BAD_BITS   16

Definition at line 46 of file display.h.

Referenced by LoadTextureTGA().

#define TGA_BAD_DATA   17

Definition at line 47 of file display.h.

Referenced by LoadTextureTGA().

#define TGA_BAD_DIMENSION   15

Definition at line 45 of file display.h.

Referenced by LoadTextureTGA().

#define TGA_BAD_IMAGE_TYPE   14

Definition at line 44 of file display.h.

Referenced by LoadTextureTGA().

#define TGA_FILE_NOT_FOUND   13

Definition at line 43 of file display.h.

Referenced by LoadTextureTGA().


Function Documentation

void DrawBarGraph ( float  top,
float  bottom,
float  left,
float  right,
float  fillPercent 
)

This function draws horizontal a 2D bar graph on the screen, allowing the screen position and dimensions to be specified, along with a value representing the percentage of the bar graph to be drawn 'filled'.

Definition at line 478 of file display.cpp.

Referenced by DrawHUD().

Here is the caller graph for this function:

void DrawCircle ( float  radius  ) 

Used for various effects, including the 'Shock Wave' effect.

Definition at line 880 of file display.cpp.

References DegreesToRadians().

Referenced by MiniShock::Draw(), and Shockwave::Draw().

Here is the call graph for this function:

Here is the caller graph for this function:

void DrawDisc ( float  radius  ) 

Used for various effects, including the 'Shock Wave' and 'Mini Shock' effects.

Definition at line 894 of file display.cpp.

References DegreesToRadians().

Referenced by Shockwave::Draw().

Here is the call graph for this function:

Here is the caller graph for this function:

void DrawGLScene ( CWorld ThisWorld  ) 

This function draws the in-game graphics. It draws the base tile-map, the world objects, and the special effects.

Definition at line 61 of file display.cpp.

References CWorld::DrawEffects(), DrawHUD(), DrawObjects(), DrawTiles(), CWorld::fFinalZoom, CWorld::fZoomBias, CObject::iHealth, CWorld::iStartingState, Vector::Magnitude(), CWorld::Player, PLAYFIELD_SIZE, CObject::Position, Vector::Reverse(), STARTINGSTATE_GO, STARTINGSTATE_IDLE, STARTINGSTATE_READY, STARTINGSTATE_RUN, STARTINGSTATE_SET, STARTINGSTATE_VICTORY, Vector::x, and Vector::y.

Referenced by PlayGame().

Here is the call graph for this function:

Here is the caller graph for this function:

void DrawHUD ( CWorld ThisWorld  ) 

Draw the heads-up information display to the screen. This includes game status information such as the players' health (bar graph), the players' current weapon and remaining ammunition, etc.

Definition at line 153 of file display.cpp.

References DrawBarGraph(), GetTexture(), CObject::iHealth, CObject::iWeapon, CWorld::Player, PLAYFIELD_SIZE, TEXID_POWERUP_BS, TEXID_POWERUP_HS, TEXID_POWERUP_LM, TEXID_POWERUP_PS, TEXID_POWERUP_SB, TEXID_TANK, WEAPONID_BOUNCY_SHOT, WEAPONID_HEAT_SEEKER, WEAPONID_LAND_MINE, WEAPONID_NULL, WEAPONID_PEA_SHOT, and WEAPONID_SUPER_BULLET.

Referenced by DrawGLScene().

Here is the call graph for this function:

Here is the caller graph for this function:

void DrawObjects ( CWorld ThisWorld  ) 

Draw all game world objects to the screen. This includes players, powerups, blocks, and walls. This will also draw 'dead' objects that haven't been removed from the world.

Definition at line 365 of file display.cpp.

References CObject::bVisible, CObject::Draw(), CObject::Next, and CWorld::Objects.

Referenced by DrawGLScene().

Here is the call graph for this function:

Here is the caller graph for this function:

void DrawStar ( float  radius  ) 

Used for various effects, including the 'Shock Wave' effect.

Definition at line 908 of file display.cpp.

References DegreesToRadians().

Referenced by Shockwave::Draw().

Here is the call graph for this function:

Here is the caller graph for this function:

void DrawStripe ( float  top,
float  bottom,
float  alpha 
)

Draw a text accentuation stripe to help text stand out when written to the screen. the strip will fade in alpha over time. Use InitStripeAlpha() to reset the stripe's opacity after updating it's position on the screen.

Definition at line 450 of file display.cpp.

References stripeAlpha.

Referenced by PlayGame().

Here is the caller graph for this function:

void DrawTiles ( CWorld ThisWorld  ) 

Draw the background tiles to the screen. This function uses a tile based method to render the backgound, one tile at a time, pulling data from the current world's tile map data array.

Definition at line 333 of file display.cpp.

References CELL_SIZE, CTile::iTexture, MAP_SIZE, textures, TILEMAP_DISTANCE, and CWorld::tiles.

Referenced by DrawGLScene().

Here is the caller graph for this function:

CAnimation* GetAnimation ( int  animID  ) 

Definition at line 635 of file display.cpp.

References animations.

Referenced by TileAnim::Draw(), and TileAnim::Step().

Here is the caller graph for this function:

GLuint GetFrame ( int  animID,
int  frame 
)

Definition at line 623 of file display.cpp.

References animations, and CAnimation::ipFrameTex.

Referenced by CObject::Draw(), and TileAnim::Draw().

Here is the caller graph for this function:

GLuint GetTexture ( int  texID  ) 

Look up the OpenGL texture handle, given the texture ID associated with it.

Definition at line 617 of file display.cpp.

References textures.

Referenced by CObject::Draw(), TileStorm::Draw(), DrawHUD(), and DrawMenuBackground().

Here is the caller graph for this function:

int GetTotalFrames ( int  animID  ) 

Definition at line 629 of file display.cpp.

References animations, and CAnimation::iTotalFrames.

void InitGL ( int  Width,
int  Height 
)

Sets all of the required OpenGL parameters to the game's defaults. Also sets up the viewing matrix.

Definition at line 36 of file display.cpp.

Referenced by main(), and ToggleFullScreen().

Here is the caller graph for this function:

void InitStripeAlpha ( void   ) 

Definition at line 437 of file display.cpp.

References stripeAlpha.

Referenced by PlayGame().

Here is the caller graph for this function:

void InitTextures (  ) 

Load all textures from disk and associate them with entries in the texture ID array.

Definition at line 500 of file display.cpp.

References animations, ANIMID_BROWN_HOP_IN, ANIMID_BROWNTANKEXPLODE, ANIMID_CRATECRUSH, ANIMID_EXPLOSION, ANIMID_GREEN_HOP_IN, ANIMID_GREENTANKEXPLODE, ANIMID_TANKROLL, CAnimation::ipFrameTex, LoadTextureTGA(), TEXID_BOUNCY_SHOT, TEXID_CRATE, TEXID_DIRT, TEXID_EZRAS_HEAD, TEXID_GRASS, TEXID_HEAT_SEEKER, TEXID_ICE, TEXID_LAND_MINE, TEXID_LAVA, TEXID_MENUBACK, TEXID_MUD, TEXID_PEA_SHOT, TEXID_POWERUP_BS, TEXID_POWERUP_HEALTH, TEXID_POWERUP_HS, TEXID_POWERUP_LM, TEXID_POWERUP_PS, TEXID_POWERUP_SB, TEXID_SAND, TEXID_SUPER_BULLET, TEXID_TANK, TEXID_TARMAC, TEXID_TNT_BLOCK, TEXID_WALL_BLOCK, TEXID_WATER, and textures.

Referenced by main(), and ToggleFullScreen().

Here is the call graph for this function:

Here is the caller graph for this function:

GLuint LoadTextureRAW ( const char *  filename,
int  wrap 
)

Load a 256x256 RGB/8 .RAW file as a texture, and return a handle to it.

Definition at line 645 of file display.cpp.

GLuint LoadTextureTGA ( const char *  filename,
int  wrap 
)

Loads a targa (.tga) image file from disk. Supported types are 8, 24 and 32 bit uncompressed images.

Definition at line 820 of file display.cpp.

References checkSize(), getData(), returnError(), TGA_BAD_BITS, TGA_BAD_DATA, TGA_BAD_DIMENSION, TGA_BAD_IMAGE_TYPE, and TGA_FILE_NOT_FOUND.

Referenced by InitTextures().

Here is the call graph for this function:

Here is the caller graph for this function:

void renderBitmapString ( float  x,
float  y,
float  z,
void *  font,
char *  string 
)

void UpdateAnimation ( CWorld ThisWorld  ) 

Update the animation frames of all the objects in the game world that are currently animating. The routine will update each object's frame using an independent delay variable, referenced to the current world's time.

Definition at line 393 of file display.cpp.

References ANIM_CYCLE_CYCLE, ANIM_CYCLE_ONESHOT, animations, CObject::bAnimating, CObject::bAnimCycle, CObject::iAnimTimeStamp, CObject::iCurrentFrame, CWorld::iCurrentTime, CObject::iNormalAnim, CObject::iNormalAnimSpeed, CAnimation::iTotalFrames, CObject::Next, and CWorld::Objects.

Referenced by PlayGame().

Here is the caller graph for this function:

 

Copyright Windsor Schmidt 2006 - All rights reserved.