# HG changeset patch # User spq@33b003aa-7bff-0310-803a-e67f0ece8222 # Date 1215423847 0 # Node ID 485f4c6dd9fc5ee2295c63158058391a036bcea7 # Parent 40a7c9618adea7acd41ceacdc1a9fce67361cc3c 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? diff -r 40a7c9618ade -r 485f4c6dd9fc engine/core/util/resource/resource.i --- a/engine/core/util/resource/resource.i Mon Jul 07 01:40:57 2008 +0000 +++ b/engine/core/util/resource/resource.i Mon Jul 07 09:44:07 2008 +0000 @@ -83,6 +83,7 @@ static const int INVALID_ID = -1; virtual ~Pool(); virtual int addResourceFromFile(const std::string& filename); + virtual int addResourceFromLocation(const ResourceLocation& loc); virtual int getResourceCount(int status); virtual void addResourceLoader(ResourceLoader* loader); private: diff -r 40a7c9618ade -r 485f4c6dd9fc engine/core/video/video.i --- a/engine/core/video/video.i Mon Jul 07 01:40:57 2008 +0000 +++ b/engine/core/video/video.i Mon Jul 07 09:44:07 2008 +0000 @@ -27,6 +27,7 @@ #include "video/imagepool.h" #include "video/animationpool.h" #include "video/renderbackend.h" +#include "video/image_location.h" #include "util/base/exception.h" %} @@ -36,6 +37,7 @@ namespace FIFE { class Pool; class Point; + class ResourceLocation; class AbstractImage { public: @@ -103,6 +105,22 @@ unsigned int getRefCount(); }; + class ImageLocation: public ResourceLocation { + public: + ImageLocation(const std::string& filename); + virtual ~ResourceLocation() {}; + virtual void setXShift(int xshift) { m_xshift = xshift; } + virtual int getXShift() const { return m_xshift; } + virtual void setYShift(int yshift) { m_yshift = yshift; } + virtual int getYShift() const { return m_yshift; } + virtual void setWidth(unsigned int width) { m_width = width; } + virtual unsigned int getWidth() const { return m_width; } + virtual void setHeight(unsigned int height) { m_height = height; } + virtual unsigned int getHeight() const { return m_height; } + virtual void setParentSource(Image* image) { m_parent_image = image; } + virtual Image* getParentSource() const { return m_parent_image; } + }; + class ImagePool: public Pool { public: virtual ~ImagePool();