Search
lxdream.org :: lxdream :: r109:cc84a653c781
lxdream 0.9.1
released Jun 29
Download Now
changeset109:cc84a653c781
parent108:565de331ccec
child110:83a33da5ed06
authornkeynes
dateWed Mar 15 13:17:23 2006 +0000 (14 years ago)
Limit gui hooks to only every 1/10 second of emulated time
src/gui/gui.c
1.1 --- a/src/gui/gui.c Wed Mar 15 13:16:50 2006 +0000
1.2 +++ b/src/gui/gui.c Wed Mar 15 13:17:23 2006 +0000
1.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.13
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.31
1.32 void gtk_gui_update(void) {
.