Starshatter_Open
Open source Starshatter engine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Sprite Class Reference

#include <Sprite.h>

Inheritance diagram for Sprite:
Graphic DriveSprite

List of all members.

Public Member Functions

 Sprite ()
 Sprite (Bitmap *animation, int length=1, int repeat=1, int share=1)
virtual ~Sprite ()
virtual void Render (Video *video, DWORD flags)
virtual void Render2D (Video *video)
virtual void Update ()
virtual void Scale (double scale)
virtual void Rescale (double scale)
virtual void Reshape (int w1, int h1)
int Width () const
int Height () const
int Looping () const
int NumFrames () const
double FrameRate () const
void SetFrameRate (double rate)
double Shade () const
void SetShade (double s)
double Angle () const
void SetAngle (double a)
int BlendMode () const
void SetBlendMode (int a)
int Filter () const
void SetFilter (int f)
virtual void SetAnimation (Bitmap *animation, int length=1, int repeat=1, int share=1)
virtual void SetTexCoords (const double *uv_interleaved)
BitmapFrame () const
void SetFrameIndex (int n)
virtual bool IsSprite () const
- Public Member Functions inherited from Graphic
 Graphic ()
virtual ~Graphic ()
int operator== (const Graphic &g) const
int operator< (const Graphic &g) const
int operator<= (const Graphic &g) const
virtual void SetOrientation (const Matrix &o)
virtual int CollidesWith (Graphic &o)
int Identity () const
const char * Name () const
bool IsVisible () const
void SetVisible (bool v)
float Radius () const
Point Location () const
virtual void MoveTo (const Point &p)
virtual void TranslateBy (const Point &ref)
virtual float Depth () const
virtual void SetDepth (float d)
virtual int IsInfinite () const
virtual void SetInfinite (bool b)
virtual int IsForeground () const
virtual void SetForeground (bool f)
virtual int IsBackground () const
virtual void SetBackground (bool b)
virtual int Hidden () const
virtual int Life () const
virtual void Destroy ()
virtual void Hide ()
virtual void Show ()
virtual bool Luminous () const
virtual void SetLuminous (bool l)
virtual bool Translucent () const
virtual bool CastsShadow () const
virtual void SetShadow (bool s)
virtual bool IsSolid () const
virtual bool IsBolt () const
virtual bool IsQuad () const
virtual void ProjectScreenRect (Projector *p)
const RectScreenRect () const
virtual SceneGetScene () const
virtual void SetScene (Scene *s)
virtual int CheckRayIntersection (Point pt, Point vpn, double len, Point &ipt, bool treat_translucent_polys_as_solid=true)
virtual bool CheckVisibility (Projector &projector)

Static Public Member Functions

static const char * TYPENAME ()
- Static Public Member Functions inherited from Graphic
static int Nearer (Graphic *a, Graphic *b)
static int Farther (Graphic *a, Graphic *b)

Protected Attributes

int w
int h
int loop
int nframes
int own_frames
Bitmapframes
int frame_index
DWORD frame_time
DWORD last_time
double shade
double angle
int blend_mode
int filter
Poly poly
Material mtl
VertexSet vset
- Protected Attributes inherited from Graphic
int id
Point loc
float depth
float radius
int life
bool visible
bool infinite
bool foreground
bool background
bool hidden
bool trans
bool shadow
bool luminous
Rect screen_rect
Scenescene
char name [32]

Additional Inherited Members

- Public Types inherited from Graphic
enum  TYPE {
  OTHER, SOLID, SPRITE, BOLT,
  QUAD
}
enum  RENDER_FLAGS {
  RENDER_SOLID = 0x0001, RENDER_ALPHA = 0x0002, RENDER_ADDITIVE = 0x0004, RENDER_FIRST_LIGHT = 0x1000,
  RENDER_ADD_LIGHT = 0x2000
}
- Static Protected Attributes inherited from Graphic
static int id_key = 1

Detailed Description

Definition at line 26 of file Sprite.h.


Constructor & Destructor Documentation

Sprite::Sprite ( )

Definition at line 25 of file Sprite.cpp.

Sprite::Sprite ( Bitmap animation,
int  length = 1,
int  repeat = 1,
int  share = 1 
)

Definition at line 57 of file Sprite.cpp.

Sprite::~Sprite ( )
virtual

Definition at line 89 of file Sprite.cpp.


Member Function Documentation

double Sprite::Angle ( ) const
inline

Definition at line 53 of file Sprite.h.

int Sprite::BlendMode ( ) const
inline

Definition at line 55 of file Sprite.h.

int Sprite::Filter ( ) const
inline

Definition at line 57 of file Sprite.h.

Bitmap * Sprite::Frame ( ) const

Definition at line 232 of file Sprite.cpp.

double Sprite::FrameRate ( ) const

Definition at line 207 of file Sprite.cpp.

int Sprite::Height ( ) const
inline

Definition at line 45 of file Sprite.h.

virtual bool Sprite::IsSprite ( ) const
inlinevirtual

Reimplemented from Graphic.

Definition at line 65 of file Sprite.h.

int Sprite::Looping ( ) const
inline

Definition at line 46 of file Sprite.h.

int Sprite::NumFrames ( ) const
inline

Definition at line 47 of file Sprite.h.

void Sprite::Render ( Video video,
DWORD  flags 
)
virtual

Reimplemented from Graphic.

Reimplemented in DriveSprite.

Definition at line 240 of file Sprite.cpp.

void Sprite::Render2D ( Video video)
virtual

Definition at line 315 of file Sprite.cpp.

void Sprite::Rescale ( double  scale)
virtual

Definition at line 115 of file Sprite.cpp.

void Sprite::Reshape ( int  w1,
int  h1 
)
virtual

Definition at line 128 of file Sprite.cpp.

void Sprite::Scale ( double  scale)
virtual

Definition at line 102 of file Sprite.cpp.

void Sprite::SetAngle ( double  a)
inline

Definition at line 54 of file Sprite.h.

void Sprite::SetAnimation ( Bitmap animation,
int  length = 1,
int  repeat = 1,
int  share = 1 
)
virtual

Definition at line 141 of file Sprite.cpp.

void Sprite::SetBlendMode ( int  a)
inline

Definition at line 56 of file Sprite.h.

void Sprite::SetFilter ( int  f)
inline

Definition at line 58 of file Sprite.h.

void Sprite::SetFrameIndex ( int  n)

Definition at line 223 of file Sprite.cpp.

void Sprite::SetFrameRate ( double  rate)

Definition at line 213 of file Sprite.cpp.

void Sprite::SetShade ( double  s)
inline

Definition at line 52 of file Sprite.h.

void Sprite::SetTexCoords ( const double *  uv_interleaved)
virtual

Definition at line 180 of file Sprite.cpp.

double Sprite::Shade ( ) const
inline

Definition at line 51 of file Sprite.h.

static const char* Sprite::TYPENAME ( )
inlinestatic

Reimplemented from Graphic.

Definition at line 29 of file Sprite.h.

void Sprite::Update ( )
virtual

Reimplemented from Graphic.

Definition at line 363 of file Sprite.cpp.

int Sprite::Width ( ) const
inline

Definition at line 44 of file Sprite.h.


Member Data Documentation

double Sprite::angle
protected

Definition at line 78 of file Sprite.h.

int Sprite::blend_mode
protected

Definition at line 79 of file Sprite.h.

int Sprite::filter
protected

Definition at line 80 of file Sprite.h.

int Sprite::frame_index
protected

Definition at line 74 of file Sprite.h.

DWORD Sprite::frame_time
protected

Definition at line 75 of file Sprite.h.

Bitmap* Sprite::frames
protected

Definition at line 73 of file Sprite.h.

int Sprite::h
protected

Definition at line 68 of file Sprite.h.

DWORD Sprite::last_time
protected

Definition at line 76 of file Sprite.h.

int Sprite::loop
protected

Definition at line 69 of file Sprite.h.

Material Sprite::mtl
protected

Definition at line 83 of file Sprite.h.

int Sprite::nframes
protected

Definition at line 71 of file Sprite.h.

int Sprite::own_frames
protected

Definition at line 72 of file Sprite.h.

Poly Sprite::poly
protected

Definition at line 82 of file Sprite.h.

double Sprite::shade
protected

Definition at line 77 of file Sprite.h.

VertexSet Sprite::vset
protected

Definition at line 84 of file Sprite.h.

int Sprite::w
protected

Definition at line 68 of file Sprite.h.


The documentation for this class was generated from the following files: