$treeview $search $mathjax
Stratagus  2.2.6
$projectbrief
$projectbrief
$searchbox
-->
         _________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          T H E   W A R   B E G I N S
           Stratagus - A free fantasy real time strategy game engine

src/video/cursor.cpp File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "stratagus.h"
#include "video.h"
#include "unittype.h"
#include "player.h"
#include "unit.h"
#include "cursor.h"
#include "tileset.h"
#include "map.h"
#include "interface.h"
#include "ui.h"
#include "editor.h"
#include "intern_video.h"

cursor.cpp - The cursors.

std::vector< CCursor * > AllCursors
CursorStates CursorState
 cursor-types description
int CursorAction
 current cursor state (point,...)
int CursorValue
 action for selection
std::string CustomCursor
 value for CursorAction (spell type f.e.)
int CursorX
 custom cursor for button
int CursorY
 cursor position on screen X
int CursorStartX
 cursor position on screen Y
int CursorStartY
 rectangle started on screen X
int CursorStartScrMapX
 rectangle started on screen Y
int CursorStartScrMapY
 Y position of starting point of selection rectangle, in screen pixels.
CUnitTypeCursorBuilding
 value for action (spell type f.e.)
CCursorGameCursor
 building cursor
static SDL_Surface * HiddenSurface
 current shown cursor-type
void LoadCursors (const std::string &race)
 the same in screen map coordinate system
CCursorCursorByIdent (const std::string &ident)
 Cursor by identifier.
static void DrawVisibleRectangleCursor (int x, int y, int x1, int y1)
static void DrawBuildingCursor ()
void DrawCursor ()
 Draw any cursor.
void HideCursor ()
 Hide the cursor.
void CursorAnimate (unsigned ticks)
 Animate the cursor.
void InitVideoCursors ()
 Initialize the cursor module.
void CleanCursors ()
 Cleanup the cursor module.

Function Documentation

void CleanCursors (  ) 

Cleanup the cursor module.

Cleanup cursor module

void CursorAnimate ( unsigned  ticks  ) 

Animate the cursor.

Animate the cursor.

Parameters:
ticks Current tick

CCursor* CursorByIdent ( const std::string &  ident  ) 

Cursor by identifier.

Find the cursor of this identifier.

Parameters:
ident Identifier for the cursor (from config files).
Returns:
Returns the matching cursor.
Note:
If we have more cursors, we should add hash to find them faster.

static void DrawBuildingCursor (  )  [static]

Draw cursor for selecting building position.

void DrawCursor (  ) 

Draw any cursor.

Draw the cursor.

static void DrawVisibleRectangleCursor ( int  x,
int  y,
int  x1,
int  y1 
) [static]

Draw rectangle cursor when visible

Parameters:
x Screen x start position of rectangle
y Screen y start position of rectangle
x1 Screen x end position of rectangle
y1 Screen y end position of rectangle

void HideCursor (  ) 

Hide the cursor.

Hide the cursor

void InitVideoCursors (  ) 

Initialize the cursor module.

Setup the cursor part.

void LoadCursors ( const std::string &  race  ) 

the same in screen map coordinate system

Load all cursor sprites.

Parameters:
race Cursor graphics of this race to load.


Variable Documentation

std::vector<CCursor*> AllCursors

Define cursor-types.

Todo:
FIXME: Should this be move to ui part?

current cursor state (point,...)

value for action (spell type f.e.)

rectangle started on screen Y

X position of starting point of selection rectangle, in screen pixels.

Y position of starting point of selection rectangle, in screen pixels.

the same in screen map coordinate system

cursor position on screen Y

rectangle started on screen X

cursor-types description

action for selection

int CursorX

custom cursor for button

cursor-type

int CursorY

cursor position on screen X

std::string CustomCursor

value for CursorAction (spell type f.e.)

building cursor

building cursor

custom cursor for button

SDL_Surface* HiddenSurface [static]

current shown cursor-type

(C) Copyright 1998-2011 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.