Freeciv-3.3
Loading...
Searching...
No Matches
Data Structures | Functions | Variables
zoom.c File Reference
#include "mapview_common.h"
#include "mapview_g.h"
#include "zoom.h"

Go to the source code of this file.

Data Structures

struct  zoom_data
 

Functions

void zoom_set (float new_zoom)
 
void zoom_1_0 (void)
 
void zoom_set_steps (float *steps)
 
void zoom_phase_set (bool individual_tiles)
 
void zoom_step_up (void)
 
void zoom_step_down (void)
 
void zoom_start (float tgt, bool tgt_1_0, float factor, float interval)
 
bool zoom_update (double time_until_next_call)
 

Variables

float map_zoom = 1.0
 
bool zoom_enabled = FALSE
 
float mouse_zoom = 1.0
 
bool zoom_individual_tiles = TRUE
 
static float default_zoom_steps []
 
static floatzoom_steps = default_zoom_steps
 
static struct zoom_data zdata = { FALSE, 0.0, 0.0 }
 

Function Documentation

◆ zoom_1_0()

void zoom_1_0 ( void  )

Set map zoom level to exactly one.

Definition at line 66 of file zoom.c.

Referenced by set_client_page_callback(), zoom_step_down(), zoom_step_up(), and zoom_update().

◆ zoom_phase_set()

void zoom_phase_set ( bool  individual_tiles)

Set time zooming takes place. Default is to zoom individual tiles. Gui needs to implement alternatives themselves.

Definition at line 93 of file zoom.c.

Referenced by ui_init().

◆ zoom_set()

void zoom_set ( float  new_zoom)

Set map zoom level.

Definition at line 49 of file zoom.c.

Referenced by set_client_page_callback(), zoom_step_down(), zoom_step_up(), and zoom_update().

◆ zoom_set_steps()

void zoom_set_steps ( float steps)

Set list of zoom steps that the system uses. The list is not copied - caller is expected to maintain it. First and last value must be -1.0

Definition at line 80 of file zoom.c.

Referenced by ui_init().

◆ zoom_start()

void zoom_start ( float  tgt,
bool  tgt_1_0,
float  factor,
float  interval 
)

Start zoom animation.

Definition at line 156 of file zoom.c.

◆ zoom_step_down()

void zoom_step_down ( void  )

Zoom level one step down

Definition at line 130 of file zoom.c.

Referenced by key_press_map_canvas(), and key_press_map_canvas().

◆ zoom_step_up()

void zoom_step_up ( void  )

Zoom level one step up

Definition at line 106 of file zoom.c.

Referenced by key_press_map_canvas(), and key_press_map_canvas().

◆ zoom_update()

bool zoom_update ( double  time_until_next_call)

Next step from the active zoom.

Definition at line 172 of file zoom.c.

Referenced by real_timer_callback().

Variable Documentation

◆ default_zoom_steps

float default_zoom_steps[]
static
Initial value:
= {
-1.0, 1.0, 2.0, -1.0
}

Definition at line 31 of file zoom.c.

Referenced by zoom_set_steps().

◆ map_zoom

float map_zoom = 1.0

◆ mouse_zoom

float mouse_zoom = 1.0

◆ zdata

struct zoom_data zdata = { FALSE, 0.0, 0.0 }
static

Referenced by zoom_start(), and zoom_update().

◆ zoom_enabled

bool zoom_enabled = FALSE

Definition at line 26 of file zoom.c.

Referenced by zoom_1_0(), zoom_phase_set(), and zoom_set().

◆ zoom_individual_tiles

bool zoom_individual_tiles = TRUE

Definition at line 29 of file zoom.c.

Referenced by zoom_phase_set(), and zoom_set().

◆ zoom_steps

float* zoom_steps = default_zoom_steps
static

Definition at line 35 of file zoom.c.

Referenced by zoom_set_steps(), zoom_step_down(), and zoom_step_up().