# HG changeset patch # User nkeynes # Date 1142428643 0 # Node ID cc84a653c78110379712724f3fc219cc331a59ea # Parent 565de331ccec99810b6de49c4e2fe04f1f43f5b0 Limit gui hooks to only every 1/10 second of emulated time --- a/src/gui/gui.c Wed Mar 15 13:16:50 2006 +0000 +++ b/src/gui/gui.c Wed Mar 15 13:17:23 2006 +0000 @@ -1,5 +1,5 @@ /** - * $Id: gui.c,v 1.10 2006-03-14 12:45:53 nkeynes Exp $ + * $Id: gui.c,v 1.11 2006-03-15 13:17:23 nkeynes Exp $ * * Top-level GUI (GTK2) module. * @@ -115,12 +115,18 @@ gtk_gui_update(); } +uint32_t gtk_gui_nanos = 0; + uint32_t gtk_gui_run_slice( uint32_t nanosecs ) { - while( gtk_events_pending() ) - gtk_main_iteration(); - update_icount(main_debug); - return nanosecs; + gtk_gui_nanos += nanosecs; + if( gtk_gui_nanos > 10000000 ) { /* About 10/sec */ + gtk_gui_nanos = 0; + while( gtk_events_pending() ) + gtk_main_iteration(); + update_icount(main_debug); + return nanosecs; + } } void gtk_gui_update(void) {