summaryrefslogtreecommitdiff
path: root/src/resources/atlas/atlasmanager.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-07-14 01:31:22 +0300
committerAndrei Karas <akaras@inbox.ru>2017-07-14 01:31:22 +0300
commit311c175f3184103950c72bc5c775174597430b83 (patch)
treead022dc44a1c4177b3d53bf0d7eaa5a1736c8cf1 /src/resources/atlas/atlasmanager.cpp
parent16bcb81b0509725e4546bcb3c390ca3c1bb7e7b1 (diff)
downloadplus-311c175f3184103950c72bc5c775174597430b83.tar.gz
plus-311c175f3184103950c72bc5c775174597430b83.tar.bz2
plus-311c175f3184103950c72bc5c775174597430b83.tar.xz
plus-311c175f3184103950c72bc5c775174597430b83.zip
Replace std::vector into macro STD_VECTOR.
In most case it equal to std::vector except debug modes. Now it can be also mse::mstd::vector, but sadly this class not support all required features.
Diffstat (limited to 'src/resources/atlas/atlasmanager.cpp')
-rw-r--r--src/resources/atlas/atlasmanager.cpp46
1 files changed, 23 insertions, 23 deletions
diff --git a/src/resources/atlas/atlasmanager.cpp b/src/resources/atlas/atlasmanager.cpp
index c7d237115..888af7fe7 100644
--- a/src/resources/atlas/atlasmanager.cpp
+++ b/src/resources/atlas/atlasmanager.cpp
@@ -61,8 +61,8 @@ AtlasResource *AtlasManager::loadTextureAtlas(const std::string &name,
const StringVect &files)
{
BLOCK_START("AtlasManager::loadTextureAtlas")
- std::vector<TextureAtlas*> atlases;
- std::vector<Image*> images;
+ STD_VECTOR<TextureAtlas*> atlases;
+ STD_VECTOR<Image*> images;
AtlasResource *resource = new AtlasResource;
loadImages(files, images);
@@ -76,7 +76,7 @@ AtlasResource *AtlasManager::loadTextureAtlas(const std::string &name,
// sorting images on atlases.
simpleSort(name, atlases, images, maxSize);
- FOR_EACH (std::vector<TextureAtlas*>::iterator, it, atlases)
+ FOR_EACH (STD_VECTOR<TextureAtlas*>::iterator, it, atlases)
{
TextureAtlas *const atlas = *it;
if (atlas == nullptr)
@@ -96,8 +96,8 @@ AtlasResource *AtlasManager::loadTextureAtlas(const std::string &name,
AtlasResource *AtlasManager::loadEmptyAtlas(const std::string &name,
const StringVect &files)
{
- std::vector<TextureAtlas*> atlases;
- std::vector<Image*> images;
+ STD_VECTOR<TextureAtlas*> atlases;
+ STD_VECTOR<Image*> images;
AtlasResource *resource = new AtlasResource;
loadEmptyImages(files, images);
@@ -105,7 +105,7 @@ AtlasResource *AtlasManager::loadEmptyAtlas(const std::string &name,
// sorting images on atlases.
emptySort(name, atlases, images);
- FOR_EACH (std::vector<TextureAtlas*>::iterator, it, atlases)
+ FOR_EACH (STD_VECTOR<TextureAtlas*>::iterator, it, atlases)
{
TextureAtlas *const atlas = *it;
if (atlas == nullptr)
@@ -125,7 +125,7 @@ AtlasResource *AtlasManager::loadEmptyAtlas(const std::string &name,
}
void AtlasManager::loadImages(const StringVect &files,
- std::vector<Image*> &images)
+ STD_VECTOR<Image*> &images)
{
BLOCK_START("AtlasManager::loadImages")
@@ -175,7 +175,7 @@ void AtlasManager::loadImages(const StringVect &files,
}
void AtlasManager::loadEmptyImages(const StringVect &files,
- std::vector<Image*> &images)
+ STD_VECTOR<Image*> &images)
{
BLOCK_START("AtlasManager::loadEmptyImages")
@@ -202,8 +202,8 @@ void AtlasManager::loadEmptyImages(const StringVect &files,
}
void AtlasManager::simpleSort(const std::string &restrict name,
- std::vector<TextureAtlas*> &restrict atlases,
- const std::vector<Image*> &restrict images,
+ STD_VECTOR<TextureAtlas*> &restrict atlases,
+ const STD_VECTOR<Image*> &restrict images,
int size)
{
BLOCK_START("AtlasManager::simpleSort")
@@ -211,8 +211,8 @@ void AtlasManager::simpleSort(const std::string &restrict name,
int y = 0;
int tempHeight = 0;
TextureAtlas *atlas = new TextureAtlas;
- std::vector<Image*>::const_iterator it = images.begin();
- const std::vector<Image*>::const_iterator it_end = images.end();
+ 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)
{
const Image *const img = *it;
@@ -273,13 +273,13 @@ void AtlasManager::simpleSort(const std::string &restrict name,
}
void AtlasManager::emptySort(const std::string &restrict name,
- std::vector<TextureAtlas*> &restrict atlases,
- const std::vector<Image*> &restrict images)
+ STD_VECTOR<TextureAtlas*> &restrict atlases,
+ const STD_VECTOR<Image*> &restrict images)
{
BLOCK_START("AtlasManager::simpleSort")
TextureAtlas *atlas = new TextureAtlas;
- std::vector<Image*>::const_iterator it = images.begin();
- const std::vector<Image*>::const_iterator it_end = images.end();
+ 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)
{
const Image *const img = *it;
@@ -370,7 +370,7 @@ void AtlasManager::createSDLAtlas(TextureAtlas *const atlas)
}
// drawing SDL images to surface
- FOR_EACH (std::vector<AtlasItem*>::iterator, it, atlas->items)
+ FOR_EACH (STD_VECTOR<AtlasItem*>::iterator, it, atlas->items)
{
AtlasItem *const item = *it;
imageHelper->copySurfaceToImage(image, item->x, item->y,
@@ -424,7 +424,7 @@ void AtlasManager::convertEmptyAtlas(TextureAtlas *const atlas)
image->incRef();
- FOR_EACH (std::vector<AtlasItem*>::iterator, it, atlas->items)
+ FOR_EACH (STD_VECTOR<AtlasItem*>::iterator, it, atlas->items)
{
AtlasItem *const item = *it;
// delete SDL Image
@@ -471,7 +471,7 @@ void AtlasManager::convertAtlas(TextureAtlas *const atlas)
image->incRef();
- FOR_EACH (std::vector<AtlasItem*>::iterator, it, atlas->items)
+ FOR_EACH (STD_VECTOR<AtlasItem*>::iterator, it, atlas->items)
{
AtlasItem *const item = *it;
// delete SDL Image
@@ -497,7 +497,7 @@ void AtlasManager::injectToResources(const AtlasResource *const resource)
{
if (resource == nullptr)
return;
- FOR_EACH (std::vector<TextureAtlas*>::const_iterator,
+ FOR_EACH (STD_VECTOR<TextureAtlas*>::const_iterator,
it, resource->atlases)
{
// add each atlas image to resources
@@ -507,7 +507,7 @@ void AtlasManager::injectToResources(const AtlasResource *const resource)
Image *const image = atlas->atlasImage;
if (image != nullptr)
ResourceManager::addResource(atlas->name, image);
- FOR_EACH (std::vector<AtlasItem*>::iterator, it2, atlas->items)
+ FOR_EACH (STD_VECTOR<AtlasItem*>::iterator, it2, atlas->items)
{
AtlasItem *const item = *it2;
if (item == nullptr)
@@ -523,7 +523,7 @@ void AtlasManager::moveToDeleted(AtlasResource *const resource)
{
if (resource == nullptr)
return;
- FOR_EACH (std::vector<TextureAtlas*>::iterator, it, resource->atlases)
+ FOR_EACH (STD_VECTOR<TextureAtlas*>::iterator, it, resource->atlases)
{
// move each atlas image to deleted
TextureAtlas *const atlas = *it;
@@ -535,7 +535,7 @@ void AtlasManager::moveToDeleted(AtlasResource *const resource)
// move each atlas image to deleted
ResourceManager::moveToDeleted(image);
}
- FOR_EACH (std::vector<AtlasItem*>::iterator, it2, atlas->items)
+ FOR_EACH (STD_VECTOR<AtlasItem*>::iterator, it2, atlas->items)
{
AtlasItem *const item = *it2;
if (item != nullptr)