Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2000:
[Freeciv-Dev] gtk client speedup
Home

[Freeciv-Dev] gtk client speedup

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] gtk client speedup
From: Karl-Ingo Friese <kif@xxxxxxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 20 Jul 2000 12:34:56 +0200
Reply-to: kif@xxxxxxxxxxxxxxxxxxxxxxxxxx

Hello there,

I implemented a short speedup of the gtk client. At the beginning
of each turn, the player dialog is updated once per player, causing
a significant 2-5 second freeze to slower machines. The solution is
the same as already implemented for the message window and report
dialogs, by adding the functions plrdlg_update_delay_on and
plrdlg_update_delay_off to the plrdlg.c file and calling them
at the "handle_before_new_year" / "handle__new_year" events.
Since I did the (few) changes against the 1.11 client, here is a
short text overview instead of a diff-patch.

Have fun,
Ingo

Changes:

--------------------------------------------------------------------
client/include/plrdlg_g.h:
--------------------------------------------------------------------
add

   void plrdlg_update_delay_on(void);
   void plrdlg_update_delay_off(void);

at the beginning.


--------------------------------------------------------------------
client/gui-gtk/plrdlg.c:
--------------------------------------------------------------------
add

   int delay_plrdlg_update=0;

   /******************************************************************
    Turn off updating of player dialog
   *******************************************************************/
   void plrdlg_update_delay_on(void)
   {
     delay_plrdlg_update=1;
   }

   /******************************************************************
    Turn off updating of player dialog
   *******************************************************************/
   void plrdlg_update_delay_off(void)
   {
     delay_plrdlg_update=0;
   }

at the beginning. Change the beginning of the function
"update_players_dialog" from 
   
   if(players_dialog_shell) {

to 

   if(players_dialog_shell && !delay_plrdlg_update) {


--------------------------------------------------------------------
client/packhand.c
--------------------------------------------------------------------
add the line

  plrdlg_update_delay_on();

to the function "handle_before_new_year". Add the lines

  report_update_delay_off();
  update_report_dialogs();

to the function "handle_new_year".

---------------------------------------------------------------------

Thats it.




[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] gtk client speedup, Karl-Ingo Friese <=