Some fixes for the OSX port. Mark, do these work??

git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@966 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2006-01-15 22:43:21 +00:00
parent e75b50cab8
commit 9d1a9977c3
3 changed files with 30 additions and 10 deletions

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // this file, and for a DISCLAIMER OF ALL WARRANTIES.
// //
// $Id: FrameBufferGL.cxx,v 1.53 2006-01-15 20:46:19 stephena Exp $ // $Id: FrameBufferGL.cxx,v 1.54 2006-01-15 22:43:21 stephena Exp $
//============================================================================ //============================================================================
#ifdef DISPLAY_OPENGL #ifdef DISPLAY_OPENGL
@ -563,11 +563,14 @@ void FrameBufferGL::enablePhosphor(bool enable)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FrameBufferGL::cls() void FrameBufferGL::cls()
{
if(myFuncsLoaded)
{ {
p_glClear(GL_COLOR_BUFFER_BIT); p_glClear(GL_COLOR_BUFFER_BIT);
SDL_GL_SwapBuffers(); SDL_GL_SwapBuffers();
p_glClear(GL_COLOR_BUFFER_BIT); p_glClear(GL_COLOR_BUFFER_BIT);
} }
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool FrameBufferGL::createTextures() bool FrameBufferGL::createTextures()

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // this file, and for a DISCLAIMER OF ALL WARRANTIES.
// //
// $Id: FrameBufferSoft.cxx,v 1.43 2006-01-15 16:31:01 stephena Exp $ // $Id: FrameBufferSoft.cxx,v 1.44 2006-01-15 22:43:21 stephena Exp $
//============================================================================ //============================================================================
#include <SDL.h> #include <SDL.h>
@ -95,6 +95,18 @@ bool FrameBufferSoft::createScreen()
cerr << "ERROR: Unable to open SDL window: " << SDL_GetError() << endl; cerr << "ERROR: Unable to open SDL window: " << SDL_GetError() << endl;
return false; return false;
} }
switch(myScreen->format->BitsPerPixel)
{
case 16:
myPitch = myScreen->pitch/2;
break;
case 24:
myPitch = myScreen->pitch/3;
break;
case 32:
myPitch = myScreen->pitch/4;
break;
}
myOSystem->eventHandler().refreshDisplay(); myOSystem->eventHandler().refreshDisplay();
return true; return true;
@ -289,7 +301,7 @@ void FrameBufferSoft::drawMediaSource()
buffer[pos++] = (uInt16) myAvgPalette[v][w]; buffer[pos++] = (uInt16) myAvgPalette[v][w];
} }
} }
screenofsY += myScreen->w; screenofsY += myPitch;
} }
bufofsY += width; bufofsY += width;
} }
@ -330,7 +342,7 @@ void FrameBufferSoft::drawMediaSource()
buffer[pos++] = (uInt16) myAvgPalette[v][w]; buffer[pos++] = (uInt16) myAvgPalette[v][w];
} }
} }
screenofsY += myScreen->w; screenofsY += myPitch;
} }
bufofsY += width; bufofsY += width;
} }
@ -370,7 +382,7 @@ void FrameBufferSoft::drawMediaSource()
buffer[pos++] = (uInt32) myAvgPalette[v][w]; buffer[pos++] = (uInt32) myAvgPalette[v][w];
} }
} }
screenofsY += myScreen->w; screenofsY += myPitch;
} }
bufofsY += width; bufofsY += width;
} }
@ -616,12 +628,15 @@ void FrameBufferSoft::enablePhosphor(bool enable)
switch(myScreen->format->BitsPerPixel) switch(myScreen->format->BitsPerPixel)
{ {
case 16: case 16:
myPitch = myScreen->pitch/2;
myRenderType = kPhosphor_16; myRenderType = kPhosphor_16;
break; break;
case 24: case 24:
myPitch = myScreen->pitch/3;
myRenderType = kPhosphor_24; myRenderType = kPhosphor_24;
break; break;
case 32: case 32:
myPitch = myScreen->pitch/4;
myRenderType = kPhosphor_32; myRenderType = kPhosphor_32;
break; break;
default: default:

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // this file, and for a DISCLAIMER OF ALL WARRANTIES.
// //
// $Id: FrameBufferSoft.hxx,v 1.29 2006-01-15 16:31:01 stephena Exp $ // $Id: FrameBufferSoft.hxx,v 1.30 2006-01-15 22:43:21 stephena Exp $
//============================================================================ //============================================================================
#ifndef FRAMEBUFFER_SOFT_HXX #ifndef FRAMEBUFFER_SOFT_HXX
@ -35,7 +35,7 @@ class RectList;
This class implements an SDL software framebuffer. This class implements an SDL software framebuffer.
@author Stephen Anthony @author Stephen Anthony
@version $Id: FrameBufferSoft.hxx,v 1.29 2006-01-15 16:31:01 stephena Exp $ @version $Id: FrameBufferSoft.hxx,v 1.30 2006-01-15 22:43:21 stephena Exp $
*/ */
class FrameBufferSoft : public FrameBuffer class FrameBufferSoft : public FrameBuffer
{ {
@ -204,6 +204,8 @@ class FrameBufferSoft : public FrameBuffer
RectList* myOverlayRectList; RectList* myOverlayRectList;
private: private:
int myPitch;
enum RenderType { enum RenderType {
kSoftZoom, kSoftZoom,
kPhosphor_16, kPhosphor_16,