From 84617341f9132135f1543423b4a13bc256c2791d Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Wed, 18 Mar 2009 17:40:31 +0100 Subject: [PATCH] Drop support for dirty rectangles. --- src/video/symbian/SDL_epocvideo.cpp | 36 +++++------------------------------- src/video/symbian/SDL_epocvideo.h | 2 -- src/video/symbian/dsa.cpp | 6 ++---- 3 files changed, 7 insertions(+), 37 deletions(-) diff --git a/src/video/symbian/SDL_epocvideo.cpp b/src/video/symbian/SDL_epocvideo.cpp index c5ab00b..e445ba0 100644 --- a/src/video/symbian/SDL_epocvideo.cpp +++ b/src/video/symbian/SDL_epocvideo.cpp @@ -193,13 +193,11 @@ int S60_VideoInit(_THIS, SDL_PixelFormat *vformat) Private->iRect[1] = new SDL_Rect; Private->iRect[2] = NULL; - Private->iScreenPos = TPoint(0, 0); + Private->iRect[0]->x = 0; + Private->iRect[0]->y = 0; - Private->iRect[0]->x = Private->iScreenPos.iX; - Private->iRect[0]->y = Private->iScreenPos.iY; - - Private->iRect[1]->x = Private->iScreenPos.iX; - Private->iRect[1]->y = Private->iScreenPos.iY; + Private->iRect[1]->x = 0; + Private->iRect[1]->y = 0; const TSize sz = GetScreenSize(); @@ -222,8 +220,6 @@ int S60_VideoInit(_THIS, SDL_PixelFormat *vformat) Private->iOrientation[1] = CAknAppUi::EAppUiOrientationPortrait; } - Private->iUpdateWholeScreen = false; - return(0); } @@ -260,9 +256,6 @@ int S60_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors) if(EpocSdlEnv::SetPalette(firstcolor, ncolors, palette) == KErrNone) { - // palette has been updated, redraw whole screen to include changes - Private->iUpdateWholeScreen = true; - return 0; } return -1; @@ -576,10 +569,6 @@ SDL_Surface *S60_SetVideoMode(_THIS, SDL_Surface *current, int width, int height // Set the blit function _this->UpdateRects = S60_DirectUpdate; - // Centralize game window on device screen - Private->iScreenPos.iX = 0; - Private->iScreenPos.iY = 0; - return current; } @@ -623,22 +612,7 @@ static void S60_DirectUpdate(_THIS, int numrects, SDL_Rect *rects) { const TRect target(TPoint(0, 0), Private->iSwSurfaceSize); - if(Private->iUpdateWholeScreen) - { - if(!EpocSdlEnv::AddUpdateRect(Private->iSwSurface, target, target)) - return; - } - else - { - for(int i = 0; i < numrects ;i++) - { - const TRect rect(TPoint(rects[i].x, rects[i].y), - TSize(rects[i].w, rects[i].h)); - if(!EpocSdlEnv::AddUpdateRect(Private->iSwSurface, rect, target)) - return; //not succesful - Private->iUpdateWholeScreen = false; - } - } + EpocSdlEnv::AddUpdateRect(Private->iSwSurface, target, target); EpocSdlEnv::UpdateSwSurface(); } if(!Private->iIsWindowFocused) diff --git a/src/video/symbian/SDL_epocvideo.h b/src/video/symbian/SDL_epocvideo.h index ce1330c..7da2cbf 100644 --- a/src/video/symbian/SDL_epocvideo.h +++ b/src/video/symbian/SDL_epocvideo.h @@ -39,13 +39,11 @@ typedef CAknAppUi::TAppUiOrientation Orientation; struct SDL_PrivateVideoData { - TPoint iScreenPos; bool iIsWindowFocused; TSize iSwSurfaceSize; TUint8* iSwSurface; SDL_Rect** iRect; Orientation* iOrientation; - bool iUpdateWholeScreen; }; struct SDL_PrivateGLData diff --git a/src/video/symbian/dsa.cpp b/src/video/symbian/dsa.cpp index fcb7e33..61bd022 100644 --- a/src/video/symbian/dsa.cpp +++ b/src/video/symbian/dsa.cpp @@ -22,13 +22,10 @@ class CDsaBase : public CDsa, public MDirectScreenAccess CDsaBase(RWsSession& aSession) : CDsa(aSession), iBmp( NULL ) { m_updateWholeScreen = false; } ~CDsaBase(); - protected: + private: void ConstructL(RWindow& aWindow, CWsScreenDevice& aDevice); void Stop(); - CDirectScreenAccess* iDsa; - - private: void AbortNow(RDirectScreenAccess::TTerminationReasons aReason); void Restart(RDirectScreenAccess::TTerminationReasons aReason); void RestartL(); @@ -40,6 +37,7 @@ class CDsaBase : public CDsa, public MDirectScreenAccess void CreateSurfaceL(const TSize& aSize); CFbsBitmap* iBmp; + CDirectScreenAccess* iDsa; }; void CDsaBase::ConstructL(RWindow& aWindow, CWsScreenDevice& aDevice) -- 2.11.4.GIT