00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef EXPLODER_UTILS_HPP_INCLUDED
00016 #define EXPLODER_UTILS_HPP_INCLUDED
00017
00018 #include "../sdl_utils.hpp"
00019 #include <string>
00020
00021 struct exploder_failure
00022 {
00023 exploder_failure(const std::string& message) :
00024 message(message) {}
00025
00026 std::string message;
00027 };
00028
00029 struct exploder_point
00030 {
00031 exploder_point() : x(0), y(0) {};
00032 exploder_point(int x, int y) : x(x), y(y) {};
00033 exploder_point(const std::string &s);
00034
00035 int x;
00036 int y;
00037 };
00038
00039 struct exploder_rect
00040 {
00041 exploder_rect() : x(0), y(0), w(0), h(0) {};
00042 exploder_rect(int x,int y, int w, int h) : x(x), y(y), w(w), h(h) {};
00043 exploder_rect(const std::string &s);
00044
00045 int x;
00046 int y;
00047 int w;
00048 int h;
00049 };
00050
00051 std::string get_mask_dir();
00052 std::string get_exploder_dir();
00053
00054 void masked_overwrite_surface(surface dest, surface src, surface mask, int x, int y);
00055 bool image_empty(surface surf);
00056 void save_image(surface surf, const std::string &filename);
00057
00058 #endif