Author: toshok
Date: 2007-09-26 15:06:56 -0400 (Wed, 26 Sep 2007)
New Revision: 86433
Modified:
trunk/moon/src/ChangeLog
trunk/moon/src/clock.cpp
trunk/moon/src/runtime.cpp
Log:
2007-09-26 Chris Toshok <[EMAIL PROTECTED]>
* clock.cpp: initialize the min_timeout based on a good default
max fps (60 in our case). Also, calculate the fps adjustments in
a nicer way.
* runtime.cpp: remove the non-xrandr SetMaximumRefreshRate call -
it's handled by TimeManager's default.
Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog 2007-09-26 19:05:20 UTC (rev 86432)
+++ trunk/moon/src/ChangeLog 2007-09-26 19:06:56 UTC (rev 86433)
@@ -1,3 +1,12 @@
+2007-09-26 Chris Toshok <[EMAIL PROTECTED]>
+
+ * clock.cpp: initialize the min_timeout based on a good default
+ max fps (60 in our case). Also, calculate the fps adjustments in
+ a nicer way.
+
+ * runtime.cpp: remove the non-xrandr SetMaximumRefreshRate call -
+ it's handled by TimeManager's default.
+
2007-09-26 Jeffrey Stedfast <[EMAIL PROTECTED]>
* font.cpp: A bunch of fixes/changes to mimic Microsoft's
Modified: trunk/moon/src/clock.cpp
===================================================================
--- trunk/moon/src/clock.cpp 2007-09-26 19:05:20 UTC (rev 86432)
+++ trunk/moon/src/clock.cpp 2007-09-26 19:06:56 UTC (rev 86433)
@@ -40,6 +40,7 @@
#define MINIMUM_FPS 10
#define DEFAULT_FPS 30
+#define MAXIMUM_FPS 60
#define FPS_TO_DELAY(fps) (int)(((double)1/(fps)) * 1000)
#define DELAY_TO_FPS(delay) (1000.0 / delay)
@@ -73,6 +74,7 @@
: child_clocks (NULL),
tick_id (-1),
current_timeout (FPS_TO_DELAY (DEFAULT_FPS)), /* something suitably small
*/
+ min_timeout (FPS_TO_DELAY (MAXIMUM_FPS)),
strikes (0),
flags (TimeManagerOp (TIME_MANAGER_UPDATE_CLOCKS | TIME_MANAGER_RENDER |
TIME_MANAGER_TICK_CALL /*| TIME_MANAGER_UPDATE_INPUT*/)),
tick_calls (NULL)
@@ -233,22 +235,24 @@
/* it took us longer than our current_timeout to run
through
the clock update/render loop. we need to scale back
our
timeout (lower fps) */
- new_timeout = current_timeout + FPS_TO_DELAY
(FPS_ADJUSTMENT);
+ new_timeout = FPS_TO_DELAY (DELAY_TO_FPS
(current_timeout) + FPS_ADJUSTMENT);
}
else if (strikes < -STRIKE_COUNT) {
/* it took us less time than our
current_timeout to run through the clock
update/render loop. let's make the timeout
less (higher fps). */
- new_timeout = current_timeout - FPS_TO_DELAY
(FPS_ADJUSTMENT);
+ new_timeout = FPS_TO_DELAY (DELAY_TO_FPS
(current_timeout) - FPS_ADJUSTMENT);
}
strikes = 0;
- if (new_timeout < min_timeout)
+ if (new_timeout < min_timeout) {
new_timeout = min_timeout;
- else if (new_timeout > FPS_TO_DELAY (MINIMUM_FPS))
+ }
+ else if (new_timeout > FPS_TO_DELAY (MINIMUM_FPS)) {
new_timeout = FPS_TO_DELAY (MINIMUM_FPS);
+ }
if (new_timeout != current_timeout) {
current_timeout = new_timeout;
Modified: trunk/moon/src/runtime.cpp
===================================================================
--- trunk/moon/src/runtime.cpp 2007-09-26 19:05:20 UTC (rev 86432)
+++ trunk/moon/src/runtime.cpp 2007-09-26 19:06:56 UTC (rev 86433)
@@ -548,8 +548,6 @@
TimeManager::Instance()->SetMaximumRefreshRate (rate);
XRRFreeScreenConfigInfo (info);
}
-#else
- TimeManager::Instance()->SetMaximumRefreshRate (60);
#endif
#endif
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches