OpenXcom  1.0
Open-source clone of the original X-Com
Public Member Functions | Static Public Member Functions | List of all members
OpenXcom::ExtraSprites Class Reference

For adding a set of extra sprite data to the game. More...

#include <ExtraSprites.h>

Public Member Functions

 ExtraSprites ()
 Creates a blank external sprite set. More...
 
virtual ~ExtraSprites ()
 Cleans up the external sprite set. More...
 
void load (const YAML::Node &node, int modIndex)
 Loads the data from YAML. More...
 
std::string getType () const
 Gets the sprite's type. More...
 
std::map< int, std::string > * getSprites ()
 Gets the list of sprites defined by this mod. More...
 
int getWidth () const
 Gets the width of the surfaces (used for single images and new spritesets). More...
 
int getHeight () const
 Gets the height of the surfaces (used for single images and new spritesets). More...
 
bool getSingleImage () const
 Checks if this is a single surface, or a set of surfaces. More...
 
int getModIndex () const
 Gets the mod index for this external sprite set. More...
 
int getSubX () const
 Gets the x subdivision. More...
 
int getSubY () const
 Gets the y subdivision. More...
 
bool isLoaded () const
 Has this sprite been loaded? More...
 
SurfaceloadSurface (Surface *surface)
 Load the external sprite into a surface. More...
 
SurfaceSetloadSurfaceSet (SurfaceSet *set)
 Load the external sprite into a surface set. More...
 

Static Public Member Functions

static bool isImageFile (const std::string &filename)
 Checks if a filename is a valid image file. More...
 

Detailed Description

For adding a set of extra sprite data to the game.

Constructor & Destructor Documentation

◆ ExtraSprites()

OpenXcom::ExtraSprites::ExtraSprites ( )

Creates a blank external sprite set.

Creates a blank set of extra sprite data.

◆ ~ExtraSprites()

OpenXcom::ExtraSprites::~ExtraSprites ( )
virtual

Cleans up the external sprite set.

Cleans up the extra sprite set.

Member Function Documentation

◆ getHeight()

int OpenXcom::ExtraSprites::getHeight ( ) const

Gets the height of the surfaces (used for single images and new spritesets).

Returns
The height of the surfaces.

◆ getModIndex()

int OpenXcom::ExtraSprites::getModIndex ( ) const

Gets the mod index for this external sprite set.

Returns
The mod index.

◆ getSingleImage()

bool OpenXcom::ExtraSprites::getSingleImage ( ) const

Checks if this is a single surface, or a set of surfaces.

Returns whether this is a single surface as opposed to a set of surfaces.

Returns
True if this is a single surface.

◆ getSprites()

std::map< int, std::string > * OpenXcom::ExtraSprites::getSprites ( )

Gets the list of sprites defined by this mod.

Gets the list of sprites defined my this mod.

Returns
The list of sprites.

◆ getSubX()

int OpenXcom::ExtraSprites::getSubX ( ) const

Gets the x subdivision.

Returns
The x subdivision.

◆ getSubY()

int OpenXcom::ExtraSprites::getSubY ( ) const

Gets the y subdivision.

Returns
The y subdivision.

◆ getType()

std::string OpenXcom::ExtraSprites::getType ( ) const

Gets the sprite's type.

Gets the filename that this sprite represents.

Returns
The sprite name.

◆ getWidth()

int OpenXcom::ExtraSprites::getWidth ( ) const

Gets the width of the surfaces (used for single images and new spritesets).

Returns
The width of the surfaces.

◆ isImageFile()

bool OpenXcom::ExtraSprites::isImageFile ( const std::string &  filename)
static

Checks if a filename is a valid image file.

Determines if an image file is an acceptable format for the game.

Parameters
filenameImage filename.
Returns
True/false

◆ isLoaded()

bool OpenXcom::ExtraSprites::isLoaded ( ) const

Has this sprite been loaded?

Returns if the sprite is loaded.

Returns
True/false

◆ load()

void OpenXcom::ExtraSprites::load ( const YAML::Node &  node,
int  modIndex 
)

Loads the data from YAML.

Loads the extra sprite set from YAML.

Parameters
nodeYAML node.
modIndexthe internal index of the associated mod.

◆ loadSurface()

Surface * OpenXcom::ExtraSprites::loadSurface ( Surface surface)

Load the external sprite into a surface.

Loads the external sprite into a new or existing surface.

Parameters
surfaceExisting surface.
Returns
New surface.

◆ loadSurfaceSet()

SurfaceSet * OpenXcom::ExtraSprites::loadSurfaceSet ( SurfaceSet set)

Load the external sprite into a surface set.

Loads the external sprite into a new or existing surface set.

Parameters
setExisting surface set.
Returns
New surface set.

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