Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2005:
[Freeciv-Dev] Re: (PR#12557) RFC: new files sprite.c and canvas.c
Home

[Freeciv-Dev] Re: (PR#12557) RFC: new files sprite.c and canvas.c

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] Re: (PR#12557) RFC: new files sprite.c and canvas.c
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 21 Mar 2005 15:27:41 -0800
Reply-to: bugs@xxxxxxxxxxx

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

Jason Short wrote:
> <URL: http://bugs.freeciv.org/Ticket/Display.html?id=12557 >
> 
> To help in modularizing the code, I'd like to make two new GUI files: 
> sprite.c and canvas.c.  Also we'll have sprite.h, canvas.h, sprite_g.h, 
> and canvas_g.h.  These will naturally include the sprite and canvas 
> code, respectively (most of which is now in graphics.c and mapview.c, 
> some in gui_main.c).
> 
> Any objections to this?  It shouldn't be intrusive on any of the users.

This patch makes the base change.

* New files canvas_g.h and sprite_g.h.
* Some slightly changed includes.
* New gui-stub files canvas.[ch] and sprite.[ch].

Aside from the bootstrap bits and a couple of added comments, it's all 
copy-and-paste.  I only updated gui-stub; the other clients can be 
updated later.

-jason

? diff
Index: client/mapview_common.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/mapview_common.h,v
retrieving revision 1.106
diff -u -r1.106 mapview_common.h
--- client/mapview_common.h     11 Mar 2005 17:11:26 -0000      1.106
+++ client/mapview_common.h     21 Mar 2005 23:26:06 -0000
@@ -55,12 +55,6 @@
 extern struct view mapview;
 extern struct overview overview;
 
-enum client_font {
-  FONT_CITY_NAME,
-  FONT_CITY_PROD,
-  FONT_COUNT
-};
-
 /* HACK: Callers can set this to FALSE to disable sliding.  It should be
  * reenabled afterwards. */
 extern bool can_slide;
Index: client/gui-stub/Makefile.am
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-stub/Makefile.am,v
retrieving revision 1.6
diff -u -r1.6 Makefile.am
--- client/gui-stub/Makefile.am 20 Oct 2004 17:38:51 -0000      1.6
+++ client/gui-stub/Makefile.am 21 Mar 2005 23:26:06 -0000
@@ -6,6 +6,8 @@
 ## Above, note -I../../intl instead of -I$(top_srdir)/intl is deliberate.
 
 libguiclient_a_SOURCES = \
+       canvas.c        \
+       canvas.h        \
        chatline.c      \
        chatline.h      \
        citydlg.c       \
@@ -52,5 +54,7 @@
        repodlgs.h      \
        spaceshipdlg.c  \
        spaceshipdlg.h  \
+       sprite.c        \
+       sprite.h        \
        wldlg.c         \
        wldlg.h
Index: client/gui-stub/canvas.c
===================================================================
RCS file: client/gui-stub/canvas.c
diff -N client/gui-stub/canvas.c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ client/gui-stub/canvas.c    21 Mar 2005 23:26:06 -0000
@@ -0,0 +1,147 @@
+/********************************************************************** 
+ Freeciv - Copyright (C) 1996-2005 - Freeciv Development Team
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+***********************************************************************/
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "canvas.h"
+
+/****************************************************************************
+  Create a canvas of the given size.
+****************************************************************************/
+struct canvas *canvas_create(int width, int height)
+{
+  /* PORTME */
+  return NULL;
+}
+
+/****************************************************************************
+  Free any resources associated with this canvas and the canvas struct
+  itself.
+****************************************************************************/
+void canvas_free(struct canvas *store)
+{
+  /* PORTME */
+}
+
+/****************************************************************************
+  Copies an area from the source canvas to the destination canvas.
+****************************************************************************/
+void canvas_copy(struct canvas *dest, struct canvas *src,
+                    int src_x, int src_y, int dest_x, int dest_y, int width,
+                    int height)
+{
+  /* PORTME */
+}
+
+/****************************************************************************
+  Draw some or all of a sprite onto the mapview or citydialog canvas.
+****************************************************************************/
+void canvas_put_sprite(struct canvas *pcanvas,
+                   int canvas_x, int canvas_y,
+                   struct Sprite *sprite,
+                   int offset_x, int offset_y, int width, int height)
+{
+  /* PORTME */
+}
+
+/****************************************************************************
+  Draw a full sprite onto the mapview or citydialog canvas.
+****************************************************************************/
+void canvas_put_sprite_full(struct canvas *pcanvas,
+                        int canvas_x, int canvas_y,
+                        struct Sprite *sprite)
+{
+  /* PORTME */
+}
+
+/****************************************************************************
+  Draw a full sprite onto the canvas.  If "fog" is specified draw it with
+  fog.
+****************************************************************************/
+void canvas_put_sprite_fogged(struct canvas *pcanvas,
+                             int canvas_x, int canvas_y,
+                             struct Sprite *psprite,
+                             bool fog, int fog_x, int fog_y)
+{
+  /* PORTME */
+}
+
+/****************************************************************************
+  Draw a filled-in colored rectangle onto the mapview or citydialog canvas.
+****************************************************************************/
+void canvas_put_rectangle(struct canvas *pcanvas,
+                      enum color_std color,
+                      int canvas_x, int canvas_y, int width, int height)
+{
+  /* PORTME */
+}
+
+/****************************************************************************
+  Fill the area covered by the sprite with the given color.
+****************************************************************************/
+void canvas_fill_sprite_area(struct canvas *pcanvas,
+                            struct Sprite *psprite, enum color_std color,
+                            int canvas_x, int canvas_y)
+{
+  /* PORTME */
+}
+
+/****************************************************************************
+  Fill the area covered by the sprite with the given color.
+****************************************************************************/
+void canvas_fog_sprite_area(struct canvas *pcanvas, struct Sprite *psprite,
+                           int canvas_x, int canvas_y)
+{
+  /* PORTME */
+}
+
+/****************************************************************************
+  Draw a 1-pixel-width colored line onto the mapview or citydialog canvas.
+****************************************************************************/
+void canvas_put_line(struct canvas *pcanvas, enum color_std color,
+                 enum line_type ltype, int start_x, int start_y,
+                 int dx, int dy)
+{
+  /* PORTME */
+}
+
+/****************************************************************************
+  Return the size of the given text in the given font.  This size should
+  include the ascent and descent of the text.  Either of width or height
+  may be NULL in which case those values simply shouldn't be filled out.
+****************************************************************************/
+void get_text_size(int *width, int *height,
+                  enum client_font font, const char *text)
+{
+  /* PORTME */
+  if (width) {
+    *width = 0;
+  }
+  if (height) {
+    *height = 0;
+  }
+}
+
+/****************************************************************************
+  Draw the text onto the canvas in the given color and font.  The canvas
+  position does not account for the ascent of the text; this function must
+  take care of this manually.  The text will not be NULL but may be empty.
+****************************************************************************/
+void canvas_put_text(struct canvas *pcanvas, int canvas_x, int canvas_y,
+                    enum client_font font, enum color_std color,
+                    const char *text)
+{
+  /* PORTME */
+}
Index: client/gui-stub/canvas.h
===================================================================
RCS file: client/gui-stub/canvas.h
diff -N client/gui-stub/canvas.h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ client/gui-stub/canvas.h    21 Mar 2005 23:26:06 -0000
@@ -0,0 +1,20 @@
+/********************************************************************** 
+ Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+***********************************************************************/
+
+#ifndef FC__CANVAS_H
+#define FC__CANVAS_H
+
+#include "canvas_g.h"
+
+
+#endif                         /* FC__CANVAS_H */
Index: client/gui-stub/graphics.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-stub/graphics.c,v
retrieving revision 1.15
diff -u -r1.15 graphics.c
--- client/gui-stub/graphics.c  11 Mar 2005 17:11:27 -0000      1.15
+++ client/gui-stub/graphics.c  21 Mar 2005 23:26:06 -0000
@@ -75,79 +75,3 @@
     radar_gfx_sprite = NULL;
   }
 }
