-
Notifications
You must be signed in to change notification settings - Fork 6
/
GUIImageCache.h
57 lines (32 loc) · 904 Bytes
/
GUIImageCache.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//
// Letter.h
// Design Patterns
//
// Created by Nathan Daly on 4/24/12.
// Copyright 2012 Lions Entertainment. All rights reserved.
//
#ifndef GUI_LETTER_H
#define GUI_LETTER_H
#include "Ptr_config.h"
#include "GUIImage.h"
#include <string>
#include <map>
struct SDL_Surface; // display image
class GUIImage_Cache {
public:
void drawself(SDL_Surface *dest, int x, int y) const;
int get_height() const;
int get_width() const;
static GUIImage* get_image(std::string image_, bool alpha = 0, const SDL_Color& color_key =default_color_key_c);
mutable GUIImage image;
private:
GUIImage_Cache() : image () {}
// GUIImage_Cache(std::string image_) {
// set_image (image_);
// }
~GUIImage_Cache();
void set_image(const std::string& filename);
typedef std::map<std::string, GUIImage_Cache*> image_map_t;
static image_map_t images;
};
#endif /* FLYWEIGHT_H */