Crossfire Client, Branches
R11627
|
#include <config.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <unistd.h>
#include <png.h>
#include <gtk/gtk.h>
#include <glade/glade.h>
#include <gdk/gdkx.h>
#include <gdk/gdkkeysyms.h>
#include "client-types.h"
#include "image.h"
#include "main.h"
#include "client.h"
#include "mapdata.h"
#include "gtk2proto.h"
#include "../../pixmaps/crossfiretitle.xpm"
Go to the source code of this file.
Functions | |
void | display_map_doneupdate (int redraw, int notice) |
void | display_map_newmap (void) |
void | display_map_startupdate (void) |
static void | display_mapcell (int ax, int ay, int mx, int my) |
int | display_mapscroll (int dx, int dy) |
void | draw_map (int redraw) |
static void | draw_pixmap (int srcx, int srcy, int dstx, int dsty, int clipx, int clipy, void *mask, void *image, int sizex, int sizey) |
void | draw_splash (void) |
void | drawsmooth (int mx, int my, int layer, int picx, int picy) |
void | gtk_draw_map (int redraw) |
void | map_init (GtkWidget *window_root) |
gboolean | on_drawingarea_map_button_press_event (GtkWidget *widget, GdkEventButton *event, gpointer user_data) |
gboolean | on_drawingarea_map_configure_event (GtkWidget *widget, GdkEventConfigure *event, gpointer user_data) |
gboolean | on_drawingarea_map_expose_event (GtkWidget *widget, GdkEventExpose *event, gpointer user_data) |
void | reset_map (void) |
void | resize_map_window (int x, int y) |
Variables | |
static GdkPixmap * | dark |
static GdkBitmap * | dark1 |
static GdkBitmap * | dark2 |
static GdkBitmap * | dark3 |
GtkWidget * | map_drawing_area |
int | map_image_half_size =DEFAULT_IMAGE_SIZE/2 |
int | map_image_size =DEFAULT_IMAGE_SIZE |
GtkWidget * | map_notebook |
static uint8 | map_updated = 0 |
GdkGC * | mapgc |
PlayerPosition | pl_pos |
const char *const | rcsid_gtk2_map_c |
int | time_map_redraw =0 |
Handles map related code in terms of allocation, insertion of new objects, and actual rendering (although the sdl rendering is in the sdl file
Definition in file map.c.
void display_map_doneupdate | ( | int | redraw, |
int | notice | ||
) |
This is called after the map has been all digested. this should perhaps be removed, and left to being done from from the main event loop.
redraw | If set, force redraw of all tiles. |
notice | If set, another call will follow soon. |
Definition at line 772 of file map.c.
References map_updated.
void display_map_newmap | ( | void | ) |
The player has changed maps, so any info we have (for fog of war) is bogus, so clear out all that old info.
Definition at line 564 of file map.c.
References reset_map().
void display_map_startupdate | ( | void | ) |
This isn't used - it is basically a prequel - we know we got a map command from the server, but have digested it all yet. This can be useful if there is info we know we need to store away or the like before it is destroyed, but there isn't anything like that for the gtk client.
|
static |
ax | |
ay | |
mx | |
my |
Definition at line 372 of file map.c.
References Map::cells, MapCell::cleared, CONFIG_FOGWAR, CONFIG_SMOOTH, dark, dark1, dark2, dark3, MapCell::darkness, draw_pixmap(), drawsmooth(), map_drawing_area, PixmapInfo::map_height, map_image_size, PixmapInfo::map_width, mapdata_bigface(), mapdata_face(), MAXLAYERS, pixmaps, the_map, TRUE, and use_config.
Referenced by gtk_draw_map().
int display_mapscroll | ( | int | dx, |
int | dy | ||
) |
dx | |
dy |
Definition at line 231 of file map.c.
References CFG_DM_SDL, CONFIG_DISPLAYMODE, sdl_mapscroll(), and use_config.
void draw_map | ( | int | redraw | ) |
redraw |
Definition at line 654 of file map.c.
References CFG_DM_OPENGL, CFG_DM_PIXMAP, CFG_DM_SDL, CONFIG_DISPLAYMODE, cpl, draw_splash(), gtk_draw_map(), Player_Struct::input_state, Metaserver_Select, opengl_gen_map(), sdl_gen_map(), and use_config.
Referenced by client_tick(), do_network(), get_metaserver(), on_drawingarea_map_expose_event(), and resize_map_window().
|
static |
srcx | |
srcy | |
dstx | |
dsty | |
clipx | |
clipy | |
mask | |
image | |
sizex | |
sizey |
Definition at line 218 of file map.c.
References map_drawing_area, and mapgc.
Referenced by display_mapcell(), and drawsmooth().
void draw_splash | ( | void | ) |
Simple routine to put the splash icon in the map window. Only supported with non-SDL right now.
Definition at line 620 of file map.c.
References CFG_DM_PIXMAP, CONFIG_DISPLAYMODE, map_drawing_area, mapgc, and use_config.
Referenced by draw_map(), and main().
void drawsmooth | ( | int | mx, |
int | my, | ||
int | layer, | ||
int | picx, | ||
int | picy | ||
) |
Draw anything in adjacent squares that could smooth on given square
mx | |
my | Square to smooth on. You should not call this function to smooth on a 'completely black' square. |
layer | Layer to examine (we smooth only one layer at a time) |
picx | |
picy | Place on the map_drawing_area->window to draw |
Definition at line 251 of file map.c.
References CAN_SMOOTH, Map::cells, draw_pixmap(), MapCellLayer::face, MapCell::heads, map_image_size, pixmaps, MapCell::smooth, PixmapInfo::smooth_face, the_map, Map::x, and Map::y.
void gtk_draw_map | ( | int | redraw | ) |
redraw |
Definition at line 511 of file map.c.
References Map::cells, CONFIG_MAPHEIGHT, CONFIG_MAPWIDTH, display_mapcell(), drawingarea, LOG(), LOG_INFO, map_image_size, map_updated, mapwindow, MapCell::need_resmooth, MapCell::need_update, the_map, time_map_redraw, use_config, Map::x, PlayerPosition::x, Map::y, and PlayerPosition::y.
Referenced by client_tick(), and display_map_doneupdate().
void map_init | ( | GtkWidget * | window_root | ) |
This initializes the stuff we need for the map.
window_root | The client's main playing window. |
Definition at line 103 of file map.c.
References CFG_DM_OPENGL, CFG_DM_PIXMAP, CFG_DM_SDL, CONFIG_DISPLAYMODE, CONFIG_MAPHEIGHT, CONFIG_MAPWIDTH, dark, dark1, dark2, dark3, init_opengl(), init_SDL(), map_drawing_area, map_image_size, map_notebook, mapgc, NDI_BLACK, NDI_WHITE, on_drawingarea_map_button_press_event(), on_drawingarea_map_configure_event(), on_drawingarea_map_expose_event(), root_color, TRUE, and use_config.
Referenced by main().
gboolean on_drawingarea_map_button_press_event | ( | GtkWidget * | widget, |
GdkEventButton * | event, | ||
gpointer | user_data | ||
) |
widget | |
event | |
user_data |
Definition at line 694 of file map.c.
References clear_fire(), CONFIG_MAPHEIGHT, CONFIG_MAPWIDTH, FALSE, fire_dir(), look_at(), map_image_size, move_player(), and use_config.
Referenced by map_init().
gboolean on_drawingarea_map_configure_event | ( | GtkWidget * | widget, |
GdkEventConfigure * | event, | ||
gpointer | user_data | ||
) |
Definition at line 586 of file map.c.
References CONFIG_MAPHEIGHT, CONFIG_MAPWIDTH, cs_print_string(), csocket, FALSE, ClientSocket::fd, map_image_size, MAP_MAX_SIZE, mapdata_set_size(), and use_config.
Referenced by map_init().
gboolean on_drawingarea_map_expose_event | ( | GtkWidget * | widget, |
GdkEventExpose * | event, | ||
gpointer | user_data | ||
) |
widget | |
event | |
user_data |
Definition at line 678 of file map.c.
References draw_map(), FALSE, and TRUE.
Referenced by map_init().
void reset_map | ( | void | ) |
void resize_map_window | ( | int | x, |
int | y | ||
) |
Resize_map_window is a NOOP for the time being - not sure if it will in fact need to do something, since there are scrollbars for the map window now. Note - this is note a window resize request, but rather process the size (in spaces) of the map - is received from server.
Definition at line 575 of file map.c.
References draw_map(), map_drawing_area, and TRUE.
|
static |
Definition at line 73 of file map.c.
Referenced by display_mapcell(), and map_init().
|
static |
Definition at line 72 of file map.c.
Referenced by display_mapcell(), and map_init().
|
static |
Definition at line 72 of file map.c.
Referenced by display_mapcell(), and map_init().
|
static |
Definition at line 72 of file map.c.
Referenced by display_mapcell(), and map_init().
GtkWidget* map_drawing_area |
Definition at line 68 of file map.c.
Referenced by display_mapcell(), draw_pixmap(), draw_splash(), map_init(), and resize_map_window().
int map_image_half_size =DEFAULT_IMAGE_SIZE/2 |
int map_image_size =DEFAULT_IMAGE_SIZE |
Definition at line 70 of file map.c.
Referenced by display_mapcell(), drawsmooth(), gtk_draw_map(), map_init(), on_drawingarea_map_button_press_event(), and on_drawingarea_map_configure_event().
GtkWidget * map_notebook |
main.c - drawing areas for the maps
Definition at line 68 of file map.c.
Referenced by draw_magic_map(), magic_map_flash_pos(), and map_init().
|
static |
Definition at line 57 of file map.c.
Referenced by display_map_doneupdate(), and gtk_draw_map().
GdkGC* mapgc |
Definition at line 69 of file map.c.
Referenced by draw_pixmap(), draw_splash(), and map_init().
PlayerPosition pl_pos |
const char* const rcsid_gtk2_map_c |
int time_map_redraw =0 |
Definition at line 79 of file map.c.
Referenced by gtk_draw_map(), and parse_args().