tools/exploder_cutter.hpp

Go to the documentation of this file.
00001 /* $Id: exploder_cutter.hpp 52533 2012-01-07 02:35:17Z shadowmaster $ */
00002 /*
00003    Copyright (C) 2004 - 2012 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 as published by
00008    the Free Software Foundation; either version 2 of the License, or
00009    (at your option) any later version.
00010    This program is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY.
00012 
00013    See the COPYING file for more details.
00014 */
00015 
00016 #ifndef EXPLODER_CUTTER_HPP_INCLUDED
00017 #define EXPLODER_CUTTER_HPP_INCLUDED
00018 
00019 #include "../sdl_utils.hpp"
00020 #include "../config.hpp"
00021 #include "../sdl_utils.hpp"
00022 #include "exploder_utils.hpp"
00023 
00024 class cutter
00025 {
00026 public:
00027     struct mask
00028     {
00029         mask()
00030             : name()
00031             , image(NULL)
00032             , filename()
00033             , shift()
00034             , cut()
00035         {
00036         }
00037 
00038         std::string name;
00039         surface image;
00040         std::string filename;
00041 
00042         exploder_point shift;
00043         exploder_rect cut;
00044     };
00045     typedef std::map<std::string, mask> mask_map;
00046     struct positioned_surface {
00047         positioned_surface()
00048             : name()
00049             , pos()
00050             , image(NULL)
00051             , mask()
00052         {
00053         };
00054 
00055         std::string name;
00056         exploder_point pos;
00057         surface image;
00058 
00059         cutter::mask mask;
00060     };
00061     typedef std::multimap<std::string, positioned_surface> surface_map;
00062 
00063     cutter();
00064 
00065     const config load_config(const std::string& filename);
00066     void load_masks(const config& conf);
00067     surface_map cut_surface(surface surf, const config& conf);
00068 
00069     void set_verbose(bool value);
00070 private:
00071     std::string find_configuration(const std::string &file);
00072     void add_sub_image(const surface &surf, surface_map &map, const config* config);
00073 
00074     mask_map masks_;
00075 
00076     bool verbose_;
00077 };
00078 
00079 #endif
00080 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Thu May 24 2012 01:02:54 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs