mirror of
https://github.com/mapmapteam/mapmap.git
synced 2026-06-16 12:33:19 +02:00
Frame rate is now an option that can be specified on the commandline.
This commit is contained in:
+10
-1
@@ -46,6 +46,9 @@ MainWindow::MainWindow()
|
||||
_hasCurrentMapping = false;
|
||||
currentSelectedItem = NULL;
|
||||
|
||||
// Frames per second.
|
||||
_framesPerSecond = (-1);
|
||||
|
||||
// Play state.
|
||||
_isPlaying = false;
|
||||
|
||||
@@ -82,8 +85,8 @@ MainWindow::MainWindow()
|
||||
|
||||
// Create and start timer.
|
||||
videoTimer = new QTimer(this);
|
||||
videoTimer->setInterval( int( 1000 / MM::FRAMES_PER_SECOND ) );
|
||||
connect(videoTimer, SIGNAL(timeout()), this, SLOT(updateCanvases()));
|
||||
setFramesPerSecond(MM::DEFAULT_FRAMES_PER_SECOND);
|
||||
videoTimer->start();
|
||||
|
||||
// Start playing by default.
|
||||
@@ -2830,6 +2833,12 @@ void MainWindow::enableDisplayControls(bool display)
|
||||
updateCanvases();
|
||||
}
|
||||
|
||||
void MainWindow::setFramesPerSecond(qreal fps)
|
||||
{
|
||||
_framesPerSecond = qMax(fps, 0.0);
|
||||
videoTimer->setInterval( int( 1000 / _framesPerSecond ) );
|
||||
}
|
||||
|
||||
void MainWindow::enableDisplayPaintControls(bool display)
|
||||
{
|
||||
_displayPaintControls = display;
|
||||
|
||||
Reference in New Issue
Block a user