From eb381e24f6307a25dc1da62b1f8bb0a613363ac1 Mon Sep 17 00:00:00 2001 From: stephena Date: Sun, 28 Dec 2008 22:54:04 +0000 Subject: [PATCH] Make software rendering mode in OSX ignore 'isBase' surface functionality, and always update entire surfaces when changes are made. This is basically a workaround for the next release, as I don't want to spend time on fixing this right now (since it only happens in fullscreen software mode, which isn't the optimal code-path in OSX anyway). git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1582 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba --- stella/src/common/FrameBufferSoft.cxx | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/stella/src/common/FrameBufferSoft.cxx b/stella/src/common/FrameBufferSoft.cxx index 33fe2f574..8f392c9f8 100644 --- a/stella/src/common/FrameBufferSoft.cxx +++ b/stella/src/common/FrameBufferSoft.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: FrameBufferSoft.cxx,v 1.86 2008-12-28 21:01:55 stephena Exp $ +// $Id: FrameBufferSoft.cxx,v 1.87 2008-12-28 22:54:04 stephena Exp $ //============================================================================ #include @@ -431,6 +431,18 @@ void FrameBufferSoft::stateChanged(EventHandler::State state) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - FBSurface* FrameBufferSoft::createSurface(int w, int h, bool isBase) const { + // For some unknown reason, OSX in software fullscreen mode doesn't like + // to use the underlying surface directly + // I suspect it's an SDL compatibility thing, since I get errors + // referencing Quartz vs. QuickDraw, and then a program crash + // For now, we'll just always use entire surfaces for OSX + // I don't think this will have much effect, since OpenGL mode is the + // preferred method in OSX (basically, all OSX installations have OpenGL + // support) +#ifdef MAC_OSX + isBase = false; +#endif + SDL_Surface* surface = isBase ? myScreen : SDL_CreateRGBSurface(SDL_SWSURFACE, w, h, myFormat->BitsPerPixel, myFormat->Rmask, myFormat->Gmask, myFormat->Bmask, @@ -589,9 +601,6 @@ void FBSurfaceSoft::drawChar(const GUI::Font* font, uInt8 chr, } const uInt16* tmp = desc.bits + (desc.offset ? desc.offset[chr] : (chr * desc.fbbh)); - - SDL_LockSurface(mySurface); - switch(myFB.myBytesPerPixel) { case 2: @@ -677,7 +686,6 @@ void FBSurfaceSoft::drawChar(const GUI::Font* font, uInt8 chr, default: break; } - SDL_UnlockSurface(mySurface); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -