1 // Copyright (C) 2003 Michael Bartl
2 // Copyright (C) 2003, 2004 Ulf Lorenz
3 // Copyright (C) 2005 Andrea Paternesi
4 // Copyright (C) 2007, 2008, 2009 Ben Asselstine
6 // This program is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 3 of the License, or
9 // (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU Library General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
28 /** Class which cares about rendering of the map.
30 * This class is initalized with the drawing surface of the BigMap class. It
31 * cares for the actual terrain drawing.
38 /** Constructor, also does the smoothing of the GameMap.
40 * @param surface the surface which is rendered with render()
42 MapRenderer(Glib::RefPtr<Gdk::Pixmap> surface);
45 /** Render a portion of the map.
47 * The part of the map which is drawn starts at the tile (tileX,tileY)
48 * and goes on till (tileX+columns, tileY+rows). The drawing is done on
49 * the surface handed over in the constructor and starts at pixel
52 void render(int x, int y, int tileX, int tileY, int columns, int rows);
54 void render(int x, int y, int tileStartX, int tileStartY,
55 int columns, int rows, Glib::RefPtr<Gdk::Pixmap> surface,
56 Glib::RefPtr<Gdk::GC> context);
58 void render_tile(Vector<int> draw, Vector<int> tile,
59 Glib::RefPtr<Gdk::Pixmap> surface,
60 Glib::RefPtr<Gdk::GC> context);
62 //! Save the current view of map tiles as an image (bmp file).
63 bool saveViewAsBitmap(std::string filename);
65 //! Save all of the map tiles as one big image (bmp file).
66 bool saveAsBitmap(std::string filename);
69 Glib::RefPtr<Gdk::Pixmap> d_surface;
70 Glib::RefPtr<Gdk::GC> gc;
74 #endif // MAPRENDERER_H