![]() |
Freeciv21
Develop your civilization from humble roots to a global empire
|
#include <cmath>#include "log.h"#include "client_main.h"#include "climap.h"#include "control.h"#include "mapview_g.h"#include "options.h"#include "overview_common.h"#include <QPainter>#include <QPixmap>#include <qnamespace.h>
Include dependency graph for overview_common.cpp:Go to the source code of this file.
Functions | |
| static void | overview_update_tile (const tile *ptile) |
| Redraw the given map position in the overview canvas. More... | |
| void | gui_to_natural_pos (const struct tileset *t, double *ntl_x, double *ntl_y, int gui_x, int gui_y) |
| Translate from gui to natural coordinate systems. More... | |
| void | gui_to_overview_pos (const struct tileset *t, int *ovr_x, int *ovr_y, int gui_x, int gui_y) |
| Translate from gui to overview coordinate systems. More... | |
| static QColor | overview_tile_color (const tile *ptile) |
| Return color for overview map tile. More... | |
| static void | redraw_overview () |
| Copies the overview image from the backing store to the window and draws the viewrect on top of it. More... | |
| static void | dirty_overview () |
| Mark the overview as "dirty" so that it will be redrawn soon. More... | |
| void | flush_dirty_overview () |
| Redraw the overview if it is "dirty". More... | |
| void | overview_to_map_pos (int *map_x, int *map_y, int overview_x, int overview_y) |
| Finds the map coordinates for a given overview (canvas) position. More... | |
| void | refresh_overview_canvas () |
| Redraw the entire backing store for the overview minimap. More... | |
| static void | put_overview_tile_area (QPixmap *pcanvas, const tile *ptile, int x, int y, int w, int h) |
| Draws the color for this tile onto the given rectangle of the canvas. More... | |
| void | calculate_overview_dimensions () |
| Called if the map size is know or changes. More... | |
| void | overview_init () |
| Allocates overview resources. More... | |
| void | overview_free () |
| Free overview resources. More... | |
| void | overview_redraw_callback (struct option *option) |
| Callback to be called when an overview option is changed. More... | |
Variables | |
| int | OVERVIEW_TILE_SIZE = 2 |
| void calculate_overview_dimensions | ( | ) |
Called if the map size is know or changes.
Definition at line 357 of file overview_common.cpp.
Referenced by handle_map_info().
|
static |
Mark the overview as "dirty" so that it will be redrawn soon.
Definition at line 244 of file overview_common.cpp.
Referenced by overview_update_tile().
| void flush_dirty_overview | ( | ) |
Redraw the overview if it is "dirty".
This module contains various general - mostly highlevel - functions used throughout the client.
Definition at line 249 of file overview_common.cpp.
Referenced by client_remove_unit(), decrease_unit_hp_smooth(), do_move_unit(), handle_unit_bombard_info(), map_canvas_resized(), and unit_focus_set().
| void gui_to_natural_pos | ( | const struct tileset * | t, |
| double * | ntl_x, | ||
| double * | ntl_y, | ||
| int | gui_x, | ||
| int | gui_y | ||
| ) |
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 64 of file overview_common.cpp.
Referenced by gui_to_overview_pos().
| void gui_to_overview_pos | ( | const struct tileset * | t, |
| int * | ovr_x, | ||
| int * | ovr_y, | ||
| int | gui_x, | ||
| int | gui_y | ||
| ) |
Translate from gui to overview coordinate systems.
Definition at line 91 of file overview_common.cpp.
Referenced by redraw_overview().
| void overview_free | ( | ) |
Free overview resources.
Definition at line 445 of file overview_common.cpp.
Referenced by client_exit().
| void overview_init | ( | ) |
Allocates overview resources.
Definition at line 434 of file overview_common.cpp.
Referenced by init_mapcanvas_and_overview().
| void overview_redraw_callback | ( | struct option * | option | ) |
Callback to be called when an overview option is changed.
Definition at line 459 of file overview_common.cpp.
Referenced by init_client_options().
|
static |
Return color for overview map tile.
Definition at line 125 of file overview_common.cpp.
Referenced by put_overview_tile_area().
| void overview_to_map_pos | ( | int * | map_x, |
| int * | map_y, | ||
| int | overview_x, | ||
| int | overview_y | ||
| ) |
Finds the map coordinates for a given overview (canvas) position.
Definition at line 261 of file overview_common.cpp.
Referenced by minimap_view::mousePressEvent().
|
static |
Redraw the given map position in the overview canvas.
Definition at line 312 of file overview_common.cpp.
Referenced by refresh_overview_canvas().
|
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 297 of file overview_common.cpp.
Referenced by overview_update_tile().
|
static |
Copies the overview image from the backing store to the window and draws the viewrect on top of it.
Definition at line 192 of file overview_common.cpp.
Referenced by flush_dirty_overview(), and refresh_overview_canvas().
| void refresh_overview_canvas | ( | ) |
Redraw the entire backing store for the overview minimap.
Definition at line 281 of file overview_common.cpp.
Referenced by calculate_overview_dimensions(), client_state(), overview_redraw_callback(), and minimap_panel::setup_minimap_menu().
| int OVERVIEW_TILE_SIZE = 2 |
Definition at line 31 of file overview_common.cpp.
Referenced by calculate_overview_dimensions(), minimap_view::draw_viewport(), gui_to_overview_pos(), overview_to_map_pos(), overview_update_tile(), and redraw_overview().