OpenXcom  1.0
Open-source clone of the original X-Com
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | List of all members
OpenXcom::XcomResourcePack Class Reference

Resource pack for the X-Com: UFO Defense game. More...

#include <XcomResourcePack.h>

Inheritance diagram for OpenXcom::XcomResourcePack:
OpenXcom::ResourcePack

Public Member Functions

 XcomResourcePack (std::vector< std::pair< std::string, ExtraSprites * > > extraSprites, std::vector< std::pair< std::string, ExtraSounds * > > extraSounds)
 Creates the X-Com ruleset. More...
 
 ~XcomResourcePack ()
 Cleans up the X-Com ruleset.
 
void loadBattlescapeResources ()
 Loads battlescape specific resources. More...
 
bool isImageFile (std::string extension)
 Checks if an extension is a valid image file. More...
 
MusicloadMusic (MusicFormat fmt, const std::string &file, int track, float volume, CatFile *adlibcat, CatFile *aintrocat, GMCatFile *gmcat)
 Loads a specified music file. More...
 
- Public Member Functions inherited from OpenXcom::ResourcePack
 ResourcePack ()
 Create a new resource pack with a folder's contents. More...
 
virtual ~ResourcePack ()
 Cleans up the resource pack. More...
 
FontgetFont (const std::string &name) const
 Gets a particular font. More...
 
SurfacegetSurface (const std::string &name) const
 Gets a particular surface. More...
 
SurfaceSetgetSurfaceSet (const std::string &name) const
 Gets a particular surface set. More...
 
std::list< Polygon * > * getPolygons ()
 Gets the list of world polygons. More...
 
std::list< Polyline * > * getPolylines ()
 Gets the list of world polylines. More...
 
MusicgetMusic (const std::string &name) const
 Gets a particular music. More...
 
MusicgetRandomMusic (const std::string &name) const
 Gets a random music. More...
 
void playMusic (const std::string &name, bool random=false)
 Plays a particular music. More...
 
SoundgetSound (const std::string &set, unsigned int sound) const
 Gets a particular sound. More...
 
PalettegetPalette (const std::string &name) const
 Gets a particular palette. More...
 
void setPalette (SDL_Color *colors, int firstcolor=0, int ncolors=256)
 Sets a new palette. More...
 
std::vector< Uint16 > * getVoxelData ()
 Gets list of voxel data. More...
 

Detailed Description

Resource pack for the X-Com: UFO Defense game.

Constructor & Destructor Documentation

OpenXcom::XcomResourcePack::XcomResourcePack ( std::vector< std::pair< std::string, ExtraSprites * > >  extraSprites,
std::vector< std::pair< std::string, ExtraSounds * > >  extraSounds 
)

Creates the X-Com ruleset.

Initializes the resource pack by loading all the resources contained in the original game folder.

Parameters
extraSpritesList of mod extra sprites.
extraSoundsList of mod extra sounds.

Member Function Documentation

bool OpenXcom::XcomResourcePack::isImageFile ( std::string  extension)

Checks if an extension is a valid image file.

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

Parameters
extensionImage file extension.
Returns
True/false
void OpenXcom::XcomResourcePack::loadBattlescapeResources ( )

Loads battlescape specific resources.

Loads the resources required by the Battlescape.

Music * OpenXcom::XcomResourcePack::loadMusic ( MusicFormat  fmt,
const std::string &  file,
int  track,
float  volume,
CatFile adlibcat,
CatFile aintrocat,
GMCatFile gmcat 
)

Loads a specified music file.

Loads the specified music file format.

Parameters
fmtFormat of the music.
fileFilename of the music.
trackTrack number of the music, if stored in a CAT.
volumeVolume modifier of the music, if stored in a CAT.
adlibcatPointer to ADLIB.CAT if available.
aintrocatPointer to AINTRO.CAT if available.
gmcatPointer to GM.CAT if available.
Returns
Pointer to the music file, or NULL if it couldn't be loaded.

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