exploder_cutter.hpp

Go to the documentation of this file.
00001 /* $Id: exploder_cutter.hpp 23842 2008-02-16 08:47:16Z mordante $ */
00002 /*
00003    Copyright (C) 2004 - 2008 by Philippe Plantier <ayin@anathas.org>
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 #ifndef EXPLODER_CUTTER_HPP_INCLUDED
00016 #define EXPLODER_CUTTER_HPP_INCLUDED
00017 
00018 #include "../sdl_utils.hpp"
00019 #include "../config.hpp"
00020 #include "../sdl_utils.hpp"
00021 #include "exploder_utils.hpp"
00022 
00023 class cutter
00024 {
00025 public:
00026     struct mask
00027     {
00028         mask() : image(NULL) {}
00029 
00030         std::string name;
00031         surface image;
00032         std::string filename;
00033 
00034         exploder_point shift;
00035         exploder_rect cut;
00036     };
00037     typedef std::map<std::string, mask> mask_map;
00038     struct positioned_surface {
00039         positioned_surface() : image(NULL) {};
00040 
00041         std::string name;
00042         exploder_point pos;
00043         surface image;
00044 
00045         cutter::mask mask;
00046     };
00047     typedef std::multimap<std::string, positioned_surface> surface_map;
00048 
00049     cutter();
00050 
00051     const config load_config(const std::string& filename);
00052     void load_masks(const config& conf);
00053     surface_map cut_surface(surface surf, const config& conf);
00054 
00055     void set_verbose(bool value);
00056 private:
00057     std::string find_configuration(const std::string &file);
00058     void add_sub_image(const surface &surf, surface_map &map, const config* config);
00059 
00060     mask_map masks_;
00061 
00062     bool verbose_;
00063 };
00064 
00065 #endif
00066 

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