2020-07-05 13:24:22 +02:00
|
|
|
#pragma once
|
2020-02-19 20:19:46 +01:00
|
|
|
|
|
|
|
#include <map>
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
//! forward declaration
|
|
|
|
class GuiImageData;
|
2022-01-09 13:37:16 +01:00
|
|
|
|
2020-02-19 20:19:46 +01:00
|
|
|
class GuiSound;
|
|
|
|
|
|
|
|
class Resources {
|
|
|
|
public:
|
|
|
|
static void Clear();
|
|
|
|
|
2022-01-09 13:37:16 +01:00
|
|
|
static bool LoadFiles(const char *path);
|
|
|
|
|
|
|
|
static const uint8_t *GetFile(const char *filename);
|
|
|
|
|
|
|
|
static uint32_t GetFileSize(const char *filename);
|
|
|
|
|
|
|
|
static GuiImageData *GetImageData(const char *filename);
|
|
|
|
|
|
|
|
static void RemoveImageData(GuiImageData *image);
|
|
|
|
|
|
|
|
static GuiSound *GetSound(const char *filename);
|
|
|
|
|
|
|
|
static void RemoveSound(GuiSound *sound);
|
2020-02-19 20:19:46 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
static Resources *instance;
|
|
|
|
|
|
|
|
Resources() {}
|
2022-01-09 13:37:16 +01:00
|
|
|
|
2020-02-19 20:19:46 +01:00
|
|
|
~Resources() {}
|
|
|
|
|
|
|
|
std::map<std::string, std::pair<uint32_t, GuiImageData *> > imageDataMap;
|
|
|
|
std::map<std::string, std::pair<uint32_t, GuiSound *> > soundDataMap;
|
2020-07-05 13:24:22 +02:00
|
|
|
};
|