The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Public Member Functions | Private Attributes | List of all members
halo::halo_impl Class Reference

Classes

class  effect
 

Public Member Functions

 halo_impl (display &screen)
 impl's of exposed functions More...
 
int add (int x, int y, const std::string &image, const map_location &loc, ORIENTATION orientation=NORMAL, bool infinite=true)
 
void set_location (int handle, int x, int y)
 Set the position of an existing haloing effect, according to its handle. More...
 
void remove (int handle)
 Remove the halo with the given handle. More...
 
void unrender (std::set< map_location > invalidated_locations)
 Render and unrender haloes. More...
 
void render ()
 

Private Attributes

displaydisp
 
std::map< int, effecthaloes
 
int halo_id
 
std::set< intinvalidated_haloes
 Upon unrendering, an invalidation list is send. More...
 
std::set< intnew_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. More...
 
std::set< intdeleted_haloes
 Upon deleting, a halo isn't deleted but added to this set, upon unrendering the image is unrendered and deleted. More...
 
std::set< intchanging_haloes
 Haloes that have an animation or expiration time need to be checked every frame and are stored in this set. More...
 

Detailed Description

Definition at line 33 of file halo.cpp.

Constructor & Destructor Documentation

halo::halo_impl::halo_impl ( display screen)
inline

impl's of exposed functions

Definition at line 112 of file halo.cpp.

Member Function Documentation

int halo::halo_impl::add ( int  x,
int  y,
const std::string image,
const map_location loc,
ORIENTATION  orientation = NORMAL,
bool  infinite = true 
)
void halo::halo_impl::remove ( int  handle)

Remove the halo with the given handle.

Definition at line 353 of file halo.cpp.

References deleted_haloes, haloes, and halo::NO_HALO.

void halo::halo_impl::render ( )

Definition at line 442 of file halo.cpp.

References haloes, invalidated_haloes, itor, new_haloes, and preferences::show_haloes().

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

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

Definition at line 345 of file halo.cpp.

References haloes, and itor.

Referenced by halo::halo_impl::effect::render().

void halo::halo_impl::unrender ( std::set< map_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 364 of file halo.cpp.

References changing_haloes, deleted_haloes, haloes, invalidated_haloes, itor, new_haloes, and preferences::show_haloes().

Referenced by halo::halo_impl::effect::set_location().

Member Data Documentation

std::set<int> halo::halo_impl::changing_haloes
private

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

Definition at line 105 of file halo.cpp.

Referenced by add(), and unrender().

std::set<int> halo::halo_impl::deleted_haloes
private

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

Definition at line 99 of file halo.cpp.

Referenced by remove(), and unrender().

display* halo::halo_impl::disp
private
int halo::halo_impl::halo_id
private

Definition at line 78 of file halo.cpp.

Referenced by add().

std::map<int, effect> halo::halo_impl::haloes
private

Definition at line 77 of file halo.cpp.

Referenced by add(), remove(), render(), set_location(), and unrender().

std::set<int> halo::halo_impl::invalidated_haloes
private

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 85 of file halo.cpp.

Referenced by render(), and unrender().

std::set<int> halo::halo_impl::new_haloes
private

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 93 of file halo.cpp.

Referenced by add(), render(), and unrender().


The documentation for this class was generated from the following file: