_________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          T H E   W A R   B E G I N S
                   Stratagus - A free fantasy real time strategy game engine

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Attributes | Protected Member Functions | List of all members
CPlayerColorGraphic Class Reference

#include <video.h>

Inheritance diagram for CPlayerColorGraphic:
CGraphic gcn::Image

Public Attributes

GLuint * PlayerColorTextures [PlayerMax]
 
- Public Attributes inherited from CGraphic
std::string File
 
std::string HashFile
 Filename. More...
 
SDL_Surface * Surface
 Filename used in hash. More...
 
SDL_Surface * SurfaceFlip
 Surface. More...
 
frame_pos_t * frame_map
 Flipped surface. More...
 
frame_pos_t * frameFlip_map
 
int Width
 
int Height
 Width of a frame. More...
 
int NumFrames
 Height of a frame. More...
 
int GraphicWidth
 Number of frames. More...
 
int GraphicHeight
 Original graphic width. More...
 
int Refs
 Original graphic height. More...
 
bool Resized
 Uses of this graphic. More...
 
GLfloat TextureWidth
 Image has been resized. More...
 
GLfloat TextureHeight
 Width of the texture. More...
 
GLuint * Textures
 Height of the texture. More...
 
int NumTextures
 Texture names. More...
 
GLuint ** ColorCyclingTextures
 Number of textures. More...
 
int NumColorCycles
 Texture names. More...
 

Protected Member Functions

 CPlayerColorGraphic ()
 
- Protected Member Functions inherited from CGraphic
 CGraphic ()
 
 ~CGraphic ()
 
- Protected Member Functions inherited from gcn::Image
 Image ()
 

graphic.cpp - The general graphic functions.

void DrawPlayerColorFrameClipX (int player, unsigned frame, int x, int y)
 
void DrawPlayerColorFrameClip (int player, unsigned frame, int x, int y)
 
CPlayerColorGraphicClone (bool grayscale=false) const
 
static CPlayerColorGraphicNew (const std::string &file, int w=0, int h=0)
 
static CPlayerColorGraphicForceNew (const std::string &file, int w=0, int h=0)
 
static CPlayerColorGraphicGet (const std::string &file)
 

Additional Inherited Members

- Public Member Functions inherited from CGraphic
bool IsLoaded () const
 
virtual void * _getData () const
 
virtual int getWidth () const
 
virtual int getHeight () const
 
void DrawClip (int x, int y) const
 
void DrawSub (int gx, int gy, int w, int h, int x, int y) const
 
void DrawSubClip (int gx, int gy, int w, int h, int x, int y) const
 
void DrawSubTrans (int gx, int gy, int w, int h, int x, int y, unsigned char alpha) const
 
void DrawSubClipTrans (int gx, int gy, int w, int h, int x, int y, unsigned char alpha) const
 
void DrawFrame (unsigned frame, int x, int y) const
 
void DoDrawFrameClip (GLuint *textures, unsigned frame, int x, int y) const
 
void DrawFrameClip (unsigned frame, int x, int y) const
 
void DrawFrameTrans (unsigned frame, int x, int y, int alpha) const
 
void DrawFrameClipTrans (unsigned frame, int x, int y, int alpha) const
 
void DrawFrameX (unsigned frame, int x, int y) const
 
void DoDrawFrameClipX (GLuint *textures, unsigned frame, int x, int y) const
 
void DrawFrameClipX (unsigned frame, int x, int y) const
 
void DrawFrameTransX (unsigned frame, int x, int y, int alpha) const
 
void DrawFrameClipTransX (unsigned frame, int x, int y, int alpha) const
 
bool DeleteColorCyclingTextures ()
 
void Load (bool grayscale=false)
 
void Flip ()
 
void UseDisplayFormat ()
 
void Resize (int w, int h)
 
void SetOriginalSize ()
 
bool TransparentPixel (int x, int y)
 
void MakeShadow ()
 
void GenFramesMap ()
 
- Public Member Functions inherited from gcn::Image
 Image (void *data, int width, int height)
 
 Image (const std::string &filename)
 
virtual ~Image ()
 
- Static Public Member Functions inherited from CGraphic
static CGraphicNew (const std::string &file, int w=0, int h=0)
 
static CGraphicForceNew (const std::string &file, int w=0, int h=0)
 
static CGraphicGet (const std::string &file)
 
static void Free (CGraphic *g)
 
- Static Public Member Functions inherited from gcn::Image
static ImageLoader_getImageLoader ()
 
static void setImageLoader (ImageLoader *imageLoader)
 
- Protected Attributes inherited from gcn::Image
void * mData
 
int mWidth
 
int mHeight
 
bool mLoadedWithImageLoader
 
- Static Protected Attributes inherited from gcn::Image
static ImageLoadermImageLoader = NULL
 

Constructor & Destructor Documentation

CPlayerColorGraphic::CPlayerColorGraphic ( )
inlineprotected

Member Function Documentation

CPlayerColorGraphic * CPlayerColorGraphic::Clone ( bool  grayscale = false) const

Clone a graphic

Parameters
grayscaleMake grayscale texture
void CPlayerColorGraphic::DrawPlayerColorFrameClip ( int  player,
unsigned  frame,
int  x,
int  y 
)

Draw graphic object clipped and with player colors.

Parameters
playerplayer number
framenumber of frame (object index)
xx coordinate on the screen
yy coordinate on the screen
void CPlayerColorGraphic::DrawPlayerColorFrameClipX ( int  player,
unsigned  frame,
int  x,
int  y 
)

Draw graphic object clipped, flipped, and with player colors.

Parameters
playerplayer number
framenumber of frame (object index)
xx coordinate on the screen
yy coordinate on the screen
CPlayerColorGraphic * CPlayerColorGraphic::ForceNew ( const std::string &  file,
int  w = 0,
int  h = 0 
)
static

Make a new player color graphic object. Don't reuse a graphic from the hash table.

Parameters
fileFilename
wWidth of a frame (optional)
hHeight of a frame (optional)
Returns
New graphic object
CPlayerColorGraphic * CPlayerColorGraphic::Get ( const std::string &  filename)
static

Get a player color graphic object.

Parameters
filenameFilename
Returns
Graphic object
CPlayerColorGraphic * CPlayerColorGraphic::New ( const std::string &  filename,
int  w = 0,
int  h = 0 
)
static

Make a new player color graphic object.

Parameters
filenameFilename
wWidth of a frame (optional)
hHeight of a frame (optional)
Returns
New graphic object

Member Data Documentation

GLuint* CPlayerColorGraphic::PlayerColorTextures[PlayerMax]

The documentation for this class was generated from the following files:
(C) Copyright 1998-2012 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.