mirror of https://github.com/stella-emu/stella.git
Fixed bug when requesting a videomode larger than the current maximum.
In such a case, the largest possible videomode should be used instead, and not the smallest one. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1700 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
26f05f5642
commit
28580d3c18
|
@ -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.165 2009-02-06 23:53:34 stephena Exp $
|
// $Id: FrameBuffer.cxx,v 1.166 2009-04-12 17:04:29 stephena Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
@ -1092,13 +1092,22 @@ void FrameBuffer::VideoModeList::set(const GraphicsMode& gfxmode)
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we get here, then the gfx type couldn't be found, so we search
|
// If we get here, then the gfx type couldn't be found, so we search
|
||||||
// for the first mode with the same zoomlevel
|
// for the first mode with the same zoomlevel (making sure that the
|
||||||
for(unsigned int i = 0; i < myModeList.size(); ++i)
|
// requested mode can fit inside the current screen)
|
||||||
|
if(gfxmode.zoom > myModeList[myModeList.size()-1].gfxmode.zoom)
|
||||||
{
|
{
|
||||||
if(myModeList[i].gfxmode.zoom == gfxmode.zoom)
|
myIdx = myModeList.size()-1;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for(unsigned int i = 0; i < myModeList.size(); ++i)
|
||||||
{
|
{
|
||||||
myIdx = i;
|
if(myModeList[i].gfxmode.zoom == gfxmode.zoom)
|
||||||
return;
|
{
|
||||||
|
myIdx = i;
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue