revision 109:cc84a653c781
summary |
tree |
shortlog |
changelog |
graph |
changeset |
raw | bz2 | zip | gz changeset | 109:cc84a653c781 |
parent | 108:565de331ccec |
child | 110:83a33da5ed06 |
author | nkeynes |
date | Wed Mar 15 13:17:23 2006 +0000 (17 years ago) |
Limit gui hooks to only every 1/10 second of emulated time
![]() | src/gui/gui.c | view | annotate | diff | log |
1.1 --- a/src/gui/gui.c Wed Mar 15 13:16:50 2006 +00001.2 +++ b/src/gui/gui.c Wed Mar 15 13:17:23 2006 +00001.3 @@ -1,5 +1,5 @@1.4 /**1.5 - * $Id: gui.c,v 1.10 2006-03-14 12:45:53 nkeynes Exp $1.6 + * $Id: gui.c,v 1.11 2006-03-15 13:17:23 nkeynes Exp $1.7 *1.8 * Top-level GUI (GTK2) module.1.9 *1.10 @@ -115,12 +115,18 @@1.11 gtk_gui_update();1.12 }1.14 +uint32_t gtk_gui_nanos = 0;1.15 +1.16 uint32_t gtk_gui_run_slice( uint32_t nanosecs )1.17 {1.18 - while( gtk_events_pending() )1.19 - gtk_main_iteration();1.20 - update_icount(main_debug);1.21 - return nanosecs;1.22 + gtk_gui_nanos += nanosecs;1.23 + if( gtk_gui_nanos > 10000000 ) { /* About 10/sec */1.24 + gtk_gui_nanos = 0;1.25 + while( gtk_events_pending() )1.26 + gtk_main_iteration();1.27 + update_icount(main_debug);1.28 + return nanosecs;1.29 + }1.30 }1.32 void gtk_gui_update(void) {
.