Some code restructuring right across the board. I also reverted much

of the earlier palette changes, since it turned into a can of worms
I don't want to open.  I think we'll be ready for a new release soon.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1066 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2006-03-25 00:34:17 +00:00
parent f89d7d71e3
commit 34f5abb314
30 changed files with 238 additions and 263 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.59 2006-03-24 19:59:52 stephena Exp $ // $Id: FrameBufferGL.cxx,v 1.60 2006-03-25 00:34:17 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) myDefTIAPalette[v]; buffer[pos] = buffer[pos+1] = (uInt16) myDefPalette[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) myAvgTIAPalette[v][w]; buffer[pos++] = (uInt16) myAvgPalette[v][w];
buffer[pos++] = (uInt16) myAvgTIAPalette[v][w]; buffer[pos++] = (uInt16) myAvgPalette[v][w];
} }
bufofsY += width; bufofsY += width;
screenofsY += myTexture->w; screenofsY += myTexture->w;
@ -450,27 +450,27 @@ void FrameBufferGL::toggleFilter()
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FrameBufferGL::hLine(uInt32 x, uInt32 y, uInt32 x2, OverlayColor color) void FrameBufferGL::hLine(uInt32 x, uInt32 y, uInt32 x2, int 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) myGUIPalette[color]; *buffer++ = (uInt16) myDefPalette[color];
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FrameBufferGL::vLine(uInt32 x, uInt32 y, uInt32 y2, OverlayColor color) void FrameBufferGL::vLine(uInt32 x, uInt32 y, uInt32 y2, int 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) myGUIPalette[color]; *buffer = (uInt16) myDefPalette[color];
buffer += myTexture->w; buffer += myTexture->w;
} }
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FrameBufferGL::fillRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h, void FrameBufferGL::fillRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h,
OverlayColor color) int color)
{ {
SDL_Rect tmp; SDL_Rect tmp;
@ -479,12 +479,12 @@ 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, myGUIPalette[color]); SDL_FillRect(myTexture, &tmp, myDefPalette[color]);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FrameBufferGL::drawChar(const GUI::Font* FONT, uInt8 chr, void FrameBufferGL::drawChar(const GUI::Font* FONT, uInt8 chr,
uInt32 tx, uInt32 ty, OverlayColor color) uInt32 tx, uInt32 ty, int color)
{ {
GUI::Font* font = (GUI::Font*) FONT; GUI::Font* font = (GUI::Font*) FONT;
@ -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) myGUIPalette[color]; buffer[x] = (uInt16) myDefPalette[color];
} }
buffer += myTexture->w; buffer += myTexture->w;
} }
@ -520,7 +520,7 @@ void FrameBufferGL::drawChar(const GUI::Font* FONT, uInt8 chr,
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FrameBufferGL::drawBitmap(uInt32* bitmap, Int32 tx, Int32 ty, void FrameBufferGL::drawBitmap(uInt32* bitmap, Int32 tx, Int32 ty,
OverlayColor color, Int32 h) int color, Int32 h)
{ {
uInt16* buffer = (uInt16*) myTexture->pixels + ty * myTexture->w + tx; uInt16* buffer = (uInt16*) myTexture->pixels + ty * myTexture->w + tx;
@ -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) myGUIPalette[color]; buffer[x] = (uInt16) myDefPalette[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: FrameBufferGL.hxx,v 1.30 2006-01-19 00:45:12 stephena Exp $ // $Id: FrameBufferGL.hxx,v 1.31 2006-03-25 00:34:17 stephena Exp $
//============================================================================ //============================================================================
#ifndef FRAMEBUFFER_GL_HXX #ifndef FRAMEBUFFER_GL_HXX
@ -37,7 +37,7 @@ class GUI::Font;
This class implements an SDL OpenGL framebuffer. This class implements an SDL OpenGL framebuffer.
@author Stephen Anthony @author Stephen Anthony
@version $Id: FrameBufferGL.hxx,v 1.30 2006-01-19 00:45:12 stephena Exp $ @version $Id: FrameBufferGL.hxx,v 1.31 2006-03-25 00:34:17 stephena Exp $
*/ */
class FrameBufferGL : public FrameBuffer class FrameBufferGL : public FrameBuffer
{ {
@ -134,7 +134,7 @@ class FrameBufferGL : public FrameBuffer
@param x2 The second x coordinate @param x2 The second x coordinate
@param color The color of the line @param color The color of the line
*/ */
virtual void hLine(uInt32 x, uInt32 y, uInt32 x2, OverlayColor color); virtual void hLine(uInt32 x, uInt32 y, uInt32 x2, int color);
/** /**
This method is called to draw a vertical line. This method is called to draw a vertical line.
@ -144,7 +144,7 @@ class FrameBufferGL : public FrameBuffer
@param y2 The second y coordinate @param y2 The second y coordinate
@param color The color of the line @param color The color of the line
*/ */
virtual void vLine(uInt32 x, uInt32 y, uInt32 y2, OverlayColor color); virtual void vLine(uInt32 x, uInt32 y, uInt32 y2, int color);
/** /**
This method is called to draw a filled rectangle. This method is called to draw a filled rectangle.
@ -156,7 +156,7 @@ class FrameBufferGL : public FrameBuffer
@param color The color of the area @param color The color of the area
*/ */
virtual void fillRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h, virtual void fillRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h,
OverlayColor color); int color);
/** /**
This method is called to draw the specified character. This method is called to draw the specified character.
@ -168,7 +168,7 @@ class FrameBufferGL : public FrameBuffer
@param color The color of the character @param color The color of the character
*/ */
virtual void drawChar(const GUI::Font* font, uInt8 c, uInt32 x, uInt32 y, virtual void drawChar(const GUI::Font* font, uInt8 c, uInt32 x, uInt32 y,
OverlayColor color); int color);
/** /**
This method is called to draw the bitmap image. This method is called to draw the bitmap image.
@ -179,7 +179,7 @@ class FrameBufferGL : public FrameBuffer
@param color The color of the character @param color The color of the character
@param h The height of the data image @param h The height of the data image
*/ */
virtual void drawBitmap(uInt32* bitmap, Int32 x, Int32 y, OverlayColor color, virtual void drawBitmap(uInt32* bitmap, Int32 x, Int32 y, int color,
Int32 h = 8); Int32 h = 8);
/** /**

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.51 2006-03-24 19:59:52 stephena Exp $ // $Id: FrameBufferSoft.cxx,v 1.52 2006-03-25 00:34:17 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, myDefTIAPalette[active.color]); SDL_FillRect(myScreen, &temp, myDefPalette[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, myDefTIAPalette[active.color]); SDL_FillRect(myScreen, &temp, myDefPalette[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, myDefTIAPalette[active.color]); SDL_FillRect(myScreen, &temp, myDefPalette[active.color]);
} }
break; // case 0 break; // case 0
} }
@ -296,8 +296,8 @@ void FrameBufferSoft::drawMediaSource()
while(xstride--) while(xstride--)
{ {
buffer[pos++] = (uInt16) myAvgTIAPalette[v][w]; buffer[pos++] = (uInt16) myAvgPalette[v][w];
buffer[pos++] = (uInt16) myAvgTIAPalette[v][w]; buffer[pos++] = (uInt16) myAvgPalette[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 = myAvgTIAPalette[v][w]; uInt32 pixel = myAvgPalette[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 = myAvgTIAPalette[v][w]; uInt32 pixel = myAvgPalette[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) myAvgTIAPalette[v][w]; buffer[pos++] = (uInt32) myAvgPalette[v][w];
buffer[pos++] = (uInt32) myAvgTIAPalette[v][w]; buffer[pos++] = (uInt32) myAvgPalette[v][w];
} }
} }
screenofsY += myPitch; screenofsY += myPitch;
@ -487,7 +487,7 @@ void FrameBufferSoft::toggleFilter()
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FrameBufferSoft::hLine(uInt32 x, uInt32 y, uInt32 x2, OverlayColor color) void FrameBufferSoft::hLine(uInt32 x, uInt32 y, uInt32 x2, int color)
{ {
SDL_Rect tmp; SDL_Rect tmp;
@ -496,11 +496,11 @@ 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, myGUIPalette[color]); SDL_FillRect(myScreen, &tmp, myDefPalette[color]);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FrameBufferSoft::vLine(uInt32 x, uInt32 y, uInt32 y2, OverlayColor color) void FrameBufferSoft::vLine(uInt32 x, uInt32 y, uInt32 y2, int color)
{ {
SDL_Rect tmp; SDL_Rect tmp;
@ -509,12 +509,12 @@ 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, myGUIPalette[color]); SDL_FillRect(myScreen, &tmp, myDefPalette[color]);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FrameBufferSoft::fillRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h, void FrameBufferSoft::fillRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h,
OverlayColor color) int color)
{ {
SDL_Rect tmp; SDL_Rect tmp;
@ -523,12 +523,12 @@ 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, myGUIPalette[color]); SDL_FillRect(myScreen, &tmp, myDefPalette[color]);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FrameBufferSoft::drawChar(const GUI::Font* FONT, uInt8 chr, void FrameBufferSoft::drawChar(const GUI::Font* FONT, uInt8 chr,
uInt32 xorig, uInt32 yorig, OverlayColor color) uInt32 xorig, uInt32 yorig, int color)
{ {
GUI::Font* font = (GUI::Font*)FONT; GUI::Font* font = (GUI::Font*)FONT;
const FontDesc& desc = font->desc(); const FontDesc& desc = font->desc();
@ -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, myGUIPalette[color]); SDL_FillRect(myScreen, &rect, myDefPalette[color]);
} }
} }
} }
@ -567,7 +567,7 @@ void FrameBufferSoft::drawChar(const GUI::Font* FONT, uInt8 chr,
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FrameBufferSoft::drawBitmap(uInt32* bitmap, Int32 xorig, Int32 yorig, void FrameBufferSoft::drawBitmap(uInt32* bitmap, Int32 xorig, Int32 yorig,
OverlayColor color, Int32 h) int color, Int32 h)
{ {
SDL_Rect rect; SDL_Rect rect;
for(int y = 0; y < h; y++) for(int y = 0; y < h; y++)
@ -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, myGUIPalette[color]); SDL_FillRect(myScreen, &rect, myDefPalette[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: FrameBufferSoft.hxx,v 1.33 2006-02-15 03:22:34 azaballa Exp $ // $Id: FrameBufferSoft.hxx,v 1.34 2006-03-25 00:34:17 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.33 2006-02-15 03:22:34 azaballa Exp $ @version $Id: FrameBufferSoft.hxx,v 1.34 2006-03-25 00:34:17 stephena Exp $
*/ */
class FrameBufferSoft : public FrameBuffer class FrameBufferSoft : public FrameBuffer
{ {
@ -123,7 +123,7 @@ class FrameBufferSoft : public FrameBuffer
@param x2 The second x coordinate @param x2 The second x coordinate
@param color The color of the line @param color The color of the line
*/ */
virtual void hLine(uInt32 x, uInt32 y, uInt32 x2, OverlayColor color); virtual void hLine(uInt32 x, uInt32 y, uInt32 x2, int color);
/** /**
This method is called to draw a vertical line. This method is called to draw a vertical line.
@ -133,7 +133,7 @@ class FrameBufferSoft : public FrameBuffer
@param y2 The second y coordinate @param y2 The second y coordinate
@param color The color of the line @param color The color of the line
*/ */
virtual void vLine(uInt32 x, uInt32 y, uInt32 y2, OverlayColor color); virtual void vLine(uInt32 x, uInt32 y, uInt32 y2, int color);
/** /**
This method is called to draw a filled rectangle. This method is called to draw a filled rectangle.
@ -145,7 +145,7 @@ class FrameBufferSoft : public FrameBuffer
@param color The color of the area @param color The color of the area
*/ */
virtual void fillRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h, virtual void fillRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h,
OverlayColor color); int color);
/** /**
This method is called to draw the specified character. This method is called to draw the specified character.
@ -157,7 +157,7 @@ class FrameBufferSoft : public FrameBuffer
@param color The color of the character @param color The color of the character
*/ */
virtual void drawChar(const GUI::Font* font, uInt8 c, uInt32 x, uInt32 y, virtual void drawChar(const GUI::Font* font, uInt8 c, uInt32 x, uInt32 y,
OverlayColor color); int color);
/** /**
This method is called to draw the bitmap image. This method is called to draw the bitmap image.
@ -168,7 +168,7 @@ class FrameBufferSoft : public FrameBuffer
@param color The color of the character @param color The color of the character
@param h The height of the data image @param h The height of the data image
*/ */
virtual void drawBitmap(uInt32* bitmap, Int32 x, Int32 y, OverlayColor color, virtual void drawBitmap(uInt32* bitmap, Int32 x, Int32 y, int color,
Int32 h = 8); Int32 h = 8);
/** /**

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: ColorWidget.cxx,v 1.3 2006-02-22 17:38:04 stephena Exp $ // $Id: ColorWidget.cxx,v 1.4 2006-03-25 00:34:17 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
@ -72,5 +72,5 @@ void ColorWidget::drawWidget(bool hilite)
fb.vLine(_x + _w - 1, _y, _y +_h - 1, kShadowColor); fb.vLine(_x + _w - 1, _y, _y +_h - 1, kShadowColor);
// Show the currently selected color // Show the currently selected color
fb.fillRect(_x+1, _y+1, _w-2, _h-1, (OverlayColor) _color); fb.fillRect(_x+1, _y+1, _w-2, _h-1, _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: DataGridWidget.cxx,v 1.6 2006-02-22 17:38:04 stephena Exp $ // $Id: DataGridWidget.cxx,v 1.7 2006-03-25 00:34:17 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
@ -520,8 +520,7 @@ void DataGridWidget::drawWidget(bool hilite)
buffer = _valueStringList[pos]; buffer = _valueStringList[pos];
deltax = 0; deltax = 0;
OverlayColor color = kTextColor; int color = kTextColor;
if(_changedList[pos]) if(_changedList[pos])
{ {
fb.fillRect(x - 3, y - 1, _colWidth-1, _rowHeight-1, kTextColorEm); fb.fillRect(x - 3, y - 1, _colWidth-1, _rowHeight-1, kTextColorEm);

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: PromptWidget.cxx,v 1.7 2006-02-22 17:38:04 stephena Exp $ // $Id: PromptWidget.cxx,v 1.8 2006-03-25 00:34:17 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
@ -102,7 +102,7 @@ PromptWidget::~PromptWidget()
void PromptWidget::drawWidget(bool hilite) void PromptWidget::drawWidget(bool hilite)
{ {
//cerr << "PromptWidget::drawWidget\n"; //cerr << "PromptWidget::drawWidget\n";
OverlayColor fgcolor, bgcolor; int fgcolor, bgcolor;
FrameBuffer& fb = _boss->instance()->frameBuffer(); FrameBuffer& fb = _boss->instance()->frameBuffer();
@ -118,10 +118,10 @@ void PromptWidget::drawWidget(bool hilite)
if(c & (1 << 17)) { // inverse video flag if(c & (1 << 17)) { // inverse video flag
fgcolor = bgColor; fgcolor = bgColor;
bgcolor = (OverlayColor)((c & 0x1ffff) >> 8); bgcolor = (c & 0x1ffff) >> 8;
fb.fillRect(x, y, _kConsoleCharWidth, _kConsoleCharHeight, bgcolor); fb.fillRect(x, y, _kConsoleCharWidth, _kConsoleCharHeight, bgcolor);
} else { } else {
fgcolor = (OverlayColor)(c >> 8); fgcolor = c >> 8;
bgcolor = bgColor; bgcolor = bgColor;
} }
fb.drawChar(&instance()->consoleFont(), c & 0x7f, x, y, fgcolor); fb.drawChar(&instance()->consoleFont(), c & 0x7f, x, y, fgcolor);
@ -792,10 +792,10 @@ void PromptWidget::putcharIntern(int c)
// don't print or advance cursor // don't print or advance cursor
// there are only 128 TIA colors, but // there are only 128 TIA colors, but
// OverlayColor contains 256 of them // OverlayColor contains 256 of them
textColor = (OverlayColor) ((c & 0x7f) << 1); textColor = (c & 0x7f) << 1;
} }
else if(c < ' ') { // More colors (the regular GUI ones) else if(c < ' ') { // More colors (the regular GUI ones)
textColor = (OverlayColor) (c + 0x100); textColor = c + 0x100;
} }
else if(c == 0x7f) { // toggle inverse video (DEL char) else if(c == 0x7f) { // toggle inverse video (DEL char)
_inverse = !_inverse; _inverse = !_inverse;

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: PromptWidget.hxx,v 1.4 2006-02-22 17:38:04 stephena Exp $ // $Id: PromptWidget.hxx,v 1.5 2006-03-25 00:34:17 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
@ -108,10 +108,10 @@ class PromptWidget : public Widget, public CommandSender
int _kConsoleCharWidth, _kConsoleCharHeight, _kConsoleLineHeight; int _kConsoleCharWidth, _kConsoleCharHeight, _kConsoleLineHeight;
OverlayColor defaultTextColor; int defaultTextColor;
OverlayColor defaultBGColor; int defaultBGColor;
OverlayColor textColor; int textColor;
OverlayColor bgColor; int bgColor;
bool _inverse; bool _inverse;
bool _makeDirty; bool _makeDirty;
bool _firstTime; bool _firstTime;

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: TiaWidget.cxx,v 1.2 2006-02-22 17:38:04 stephena Exp $ // $Id: TiaWidget.cxx,v 1.3 2006-03-25 00:34:17 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
@ -980,7 +980,7 @@ void TiaWidget::fillGrid()
// P0 register info // P0 register info
//////////////////////////// ////////////////////////////
// grP0 // grP0
myGRP0->setColor((OverlayColor)state.coluRegs[0]); myGRP0->setColor(state.coluRegs[0]);
myGRP0->setIntState(state.gr[P0], false); myGRP0->setIntState(state.gr[P0], false);
// posP0 // posP0
@ -1001,7 +1001,7 @@ void TiaWidget::fillGrid()
// P1 register info // P1 register info
//////////////////////////// ////////////////////////////
// grP1 // grP1
myGRP1->setColor((OverlayColor)state.coluRegs[1]); myGRP1->setColor(state.coluRegs[1]);
myGRP1->setIntState(state.gr[P1], false); myGRP1->setIntState(state.gr[P1], false);
// posP1 // posP1
@ -1076,15 +1076,15 @@ void TiaWidget::fillGrid()
// PF register info // PF register info
//////////////////////////// ////////////////////////////
// PF0 // PF0
myPF[0]->setColor((OverlayColor)state.coluRegs[2]); myPF[0]->setColor(state.coluRegs[2]);
myPF[0]->setIntState(state.pf[0], true); // reverse bit order myPF[0]->setIntState(state.pf[0], true); // reverse bit order
// PF1 // PF1
myPF[1]->setColor((OverlayColor)state.coluRegs[2]); myPF[1]->setColor(state.coluRegs[2]);
myPF[1]->setIntState(state.pf[1], false); myPF[1]->setIntState(state.pf[1], false);
// PF2 // PF2
myPF[2]->setColor((OverlayColor)state.coluRegs[2]); myPF[2]->setColor(state.coluRegs[2]);
myPF[2]->setIntState(state.pf[2], true); // reverse bit order myPF[2]->setIntState(state.pf[2], true); // reverse bit order
// Reflect // Reflect

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: TiaZoomWidget.cxx,v 1.6 2006-02-22 17:38:04 stephena Exp $ // $Id: TiaZoomWidget.cxx,v 1.7 2006-03-25 00:34:17 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
@ -219,15 +219,8 @@ void TiaZoomWidget::drawWidget(bool hilite)
{ {
for(x = myXoff, col = 0; x < myNumCols+myXoff; ++x, col += width) for(x = myXoff, col = 0; x < myNumCols+myXoff; ++x, col += width)
{ {
SDL_Rect temp;
temp.x = _x + col;
temp.y = _y + row;
temp.w = width;
temp.h = height;
fb.fillRect(_x + col + 2, _y + row + 2, width, height, fb.fillRect(_x + col + 2, _y + row + 2, width, height,
(OverlayColor)currentFrame[y*pitch + x]); currentFrame[y*pitch + x]);
} }
} }
} }

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: TogglePixelWidget.hxx,v 1.2 2006-02-22 17:38:04 stephena Exp $ // $Id: TogglePixelWidget.hxx,v 1.3 2006-03-25 00:34:17 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
@ -33,7 +33,7 @@ class TogglePixelWidget : public ToggleWidget
int x, int y, int cols, int rows); int x, int y, int cols, int rows);
virtual ~TogglePixelWidget(); virtual ~TogglePixelWidget();
void setColor(OverlayColor color) { _pixelColor = color; } void setColor(int color) { _pixelColor = color; }
void setState(const BoolArray& state); void setState(const BoolArray& state);
void setIntState(int value, bool swap); void setIntState(int value, bool swap);
@ -43,7 +43,7 @@ class TogglePixelWidget : public ToggleWidget
void drawWidget(bool hilite); void drawWidget(bool hilite);
private: private:
OverlayColor _pixelColor; int _pixelColor;
unsigned int _numBits; unsigned int _numBits;
bool _swapBits; bool _swapBits;
}; };

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: Console.cxx,v 1.87 2006-03-19 18:17:48 stephena Exp $ // $Id: Console.cxx,v 1.88 2006-03-25 00:34:17 stephena Exp $
//============================================================================ //============================================================================
#include <assert.h> #include <assert.h>
@ -475,14 +475,14 @@ void Console::fry()
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Console::changeXStart(const uInt32 direction) void Console::changeXStart(int direction)
{ {
Int32 xstart = atoi(myProperties.get(Display_XStart).c_str()); Int32 xstart = atoi(myProperties.get(Display_XStart).c_str());
uInt32 width = atoi(myProperties.get(Display_Width).c_str()); uInt32 width = atoi(myProperties.get(Display_Width).c_str());
ostringstream strval; ostringstream strval;
string message; string message;
if(direction == 1) // increase XStart if(direction == +1) // increase XStart
{ {
xstart += 4; xstart += 4;
if(xstart > 80) if(xstart > 80)
@ -496,7 +496,7 @@ void Console::changeXStart(const uInt32 direction)
return; return;
} }
} }
else if(direction == 0) // decrease XStart else if(direction == -1) // decrease XStart
{ {
xstart -= 4; xstart -= 4;
if(xstart < 0) if(xstart < 0)
@ -505,6 +505,8 @@ void Console::changeXStart(const uInt32 direction)
return; return;
} }
} }
else
return;
strval << xstart; strval << xstart;
myProperties.set(Display_XStart, strval.str()); myProperties.set(Display_XStart, strval.str());
@ -517,13 +519,13 @@ void Console::changeXStart(const uInt32 direction)
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Console::changeYStart(const uInt32 direction) void Console::changeYStart(int direction)
{ {
Int32 ystart = atoi(myProperties.get(Display_YStart).c_str()); Int32 ystart = atoi(myProperties.get(Display_YStart).c_str());
ostringstream strval; ostringstream strval;
string message; string message;
if(direction == 1) // increase YStart if(direction == +1) // increase YStart
{ {
ystart++; ystart++;
if(ystart > 64) if(ystart > 64)
@ -532,7 +534,7 @@ void Console::changeYStart(const uInt32 direction)
return; return;
} }
} }
else if(direction == 0) // decrease YStart else if(direction == -1) // decrease YStart
{ {
ystart--; ystart--;
if(ystart < 0) if(ystart < 0)
@ -541,6 +543,8 @@ void Console::changeYStart(const uInt32 direction)
return; return;
} }
} }
else
return;
strval << ystart; strval << ystart;
myProperties.set(Display_YStart, strval.str()); myProperties.set(Display_YStart, strval.str());
@ -553,14 +557,14 @@ void Console::changeYStart(const uInt32 direction)
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Console::changeWidth(const uInt32 direction) void Console::changeWidth(int direction)
{ {
uInt32 xstart = atoi(myProperties.get(Display_XStart).c_str()); uInt32 xstart = atoi(myProperties.get(Display_XStart).c_str());
Int32 width = atoi(myProperties.get(Display_Width).c_str()); Int32 width = atoi(myProperties.get(Display_Width).c_str());
ostringstream strval; ostringstream strval;
string message; string message;
if(direction == 1) // increase Width if(direction == +1) // increase Width
{ {
width += 4; width += 4;
if((width > 160) || ((width % 4) != 0)) if((width > 160) || ((width % 4) != 0))
@ -574,7 +578,7 @@ void Console::changeWidth(const uInt32 direction)
return; return;
} }
} }
else if(direction == 0) // decrease Width else if(direction == -1) // decrease Width
{ {
width -= 4; width -= 4;
if(width < 80) if(width < 80)
@ -583,6 +587,8 @@ void Console::changeWidth(const uInt32 direction)
return; return;
} }
} }
else
return;
strval << width; strval << width;
myProperties.set(Display_Width, strval.str()); myProperties.set(Display_Width, strval.str());
@ -595,13 +601,13 @@ void Console::changeWidth(const uInt32 direction)
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Console::changeHeight(const uInt32 direction) void Console::changeHeight(int direction)
{ {
Int32 height = atoi(myProperties.get(Display_Height).c_str()); Int32 height = atoi(myProperties.get(Display_Height).c_str());
ostringstream strval; ostringstream strval;
string message; string message;
if(direction == 1) // increase Height if(direction == +1) // increase Height
{ {
height++; height++;
if(height > 256) if(height > 256)
@ -610,7 +616,7 @@ void Console::changeHeight(const uInt32 direction)
return; return;
} }
} }
else if(direction == 0) // decrease Height else if(direction == -1) // decrease Height
{ {
height--; height--;
if(height < 100) if(height < 100)
@ -619,6 +625,8 @@ void Console::changeHeight(const uInt32 direction)
return; return;
} }
} }
else
return;
strval << height; strval << height;
myProperties.set(Display_Height, strval.str()); myProperties.set(Display_Height, strval.str());

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: Console.hxx,v 1.42 2006-01-11 14:13:19 stephena Exp $ // $Id: Console.hxx,v 1.43 2006-03-25 00:34:17 stephena Exp $
//============================================================================ //============================================================================
#ifndef CONSOLE_HXX #ifndef CONSOLE_HXX
@ -37,7 +37,7 @@ class System;
This class represents the entire game console. This class represents the entire game console.
@author Bradford W. Mott @author Bradford W. Mott
@version $Id: Console.hxx,v 1.42 2006-01-11 14:13:19 stephena Exp $ @version $Id: Console.hxx,v 1.43 2006-03-25 00:34:17 stephena Exp $
*/ */
class Console class Console
{ {
@ -196,33 +196,33 @@ class Console
Change the "Display.XStart" variable. Currently, a system reset is issued Change the "Display.XStart" variable. Currently, a system reset is issued
after the change. GUI's may need to resize their viewports. after the change. GUI's may need to resize their viewports.
@param direction A 1 indicates increase, 0 indicates decrease. @param direction +1 indicates increase, -1 indicates decrease.
*/ */
void changeXStart(const uInt32 direction); void changeXStart(int direction);
/** /**
Change the "Display.XStart" variable. Currently, a system reset is issued Change the "Display.XStart" variable. Currently, a system reset is issued
after the change. GUI's may need to resize their viewports. after the change. GUI's may need to resize their viewports.
@param direction A 1 indicates increase, 0 indicates decrease. @param direction +1 indicates increase, -1 indicates decrease.
*/ */
void changeYStart(const uInt32 direction); void changeYStart(int direction);
/** /**
Change the "Display.XStart" variable. Currently, a system reset is issued Change the "Display.XStart" variable. Currently, a system reset is issued
after the change. GUI's may need to resize their viewports. after the change. GUI's may need to resize their viewports.
@param direction A 1 indicates increase, 0 indicates decrease. @param direction +1 indicates increase, -1 indicates decrease.
*/ */
void changeWidth(const uInt32 direction); void changeWidth(int direction);
/** /**
Change the "Display.XStart" variable. Currently, a system reset is issued Change the "Display.XStart" variable. Currently, a system reset is issued
after the change. GUI's may need to resize their viewports. after the change. GUI's may need to resize their viewports.
@param direction A 1 indicates increase, 0 indicates decrease. @param direction +1 indicates increase, -1 indicates decrease.
*/ */
void changeHeight(const uInt32 direction); void changeHeight(int direction);
/** /**
Toggles the TIA bit specified in the method name. Toggles the TIA bit specified in the method name.

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.156 2006-03-24 19:59:52 stephena Exp $ // $Id: EventHandler.cxx,v 1.157 2006-03-25 00:34:17 stephena Exp $
//============================================================================ //============================================================================
#include <sstream> #include <sstream>
@ -218,10 +218,9 @@ void EventHandler::refreshDisplay(bool forceUpdate)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void EventHandler::pause(bool status) void EventHandler::pause(bool status)
{ {
cerr << "EventHandler::pause(): " << status << endl;
myPauseFlag = status; myPauseFlag = status;
myOSystem->frameBuffer().handlePause(myPauseFlag); myOSystem->frameBuffer().pause(myPauseFlag);
myOSystem->sound().mute(myPauseFlag); myOSystem->sound().mute(myPauseFlag);
} }
@ -392,11 +391,11 @@ void EventHandler::poll(uInt32 time)
{ {
#ifndef MAC_OSX #ifndef MAC_OSX
case SDLK_EQUALS: case SDLK_EQUALS:
myOSystem->frameBuffer().resize(NextSize); myOSystem->frameBuffer().resize(+1);
break; break;
case SDLK_MINUS: case SDLK_MINUS:
myOSystem->frameBuffer().resize(PreviousSize); myOSystem->frameBuffer().resize(-1);
break; break;
case SDLK_RETURN: case SDLK_RETURN:
@ -422,19 +421,19 @@ void EventHandler::poll(uInt32 time)
break; break;
case SDLK_END: // Alt-End increases XStart case SDLK_END: // Alt-End increases XStart
myOSystem->console().changeXStart(1); myOSystem->console().changeXStart(+1);
break; break;
case SDLK_HOME: // Alt-Home decreases XStart case SDLK_HOME: // Alt-Home decreases XStart
myOSystem->console().changeXStart(0); myOSystem->console().changeXStart(-1);
break; break;
case SDLK_PAGEUP: // Alt-PageUp increases YStart case SDLK_PAGEUP: // Alt-PageUp increases YStart
myOSystem->console().changeYStart(1); myOSystem->console().changeYStart(+1);
break; break;
case SDLK_PAGEDOWN: // Alt-PageDown decreases YStart case SDLK_PAGEDOWN: // Alt-PageDown decreases YStart
myOSystem->console().changeYStart(0); myOSystem->console().changeYStart(-1);
break; break;
case SDLK_z: case SDLK_z:
@ -526,11 +525,11 @@ void EventHandler::poll(uInt32 time)
break; break;
case SDLK_EQUALS: case SDLK_EQUALS:
myOSystem->frameBuffer().resize(NextSize); myOSystem->frameBuffer().resize(+1);
break; break;
case SDLK_MINUS: case SDLK_MINUS:
myOSystem->frameBuffer().resize(PreviousSize); myOSystem->frameBuffer().resize(-1);
break; break;
case SDLK_RETURN: case SDLK_RETURN:
@ -582,19 +581,19 @@ void EventHandler::poll(uInt32 time)
break; break;
case SDLK_END: // Ctrl-End increases Width case SDLK_END: // Ctrl-End increases Width
myOSystem->console().changeWidth(1); myOSystem->console().changeWidth(+1);
break; break;
case SDLK_HOME: // Ctrl-Home decreases Width case SDLK_HOME: // Ctrl-Home decreases Width
myOSystem->console().changeWidth(0); myOSystem->console().changeWidth(-1);
break; break;
case SDLK_PAGEUP: // Ctrl-PageUp increases Height case SDLK_PAGEUP: // Ctrl-PageUp increases Height
myOSystem->console().changeHeight(1); myOSystem->console().changeHeight(+1);
break; break;
case SDLK_PAGEDOWN: // Ctrl-PageDown decreases Height case SDLK_PAGEDOWN: // Ctrl-PageDown decreases Height
myOSystem->console().changeHeight(0); myOSystem->console().changeHeight(-1);
break; break;
case SDLK_s: // Ctrl-s saves properties to a file case SDLK_s: // Ctrl-s saves properties to a file

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.82 2006-03-24 19:59:52 stephena Exp $ // $Id: EventHandler.hxx,v 1.83 2006-03-25 00:34:17 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.82 2006-03-24 19:59:52 stephena Exp $ @version $Id: EventHandler.hxx,v 1.83 2006-03-25 00:34:17 stephena Exp $
*/ */
class EventHandler class EventHandler
{ {
@ -232,7 +232,7 @@ class EventHandler
/** /**
This method indicates whether a quit event has been received. This method indicates whether a quit event has been received.
*/ */
inline bool isQuit() { return myQuitFlag; } inline bool doQuit() { 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.84 2006-03-24 19:59:52 stephena Exp $ // $Id: FrameBuffer.cxx,v 1.85 2006-03-25 00:34:17 stephena Exp $
//============================================================================ //============================================================================
#include <sstream> #include <sstream>
@ -51,8 +51,7 @@ FrameBuffer::FrameBuffer(OSystem* osystem)
theRedrawTIAIndicator(true), theRedrawTIAIndicator(true),
myUsePhosphor(false), myUsePhosphor(false),
myPhosphorBlend(77), myPhosphorBlend(77),
myFrameRate(0), myFrameRate(0)
myPauseStatus(false)
{ {
myBaseDim.x = myBaseDim.y = myBaseDim.w = myBaseDim.h = 0; myBaseDim.x = myBaseDim.y = myBaseDim.w = myBaseDim.h = 0;
myImageDim = myScreenDim = myDesktopDim = myBaseDim; myImageDim = myScreenDim = myDesktopDim = myBaseDim;
@ -122,18 +121,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; i++) for(int i = 0; i < kNumColors-256; i++)
myGUIPalette[i] = mapRGB(ourGUIColors[i][0], ourGUIColors[i][1], ourGUIColors[i][2]); myDefPalette[i+256] = mapRGB(ourGUIColors[i][0], ourGUIColors[i][1], ourGUIColors[i][2]);
// Set emulation palette if a console exists
// Used when entering/exiting debugger
#ifdef DEVELOPER_SUPPORT
if(&myOSystem->console())
{
enablePhosphor(myOSystem->console().properties().get(Display_Phosphor) == "YES");
setPalette(myOSystem->console().mediaSource().palette());
}
#endif
// Enable unicode so we can see translated key events // Enable unicode so we can see translated key events
// (lowercase vs. uppercase characters) // (lowercase vs. uppercase characters)
@ -161,7 +150,7 @@ void FrameBuffer::update()
bool mediaSourceChanged = false; bool mediaSourceChanged = false;
// Draw changes to the mediasource // Draw changes to the mediasource
if(!myPauseStatus) if(!myOSystem->eventHandler().isPaused())
{ {
myOSystem->console().mediaSource().update(); myOSystem->console().mediaSource().update();
if(myOSystem->eventHandler().frying()) if(myOSystem->eventHandler().frying())
@ -174,7 +163,7 @@ void FrameBuffer::update()
drawMediaSource(); drawMediaSource();
// Draw any pending messages // Draw any pending messages
if(myMessage.counter > 0 && !myPauseStatus) if(myMessage.counter > 0 && !myOSystem->eventHandler().isPaused())
drawMessage(); drawMessage();
break; // S_EMULATE break; // S_EMULATE
@ -199,7 +188,7 @@ void FrameBuffer::update()
myOSystem->commandMenu().draw(); myOSystem->commandMenu().draw();
// Draw any pending messages // Draw any pending messages
if(myMessage.counter > 0 && !myPauseStatus) if(myMessage.counter > 0 && !myOSystem->eventHandler().isPaused())
drawMessage(); drawMessage();
break; // S_CMDMENU break; // S_CMDMENU
} }
@ -237,7 +226,7 @@ void FrameBuffer::update()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FrameBuffer::showMessage(const string& message, MessagePosition position, void FrameBuffer::showMessage(const string& message, MessagePosition position,
OverlayColor color) int color)
{ {
// Erase old messages on the screen // Erase old messages on the screen
if(myMessage.counter > 0) if(myMessage.counter > 0)
@ -333,12 +322,8 @@ inline void FrameBuffer::drawMessage()
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FrameBuffer::handlePause(bool status) void FrameBuffer::pause(bool status)
{ {
cerr << "FrameBuffer::handlePause(): " << status << endl;
myPauseStatus = status;
// Enable the paused palette
if(&myOSystem->console()) if(&myOSystem->console())
{ {
enablePhosphor(myOSystem->console().properties().get(Display_Phosphor) == "YES"); enablePhosphor(myOSystem->console().properties().get(Display_Phosphor) == "YES");
@ -349,18 +334,16 @@ cerr << "FrameBuffer::handlePause(): " << status << endl;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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) * shade); Uint8 r = (Uint8) ((palette[i] & 0x00ff0000) >> 16);
Uint8 g = (Uint8) (((palette[i] & 0x0000ff00) >> 8) * shade); Uint8 g = (Uint8) ((palette[i] & 0x0000ff00) >> 8);
Uint8 b = (Uint8) ((palette[i] & 0x000000ff) * shade); Uint8 b = (Uint8) (palette[i] & 0x000000ff);
myDefTIAPalette[i] = mapRGB(r, g, b); myDefPalette[i] = mapRGB(r, g, b);
} }
// Set palette for phosphor effect // Set palette for phosphor effect
@ -375,11 +358,11 @@ void FrameBuffer::setPalette(const uInt32* palette)
uInt8 gj = (uInt8) ((palette[j] & 0x0000ff00) >> 8); uInt8 gj = (uInt8) ((palette[j] & 0x0000ff00) >> 8);
uInt8 bj = (uInt8) (palette[j] & 0x000000ff); uInt8 bj = (uInt8) (palette[j] & 0x000000ff);
Uint8 r = (Uint8) (getPhosphor(ri, rj) * shade); Uint8 r = (Uint8) getPhosphor(ri, rj);
Uint8 g = (Uint8) (getPhosphor(gi, gj) * shade); Uint8 g = (Uint8) getPhosphor(gi, gj);
Uint8 b = (Uint8) (getPhosphor(bi, bj) * shade); Uint8 b = (Uint8) getPhosphor(bi, bj);
myAvgTIAPalette[i][j] = mapRGB(r, g, b); myAvgPalette[i][j] = mapRGB(r, g, b);
} }
} }
@ -412,11 +395,11 @@ void FrameBuffer::setFullscreen(bool enable)
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FrameBuffer::resize(Size size, Int8 zoom) void FrameBuffer::resize(int size, Int8 zoom)
{ {
switch(size) switch(size)
{ {
case PreviousSize: // decrease size case -1: // decrease size
if(myOSystem->settings().getBool("fullscreen")) if(myOSystem->settings().getBool("fullscreen"))
return; return;
if(theZoomLevel == 1) if(theZoomLevel == 1)
@ -425,7 +408,7 @@ void FrameBuffer::resize(Size size, Int8 zoom)
theZoomLevel--; theZoomLevel--;
break; break;
case NextSize: // increase size case +1: // increase size
if(myOSystem->settings().getBool("fullscreen")) if(myOSystem->settings().getBool("fullscreen"))
return; return;
if(theZoomLevel == theMaxZoomLevel) if(theZoomLevel == theMaxZoomLevel)
@ -434,7 +417,7 @@ void FrameBuffer::resize(Size size, Int8 zoom)
theZoomLevel++; theZoomLevel++;
break; break;
case GivenSize: // use 'zoom' quantity case 0: // use 'zoom' quantity
if(zoom < 1) if(zoom < 1)
theZoomLevel = 1; theZoomLevel = 1;
else if((uInt32)zoom > theMaxZoomLevel) else if((uInt32)zoom > theMaxZoomLevel)
@ -598,7 +581,7 @@ void FrameBuffer::setWindowIcon()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FrameBuffer::box(uInt32 x, uInt32 y, uInt32 w, uInt32 h, void FrameBuffer::box(uInt32 x, uInt32 y, uInt32 w, uInt32 h,
OverlayColor colorA, OverlayColor colorB) int colorA, int colorB)
{ {
hLine(x + 1, y, x + w - 2, colorA); hLine(x + 1, y, x + w - 2, colorA);
hLine(x, y + 1, x + w - 1, colorA); hLine(x, y + 1, x + w - 1, colorA);
@ -613,7 +596,7 @@ void FrameBuffer::box(uInt32 x, uInt32 y, uInt32 w, uInt32 h,
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FrameBuffer::frameRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h, void FrameBuffer::frameRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h,
OverlayColor color, FrameStyle style) int color, FrameStyle style)
{ {
switch(style) switch(style)
{ {
@ -650,7 +633,7 @@ void FrameBuffer::frameRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h,
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FrameBuffer::drawString(const GUI::Font* font, const string& s, void FrameBuffer::drawString(const GUI::Font* font, const string& s,
int x, int y, int w, int x, int y, int w,
OverlayColor color, TextAlignment align, int color, TextAlignment align,
int deltax, bool useEllipsis) int deltax, bool useEllipsis)
{ {
const int leftX = x, rightX = x + w; const int leftX = x, rightX = x + w;
@ -733,7 +716,7 @@ uInt8 FrameBuffer::getPhosphor(uInt8 c1, uInt8 c2)
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
const uInt8 FrameBuffer::ourGUIColors[kNumColors][3] = { const uInt8 FrameBuffer::ourGUIColors[kNumColors-256][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.68 2006-03-24 19:59:52 stephena Exp $ // $Id: FrameBuffer.hxx,v 1.69 2006-03-25 00:34:17 stephena Exp $
//============================================================================ //============================================================================
#ifndef FRAMEBUFFER_HXX #ifndef FRAMEBUFFER_HXX
@ -62,6 +62,18 @@ enum MessagePosition {
kBottomRight kBottomRight
}; };
// Colors indices to use for the various GUI elements
enum {
kColor = 256,
kBGColor,
kShadowColor,
kHiliteColor,
kTextColor,
kTextColorHi,
kTextColorEm,
kNumColors
};
/** /**
This class encapsulates the MediaSource and is the basis for the video This class encapsulates the MediaSource and is the basis for the video
display in Stella. All graphics ports should derive from this class for display in Stella. All graphics ports should derive from this class for
@ -70,7 +82,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.68 2006-03-24 19:59:52 stephena Exp $ @version $Id: FrameBuffer.hxx,v 1.69 2006-03-25 00:34:17 stephena Exp $
*/ */
class FrameBuffer class FrameBuffer
{ {
@ -112,7 +124,7 @@ class FrameBuffer
*/ */
void showMessage(const string& message, void showMessage(const string& message,
MessagePosition position = kBottomCenter, MessagePosition position = kBottomCenter,
OverlayColor color = kTextColor); int color = kTextColor);
/** /**
Hides any onscreen messages. Hides any onscreen messages.
@ -154,7 +166,7 @@ class FrameBuffer
@param status Whether pause has been enabled or disabled @param status Whether pause has been enabled or disabled
*/ */
void handlePause(bool status); void pause(bool status);
/** /**
Indicates that the TIA area is dirty, and certain areas need Indicates that the TIA area is dirty, and certain areas need
@ -178,14 +190,14 @@ class FrameBuffer
/** /**
This method is called when the user wants to resize the window. This method is called when the user wants to resize the window.
Size = 'PreviousSize' means window should decrease in size Size = -1 means window should decrease in size
Size = 'NextSize' means window should increase in size Size = 0 means window should be resized to quantity given in 'zoom'
Size = 'GivenSize' means window should be resized to quantity given in 'zoom' Size = +1 means window should increase in size
@param size Described above @param size Described above
@param zoom The zoom level to use if size is set to 'sGiven' @param zoom The zoom level to use if size is set to 'sGiven'
*/ */
void resize(Size size, Int8 zoom = 0); void resize(int size, Int8 zoom = 0);
/** /**
Sets the state of the cursor (hidden or grabbed) based on the Sets the state of the cursor (hidden or grabbed) based on the
@ -243,7 +255,7 @@ class FrameBuffer
@param colorB Darker color for inside line. @param colorB Darker color for inside line.
*/ */
void box(uInt32 x, uInt32 y, uInt32 w, uInt32 h, void box(uInt32 x, uInt32 y, uInt32 w, uInt32 h,
OverlayColor colorA, OverlayColor colorB); int colorA, int colorB);
/** /**
This method should be called to draw a framed rectangle. This method should be called to draw a framed rectangle.
@ -256,7 +268,7 @@ class FrameBuffer
@param color The color of the surrounding frame @param color The color of the surrounding frame
*/ */
void frameRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h, void frameRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h,
OverlayColor color, FrameStyle style = kSolidLine); int color, FrameStyle style = kSolidLine);
/** /**
This method should be called to draw the specified string. This method should be called to draw the specified string.
@ -273,7 +285,7 @@ class FrameBuffer
@param useEllipsis Whether to use '...' when the string is too long @param useEllipsis Whether to use '...' when the string is too long
*/ */
void drawString(const GUI::Font* font, const string& str, int x, int y, int w, void drawString(const GUI::Font* font, const string& str, int x, int y, int w,
OverlayColor color, TextAlignment align = kTextAlignLeft, int color, TextAlignment align = kTextAlignLeft,
int deltax = 0, bool useEllipsis = true); int deltax = 0, bool useEllipsis = true);
@ -349,7 +361,7 @@ class FrameBuffer
@param x2 The second x coordinate @param x2 The second x coordinate
@param color The color of the line @param color The color of the line
*/ */
virtual void hLine(uInt32 x, uInt32 y, uInt32 x2, OverlayColor color) = 0; virtual void hLine(uInt32 x, uInt32 y, uInt32 x2, int color) = 0;
/** /**
This method should be called to draw a vertical line. This method should be called to draw a vertical line.
@ -359,7 +371,7 @@ class FrameBuffer
@param y2 The second y coordinate @param y2 The second y coordinate
@param color The color of the line @param color The color of the line
*/ */
virtual void vLine(uInt32 x, uInt32 y, uInt32 y2, OverlayColor color) = 0; virtual void vLine(uInt32 x, uInt32 y, uInt32 y2, int color) = 0;
/** /**
This method should be called to draw a filled rectangle. This method should be called to draw a filled rectangle.
@ -371,7 +383,7 @@ class FrameBuffer
@param color The color of the area @param color The color of the area
*/ */
virtual void fillRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h, virtual void fillRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h,
OverlayColor color) = 0; int color) = 0;
/** /**
This method should be called to draw the specified character. This method should be called to draw the specified character.
@ -383,7 +395,7 @@ class FrameBuffer
@param color The color of the character @param color The color of the character
*/ */
virtual void drawChar(const GUI::Font* font, uInt8 c, uInt32 x, uInt32 y, virtual void drawChar(const GUI::Font* font, uInt8 c, uInt32 x, uInt32 y,
OverlayColor color) = 0; int color) = 0;
/** /**
This method should be called to draw the bitmap image. This method should be called to draw the bitmap image.
@ -394,7 +406,7 @@ class FrameBuffer
@param color The color of the character @param color The color of the character
@param h The height of the data image @param h The height of the data image
*/ */
virtual void drawBitmap(uInt32* bitmap, Int32 x, Int32 y, OverlayColor color, virtual void drawBitmap(uInt32* bitmap, Int32 x, Int32 y, int color,
Int32 h = 8) = 0; Int32 h = 8) = 0;
/** /**
@ -453,11 +465,8 @@ class FrameBuffer
uInt32 mySDLFlags; uInt32 mySDLFlags;
// TIA palettes for normal and phosphor modes // TIA palettes for normal and phosphor modes
Uint32 myDefTIAPalette[256]; Uint32 myDefPalette[256+kNumColors];
Uint32 myAvgTIAPalette[256][256]; Uint32 myAvgPalette[256][256];
// GUI palette, derived from 'ourGUIColors'
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 +490,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][3]; static const uInt8 ourGUIColors[kNumColors-256][3];
private: private:
/** /**
@ -508,15 +517,12 @@ class FrameBuffer
// Indicates the current framerate of the system // Indicates the current framerate of the system
uInt32 myFrameRate; uInt32 myFrameRate;
// Indicates the current pause status
bool myPauseStatus;
// Used for onscreen messages // Used for onscreen messages
struct Message { struct Message {
string text; string text;
int counter; int counter;
int x, y, w, h; int x, y, w, h;
OverlayColor color; uInt32 color;
}; };
Message myMessage; Message myMessage;
}; };

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.66 2006-03-24 19:59:52 stephena Exp $ // $Id: OSystem.cxx,v 1.67 2006-03-25 00:34:17 stephena Exp $
//============================================================================ //============================================================================
#include <cassert> #include <cassert>
@ -232,9 +232,15 @@ void OSystem::toggleFrameBuffer()
myEventHandler->handleEvent(Event::Pause, 0); myEventHandler->handleEvent(Event::Pause, 0);
// Remember the pause state
bool pause = myEventHandler->isPaused();
// 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
// And re-pause the system
myEventHandler->pause(pause);
#endif #endif
} }

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.hxx,v 1.40 2006-03-17 19:44:18 stephena Exp $ // $Id: OSystem.hxx,v 1.41 2006-03-25 00:34:17 stephena Exp $
//============================================================================ //============================================================================
#ifndef OSYSTEM_HXX #ifndef OSYSTEM_HXX
@ -44,7 +44,7 @@ class CheatManager;
other objects belong. other objects belong.
@author Stephen Anthony @author Stephen Anthony
@version $Id: OSystem.hxx,v 1.40 2006-03-17 19:44:18 stephena Exp $ @version $Id: OSystem.hxx,v 1.41 2006-03-25 00:34:17 stephena Exp $
*/ */
class OSystem class OSystem
{ {
@ -91,63 +91,63 @@ class OSystem
@return The event handler @return The event handler
*/ */
EventHandler& eventHandler() const { return *myEventHandler; } inline EventHandler& eventHandler() const { return *myEventHandler; }
/** /**
Get the frame buffer of the system Get the frame buffer of the system
@return The frame buffer @return The frame buffer
*/ */
FrameBuffer& frameBuffer() const { return *myFrameBuffer; } inline FrameBuffer& frameBuffer() const { return *myFrameBuffer; }
/** /**
Get the sound object of the system Get the sound object of the system
@return The sound object @return The sound object
*/ */
Sound& sound() const { return *mySound; } inline Sound& sound() const { return *mySound; }
/** /**
Get the settings object of the system Get the settings object of the system
@return The settings object @return The settings object
*/ */
Settings& settings() const { return *mySettings; } inline Settings& settings() const { return *mySettings; }
/** /**
Get the set of game properties for the system Get the set of game properties for the system
@return The properties set object @return The properties set object
*/ */
PropertiesSet& propSet() const { return *myPropSet; } inline PropertiesSet& propSet() const { return *myPropSet; }
/** /**
Get the console of the system. Get the console of the system.
@return The console object @return The console object
*/ */
Console& console(void) const { return *myConsole; } inline Console& console(void) const { return *myConsole; }
/** /**
Get the settings menu of the system. Get the settings menu of the system.
@return The settings menu object @return The settings menu object
*/ */
Menu& menu(void) const { return *myMenu; } inline Menu& menu(void) const { return *myMenu; }
/** /**
Get the command menu of the system. Get the command menu of the system.
@return The command menu object @return The command menu object
*/ */
CommandMenu& commandMenu(void) const { return *myCommandMenu; } inline CommandMenu& commandMenu(void) const { return *myCommandMenu; }
/** /**
Get the ROM launcher of the system. Get the ROM launcher of the system.
@return The launcher object @return The launcher object
*/ */
Launcher& launcher(void) const { return *myLauncher; } inline Launcher& launcher(void) const { return *myLauncher; }
#ifdef DEVELOPER_SUPPORT #ifdef DEVELOPER_SUPPORT
/** /**
@ -155,7 +155,7 @@ class OSystem
@return The debugger object @return The debugger object
*/ */
Debugger& debugger(void) const { return *myDebugger; } inline Debugger& debugger(void) const { return *myDebugger; }
#endif #endif
#ifdef CHEATCODE_SUPPORT #ifdef CHEATCODE_SUPPORT
@ -164,7 +164,7 @@ class OSystem
@return The cheatmanager object @return The cheatmanager object
*/ */
CheatManager& cheat(void) const { return *myCheatManager; } inline CheatManager& cheat(void) const { return *myCheatManager; }
#endif #endif
/** /**

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: AboutDialog.cxx,v 1.10 2006-02-22 17:38:04 stephena Exp $ // $Id: AboutDialog.cxx,v 1.11 2006-03-25 00:34:17 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
@ -171,7 +171,7 @@ void AboutDialog::displayInfo()
{ {
const char *str = dscStr[i].c_str(); const char *str = dscStr[i].c_str();
TextAlignment align = kTextAlignCenter; TextAlignment align = kTextAlignCenter;
OverlayColor color = kTextColor; int color = kTextColor;
while (str[0] == '\\') while (str[0] == '\\')
{ {

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: EditableWidget.cxx,v 1.16 2006-02-22 17:38:04 stephena Exp $ // $Id: EditableWidget.cxx,v 1.17 2006-03-25 00:34:17 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
@ -170,7 +170,7 @@ void EditableWidget::drawCaret()
GUI::Rect editRect = getEditRect(); GUI::Rect editRect = getEditRect();
OverlayColor color = kTextColorHi; int color = kTextColorHi;
int x = editRect.left; int x = editRect.left;
int y = editRect.top; int y = editRect.top;

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.23 2006-03-24 19:59:52 stephena Exp $ // $Id: GuiUtils.hxx,v 1.24 2006-03-25 00:34:17 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,23 +29,11 @@
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.23 2006-03-24 19:59:52 stephena Exp $ @version $Id: GuiUtils.hxx,v 1.24 2006-03-25 00:34:17 stephena Exp $
*/ */
#define kScrollBarWidth 9 #define kScrollBarWidth 9
// Colors indices to use for the various GUI elements
enum OverlayColor {
kColor,
kBGColor,
kShadowColor,
kHiliteColor,
kTextColor,
kTextColorHi,
kTextColorEm,
kNumColors
};
// The commands generated by various widgets // The commands generated by various widgets
enum { enum {
kOKCmd = 'OK ', kOKCmd = 'OK ',
@ -60,13 +48,6 @@ enum {
kRefreshAllCmd = 'REFA' kRefreshAllCmd = 'REFA'
}; };
// Indicates a three-way possibility when changing the size of some quantity
enum Size {
PreviousSize,
GivenSize,
NextSize
};
static const string EmptyString(""); static const string EmptyString("");
template<typename T> inline void SWAP(T &a, T &b) { T tmp = a; a = b; b = tmp; } template<typename T> inline void SWAP(T &a, T &b) { T tmp = a; a = b; b = tmp; }

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: ScrollBarWidget.cxx,v 1.13 2006-02-22 17:38:04 stephena Exp $ // $Id: ScrollBarWidget.cxx,v 1.14 2006-03-25 00:34:17 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
@ -277,7 +277,7 @@ void ScrollBarWidget::drawWidget(bool hilite)
(hilite && _part == kSliderPart) ? kTextColorHi : kTextColor); (hilite && _part == kSliderPart) ? kTextColorHi : kTextColor);
fb.frameRect(_x, _y + _sliderPos, _w, _sliderHeight, kColor); fb.frameRect(_x, _y + _sliderPos, _w, _sliderHeight, kColor);
int y = _y + _sliderPos + _sliderHeight / 2; int y = _y + _sliderPos + _sliderHeight / 2;
OverlayColor color = (hilite && _part == kSliderPart) ? kColor : kShadowColor; int color = (hilite && _part == kSliderPart) ? kColor : kShadowColor;
fb.hLine(_x + 2, y - 2, _x + _w - 3, color); fb.hLine(_x + 2, y - 2, _x + _w - 3, color);
fb.hLine(_x + 2, y, _x + _w - 3, color); fb.hLine(_x + 2, y, _x + _w - 3, color);
fb.hLine(_x + 2, y + 2, _x + _w - 3, color); fb.hLine(_x + 2, y + 2, _x + _w - 3, 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: StringListWidget.cxx,v 1.5 2006-02-22 17:38:04 stephena Exp $ // $Id: StringListWidget.cxx,v 1.6 2006-03-25 00:34:17 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
@ -61,7 +61,7 @@ void StringListWidget::drawWidget(bool hilite)
// Draw the list items // Draw the list items
for (i = 0, pos = _currentPos; i < _rows && pos < len; i++, pos++) for (i = 0, pos = _currentPos; i < _rows && pos < len; i++, pos++)
{ {
const OverlayColor textColor = (_selectedItem == pos && _editMode) const int textColor = (_selectedItem == pos && _editMode)
? kColor : kTextColor; ? kColor : kTextColor;
const int y = _y + 2 + _fontHeight * i; const int y = _y + 2 + _fontHeight * i;

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: TabWidget.cxx,v 1.21 2006-02-22 17:38:04 stephena Exp $ // $Id: TabWidget.cxx,v 1.22 2006-03-25 00:34:17 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
@ -212,7 +212,7 @@ void TabWidget::loadConfig()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void TabWidget::box(int x, int y, int width, int height, void TabWidget::box(int x, int y, int width, int height,
OverlayColor colorA, OverlayColor colorB, bool omitBottom) int colorA, int colorB, bool omitBottom)
{ {
//cerr << "TabWidget::box\n"; //cerr << "TabWidget::box\n";
FrameBuffer& fb = _boss->instance()->frameBuffer(); FrameBuffer& fb = _boss->instance()->frameBuffer();
@ -255,7 +255,7 @@ void TabWidget::drawWidget(bool hilite)
int i, x = _x + kTabLeftOffset; int i, x = _x + kTabLeftOffset;
for (i = 0; i < (int)_tabs.size(); ++i) for (i = 0; i < (int)_tabs.size(); ++i)
{ {
OverlayColor color = (i == _activeTab) ? kColor : kShadowColor; int color = (i == _activeTab) ? kColor : kShadowColor;
int yOffset = (i == _activeTab) ? 0 : 2; int yOffset = (i == _activeTab) ? 0 : 2;
box(x, _y + yOffset, _tabWidth, _tabHeight - yOffset, color, color, (i == _activeTab)); box(x, _y + yOffset, _tabWidth, _tabHeight - yOffset, color, color, (i == _activeTab));
fb.drawString(_font, _tabs[i].title, x + kTabPadding, fb.drawString(_font, _tabs[i].title, x + kTabPadding,

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: TabWidget.hxx,v 1.12 2006-02-22 17:38:04 stephena Exp $ // $Id: TabWidget.hxx,v 1.13 2006-03-25 00:34:17 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
@ -87,7 +87,7 @@ class TabWidget : public Widget, public CommandSender
private: private:
void box(int x, int y, int width, int height, void box(int x, int y, int width, int height,
OverlayColor colorA, OverlayColor colorB, bool omitBottom); int colorA, int colorB, bool omitBottom);
void updateActiveTab(); void updateActiveTab();
}; };

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: VideoDialog.cxx,v 1.28 2006-03-19 20:57:55 stephena Exp $ // $Id: VideoDialog.cxx,v 1.29 2006-03-25 00:34:17 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
@ -294,7 +294,7 @@ void VideoDialog::saveConfig()
// Zoom // Zoom
i = (myZoomSlider->getValue() / 10) + 1; i = (myZoomSlider->getValue() / 10) + 1;
instance()->settings().setInt("zoom", i); instance()->settings().setInt("zoom", i);
instance()->frameBuffer().resize(GivenSize, i); instance()->frameBuffer().resize(0, i);
// Fullscreen (the setFullscreen method takes care of updating settings) // Fullscreen (the setFullscreen method takes care of updating settings)
b = myFullscreenCheckbox->getState(); b = myFullscreenCheckbox->getState();

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: Widget.cxx,v 1.42 2006-02-22 17:38:04 stephena Exp $ // $Id: Widget.cxx,v 1.43 2006-03-25 00:34:17 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
@ -85,8 +85,8 @@ void Widget::draw()
// Draw border // Draw border
if(_flags & WIDGET_BORDER) { if(_flags & WIDGET_BORDER) {
OverlayColor colorA = kColor; int colorA = kColor;
OverlayColor colorB = kShadowColor; int colorB = kShadowColor;
if((_flags & WIDGET_INV_BORDER) == WIDGET_INV_BORDER) if((_flags & WIDGET_INV_BORDER) == WIDGET_INV_BORDER)
SWAP(colorA, colorB); SWAP(colorA, colorB);
fb.box(_x, _y, _w, _h, colorA, colorB); fb.box(_x, _y, _w, _h, colorA, colorB);

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: Widget.hxx,v 1.48 2006-03-02 13:10:53 stephena Exp $ // $Id: Widget.hxx,v 1.49 2006-03-25 00:34:17 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
@ -75,7 +75,7 @@ enum {
This is the base class for all widgets. This is the base class for all widgets.
@author Stephen Anthony @author Stephen Anthony
@version $Id: Widget.hxx,v 1.48 2006-03-02 13:10:53 stephena Exp $ @version $Id: Widget.hxx,v 1.49 2006-03-25 00:34:17 stephena Exp $
*/ */
class Widget : public GuiObject class Widget : public GuiObject
{ {
@ -124,7 +124,7 @@ class Widget : public GuiObject
void setID(int id) { _id = id; } void setID(int id) { _id = id; }
int getID() { return _id; } int getID() { return _id; }
void setColor(OverlayColor color) { _color = color; } void setColor(int color) { _color = color; }
virtual const GUI::Font* font() { return _font; } virtual const GUI::Font* font() { return _font; }
virtual void loadConfig() {} virtual void loadConfig() {}
@ -151,7 +151,7 @@ class Widget : public GuiObject
int _id; int _id;
int _flags; int _flags;
bool _hasFocus; bool _hasFocus;
OverlayColor _color; int _color;
int _fontWidth; int _fontWidth;
int _fontHeight; int _fontHeight;
@ -262,7 +262,7 @@ class CheckboxWidget : public ButtonWidget
bool _fillRect; bool _fillRect;
bool _drawBox; bool _drawBox;
OverlayColor _fillColor; int _fillColor;
private: private:
int _boxY; int _boxY;

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.19 2006-03-24 19:59:52 stephena Exp $ // $Id: OSystemUNIX.cxx,v 1.20 2006-03-25 00:34:17 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->isQuit()) if(myEventHandler->doQuit())
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->isQuit()) if(myEventHandler->doQuit())
break; break;
startTime = getTicks(); startTime = getTicks();