-
-/****************************************************************************
-  Return a NULL-terminated, permanently allocated array of possible
-  graphics types extensions.  Extensions listed first will be checked
-  first.
-****************************************************************************/
-const char **gfx_fileextensions(void)
-{
-  /* PORTME */
-
-  /* hack to allow stub to run */
-  static const char *ext[] = {
-    "png",     /* png should be the default. */
-    /* ...etc... */
-    NULL
-  };
-
-  return ext;
-}
-
-/****************************************************************************
-  Load the given graphics file into a sprite.  This function loads an
-  entire image file, which may later be broken up into individual sprites
-  with crop_sprite.
-****************************************************************************/
-struct Sprite *load_gfxfile(const char *filename)
-{
-  /* PORTME */
-  return NULL;
-}
-
-/****************************************************************************
-  Create a new sprite by cropping and taking only the given portion of
-  the image.
-
-  source gives the sprite that is to be cropped.
-
-  x,y, width, height gives the rectangle to be cropped.  The pixel at
-  position of the source sprite will be at (0,0) in the new sprite, and
-  the new sprite will have dimensions (width, height).
-
-  mask gives an additional mask to be used for clipping the new sprite.
-
-  mask_offset_x, mask_offset_y is the offset of the mask relative to the
-  origin of the source image.  The pixel at (mask_offset_x,mask_offset_y)
-  in the mask image will be used to clip pixel (0,0) in the source image
-  which is pixel (-x,-y) in the new image.
-****************************************************************************/
-struct Sprite *crop_sprite(struct Sprite *source,
-                          int x, int y, int width, int height,
-                          struct Sprite *mask,
-                          int mask_offset_x, int mask_offset_y)
-{
-  /* PORTME */
-  return NULL;
-}
-
-/****************************************************************************
-  Find the dimensions of the sprite.
-****************************************************************************/
-void get_sprite_dimensions(struct Sprite *sprite, int *width, int *height)
-{
-  /* PORTME */
-#if 0
-  *width = sprite->width;
-  *height = sprite->height;
-#endif
-}
-
-/****************************************************************************
-  Free a sprite and all associated image data.
-****************************************************************************/
-void free_sprite(struct Sprite *s)
-{
-  /* PORTME */
-}
Index: client/gui-stub/mapview.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-stub/mapview.c,v
retrieving revision 1.51
diff -u -r1.51 mapview.c
--- client/gui-stub/mapview.c   11 Mar 2005 07:46:01 -0000      1.51
+++ client/gui-stub/mapview.c   21 Mar 2005 23:26:06 -0000
@@ -122,135 +122,6 @@
 }
 
 /****************************************************************************
-  Return the size of the given text in the given font.  This size should
-  include the ascent and descent of the text.  Either of width or height
-  may be NULL in which case those values simply shouldn't be filled out.
-****************************************************************************/
-void get_text_size(int *width, int *height,
-                  enum client_font font, const char *text)
-{
-  /* PORTME */
-  if (width) {
-    *width = 0;
-  }
-  if (height) {
-    *height = 0;
-  }
-}
-
-/****************************************************************************
-  Draw the text onto the canvas in the given color and font.  The canvas
-  position does not account for the ascent of the text; this function must
-  take care of this manually.  The text will not be NULL but may be empty.
-****************************************************************************/
-void canvas_put_text(struct canvas *pcanvas, int canvas_x, int canvas_y,
-                    enum client_font font, enum color_std color,
-                    const char *text)
-{
-  /* PORTME */
-}
-
-/****************************************************************************
-  Create a canvas of the given size.
-****************************************************************************/
-struct canvas *canvas_create(int width, int height)
-{
-  /* PORTME */
-  return NULL;
-}
-
-/****************************************************************************
-  Free any resources associated with this canvas and the canvas struct
-  itself.
-****************************************************************************/
-void canvas_free(struct canvas *store)
-{
-  /* PORTME */
-}
-
-/****************************************************************************
-  Draw some or all of a sprite onto the mapview or citydialog canvas.
-****************************************************************************/
-void canvas_put_sprite(struct canvas *pcanvas,
-                   int canvas_x, int canvas_y,
-                   struct Sprite *sprite,
-                   int offset_x, int offset_y, int width, int height)
-{
-  /* PORTME */
-}
-
-/****************************************************************************
-  Draw a full sprite onto the mapview or citydialog canvas.
-****************************************************************************/
-void canvas_put_sprite_full(struct canvas *pcanvas,
-                        int canvas_x, int canvas_y,
-                        struct Sprite *sprite)
-{
-  /* PORTME */
-}
-
-/****************************************************************************
-  Draw a full sprite onto the canvas.  If "fog" is specified draw it with
-  fog.
-****************************************************************************/
-void canvas_put_sprite_fogged(struct canvas *pcanvas,
-                             int canvas_x, int canvas_y,
-                             struct Sprite *psprite,
-                             bool fog, int fog_x, int fog_y)
-{
-  /* PORTME */
-}
-
-/****************************************************************************
-  Draw a filled-in colored rectangle onto the mapview or citydialog canvas.
-****************************************************************************/
-void canvas_put_rectangle(struct canvas *pcanvas,
-                      enum color_std color,
-                      int canvas_x, int canvas_y, int width, int height)
-{
-  /* PORTME */
-}
-
-/****************************************************************************
-  Fill the area covered by the sprite with the given color.
-****************************************************************************/
-void canvas_fill_sprite_area(struct canvas *pcanvas,
-                            struct Sprite *psprite, enum color_std color,
-                            int canvas_x, int canvas_y)
-{
-  /* PORTME */
-}
-
-/****************************************************************************
-  Fill the area covered by the sprite with the given color.
-****************************************************************************/
-void canvas_fog_sprite_area(struct canvas *pcanvas, struct Sprite *psprite,
-                           int canvas_x, int canvas_y)
-{
-  /* PORTME */
-}
-
-/****************************************************************************
-  Draw a 1-pixel-width colored line onto the mapview or citydialog canvas.
-****************************************************************************/
-void canvas_put_line(struct canvas *pcanvas, enum color_std color,
-                 enum line_type ltype, int start_x, int start_y,
-                 int dx, int dy)
-{
-  /* PORTME */
-}
-
-/****************************************************************************
-  Copies an area from the source canvas to the destination canvas.
-****************************************************************************/
-void canvas_copy(struct canvas *dest, struct canvas *src,
-                    int src_x, int src_y, int dest_x, int dest_y, int width,
-                    int height)
-{
-  /* PORTME */
-}
-
-/****************************************************************************
   Return a canvas that is the overview window.
 ****************************************************************************/
 struct canvas *get_overview_window(void)
