Freeciv-3.2
Loading...
Searching...
No Matches
Data Structures | Functions | Variables
gui_mouse.c File Reference
#include <SDL3/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 180 of file gui_mouse.c.

◆ draw_mouse_cursor()

void draw_mouse_cursor ( void  )

Draw current cursor.

Definition at line 98 of file gui_mouse.c.

◆ 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 134 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 53 of file gui_mouse.c.

◆ unload_cursors()

void unload_cursors ( void  )

Free all cursors

Definition at line 162 of file gui_mouse.c.

◆ update_mouse_cursor()

void update_mouse_cursor ( enum cursor_type  new_cursor_type)

This function will change the current mouse cursor.

Definition at line 212 of file gui_mouse.c.

Variable Documentation

◆ current_color_cursor

struct color_cursor current_color_cursor

Definition at line 48 of file gui_mouse.c.

◆ disabled_cursor

SDL_Cursor* disabled_cursor = NULL

Definition at line 46 of file gui_mouse.c.

◆ fc_cursors

Definition at line 40 of file gui_mouse.c.

◆ mouse_cursor_changed

bool mouse_cursor_changed = FALSE

Definition at line 43 of file gui_mouse.c.

◆ mouse_cursor_type

enum cursor_type mouse_cursor_type = CURSOR_DEFAULT

Definition at line 42 of file gui_mouse.c.

◆ std_cursor

SDL_Cursor* std_cursor = NULL

Definition at line 45 of file gui_mouse.c.