summaryrefslogtreecommitdiff
path: root/src/render/sdl2softwaregraphics.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-09-01 23:38:52 +0300
committerAndrei Karas <akaras@inbox.ru>2013-09-01 23:38:52 +0300
commit987141c4340c508b14ec085f977754bb48dcfe0e (patch)
treebcf9b747ebdf79a4c45a9d19a4c22725d48f4b99 /src/render/sdl2softwaregraphics.cpp
parent2ab3f0d8d04374b330c91a9f065efa0f526d7824 (diff)
downloadplus-987141c4340c508b14ec085f977754bb48dcfe0e.tar.gz
plus-987141c4340c508b14ec085f977754bb48dcfe0e.tar.bz2
plus-987141c4340c508b14ec085f977754bb48dcfe0e.tar.xz
plus-987141c4340c508b14ec085f977754bb48dcfe0e.zip
improve speed in software renderer in SDL2.
now it works almost with same speed like SDL1.2
Diffstat (limited to 'src/render/sdl2softwaregraphics.cpp')
-rw-r--r--src/render/sdl2softwaregraphics.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/render/sdl2softwaregraphics.cpp b/src/render/sdl2softwaregraphics.cpp
index 857909636..ac9f962ac 100644
--- a/src/render/sdl2softwaregraphics.cpp
+++ b/src/render/sdl2softwaregraphics.cpp
@@ -32,7 +32,7 @@
#include "logger.h"
#include "resources/imagehelper.h"
-#include "resources/sdl2imagehelper.h"
+#include "resources/sdl2softwareimagehelper.h"
#include <guichan/sdl/sdlpixel.hpp>
@@ -1267,7 +1267,8 @@ bool SDL2SoftwareGraphics::setVideoMode(const int w, const int h,
}
mSurface = SDL_GetWindowSurface(mWindow);
- logger->log("window surface: %p", mSurface);
+ imageHelper->dumpSurfaceFormat(mSurface);
+ SDL2SoftwareImageHelper::setFormat(mSurface->format);
int w1 = 0;
int h1 = 0;
@@ -1276,8 +1277,16 @@ bool SDL2SoftwareGraphics::setVideoMode(const int w, const int h,
mRect.h = h1;
mRenderer = graphicsManager.createRenderer(mWindow, mRendererFlags);
- SDLImageHelper::setRenderer(mRenderer);
return videoInfo();
}
+bool SDL2SoftwareGraphics::resizeScreen(const int width, const int height)
+{
+ const bool ret = Graphics::resizeScreen(width, height);
+
+ mSurface = SDL_GetWindowSurface(mWindow);
+ SDL2SoftwareImageHelper::setFormat(mSurface->format);
+ return ret;
+}
+
#endif // USE_SDL2