Some palette/framebuffer updates, and some work on making pause state

be in only one class (vs. spread over three like it is now).  I'm
sure the code is broken on every platform but Linux; I'll get to it.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1065 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2006-03-24 19:59:52 +00:00
parent 8fa78c60c3
commit f89d7d71e3
9 changed files with 100 additions and 81 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.58 2006-03-18 00:00:30 stephena Exp $ // $Id: FrameBufferGL.cxx,v 1.59 2006-03-24 19:59:52 stephena Exp $
//============================================================================ //============================================================================
#ifdef DISPLAY_OPENGL #ifdef DISPLAY_OPENGL
@ -343,7 +343,7 @@ void FrameBufferGL::drawMediaSource()
// are drawn in postFrameUpdate() // are drawn in postFrameUpdate()
myDirtyFlag = true; myDirtyFlag = true;
buffer[pos] = buffer[pos+1] = (uInt16) myPalette[v]; buffer[pos] = buffer[pos+1] = (uInt16) myDefTIAPalette[v];
} }
pos += 2; pos += 2;
} }
@ -370,8 +370,8 @@ void FrameBufferGL::drawMediaSource()
uInt8 v = currentFrame[bufofs]; uInt8 v = currentFrame[bufofs];
uInt8 w = previousFrame[bufofs]; uInt8 w = previousFrame[bufofs];
buffer[pos++] = (uInt16) myAvgPalette[v][w]; buffer[pos++] = (uInt16) myAvgTIAPalette[v][w];
buffer[pos++] = (uInt16) myAvgPalette[v][w]; buffer[pos++] = (uInt16) myAvgTIAPalette[v][w];
} }
bufofsY += width; bufofsY += width;
screenofsY += myTexture->w; screenofsY += myTexture->w;
@ -454,7 +454,7 @@ void FrameBufferGL::hLine(uInt32 x, uInt32 y, uInt32 x2, OverlayColor color)
{ {
uInt16* buffer = (uInt16*) myTexture->pixels + y * myTexture->w + x; uInt16* buffer = (uInt16*) myTexture->pixels + y * myTexture->w + x;
while(x++ <= x2) while(x++ <= x2)
*buffer++ = (uInt16) myPalette[color]; *buffer++ = (uInt16) myGUIPalette[color];
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -463,7 +463,7 @@ void FrameBufferGL::vLine(uInt32 x, uInt32 y, uInt32 y2, OverlayColor color)
uInt16* buffer = (uInt16*) myTexture->pixels + y * myTexture->w + x; uInt16* buffer = (uInt16*) myTexture->pixels + y * myTexture->w + x;
while(y++ <= y2) while(y++ <= y2)
{ {
*buffer = (uInt16) myPalette[color]; *buffer = (uInt16) myGUIPalette[color];
buffer += myTexture->w; buffer += myTexture->w;
} }
} }
@ -479,7 +479,7 @@ void FrameBufferGL::fillRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h,
tmp.y = y; tmp.y = y;
tmp.w = w; tmp.w = w;
tmp.h = h; tmp.h = h;
SDL_FillRect(myTexture, &tmp, myPalette[color]); SDL_FillRect(myTexture, &tmp, myGUIPalette[color]);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -512,7 +512,7 @@ void FrameBufferGL::drawChar(const GUI::Font* FONT, uInt8 chr,
for(int x = 0; x < w; ++x, mask >>= 1) for(int x = 0; x < w; ++x, mask >>= 1)
{ {
if(ptr & mask) if(ptr & mask)
buffer[x] = (uInt16) myPalette[color]; buffer[x] = (uInt16) myGUIPalette[color];
} }
buffer += myTexture->w; buffer += myTexture->w;
} }
@ -530,7 +530,7 @@ void FrameBufferGL::drawBitmap(uInt32* bitmap, Int32 tx, Int32 ty,
for(int x = 0; x < 8; ++x, mask >>= 4) for(int x = 0; x < 8; ++x, mask >>= 4)
{ {
if(bitmap[y] & mask) if(bitmap[y] & mask)
buffer[x] = (uInt16) myPalette[color]; buffer[x] = (uInt16) myGUIPalette[color];
} }
buffer += myTexture->w; buffer += myTexture->w;
} }

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.50 2006-03-18 00:00:30 stephena Exp $ // $Id: FrameBufferSoft.cxx,v 1.51 2006-03-24 19:59:52 stephena Exp $
//============================================================================ //============================================================================
#include <SDL.h> #include <SDL.h>
@ -220,7 +220,7 @@ void FrameBufferSoft::drawMediaSource()
temp.h = active.height * screenMultiple; temp.h = active.height * screenMultiple;
myRectList->add(&temp); myRectList->add(&temp);
SDL_FillRect(myScreen, &temp, myPalette[active.color]); SDL_FillRect(myScreen, &temp, myDefTIAPalette[active.color]);
++activeIndex; ++activeIndex;
} }
@ -238,7 +238,7 @@ void FrameBufferSoft::drawMediaSource()
temp.h = active.height * screenMultiple; temp.h = active.height * screenMultiple;
myRectList->add(&temp); myRectList->add(&temp);
SDL_FillRect(myScreen, &temp, myPalette[active.color]); SDL_FillRect(myScreen, &temp, myDefTIAPalette[active.color]);
} }
// We can now make the current rectangles into the active rectangles // We can now make the current rectangles into the active rectangles
@ -263,7 +263,7 @@ void FrameBufferSoft::drawMediaSource()
temp.h = active.height * screenMultiple; temp.h = active.height * screenMultiple;
myRectList->add(&temp); myRectList->add(&temp);
SDL_FillRect(myScreen, &temp, myPalette[active.color]); SDL_FillRect(myScreen, &temp, myDefTIAPalette[active.color]);
} }
break; // case 0 break; // case 0
} }
@ -296,8 +296,8 @@ void FrameBufferSoft::drawMediaSource()
while(xstride--) while(xstride--)
{ {
buffer[pos++] = (uInt16) myAvgPalette[v][w]; buffer[pos++] = (uInt16) myAvgTIAPalette[v][w];
buffer[pos++] = (uInt16) myAvgPalette[v][w]; buffer[pos++] = (uInt16) myAvgTIAPalette[v][w];
} }
} }
screenofsY += myPitch; screenofsY += myPitch;
@ -335,14 +335,14 @@ void FrameBufferSoft::drawMediaSource()
uInt8 r, g, b; uInt8 r, g, b;
if(SDL_BYTEORDER == SDL_BIG_ENDIAN) if(SDL_BYTEORDER == SDL_BIG_ENDIAN)
{ {
uInt32 pixel = myAvgPalette[v][w]; uInt32 pixel = myAvgTIAPalette[v][w];
b = pixel & 0xff; b = pixel & 0xff;
g = (pixel & 0xff00) >> 8; g = (pixel & 0xff00) >> 8;
r = (pixel & 0xff0000) >> 16; r = (pixel & 0xff0000) >> 16;
} }
else else
{ {
uInt32 pixel = myAvgPalette[v][w]; uInt32 pixel = myAvgTIAPalette[v][w];
r = pixel & 0xff; r = pixel & 0xff;
g = (pixel & 0xff00) >> 8; g = (pixel & 0xff00) >> 8;
b = (pixel & 0xff0000) >> 16; b = (pixel & 0xff0000) >> 16;
@ -389,8 +389,8 @@ void FrameBufferSoft::drawMediaSource()
while(xstride--) while(xstride--)
{ {
buffer[pos++] = (uInt32) myAvgPalette[v][w]; buffer[pos++] = (uInt32) myAvgTIAPalette[v][w];
buffer[pos++] = (uInt32) myAvgPalette[v][w]; buffer[pos++] = (uInt32) myAvgTIAPalette[v][w];
} }
} }
screenofsY += myPitch; screenofsY += myPitch;
@ -496,7 +496,7 @@ void FrameBufferSoft::hLine(uInt32 x, uInt32 y, uInt32 x2, OverlayColor color)
tmp.y = y * theZoomLevel; tmp.y = y * theZoomLevel;
tmp.w = (x2 - x + 1) * theZoomLevel; tmp.w = (x2 - x + 1) * theZoomLevel;
tmp.h = theZoomLevel; tmp.h = theZoomLevel;
SDL_FillRect(myScreen, &tmp, myPalette[color]); SDL_FillRect(myScreen, &tmp, myGUIPalette[color]);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -509,7 +509,7 @@ void FrameBufferSoft::vLine(uInt32 x, uInt32 y, uInt32 y2, OverlayColor color)
tmp.y = y * theZoomLevel; tmp.y = y * theZoomLevel;
tmp.w = theZoomLevel; tmp.w = theZoomLevel;
tmp.h = (y2 - y + 1) * theZoomLevel; tmp.h = (y2 - y + 1) * theZoomLevel;
SDL_FillRect(myScreen, &tmp, myPalette[color]); SDL_FillRect(myScreen, &tmp, myGUIPalette[color]);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -523,7 +523,7 @@ void FrameBufferSoft::fillRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h,
tmp.y = y * theZoomLevel; tmp.y = y * theZoomLevel;
tmp.w = w * theZoomLevel; tmp.w = w * theZoomLevel;
tmp.h = h * theZoomLevel; tmp.h = h * theZoomLevel;
SDL_FillRect(myScreen, &tmp, myPalette[color]); SDL_FillRect(myScreen, &tmp, myGUIPalette[color]);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -559,7 +559,7 @@ void FrameBufferSoft::drawChar(const GUI::Font* FONT, uInt8 chr,
rect.x = (x + xorig) * theZoomLevel; rect.x = (x + xorig) * theZoomLevel;
rect.y = (y + yorig) * theZoomLevel; rect.y = (y + yorig) * theZoomLevel;
rect.w = rect.h = theZoomLevel; rect.w = rect.h = theZoomLevel;
SDL_FillRect(myScreen, &rect, myPalette[color]); SDL_FillRect(myScreen, &rect, myGUIPalette[color]);
} }
} }
} }
@ -581,7 +581,7 @@ void FrameBufferSoft::drawBitmap(uInt32* bitmap, Int32 xorig, Int32 yorig,
rect.x = (x + xorig) * theZoomLevel; rect.x = (x + xorig) * theZoomLevel;
rect.y = (y + yorig) * theZoomLevel; rect.y = (y + yorig) * theZoomLevel;
rect.w = rect.h = theZoomLevel; rect.w = rect.h = theZoomLevel;
SDL_FillRect(myScreen, &rect, myPalette[color]); SDL_FillRect(myScreen, &rect, myGUIPalette[color]);
} }
} }
} }

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: EventHandler.cxx,v 1.155 2006-03-18 00:00:30 stephena Exp $ // $Id: EventHandler.cxx,v 1.156 2006-03-24 19:59:52 stephena Exp $
//============================================================================ //============================================================================
#include <sstream> #include <sstream>
@ -162,8 +162,7 @@ void EventHandler::reset(State state)
myPauseFlag = false; myPauseFlag = false;
myQuitFlag = false; myQuitFlag = false;
myOSystem->frameBuffer().pause(myPauseFlag); pause(false);
myOSystem->sound().mute(myPauseFlag);
myEvent->clear(); myEvent->clear();
if(myState == S_LAUNCHER) if(myState == S_LAUNCHER)
@ -216,6 +215,16 @@ void EventHandler::refreshDisplay(bool forceUpdate)
// cerr << " ==> State change = " << myState << endl; // cerr << " ==> State change = " << myState << endl;
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void EventHandler::pause(bool status)
{
cerr << "EventHandler::pause(): " << status << endl;
myPauseFlag = status;
myOSystem->frameBuffer().handlePause(myPauseFlag);
myOSystem->sound().mute(myPauseFlag);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void EventHandler::setupJoysticks() void EventHandler::setupJoysticks()
{ {
@ -1167,11 +1176,7 @@ void EventHandler::handleEvent(Event::Type event, int state)
case Event::Pause: case Event::Pause:
if(state) if(state)
{ pause(!myPauseFlag);
myPauseFlag = !myPauseFlag;
myOSystem->frameBuffer().pause(myPauseFlag);
myOSystem->sound().mute(myPauseFlag);
}
return; return;
case Event::LauncherMode: case Event::LauncherMode:

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: EventHandler.hxx,v 1.81 2006-03-18 00:00:30 stephena Exp $ // $Id: EventHandler.hxx,v 1.82 2006-03-24 19:59:52 stephena Exp $
//============================================================================ //============================================================================
#ifndef EVENTHANDLER_HXX #ifndef EVENTHANDLER_HXX
@ -107,7 +107,7 @@ struct JoyMouse {
mapping can take place. mapping can take place.
@author Stephen Anthony @author Stephen Anthony
@version $Id: EventHandler.hxx,v 1.81 2006-03-18 00:00:30 stephena Exp $ @version $Id: EventHandler.hxx,v 1.82 2006-03-24 19:59:52 stephena Exp $
*/ */
class EventHandler class EventHandler
{ {
@ -215,19 +215,24 @@ class EventHandler
void refreshDisplay(bool forceUpdate = false); void refreshDisplay(bool forceUpdate = false);
/** /**
This method indicates whether a pause event has been received. This method pauses the entire emulator.
*/ */
inline bool doPause() { return myPauseFlag; } void pause(bool status);
/** /**
This method indicates whether a quit event has been received. This method indicates whether a pause event has been received.
*/ */
inline bool doQuit() { return myQuitFlag; } inline bool isPaused() { return myPauseFlag; }
/** /**
This method indicates that the system should terminate. This method indicates that the system should terminate.
*/ */
inline void quit() { handleEvent(Event::Quit, 1); } void quit() { handleEvent(Event::Quit, 1); }
/**
This method indicates whether a quit event has been received.
*/
inline bool isQuit() { return myQuitFlag; }
/** /**
Save state to explicit state number (debugger uses this) Save state to explicit state number (debugger uses this)

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: FrameBuffer.cxx,v 1.83 2006-03-19 18:17:48 stephena Exp $ // $Id: FrameBuffer.cxx,v 1.84 2006-03-24 19:59:52 stephena Exp $
//============================================================================ //============================================================================
#include <sstream> #include <sstream>
@ -122,8 +122,8 @@ void FrameBuffer::initialize(const string& title, uInt32 width, uInt32 height,
myOSystem->eventHandler().refreshDisplay(); myOSystem->eventHandler().refreshDisplay();
// Set palette for GUI // Set palette for GUI
for(int i = 0; i < kNumColors-256; i++) for(int i = 0; i < kNumColors; i++)
myPalette[i+256] = mapRGB(ourGUIColors[i][0], ourGUIColors[i][1], ourGUIColors[i][2]); myGUIPalette[i] = mapRGB(ourGUIColors[i][0], ourGUIColors[i][1], ourGUIColors[i][2]);
// Set emulation palette if a console exists // Set emulation palette if a console exists
// Used when entering/exiting debugger // Used when entering/exiting debugger
@ -333,46 +333,53 @@ inline void FrameBuffer::drawMessage()
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FrameBuffer::pause(bool status) void FrameBuffer::handlePause(bool status)
{ {
cerr << "FrameBuffer::handlePause(): " << status << endl;
myPauseStatus = status; myPauseStatus = status;
// Enable the paused palette
if(&myOSystem->console())
{
enablePhosphor(myOSystem->console().properties().get(Display_Phosphor) == "YES");
setPalette(myOSystem->console().mediaSource().palette());
}
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FrameBuffer::setPalette(const uInt32* palette) void FrameBuffer::setPalette(const uInt32* palette)
{ {
// Account for pause mode
float shade = myPauseStatus ? 0.65 : 1.0;
int i, j; int i, j;
// Set palette for normal fill // Set palette for normal fill
for(i = 0; i < 256; ++i) for(i = 0; i < 256; ++i)
{ {
Uint8 r = (Uint8) ((palette[i] & 0x00ff0000) >> 16); Uint8 r = (Uint8) (((palette[i] & 0x00ff0000) >> 16) * shade);
Uint8 g = (Uint8) ((palette[i] & 0x0000ff00) >> 8); Uint8 g = (Uint8) (((palette[i] & 0x0000ff00) >> 8) * shade);
Uint8 b = (Uint8) (palette[i] & 0x000000ff); Uint8 b = (Uint8) ((palette[i] & 0x000000ff) * shade);
myPalette[i] = mapRGB(r, g, b); myDefTIAPalette[i] = mapRGB(r, g, b);
} }
// Set palette for phosphor effect // Set palette for phosphor effect
if(myUsePhosphor) for(i = 0; i < 256; ++i)
{ {
for(i = 0; i < 256; ++i) for(j = 0; j < 256; ++j)
{ {
for(j = 0; j < 256; ++j) uInt8 ri = (uInt8) ((palette[i] & 0x00ff0000) >> 16);
{ uInt8 gi = (uInt8) ((palette[i] & 0x0000ff00) >> 8);
uInt8 ri = (uInt8) ((palette[i] & 0x00ff0000) >> 16); uInt8 bi = (uInt8) (palette[i] & 0x000000ff);
uInt8 gi = (uInt8) ((palette[i] & 0x0000ff00) >> 8); uInt8 rj = (uInt8) ((palette[j] & 0x00ff0000) >> 16);
uInt8 bi = (uInt8) (palette[i] & 0x000000ff); uInt8 gj = (uInt8) ((palette[j] & 0x0000ff00) >> 8);
uInt8 rj = (uInt8) ((palette[j] & 0x00ff0000) >> 16); uInt8 bj = (uInt8) (palette[j] & 0x000000ff);
uInt8 gj = (uInt8) ((palette[j] & 0x0000ff00) >> 8);
uInt8 bj = (uInt8) (palette[j] & 0x000000ff);
Uint8 r = (Uint8) getPhosphor(ri, rj); Uint8 r = (Uint8) (getPhosphor(ri, rj) * shade);
Uint8 g = (Uint8) getPhosphor(gi, gj); Uint8 g = (Uint8) (getPhosphor(gi, gj) * shade);
Uint8 b = (Uint8) getPhosphor(bi, bj); Uint8 b = (Uint8) (getPhosphor(bi, bj) * shade);
myAvgPalette[i][j] = mapRGB(r, g, b); myAvgTIAPalette[i][j] = mapRGB(r, g, b);
}
} }
} }
@ -726,7 +733,7 @@ uInt8 FrameBuffer::getPhosphor(uInt8 c1, uInt8 c2)
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
const uInt8 FrameBuffer::ourGUIColors[kNumColors-256][3] = { const uInt8 FrameBuffer::ourGUIColors[kNumColors][3] = {
{ 104, 104, 104 }, // kColor { 104, 104, 104 }, // kColor
{ 0, 0, 0 }, // kBGColor { 0, 0, 0 }, // kBGColor
{ 64, 64, 64 }, // kShadowColor { 64, 64, 64 }, // kShadowColor

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: FrameBuffer.hxx,v 1.67 2006-03-19 18:17:48 stephena Exp $ // $Id: FrameBuffer.hxx,v 1.68 2006-03-24 19:59:52 stephena Exp $
//============================================================================ //============================================================================
#ifndef FRAMEBUFFER_HXX #ifndef FRAMEBUFFER_HXX
@ -70,7 +70,7 @@ enum MessagePosition {
All GUI elements (ala ScummVM) are drawn here as well. All GUI elements (ala ScummVM) are drawn here as well.
@author Stephen Anthony @author Stephen Anthony
@version $Id: FrameBuffer.hxx,v 1.67 2006-03-19 18:17:48 stephena Exp $ @version $Id: FrameBuffer.hxx,v 1.68 2006-03-24 19:59:52 stephena Exp $
*/ */
class FrameBuffer class FrameBuffer
{ {
@ -150,12 +150,11 @@ class FrameBuffer
inline const uInt32 imageHeight() { return myImageDim.h; } inline const uInt32 imageHeight() { return myImageDim.h; }
/** /**
Sets the pause status. While pause is selected, the Handle the pause event; currently this updates the palette.
MediaSource will not be updated.
@param status Toggle pause based on status @param status Whether pause has been enabled or disabled
*/ */
void pause(bool status); void handlePause(bool status);
/** /**
Indicates that the TIA area is dirty, and certain areas need Indicates that the TIA area is dirty, and certain areas need
@ -453,11 +452,12 @@ class FrameBuffer
// SDL initialization flags // SDL initialization flags
uInt32 mySDLFlags; uInt32 mySDLFlags;
// SDL palette, with the first 256 colors representing normal fill // TIA palettes for normal and phosphor modes
Uint32 myPalette[kNumColors]; Uint32 myDefTIAPalette[256];
Uint32 myAvgTIAPalette[256][256];
// SDL palette representing phosphor effect // GUI palette, derived from 'ourGUIColors'
Uint32 myAvgPalette[256][256]; Uint32 myGUIPalette[kNumColors];
// Indicates the current zoom level of the SDL screen // Indicates the current zoom level of the SDL screen
uInt32 theZoomLevel; uInt32 theZoomLevel;
@ -481,7 +481,7 @@ class FrameBuffer
int myPhosphorBlend; int myPhosphorBlend;
// Table of RGB values for GUI elements // Table of RGB values for GUI elements
static const uInt8 ourGUIColors[kNumColors-256][3]; static const uInt8 ourGUIColors[kNumColors][3];
private: private:
/** /**

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: OSystem.cxx,v 1.65 2006-03-22 15:12:02 stephena Exp $ // $Id: OSystem.cxx,v 1.66 2006-03-24 19:59:52 stephena Exp $
//============================================================================ //============================================================================
#include <cassert> #include <cassert>
@ -230,6 +230,8 @@ void OSystem::toggleFrameBuffer()
else // a driver that doesn't exist was requested, so use software mode else // a driver that doesn't exist was requested, so use software mode
video = "soft"; video = "soft";
myEventHandler->handleEvent(Event::Pause, 0);
// Update the settings and create the framebuffer // Update the settings and create the framebuffer
mySettings->setString("video", video); mySettings->setString("video", video);
createFrameBuffer(true); // show onscreen message createFrameBuffer(true); // show onscreen message

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: GuiUtils.hxx,v 1.22 2006-02-22 17:38:04 stephena Exp $ // $Id: GuiUtils.hxx,v 1.23 2006-03-24 19:59:52 stephena Exp $
// //
// Based on code from ScummVM - Scumm Interpreter // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -29,14 +29,14 @@
Probably not very neat, but at least it works ... Probably not very neat, but at least it works ...
@author Stephen Anthony @author Stephen Anthony
@version $Id: GuiUtils.hxx,v 1.22 2006-02-22 17:38:04 stephena Exp $ @version $Id: GuiUtils.hxx,v 1.23 2006-03-24 19:59:52 stephena Exp $
*/ */
#define kScrollBarWidth 9 #define kScrollBarWidth 9
// Colors indices to use for the various GUI elements // Colors indices to use for the various GUI elements
enum OverlayColor { enum OverlayColor {
kColor = 256, // The rest of the enumerations will continue from 256 kColor,
kBGColor, kBGColor,
kShadowColor, kShadowColor,
kHiliteColor, kHiliteColor,

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: OSystemUNIX.cxx,v 1.18 2006-03-17 23:06:28 stephena Exp $ // $Id: OSystemUNIX.cxx,v 1.19 2006-03-24 19:59:52 stephena Exp $
//============================================================================ //============================================================================
#include <SDL.h> #include <SDL.h>
@ -88,7 +88,7 @@ void OSystemUNIX::mainLoop()
for(;;) for(;;)
{ {
// Exit if the user wants to quit // Exit if the user wants to quit
if(myEventHandler->doQuit()) if(myEventHandler->isQuit())
break; break;
startTime = getTicks(); startTime = getTicks();
@ -121,7 +121,7 @@ void OSystemUNIX::mainLoop()
for(;;) for(;;)
{ {
// Exit if the user wants to quit // Exit if the user wants to quit
if(myEventHandler->doQuit()) if(myEventHandler->isQuit())
break; break;
startTime = getTicks(); startTime = getTicks();