diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-05-01 23:56:03 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-05-02 14:28:17 +0300 |
commit | 520a495c466793c29f3e721634dfe6cc616b8ede (patch) | |
tree | 749b67f5d4df83f6f4997dabeb66ec394eabccd7 /src/resources | |
parent | f9030497b6196ce2fadb6b6ada5d784be227d9a6 (diff) | |
download | plus-520a495c466793c29f3e721634dfe6cc616b8ede.tar.gz plus-520a495c466793c29f3e721634dfe6cc616b8ede.tar.bz2 plus-520a495c466793c29f3e721634dfe6cc616b8ede.tar.xz plus-520a495c466793c29f3e721634dfe6cc616b8ede.zip |
Add missing const.
Diffstat (limited to 'src/resources')
-rw-r--r-- | src/resources/atlasmanager.cpp | 9 | ||||
-rw-r--r-- | src/resources/atlasmanager.h | 5 | ||||
-rw-r--r-- | src/resources/mapreader.cpp | 2 | ||||
-rw-r--r-- | src/resources/resourcemanager.cpp | 4 | ||||
-rw-r--r-- | src/resources/resourcemanager.h | 2 |
5 files changed, 12 insertions, 10 deletions
diff --git a/src/resources/atlasmanager.cpp b/src/resources/atlasmanager.cpp index c3ba82fdd..1dad94a09 100644 --- a/src/resources/atlasmanager.cpp +++ b/src/resources/atlasmanager.cpp @@ -133,13 +133,14 @@ void AtlasManager::loadImages(const StringVect &files, void AtlasManager::simpleSort(const std::string &restrict name, std::vector<TextureAtlas*> &restrict atlases, - std::vector<Image*> &restrict images, int size) + const std::vector<Image*> &restrict images, + int size) { int x = 0; int y = 0; int tempHeight = 0; TextureAtlas *atlas = new TextureAtlas(); - std::vector<Image*>::iterator it = images.begin(); + std::vector<Image*>::const_iterator it = images.begin(); const std::vector<Image*>::const_iterator it_end = images.end(); for (it = images.begin(); it != it_end; ++ it) { @@ -297,10 +298,10 @@ void AtlasManager::convertAtlas(TextureAtlas *const atlas) } } -void AtlasManager::injectToResources(AtlasResource *const resource) +void AtlasManager::injectToResources(const AtlasResource *const resource) { ResourceManager *const resman = ResourceManager::getInstance(); - FOR_EACH (std::vector<TextureAtlas*>::iterator, it, resource->atlases) + FOR_EACH (std::vector<TextureAtlas*>::const_iterator, it, resource->atlases) { // add each atlas image to resources TextureAtlas *const atlas = *it; diff --git a/src/resources/atlasmanager.h b/src/resources/atlasmanager.h index 309bf11cb..58f43d251 100644 --- a/src/resources/atlasmanager.h +++ b/src/resources/atlasmanager.h @@ -104,7 +104,7 @@ class AtlasManager final const StringVect &files) A_WARN_UNUSED; - static void injectToResources(AtlasResource *const resource); + static void injectToResources(const AtlasResource *const resource); static void moveToDeleted(AtlasResource *const resource); @@ -114,7 +114,8 @@ class AtlasManager final static void simpleSort(const std::string &restrict name, std::vector<TextureAtlas*> &restrict atlases, - std::vector<Image*> &restrict images, int size); + const std::vector<Image*> &restrict images, + int size); static SDL_Surface *createSDLAtlas(TextureAtlas *const atlas) A_WARN_UNUSED; diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp index ec219886e..e4c3e6f73 100644 --- a/src/resources/mapreader.cpp +++ b/src/resources/mapreader.cpp @@ -277,7 +277,7 @@ void MapReader::unloadTempLayers() mKnownDocs.clear(); } -static void loadReplaceLayer(LayerInfoIterator &it, Map *const map) +static void loadReplaceLayer(const LayerInfoIterator &it, Map *const map) { MapReader::readLayer((*it).second, map); } diff --git a/src/resources/resourcemanager.cpp b/src/resources/resourcemanager.cpp index a65fc508c..876d7b751 100644 --- a/src/resources/resourcemanager.cpp +++ b/src/resources/resourcemanager.cpp @@ -1099,7 +1099,7 @@ void ResourceManager::clearScheduled() struct RescaledLoader { ResourceManager *manager; - Image *image; + const Image *image; int width; int height; static Resource *load(const void *const v) @@ -1118,7 +1118,7 @@ struct RescaledLoader } }; -Image *ResourceManager::getRescaled(Image *const image, +Image *ResourceManager::getRescaled(const Image *const image, const int width, const int height) { if (!image) diff --git a/src/resources/resourcemanager.h b/src/resources/resourcemanager.h index 2398cf212..954ee3551 100644 --- a/src/resources/resourcemanager.h +++ b/src/resources/resourcemanager.h @@ -278,7 +278,7 @@ class ResourceManager final const std::string &restrict name, const std::string &restrict text); - Image *getRescaled(Image *const image, + Image *getRescaled(const Image *const image, const int width, const int height) A_WARN_UNUSED; /** |