diff options
Diffstat (limited to 'src/resources/image.cpp')
-rw-r--r-- | src/resources/image.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/resources/image.cpp b/src/resources/image.cpp index df07c16a2..9e9124ab6 100644 --- a/src/resources/image.cpp +++ b/src/resources/image.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011 The ManaPlus Developers + * Copyright (C) 2011-2012 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -119,10 +119,8 @@ Image::~Image() unload(); } -Resource *Image::load(void *buffer, unsigned bufferSize) +Resource *Image::load(SDL_RWops *rw) { - // Load the raw file data from the buffer in an RWops structure - SDL_RWops *rw = SDL_RWFromMem(buffer, bufferSize); SDL_Surface *tmpImage = IMG_Load_RW(rw, 1); if (!tmpImage) @@ -137,9 +135,8 @@ Resource *Image::load(void *buffer, unsigned bufferSize) return image; } -Resource *Image::load(void *buffer, unsigned bufferSize, Dye const &dye) +Resource *Image::load(SDL_RWops *rw, Dye const &dye) { - SDL_RWops *rw = SDL_RWFromMem(buffer, bufferSize); SDL_Surface *tmpImage = IMG_Load_RW(rw, 1); if (!tmpImage) @@ -473,10 +470,10 @@ Image* Image::SDLmerge(Image *image, int x, int y) static_cast<Uint16>(mBounds.h - y)); // for each pixel lines of a source image - for (offset_x = (x > 0 ? 0 : -x); offset_x < maxX; offset_x++) + for (offset_x = ((x > 0) ? 0 : -x); offset_x < maxX; offset_x++) { const int x1 = x0 + offset_x; - for (offset_y = (y > 0 ? 0 : -y); offset_y < maxY; offset_y++) + for (offset_y = ((y > 0) ? 0 : -y); offset_y < maxY; offset_y++) { // Computing offset on both images current_offset = (offset_y * getWidth()) + x1; |