19 std::tr1::shared_ptr<ImageData> data;
28 bool tileable =
false);
34 Image(
Graphics& graphics,
const std::wstring& filename,
unsigned srcX,
35 unsigned srcY,
unsigned srcWidth,
unsigned srcHeight,
36 bool tileable =
false);
41 bool tileable =
false);
45 unsigned srcY,
unsigned srcWidth,
unsigned srcHeight,
46 bool tileable =
false);
49 explicit Image(std::auto_ptr<ImageData> data);
51 unsigned width()
const;
55 void draw(
double x,
double y,
ZPos z,
56 double factorX = 1,
double factorY = 1,
62 double factorX,
double factorY,
76 double angle,
double centerX = 0.5,
double centerY = 0.5,
77 double factorX = 1,
double factorY = 1,
85 std::vector<Gosu::Image>
loadTiles(
Graphics& graphics,
const Bitmap& bmp,
int tileWidth,
int tileHeight,
bool tileable);
86 std::vector<Gosu::Image>
loadTiles(
Graphics& graphics,
const std::wstring& bmp,
int tileWidth,
int tileHeight,
bool tileable);
96 template<
typename Container>
99 std::vector<Gosu::Image> tiles =
loadTiles(graphics, filename, tileWidth, tileHeight, tileable);
100 for (
int i = 0, num = tiles.size(); i < num; ++i)
101 appendTo.push_back(
typename Container::value_type(
new Gosu::Image(tiles[i])));
112 template<
typename Container>
114 int tileWidth,
int tileHeight,
bool tileable, Container& appendTo)
116 std::vector<Gosu::Image> tiles =
loadTiles(graphics, bmp, tileWidth, tileHeight, tileable);
117 for (
int i = 0, num = tiles.size(); i < num; ++i)
118 appendTo.push_back(
typename Container::value_type(
new Gosu::Image(tiles[i])));