Virtual U.org
Get Personal Training on VU Today
    
Top shadow
 
 register/help
User Name:

Password:

Sprite class Reference
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

Sprite Class Reference

#include <OSPRITE.H>

List of all members.

Public Types

enum  { SPRITE_IDLE = 1, SPRITE_MOVE, SPRITE_WAIT }

Public Methods

 Sprite ()
virtual ~Sprite ()
void init (short spriteId, short startX, short startY, char startSubX, char startSubY)
void deinit ()
void set_abs (int zoomLevel, int locWidth, int locHeight)
void draw (Matrix *)
void process ()
virtual void update_abs_pos ()
SpriteFramecur_sprite_frame (int *needMirror=0)

Public Attributes

short sprite_id
short sprite_recno
char mobile_type
unsigned char cur_dir
unsigned char cur_frame
unsigned char cur_action
unsigned char cur_attack
unsigned char final_dir
short cur_x
short cur_y
short go_x
short go_y
short next_x
short next_y
Rect abs_rect [MAX_ZOOM_LEVEL]
int will_not_move_next_process
SpriteInfosprite_info


Detailed Description

Class for representing and drawing possibly moving sprites (rectangular graphics stored in memory that can be transfered to the screen).

Definition at line 16 of file OSPRITE.H.


Member Enumeration Documentation

anonymous enum
 

Enumeration values:
SPRITE_IDLE 
SPRITE_MOVE 
SPRITE_WAIT 

Definition at line 19 of file OSPRITE.H.


Constructor & Destructor Documentation

Sprite::Sprite  
 

Definition at line 22 of file OSPRITE.CPP.

Sprite::~Sprite   [virtual]
 

Definition at line 30 of file OSPRITE.CPP.

References deinit().


Member Function Documentation

SpriteFrame * Sprite::cur_sprite_frame int *    needMirror = 0
 

Return the current frame of the sprite

Definition at line 86 of file OSPRITE.CPP.

References NULL.

void Sprite::deinit  
 

Definition at line 70 of file OSPRITE.CPP.

References cur_x, and cur_y.

Referenced by ~Sprite().

void Sprite::draw Matrix   matrixPtr
 

<Matrix*> matrixPtr - pointer to the current active matrix

Definition at line 232 of file OSPRITE.CPP.

void Sprite::init short    spriteId,
short    startX,
short    startY,
char    startSubX,
char    startSubY
 

Definition at line 37 of file OSPRITE.CPP.

References cur_x, cur_y, err_here, go_x, go_y, SpriteInfo::load_bitmap_res(), MAP_LOC_HEIGHT, MAP_LOC_WIDTH, next_x, next_y, set_abs(), sprite_id, sprite_info, will_not_move_next_process, ZOOM1_LOC_HEIGHT, ZOOM1_LOC_WIDTH, ZOOM2_LOC_HEIGHT, ZOOM2_LOC_WIDTH, ZOOM_LARGE, ZOOM_MEDIUM, and ZOOM_SMALL.

void Sprite::process  
 

Definition at line 301 of file OSPRITE.CPP.

References cur_x, cur_y, go_x, go_y, Location::has_sprite(), Location::is_walkable(), MAP_LOC_HEIGHT, MAP_LOC_WIDTH, set_abs(), Location::set_sprite(), sprite_recno, will_not_move_next_process, ZOOM1_LOC_HEIGHT, ZOOM1_LOC_WIDTH, ZOOM2_LOC_HEIGHT, ZOOM2_LOC_WIDTH, ZOOM_LARGE, ZOOM_MEDIUM, and ZOOM_SMALL.

Referenced by SpriteArray::process().

void Sprite::set_abs int    zoomLevel,
int    locWidth,
int    locHeight
 

Definition at line 78 of file OSPRITE.CPP.

Referenced by init(), and process().

void Sprite::update_abs_pos   [virtual]
 

called before matrix.draw()'s sorting

Definition at line 174 of file OSPRITE.CPP.


Member Data Documentation

Rect Sprite::abs_rect[MAX_ZOOM_LEVEL]
 

Definition at line 41 of file OSPRITE.H.

unsigned char Sprite::cur_action
 

Definition at line 33 of file OSPRITE.H.

unsigned char Sprite::cur_attack
 

Definition at line 34 of file OSPRITE.H.

unsigned char Sprite::cur_dir
 

Definition at line 31 of file OSPRITE.H.

unsigned char Sprite::cur_frame
 

Definition at line 32 of file OSPRITE.H.

short Sprite::cur_x
 

Definition at line 37 of file OSPRITE.H.

Referenced by deinit(), init(), and process().

short Sprite::cur_y
 

Definition at line 37 of file OSPRITE.H.

Referenced by deinit(), init(), and process().

unsigned char Sprite::final_dir
 

Definition at line 35 of file OSPRITE.H.

short Sprite::go_x
 

Definition at line 38 of file OSPRITE.H.

Referenced by init(), and process().

short Sprite::go_y
 

Definition at line 38 of file OSPRITE.H.

Referenced by init(), and process().

char Sprite::mobile_type
 

Definition at line 29 of file OSPRITE.H.

short Sprite::next_x
 

Definition at line 39 of file OSPRITE.H.

Referenced by init().

short Sprite::next_y
 

Definition at line 39 of file OSPRITE.H.

Referenced by init().

short Sprite::sprite_id
 

Definition at line 27 of file OSPRITE.H.

Referenced by init().

SpriteInfo* Sprite::sprite_info
 

Definition at line 50 of file OSPRITE.H.

Referenced by init().

short Sprite::sprite_recno
 

Definition at line 28 of file OSPRITE.H.

Referenced by SpriteArray::add(), and process().

int Sprite::will_not_move_next_process
 

Definition at line 43 of file OSPRITE.H.

Referenced by init(), and process().


The documentation for this class was generated from the following files:
Generated on Fri Aug 23 01:39:37 2002 for VirtualU by doxygen1.2.17