projects
/
supertux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
- Cleanup and rewrite some mainloop code
[supertux.git]
/
src
/
tile.cpp
diff --git
a/src/tile.cpp
b/src/tile.cpp
index
c402cf4
..
ea18d8e
100644
(file)
--- a/
src/tile.cpp
+++ b/
src/tile.cpp
@@
-59,7
+59,7
@@
Tile::parse(const lisp::Lisp& reader)
if(!reader.get("id", id)) {
throw std::runtime_error("Missing tile-id.");
}
if(!reader.get("id", id)) {
throw std::runtime_error("Missing tile-id.");
}
-
+
bool value = false;
if(reader.get("solid", value) && value)
attributes |= SOLID;
bool value = false;
if(reader.get("solid", value) && value)
attributes |= SOLID;
@@
-73,6
+73,8
@@
Tile::parse(const lisp::Lisp& reader)
attributes |= WATER;
if(reader.get("hurts", value) && value)
attributes |= HURTS;
attributes |= WATER;
if(reader.get("hurts", value) && value)
attributes |= HURTS;
+ if(reader.get("fire", value) && value)
+ attributes |= FIRE;
if(reader.get("fullbox", value) && value)
attributes |= FULLBOX;
if(reader.get("coin", value) && value)
if(reader.get("fullbox", value) && value)
attributes |= FULLBOX;
if(reader.get("coin", value) && value)
@@
-86,10
+88,10
@@
Tile::parse(const lisp::Lisp& reader)
data |= WORLDMAP_SOUTH;
if(reader.get("west", value) && value)
data |= WORLDMAP_WEST;
data |= WORLDMAP_SOUTH;
if(reader.get("west", value) && value)
data |= WORLDMAP_WEST;
- if(reader.get("east", value) && value)
+ if(reader.get("east", value) && value)
data |= WORLDMAP_EAST;
if(reader.get("stop", value) && value)
data |= WORLDMAP_EAST;
if(reader.get("stop", value) && value)
- data |= WORLDMAP_STOP;
+ data |= WORLDMAP_STOP;
reader.get("data", data);
reader.get("anim-fps", anim_fps);
reader.get("data", data);
reader.get("anim-fps", anim_fps);
@@
-97,7
+99,7
@@
Tile::parse(const lisp::Lisp& reader)
if(reader.get("slope-type", data)) {
attributes |= SOLID | SLOPE;
}
if(reader.get("slope-type", data)) {
attributes |= SOLID | SLOPE;
}
-
+
const lisp::Lisp* images = reader.get_lisp("images");
if(images)
parse_images(*images);
const lisp::Lisp* images = reader.get_lisp("images");
if(images)
parse_images(*images);
@@
-113,7
+115,7
@@
Tile::parse_images(const lisp::Lisp& images_lisp)
std::string file;
cur->get(file);
imagespecs.push_back(ImageSpec(file, Rect(0, 0, 0, 0)));
std::string file;
cur->get(file);
imagespecs.push_back(ImageSpec(file, Rect(0, 0, 0, 0)));
- } else if(cur->get_type() == lisp::Lisp::TYPE_CONS &&
+ } else if(cur->get_type() == lisp::Lisp::TYPE_CONS &&
cur->get_car()->get_type() == lisp::Lisp::TYPE_SYMBOL) {
const lisp::Lisp* ptr = cur->get_cdr();
cur->get_car()->get_type() == lisp::Lisp::TYPE_SYMBOL) {
const lisp::Lisp* ptr = cur->get_cdr();
@@
-129,7
+131,7
@@
Tile::parse_images(const lisp::Lisp& images_lisp)
log_warning << "Expected string or list in images tag" << std::endl;
continue;
}
log_warning << "Expected string or list in images tag" << std::endl;
continue;
}
-
+
list = list->get_cdr();
}
}
list = list->get_cdr();
}
}
@@
-166,4
+168,3
@@
Tile::draw(DrawingContext& context, const Vector& pos, int z_pos) const
context.draw_surface(images[0], pos, z_pos);
}
}
context.draw_surface(images[0], pos, z_pos);
}
}
-