Re-added 'uipalette' option.

git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2989 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2014-09-03 13:27:33 +00:00
parent 8c3c668276
commit 4b6f589a4e
8 changed files with 71 additions and 21 deletions

View File

@ -12,6 +12,14 @@
Release History
===========================================================================
4.1 to 4.2: (September x, 2014)
* Re-added 'uipalette' option due to popular demand (of at least one
person :)).
-Have fun!
4.0 to 4.1: (September 1, 2014)
* Improved 'DASH' bankswitching scheme support; there is now a debugger
@ -39,8 +47,6 @@
* The UNIX configure script now supports newer versions of Hurd.
Special thanks to Stephen Kitt for the patch.
-Have fun!
3.9.3 to 4.0: (July 1, 2014)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@ -2093,6 +2093,11 @@
given zoom level (1 or 2).</td>
</tr>
<tr>
<td><pre>-uipalette &lt;standard|classic&gt;</pre></td>
<td>Use the specified palette for UI elements.</td>
</tr>
<tr>
<td><pre>-listdelay &lt;delay&gt;</pre></td>
<td>Set the amount of time to wait between treating successive
@ -2475,6 +2480,7 @@
<td valign="top">
<table border="1" cellpadding="4">
<tr><th>Item</th><th>Brief description</th><th>For more information,<br>see <a href="#CommandLine">CommandLine</a></th></tr>
<tr><td>Interface Palette</td><td>palette to use for UI elements</td><td>-uipalette</td></tr>
<tr><td>List quick delay</td><td>time to wait between keypresses in listwidget</td><td>-listdelay</td></tr>
<tr><td>Mouse wheel scroll</td><td>number of lines mouse scroll will move in listwidget</td><td>-mscroll</td></tr>
</table>

View File

@ -77,10 +77,8 @@ FrameBuffer::~FrameBuffer(void)
bool FrameBuffer::initialize()
{
// Get desktop resolution and supported renderers
uInt32 query_w, query_h;
queryHardware(myDisplays, myRenderers);
query_w = myDisplays[0].w;
query_h = myDisplays[0].h;
uInt32 query_w = myDisplays[0].w, query_h = myDisplays[0].h;
// Check the 'maxres' setting, which is an undocumented developer feature
// that specifies the desktop size (not normally set)
@ -104,8 +102,7 @@ bool FrameBuffer::initialize()
// We can probably add ifdefs to take care of corner cases,
// but that means we've failed to abstract it enough ...
////////////////////////////////////////////////////////////////////
bool smallScreen = myDesktopSize.w < kFBMinW ||
myDesktopSize.h < kFBMinH;
bool smallScreen = myDesktopSize.w < kFBMinW || myDesktopSize.h < kFBMinH;
// This font is used in a variety of situations when a really small
// font is needed; we let the specific widget/dialog decide when to
@ -150,11 +147,13 @@ bool FrameBuffer::initialize()
}
// Set palette for GUI (upper area of array, doesn't change during execution)
int palID = myOSystem.settings().getString("uipalette") == "classic" ? 1 : 0;
for(int i = 0, j = 256; i < kNumColors-256; ++i, ++j)
{
Uint8 r = (ourGUIColors[i] >> 16) & 0xff;
Uint8 g = (ourGUIColors[i] >> 8) & 0xff;
Uint8 b = ourGUIColors[i] & 0xff;
Uint8 r = (ourGUIColors[palID][i] >> 16) & 0xff;
Uint8 g = (ourGUIColors[palID][i] >> 8) & 0xff;
Uint8 b = ourGUIColors[palID][i] & 0xff;
myPalette[j] = mapRGB(r, g, b);
}
@ -1030,12 +1029,24 @@ void FrameBuffer::VideoModeList::setZoom(uInt32 zoom)
kDbgChangedTextColor Text color for changed cells
kDbgColorHi Highlighted color in debugger data cells
*/
uInt32 FrameBuffer::ourGUIColors[kNumColors-256] = {
0x686868, 0x000000, 0x404040, 0x000000, 0x62a108, 0x9f0000,
uInt32 FrameBuffer::ourGUIColors[2][kNumColors-256] = {
// Standard
{ 0x686868, 0x000000, 0x404040, 0x000000, 0x62a108, 0x9f0000,
0xc9af7c, 0xf0f0cf, 0xc80000,
0xac3410, 0xd55941, 0xffffff, 0xffd652,
0xac3410,
0xac3410, 0xd55941,
0xac3410, 0xd55941,
0xc80000, 0x00ff00, 0xc8c8ff
},
// Classic
{ 0x686868, 0x000000, 0x404040, 0x20a020, 0x00ff00, 0xc80000,
0x000000, 0x000000, 0xc80000,
0x000000, 0x000000, 0x20a020, 0x00ff00,
0x20a020,
0x20a020, 0x00ff00,
0x20a020, 0x00ff00,
0xc80000, 0x00ff00, 0xc8c8ff
}
};

View File

@ -579,8 +579,8 @@ class FrameBuffer
// Holds a reference to all the surfaces that have been created
map<uInt32,FBSurface*> mySurfaceList;
// Holds UI palette data
static uInt32 ourGUIColors[kNumColors-256];
// Holds UI palette data (standard and classic colours)
static uInt32 ourGUIColors[2][kNumColors-256];
};
#endif

