[dasher] Lower the frame rate from 40fps to 10fps so we don't abuse the CPU.
- From: Patrick Welche <pwelche src gnome org>
- To: svn-commits-list gnome org
- Subject: [dasher] Lower the frame rate from 40fps to 10fps so we don't abuse the CPU.
- Date: Tue, 2 Jun 2009 07:09:59 -0400 (EDT)
commit 54b12b64679070dd61c0516bf507bd5024589f01
Author: Patrick Welche <prlw1 cam ac uk>
Date: Tue Jun 2 12:09:01 2009 +0100
Lower the frame rate from 40fps to 10fps so we don't abuse the CPU.
---
ChangeLog | 2 ++
Src/DasherCore/DasherInterfaceBase.cpp | 1 +
Src/DasherCore/DasherModel.cpp | 2 +-
Src/Gtk2/DasherControl.cpp | 6 +++---
4 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index af9d318..7be371e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,8 @@
2009-06-02 Patrick Welche <prlw1 cam ac uk>
* dasher_main.cpp: enable error message if help not found.
+ * Gtk2/DasherControl.cpp: lower the frame rate so we don't
+ abuse the CPU.
2009-06-01 Patrick Welche <prlw1 cam ac uk>
diff --git a/Src/DasherCore/DasherInterfaceBase.cpp b/Src/DasherCore/DasherInterfaceBase.cpp
index 51a7a2d..3240409 100644
--- a/Src/DasherCore/DasherInterfaceBase.cpp
+++ b/Src/DasherCore/DasherInterfaceBase.cpp
@@ -591,6 +591,7 @@ void CDasherInterfaceBase::NewFrame(unsigned long iTime, bool bForceRedraw) {
bReentered=false;
}
+// PRLW: this is never called.
void CDasherInterfaceBase::CheckRedraw() {
if(m_bRedrawScheduled)
Redraw(true);
diff --git a/Src/DasherCore/DasherModel.cpp b/Src/DasherCore/DasherModel.cpp
index d15d18f..52536ab 100644
--- a/Src/DasherCore/DasherModel.cpp
+++ b/Src/DasherCore/DasherModel.cpp
@@ -558,7 +558,7 @@ void CDasherModel::OldPush(myint iMousex, myint iMousey) {
Push_Node(pRight);
}
- // only do this is Dasher is flying
+ // only do this if Dasher is flying
if(Framerate() > 30) {
for(int i = 1; i < int (Framerate() - 30) / 3; i++) {
diff --git a/Src/Gtk2/DasherControl.cpp b/Src/Gtk2/DasherControl.cpp
index fcd26c8..c145daa 100644
--- a/Src/Gtk2/DasherControl.cpp
+++ b/Src/Gtk2/DasherControl.cpp
@@ -256,11 +256,11 @@ void CDasherControl::RealizeCanvas(GtkWidget *pWidget) {
}
void CDasherControl::StartTimer() {
- // Start the timer loops as everything is set up
- // Aim for 40 frames per second, computers are getting faster
+ // Start the timer loops as everything is set up.
+ // Aim for 10 frames per second, we aren't the only process on the system.
if(g_iTimeoutID == 0) {
- g_iTimeoutID = g_timeout_add_full(G_PRIORITY_DEFAULT_IDLE, 25, timer_callback, this, NULL);
+ g_iTimeoutID = g_timeout_add_full(G_PRIORITY_DEFAULT_IDLE, 100, timer_callback, this, NULL);
// TODO: Reimplement this (or at least reimplement some kind of status reporting)
//g_timeout_add_full(G_PRIORITY_DEFAULT_IDLE, 5000, long_timer_callback, this, NULL);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]