Freeciv-3.3
Loading...
Searching...
No Matches
Data Structures | Functions | Variables
gui_mouse.c File Reference
#include <SDL2/SDL.h>
#include "log.h"
#include "tilespec.h"
#include "graphics.h"
#include "mapview.h"
#include "sprite.h"
#include "gui_mouse.h"

Go to the source code of this file.

Data Structures

struct  color_cursor
 

Functions

static SDL_CursorSurfaceToCursor (SDL_Surface *image, int hx, int hy)
 
void draw_mouse_cursor (void)
 
void load_cursors (void)
 
void unload_cursors (void)
 
void animate_mouse_cursor (void)
 
void update_mouse_cursor (enum cursor_type new_cursor_type)
 

Variables

SDL_Cursorfc_cursors [CURSOR_LAST][NUM_CURSOR_FRAMES]
 
enum cursor_type mouse_cursor_type = CURSOR_DEFAULT
 
bool mouse_cursor_changed = FALSE
 
SDL_Cursorstd_cursor = NULL
 
SDL_Cursordisabled_cursor = NULL
 
struct color_cursor current_color_cursor
 

Function Documentation

◆ animate_mouse_cursor()

void animate_mouse_cursor ( void  )

This function is used to animate the mouse cursor.

Definition at line 182 of file gui_mouse.c.

Referenced by gui_event_loop(), and gui_event_loop().

◆ draw_mouse_cursor()

void draw_mouse_cursor ( void  )

Draw current cursor.

Definition at line 100 of file gui_mouse.c.

Referenced by flush_dirty(), gui_event_loop(), gui_event_loop(), and main_mouse_motion_handler().

◆ load_cursors()

void load_cursors ( void  )

Load the cursors (mouse substitute sprites), including a goto cursor, an airdrop cursor, a nuke cursor, and a patrol cursor.

Definition at line 136 of file gui_mouse.c.

◆ SurfaceToCursor()

static SDL_Cursor * SurfaceToCursor ( SDL_Surface image,
int  hx,
int  hy 
)
static

Convert SDL surface to SDL cursor format (code from SDL-dev mailing list)

Definition at line 57 of file gui_mouse.c.

Referenced by load_cursors().

◆ unload_cursors()

void unload_cursors ( void  )

Free all cursors

Definition at line 164 of file gui_mouse.c.

Referenced by ui_main().

◆ update_mouse_cursor()

void update_mouse_cursor ( enum cursor_type  new_cursor_type)

This function will change the current mouse cursor.

Definition at line 214 of file gui_mouse.c.

Variable Documentation

◆ current_color_cursor

struct color_cursor current_color_cursor

Definition at line 52 of file gui_mouse.c.

Referenced by animate_mouse_cursor(), draw_mouse_cursor(), and update_mouse_cursor().

◆ disabled_cursor

SDL_Cursor* disabled_cursor = NULL

Definition at line 50 of file gui_mouse.c.

Referenced by load_cursors(), unload_cursors(), and update_mouse_cursor().

◆ fc_cursors

Definition at line 44 of file gui_mouse.c.

Referenced by animate_mouse_cursor(), load_cursors(), and unload_cursors().

◆ mouse_cursor_changed

bool mouse_cursor_changed = FALSE

Definition at line 47 of file gui_mouse.c.

Referenced by animate_mouse_cursor(), and update_mouse_cursor().

◆ mouse_cursor_type

enum cursor_type mouse_cursor_type = CURSOR_DEFAULT

Definition at line 46 of file gui_mouse.c.

Referenced by animate_mouse_cursor(), control_mouse_cursor(), and update_mouse_cursor().

◆ std_cursor

SDL_Cursor* std_cursor = NULL

Definition at line 49 of file gui_mouse.c.

Referenced by load_cursors(), unload_cursors(), and update_mouse_cursor().