summaryrefslogtreecommitdiff
path: root/src/resources
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-02-18 02:06:44 +0300
committerAndrei Karas <akaras@inbox.ru>2012-02-18 02:06:44 +0300
commit2257406db0fd374e929def04525671c2826306c2 (patch)
tree0df3ef6435664fc962b772302e716adf01855825 /src/resources
parent4cd44430deb5a7efc030839a133fe8510327fc24 (diff)
downloadplus-2257406db0fd374e929def04525671c2826306c2.tar.gz
plus-2257406db0fd374e929def04525671c2826306c2.tar.bz2
plus-2257406db0fd374e929def04525671c2826306c2.tar.xz
plus-2257406db0fd374e929def04525671c2826306c2.zip
Fix code style.
Diffstat (limited to 'src/resources')
-rw-r--r--src/resources/dye.cpp2
-rw-r--r--src/resources/image.cpp18
-rw-r--r--src/resources/specialdb.cpp1
3 files changed, 15 insertions, 6 deletions
diff --git a/src/resources/dye.cpp b/src/resources/dye.cpp
index 6800c5170..eec5916c4 100644
--- a/src/resources/dye.cpp
+++ b/src/resources/dye.cpp
@@ -309,7 +309,7 @@ void Dye::instantiate(std::string &target, const std::string &palettes)
{
s << palettes.substr(pal_pos);
s << target.substr(next_pos);
- pal_pos = std::string::npos;
+ //pal_pos = std::string::npos;
break;
}
s << palettes.substr(pal_pos, pal_next_pos - pal_pos);
diff --git a/src/resources/image.cpp b/src/resources/image.cpp
index 0ac11f114..1e2bd6b51 100644
--- a/src/resources/image.cpp
+++ b/src/resources/image.cpp
@@ -885,10 +885,20 @@ SubImage::SubImage(Image *parent, SDL_Surface *image,
mBounds.y = static_cast<short>(y);
mBounds.w = static_cast<Uint16>(width);
mBounds.h = static_cast<Uint16>(height);
- mInternalBounds.x = mParent->mBounds.x;
- mInternalBounds.y = mParent->mBounds.y;
- mInternalBounds.w = mParent->mBounds.w;
- mInternalBounds.h = mParent->mBounds.h;
+ if (mParent)
+ {
+ mInternalBounds.x = mParent->mBounds.x;
+ mInternalBounds.y = mParent->mBounds.y;
+ mInternalBounds.w = mParent->mBounds.w;
+ mInternalBounds.h = mParent->mBounds.h;
+ }
+ else
+ {
+ mInternalBounds.x = 0;
+ mInternalBounds.y = 0;
+ mInternalBounds.w = 1;
+ mInternalBounds.h = 1;
+ }
mUseAlphaCache = false;
}
diff --git a/src/resources/specialdb.cpp b/src/resources/specialdb.cpp
index 664d2c73d..50ea773bc 100644
--- a/src/resources/specialdb.cpp
+++ b/src/resources/specialdb.cpp
@@ -129,5 +129,4 @@ SpecialInfo *SpecialDB::get(int id)
return nullptr;
else
return i->second;
- return nullptr;
}