halo.cpp File Reference

Maintain halo-effects for units and items. More...

#include "global.hpp"
#include "display.hpp"
#include "game_preferences.hpp"
#include "halo.hpp"
#include "image.hpp"
#include "sdl_utils.hpp"
#include "util.hpp"
#include "video.hpp"
#include "serialization/string_utils.hpp"
#include <algorithm>
#include <cassert>
#include <map>

Include dependency graph for halo.cpp:

Go to the source code of this file.

Namespaces

namespace  halo

Functions

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).
void halo::set_location (int handle, int x, int y)
 Set the position of an existing haloing effect, according to its handle.
void halo::remove (int handle)
 Remove the halo with the given handle.
void halo::unrender (std::set< gamemap::location > invalidated_locations)
 Render and unrender haloes.
void halo::render ()

Variables

displayhalo::disp = NULL
std::map< int, effect > halo::haloes
int halo::halo_id = 1
std::set< int > halo::invalidated_haloes
 Upon unrendering, an invalidation list is send.
std::set< int > halo::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 > halo::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 > halo::changing_haloes
 Haloes that have an animation or expiration time need to be checked every frame and are stored in this set.


Detailed Description

Maintain halo-effects for units and items.

Examples: white mage, lighthouse.

Definition in file halo.cpp.


Variable Documentation

Definition at line 66 of file halo.cpp.

animated<std::string> images_

Definition at line 61 of file halo.cpp.

Referenced by image::flush_cache(), image::get_image(), and image::locator::init_index().

The location of the center of the halo.

Definition at line 70 of file halo.cpp.

ORIENTATION orientation_

Definition at line 63 of file halo.cpp.

All locations over which the halo lies.

Definition at line 73 of file halo.cpp.

SDL_Rect rect_

Definition at line 67 of file halo.cpp.

Definition at line 66 of file halo.cpp.

int x_

Definition at line 65 of file halo.cpp.

int y_

Definition at line 65 of file halo.cpp.


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