cursor.cpp File Reference

Support for different cursors-shapes. More...

#include "global.hpp"
#include "cursor.hpp"
#include "game_config.hpp"
#include "image.hpp"
#include "preferences_display.hpp"
#include "scoped_resource.hpp"
#include "sdl_utils.hpp"
#include "video.hpp"
#include "SDL.h"
#include <iostream>
#include <vector>

Include dependency graph for cursor.cpp:

Go to the source code of this file.

Namespaces

namespace  cursor

Functions

static bool use_colour_cursors ()
static SDL_Cursor * create_cursor (surface surf)
static SDL_Cursor * get_cursor (cursor::CURSOR_TYPE type)
static void clear_cache ()
void cursor::temporary_use_bw ()
 This function uses temporary the b&w cursors while the display is busy.
void cursor::set (CURSOR_TYPE type=NUM_CURSORS)
 Use the default parameter to reset cursors.
void cursor::set_dragging (bool drag)
CURSOR_TYPE cursor::get ()
void cursor::set_focus (bool focus)
void cursor::draw (surface screen)
void cursor::undraw (surface screen)

Variables

SDL_Cursor * cache [cursor::NUM_CURSORS] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
const std::string bw_images [cursor::NUM_CURSORS] = { "normal.png", "wait.png", "move.png", "attack.png", "select.png", "move_drag.png", "attack_drag.png", "no_cursor.png"}
const std::string colour_images [cursor::NUM_CURSORS] = { "normal.png", "wait.png", "move.png", "attack.png", "select.png", "move_drag.png", "attack_drag.png", ""}
const int shift_x [cursor::NUM_CURSORS] = {0, 0, 0, 0, 0, 2, 3, 0}
const int shift_y [cursor::NUM_CURSORS] = {0, 0, 0, 0, 0, 20, 22, 0}
cursor::CURSOR_TYPE current_cursor = cursor::NORMAL
int cursor_x = -1
int cursor_y = -1
surface cursor_buf = NULL
bool have_focus = true
bool colour_ready = false


Detailed Description

Support for different cursors-shapes.

Definition in file cursor.cpp.


Function Documentation

static void clear_cache (  )  [static]

Definition at line 127 of file cursor.cpp.

References cache, cursor_buf, and cursor::NUM_CURSORS.

Referenced by cursor::manager::~manager().

static SDL_Cursor* create_cursor ( surface  surf  )  [static]

Definition at line 38 of file cursor.cpp.

References a, b, data, g, make_neutral_surface(), and r.

Referenced by get_cursor().

static SDL_Cursor* get_cursor ( cursor::CURSOR_TYPE  type  )  [static]

Definition at line 116 of file cursor.cpp.

References bw_images, cache, create_cursor(), and image::get_image().

Referenced by cursor::set().

static bool use_colour_cursors (  )  [static]

Definition at line 33 of file cursor.cpp.

References game_config::editor, and preferences::use_colour_cursors().

Referenced by cursor::draw(), cursor::set(), and cursor::undraw().


Variable Documentation

const std::string bw_images[cursor::NUM_CURSORS] = { "normal.png", "wait.png", "move.png", "attack.png", "select.png", "move_drag.png", "attack_drag.png", "no_cursor.png"} [static]

Definition at line 98 of file cursor.cpp.

Referenced by get_cursor().

SDL_Cursor* cache[cursor::NUM_CURSORS] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL} [static]

const std::string colour_images[cursor::NUM_CURSORS] = { "normal.png", "wait.png", "move.png", "attack.png", "select.png", "move_drag.png", "attack_drag.png", ""} [static]

Definition at line 101 of file cursor.cpp.

Referenced by cursor::draw().

bool colour_ready = false [static]

Definition at line 112 of file cursor.cpp.

Referenced by cursor::draw(), cursor::set(), cursor::set_focus(), and cursor::temporary_use_bw().

cursor::CURSOR_TYPE current_cursor = cursor::NORMAL [static]

surface cursor_buf = NULL [static]

Definition at line 110 of file cursor.cpp.

Referenced by clear_cache(), cursor::draw(), and cursor::undraw().

int cursor_x = -1 [static]

Definition at line 109 of file cursor.cpp.

Referenced by cursor::draw(), cursor::undraw(), and gui::textbox::update_text_cache().

int cursor_y = -1 [static]

Definition at line 109 of file cursor.cpp.

Referenced by cursor::draw(), and cursor::undraw().

bool have_focus = true [static]

Definition at line 111 of file cursor.cpp.

Referenced by cursor::draw(), and cursor::set_focus().

const int shift_x[cursor::NUM_CURSORS] = {0, 0, 0, 0, 0, 2, 3, 0} [static]

Definition at line 104 of file cursor.cpp.

Referenced by cursor::draw(), display::draw_minimap(), and cursor::undraw().

const int shift_y[cursor::NUM_CURSORS] = {0, 0, 0, 0, 0, 20, 22, 0} [static]

Definition at line 105 of file cursor.cpp.

Referenced by cursor::draw(), display::draw_minimap(), and cursor::undraw().


Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs