The Battle for Wesnoth  1.15.1+dev
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< int > invalidated_haloes
 Upon unrendering, an invalidation list is send. More...
 
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. More...
 
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. More...
 

Detailed Description

Definition at line 36 of file halo.cpp.

Constructor & Destructor Documentation

◆ halo_impl()

halo::halo_impl::halo_impl ( display screen)
inlineexplicit

Member Function Documentation

◆ add()

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

◆ remove()

void halo::halo_impl::remove ( int  handle)

Remove the halo with the given handle.

Definition at line 344 of file halo.cpp.

References deleted_haloes, haloes, and halo::NO_HALO.

◆ render()

void halo::halo_impl::render ( )

Definition at line 430 of file halo.cpp.

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

◆ set_location()

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

References haloes.

◆ unrender()

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

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

Member Data Documentation

◆ changing_haloes

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

Referenced by add(), and unrender().

◆ deleted_haloes

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

Referenced by remove(), and unrender().

◆ disp

display* halo::halo_impl::disp
private

Definition at line 78 of file halo.cpp.

◆ halo_id

int halo::halo_impl::halo_id
private

Definition at line 81 of file halo.cpp.

Referenced by add().

◆ haloes

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

Definition at line 80 of file halo.cpp.

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

◆ invalidated_haloes

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

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


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