Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Terrain Class Reference

#include </home/clem/local/src/opie/noncore/games/sfcave-sdl/terrain.h>

Inheritance diagram for Terrain:

Inheritance graph
[legend]
Collaboration diagram for Terrain:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Terrain (int w, int h, bool drawTop=true, bool drawBottom=true)
virtual ~Terrain ()
virtual void initTerrain ()
virtual void moveTerrain (int amountToMove)
virtual bool checkCollision (int x, int y, int h)
virtual void drawTerrain (SDL_Surface *screen)
int getMapTop (int pos)
int getMapBottom (int pos)
int getMaxHeight ()
void increaseMaxHeight (int amount)

Public Attributes

int offset

Protected Member Functions

void setPoint (int point)

Protected Attributes

int sWidth
int sHeight
int drawTop
int drawBottom
int mapTop [MAPSIZE]
int mapBottom [MAPSIZE]
int maxTop
int maxBottom
int maxHeight
int dir
int speed
int segSize
SDL_Surface * terrainSurface
StarFieldstars

Constructor & Destructor Documentation

Terrain::Terrain int  w,
int  h,
bool  drawTop = true,
bool  drawBottom = true
 

Definition at line 11 of file terrain.cpp.

References initTerrain(), MAPSIZE, segSize, sHeight, speed, stars, sWidth, and terrainSurface.

Terrain::~Terrain  )  [virtual]
 

Definition at line 31 of file terrain.cpp.

References stars, and terrainSurface.


Member Function Documentation

bool Terrain::checkCollision int  x,
int  y,
int  h
[virtual]
 

Definition at line 208 of file terrain.cpp.

References getpixel(), sHeight, and terrainSurface.

Referenced by SFCaveGame::checkCollisions(), GatesGame::checkCollisions(), and FlyGame::checkCollisions().

void Terrain::drawTerrain SDL_Surface *  screen  )  [virtual]
 

Reimplemented in FlyTerrain.

Definition at line 189 of file terrain.cpp.

References StarField::draw(), offset, sHeight, stars, sWidth, and terrainSurface.

Referenced by SFCaveGame::draw(), GatesGame::draw(), FlyGame::draw(), and FlyTerrain::drawTerrain().

int Terrain::getMapBottom int  pos  )  [inline]
 

Definition at line 19 of file terrain.h.

References mapBottom.

Referenced by SFCaveGame::addBlock(), GatesGame::addGate(), and FlyGame::update().

int Terrain::getMapTop int  pos  )  [inline]
 

Definition at line 18 of file terrain.h.

References mapTop.

Referenced by SFCaveGame::addBlock(), and GatesGame::addGate().

int Terrain::getMaxHeight  )  [inline]
 

Definition at line 20 of file terrain.h.

References maxHeight.

Referenced by SFCaveGame::update().

void Terrain::increaseMaxHeight int  amount  ) 
 

Definition at line 184 of file terrain.cpp.

References maxHeight.

Referenced by SFCaveGame::update().

void Terrain::initTerrain  )  [virtual]
 

Definition at line 37 of file terrain.cpp.

References dir, drawBottom, drawTop, i, mapBottom, MAPSIZE, mapTop, maxHeight, nextInt, offset, segSize, setPoint(), sHeight, and terrainSurface.

Referenced by Game::init(), and Terrain().

void Terrain::moveTerrain int  amountToMove  )  [virtual]
 

Definition at line 88 of file terrain.cpp.

References drawBottom, drawTop, i, mapBottom, MAPSIZE, mapTop, StarField::move(), offset, segSize, setPoint(), sHeight, speed, stars, sWidth, and terrainSurface.

Referenced by SFCaveGame::update(), GatesGame::update(), and FlyGame::update().

void Terrain::setPoint int  point  )  [protected]
 

Reimplemented in FlyTerrain.

Definition at line 164 of file terrain.cpp.

References dir, mapBottom, mapTop, maxHeight, nextInt, and sHeight.

Referenced by initTerrain(), and moveTerrain().


Member Data Documentation

int Terrain::dir [protected]
 

Definition at line 38 of file terrain.h.

Referenced by initTerrain(), setPoint(), and FlyTerrain::setPoint().

int Terrain::drawBottom [protected]
 

Definition at line 30 of file terrain.h.

Referenced by initTerrain(), and moveTerrain().

int Terrain::drawTop [protected]
 

Definition at line 29 of file terrain.h.

Referenced by initTerrain(), and moveTerrain().

int Terrain::mapBottom[MAPSIZE] [protected]
 

Definition at line 33 of file terrain.h.

Referenced by FlyTerrain::drawTerrain(), getMapBottom(), initTerrain(), moveTerrain(), setPoint(), and FlyTerrain::setPoint().

int Terrain::mapTop[MAPSIZE] [protected]
 

Definition at line 32 of file terrain.h.

Referenced by getMapTop(), initTerrain(), moveTerrain(), and setPoint().

int Terrain::maxBottom [protected]
 

Definition at line 35 of file terrain.h.

int Terrain::maxHeight [protected]
 

Definition at line 37 of file terrain.h.

Referenced by getMaxHeight(), increaseMaxHeight(), initTerrain(), setPoint(), and FlyTerrain::setPoint().

int Terrain::maxTop [protected]
 

Definition at line 34 of file terrain.h.

int Terrain::offset
 

Definition at line 23 of file terrain.h.

Referenced by drawTerrain(), FlyTerrain::drawTerrain(), initTerrain(), and moveTerrain().

int Terrain::segSize [protected]
 

Definition at line 40 of file terrain.h.

Referenced by FlyTerrain::drawTerrain(), initTerrain(), moveTerrain(), and Terrain().

int Terrain::sHeight [protected]
 

Definition at line 27 of file terrain.h.

Referenced by checkCollision(), drawTerrain(), initTerrain(), moveTerrain(), setPoint(), FlyTerrain::setPoint(), and Terrain().

int Terrain::speed [protected]
 

Definition at line 39 of file terrain.h.

Referenced by FlyTerrain::drawTerrain(), moveTerrain(), and Terrain().

StarField* Terrain::stars [protected]
 

Definition at line 43 of file terrain.h.

Referenced by drawTerrain(), moveTerrain(), Terrain(), and ~Terrain().

int Terrain::sWidth [protected]
 

Definition at line 26 of file terrain.h.

Referenced by drawTerrain(), moveTerrain(), and Terrain().

SDL_Surface* Terrain::terrainSurface [protected]
 

Definition at line 42 of file terrain.h.

Referenced by checkCollision(), drawTerrain(), initTerrain(), moveTerrain(), Terrain(), and ~Terrain().


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 17:53:33 2005 for OPIE by  doxygen 1.4.2