Freeciv-3.3
|
#include <math.h>
#include "log.h"
#include "client_main.h"
#include "climap.h"
#include "control.h"
#include "mapview_g.h"
#include "options.h"
#include "zoom.h"
#include "overview_common.h"
Go to the source code of this file.
Functions | |
static void | gui_to_natural_pos (const struct tileset *t, double *ntl_x, double *ntl_y, int gui_x, int gui_y) |
static void | gui_to_overview_pos (const struct tileset *t, int *ovr_x, int *ovr_y, int gui_x, int gui_y) |
static struct color * | overview_tile_color (struct tile *ptile) |
void | refresh_overview_from_canvas (void) |
static void | redraw_overview (void) |
static void | dirty_overview (void) |
void | flush_dirty_overview (void) |
static double | wrap_double (double value, double wrap) |
void | center_tile_overviewcanvas (void) |
void | map_to_overview_pos (int *overview_x, int *overview_y, int map_x, int map_y) |
void | overview_to_map_pos (int *map_x, int *map_y, int overview_x, int overview_y) |
void | refresh_overview_canvas (void) |
static void | put_overview_tile_area (struct canvas *pcanvas, struct tile *ptile, int x, int y, int w, int h) |
void | overview_update_tile (struct tile *ptile) |
void | calculate_overview_dimensions (void) |
void | overview_free (void) |
void | overview_redraw_callback (struct option *option) |
Variables | |
int | OVERVIEW_TILE_SIZE = 2 |
static bool | overview_dirty = FALSE |
Called if the map size is know or changes.
Definition at line 450 of file overview_common.c.
Referenced by handle_map_info().
Center the overview around the mapview.
Definition at line 287 of file overview_common.c.
Referenced by base_set_mapview_origin(), and map_canvas_resized().
Mark the overview as "dirty" so that it will be redrawn soon.
Definition at line 253 of file overview_common.c.
Referenced by overview_update_tile().
Redraw the overview if it is "dirty".
Definition at line 261 of file overview_common.c.
Referenced by unqueue_mapview_updates().
|
static |
Translate from gui to natural coordinate systems. This provides natural coordinates as a floating-point value so there is no loss of information in the resulting values.
Definition at line 56 of file overview_common.c.
Referenced by center_tile_overviewcanvas(), and gui_to_overview_pos().
|
static |
Translate from gui to overview coordinate systems.
Definition at line 84 of file overview_common.c.
Referenced by center_tile_overviewcanvas(), and redraw_overview().
Finds the overview (canvas) coordinates for a given map position.
Definition at line 324 of file overview_common.c.
Free overview resources.
Definition at line 511 of file overview_common.c.
Referenced by client_exit().
Callback to be called when an overview option is changed.
Definition at line 524 of file overview_common.c.
Return color for overview map tile.
Definition at line 118 of file overview_common.c.
Referenced by put_overview_tile_area().
Finds the map coordinates for a given overview (canvas) position.
Definition at line 358 of file overview_common.c.
Referenced by butt_down_overviewcanvas(), left_butt_down_overviewcanvas(), minimap_window_callback(), minimap_view::mousePressEvent(), overview_update_line(), and right_butt_down_overviewcanvas().
Redraw the given map position in the overview canvas.
Definition at line 411 of file overview_common.c.
Referenced by refresh_overview_canvas(), and unqueue_mapview_updates().
|
static |
Draws the color for this tile onto the given rectangle of the canvas.
This is just a simple helper function for overview_update_tile, since sometimes a tile may cover more than one rectangle.
Definition at line 394 of file overview_common.c.
Referenced by overview_update_tile().
Copies the overview image from the backing store to the window and draws the viewrect on top of it.
Definition at line 201 of file overview_common.c.
Referenced by center_tile_overviewcanvas(), flush_dirty_overview(), and refresh_overview_canvas().
Redraw the entire backing store for the overview minimap.
Definition at line 377 of file overview_common.c.
Referenced by calculate_overview_dimensions(), overview_redraw_callback(), request_toggle_fog_of_war(), set_client_state(), and unqueue_mapview_updates().
Copies the current centred image + viewrect unchanged to the client's overview window (for expose events etc).
Definition at line 185 of file overview_common.c.
Referenced by redraw_overview().
Equivalent to FC_WRAP, but it works for doubles.
Definition at line 273 of file overview_common.c.
Referenced by center_tile_overviewcanvas().
Definition at line 49 of file overview_common.c.
Referenced by dirty_overview(), flush_dirty_overview(), and redraw_overview().
int OVERVIEW_TILE_SIZE = 2 |
Definition at line 33 of file overview_common.c.
Referenced by calculate_overview_dimensions(), get_overview_area_dimensions(), gui_to_overview(), gui_to_overview_pos(), map_to_overview_pos(), overview_to_map_pos(), overview_update_tile(), and redraw_overview().