Index: client/gui-stub/sprite.c
===================================================================
RCS file: client/gui-stub/sprite.c
diff -N client/gui-stub/sprite.c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ client/gui-stub/sprite.c    21 Mar 2005 23:26:06 -0000
@@ -0,0 +1,94 @@
+/********************************************************************** 
+ Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+***********************************************************************/
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "sprite.h"
+
+/****************************************************************************
+  Return a NULL-terminated, permanently allocated array of possible
+  graphics types extensions.  Extensions listed first will be checked
+  first.
+****************************************************************************/
+const char **gfx_fileextensions(void)
+{
+  /* PORTME */
+
+  /* hack to allow stub to run */
+  static const char *ext[] = {
+    "png",     /* png should be the default. */
+    /* ...etc... */
+    NULL
+  };
+
+  return ext;
+}
+
+/****************************************************************************
+  Load the given graphics file into a sprite.  This function loads an
+  entire image file, which may later be broken up into individual sprites
+  with crop_sprite.
+****************************************************************************/
+struct Sprite *load_gfxfile(const char *filename)
+{
+  /* PORTME */
+  return NULL;
+}
+
+/****************************************************************************
+  Create a new sprite by cropping and taking only the given portion of
+  the image.
+
+  source gives the sprite that is to be cropped.
+
+  x,y, width, height gives the rectangle to be cropped.  The pixel at
+  position of the source sprite will be at (0,0) in the new sprite, and
+  the new sprite will have dimensions (width, height).
+
+  mask gives an additional mask to be used for clipping the new sprite.
+
+  mask_offset_x, mask_offset_y is the offset of the mask relative to the
+  origin of the source image.  The pixel at (mask_offset_x,mask_offset_y)
+  in the mask image will be used to clip pixel (0,0) in the source image
+  which is pixel (-x,-y) in the new image.
+****************************************************************************/
+struct Sprite *crop_sprite(struct Sprite *source,
+                          int x, int y, int width, int height,
+                          struct Sprite *mask,
+                          int mask_offset_x, int mask_offset_y)
+{
+  /* PORTME */
+  return NULL;
+}
+
+/****************************************************************************
+  Find the dimensions of the sprite.
+****************************************************************************/
+void get_sprite_dimensions(struct Sprite *sprite, int *width, int *height)
+{
+  /* PORTME */
+#if 0
+  *width = sprite->width;
+  *height = sprite->height;
+#endif
+}
+
+/****************************************************************************
+  Free a sprite and all associated image data.
+****************************************************************************/
+void free_sprite(struct Sprite *s)
+{
+  /* PORTME */
+}
Index: client/gui-stub/sprite.h
===================================================================
RCS file: client/gui-stub/sprite.h
diff -N client/gui-stub/sprite.h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ client/gui-stub/sprite.h    21 Mar 2005 23:26:06 -0000
@@ -0,0 +1,20 @@
+/********************************************************************** 
+ Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+***********************************************************************/
+
+#ifndef FC__SPRITE_H
+#define FC__SPRITE_H
+
+#include "sprite_g.h"
+
+
+#endif                         /* FC__SPRITE_H */
Index: client/include/Makefile.am
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/include/Makefile.am,v
retrieving revision 1.16
diff -u -r1.16 Makefile.am
--- client/include/Makefile.am  16 Mar 2005 19:30:38 -0000      1.16
+++ client/include/Makefile.am  21 Mar 2005 23:26:06 -0000
@@ -1,6 +1,7 @@
 ## Process this file with automake to produce Makefile.in
 
 noinst_HEADERS = \
