The Battle for Wesnoth  1.19.5+dev
Classes | Public Member Functions | Private Attributes | List of all members
halo::halo_impl Class Reference

Classes

class  effect
 

Public Member Functions

 halo_impl ()
 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 update ()
 
void render (const rect &)
 Render all halos overlapping the given region. More...
 

Private Attributes

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

Constructor & Destructor Documentation

◆ halo_impl()

halo::halo_impl::halo_impl ( )
inlineexplicit

impl's of exposed functions

Definition at line 125 of file halo.cpp.

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 ( const rect region)

Render all halos overlapping the given region.

Definition at line 396 of file halo.cpp.

References DBG_HL, halo::halo_impl::effect::get_draw_location(), haloes, id, rect::overlaps(), and halo::halo_impl::effect::render().

◆ 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.

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

◆ update()

void halo::halo_impl::update ( )

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

Referenced by add(), and update().

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

Referenced by remove(), and update().

◆ halo_id

int halo::halo_impl::halo_id
private

Definition at line 99 of file halo.cpp.

Referenced by add().

◆ haloes

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

Definition at line 98 of file halo.cpp.

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

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

Referenced by add().


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