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

Protected Member Functions | List of all members
CPlayerColorGraphic Class Reference

#include <video.h>

Inheritance diagram for CPlayerColorGraphic:
CGraphic gcn::Image

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 colorIndex, unsigned frame, int x, int y, SDL_Surface *surface=TheScreen)
 
void DrawPlayerColorFrameClip (int colorIndex, unsigned frame, int x, int y, SDL_Surface *surface=TheScreen)
 
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 (bool flipped=false) const
 
virtual void_getData () const
 
virtual int getWidth () const
 
virtual int getHeight () const
 
void DrawClip (int x, int y, SDL_Surface *surface=TheScreen) const
 
void DrawSub (int gx, int gy, int w, int h, int x, int y, SDL_Surface *surface=TheScreen) const
 
void DrawSubCustomMod (int gx, int gy, int w, int h, int x, int y, pixelModifier modifier, const uint32_t param, SDL_Surface *surface=TheScreen) const
 
void DrawSubClip (int gx, int gy, int w, int h, int x, int y, SDL_Surface *surface=TheScreen) const
 
void DrawSubTrans (int gx, int gy, int w, int h, int x, int y, unsigned char alpha, SDL_Surface *surface=TheScreen) const
 
void DrawSubClipTrans (int gx, int gy, int w, int h, int x, int y, unsigned char alpha, SDL_Surface *surface=TheScreen) const
 
void DrawSubClipCustomMod (int gx, int gy, int w, int h, int x, int y, pixelModifier modifier, const uint32_t param, SDL_Surface *surface=TheScreen) const
 
void DrawFrame (unsigned frame, int x, int y, SDL_Surface *surface=TheScreen) const
 
void DrawFrameClip (unsigned frame, int x, int y, SDL_Surface *surface=TheScreen) const
 
void DrawFrameTrans (unsigned frame, int x, int y, int alpha, SDL_Surface *surface=TheScreen) const
 
void DrawFrameClipTrans (unsigned frame, int x, int y, int alpha, SDL_Surface *surface=TheScreen) const
 
void DrawFrameClipCustomMod (unsigned frame, int x, int y, pixelModifier modifier, const uint32_t param, SDL_Surface *surface=TheScreen) const
 
void DrawFrameX (unsigned frame, int x, int y, SDL_Surface *surface=TheScreen) const
 
void DrawFrameClipX (unsigned frame, int x, int y, SDL_Surface *surface=TheScreen) const
 
void DrawFrameTransX (unsigned frame, int x, int y, int alpha, SDL_Surface *surface=TheScreen) const
 
void DrawFrameClipTransX (unsigned frame, int x, int y, int alpha, SDL_Surface *surface=TheScreen) const
 
void Load (bool grayscale=false)
 
void Flip ()
 
void Resize (int w, int h)
 
void SetOriginalSize ()
 
bool TransparentPixel (int x, int y)
 
void SetPaletteColor (int idx, int r, int g, int b)
 
void MakeShadow (int xOffset, int yOffset)
 
void OverlayGraphic (CGraphic *other, bool mask=false)
 
void GenFramesMap ()
 
- Public Member Functions inherited from gcn::Image
 Image (void *data, int width, int height)
 
 Image (const std::string &filename)
 
virtual ~Image ()
 
virtual bool isDirty () const
 
- 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)
 
- 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_tframe_map
 Flipped surface. More...
 
frame_pos_tframeFlip_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...
 
- Protected Attributes inherited from gcn::Image
voidmData
 
int mWidth
 
int mHeight
 
bool mLoadedWithImageLoader
 
- Static Protected Attributes inherited from gcn::Image
static ImageLoadermImageLoader = NULL
 

Constructor & Destructor Documentation

◆ CPlayerColorGraphic()

CPlayerColorGraphic::CPlayerColorGraphic ( )
inlineprotected

Member Function Documentation

◆ Clone()

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

Clone a graphic

Parameters
grayscaleMake grayscale texture

◆ DrawPlayerColorFrameClip()

void CPlayerColorGraphic::DrawPlayerColorFrameClip ( int  colorIndex,
unsigned  frame,
int  x,
int  y,
SDL_Surface *  surface = TheScreen 
)

Draw graphic object clipped and with player colors.

Parameters
playerplayer number
framenumber of frame (object index)
xx coordinate on the target surface
yy coordinate on the target surface
surfacetarget surface

◆ DrawPlayerColorFrameClipX()

void CPlayerColorGraphic::DrawPlayerColorFrameClipX ( int  colorIndex,
unsigned  frame,
int  x,
int  y,
SDL_Surface *  surface = TheScreen 
)

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

Parameters
playerplayer number
framenumber of frame (object index)
xx coordinate on the target surface
yy coordinate on the target surface
surfacetarget surface

◆ ForceNew()

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

◆ Get()

CPlayerColorGraphic * CPlayerColorGraphic::Get ( const std::string &  filename)
static

Get a player color graphic object.

Parameters
filenameFilename
Returns
Graphic object

◆ New()

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

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.