+       canvas_g.h              \
        chatline_g.h    \
        citydlg_g.h     \
        cityrep_g.h     \
@@ -24,4 +25,5 @@
        ratesdlg_g.h    \
        repodlgs_g.h    \
        spaceshipdlg_g.h        \
+       sprite_g.h              \
        wldlg_g.h
Index: client/include/canvas_g.h
===================================================================
RCS file: client/include/canvas_g.h
diff -N client/include/canvas_g.h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ client/include/canvas_g.h   21 Mar 2005 23:26:06 -0000
@@ -0,0 +1,65 @@
+/********************************************************************** 
+ Freeciv - Copyright (C) 1996-2005 - Freeciv Development Team
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+***********************************************************************/
+#ifndef FC__CANVAS_G_H
+#define FC__CANVAS_G_H
+
+#include "fc_types.h"
+
+#include "colors_g.h"
+#include "sprite_g.h"
+
+struct canvas;
+
+/* Creator and destructor */
+struct canvas *canvas_create(int width, int height);
+void canvas_free(struct canvas *store);
+
+/* Drawing functions */
+void canvas_copy(struct canvas *dest, struct canvas *src,
+                int src_x, int src_y, int dest_x, int dest_y,
+                int width, int height);
+void canvas_put_sprite(struct canvas *pcanvas,
+                      int canvas_x, int canvas_y, struct Sprite *sprite,
+                      int offset_x, int offset_y, int width, int height);
+void canvas_put_sprite_full(struct canvas *pcanvas, 
+                           int canvas_x, int canvas_y,
+                           struct Sprite *sprite);
+void canvas_put_sprite_fogged(struct canvas *pcanvas,
+                             int canvas_x, int canvas_y,
+                             struct Sprite *psprite,
+                             bool fog, int fog_x, int fog_y);
+void canvas_put_rectangle(struct canvas *pcanvas,
+                         enum color_std color,
+                         int canvas_x, int canvas_y, int width, int height);
+void canvas_fill_sprite_area(struct canvas *pcanvas,
+                            struct Sprite *psprite, enum color_std color,
+                            int canvas_x, int canvas_y);
+void canvas_fog_sprite_area(struct canvas *pcanvas, struct Sprite *psprite,
+                           int canvas_x, int canvas_y);
+void canvas_put_line(struct canvas *pcanvas, enum color_std color,
+                    enum line_type ltype, int start_x, int start_y,
+                    int dx, int dy);
+
+/* Text drawing functions */
+enum client_font {
+  FONT_CITY_NAME,
+  FONT_CITY_PROD,
+  FONT_COUNT
+};
+void get_text_size(int *width, int *height,
+                  enum client_font font, const char *text);
+void canvas_put_text(struct canvas *pcanvas, int canvas_x, int canvas_y,
+                    enum client_font font, enum color_std color,
+                    const char *text);
+
+#endif  /* FC__CANVAS_G_H */
Index: client/include/graphics_g.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/include/graphics_g.h,v
retrieving revision 1.10
diff -u -r1.10 graphics_g.h
--- client/include/graphics_g.h 24 Mar 2004 06:18:19 -0000      1.10
+++ client/include/graphics_g.h 21 Mar 2005 23:26:06 -0000
@@ -15,6 +15,8 @@
 
 #include "shared.h"            /* bool type */
 
