Meteor2D  dev internal
Meteor is a lightweight 2D game engine.
Loading...
Searching...
No Matches
assetmanager.h
1#pragma once
2#include <2d/texture.h>
3#include <2d/animationmap.h>
4#include <audio/audioclip.h>
5#include <pugixml/pugixml.hpp>
6#include <map>
7
8namespace meteor {
13 class MAssetManager : public MEntity {
14 public:
21 MTexture* getTexture(std::string path, bool relative = true);
28 MAnimationMap* getAnimationMap(std::string path, bool relative = true);
35 pugi::xml_document* getSceneDefinition(std::string path, bool relative = true);
42 pugi::xml_document* getUIDefinition(std::string path, bool relative = true);
49 MAudioClip* getAudioClip(std::string path, bool relative = true);
53 void cleanup();
59
60 private:
61 std::map<std::string, MTexture*> texMap;
62 std::map<std::string, MAnimationMap*> animMap;
63 std::map<std::string, pugi::xml_document*> xmlMap;
64 std::map<std::string, MAudioClip*> audioMap;
65
66 static MAssetManager* instance;
67
68 pugi::xml_document* getXmlDocument(std::string path);
69 };
70}
This class holds the relationship between SpriteSheets and Animation name. Needs to be created using ...
Definition animationmap.h:10
AssetManager handles asset loads and cleanup. AssetManager maintains references to loaded asset,...
Definition assetmanager.h:13
MTexture * getTexture(std::string path, bool relative=true)
Gets a Texture reference loaded from provided disk path.
MAudioClip * getAudioClip(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!!
MAnimationMap * getAnimationMap(std::string path, bool relative=true)
Gets a AnimationMap reference loaded from provided disk path.
static MAssetManager * getInstance()
Gets singleton instance to AssetManager.
pugi::xml_document * getUIDefinition(std::string path, bool relative=true)
Gets a XmlDocument 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.
AudioClip is the instance of a audio clip file, this class holds. This class holds basic information ...
Definition audioclip.h:16
An Entity is the base class for all data and behaviour oriented objects in meteor....
Definition entity.h:9
This class holds an image that can be rendererd to the screen.
Definition texture.h:12