summaryrefslogtreecommitdiff
path: root/src/resources/atlas/atlasmanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/resources/atlas/atlasmanager.cpp')
-rw-r--r--src/resources/atlas/atlasmanager.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/resources/atlas/atlasmanager.cpp b/src/resources/atlas/atlasmanager.cpp
index 4f38439ad..f8251ba7d 100644
--- a/src/resources/atlas/atlasmanager.cpp
+++ b/src/resources/atlas/atlasmanager.cpp
@@ -313,6 +313,10 @@ void AtlasManager::createSDLAtlas(TextureAtlas *const atlas)
}
BLOCK_END("AtlasManager::createSDLAtlas create surface")
+#ifdef OPENGLERRORS
+ logger->log("OpenGL debug: creating atlase %dx%d", width, height);
+#endif // OPENGLERRORS
+
Image *image = imageHelper->loadSurface(surface);
// free SDL atlas surface
MSDL_FreeSurface(surface);
@@ -330,6 +334,25 @@ void AtlasManager::createSDLAtlas(TextureAtlas *const atlas)
AtlasItem *const item = *it;
imageHelper->copySurfaceToImage(image, item->x, item->y,
item->image->mSDLSurface);
+#ifdef OPENGLERRORS
+ logger->log("OpenGL debug: put atlas image %s (size %dx%d),"
+ " into %d,%d to %d,%d",
+ item->name.c_str(),
+ item->image->mSDLSurface->w,
+ item->image->mSDLSurface->h,
+ item->x,
+ item->y,
+ item->x + item->image->mSDLSurface->w - 1,
+ item->y + item->image->mSDLSurface->h - 1);
+ if (item->x >= width)
+ logger->log("OpenGL error: start x position outside of atlas");
+ if (item->y >= height)
+ logger->log("OpenGL error: start y position outside of atlas");
+ if (item->x + item->image->mSDLSurface->w - 1 >= width)
+ logger->log("OpenGL error: end x position outside of atlas");
+ if (item->y + item->image->mSDLSurface->h - 1 >= height)
+ logger->log("OpenGL error: end y position outside of atlas");
+#endif // OPENGLERRORS
}
atlas->atlasImage = image;
BLOCK_END("AtlasManager::createSDLAtlas")