The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
exploder_cutter.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2004 - 2016 by Philippe Plantier <[email protected]>
3  Part of the Battle for Wesnoth Project http://www.wesnoth.org
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY.
11 
12  See the COPYING file for more details.
13 */
14 
15 #ifndef EXPLODER_CUTTER_HPP_INCLUDED
16 #define EXPLODER_CUTTER_HPP_INCLUDED
17 
18 #include "sdl/utils.hpp"
19 #include "config.hpp"
20 #include "exploder_utils.hpp"
21 
22 class cutter
23 {
24 public:
25  struct mask
26  {
27  mask()
28  : name()
29  , image(nullptr)
30  , filename()
31  , shift()
32  , cut()
33  {
34  }
35 
39 
42  };
43  typedef std::map<std::string, mask> mask_map;
46  : name()
47  , pos()
48  , image(nullptr)
49  , mask()
50  {
51  }
52 
56 
58  };
59  typedef std::multimap<std::string, positioned_surface> surface_map;
60 
61  cutter();
62 
63  const config load_config(const std::string& filename);
64  void load_masks(const config& conf);
65  surface_map cut_surface(surface surf, const config& conf);
66 
67  void set_verbose(bool value);
68 private:
70  void add_sub_image(const surface &surf, surface_map &map, const config* config);
71 
72  mask_map masks_;
73 
74  bool verbose_;
75 };
76 
77 #endif
78 
void set_verbose(bool value)
surface_map cut_surface(surface surf, const config &conf)
std::string name
void add_sub_image(const surface &surf, surface_map &map, const config *config)
std::multimap< std::string, positioned_surface > surface_map
Definitions for the interface to Wesnoth Markup Language (WML).
std::string find_configuration(const std::string &file)
const config load_config(const std::string &filename)
exploder_rect cut
GLsizei const GLfloat * value
Definition: glew.h:1817
surf
Definition: filter.cpp:143
GLuint const GLchar * name
Definition: glew.h:1782
mask_map masks_
this module manages the cache of images.
Definition: image.cpp:75
std::string filename
A config object defines a single node in a WML file, with access to child nodes.
Definition: config.hpp:83
exploder_point shift
GLsizei const GLcharARB ** string
Definition: glew.h:4503
std::map< std::string, mask > mask_map
void load_masks(const config &conf)