Split "Establish Embassy".
[freeciv.git] / client / gui-gtk-3.0 / graphics.c
blob590e466063dc157a71705fc9032c1e1495c0fa4f
1 /***********************************************************************
2 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12 ***********************************************************************/
14 #ifdef HAVE_CONFIG_H
15 #include <fc_config.h>
16 #endif
18 #include <stdio.h>
19 #include <stdlib.h>
20 #include <string.h>
22 #include <gtk/gtk.h>
24 /* utility */
25 #include "log.h"
26 #include "mem.h"
27 #include "shared.h"
28 #include "support.h"
30 /* common */
31 #include "game.h"
32 #include "movement.h"
33 #include "unit.h"
34 #include "version.h"
36 /* client */
37 #include "climisc.h"
38 #include "colors.h"
39 #include "mapview_g.h"
40 #include "options.h"
41 #include "tilespec.h"
43 /* client/gui-gtk-3.0 */
44 #include "gui_main.h"
46 #include "graphics.h"
48 struct sprite *intro_gfx_sprite;
50 GdkCursor *fc_cursors[CURSOR_LAST][NUM_CURSOR_FRAMES];
52 /***************************************************************************
53 Returns TRUE to indicate that gtk3-client supports given view type
54 ***************************************************************************/
55 bool is_view_supported(enum ts_type type)
57 switch (type) {
58 case TS_ISOMETRIC:
59 case TS_OVERHEAD:
60 return TRUE;
63 return FALSE;
66 #define COLOR_MOTTO_FACE_R 0x2D
67 #define COLOR_MOTTO_FACE_G 0x71
68 #define COLOR_MOTTO_FACE_B 0xE3
70 /***************************************************************************
71 Load cursor sprites
72 ***************************************************************************/
73 void load_cursors(void)
75 enum cursor_type cursor;
76 GdkDisplay *display = gdk_display_get_default();
77 int frame;
79 for (cursor = 0; cursor < CURSOR_LAST; cursor++) {
80 for (frame = 0; frame < NUM_CURSOR_FRAMES; frame++) {
81 int hot_x, hot_y;
82 struct sprite *sprite
83 = get_cursor_sprite(tileset, cursor, &hot_x, &hot_y, frame);
84 GdkPixbuf *pixbuf = sprite_get_pixbuf(sprite);
86 fc_cursors[cursor][frame] = gdk_cursor_new_from_pixbuf(display, pixbuf,
87 hot_x, hot_y);
88 g_object_unref(G_OBJECT(pixbuf));
93 /***************************************************************************
94 This function is so that packhand.c can be gui-independent, and
95 not have to deal with Sprites itself.
96 ***************************************************************************/
97 void free_intro_radar_sprites(void)
99 if (intro_gfx_sprite) {
100 free_sprite(intro_gfx_sprite);
101 intro_gfx_sprite = NULL;