Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2004:
[Freeciv-Dev] (PR#11681) [PATCH] Remove load_intro_gfx
Home

[Freeciv-Dev] (PR#11681) [PATCH] Remove load_intro_gfx

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#11681) [PATCH] Remove load_intro_gfx
From: "Vasco Alexandre da Silva Costa" <vasc@xxxxxxxxxxxxxx>
Date: Fri, 24 Dec 2004 15:29:29 -0800
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=11681 >

What the subject says.

Index: client/gui-gtk-2.0/graphics.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/graphics.c,v
retrieving revision 1.29
diff -u -r1.29 graphics.c
--- client/gui-gtk-2.0/graphics.c       16 Dec 2004 00:00:28 -0000      1.29
+++ client/gui-gtk-2.0/graphics.c       24 Dec 2004 23:26:37 -0000
@@ -92,77 +92,6 @@
   gdk_draw_layout(drawable, white_gc, x, y, layout);
 }
 
-/**************************************************************************
-...
-**************************************************************************/
-void load_intro_gfx(void)
-{
-  int tot, y;
-  char s[64];
-  GdkColor face;
-  GdkGC *face_gc;
-  PangoContext *context;
-  PangoLayout *layout;
-  PangoRectangle rect;
-
-  context = gdk_pango_context_get();
-  layout = pango_layout_new(context);
-  pango_layout_set_font_description(layout, main_font);
-
-  /* get colors */
-  face.red  = COLOR_MOTTO_FACE_R<<8;
-  face.green= COLOR_MOTTO_FACE_G<<8;
-  face.blue = COLOR_MOTTO_FACE_B<<8;
-  face_gc = gdk_gc_new(root_window);
-
-  /* Main graphic */
-  intro_gfx_sprite = load_gfxfile(main_intro_filename);
-  tot=intro_gfx_sprite->width;
-
-  pango_layout_set_text(layout, freeciv_motto(), -1);
-  pango_layout_get_pixel_extents(layout, &rect, NULL);
-
-  y = intro_gfx_sprite->height-45;
-
-  gdk_gc_set_rgb_fg_color(face_gc, &face);
-  gdk_draw_layout(intro_gfx_sprite->pixmap, face_gc,
-                 (tot-rect.width) / 2, y, layout);
-  g_object_unref(face_gc);
-
-  /* Minimap graphic */
-  radar_gfx_sprite = load_gfxfile(minimap_intro_filename);
-  tot=radar_gfx_sprite->width;
-
-  my_snprintf(s, sizeof(s), "%d.%d.%d%s",
-             MAJOR_VERSION, MINOR_VERSION,
-             PATCH_VERSION, VERSION_LABEL);
-  pango_layout_set_text(layout, s, -1);
-  pango_layout_get_pixel_extents(layout, &rect, NULL);
-
-  y = radar_gfx_sprite->height - (rect.height + 6);
-
-  gtk_draw_shadowed_string(radar_gfx_sprite->pixmap,
-                       toplevel->style->black_gc,
-                       toplevel->style->white_gc,
-                       (tot - rect.width) / 2, y,
-                       layout);
-
-  pango_layout_set_text(layout, word_version(), -1);
-  pango_layout_get_pixel_extents(layout, &rect, NULL);
-  y-=rect.height+3;
-
-  gtk_draw_shadowed_string(radar_gfx_sprite->pixmap,
-                       toplevel->style->black_gc,
-                       toplevel->style->white_gc,
-                       (tot - rect.width) / 2, y,
-                       layout);
-
-  /* done */
-  g_object_unref(layout);
-  g_object_unref(context);
-  return;
-}
-
 /****************************************************************************
   Create a new sprite by cropping and taking only the given portion of
   the image.
Index: client/gui-gtk-2.0/gui_main.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/gui_main.c,v
retrieving revision 1.99
diff -u -r1.99 gui_main.c
--- client/gui-gtk-2.0/gui_main.c       16 Dec 2004 19:52:34 -0000      1.99
+++ client/gui-gtk-2.0/gui_main.c       24 Dec 2004 23:26:38 -0000
@@ -1177,7 +1177,6 @@
   tilespec_load_tiles();
 
   setup_widgets();
-  load_intro_gfx();
   load_cursors();
 
   genlist_init(&history_list);
Index: client/gui-gtk-2.0/mapview.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/mapview.c,v
retrieving revision 1.149
diff -u -r1.149 mapview.c
--- client/gui-gtk-2.0/mapview.c        16 Dec 2004 00:32:21 -0000      1.149
+++ client/gui-gtk-2.0/mapview.c        24 Dec 2004 23:26:38 -0000
@@ -62,10 +62,6 @@
                                         struct Sprite *ssprite,
                                         bool fog);
 
-/* the intro picture is held in this pixmap, which is scaled to
-   the screen size */
-static SPRITE *scaled_intro_sprite = NULL;
-
 static GtkObject *map_hadj, *map_vadj;
 
 
@@ -342,43 +338,14 @@
   static bool cleared = FALSE;
 
   if (!can_client_change_view()) {
-    if (map_configure || !scaled_intro_sprite) {
-
-      if (!intro_gfx_sprite) {
-        load_intro_gfx();
-      }
-
-      if (scaled_intro_sprite) {
-        free_sprite(scaled_intro_sprite);
-      }
-
-      scaled_intro_sprite = sprite_scale(intro_gfx_sprite,
-                                        w->allocation.width,
-                                        w->allocation.height);
-    }
-
-    if (scaled_intro_sprite) {
-      gdk_draw_drawable(map_canvas->window, civ_gc,
-                       scaled_intro_sprite->pixmap,
-                       ev->area.x, ev->area.y, ev->area.x, ev->area.y,
-                       ev->area.width, ev->area.height);
-      gtk_widget_queue_draw(overview_canvas);
-      cleared = FALSE;
-    } else {
-      if (!cleared) {
-       gtk_widget_queue_draw(w);
-       cleared = TRUE;
-      }
+    if (!cleared) {
+      gtk_widget_queue_draw(w);
+      cleared = TRUE;
     }
     map_center = TRUE;
   }
   else
   {
-    if (scaled_intro_sprite) {
-      free_sprite(scaled_intro_sprite);
-      scaled_intro_sprite = NULL;
-    }
-
     if (map_exists()) { /* do we have a map at all */
       gdk_draw_drawable(map_canvas->window, civ_gc, map_canvas_store,
                        ev->area.x, ev->area.y, ev->area.x, ev->area.y,

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#11681) [PATCH] Remove load_intro_gfx, Vasco Alexandre da Silva Costa <=