diff -Nurd -X clean/diff_ignore clean/client/fc_gtk.c work/client/fc_gtk.c --- clean/client/fc_gtk.c Thu Jan 1 01:00:00 1970 +++ work/client/fc_gtk.c Fri Dec 13 17:30:35 2002 @@ -0,0 +1,43 @@ + +#include "log.h" +#include "timing.h" + +static bool trace_enabled = FALSE; +static int calls, pixels; +static struct timer *t = NULL; +static double sec; + +void fc_gdk_draw_pixmap(GdkDrawable * drawable, GdkGC * gc, GdkDrawable * src, + gint xsrc, gint ysrc, gint xdest, gint ydest, + gint width, gint height) +{ + if (trace_enabled) { + calls++; + pixels += width * height; + //freelog(LOG_NORMAL, "%d x %d", width, height); + t = new_timer_start(TIMER_USER, TIMER_ACTIVE); + } +#undef gdk_draw_pixmap + gdk_draw_pixmap(drawable, gc, src, xsrc, ysrc, xdest, ydest, width, + height); +#define gdk_draw_pixmap fc_gdk_draw_pixmap + + if (trace_enabled) { + sec += read_timer_seconds_free(t); + } +} + +void trace_on(void) +{ + trace_enabled = TRUE; + calls = 0; + pixels = 0; + sec = 0.0; +} + +void trace_off(void) +{ + trace_enabled = FALSE; + freelog(LOG_NORMAL, "%d calls with %d pixels total; time=%fms", calls, + pixels, 1000.0 * sec); +} diff -Nurd -X clean/diff_ignore clean/client/fc_gtk.h work/client/fc_gtk.h --- clean/client/fc_gtk.h Thu Jan 1 01:00:00 1970 +++ work/client/fc_gtk.h Fri Dec 13 15:04:41 2002 @@ -0,0 +1,10 @@ + +#include + +#define gdk_draw_pixmap fc_gdk_draw_pixmap + +void fc_gdk_draw_pixmap(GdkDrawable * drawable, GdkGC * gc, GdkDrawable * src, + gint xsrc, gint ysrc, gint xdest, gint ydest, + gint width, gint height); +void trace_on(void); +void trace_off(void); diff -Nurd -X clean/diff_ignore clean/client/gui-gtk/chatline.c work/client/gui-gtk/chatline.c --- clean/client/gui-gtk/chatline.c Fri Dec 13 17:34:47 2002 +++ work/client/gui-gtk/chatline.c Fri Dec 13 15:01:58 2002 @@ -106,3 +106,5 @@ gtk_text_insert(GTK_TEXT(main_message_area), NULL, NULL, NULL, text, -1); gtk_text_thaw(GTK_TEXT(main_message_area)); } + +#include "fc_gtk.c" diff -Nurd -X clean/diff_ignore clean/client/gui-gtk/chatline.h work/client/gui-gtk/chatline.h --- clean/client/gui-gtk/chatline.h Fri Dec 13 17:34:47 2002 +++ work/client/gui-gtk/chatline.h Fri Dec 13 14:55:18 2002 @@ -13,7 +13,7 @@ #ifndef FC__CHATLINE_H #define FC__CHATLINE_H -#include +#include "fc_gtk.h" #include "chatline_g.h" diff -Nurd -X clean/diff_ignore clean/client/gui-gtk/citydlg.c work/client/gui-gtk/citydlg.c --- clean/client/gui-gtk/citydlg.c Fri Dec 13 17:34:47 2002 +++ work/client/gui-gtk/citydlg.c Fri Dec 13 14:55:18 2002 @@ -20,7 +20,7 @@ #include #include -#include +#include "fc_gtk.h" #include #include "city.h" diff -Nurd -X clean/diff_ignore clean/client/gui-gtk/cityrep.c work/client/gui-gtk/cityrep.c --- clean/client/gui-gtk/cityrep.c Fri Dec 13 17:34:47 2002 +++ work/client/gui-gtk/cityrep.c Fri Dec 13 14:55:18 2002 @@ -21,7 +21,7 @@ #include #include -#include +#include "fc_gtk.h" #include #include "city.h" diff -Nurd -X clean/diff_ignore clean/client/gui-gtk/cma_fe.h work/client/gui-gtk/cma_fe.h --- clean/client/gui-gtk/cma_fe.h Fri Dec 13 17:34:47 2002 +++ work/client/gui-gtk/cma_fe.h Fri Dec 13 14:55:18 2002 @@ -14,7 +14,7 @@ #ifndef FC__GTK_CMA_H #define FC__GTK_CMA_H -#include +#include "fc_gtk.h" #include "cma_core.h" diff -Nurd -X clean/diff_ignore clean/client/gui-gtk/colors.c work/client/gui-gtk/colors.c --- clean/client/gui-gtk/colors.c Fri Dec 13 17:34:47 2002 +++ work/client/gui-gtk/colors.c Fri Dec 13 14:55:18 2002 @@ -17,7 +17,7 @@ #include -#include +#include "fc_gtk.h" #include diff -Nurd -X clean/diff_ignore clean/client/gui-gtk/colors.h work/client/gui-gtk/colors.h --- clean/client/gui-gtk/colors.h Fri Dec 13 17:34:47 2002 +++ work/client/gui-gtk/colors.h Fri Dec 13 14:55:18 2002 @@ -13,7 +13,7 @@ #ifndef FC__COLORS_H #define FC__COLORS_H -#include +#include "fc_gtk.h" #include "colors_g.h" diff -Nurd -X clean/diff_ignore clean/client/gui-gtk/connectdlg.c work/client/gui-gtk/connectdlg.c --- clean/client/gui-gtk/connectdlg.c Fri Dec 13 17:34:47 2002 +++ work/client/gui-gtk/connectdlg.c Fri Dec 13 14:55:18 2002 @@ -19,7 +19,7 @@ #include #include -#include +#include "fc_gtk.h" #include "fcintl.h" #include "log.h" diff -Nurd -X clean/diff_ignore clean/client/gui-gtk/dialogs.c work/client/gui-gtk/dialogs.c --- clean/client/gui-gtk/dialogs.c Fri Dec 13 17:34:47 2002 +++ work/client/gui-gtk/dialogs.c Fri Dec 13 14:55:18 2002 @@ -21,7 +21,7 @@ #include #include -#include +#include "fc_gtk.h" #include #include "fcintl.h" diff -Nurd -X clean/diff_ignore clean/client/gui-gtk/dialogs.h work/client/gui-gtk/dialogs.h --- clean/client/gui-gtk/dialogs.h Fri Dec 13 17:34:47 2002 +++ work/client/gui-gtk/dialogs.h Fri Dec 13 14:55:18 2002 @@ -13,7 +13,7 @@ #ifndef FC__DIALOGS_H #define FC__DIALOGS_H -#include +#include "fc_gtk.h" #include "dialogs_g.h" diff -Nurd -X clean/diff_ignore clean/client/gui-gtk/diplodlg.c work/client/gui-gtk/diplodlg.c --- clean/client/gui-gtk/diplodlg.c Fri Dec 13 17:34:47 2002 +++ work/client/gui-gtk/diplodlg.c Fri Dec 13 14:55:17 2002 @@ -18,7 +18,7 @@ #include #include -#include +#include "fc_gtk.h" #include "fcintl.h" #include "game.h" diff -Nurd -X clean/diff_ignore clean/client/gui-gtk/diplodlg.h work/client/gui-gtk/diplodlg.h --- clean/client/gui-gtk/diplodlg.h Fri Dec 13 17:34:47 2002 +++ work/client/gui-gtk/diplodlg.h Fri Dec 13 14:55:17 2002 @@ -13,7 +13,7 @@ #ifndef FC__DIPLODLG_H #define FC__DIPLODLG_H -#include +#include "fc_gtk.h" #include "diplodlg_g.h" diff -Nurd -X clean/diff_ignore clean/client/gui-gtk/finddlg.c work/client/gui-gtk/finddlg.c --- clean/client/gui-gtk/finddlg.c Fri Dec 13 17:34:47 2002 +++ work/client/gui-gtk/finddlg.c Fri Dec 13 14:55:17 2002 @@ -19,7 +19,7 @@ #include #include -#include +#include "fc_gtk.h" #include #include "fcintl.h" diff -Nurd -X clean/diff_ignore clean/client/gui-gtk/gamedlgs.c work/client/gui-gtk/gamedlgs.c --- clean/client/gui-gtk/gamedlgs.c Fri Dec 13 17:34:47 2002 +++ work/client/gui-gtk/gamedlgs.c Fri Dec 13 14:55:17 2002 @@ -19,7 +19,7 @@ #include #include -#include +#include "fc_gtk.h" #include #include "events.h" diff -Nurd -X clean/diff_ignore clean/client/gui-gtk/gotodlg.c work/client/gui-gtk/gotodlg.c --- clean/client/gui-gtk/gotodlg.c Fri Dec 13 17:34:47 2002 +++ work/client/gui-gtk/gotodlg.c Fri Dec 13 14:55:17 2002 @@ -19,7 +19,7 @@ #include #include -#include +#include "fc_gtk.h" #include #include "fcintl.h" diff -Nurd -X clean/diff_ignore clean/client/gui-gtk/graphics.c work/client/gui-gtk/graphics.c --- clean/client/gui-gtk/graphics.c Fri Dec 13 17:34:47 2002 +++ work/client/gui-gtk/graphics.c Fri Dec 13 14:55:17 2002 @@ -19,7 +19,7 @@ #include #include -#include +#include "fc_gtk.h" #include #include "gtkpixcomm.h" diff -Nurd -X clean/diff_ignore clean/client/gui-gtk/graphics.h work/client/gui-gtk/graphics.h --- clean/client/gui-gtk/graphics.h Fri Dec 13 17:34:47 2002 +++ work/client/gui-gtk/graphics.h Fri Dec 13 14:55:17 2002 @@ -13,7 +13,7 @@ #ifndef FC__GRAPHICS_H #define FC__GRAPHICS_H -#include +#include "fc_gtk.h" #include "graphics_g.h" diff -Nurd -X clean/diff_ignore clean/client/gui-gtk/gui_main.c work/client/gui-gtk/gui_main.c --- clean/client/gui-gtk/gui_main.c Fri Dec 13 17:34:47 2002 +++ work/client/gui-gtk/gui_main.c Fri Dec 13 14:55:17 2002 @@ -28,7 +28,7 @@ #include #endif -#include +#include "fc_gtk.h" #include #include diff -Nurd -X clean/diff_ignore clean/client/gui-gtk/gui_main.h work/client/gui-gtk/gui_main.h --- clean/client/gui-gtk/gui_main.h Fri Dec 13 17:34:47 2002 +++ work/client/gui-gtk/gui_main.h Fri Dec 13 14:55:17 2002 @@ -13,7 +13,7 @@ #ifndef FC__GUI_MAIN_H #define FC__GUI_MAIN_H -#include +#include "fc_gtk.h" #include "gui_main_g.h" diff -Nurd -X clean/diff_ignore clean/client/gui-gtk/gui_stuff.c work/client/gui-gtk/gui_stuff.c --- clean/client/gui-gtk/gui_stuff.c Fri Dec 13 17:34:47 2002 +++ work/client/gui-gtk/gui_stuff.c Fri Dec 13 14:55:17 2002 @@ -19,7 +19,7 @@ #include #include -#include +#include "fc_gtk.h" #include #include "fcintl.h" diff -Nurd -X clean/diff_ignore clean/client/gui-gtk/gui_stuff.h work/client/gui-gtk/gui_stuff.h --- clean/client/gui-gtk/gui_stuff.h Fri Dec 13 17:34:47 2002 +++ work/client/gui-gtk/gui_stuff.h Fri Dec 13 14:55:17 2002 @@ -13,7 +13,7 @@ #ifndef FC__GUI_STUFF_H #define FC__GUI_STUFF_H -#include +#include "fc_gtk.h" GtkWidget *gtk_accelbutton_new(const gchar *label, GtkAccelGroup *accel); void gtk_set_label(GtkWidget *w, const char *text); diff -Nurd -X clean/diff_ignore clean/client/gui-gtk/happiness.c work/client/gui-gtk/happiness.c --- clean/client/gui-gtk/happiness.c Fri Dec 13 17:34:47 2002 +++ work/client/gui-gtk/happiness.c Fri Dec 13 14:55:17 2002 @@ -15,7 +15,7 @@ #include #endif -#include +#include "fc_gtk.h" #include "city.h" #include "fcintl.h" diff -Nurd -X clean/diff_ignore clean/client/gui-gtk/happiness.h work/client/gui-gtk/happiness.h --- clean/client/gui-gtk/happiness.h Fri Dec 13 17:34:47 2002 +++ work/client/gui-gtk/happiness.h Fri Dec 13 14:55:17 2002 @@ -10,7 +10,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ***********************************************************************/ -#include +#include "fc_gtk.h" #include "citydlg.h" GtkWidget *get_top_happiness_display(struct city *pcity); diff -Nurd -X clean/diff_ignore clean/client/gui-gtk/helpdlg.c work/client/gui-gtk/helpdlg.c --- clean/client/gui-gtk/helpdlg.c Fri Dec 13 17:34:47 2002 +++ work/client/gui-gtk/helpdlg.c Fri Dec 13 14:55:17 2002 @@ -20,7 +20,7 @@ #include #include -#include +#include "fc_gtk.h" #include "gtkpixcomm.h" #include "city.h" diff -Nurd -X clean/diff_ignore clean/client/gui-gtk/inputdlg.c work/client/gui-gtk/inputdlg.c --- clean/client/gui-gtk/inputdlg.c Fri Dec 13 17:34:47 2002 +++ work/client/gui-gtk/inputdlg.c Fri Dec 13 14:55:17 2002 @@ -17,7 +17,7 @@ #include -#include +#include "fc_gtk.h" #include "fcintl.h" diff -Nurd -X clean/diff_ignore clean/client/gui-gtk/inputdlg.h work/client/gui-gtk/inputdlg.h --- clean/client/gui-gtk/inputdlg.h Fri Dec 13 17:34:47 2002 +++ work/client/gui-gtk/inputdlg.h Fri Dec 13 14:55:17 2002 @@ -13,7 +13,7 @@ #ifndef FC__INPUTDLG_H #define FC__INPUTDLG_H -#include +#include "fc_gtk.h" GtkWidget *input_dialog_create(GtkWidget * parent, char *dialogname, char *text, char *postinputtest, diff -Nurd -X clean/diff_ignore clean/client/gui-gtk/inteldlg.c work/client/gui-gtk/inteldlg.c --- clean/client/gui-gtk/inteldlg.c Fri Dec 13 17:34:47 2002 +++ work/client/gui-gtk/inteldlg.c Fri Dec 13 14:55:17 2002 @@ -19,7 +19,7 @@ #include #include -#include +#include "fc_gtk.h" #include "fcintl.h" #include "game.h" diff -Nurd -X clean/diff_ignore clean/client/gui-gtk/mapctrl.c work/client/gui-gtk/mapctrl.c --- clean/client/gui-gtk/mapctrl.c Fri Dec 13 17:34:47 2002 +++ work/client/gui-gtk/mapctrl.c Fri Dec 13 14:55:17 2002 @@ -16,7 +16,7 @@ #endif #include -#include +#include "fc_gtk.h" #include "fcintl.h" #include "game.h" diff -Nurd -X clean/diff_ignore clean/client/gui-gtk/mapctrl.h work/client/gui-gtk/mapctrl.h --- clean/client/gui-gtk/mapctrl.h Fri Dec 13 17:34:47 2002 +++ work/client/gui-gtk/mapctrl.h Fri Dec 13 14:55:17 2002 @@ -13,7 +13,7 @@ #ifndef FC__MAPCTRL_H #define FC__MAPCTRL_H -#include +#include "fc_gtk.h" #include "mapctrl_g.h" diff -Nurd -X clean/diff_ignore clean/client/gui-gtk/mapview.c work/client/gui-gtk/mapview.c --- clean/client/gui-gtk/mapview.c Fri Dec 13 17:34:47 2002 +++ work/client/gui-gtk/mapview.c Fri Dec 13 14:55:17 2002 @@ -22,7 +22,7 @@ #include #endif -#include +#include "fc_gtk.h" #include "fcintl.h" #include "game.h" diff -Nurd -X clean/diff_ignore clean/client/gui-gtk/mapview.h work/client/gui-gtk/mapview.h --- clean/client/gui-gtk/mapview.h Fri Dec 13 17:34:47 2002 +++ work/client/gui-gtk/mapview.h Fri Dec 13 14:55:17 2002 @@ -13,7 +13,7 @@ #ifndef FC__MAPVIEW_H #define FC__MAPVIEW_H -#include +#include "fc_gtk.h" #include "gtkpixcomm.h" diff -Nurd -X clean/diff_ignore clean/client/gui-gtk/menu.c work/client/gui-gtk/menu.c --- clean/client/gui-gtk/menu.c Fri Dec 13 17:34:47 2002 +++ work/client/gui-gtk/menu.c Fri Dec 13 14:55:17 2002 @@ -19,7 +19,7 @@ #include #include -#include +#include "fc_gtk.h" #include "astring.h" #include "fcintl.h" diff -Nurd -X clean/diff_ignore clean/client/gui-gtk/menu.h work/client/gui-gtk/menu.h --- clean/client/gui-gtk/menu.h Fri Dec 13 17:34:47 2002 +++ work/client/gui-gtk/menu.h Fri Dec 13 14:55:17 2002 @@ -13,7 +13,7 @@ #ifndef FC__MENU_H #define FC__MENU_H -#include +#include "fc_gtk.h" #include "menu_g.h" diff -Nurd -X clean/diff_ignore clean/client/gui-gtk/messagedlg.c work/client/gui-gtk/messagedlg.c --- clean/client/gui-gtk/messagedlg.c Fri Dec 13 17:34:47 2002 +++ work/client/gui-gtk/messagedlg.c Fri Dec 13 14:55:17 2002 @@ -15,7 +15,7 @@ #include #endif -#include +#include "fc_gtk.h" #include #include "events.h" diff -Nurd -X clean/diff_ignore clean/client/gui-gtk/messagewin.c work/client/gui-gtk/messagewin.c --- clean/client/gui-gtk/messagewin.c Fri Dec 13 17:34:47 2002 +++ work/client/gui-gtk/messagewin.c Fri Dec 13 14:55:17 2002 @@ -19,7 +19,7 @@ #include #include -#include +#include "fc_gtk.h" #include "events.h" #include "fcintl.h" diff -Nurd -X clean/diff_ignore clean/client/gui-gtk/optiondlg.h work/client/gui-gtk/optiondlg.h --- clean/client/gui-gtk/optiondlg.h Fri Dec 13 17:34:47 2002 +++ work/client/gui-gtk/optiondlg.h Fri Dec 13 14:55:17 2002 @@ -13,7 +13,7 @@ #ifndef FC__OPTIONDLG_H #define FC__OPTIONDLG_H -#include +#include "fc_gtk.h" void popup_option_dialog(void); void toggle_callback(GtkWidget *w, gpointer data); diff -Nurd -X clean/diff_ignore clean/client/gui-gtk/plrdlg.c work/client/gui-gtk/plrdlg.c --- clean/client/gui-gtk/plrdlg.c Fri Dec 13 17:34:47 2002 +++ work/client/gui-gtk/plrdlg.c Fri Dec 13 14:55:17 2002 @@ -20,7 +20,7 @@ #include #include -#include +#include "fc_gtk.h" #include #include "fcintl.h" diff -Nurd -X clean/diff_ignore clean/client/gui-gtk/repodlgs.c work/client/gui-gtk/repodlgs.c --- clean/client/gui-gtk/repodlgs.c Fri Dec 13 17:34:47 2002 +++ work/client/gui-gtk/repodlgs.c Fri Dec 13 14:55:17 2002 @@ -20,7 +20,7 @@ #include #include -#include +#include "fc_gtk.h" #include #include "fcintl.h" diff -Nurd -X clean/diff_ignore clean/client/gui-gtk/resources.c work/client/gui-gtk/resources.c --- clean/client/gui-gtk/resources.c Fri Dec 13 17:34:47 2002 +++ work/client/gui-gtk/resources.c Fri Dec 13 14:55:17 2002 @@ -15,7 +15,7 @@ #include #endif -#include +#include "fc_gtk.h" /************************************************************************** Fallback resources diff -Nurd -X clean/diff_ignore clean/client/gui-gtk/resources.h work/client/gui-gtk/resources.h --- clean/client/gui-gtk/resources.h Fri Dec 13 17:34:47 2002 +++ work/client/gui-gtk/resources.h Fri Dec 13 14:55:17 2002 @@ -13,7 +13,7 @@ #ifndef FC__RESOURCES_H #define FC__RESOURCES_H -#include +#include "fc_gtk.h" extern gchar *fallback_resources; diff -Nurd -X clean/diff_ignore clean/client/gui-gtk/spaceshipdlg.c work/client/gui-gtk/spaceshipdlg.c --- clean/client/gui-gtk/spaceshipdlg.c Fri Dec 13 17:34:47 2002 +++ work/client/gui-gtk/spaceshipdlg.c Fri Dec 13 14:55:17 2002 @@ -18,7 +18,7 @@ #include #include -#include +#include "fc_gtk.h" #include "fcintl.h" #include "game.h" diff -Nurd -X clean/diff_ignore clean/client/gui-gtk/spaceshipdlg.h work/client/gui-gtk/spaceshipdlg.h --- clean/client/gui-gtk/spaceshipdlg.h Fri Dec 13 17:34:47 2002 +++ work/client/gui-gtk/spaceshipdlg.h Fri Dec 13 14:55:17 2002 @@ -13,7 +13,7 @@ #ifndef FC__SPACESHIPDLG_H #define FC__SPACESHIPDLG_H -#include +#include "fc_gtk.h" #include "spaceshipdlg_g.h" diff -Nurd -X clean/diff_ignore clean/client/gui-gtk/wldlg.c work/client/gui-gtk/wldlg.c --- clean/client/gui-gtk/wldlg.c Fri Dec 13 17:34:47 2002 +++ work/client/gui-gtk/wldlg.c Fri Dec 13 14:55:17 2002 @@ -19,7 +19,7 @@ #include #include -#include +#include "fc_gtk.h" #include #include "city.h" diff -Nurd -X clean/diff_ignore clean/client/gui-gtk/wldlg.h work/client/gui-gtk/wldlg.h --- clean/client/gui-gtk/wldlg.h Fri Dec 13 17:34:47 2002 +++ work/client/gui-gtk/wldlg.h Fri Dec 13 14:55:17 2002 @@ -13,7 +13,7 @@ #ifndef FC__WLDLG_H #define FC__WLDLG_H -#include +#include "fc_gtk.h" #include "worklist.h" #include "improvement.h" diff -Nurd -X clean/diff_ignore clean/client/mapview_common.c work/client/mapview_common.c --- clean/client/mapview_common.c Fri Dec 13 17:34:47 2002 +++ work/client/mapview_common.c Fri Dec 13 15:02:58 2002 @@ -27,6 +27,9 @@ #include "mapview_common.h" #include "tilespec.h" +void trace_on(void); +void trace_off(void); + /************************************************************************** Refreshes a single tile on the map canvas. **************************************************************************/ @@ -383,6 +386,8 @@ int map_view_x0, map_view_y0, map_win_width, map_win_height; int map_tile_width, map_tile_height; + trace_on(); + get_mapview_dimensions(&map_view_x0, &map_view_y0, &map_win_width, &map_win_height); map_tile_width = (map_win_width - 1) / NORMAL_TILE_WIDTH + 1; @@ -402,6 +407,7 @@ } show_city_descriptions(); + trace_off(); } /**************************************************************************