mirror of https://github.com/PCSX2/pcsx2.git
Minor fixes for new framelimiter; add proper w32pthreads/gsdx dependencies to the MSVC solution.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2297 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
97041701ae
commit
620c93cad7
|
@ -188,21 +188,38 @@ struct FixedInt
|
||||||
return (Raw + (Precision/2)) / Precision;
|
return (Raw + (Precision/2)) / Precision;
|
||||||
}
|
}
|
||||||
|
|
||||||
static FixedInt<Precision> FromString( const wxString parseFrom, const FixedInt<Precision>& defval )
|
static bool TryFromString( FixedInt<Precision>& dest, const wxString& parseFrom )
|
||||||
{
|
{
|
||||||
long whole, frac;
|
long whole, frac;
|
||||||
wxString afterFirst( parseFrom.AfterFirst( L'.' ).Mid(0, 5) );
|
wxString afterFirst( parseFrom.AfterFirst( L'.' ).Mid(0, 5) );
|
||||||
if( !parseFrom.BeforeFirst( L'.' ).ToLong( &whole ) || !afterFirst.ToLong( &frac ) )
|
if( !parseFrom.BeforeFirst( L'.' ).ToLong( &whole ) || !afterFirst.ToLong( &frac ) )
|
||||||
return defval;
|
return false;
|
||||||
|
|
||||||
FixedInt<Precision> retval( whole );
|
dest.SetWhole( whole );
|
||||||
|
|
||||||
if( afterFirst.Length() != 0 && frac != 0 )
|
if( afterFirst.Length() != 0 && frac != 0 )
|
||||||
{
|
{
|
||||||
int fracPower = (int)pow( 10.0, (int)afterFirst.Length() );
|
int fracPower = (int)pow( 10.0, (int)afterFirst.Length() );
|
||||||
retval.SetFraction( (frac * Precision) / fracPower );
|
dest.SetFraction( (frac * Precision) / fracPower );
|
||||||
}
|
}
|
||||||
return retval;
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
static FixedInt<Precision> FromString( const wxString& parseFrom, const FixedInt<Precision>& defval )
|
||||||
|
{
|
||||||
|
FixedInt<Precision> dest;
|
||||||
|
if( !TryFromString( dest, parseFrom ) ) return defval;
|
||||||
|
return dest;
|
||||||
|
}
|
||||||
|
|
||||||
|
// This version of FromString throws a ParseError exception if the conversion fails.
|
||||||
|
static FixedInt<Precision> FromString( const wxString parseFrom )
|
||||||
|
{
|
||||||
|
FixedInt<Precision> dest;
|
||||||
|
if( !TryFromString( dest, parseFrom ) ) throw Exception::ParseError(
|
||||||
|
wxsFormat(L"Parse error on FixedInt<%d>::FromString", Precision), wxEmptyString
|
||||||
|
);
|
||||||
|
return dest;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -154,8 +154,9 @@ namespace Panels
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
// --------------------------------------------------------------------------------------
|
||||||
//
|
// FramelimiterPanel
|
||||||
|
// --------------------------------------------------------------------------------------
|
||||||
class FramelimiterPanel : public BaseApplicableConfigPanel
|
class FramelimiterPanel : public BaseApplicableConfigPanel
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
@ -181,6 +182,9 @@ namespace Panels
|
||||||
void OnSettingsChanged();
|
void OnSettingsChanged();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------------------------
|
||||||
|
// GSWindowSettingsPanel
|
||||||
|
// --------------------------------------------------------------------------------------
|
||||||
class GSWindowSettingsPanel : public BaseApplicableConfigPanel
|
class GSWindowSettingsPanel : public BaseApplicableConfigPanel
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -320,9 +320,9 @@ void Panels::FramelimiterPanel::OnSettingsChanged()
|
||||||
|
|
||||||
m_check_LimiterDisable->SetValue( !gsconf.FrameLimitEnable );
|
m_check_LimiterDisable->SetValue( !gsconf.FrameLimitEnable );
|
||||||
|
|
||||||
m_spin_NominalPct ->SetValue( (appconf.NominalScalar * 100).ToIntRounded() );
|
m_spin_NominalPct ->SetValue( appconf.NominalScalar.Raw );
|
||||||
m_spin_TurboPct ->SetValue( (appconf.TurboScalar * 100).ToIntRounded() );
|
m_spin_TurboPct ->SetValue( appconf.TurboScalar.Raw );
|
||||||
m_spin_TurboPct ->SetValue( (appconf.SlomoScalar * 100).ToIntRounded() );
|
m_spin_SlomoPct ->SetValue( appconf.SlomoScalar.Raw );
|
||||||
|
|
||||||
m_text_BaseNtsc ->SetValue( gsconf.FramerateNTSC.ToString() );
|
m_text_BaseNtsc ->SetValue( gsconf.FramerateNTSC.ToString() );
|
||||||
m_text_BasePal ->SetValue( gsconf.FrameratePAL.ToString() );
|
m_text_BasePal ->SetValue( gsconf.FrameratePAL.ToString() );
|
||||||
|
@ -335,16 +335,20 @@ void Panels::FramelimiterPanel::Apply()
|
||||||
|
|
||||||
gsconf.FrameLimitEnable = !m_check_LimiterDisable->GetValue();
|
gsconf.FrameLimitEnable = !m_check_LimiterDisable->GetValue();
|
||||||
|
|
||||||
appconf.NominalScalar = m_spin_NominalPct ->GetValue();
|
appconf.NominalScalar.Raw = m_spin_NominalPct ->GetValue();
|
||||||
appconf.TurboScalar = m_spin_TurboPct ->GetValue();
|
appconf.TurboScalar.Raw = m_spin_TurboPct ->GetValue();
|
||||||
appconf.SlomoScalar = m_spin_SlomoPct ->GetValue();
|
appconf.SlomoScalar.Raw = m_spin_SlomoPct ->GetValue();
|
||||||
|
|
||||||
double ntsc, pal;
|
try {
|
||||||
if( !m_text_BaseNtsc->GetValue().ToDouble( &ntsc ) ||
|
gsconf.FramerateNTSC = Fixed100::FromString( m_text_BaseNtsc->GetValue() );
|
||||||
!m_text_BasePal ->GetValue().ToDouble( &pal )
|
gsconf.FrameratePAL = Fixed100::FromString( m_text_BasePal->GetValue() );
|
||||||
)
|
}
|
||||||
throw Exception::CannotApplySettings( this, wxLt("Error while parsing either NTSC or PAL framerate settings. Settings must be valid floating point numerics.") );
|
catch( Exception::ParseError& )
|
||||||
|
{
|
||||||
|
throw Exception::CannotApplySettings( this,
|
||||||
|
wxLt("Error while parsing either NTSC or PAL framerate settings. Settings must be valid floating point numerics.")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
gsconf.FramerateNTSC = ntsc;
|
appconf.SanityCheck();
|
||||||
gsconf.FrameratePAL = pal;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,6 +42,8 @@ EndProject
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GSdx", "plugins\GSdx\GSdx_vs2008.vcproj", "{18E42F6F-3A62-41EE-B42F-79366C4F1E95}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GSdx", "plugins\GSdx\GSdx_vs2008.vcproj", "{18E42F6F-3A62-41EE-B42F-79366C4F1E95}"
|
||||||
ProjectSection(ProjectDependencies) = postProject
|
ProjectSection(ProjectDependencies) = postProject
|
||||||
{067D7863-393B-494F-B296-4A8853EB3D1D} = {067D7863-393B-494F-B296-4A8853EB3D1D}
|
{067D7863-393B-494F-B296-4A8853EB3D1D} = {067D7863-393B-494F-B296-4A8853EB3D1D}
|
||||||
|
{26511268-2902-4997-8421-ECD7055F9E28} = {26511268-2902-4997-8421-ECD7055F9E28}
|
||||||
|
{7E9B2BE7-CEC3-4F14-847B-0AB8D562FB86} = {7E9B2BE7-CEC3-4F14-847B-0AB8D562FB86}
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SoundTouch", "3rdparty\SoundTouch\SoundTouch.vcproj", "{E9B51944-7E6D-4BCD-83F2-7BBD5A46182D}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SoundTouch", "3rdparty\SoundTouch\SoundTouch.vcproj", "{E9B51944-7E6D-4BCD-83F2-7BBD5A46182D}"
|
||||||
|
|
Loading…
Reference in New Issue