Commit b5af21cb authored by gerstrong@gmail.com's avatar gerstrong@gmail.com

FPS improvments

parent f1d7566d
......@@ -58,9 +58,9 @@ public:
float FPS() { return 1000.0f/mRenderLatency; }
float LogicLatency() { return mLogicLatency; }
float LogicLatency() const { return mLogicLatency; }
float RenderLatency() { return mRenderLatency; }
float RenderLatency() const { return mRenderLatency; }
inline bool resetLogicSignal()
{
......
......@@ -89,6 +89,9 @@ void CGUINumberControl::setSelection( const int value )
void CGUINumberControl::processLogic()
{
if(!mEnabled)
return;
GsPointingState &pointingState = gPointDevice.mPointingState;
const bool hasPoint = mRect.HasPoint(pointingState.mPos);
......
......@@ -46,6 +46,8 @@ GameMenu(GsRect<float>(0.15f, 0.20f, 0.65f, 0.55f), style )
mpFPSSelection = new NumberControl( "FPS", 10, 120, 10, 60,
false,
style);
mpMenuDialog->addControl( mpFPSSelection, style );
mpFrameSkip = new Switch( "FrameSkip", style );
......@@ -87,6 +89,10 @@ void CVideoSettings::refresh()
// Load the config into the GUI
// TODO: Temporary. This must become a float later...
const auto iFPS = static_cast<int>( gTimer.FPS() );
// Only enable this option when VSync is turned off
mpFPSSelection->enable(!mUsersConf.mVSync);
mpFPSSelection->setSelection( iFPS );
mpFrameSkip->enable( (iFPS> 0.0) ? true : false );
......
......@@ -69,22 +69,32 @@ void NumberControl::drawNoStyle(SDL_Rect& lRect)
SDL_Surface *blitsfc = gVideoDriver.getBlitSurface();
/*
if(mEnabled)
{
/*
if(mSlider)
{
text += sliderStr();
}
else*/
{
text += (mDecSel) ? "\025" : " ";
text += itoa(mValue);
if(mIncSel)
text += static_cast<char>(17);
else
text += " ";
{
text += (mDecSel) ? "\025" : " ";
text += itoa(mValue);
if(mIncSel)
text += static_cast<char>(17);
else
text += " ";
}
Font.drawFont( blitsfc, text, lRect.x+40, lRect.y, false );
}
Font.drawFont( blitsfc, text, lRect.x+40, lRect.y, false );
else
{
text += " " + itoa(mValue) + " ";
Font.drawFont( blitsfc, text, lRect.x+40, lRect.y, true );
}
drawTwirl(lRect);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment