summaryrefslogtreecommitdiff
path: root/src/resources/imageset.cpp
diff options
context:
space:
mode:
authorStefan Dombrowski <stefan@uni-bonn.de>2010-12-05 19:30:53 +0100
committerStefan Dombrowski <stefan@uni-bonn.de>2010-12-05 19:30:53 +0100
commitf622cf4c545033e25fde7f3e1105cdf2118d7016 (patch)
tree2f4a69193a1d37716e8b7fdac1d04b2c1fba6268 /src/resources/imageset.cpp
parentf2b8d02dc560528f6854a339c1974d761daabc70 (diff)
downloadMana-f622cf4c545033e25fde7f3e1105cdf2118d7016.tar.gz
Mana-f622cf4c545033e25fde7f3e1105cdf2118d7016.tar.bz2
Mana-f622cf4c545033e25fde7f3e1105cdf2118d7016.tar.xz
Mana-f622cf4c545033e25fde7f3e1105cdf2118d7016.zip
Add support for tiles with spacing
Now the map from the Mana server's example data is shown properly. Reviewed-by: Jaxad0127
Diffstat (limited to 'src/resources/imageset.cpp')
-rw-r--r--src/resources/imageset.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/resources/imageset.cpp b/src/resources/imageset.cpp
index bd28cd6e..d33fac32 100644
--- a/src/resources/imageset.cpp
+++ b/src/resources/imageset.cpp
@@ -27,11 +27,11 @@
#include "utils/dtor.h"
-ImageSet::ImageSet(Image *img, int width, int height)
+ImageSet::ImageSet(Image *img, int width, int height, int margin, int spacing)
{
- for (int y = 0; y + height <= img->getHeight(); y += height)
+ for (int y = margin; y + height <= img->getHeight() - margin; y += height + spacing)
{
- for (int x = 0; x + width <= img->getWidth(); x += width)
+ for (int x = margin; x + width <= img->getWidth() - margin; x += width + spacing)
{
mImages.push_back(img->getSubImage(x, y, width, height));
}