Meteor2D  dev internal
Meteor is a lightweight 2D game engine.
Loading...
Searching...
No Matches
meteor::MAssetManager Class Reference

AssetManager handles asset loads and cleanup. AssetManager maintains references to loaded asset, to avoid duplicate asset loads. More...

#include <assetmanager.h>

Inheritance diagram for meteor::MAssetManager:

Public Member Functions

MTexturegetTexture (std::string path, bool relative=true)
 Gets a Texture reference loaded from provided disk path.
 
MAnimationMapgetAnimationMap (std::string path, bool relative=true)
 Gets a AnimationMap reference loaded from provided disk path.
 
pugi::xml_document * getSceneDefinition (std::string path, bool relative=true)
 Gets a XmlDocument reference loaded from provided disk path.
 
pugi::xml_document * getUIDefinition (std::string path, bool relative=true)
 Gets a XmlDocument reference loaded from provided disk path.
 
MAudioClipgetAudioClip (std::string path, bool relative=true)
 Gets a AudioClip reference loaded from provided disk path.
 
void cleanup ()
 cleans up all cached assets in memory, IMP: DO NOT CALL!!
 
- Public Member Functions inherited from meteor::MEntity
virtual bool equals (MEntity *other)
 Checks equality between two entities.
 
std::string getName ()
 
void setName (std::string name)
 Sets name of entity.
 
virtual std::string toString ()
 Get this object as a string.
 

Static Public Member Functions

static MAssetManagergetInstance ()
 Gets singleton instance to AssetManager.
 

Additional Inherited Members

- Protected Attributes inherited from meteor::MEntity
std::string name
 

Detailed Description

AssetManager handles asset loads and cleanup. AssetManager maintains references to loaded asset, to avoid duplicate asset loads.

Member Function Documentation

◆ getAnimationMap()

MAnimationMap * meteor::MAssetManager::getAnimationMap ( std::string path,
bool relative = true )

Gets a AnimationMap reference loaded from provided disk path.

Parameters
pathPath to .anim file.
relativetrue by default, defines if path is relative or absolute
Returns
AnimationMap reference.

◆ getAudioClip()

MAudioClip * meteor::MAssetManager::getAudioClip ( std::string path,
bool relative = true )

Gets a AudioClip reference loaded from provided disk path.

Parameters
pathPath to audio file.
relativetrue by default, defines if path is relative or absolute
Returns
AudioClip reference.

◆ getInstance()

static MAssetManager * meteor::MAssetManager::getInstance ( )
static

Gets singleton instance to AssetManager.

Returns
AssetManager refrence.

◆ getSceneDefinition()

pugi::xml_document * meteor::MAssetManager::getSceneDefinition ( std::string path,
bool relative = true )

Gets a XmlDocument reference loaded from provided disk path.

Parameters
pathPath to .scml file.
relativetrue by default, defines if path is relative or absolute
Returns
XmlDocument reference.

◆ getTexture()

MTexture * meteor::MAssetManager::getTexture ( std::string path,
bool relative = true )

Gets a Texture reference loaded from provided disk path.

Parameters
pathPath to Texture file.
relativetrue by default, defines if path is relative or absolute
Returns
Texture reference.

◆ getUIDefinition()

pugi::xml_document * meteor::MAssetManager::getUIDefinition ( std::string path,
bool relative = true )

Gets a XmlDocument reference loaded from provided disk path.

Parameters
pathPath to .uiml file.
relativetrue by default, defines if path is relative or absolute
Returns
XmlDocument reference.