X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=platform%2Fsdlvscalers.cpp;h=8afbdf83910f5a7783f01b39dffd8049fa133e15;hb=9902256814785f0b3f08d336a98c481c296ac7e5;hp=5218ebd91b204c16c3528c6be1e94218aab15ec8;hpb=11f745d33a3a15f1db8109499f590a0f9bae9e7a;p=drnoksnes diff --git a/platform/sdlvscalers.cpp b/platform/sdlvscalers.cpp index 5218ebd..8afbdf8 100644 --- a/platform/sdlvscalers.cpp +++ b/platform/sdlvscalers.cpp @@ -6,6 +6,7 @@ #include #if CONF_XSP +# include # include #endif #if CONF_HD @@ -13,7 +14,6 @@ #endif #include "snes9x.h" -#include "display.h" #include "platform.h" #include "sdlv.h" @@ -372,6 +372,8 @@ class HAAScalerBase : public Scaler const int m_w, m_h, m_Bpp; const float ratio_x, ratio_y; + static bool initialized; + protected: HAAScalerBase(SDL_Surface* screen, int w, int h, float r_x, float r_y) : m_screen(screen), m_w(w), m_h(h), @@ -384,9 +386,16 @@ protected: // Clear the SDL screen with black, just in case it gets drawn. SDL_FillRect(screen, 0, SDL_MapRGB(screen->format, 0, 0, 0)); - HAA_Init(fullscreen ? SDL_FULLSCREEN : 0); + if (!initialized) { + HAA_Init(0); + initialized = true; + } else { + HAA_SetVideoMode(); // Tell HAA we might have changed video mode + } + actor = HAA_CreateActor(0, m_w, m_h, m_screen->format->BitsPerPixel); HAA_SetPosition(actor, m_area.x, m_area.y + (fullscreen ? 0 : 60)); + // In windowed mode, take care of the title bar (xoffset = 60) HAA_SetScale(actor, r_x, r_y); HAA_Show(actor); } @@ -395,7 +404,6 @@ public: virtual ~HAAScalerBase() { HAA_FreeActor(actor); - HAA_Quit(); }; uint8* getDrawBuffer() const @@ -437,6 +445,7 @@ public: return HAA_FilterEvent(&event) == 0; }; }; +bool HAAScalerBase::initialized = false; class HAAFillScaler : public HAAScalerBase {