OK, I decided to take a break from the positioning stuff and work on

something which was the basis for this whole surface restructuring in
the first place; updated fonts in the UI.

Switched out the old normal and larger sized fonts for higher
resolution ones.  The surfaces are now mostly larger than 320x210,
which means 1x TIA zoom mode is no longer allowed (which was actually
disabled some time ago).

I'm getting close to the end of a single surface design to what we have
now; a multi-level surface infrastructure.  This allows higher-res UI's
(which have just been committed), and optimizations for OpenGL TIA
rendering (which were committed over the last week).  In the future,
this will also make it easy to add TIA filters to OpenGL mode (ScalexX,
HQxX, etc).


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1573 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2008-12-25 23:05:16 +00:00
parent 843c85c56b
commit 92b22e3ad7
19 changed files with 9006 additions and 7171 deletions

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: CheatCodeDialog.cxx,v 1.21 2008-12-24 01:20:05 stephena Exp $
// $Id: CheatCodeDialog.cxx,v 1.22 2008-12-25 23:05:16 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -40,26 +40,43 @@ CheatCodeDialog::CheatCodeDialog(OSystem* osystem, DialogContainer* parent,
const GUI::Font& font, int x, int y, int w, int h)
: Dialog(osystem, parent, x, y, w, h)
{
const int lineHeight = font.getLineHeight(),
buttonWidth = font.getStringWidth("Defaults") + 20,
buttonHeight = font.getLineHeight() + 4;
int xpos, ypos;
WidgetArray wid;
ButtonWidget* b;
// List of cheats, with checkboxes to enable/disable
xpos = 10; ypos = 10;
myCheatList = new CheckListWidget(this, font, xpos, ypos,
_w - 25 - kButtonWidth, _h - 50);
myCheatList =
new CheckListWidget(this, font, xpos, ypos, _w - buttonWidth - 25,
_h - 3*lineHeight);
myCheatList->setStyle(kXFill);
myCheatList->setEditable(false);
wid.push_back(myCheatList);
xpos += myCheatList->getWidth() + 15; ypos = 15;
b = addButton(font, xpos, ypos, "Add", kAddCheatCmd);
b = new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
"Add", kAddCheatCmd);
wid.push_back(b);
myEditButton = addButton(font, xpos, ypos+=20, "Edit", kEditCheatCmd);
ypos += lineHeight + 10;
myEditButton =
new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
"Edit", kEditCheatCmd);
wid.push_back(myEditButton);
myRemoveButton = addButton(font, xpos, ypos+=20, "Remove", kRemCheatCmd);
ypos += lineHeight + 10;
myRemoveButton =
new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
"Remove", kRemCheatCmd);
wid.push_back(myRemoveButton);
b = addButton(font, xpos, ypos+=30, "One shot", kAddOneShotCmd);
ypos += lineHeight + 10;
b = new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
"One shot", kAddOneShotCmd);
wid.push_back(b);
// Inputbox which will pop up when adding/editing a cheat

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: FrameBufferGL.cxx,v 1.123 2008-12-24 01:20:06 stephena Exp $
// $Id: FrameBufferGL.cxx,v 1.124 2008-12-25 23:05:16 stephena Exp $
//============================================================================
#ifdef DISPLAY_OPENGL
@ -664,23 +664,39 @@ void FBSurfaceGL::drawChar(const GUI::Font* font, uInt8 chr,
if (chr == ' ') return;
chr = desc.defaultchar;
}
const Int32 w = font->getCharWidth(chr);
const Int32 h = font->getFontHeight();
chr -= desc.firstchar;
const uInt32* tmp = desc.bits + (desc.offset ? desc.offset[chr] : (chr * h));
uInt16* buffer = (uInt16*) myTexture->pixels + ty * myPitch + tx;
for(int y = 0; y < h; ++y)
// Get the bounding box of the character
int bbw, bbh, bbx, bby;
if(!desc.bbx)
{
const uInt32 ptr = *tmp++;
if(ptr)
{
uInt32 mask = 0x80000000;
for(int x = 0; x < w; ++x, mask >>= 1)
if(ptr & mask)
buffer[x] = (uInt16) myFB.myDefPalette[color];
}
bbw = desc.fbbw;
bbh = desc.fbbh;
bbx = desc.fbbx;
bby = desc.fbby;
}
else
{
bbw = desc.bbx[chr].w;
bbh = desc.bbx[chr].h;
bbx = desc.bbx[chr].x;
bby = desc.bbx[chr].y;
}
const uInt16* tmp = desc.bits + (desc.offset ? desc.offset[chr] : (chr * desc.fbbh));
uInt16* buffer = (uInt16*) myTexture->pixels +
(ty + desc.ascent - bby - bbh) * myPitch +
tx + bbx;
for(int y = 0; y < bbh; y++)
{
const uInt16 ptr = *tmp++;
uInt16 mask = 0x8000;
for(int x = 0; x < bbw; x++, mask >>= 1)
if(ptr & mask)
buffer[x] = (uInt16) myFB.myDefPalette[color];
buffer += myPitch;
}
}

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: FrameBufferSoft.cxx,v 1.82 2008-08-04 11:56:11 stephena Exp $
// $Id: FrameBufferSoft.cxx,v 1.83 2008-12-25 23:05:16 stephena Exp $
//============================================================================
#include <sstream>
@ -557,6 +557,7 @@ void FBSurfaceSoft::fillRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h, int color)
void FBSurfaceSoft::drawChar(const GUI::Font* font, uInt8 chr,
uInt32 tx, uInt32 ty, int color)
{
#if 0
const FontDesc& desc = font->desc();
// If this character is not included in the font, use the default char.
@ -655,6 +656,7 @@ void FBSurfaceSoft::drawChar(const GUI::Font* font, uInt8 chr,
break;
}
SDL_UnlockSurface(mySurface);
#endif
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: FrameBuffer.cxx,v 1.145 2008-12-20 23:32:46 stephena Exp $
// $Id: FrameBuffer.cxx,v 1.146 2008-12-25 23:05:16 stephena Exp $
//============================================================================
#include <algorithm>
@ -49,7 +49,7 @@ FrameBuffer::FrameBuffer(OSystem* osystem)
myPausedCount(0),
mySurfaceCount(0)
{
myMsg.surface = myStatsMsg.surface = 0;
myMsg.surface = myStatsMsg.surface = NULL;
myMsg.surfaceID = myStatsMsg.surfaceID = -1;
myMsg.enabled = myStatsMsg.enabled = false;
}
@ -133,14 +133,15 @@ cerr << " <== FrameBuffer::initialize: w = " << width << ", h = " << height << e
myStatsMsg.color = kBtnTextColor;
myStatsMsg.w = myOSystem->consoleFont().getStringWidth("000 LINES %00.00 FPS");
myStatsMsg.h = myOSystem->consoleFont().getFontHeight();
if(myStatsMsg.surfaceID < 0)
if(myStatsMsg.surface == NULL)
{
myStatsMsg.surfaceID = allocateSurface(myStatsMsg.w, myStatsMsg.h);
myStatsMsg.surface = surface(myStatsMsg.surfaceID);
}
if(!myMsg.surface) // TODO - change this to the font we'll really use
if(myMsg.surface == NULL)
{
myMsg.surfaceID = allocateSurface(320, myOSystem->consoleFont().getFontHeight()+10);
myMsg.surfaceID = allocateSurface(320, myOSystem->font().getFontHeight()+10);
myMsg.surface = surface(myMsg.surfaceID);
}
@ -179,7 +180,7 @@ void FrameBuffer::update()
myOSystem->console().mediaSource().scanlines(),
myOSystem->console().getFramerate());
myStatsMsg.surface->fillRect(0, 0, myStatsMsg.w, myStatsMsg.h, kBGColor);
myStatsMsg.surface->drawString(&myOSystem->consoleFont(), msg, 0, 0,
myStatsMsg.surface->drawString(&myOSystem->consoleFont(), msg, 1, 1,
myStatsMsg.w, myStatsMsg.color, kTextAlignLeft);
myStatsMsg.surface->addDirtyRect(0, 0, 0, 0); // force a full draw
myStatsMsg.surface->setPos(myImageRect.x() + 3, myImageRect.y() + 3);

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: AboutDialog.cxx,v 1.25 2008-06-13 13:14:51 stephena Exp $
// $Id: AboutDialog.cxx,v 1.26 2008-12-25 23:05:16 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -32,34 +32,49 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AboutDialog::AboutDialog(OSystem* osystem, DialogContainer* parent,
const GUI::Font& font, int x, int y, int w, int h)
: Dialog(osystem, parent, x, y, w, h),
myPage(1),
myNumPages(6)
: Dialog(osystem, parent, x, y, w, h),
myPage(1),
myNumPages(6)
{
const int lineHeight = font.getLineHeight(),
fontHeight = font.getFontHeight(),
buttonWidth = font.getStringWidth("Defaults") + 20,
buttonHeight = font.getLineHeight() + 4;
int xpos, ypos;
WidgetArray wid;
// Add Previous, Next and Close buttons
myPrevButton = addButton(font, 10, h - 24, "Previous", kPrevCmd);
xpos = 10; ypos = _h - buttonHeight - 10;
myPrevButton =
new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
"Previous", kPrevCmd);
myPrevButton->clearFlags(WIDGET_ENABLED);
wid.push_back(myPrevButton);
myNextButton = addButton(font, (kButtonWidth + 15), h - 24,
"Next", kNextCmd);
xpos += buttonWidth + 7;
myNextButton =
new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
"Next", kNextCmd);
wid.push_back(myNextButton);
ButtonWidget* b = addButton(font, w - (kButtonWidth + 10), h - 24,
"Close", kCloseCmd);
xpos = _w - buttonWidth - 10;
ButtonWidget* b =
new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
"Close", kCloseCmd);
wid.push_back(b);
addOKWidget(b); addCancelWidget(b);
myTitle = new StaticTextWidget(this, font, 5, 5, w - 10, font.getFontHeight(),
xpos = 5; ypos = 5;
myTitle = new StaticTextWidget(this, font, xpos, ypos, _w - 10, fontHeight,
"", kTextAlignCenter);
myTitle->setTextColor(kTextColorEm);
xpos = 10; ypos += lineHeight + 4;
for(int i = 0; i < LINES_PER_PAGE; i++)
{
myDesc[i] = new StaticTextWidget(this, font, 10, 18 + (10 * i), w - 20,
font.getFontHeight(), "", kTextAlignLeft);
myDesc[i] = new StaticTextWidget(this, font, xpos, ypos, _w - 20,
fontHeight, "", kTextAlignLeft);
ypos += fontHeight;
}
addToFocusList(wid);

File diff suppressed because it is too large Load Diff

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: Dialog.cxx,v 1.68 2008-12-18 23:36:32 stephena Exp $
// $Id: Dialog.cxx,v 1.69 2008-12-25 23:05:16 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -593,19 +593,3 @@ void Dialog::addOKCancelBGroup(WidgetArray& wid, const GUI::Font& font)
addOKWidget(b);
#endif
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ButtonWidget* Dialog::addButton(const GUI::Font& font, int x, int y,
const string& label, int cmd)
{
// FIXME - this is deprecated, and the UI code should be refactored
// to remove all references to it
#if 0
const int w = 6 * font.getMaxCharWidth(),
h = font.getFontHeight() + 6;
return new ButtonWidget(this, font, x, y, w, h, label, cmd);
#else
return new ButtonWidget(this, font, x, y, kButtonWidth, 16, label, cmd);
#endif
}

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: Dialog.hxx,v 1.40 2008-12-12 15:51:07 stephena Exp $
// $Id: Dialog.hxx,v 1.41 2008-12-25 23:05:16 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -47,7 +47,7 @@ class TabWidget;
This is the base class for all dialog boxes.
@author Stephen Anthony
@version $Id: Dialog.hxx,v 1.40 2008-12-12 15:51:07 stephena Exp $
@version $Id: Dialog.hxx,v 1.41 2008-12-25 23:05:16 stephena Exp $
*/
class Dialog : public GuiObject
{
@ -106,9 +106,6 @@ class Dialog : public GuiObject
Widget* findWidget(int x, int y); // Find the widget at pos x,y if any
ButtonWidget* addButton(const GUI::Font& font, int x, int y,
const string& label = "", int cmd = 0);
void addOKCancelBGroup(WidgetArray& wid, const GUI::Font& font);
void setResult(int result) { _result = result; }

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: FileSnapDialog.cxx,v 1.20 2008-08-01 12:16:00 stephena Exp $
// $Id: FileSnapDialog.cxx,v 1.21 2008-12-25 23:05:16 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -138,7 +138,7 @@ FileSnapDialog::FileSnapDialog(
// Create file browser dialog
// FIXME - let dialog determine its own size
myBrowser = new BrowserDialog(this, font, 0, 0, 300, 300);
myBrowser = new BrowserDialog(this, font, 0, 0, 400, 320);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: Font.hxx,v 1.11 2008-03-24 00:02:16 stephena Exp $
// $Id: Font.hxx,v 1.12 2008-12-25 23:05:16 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -24,21 +24,31 @@
#include "bspf.hxx"
struct BBX
{
Int8 w;
Int8 h;
Int8 x;
Int8 y;
};
/* builtin C-based proportional/fixed font structure */
/* based on The Microwindows Project http://microwindows.org */
typedef struct
{
const char* name; /* font name */
int maxwidth; /* max width in pixels */
int height; /* height in pixels */
int ascent; /* ascent (baseline) height */
int firstchar; /* first character in bitmap */
int size; /* font size in glyphs */
const uInt32* bits; /* 32-bit right-padded bitmap data */
const uInt16* offset; /* offsets into bitmap data */
const uInt8* width; /* character widths or NULL if fixed */
int defaultchar; /* default char (not glyph index) */
long bits_size; /* # words of bitmap_t bits */
const char* name; /* font name */
int maxwidth; /* max width in pixels */
int height; /* height in pixels */
int fbbw, fbbh, fbbx, fbby; /* max bounding box */
int ascent; /* ascent (baseline) height */
int firstchar; /* first character in bitmap */
int size; /* font size in glyphs */
const uInt16* bits; /* 16-bit right-padded bitmap data */
const uInt32* offset; /* offsets into bitmap data*/
const uInt8* width; /* character widths or NULL if fixed */
const BBX* bbx; /* character bounding box or NULL if fixed */
int defaultchar; /* default char (not glyph index) */
long bits_size; /* # words of bitmap_t bits */
} FontDesc;
namespace GUI {

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: GameInfoDialog.cxx,v 1.59 2008-08-01 12:16:00 stephena Exp $
// $Id: GameInfoDialog.cxx,v 1.60 2008-12-25 23:05:16 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -43,6 +43,7 @@ GameInfoDialog::GameInfoDialog(
myDefaultsSelected(false)
{
const int lineHeight = font.getLineHeight(),
fontWidth = font.getMaxCharWidth(),
fontHeight = font.getFontHeight(),
buttonWidth = font.getStringWidth("Defaults") + 20,
buttonHeight = font.getLineHeight() + 4;
@ -53,7 +54,8 @@ GameInfoDialog::GameInfoDialog(
// The tab widget
xpos = 2; ypos = vBorder;
myTab = new TabWidget(this, font, xpos, ypos, _w - 2*xpos, _h - 24 - 2*ypos - 15);
myTab = new TabWidget(this, font, xpos, ypos, _w - 2*xpos,
_h - buttonHeight - 2*fontHeight - 20);
addTabWidget(myTab);
addFocusWidget(myTab);
@ -283,14 +285,14 @@ GameInfoDialog::GameInfoDialog(
new StaticTextWidget(myTab, font, xpos, ypos+1, lwidth, fontHeight,
"YStart:", kTextAlignLeft);
myYStart = new EditTextWidget(myTab, font, xpos+lwidth, ypos,
25, fontHeight, "");
4*fontWidth, fontHeight, "");
wid.push_back(myYStart);
ypos += lineHeight + 5;
new StaticTextWidget(myTab, font, xpos, ypos+1, lwidth, fontHeight,
"Height:", kTextAlignLeft);
myHeight = new EditTextWidget(myTab, font, xpos+lwidth, ypos,
25, fontHeight, "");
4*fontWidth, fontHeight, "");
wid.push_back(myHeight);
ypos += lineHeight + 5;
@ -305,7 +307,7 @@ GameInfoDialog::GameInfoDialog(
wid.push_back(myPhosphor);
myPPBlend = new SliderWidget(myTab, font, xpos + lwidth + myPhosphor->getWidth() + 10,
ypos, 30, lineHeight, "Blend: ",
ypos, 8*fontWidth, lineHeight, "Blend: ",
font.getStringWidth("Blend: "),
kPPBlendChanged);
myPPBlend->setMinValue(1); myPPBlend->setMaxValue(100);
@ -314,7 +316,7 @@ GameInfoDialog::GameInfoDialog(
myPPBlendLabel = new StaticTextWidget(myTab, font,
xpos + lwidth + myPhosphor->getWidth() + 10 + \
myPPBlend->getWidth() + 4, ypos+1,
15, fontHeight, "", kTextAlignLeft);
3*fontWidth, fontHeight, "", kTextAlignLeft);
myPPBlendLabel->setFlags(WIDGET_CLEARBG);
ypos += lineHeight + 5;
@ -336,7 +338,8 @@ GameInfoDialog::GameInfoDialog(
// Add message concerning usage
lwidth = font.getStringWidth("(*) Changes to properties require a ROM reload");
new StaticTextWidget(this, font, 10, _h - 38, lwidth, fontHeight,
new StaticTextWidget(this, font, 10, _h - buttonHeight - fontHeight - 20,
lwidth, fontHeight,
"(*) Changes to properties require a ROM reload",
kTextAlignLeft);

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: HelpDialog.cxx,v 1.25 2008-03-23 16:22:46 stephena Exp $
// $Id: HelpDialog.cxx,v 1.26 2008-12-25 23:05:16 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -30,34 +30,54 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
HelpDialog::HelpDialog(OSystem* osystem, DialogContainer* parent,
const GUI::Font& font, int x, int y, int w, int h)
: Dialog(osystem, parent, x, y, w, h),
myPage(1),
myNumPages(4)
: Dialog(osystem, parent, x, y, w, h),
myPage(1),
myNumPages(4)
{
const int lineHeight = font.getLineHeight(),
fontWidth = font.getMaxCharWidth(),
fontHeight = font.getFontHeight(),
buttonWidth = font.getStringWidth("Defaults") + 20,
buttonHeight = font.getLineHeight() + 4;
int xpos, ypos;
WidgetArray wid;
// Add Previous, Next and Close buttons
myPrevButton = addButton(font, 10, h - 24, "Previous", kPrevCmd);
xpos = 10; ypos = _h - buttonHeight - 10;
myPrevButton =
new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
"Previous", kPrevCmd);
myPrevButton->clearFlags(WIDGET_ENABLED);
wid.push_back(myPrevButton);
myNextButton = addButton(font, (kButtonWidth + 15), h - 24,
"Next", kNextCmd);
xpos += buttonWidth + 7;
myNextButton =
new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
"Next", kNextCmd);
wid.push_back(myNextButton);
ButtonWidget* b = addButton(font, w - (kButtonWidth + 10), h - 24,
"Close", kCloseCmd);
xpos = _w - buttonWidth - 10;
ButtonWidget* b =
new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
"Close", kCloseCmd);
wid.push_back(b);
addOKWidget(b); addCancelWidget(b);
myTitle = new StaticTextWidget(this, font, 5, 5, w - 10, font.getFontHeight(),
xpos = 5; ypos = 5;
myTitle = new StaticTextWidget(this, font, xpos, ypos, _w - 10, fontHeight,
"", kTextAlignCenter);
int lwidth = 15 * fontWidth;
xpos += 5; ypos += lineHeight + 4;
for(uInt8 i = 0; i < LINES_PER_PAGE; i++)
{
myKey[i] = new StaticTextWidget(this, font, 10, 18 + (10 * i), 80,
font.getFontHeight(), "", kTextAlignLeft);
myDesc[i] = new StaticTextWidget(this, font, 90, 18 + (10 * i), 160,
font.getFontHeight(), "", kTextAlignLeft);
myKey[i] =
new StaticTextWidget(this, font, xpos, ypos, lwidth,
fontHeight, "", kTextAlignLeft);
myDesc[i] =
new StaticTextWidget(this, font, xpos+lwidth, ypos, _w - xpos - lwidth - 5,
fontHeight, "", kTextAlignLeft);
ypos += fontHeight;
}
addToFocusList(wid);
@ -87,8 +107,8 @@ void HelpDialog::updateStrings(uInt8 page, uInt8 lines,
ADD_BIND("\\", "Toggle command menu");
ADD_BIND("Alt =", "Increase window size");
ADD_BIND("Alt -", "Decrease window size");
ADD_BIND("Alt Enter", "Toggle fullscreen/windowed mode");
ADD_LINE;
ADD_BIND("Alt Enter", "Toggle fullscreen /");
ADD_BIND("", " windowed mode");
ADD_BIND("Alt ]", "Increase volume by 2%");
ADD_BIND("Alt [", "Decrease volume by 2%");
break;
@ -97,7 +117,8 @@ void HelpDialog::updateStrings(uInt8 page, uInt8 lines,
title = "Special commands:";
ADD_BIND("Ctrl g", "Grab mouse (keep in window)");
ADD_BIND("Ctrl f", "Switch between NTSC/PAL/SECAM");
ADD_BIND("Ctrl s", "Save game properties to new file");
ADD_BIND("Ctrl s", "Save game properties");
ADD_BIND("", " to a new file");
ADD_LINE;
ADD_BIND("Ctrl 0", "Mouse emulates paddle 0");
ADD_BIND("Ctrl 1", "Mouse emulates paddle 1");
@ -107,10 +128,10 @@ void HelpDialog::updateStrings(uInt8 page, uInt8 lines,
case 3:
title = "Developer commands:";
ADD_BIND("Alt PageUp", "Increase Display.YStart");
ADD_BIND("Alt PageDown", "Decrease Display.YStart");
ADD_BIND("Ctrl PageUp", "Increase Display.Height");
ADD_BIND("Ctrl PageDown", "Decrease Display.Height");
ADD_BIND("Alt PgUp", "Increase Display.YStart");
ADD_BIND("Alt PgDn", "Decrease Display.YStart");
ADD_BIND("Ctrl PgUp", "Increase Display.Height");
ADD_BIND("Ctrl PgDn", "Decrease Display.Height");
break;
#else
case 1:
@ -121,8 +142,8 @@ void HelpDialog::updateStrings(uInt8 page, uInt8 lines,
ADD_BIND("\\", "Toggle command menu");
ADD_BIND("Cmd =", "Increase window size");
ADD_BIND("Cmd -", "Decrease window size");
ADD_BIND("Cmd Enter", "Toggle fullscreen/windowed mode");
ADD_LINE;
ADD_BIND("Cmd Enter", "Toggle fullscreen /");
ADD_BIND("", " windowed mode");
ADD_BIND("Shift-Cmd ]", "Increase volume by 2%");
ADD_BIND("Shift-Cmd [", "Decrease volume by 2%");
break;
@ -131,7 +152,8 @@ void HelpDialog::updateStrings(uInt8 page, uInt8 lines,
title = "Special commands:";
ADD_BIND("Cmd g", "Grab mouse (keep in window)");
ADD_BIND("Cmd f", "Switch between NTSC/PAL/SECAM");
ADD_BIND("Cmd s", "Save game properties to new file");
ADD_BIND("Cmd s", "Save game properties");
ADD_BIND("", " to a new file");
ADD_LINE;
ADD_BIND("Cmd 0", "Mouse emulates paddle 0");
ADD_BIND("Cmd 1", "Mouse emulates paddle 1");
@ -141,10 +163,10 @@ void HelpDialog::updateStrings(uInt8 page, uInt8 lines,
case 3:
title = "Developer commands:";
ADD_BIND("Shift-Cmd PageUp", "Increase Display.YStart");
ADD_BIND("Shift-Cmd PageDown", "Decrease Display.YStart");
ADD_BIND("Cmd PageUp", "Increase Display.Height");
ADD_BIND("Cmd PageDown", "Decrease Display.Height");
ADD_BIND("Shift-Cmd PgUp", "Increase Display.YStart");
ADD_BIND("Shift-Cmd PgDn", "Decrease Display.YStart");
ADD_BIND("Cmd PgUp", "Increase Display.Height");
ADD_BIND("Cmd PgDn", "Decrease Display.Height");
break;
#endif
case 4:

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: InputTextDialog.cxx,v 1.24 2008-12-24 01:20:06 stephena Exp $
// $Id: InputTextDialog.cxx,v 1.25 2008-12-25 23:05:16 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -47,7 +47,7 @@ InputTextDialog::InputTextDialog(GuiObject* boss, const GUI::Font& font,
WidgetArray wid;
// Calculate real dimensions
_w = fontWidth * 25;
_w = fontWidth * 30;
_h = lineHeight * 4 + labels.size() * (lineHeight + 5);
// Determine longest label

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: OptionsDialog.cxx,v 1.71 2008-08-01 12:16:00 stephena Exp $
// $Id: OptionsDialog.cxx,v 1.72 2008-12-25 23:05:16 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -119,44 +119,45 @@ OptionsDialog::OptionsDialog(OSystem* osystem, DialogContainer* parent,
int x = 0, y = 0, w, h;
// Now create all the dialogs attached to each menu button
w = 240; h = 185;
w = 410; h = 280;
myVideoDialog = new VideoDialog(osystem, parent, font, x, y, w, h);
w = 200; h = 140;
w = 285; h = 200;
myAudioDialog = new AudioDialog(osystem, parent, font, x, y, w, h);
#ifdef _WIN32_WCE
// FIXME - adjust size for WINCE using a smaller font
// we scale the input dialog down a bit in low res devices.
// looks only a little ugly, but the functionality is very welcome
if(instance().desktopWidth() < 320) { w = 220; h = 176; }
else { w = 230; h = 185; }
#else
w = 230; h = 185;
w = 380; h = 310;
#endif
myInputDialog = new InputDialog(osystem, parent, font, x, y, w, h);
w = 200; h = 155;
w = 380; h = 220;
myUIDialog = new UIDialog(osystem, parent, font, x, y, w, h);
w = 280; h = 180;
w = 480; h = 250;
myFileSnapDialog = new FileSnapDialog(osystem, parent, font,
boss, x, y, w, h);
w = 240; h = 115;
w = 440; h = 160;
myRomAuditDialog = new RomAuditDialog(osystem, parent, font, x, y, w, h);
w = 255; h = 190;
w = 470; h = 300;
myGameInfoDialog = new GameInfoDialog(osystem, parent, font, this, x, y, w, h);
#ifdef CHEATCODE_SUPPORT
w = 230; h = 150;
w = 380; h = 240;
myCheatCodeDialog = new CheatCodeDialog(osystem, parent, font, x, y, w, h);
#endif
w = 255; h = 150;
w = 420; h = 270;
myHelpDialog = new HelpDialog(osystem, parent, font, x, y, w, h);
w = 255; h = 150;
w = 480; h = 270;
myAboutDialog = new AboutDialog(osystem, parent, font, x, y, w, h);
addToFocusList(wid);

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: RomAuditDialog.cxx,v 1.5 2008-08-01 12:16:00 stephena Exp $
// $Id: RomAuditDialog.cxx,v 1.6 2008-12-25 23:05:16 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -46,7 +46,6 @@ RomAuditDialog::RomAuditDialog(OSystem* osystem, DialogContainer* parent,
lwidth = font.getStringWidth("ROMs with properties (renamed): ");
int xpos = vBorder, ypos = vBorder;
WidgetArray wid;
ButtonWidget* b;
// Audit path
ButtonWidget* romButton =
@ -79,27 +78,13 @@ RomAuditDialog::RomAuditDialog(OSystem* osystem, DialogContainer* parent,
"(*) Warning: this operation cannot be undone",
kTextAlignLeft);
// Add OK & Cancel buttons
#ifndef MAC_OSX
b = addButton(font, _w - 2 * (kButtonWidth + 7), _h - 24, "Audit", kOKCmd);
wid.push_back(b);
addOKWidget(b);
b = addButton(font, _w - (kButtonWidth + 10), _h - 24, "Close", kCloseCmd);
wid.push_back(b);
addCancelWidget(b);
#else
b = addButton(font, _w - 2 * (kButtonWidth + 7), _h - 24, "Close", kCloseCmd);
wid.push_back(b);
addCancelWidget(b);
b = addButton(font, _w - (kButtonWidth + 10), _h - 24, "Audit", kOKCmd);
wid.push_back(b);
addOKWidget(b);
#endif
addToFocusList(wid);
// Add OK and Cancel buttons
wid.clear();
addOKCancelBGroup(wid, font);
addBGroupToFocusList(wid);
// Create file browser dialog
myBrowser = new BrowserDialog(this, font, 0, 0, 200, 200);
myBrowser = new BrowserDialog(this, font, 0, 0, 400, 320);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: VideoDialog.cxx,v 1.54 2008-07-25 12:41:41 stephena Exp $
// $Id: VideoDialog.cxx,v 1.55 2008-12-25 23:05:16 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -117,6 +117,7 @@ VideoDialog::VideoDialog(OSystem* osystem, DialogContainer* parent,
wid.push_back(myGLStretchPopup);
ypos += lineHeight + 4;
// GL aspect ratio
myAspectRatioSlider =
new SliderWidget(this, font, xpos, ypos, pwidth, lineHeight,
@ -127,23 +128,23 @@ VideoDialog::VideoDialog(OSystem* osystem, DialogContainer* parent,
new StaticTextWidget(this, font, xpos + myAspectRatioSlider->getWidth() + 4,
ypos + 1, fontWidth * 3, fontHeight, "", kTextAlignLeft);
myAspectRatioLabel->setFlags(WIDGET_CLEARBG);
ypos += lineHeight + 4;
// Framerate
myFrameRateSlider =
new SliderWidget(this, font, xpos, ypos, pwidth, lineHeight,
"Framerate: ", lwidth, kFrameRateChanged);
myFrameRateSlider->setMinValue(0); myFrameRateSlider->setMaxValue(300);
wid.push_back(myFrameRateSlider);
myFrameRateLabel =
new StaticTextWidget(this, font, xpos + myFrameRateSlider->getWidth() + 4,
ypos + 1, fontWidth * 3, fontHeight, "", kTextAlignLeft);
myFrameRateLabel->setFlags(WIDGET_CLEARBG);
// Move over to the next column
xpos += myAspectRatioSlider->getWidth() + myAspectRatioLabel->getWidth();
ypos = 10;
// Framerate
myFrameRateSlider = new SliderWidget(this, font, xpos, ypos, 30, lineHeight,
"Framerate: ", lwidth, kFrameRateChanged);
myFrameRateSlider->setMinValue(0); myFrameRateSlider->setMaxValue(300);
wid.push_back(myFrameRateSlider);
myFrameRateLabel = new StaticTextWidget(this, font,
xpos + myFrameRateSlider->getWidth() + 4,
ypos + 1,
15, fontHeight, "", kTextAlignLeft);
myFrameRateLabel->setFlags(WIDGET_CLEARBG);
ypos += lineHeight + 4;
// Fullscreen
myFullscreenCheckbox = new CheckboxWidget(this, font, xpos, ypos,
"Fullscreen mode", kFullScrChanged);

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: Widget.hxx,v 1.62 2008-06-13 13:14:52 stephena Exp $
// $Id: Widget.hxx,v 1.63 2008-12-25 23:05:16 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -79,16 +79,11 @@ enum {
kToggleWidget = 'TOGL'
};
enum {
kButtonWidth = 50,
kButtonHeight = 16
};
/**
This is the base class for all widgets.
@author Stephen Anthony
@version $Id: Widget.hxx,v 1.62 2008-06-13 13:14:52 stephena Exp $
@version $Id: Widget.hxx,v 1.63 2008-12-25 23:05:16 stephena Exp $
*/
class Widget : public GuiObject
{