singletons
This commit is contained in:
@@ -7,8 +7,6 @@
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
class Asset;
|
||||
class Input;
|
||||
class Menu;
|
||||
class Text;
|
||||
class Texture;
|
||||
@@ -19,7 +17,7 @@ struct JA_Sound_t;
|
||||
// Singleton inicializado desde Director; las escenas consultan handles via get*().
|
||||
class Resource {
|
||||
public:
|
||||
static void init(SDL_Renderer *renderer, Asset *asset, Input *input);
|
||||
static void init(SDL_Renderer *renderer);
|
||||
static void destroy();
|
||||
static Resource *get();
|
||||
|
||||
@@ -32,14 +30,12 @@ class Resource {
|
||||
const std::vector<uint8_t> &getDemoBytes() const { return demoBytes_; }
|
||||
|
||||
private:
|
||||
Resource(SDL_Renderer *renderer, Asset *asset, Input *input);
|
||||
Resource(SDL_Renderer *renderer);
|
||||
~Resource();
|
||||
|
||||
void preloadAll();
|
||||
|
||||
SDL_Renderer *renderer_;
|
||||
Asset *asset_;
|
||||
Input *input_;
|
||||
|
||||
std::unordered_map<std::string, Texture *> textures_;
|
||||
std::unordered_map<std::string, JA_Sound_t *> sounds_;
|
||||
|
||||
Reference in New Issue
Block a user