halo.hpp

Go to the documentation of this file.
00001 /* $Id: halo.hpp 23842 2008-02-16 08:47:16Z mordante $ */
00002 /*
00003    Copyright (C) 2003 - 2008 by David White <dave@whitevine.net>
00004    Part of the Battle for Wesnoth Project http://www.wesnoth.org/
00005 
00006    This program is free software; you can redistribute it and/or modify
00007    it under the terms of the GNU General Public License version 2
00008    or at your option any later version.
00009    This program is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY.
00011 
00012    See the COPYING file for more details.
00013 */
00014 
00015 //! @file halo.hpp 
00016 //!
00017 
00018 #ifndef HALO_HPP_INCLUDED
00019 #define HALO_HPP_INCLUDED
00020 
00021 class display;
00022 
00023 #include "map.hpp"
00024 #include <set>
00025 #include <string>
00026 
00027 namespace halo
00028 {
00029 
00030 
00031 struct manager
00032 {
00033     manager(display& disp);
00034     ~manager();
00035 
00036 private:
00037     display* const old;
00038 };
00039 
00040 enum ORIENTATION { NORMAL, HREVERSE, VREVERSE, HVREVERSE };
00041 const int NO_HALO = 0;
00042 
00043 //! Add a haloing effect using 'image centered on (x,y).
00044 //! @return     The handle to the halo object.
00045 //! @retval     0 is the invalid handle.
00046 //!
00047 //! If the halo is attached to an item, it needs to be hidden if the 
00048 //! shroud is active.  (Note it will be shown with the fog active.) 
00049 //! If it is not attached to an item, the location should be set to -1, -1
00050 int add(int x, int y, const std::string& image, const gamemap::location& loc,
00051         ORIENTATION orientation=NORMAL, bool infinite=true);
00052 
00053 //! Set the position of an existing haloing effect, according to its handle.
00054 void set_location(int handle, int x, int y);
00055 
00056 //! Remove the halo with the given handle.
00057 void remove(int handle);
00058 
00059 struct remover
00060 {
00061     void operator()(int handle) const { remove(handle); }
00062 };
00063 
00064 //! Render and unrender haloes. 
00065 //! Which haloes are rendered is determined by invalidated_locations 
00066 //! and the internal state in the control sets (in halo.cpp).
00067 void unrender(std::set<gamemap::location> invalidated_locations);
00068 void render();
00069 
00070 } // end namespace halo
00071 
00072 #endif

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