Mercurial > fife-parpg
comparison engine/core/video/video.i @ 19:485f4c6dd9fc
added possibility to load subimages:
* allow loading via addResourceFromLocation in pool's
* added ImageLocation type to swig files
* one questions remains: why do we have to give the image filename even if we dont want to use it?
author | spq@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Mon, 07 Jul 2008 09:44:07 +0000 |
parents | 4a0efb7baf70 |
children | 90005975cdbb |
comparison
equal
deleted
inserted
replaced
18:40a7c9618ade | 19:485f4c6dd9fc |
---|---|
25 #include "video/cursor.h" | 25 #include "video/cursor.h" |
26 #include "video/animation.h" | 26 #include "video/animation.h" |
27 #include "video/imagepool.h" | 27 #include "video/imagepool.h" |
28 #include "video/animationpool.h" | 28 #include "video/animationpool.h" |
29 #include "video/renderbackend.h" | 29 #include "video/renderbackend.h" |
30 #include "video/image_location.h" | |
30 #include "util/base/exception.h" | 31 #include "util/base/exception.h" |
31 %} | 32 %} |
32 | 33 |
33 %include "util/structures/utilstructures.i" | 34 %include "util/structures/utilstructures.i" |
34 %include "util/resource/resource.i" | 35 %include "util/resource/resource.i" |
35 | 36 |
36 namespace FIFE { | 37 namespace FIFE { |
37 class Pool; | 38 class Pool; |
38 class Point; | 39 class Point; |
40 class ResourceLocation; | |
39 | 41 |
40 class AbstractImage { | 42 class AbstractImage { |
41 public: | 43 public: |
42 virtual ~AbstractImage() {} | 44 virtual ~AbstractImage() {} |
43 virtual SDL_Surface* getSurface() = 0; | 45 virtual SDL_Surface* getSurface() = 0; |
101 void addRef(); | 103 void addRef(); |
102 void decRef(); | 104 void decRef(); |
103 unsigned int getRefCount(); | 105 unsigned int getRefCount(); |
104 }; | 106 }; |
105 | 107 |
108 class ImageLocation: public ResourceLocation { | |
109 public: | |
110 ImageLocation(const std::string& filename); | |
111 virtual ~ResourceLocation() {}; | |
112 virtual void setXShift(int xshift) { m_xshift = xshift; } | |
113 virtual int getXShift() const { return m_xshift; } | |
114 virtual void setYShift(int yshift) { m_yshift = yshift; } | |
115 virtual int getYShift() const { return m_yshift; } | |
116 virtual void setWidth(unsigned int width) { m_width = width; } | |
117 virtual unsigned int getWidth() const { return m_width; } | |
118 virtual void setHeight(unsigned int height) { m_height = height; } | |
119 virtual unsigned int getHeight() const { return m_height; } | |
120 virtual void setParentSource(Image* image) { m_parent_image = image; } | |
121 virtual Image* getParentSource() const { return m_parent_image; } | |
122 }; | |
123 | |
106 class ImagePool: public Pool { | 124 class ImagePool: public Pool { |
107 public: | 125 public: |
108 virtual ~ImagePool(); | 126 virtual ~ImagePool(); |
109 inline Image& getImage(unsigned int index); | 127 inline Image& getImage(unsigned int index); |
110 private: | 128 private: |