diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-09-01 23:38:52 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-09-01 23:38:52 +0300 |
commit | 987141c4340c508b14ec085f977754bb48dcfe0e (patch) | |
tree | bcf9b747ebdf79a4c45a9d19a4c22725d48f4b99 /src/resources/sdl2softwareimagehelper.cpp | |
parent | 2ab3f0d8d04374b330c91a9f065efa0f526d7824 (diff) | |
download | mv-987141c4340c508b14ec085f977754bb48dcfe0e.tar.gz mv-987141c4340c508b14ec085f977754bb48dcfe0e.tar.bz2 mv-987141c4340c508b14ec085f977754bb48dcfe0e.tar.xz mv-987141c4340c508b14ec085f977754bb48dcfe0e.zip |
improve speed in software renderer in SDL2.
now it works almost with same speed like SDL1.2
Diffstat (limited to 'src/resources/sdl2softwareimagehelper.cpp')
-rw-r--r-- | src/resources/sdl2softwareimagehelper.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/resources/sdl2softwareimagehelper.cpp b/src/resources/sdl2softwareimagehelper.cpp index 3511b8298..7c4ff3d5d 100644 --- a/src/resources/sdl2softwareimagehelper.cpp +++ b/src/resources/sdl2softwareimagehelper.cpp @@ -40,7 +40,7 @@ #include "debug.h" bool SDL2SoftwareImageHelper::mEnableAlphaCache = false; -SDL_Renderer *SDL2SoftwareImageHelper::mRenderer = nullptr; +SDL_PixelFormat *SDL2SoftwareImageHelper::mFormat = nullptr; Image *SDL2SoftwareImageHelper::load(SDL_RWops *const rw, Dye const &dye) const { @@ -137,13 +137,7 @@ Image *SDL2SoftwareImageHelper::_SDLload(SDL_Surface *tmpImage) const if (!tmpImage) return nullptr; -// SDL_Texture *const texture = SDL_CreateTextureFromSurface( -// mRenderer, tmpImage); -// if (!texture) -// return nullptr; -// SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND); -// return new Image(texture, tmpImage->w, tmpImage->h); - SDL_Surface *image = convertTo32Bit(tmpImage); + SDL_Surface *image = SDL_ConvertSurface(tmpImage, mFormat, 0); return new Image(image, false, nullptr); } |