4 // Copyright (C) 2004 Tobias Glaesser <tobi.web@gmx.de>
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (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 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., 59 Temple Place - Suite 330, Boston, MA
24 #include "video/surface.h"
25 #include "utils/lispreader.h"
26 #include "math/rectangle.h"
28 using namespace SuperTux;
36 /// bitset for tile attributes
38 /** solid tile that is indestructable by Tux */
40 /** uni-directional solid tile */
42 /** a brick that can be destroyed by jumping under it */
44 /** an ice brick that makes tux sliding more than usual */
46 /** a water tile in which tux starts to swim */
48 /** a tile that hurts the player if he touches it */
50 /** Bonusbox, content is stored in \a data */
54 /** the level should be finished when touching a goaltile.
55 * if data is 0 then the endsequence should be triggered, if data is 1
56 * then we can finish the level instantly.
67 ImageSpec(const std::string& newfile, const Rectangle& newrect)
68 : file(newfile), rect(newrect)
74 std::vector<ImageSpec> imagespecs;
75 std::vector<Surface*> images;
77 std::string editor_imagefile;
78 Surface* editor_image;
80 /** tile attributes */
83 /** General purpose data attached to a tile (content of a box, type of coin)*/
91 /** Draw a tile on the screen */
92 void draw(DrawingContext& context, const Vector& pos, int layer) const;
94 Surface* get_editor_image() const;
96 unsigned int getID() const
99 Uint32 getAttributes() const
100 { return attributes; }
105 /// returns the width of the tile in pixels
113 /// returns the height of the tiles in pixels
114 int getHeight() const
122 friend class TileManager;
127 /// parses the tile and returns it's id number
128 void parse(LispReader& reader);
129 void parse_images(lisp_object_t* cur);