halo Namespace Reference


Classes

struct  manager
struct  remover

Enumerations

enum  ORIENTATION { NORMAL, HREVERSE, VREVERSE, HVREVERSE }

Functions

int add (int x, int y, const std::string &image, const gamemap::location &loc, ORIENTATION orientation=NORMAL, bool infinite=true)
 Add a haloing effect using 'image centered on (x,y).
void set_location (int handle, int x, int y)
 Set the position of an existing haloing effect, according to its handle.
void remove (int handle)
 Remove the halo with the given handle.
void unrender (std::set< gamemap::location > invalidated_locations)
 Render and unrender haloes.
void render ()

Variables

displaydisp = NULL
std::map< int, effect > haloes
int halo_id = 1
std::set< int > invalidated_haloes
 Upon unrendering, an invalidation list is send.
std::set< int > new_haloes
 A newly added halo will be added to this list, these haloes don't need to be unrendered but do not to be rendered regardless which tiles are invalidated.
std::set< int > deleted_haloes
 Upon deleting, a halo isn't deleted but added to this set, upon unrendering the image is unrendered and deleted.
std::set< int > changing_haloes
 Haloes that have an animation or expiration time need to be checked every frame and are stored in this set.
const int NO_HALO = 0


Enumeration Type Documentation

Enumerator:
NORMAL 
HREVERSE 
VREVERSE 
HVREVERSE 

Definition at line 40 of file halo.hpp.


Function Documentation

int halo::add ( int  x,
int  y,
const std::string &  image,
const gamemap::location loc,
ORIENTATION  orientation = NORMAL,
bool  infinite = true 
)

Add a haloing effect using 'image centered on (x,y).

Returns:
The handle to the halo object.
Return values:
0 is the invalid handle.
If the halo is attached to an item, it needs to be hidden if the shroud is active. (Note it will be shown with the fog active.) If it is not attached to an item, the location should be set to -1, -1

Definition at line 269 of file halo.cpp.

References loc, and utils::split().

Referenced by game_display::add_overlay(), unit_frame::redraw(), and unit::redraw_unit().

void halo::remove ( int  handle  ) 

void halo::render (  ) 

Definition at line 395 of file halo.cpp.

References preferences::show_haloes().

Referenced by game_display::draw().

void halo::set_location ( int  handle,
int  x,
int  y 
)

Set the position of an existing haloing effect, according to its handle.

Definition at line 299 of file halo.cpp.

Referenced by unit::redraw_unit().

void halo::unrender ( std::set< gamemap::location invalidated_locations  ) 

Render and unrender haloes.

Which haloes are rendered is determined by invalidated_locations and the internal state in the control sets (in halo.cpp).

Definition at line 318 of file halo.cpp.

References preferences::show_haloes().

Referenced by game_display::draw().


Variable Documentation

std::set<int> halo::changing_haloes [static]

Haloes that have an animation or expiration time need to be checked every frame and are stored in this set.

Definition at line 97 of file halo.cpp.

std::set<int> halo::deleted_haloes [static]

Upon deleting, a halo isn't deleted but added to this set, upon unrendering the image is unrendered and deleted.

Definition at line 93 of file halo.cpp.

display* halo::disp = NULL [static]

Definition at line 38 of file halo.cpp.

int halo::halo_id = 1 [static]

Definition at line 77 of file halo.cpp.

std::map<int, effect> halo::haloes [static]

Definition at line 76 of file halo.cpp.

std::set<int> halo::invalidated_haloes [static]

Upon unrendering, an invalidation list is send.

All haloes in that area and the other invalidated haloes are stored in this set. Then there'll be tested which haloes overlap and they're also stored in this set.

Definition at line 83 of file halo.cpp.

std::set<int> halo::new_haloes [static]

A newly added halo will be added to this list, these haloes don't need to be unrendered but do not to be rendered regardless which tiles are invalidated.

These haloes will stay in this set until there're really rendered (rendering won't happen if for example the halo is offscreen).

Definition at line 89 of file halo.cpp.

const int halo::NO_HALO = 0


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