From ca58a3cced99fc2a8989da0155c1927bc0f08b6f Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 2 Jul 2011 04:36:59 +0300 Subject: Replace some getters to direct member access in Image class. --- src/resources/image.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/resources/image.cpp') diff --git a/src/resources/image.cpp b/src/resources/image.cpp index ec74630ff..2d3676304 100644 --- a/src/resources/image.cpp +++ b/src/resources/image.cpp @@ -386,8 +386,10 @@ Image* Image::SDLmerge(Image *image, int x, int y) SDL_LockSurface(mSDLSurface); const int x0 = (y * getWidth()) + x; - const int maxX = std::min(image->getWidth(), getWidth() - x); - const int maxY = std::min(image->getHeight(), getHeight() - y); + const int maxX = std::min(image->mBounds.w, + static_cast(mBounds.w - x)); + const int maxY = std::min(image->mBounds.w, + static_cast(mBounds.h - y)); // for each pixel lines of a source image for (offset_x = (x > 0 ? 0 : -x); offset_x < maxX; offset_x++) -- cgit v1.2.3-70-g09d2