diff --git a/src/world.c b/src/world.c index 50d71c2..79c3c3e 100644 --- a/src/world.c +++ b/src/world.c @@ -92,9 +92,10 @@ void worldSetHeight(int h) double worldGetFrameRate() { return frameRate; } -void worldSetFrameRate(double frameRate) { - if (!(frameRate > 1)) frameRate = 1; - if (!(frameRate < 100)) frameRate = 100; +void worldSetFrameRate(double fps) { + if (!(fps > 1)) fps = 1; + if (!(fps < 100)) fps = 100; + frameRate = fps; } double worldGetTimeStep() @@ -210,10 +211,11 @@ static gboolean draw(GtkWidget *widget G_GNUC_UNUSED, cairo_t *cr, gpointer data cairo_paint(cr); cairo_restore(cr); - if (!stopped) gtk_widget_queue_draw(window); - - delta = currentTime - g_get_monotonic_time(); - if (delta > 100) g_usleep(delta - 100); + if (!stopped) { + gtk_widget_queue_draw(window); + delta = currentTime - g_get_monotonic_time(); + if (delta > 100) g_usleep(delta - 100); + } return TRUE; }