View File

@ -121,6 +121,7 @@ Settings::Settings(OSystem& osystem)
GUI::Size(DebuggerDialog::kMediumFontMinW,
DebuggerDialog::kMediumFontMinH));
#endif
setInternal("uipalette", "standard");
setInternal("listdelay", "300");
setInternal("mwheel", "4");

View File

@ -236,10 +236,19 @@ UIDialog::UIDialog(OSystem* osystem, DialogContainer* parent,
// 3) Misc. options
wid.clear();
tabID = myTab->addTab(" Misc. ");
lwidth = font.getStringWidth("Mouse wheel scroll: ");
lwidth = font.getStringWidth("Interface Palette (*): ");
pwidth = font.getStringWidth("Standard");
xpos = ypos = vBorder;
// UI Palette
ypos += 1;
items.clear();
items.push_back("Standard", "standard");
items.push_back("Classic", "classic");
myPalettePopup = new PopUpWidget(myTab, font, xpos, ypos, pwidth, lineHeight,
items, "Interface Palette (*): ", lwidth);
wid.push_back(myPalettePopup);
ypos += lineHeight + 4;
// Delay between quick-selecting characters in ListWidget
items.clear();
@ -273,6 +282,13 @@ UIDialog::UIDialog(OSystem* osystem, DialogContainer* parent,
wid.push_back(myWheelLinesPopup);
ypos += lineHeight + 4;
// Add message concerning usage
xpos = vBorder; ypos += 1*(lineHeight + 4);
lwidth = ifont.getStringWidth("(*) Requires application restart");
new StaticTextWidget(myTab, ifont, xpos, ypos, BSPF_min(lwidth, _w-20), fontHeight,
"(*) Requires application restart",
kTextAlignLeft);
// Add items for tab 2
addToFocusList(wid, myTab, tabID);
@ -341,6 +357,10 @@ void UIDialog::loadConfig()
myDebuggerFontStyle->setSelected(style, "0");
#endif
// UI palette
const string& pal = instance().settings().getString("uipalette");
myPalettePopup->setSelected(pal, "standard");
// Listwidget quick delay
const string& delay = instance().settings().getString("listdelay");
myListDelayPopup->setSelected(delay, "300");
@ -381,6 +401,10 @@ void UIDialog::saveConfig()
instance().settings().setValue("dbg.fontstyle",
myDebuggerFontStyle->getSelectedTag().toString());
// UI palette
instance().settings().setValue("uipalette",
myPalettePopup->getSelectedTag().toString());
// Listwidget quick delay
instance().settings().setValue("listdelay",
myListDelayPopup->getSelectedTag().toString());
@ -426,6 +450,7 @@ void UIDialog::setDefaults()
}
case 2: // Misc. options
myPalettePopup->setSelected("standard");
myListDelayPopup->setSelected("300");
myWheelLinesPopup->setSelected("4");
break;

View File

@ -58,6 +58,7 @@ class UIDialog : public Dialog
PopUpWidget* myDebuggerFontStyle;
// Misc options
PopUpWidget* myPalettePopup;
PopUpWidget* myListDelayPopup;
PopUpWidget* myWheelLinesPopup;