mElite  1.0
An Elite clone based on TextElite by Jan-Philipp Kappmeier and Melanie Schmidt.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Static Public Member Functions | List of all members
FileAccess Class Reference

Static class which allows all the file access. More...

#include <FileAccess.h>

Static Public Member Functions

static TextureSlot getPlanetSlot (unsigned int index)
 Gives the TextureSlot that is assigned to a given index.
 
static std::string getTextureFile (TextureName texture)
 Returns the filename for a given texture.
 
static TextureAccess getTextureInfo (TextureName texture)
 Returns the TextureInfo for a given texture.
 
static void loadTexture (TextureSlot slot, TextureName texture)
 
static std::string getObjectFile (ObjectName object)
 
static ObjectAccess getObjectInfo (ObjectName object)
 
static Vector3 getObjectView (ObjectName object)
 
static float getObjectFactor (ObjectName object)
 
static void loadObject (ObjectName object)
 Loads a 3d object from a file.
 

Detailed Description

Static class which allows all the file access.

Handling the file access means all accesses to textures and objects are handled. Included are methods to load files containt images and 3d game objects, retrieving information about loaded objects and modify them in a way that they can be used in the program.

Definition at line 58 of file FileAccess.h.

Member Function Documentation

float FileAccess::getObjectFactor ( ObjectName  object)
static

Returns the scale factor of a given object.

Parameters
objectthe given object

Definition at line 115 of file FileAccess.cpp.

string FileAccess::getObjectFile ( ObjectName  object)
static

Returns the filename for an object given as ObjectName.

Parameters
objectthe given object

Definition at line 90 of file FileAccess.cpp.

ObjectAccess FileAccess::getObjectInfo ( ObjectName  object)
static

Returns the information for a given object. Returned are the filename and the view direction of the object.

Parameters
objectthe given object

Definition at line 99 of file FileAccess.cpp.

Vector3 FileAccess::getObjectView ( ObjectName  object)
static

Returns the view direction of a given object.

Parameters
objectthe given object

Definition at line 107 of file FileAccess.cpp.

TextureSlot FileAccess::getPlanetSlot ( unsigned int  index)
static

Gives the TextureSlot that is assigned to a given index.

It is mainly a translation function to translate from an integer to a TextureSlot.

Parameters
indexnumber of the planet slot whose nome is asked for

Definition at line 22 of file FileAccess.cpp.

string FileAccess::getTextureFile ( TextureName  texture)
static

Returns the filename for a given texture.

The filename is created from the information in the static textureInfos[] array. If a texture is available in different sizes, an suffix is added to the name.

Parameters
texturename of the texture

Definition at line 36 of file FileAccess.cpp.

TextureAccess FileAccess::getTextureInfo ( TextureName  texture)
static

Returns the TextureInfo for a given texture.

Returns are the name, the filetype and the information if the texture exists in multiple qualities.

Parameters
texturethe texture name

Definition at line 69 of file FileAccess.cpp.

void FileAccess::loadObject ( ObjectName  object)
static

Loads a 3d object from a file.

In this procedure a file is loaded, the meshs are extracted and a display list is created.

Parameters
objectthe given object

Definition at line 126 of file FileAccess.cpp.

void FileAccess::loadTexture ( TextureSlot  slot,
TextureName  texture 
)
static

Loads a texture which is provided as a TextureName into a TextureSlot.

This is procedure is done because the number of simultaneous loaded textures should be limited.

Parameters
slotthe slot in which the texture should be loaded
texturethe texture

Definition at line 81 of file FileAccess.cpp.


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