+#include "sprite_g.h"
+
 bool isometric_view_supported(void);
 bool overhead_view_supported(void);
 
@@ -23,16 +25,4 @@
 
 void free_intro_radar_sprites(void);
 
-struct Sprite;                 /* opaque type, real type is gui-dep */
-
-const char **gfx_fileextensions(void);
-
-struct Sprite *load_gfxfile(const char *filename);
-struct Sprite *crop_sprite(struct Sprite *source,
-                          int x, int y, int width, int height,
-                          struct Sprite *mask,
-                          int mask_offset_x, int mask_offset_y);
-void get_sprite_dimensions(struct Sprite *sprite, int *width, int *height);
-void free_sprite(struct Sprite *s);
-
 #endif  /* FC__GRAPHICS_G_H */
Index: client/include/mapview_g.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/include/mapview_g.h,v
retrieving revision 1.61
diff -u -r1.61 mapview_g.h
--- client/include/mapview_g.h  11 Mar 2005 07:46:01 -0000      1.61
+++ client/include/mapview_g.h  21 Mar 2005 23:26:06 -0000
@@ -17,9 +17,9 @@
 
 #include "fc_types.h"
 
-#include "mapview_common.h"
+#include "canvas_g.h"
 
-struct Sprite;
+#include "mapview_common.h"
 
 void update_info_label(void);
 void update_unit_info_label(struct unit *punit);
