The TIA windowed zooming modes now work (using Alt-minus and Alt-equals).

Rearranged some of the desktop size code, to be more consistent with the
new API.

Beginning to remove the old assumptions that a smaller screen than 640x480
could be used.  In the 4.0 release, the smallest (internal) screen
supported will actually be 640x480, and if the real desktop can't display
it, then it will be scaled down.  This is one of the nice benefits of
killing pure software rendering support, and letting the hardware just
draw the screen as it likes.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2877 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2014-04-29 14:52:35 +00:00
parent 0c3b9f1443
commit 61689a9563
9 changed files with 84 additions and 146 deletions

View File

@ -524,11 +524,12 @@ void Console::changeYStart(int direction)
void Console::changeHeight(int direction) void Console::changeHeight(int direction)
{ {
uInt32 height = myTIA->height(); uInt32 height = myTIA->height();
uInt32 dheight = myOSystem->frameBuffer().desktopSize().h;
if(direction == +1) // increase Height if(direction == +1) // increase Height
{ {
height++; height++;
if(height > 256 || height > myOSystem->desktopHeight()) if(height > 256 || height > dheight)
{ {
myOSystem->frameBuffer().showMessage("Height at maximum"); myOSystem->frameBuffer().showMessage("Height at maximum");
return; return;
@ -585,11 +586,12 @@ void Console::setTIAProperties()
// Make sure these values fit within the bounds of the desktop // Make sure these values fit within the bounds of the desktop
// If not, attempt to center vertically // If not, attempt to center vertically
if(height > myOSystem->desktopHeight()) uInt32 dheight = myOSystem->frameBuffer().desktopSize().h;
if(height > dheight)
{ {
ystart += height - myOSystem->desktopHeight(); ystart += height - dheight;
ystart = BSPF_min(ystart, 64u); ystart = BSPF_min(ystart, 64u);
height = myOSystem->desktopHeight(); height = dheight;
} }
myTIA->setYStart(ystart); myTIA->setYStart(ystart);
myTIA->setHeight(height); myTIA->setHeight(height);

View File

@ -367,11 +367,11 @@ void EventHandler::handleKeyEvent(StellaKey key, StellaMod mod, char ascii, bool
switch(key) switch(key)
{ {
case KBDK_EQUALS: case KBDK_EQUALS:
myOSystem->frameBuffer().changeVidMode(+1); myOSystem->frameBuffer().changeWindowedVidMode(+1);
break; break;
case KBDK_MINUS: case KBDK_MINUS:
myOSystem->frameBuffer().changeVidMode(-1); myOSystem->frameBuffer().changeWindowedVidMode(-1);
break; break;
case KBDK_LEFTBRACKET: case KBDK_LEFTBRACKET:

View File

@ -79,19 +79,20 @@ FrameBuffer::~FrameBuffer(void)
bool FrameBuffer::initialize() bool FrameBuffer::initialize()
{ {
// Get desktop resolution and supported renderers // Get desktop resolution and supported renderers
queryHardware(myDesktopWidth, myDesktopHeight, myRenderers); uInt32 query_w, query_h;
queryHardware(query_w, query_h, myRenderers);
// Check the 'maxres' setting, which is an undocumented developer feature // Check the 'maxres' setting, which is an undocumented developer feature
// that specifies the desktop size (not normally set) // that specifies the desktop size (not normally set)
const GUI::Size& s = myOSystem->settings().getSize("maxres"); const GUI::Size& s = myOSystem->settings().getSize("maxres");
if(s.w > 0 && s.h > 0) if(s.w > 0 && s.h > 0)
{ {
myDesktopWidth = s.w; query_w = s.w;
myDesktopHeight = s.h; query_h = s.h;
} }
// Various parts of the codebase assume a minimum screen size // Various parts of the codebase assume a minimum screen size
myDesktopWidth = BSPF_max(myDesktopWidth, (uInt32)kFBMinW); myDesktopSize.w = BSPF_max(query_w, (uInt32)kFBMinW);
myDesktopHeight = BSPF_max(myDesktopHeight, (uInt32)kFBMinH); myDesktopSize.h = BSPF_max(query_h, (uInt32)kFBMinH);
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Create fonts to draw text // Create fonts to draw text
@ -103,8 +104,8 @@ bool FrameBuffer::initialize()
// We can probably add ifdefs to take care of corner cases, // We can probably add ifdefs to take care of corner cases,
// but that means we've failed to abstract it enough ... // but that means we've failed to abstract it enough ...
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
bool smallScreen = myDesktopWidth < (uInt32)kFBMinW || bool smallScreen = myDesktopSize.w < (uInt32)kFBMinW ||
myDesktopHeight < (uInt32)kFBMinH; myDesktopSize.h < (uInt32)kFBMinH;
// This font is used in a variety of situations when a really small // 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 // font is needed; we let the specific widget/dialog decide when to
@ -137,7 +138,7 @@ bool FrameBuffer::initialize()
// Determine possible TIA windowed zoom levels // Determine possible TIA windowed zoom levels
uInt32 maxZoom = maxWindowSizeForScreen((uInt32)kTIAMinW, (uInt32)kTIAMinH, uInt32 maxZoom = maxWindowSizeForScreen((uInt32)kTIAMinW, (uInt32)kTIAMinH,
myDesktopWidth, myDesktopHeight); myDesktopSize.w, myDesktopSize.h);
// Figure our the smallest zoom level we can use // Figure our the smallest zoom level we can use
uInt32 firstZoom = smallScreen ? 1 : 2; uInt32 firstZoom = smallScreen ? 1 : 2;
@ -156,6 +157,7 @@ FBInitStatus FrameBuffer::createDisplay(const string& title,
uInt32 width, uInt32 height) uInt32 width, uInt32 height)
{ {
myInitializedCount++; myInitializedCount++;
myScreenTitle = title;
// A 'windowed' system is defined as one where the window size can be // A 'windowed' system is defined as one where the window size can be
// larger than the screen size, as there's some sort of window manager // larger than the screen size, as there's some sort of window manager
@ -173,14 +175,15 @@ FBInitStatus FrameBuffer::createDisplay(const string& title,
// we're running on a 'large' system, and the window size requirements // we're running on a 'large' system, and the window size requirements
// can be relaxed // can be relaxed
// Otherwise, we treat the system as if WINDOWED_SUPPORT is not defined // Otherwise, we treat the system as if WINDOWED_SUPPORT is not defined
if(myOSystem->desktopWidth() < (uInt32)kFBMinW && if(myDesktopSize.w < (uInt32)kFBMinW &&
myOSystem->desktopHeight() < (uInt32)kFBMinH && myDesktopSize.h < (uInt32)kFBMinH &&
(myOSystem->desktopWidth() < width || myOSystem->desktopHeight() < height)) (myDesktopSize.w < width || myDesktopSize.h < height))
return kFailTooLarge; return kFailTooLarge;
// FIXSDL - remove size limitations here?
if(myOSystem->settings().getString("fullscreen") == "1") if(myOSystem->settings().getString("fullscreen") == "1")
{ {
if(myOSystem->desktopWidth() < width || myOSystem->desktopHeight() < height) if(myDesktopSize.w < width || myDesktopSize.h < height)
return kFailTooLarge; return kFailTooLarge;
useFullscreen = true; useFullscreen = true;
@ -191,7 +194,7 @@ FBInitStatus FrameBuffer::createDisplay(const string& title,
// Make sure this mode is even possible // Make sure this mode is even possible
// We only really need to worry about it in non-windowed environments, // We only really need to worry about it in non-windowed environments,
// where requesting a window that's too large will probably cause a crash // where requesting a window that's too large will probably cause a crash
if(myOSystem->desktopWidth() < width || myOSystem->desktopHeight() < height) if(myDesktopSize.w < width || myDesktopSize.h < height)
return kFailTooLarge; return kFailTooLarge;
#endif #endif
@ -205,7 +208,7 @@ FBInitStatus FrameBuffer::createDisplay(const string& title,
myScreenSize = mode.screen; myScreenSize = mode.screen;
if(width <= myScreenSize.w && height <= myScreenSize.h) if(width <= myScreenSize.w && height <= myScreenSize.h)
{ {
if(setVideoMode(title, mode, useFullscreen)) if(setVideoMode(myScreenTitle, mode, useFullscreen))
{ {
// Did we get the requested fullscreen state? // Did we get the requested fullscreen state?
myOSystem->settings().setValue("fullscreen", fullScreen()); myOSystem->settings().setValue("fullscreen", fullScreen());
@ -776,68 +779,36 @@ void FrameBuffer::toggleFullscreen()
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool FrameBuffer::changeVidMode(int direction) bool FrameBuffer::changeWindowedVidMode(int direction)
{ {
cerr << "changeVidMode: " << direction << endl; #ifdef WINDOWED_SUPPORT
#if 0 //FIXSDL
EventHandler::State state = myOSystem->eventHandler().state(); EventHandler::State state = myOSystem->eventHandler().state();
bool inUIMode = (state == EventHandler::S_DEBUGGER || bool tiaMode = (state != EventHandler::S_DEBUGGER &&
state == EventHandler::S_LAUNCHER); state != EventHandler::S_LAUNCHER);
// Ignore any attempts to change video size while in UI mode // Ignore any attempts to change video size while in invalid modes
if(inUIMode && direction != 0) if(!tiaMode || fullScreen())
return false; return false;
// Only save mode changes in TIA mode with a valid selector
bool saveModeChange = !inUIMode && (direction == -1 || direction == +1);
if(direction == +1) if(direction == +1)
myCurrentModeList->next(); myCurrentModeList->next();
else if(direction == -1) else if(direction == -1)
myCurrentModeList->previous(); myCurrentModeList->previous();
VideoMode vidmode = myCurrentModeList->current(myOSystem->settings(), fullScreen());
if(setVidMode(vidmode))
{
myImageRect.setWidth(vidmode.image_w);
myImageRect.setHeight(vidmode.image_h);
myImageRect.moveTo(vidmode.image_x, vidmode.image_y);
myScreenRect.setWidth(vidmode.screen_w);
myScreenRect.setHeight(vidmode.screen_h);
// Did we get the requested fullscreen state?
const string& fullscreen = myOSystem->settings().getString("fullscreen");
if(fullscreen != "-1")
myOSystem->settings().setValue("fullscreen", fullScreen() ? "1" : "0");
setCursorState();
if(!inUIMode)
{
if(direction != 0) // only show message when mode actually changes
showMessage(vidmode.gfxmode.description);
}
if(saveModeChange)
myOSystem->settings().setValue("tia.filter", vidmode.gfxmode.name);
refresh();
}
else else
return false; return false;
const VideoMode& mode = myCurrentModeList->current();
myImageRect = mode.image;
myScreenSize = mode.screen;
if(setVideoMode(myScreenTitle, mode, false))
{
showMessage(mode.description);
myOSystem->settings().setValue("tia.zoom", mode.zoom);
refresh();
return true;
}
#endif #endif
return true; return false;
/*
cerr << "New mode:" << endl
<< " screen w = " << newmode.screen_w << endl
<< " screen h = " << newmode.screen_h << endl
<< " image x = " << newmode.image_x << endl
<< " image y = " << newmode.image_y << endl
<< " image w = " << newmode.image_w << endl
<< " image h = " << newmode.image_h << endl
<< " zoom = " << newmode.zoom << endl
<< " name = " << newmode.name << endl
<< endl;
*/
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -906,7 +877,7 @@ void FrameBuffer::setAvailableVidModes(uInt32 baseWidth, uInt32 baseHeight)
{ {
// TIA windowed modes // TIA windowed modes
uInt32 maxZoom = maxWindowSizeForScreen(baseWidth, baseHeight, uInt32 maxZoom = maxWindowSizeForScreen(baseWidth, baseHeight,
myDesktopWidth, myDesktopHeight); myDesktopSize.w, myDesktopSize.h);
// Aspect ratio // Aspect ratio
bool ntsc = myOSystem->console().about().InitialFrameRate == "60"; bool ntsc = myOSystem->console().about().InitialFrameRate == "60";
@ -915,7 +886,7 @@ void FrameBuffer::setAvailableVidModes(uInt32 baseWidth, uInt32 baseHeight)
// Figure our the smallest zoom level we can use // Figure our the smallest zoom level we can use
uInt32 firstZoom = 2; uInt32 firstZoom = 2;
if(myDesktopWidth < 640 || myDesktopHeight < 480) if(myDesktopSize.w < 640 || myDesktopSize.h < 480)
firstZoom = 1; firstZoom = 1;
for(uInt32 zoom = firstZoom; zoom <= maxZoom; ++zoom) for(uInt32 zoom = firstZoom; zoom <= maxZoom; ++zoom)
{ {
@ -931,7 +902,7 @@ void FrameBuffer::setAvailableVidModes(uInt32 baseWidth, uInt32 baseHeight)
// TIA fullscreen mode // TIA fullscreen mode
// GUI::Size screen(myDesktopWidth, myDesktopHeight); // GUI::Size screen(myDesktopWidth, myDesktopHeight);
myFullscreenModeList.add( myFullscreenModeList.add(
VideoMode(baseWidth, baseHeight, myDesktopWidth, myDesktopHeight, true) VideoMode(baseWidth, baseHeight, myDesktopSize.w, myDesktopSize.h, true)
); );
} }
@ -942,7 +913,7 @@ void FrameBuffer::setAvailableVidModes(uInt32 baseWidth, uInt32 baseHeight)
VideoMode(baseWidth, baseHeight, baseWidth, baseHeight, false) VideoMode(baseWidth, baseHeight, baseWidth, baseHeight, false)
); );
myFullscreenModeList.add( myFullscreenModeList.add(
VideoMode(baseWidth, baseHeight, myDesktopWidth, myDesktopHeight, true) VideoMode(baseWidth, baseHeight, myDesktopSize.w, myDesktopSize.h, true)
); );
} }
@ -955,7 +926,6 @@ cerr << "Windowed modes:\n" << myWindowedModeList << endl
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
const FrameBuffer::VideoMode& FrameBuffer::getSavedVidMode(bool fullscreen) const FrameBuffer::VideoMode& FrameBuffer::getSavedVidMode(bool fullscreen)
{ {
cerr << "getSavedVidMode(full=" << fullscreen << ")\n";
EventHandler::State state = myOSystem->eventHandler().state(); EventHandler::State state = myOSystem->eventHandler().state();
if(fullscreen) if(fullscreen)

View File

@ -200,10 +200,9 @@ class FrameBuffer
const GUI::Size& screenSize() const { return myScreenSize; } const GUI::Size& screenSize() const { return myScreenSize; }
/** /**
Get the maximum dimensions of a window for the framebuffer hardware. Returns the current dimensions of the users' desktop.
*/ */
uInt32 desktopWidth() const { return myDesktopWidth; } const GUI::Size& desktopSize() const { return myDesktopSize; }
uInt32 desktopHeight() const { return myDesktopHeight; }
/** /**
Get the supported renderers for the video hardware. Get the supported renderers for the video hardware.
@ -238,14 +237,13 @@ class FrameBuffer
/** /**
This method is called when the user wants to switch to the next available This method is called when the user wants to switch to the next available
video mode (functionality depends on fullscreen or windowed mode). windowed video mode.
direction = -1 means go to the next lower video mode direction = -1 means go to the next lower windowed video mode
direction = 0 means to reload the current video mode direction = +1 means go to the next higher windowed video mode
direction = +1 means go to the next higher video mode
@param direction Described above @param direction Described above
*/ */
bool changeVidMode(int direction); bool changeWindowedVidMode(int direction);
/** /**
Sets the state of the cursor (hidden or grabbed) based on the Sets the state of the cursor (hidden or grabbed) based on the
@ -601,8 +599,11 @@ class FrameBuffer
// Dimensions of the main window (not always the same as the image) // Dimensions of the main window (not always the same as the image)
GUI::Size myScreenSize; GUI::Size myScreenSize;
// Title of the main window/screen
string myScreenTitle;
// Maximum dimensions of the desktop area // Maximum dimensions of the desktop area
uInt32 myDesktopWidth, myDesktopHeight; GUI::Size myDesktopSize;
// Supported renderers // Supported renderers
VariantList myRenderers; VariantList myRenderers;

View File

@ -232,13 +232,6 @@ class OSystem
*/ */
float frameRate() const { return myDisplayFrameRate; } float frameRate() const { return myDisplayFrameRate; }
//FIXME - remove this code
/**
Get the maximum dimensions of a window for the video hardware.
*/
uInt32 desktopWidth() const { return myFrameBuffer->desktopWidth(); }
uInt32 desktopHeight() const { return myFrameBuffer->desktopHeight(); }
/////////////////////////////////////////////////
/** /**
Return the default full/complete directory name for storing data. Return the default full/complete directory name for storing data.
*/ */

View File

@ -32,14 +32,15 @@ Launcher::Launcher(OSystem* osystem)
: DialogContainer(osystem) : DialogContainer(osystem)
{ {
const GUI::Size& s = myOSystem->settings().getSize("launcherres"); const GUI::Size& s = myOSystem->settings().getSize("launcherres");
const GUI::Size& d = myOSystem->frameBuffer().desktopSize();
myWidth = s.w; myHeight = s.h; myWidth = s.w; myHeight = s.h;
// The launcher dialog is resizable, within certain bounds // The launcher dialog is resizable, within certain bounds
// We check those bounds now // We check those bounds now
myWidth = BSPF_max(myWidth, osystem->desktopWidth() >= 640 ? 640u : 320u); myWidth = BSPF_max(myWidth, (uInt32)FrameBuffer::kFBMinW);
myHeight = BSPF_max(myHeight, osystem->desktopHeight() >= 480 ? 480u : 240u); myHeight = BSPF_max(myHeight, (uInt32)FrameBuffer::kFBMinH);
myWidth = BSPF_min(myWidth, osystem->desktopWidth()); myWidth = BSPF_min(myWidth, (uInt32)d.w);
myHeight = BSPF_min(myHeight, osystem->desktopHeight()); myHeight = BSPF_min(myHeight, (uInt32)d.h);
myOSystem->settings().setValue("launcherres", myOSystem->settings().setValue("launcherres",
GUI::Size(myWidth, myHeight)); GUI::Size(myWidth, myHeight));

View File

@ -18,6 +18,7 @@
//============================================================================ //============================================================================
#include "Dialog.hxx" #include "Dialog.hxx"
#include "FrameBuffer.hxx"
#include "OptionsDialog.hxx" #include "OptionsDialog.hxx"
#include "bspf.hxx" #include "bspf.hxx"
#include "Menu.hxx" #include "Menu.hxx"
@ -28,20 +29,7 @@ class Properties;
Menu::Menu(OSystem* osystem) Menu::Menu(OSystem* osystem)
: DialogContainer(osystem) : DialogContainer(osystem)
{ {
// This dialog is overlaid on the main TIA screen; we make sure it will fit myBaseDialog = new OptionsDialog(myOSystem, this, 0, 480, 380, false);
// If the TIA can use 1x mode, it implies that the overlay can be no larger
// than 320x240
// Otherwise we can use 2x mode, in which 640x420 is the minimum TIA size
int dw = osystem->desktopWidth(), dh = osystem->desktopHeight();
if(dw < 640 || dh < 480)
{
dw = 320; dh = 240;
}
else
{
dw = 480; dh = 380;
}
myBaseDialog = new OptionsDialog(myOSystem, this, 0, dw, dh, false); // in game mode
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -53,6 +53,7 @@ UIDialog::UIDialog(OSystem* osystem, DialogContainer* parent,
WidgetArray wid; WidgetArray wid;
VariantList items; VariantList items;
ButtonWidget* b; ButtonWidget* b;
const GUI::Size& ds = instance().frameBuffer().desktopSize();
// Set real dimensions // Set real dimensions
_w = 37 * fontWidth + 10; _w = 37 * fontWidth + 10;
@ -73,16 +74,8 @@ UIDialog::UIDialog(OSystem* osystem, DialogContainer* parent,
myLauncherWidthSlider = new SliderWidget(myTab, font, xpos, ypos, pwidth, myLauncherWidthSlider = new SliderWidget(myTab, font, xpos, ypos, pwidth,
lineHeight, "Launcher Width: ", lineHeight, "Launcher Width: ",
lwidth, kLWidthChanged); lwidth, kLWidthChanged);
if(instance().desktopWidth() < 640) myLauncherWidthSlider->setMinValue(FrameBuffer::kFBMinW);
{ myLauncherWidthSlider->setMaxValue(ds.w);
myLauncherWidthSlider->setMinValue(320);
myLauncherWidthSlider->setMaxValue(instance().desktopWidth());
}
else
{
myLauncherWidthSlider->setMinValue(640);
myLauncherWidthSlider->setMaxValue(1920);
}
myLauncherWidthSlider->setStepValue(10); myLauncherWidthSlider->setStepValue(10);
wid.push_back(myLauncherWidthSlider); wid.push_back(myLauncherWidthSlider);
myLauncherWidthLabel = myLauncherWidthLabel =
@ -95,16 +88,8 @@ UIDialog::UIDialog(OSystem* osystem, DialogContainer* parent,
myLauncherHeightSlider = new SliderWidget(myTab, font, xpos, ypos, pwidth, myLauncherHeightSlider = new SliderWidget(myTab, font, xpos, ypos, pwidth,
lineHeight, "Launcher Height: ", lineHeight, "Launcher Height: ",
lwidth, kLHeightChanged); lwidth, kLHeightChanged);
if(instance().desktopHeight() < 480) myLauncherHeightSlider->setMinValue(FrameBuffer::kFBMinH);
{ myLauncherHeightSlider->setMaxValue(ds.h);
myLauncherHeightSlider->setMinValue(240);
myLauncherHeightSlider->setMaxValue(instance().desktopHeight());
}
else
{
myLauncherHeightSlider->setMinValue(480);
myLauncherHeightSlider->setMaxValue(1200);
}
myLauncherHeightSlider->setStepValue(10); myLauncherHeightSlider->setStepValue(10);
wid.push_back(myLauncherHeightSlider); wid.push_back(myLauncherHeightSlider);
myLauncherHeightLabel = myLauncherHeightLabel =
@ -171,7 +156,7 @@ UIDialog::UIDialog(OSystem* osystem, DialogContainer* parent,
lineHeight, "Debugger Width: ", lineHeight, "Debugger Width: ",
lwidth, kDWidthChanged); lwidth, kDWidthChanged);
myDebuggerWidthSlider->setMinValue(DebuggerDialog::kSmallFontMinW); myDebuggerWidthSlider->setMinValue(DebuggerDialog::kSmallFontMinW);
myDebuggerWidthSlider->setMaxValue(osystem->desktopWidth()); myDebuggerWidthSlider->setMaxValue(ds.w);
myDebuggerWidthSlider->setStepValue(10); myDebuggerWidthSlider->setStepValue(10);
wid.push_back(myDebuggerWidthSlider); wid.push_back(myDebuggerWidthSlider);
myDebuggerWidthLabel = myDebuggerWidthLabel =
@ -185,7 +170,7 @@ UIDialog::UIDialog(OSystem* osystem, DialogContainer* parent,
lineHeight, "Debugger Height: ", lineHeight, "Debugger Height: ",
lwidth, kDHeightChanged); lwidth, kDHeightChanged);
myDebuggerHeightSlider->setMinValue(DebuggerDialog::kSmallFontMinH); myDebuggerHeightSlider->setMinValue(DebuggerDialog::kSmallFontMinH);
myDebuggerHeightSlider->setMaxValue(osystem->desktopHeight()); myDebuggerHeightSlider->setMaxValue(ds.h);
myDebuggerHeightSlider->setStepValue(10); myDebuggerHeightSlider->setStepValue(10);
wid.push_back(myDebuggerHeightSlider); wid.push_back(myDebuggerHeightSlider);
myDebuggerHeightLabel = myDebuggerHeightLabel =
@ -228,7 +213,7 @@ UIDialog::UIDialog(OSystem* osystem, DialogContainer* parent,
// (and when it's actually been compiled into the app) // (and when it's actually been compiled into the app)
bool debuggerAvailable = bool debuggerAvailable =
#if defined(DEBUGGER_SUPPORT) && defined(WINDOWED_SUPPORT) #if defined(DEBUGGER_SUPPORT) && defined(WINDOWED_SUPPORT)
(instance().desktopWidth() >= 800 && instance().desktopHeight() >= 600); (ds.w >= 800 && ds.h >= 600); // TODO - maybe this logic can disappear?
#else #else
false; false;
#endif #endif
@ -315,10 +300,10 @@ void UIDialog::loadConfig()
const GUI::Size& ls = instance().settings().getSize("launcherres"); const GUI::Size& ls = instance().settings().getSize("launcherres");
int w = ls.w, h = ls.h; int w = ls.w, h = ls.h;
w = BSPF_max(w, 320); w = BSPF_max(w, (int)FrameBuffer::kFBMinW);
h = BSPF_max(h, 240); h = BSPF_max(h, (int)FrameBuffer::kFBMinH);
w = BSPF_min(w, 1920); w = BSPF_min(w, instance().frameBuffer().desktopSize().w);
h = BSPF_min(h, 1200); h = BSPF_min(h, instance().frameBuffer().desktopSize().h);
myLauncherWidthSlider->setValue(w); myLauncherWidthSlider->setValue(w);
myLauncherWidthLabel->setValue(w); myLauncherWidthLabel->setValue(w);
@ -343,8 +328,8 @@ void UIDialog::loadConfig()
w = ds.w, h = ds.h; w = ds.w, h = ds.h;
w = BSPF_max(w, (int)DebuggerDialog::kSmallFontMinW); w = BSPF_max(w, (int)DebuggerDialog::kSmallFontMinW);
h = BSPF_max(h, (int)DebuggerDialog::kSmallFontMinH); h = BSPF_max(h, (int)DebuggerDialog::kSmallFontMinH);
w = BSPF_min(w, (int)instance().desktopWidth()); w = BSPF_min(w, (int)ds.w);
h = BSPF_min(h, (int)instance().desktopHeight()); h = BSPF_min(h, (int)ds.h);
myDebuggerWidthSlider->setValue(w); myDebuggerWidthSlider->setValue(w);
myDebuggerWidthLabel->setValue(w); myDebuggerWidthLabel->setValue(w);
@ -414,8 +399,8 @@ void UIDialog::setDefaults()
{ {
case 0: // Launcher options case 0: // Launcher options
{ {
int w = BSPF_min(instance().desktopWidth(), 640u); int w = BSPF_min(instance().frameBuffer().desktopSize().w, (int)FrameBuffer::kFBMinW);
int h = BSPF_min(instance().desktopHeight(), 480u); int h = BSPF_min(instance().frameBuffer().desktopSize().h, (int)FrameBuffer::kFBMinH);
myLauncherWidthSlider->setValue(w); myLauncherWidthSlider->setValue(w);
myLauncherWidthLabel->setValue(w); myLauncherWidthLabel->setValue(w);
myLauncherHeightSlider->setValue(h); myLauncherHeightSlider->setValue(h);
@ -429,8 +414,8 @@ void UIDialog::setDefaults()
case 1: // Debugger options case 1: // Debugger options
{ {
#ifdef DEBUGGER_SUPPORT #ifdef DEBUGGER_SUPPORT
int w = BSPF_min(instance().desktopWidth(), (uInt32)DebuggerDialog::kMediumFontMinW); int w = BSPF_min(instance().frameBuffer().desktopSize().w, (int)DebuggerDialog::kMediumFontMinW);
int h = BSPF_min(instance().desktopHeight(), (uInt32)DebuggerDialog::kMediumFontMinH); int h = BSPF_min(instance().frameBuffer().desktopSize().h, (int)DebuggerDialog::kMediumFontMinH);
myDebuggerWidthSlider->setValue(w); myDebuggerWidthSlider->setValue(w);
myDebuggerWidthLabel->setValue(w); myDebuggerWidthLabel->setValue(w);
myDebuggerHeightSlider->setValue(h); myDebuggerHeightSlider->setValue(h);

View File

@ -322,8 +322,7 @@ void VideoDialog::loadConfig()
// the desktop and which renderer we're using // the desktop and which renderer we're using
const VariantList& items = instance().frameBuffer().supportedTIAZoomLevels(); const VariantList& items = instance().frameBuffer().supportedTIAZoomLevels();
myTIAZoom->addItems(items); myTIAZoom->addItems(items);
myTIAZoom->setSelected(instance().settings().getString("tia.zoom"), myTIAZoom->setSelected(instance().settings().getString("tia.zoom"), "2");
instance().desktopWidth() < 640 ? "1" : "2");
// TIA Palette // TIA Palette
myTIAPalette->setSelected( myTIAPalette->setSelected(
@ -482,8 +481,7 @@ void VideoDialog::setDefaults()
case 0: // General case 0: // General
{ {
myRenderer->setSelected("soft", ""); myRenderer->setSelected("soft", "");
myTIAZoom->setSelected( myTIAZoom->setSelected("2", "");
instance().desktopWidth() < 640 ? "1" : "2", "");
myTIAPalette->setSelected("standard", ""); myTIAPalette->setSelected("standard", "");
myFrameTiming->setSelected("sleep", ""); myFrameTiming->setSelected("sleep", "");
myTIAInterpolate->setSelected("nearest", ""); myTIAInterpolate->setSelected("nearest", "");