mirror of https://github.com/stella-emu/stella.git
fix stoi exception for Display_PPBlend
This commit is contained in:
parent
a937b8fea8
commit
7a7969ae8a
|
@ -583,7 +583,13 @@ void Console::togglePhosphor()
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void Console::changePhosphor(int direction)
|
void Console::changePhosphor(int direction)
|
||||||
{
|
{
|
||||||
int blend = stoi(myProperties.get(PropType::Display_PPBlend));
|
int blend = 0;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
blend = stoi(myProperties.get(PropType::Display_PPBlend));
|
||||||
|
}
|
||||||
|
catch (...) {}
|
||||||
|
|
||||||
if(direction == +1) // increase blend
|
if(direction == +1) // increase blend
|
||||||
{
|
{
|
||||||
|
|
|
@ -91,7 +91,11 @@ void TIASurface::initialize(const Console& console,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
p_blend = stoi(console.properties().get(PropType::Display_PPBlend));
|
try
|
||||||
|
{
|
||||||
|
p_blend = stoi(console.properties().get(PropType::Display_PPBlend));
|
||||||
|
}
|
||||||
|
catch (...) {}
|
||||||
enable = console.properties().get(PropType::Display_Phosphor) == "YES";
|
enable = console.properties().get(PropType::Display_Phosphor) == "YES";
|
||||||
}
|
}
|
||||||
enablePhosphor(enable, p_blend);
|
enablePhosphor(enable, p_blend);
|
||||||
|
|
|
@ -460,7 +460,14 @@ void GameInfoDialog::loadEmulationProperties(const Properties& props)
|
||||||
myPPBlend->setEnabled(!alwaysPhosphor && usePhosphor);
|
myPPBlend->setEnabled(!alwaysPhosphor && usePhosphor);
|
||||||
|
|
||||||
const string& blend = props.get(PropType::Display_PPBlend);
|
const string& blend = props.get(PropType::Display_PPBlend);
|
||||||
myPPBlend->setValue(stoi(blend));
|
try
|
||||||
|
{
|
||||||
|
myPPBlend->setValue(stoi(blend));
|
||||||
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
myPPBlend->setValue(0);
|
||||||
|
}
|
||||||
|
|
||||||
// set vertical center
|
// set vertical center
|
||||||
Int32 vcenter = stoi(props.get(PropType::Display_VCenter));
|
Int32 vcenter = stoi(props.get(PropType::Display_VCenter));
|
||||||
|
|
Loading…
Reference in New Issue