From b12dc3a7a676286ed4ce6901f02ee8982e0c632f Mon Sep 17 00:00:00 2001 From: stephena Date: Thu, 12 Mar 2009 15:37:07 +0000 Subject: [PATCH] A few minor tweaks in the GL code. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1678 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba --- stella/src/common/FrameBufferGL.cxx | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/stella/src/common/FrameBufferGL.cxx b/stella/src/common/FrameBufferGL.cxx index 4a1b9ab18..e7486e05f 100644 --- a/stella/src/common/FrameBufferGL.cxx +++ b/stella/src/common/FrameBufferGL.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: FrameBufferGL.cxx,v 1.138 2009-01-26 15:05:25 stephena Exp $ +// $Id: FrameBufferGL.cxx,v 1.139 2009-03-12 15:37:07 stephena Exp $ //============================================================================ #ifdef DISPLAY_OPENGL @@ -74,7 +74,7 @@ FrameBufferGL::FrameBufferGL(OSystem* osystem) // We need a pixel format for palette value calculations // It's done this way (vs directly accessing a FBSurfaceGL object) // since the structure may be needed before any FBSurface's have - // be created + // been created SDL_Surface* s = SDL_CreateRGBSurface(SDL_SWSURFACE, 1, 1, 16, 0x00007c00, 0x000003e0, 0x0000001f, 0x00000000); myPixelFormat = *(s->format); @@ -507,21 +507,7 @@ FBSurfaceGL::FBSurfaceGL(FrameBufferGL& buffer, myTexture = SDL_CreateRGBSurface(SDL_SWSURFACE, myTexWidth, myTexHeight, 16, 0x00007c00, 0x000003e0, 0x0000001f, 0x00000000); - - switch(myTexture->format->BytesPerPixel) - { - case 2: // 16-bit - myPitch = myTexture->pitch/2; - break; - case 3: // 24-bit - myPitch = myTexture->pitch; - break; - case 4: // 32-bit - myPitch = myTexture->pitch/4; - break; - default: - break; - } + myPitch = myTexture->pitch >> 1; // Associate the SDL surface with a GL texture object reload();