21 #include <SDL_image.h>
56 std::cerr <<
"Adding mask " << name <<
"\n";
67 " correspond to two different files: " +
69 masks_.find(name)->second.filename);
76 cur_mask.
shift = shift;
79 surface tmp(IMG_Load(image.c_str()));
86 if(
masks_[name].image ==
nullptr)
108 const std::string::size_type dotpos = fname.rfind(
'.');
111 if(dotpos == std::string::npos) {
114 basename = fname.substr(0, dotpos);
136 int x = atoi(pos[0].c_str());
137 int y = atoi(pos[1].c_str());
144 typedef std::pair<std::string, positioned_surface> sme;
148 if(ps.
image ==
nullptr)
154 map.insert(sme(name, ps));
157 std::cerr <<
"Extracting sub-image " << name <<
", position (" << x <<
", " << y <<
")\n";
void set_verbose(bool value)
child_itors child_range(const std::string &key)
surface_map cut_surface(surface surf, const config &conf)
void add_sub_image(const surface &surf, surface_map &map, const config *config)
GLenum GLsizei GLenum GLenum const GLvoid * image
GLint GLint GLint GLint GLint GLint y
std::multimap< std::string, positioned_surface > surface_map
std::string find_configuration(const std::string &file)
const config load_config(const std::string &filename)
std::string get_exploder_dir()
GLsizei const GLfloat * value
std::string base_name(const std::string &file)
Returns the base filename of a file, with directory name stripped.
GLint GLint GLint GLint GLint x
Declarations for File-IO.
void read(config &cfg, std::istream &in, abstract_validator *validator)
GLuint const GLchar * name
SDL_Rect create_rect(const int x, const int y, const int w, const int h)
Creates an empty SDL_Rect.
std::istream * preprocess_file(std::string const &fname, preproc_map *defines)
Contains the SDL_Rect helper code.
surface make_neutral_surface(const surface &surf)
this module manages the cache of images.
std::vector< std::string > split(std::string const &val, const char c, const int flags)
Splits a (comma-)separated string into a vector of pieces.
A config object defines a single node in a WML file, with access to child nodes.
std::string get_mask_dir()
GLsizei const GLcharARB ** string
void load_masks(const config &conf)