@@ -30,41 +30,8 @@
                         struct Sprite *flake, struct Sprite *gov);
 
 void map_size_changed(void);
-struct canvas *canvas_create(int width, int height);
-void canvas_free(struct canvas *store);
 struct canvas *get_overview_window(void);
 
-void get_text_size(int *width, int *height,
-                  enum client_font font, const char *text);
-
-void canvas_put_text(struct canvas *pcanvas, int canvas_x, int canvas_y,
-                    enum client_font font, enum color_std color,
-                    const char *text);
-void canvas_put_sprite(struct canvas *pcanvas,
-                      int canvas_x, int canvas_y, struct Sprite *sprite,
-                      int offset_x, int offset_y, int width, int height);
-void canvas_put_sprite_full(struct canvas *pcanvas, 
-                           int canvas_x, int canvas_y,
-                           struct Sprite *sprite);
-void canvas_put_sprite_fogged(struct canvas *pcanvas,
-                             int canvas_x, int canvas_y,
-                             struct Sprite *psprite,
-                             bool fog, int fog_x, int fog_y);
-void canvas_put_rectangle(struct canvas *pcanvas,
-                         enum color_std color,
-                         int canvas_x, int canvas_y, int width, int height);
-void canvas_fill_sprite_area(struct canvas *pcanvas,
-                            struct Sprite *psprite, enum color_std color,
-                            int canvas_x, int canvas_y);
-void canvas_fog_sprite_area(struct canvas *pcanvas, struct Sprite *psprite,
-                           int canvas_x, int canvas_y);
-void canvas_put_line(struct canvas *pcanvas, enum color_std color,
-                    enum line_type ltype, int start_x, int start_y,
-                    int dx, int dy);
-void canvas_copy(struct canvas *dest, struct canvas *src,
-                int src_x, int src_y, int dest_x, int dest_y,
-                int width, int height);
-
 void flush_mapcanvas(int canvas_x, int canvas_y,
                     int pixel_width, int pixel_height);
 void dirty_rect(int canvas_x, int canvas_y,
Index: client/include/sprite_g.h
===================================================================
RCS file: client/include/sprite_g.h
diff -N client/include/sprite_g.h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ client/include/sprite_g.h   21 Mar 2005 23:26:06 -0000
@@ -0,0 +1,30 @@
+/********************************************************************** 
+ Freeciv - Copyright (C) 1996-2005 - Freeciv Development Team
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+***********************************************************************/
+#ifndef FC__SPRITE_G_H
+#define FC__SPRITE_G_H
+
+#include "shared.h"            /* bool type */
+
+struct Sprite;                 /* opaque type, real type is gui-dep */
+
+const char **gfx_fileextensions(void);
+
+struct Sprite *load_gfxfile(const char *filename);
+struct Sprite *crop_sprite(struct Sprite *source,
+                          int x, int y, int width, int height,
+                          struct Sprite *mask,
+                          int mask_offset_x, int mask_offset_y);
+void get_sprite_dimensions(struct Sprite *sprite, int *width, int *height);
+void free_sprite(struct Sprite *s);
+
+#endif  /* FC__SPRITE_G_H */

[Prev in Thread] Current Thread [Next in Thread]