Relax restrictions on opening windows larger than the desktop when

WINDOWED_SUPPORT is defined.  This restriction really only applies
to hardware/systems where the desktop resolution is the absolute
limit on window size (and any larger could cause a crash).


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1648 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2009-01-20 21:01:28 +00:00
parent 50e495b637
commit 831f4ac132
2 changed files with 17 additions and 11 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: Debugger.cxx,v 1.133 2009-01-19 16:52:32 stephena Exp $
// $Id: Debugger.cxx,v 1.134 2009-01-20 21:01:28 stephena Exp $
//============================================================================
#include "bspf.hxx"
@ -150,7 +150,7 @@ Debugger::~Debugger()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Debugger::initialize()
{
GUI::Rect r = getDialogBounds();
const GUI::Rect& r = getDialogBounds();
delete myBaseDialog;
DebuggerDialog *dd = new DebuggerDialog(myOSystem, this,
@ -168,7 +168,7 @@ void Debugger::initialize()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool Debugger::initializeVideo()
{
GUI::Rect r = getDialogBounds();
const GUI::Rect& r = getDialogBounds();
string title = string("Stella ") + STELLA_VERSION + ": Debugger mode";
return myOSystem->frameBuffer().initialize(title, r.width(), r.height());
@ -774,8 +774,8 @@ GUI::Rect Debugger::getTiaBounds() const
GUI::Rect Debugger::getRomBounds() const
{
// The ROM area is the full area to the right of the tabs
GUI::Rect dialog = getDialogBounds();
GUI::Rect status = getStatusBounds();
const GUI::Rect& dialog = getDialogBounds();
const GUI::Rect& status = getStatusBounds();
int x1 = status.right + 1;
int y1 = 0;
@ -792,8 +792,8 @@ GUI::Rect Debugger::getStatusBounds() const
// The status area is the full area to the right of the TIA image
// extending as far as necessary
// 30% of any space above 1030 pixels will be allocated to this area
GUI::Rect dlg = getDialogBounds();
GUI::Rect tia = getTiaBounds();
const GUI::Rect& dlg = getDialogBounds();
const GUI::Rect& tia = getTiaBounds();
int x1 = tia.right + 1;
int y1 = 0;
@ -809,9 +809,9 @@ GUI::Rect Debugger::getStatusBounds() const
GUI::Rect Debugger::getTabBounds() const
{
// The tab area is the full area below the TIA image
GUI::Rect dialog = getDialogBounds();
GUI::Rect tia = getTiaBounds();
GUI::Rect status = getStatusBounds();
const GUI::Rect& dialog = getDialogBounds();
const GUI::Rect& tia = getTiaBounds();
const GUI::Rect& status = getStatusBounds();
int x1 = 0;
int y1 = tia.bottom + 1;

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.162 2009-01-19 16:52:32 stephena Exp $
// $Id: FrameBuffer.cxx,v 1.163 2009-01-20 21:01:28 stephena Exp $
//============================================================================
#include <algorithm>
@ -81,8 +81,12 @@ bool FrameBuffer::initialize(const string& title, uInt32 width, uInt32 height)
myInitializedCount++;
// Make sure this mode is even possible
// 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
#ifndef WINDOWED_SUPPORT
if(myOSystem->desktopWidth() < width || myOSystem->desktopHeight() < height)
return false;
#endif
// Set the available video modes for this framebuffer
setAvailableVidModes(width, height);
@ -830,6 +834,8 @@ void FrameBuffer::setAvailableVidModes(uInt32 baseWidth, uInt32 baseHeight)
myFullscreenModeList.clear();
// In UI/windowed mode, there's only one valid video mode we can use
// We don't use maxWindowSizeForScreen here, since UI mode has to open its
// window at the requested size
if(inUIMode)
{
VideoMode m;