#include "object/snow_particle_system.hpp"
#include "object/text_object.hpp"
#include "object/tilemap.hpp"
-#include "physfs/ifile_stream.hpp"
+#include "physfs/ifile_streambuf.hpp"
#include "scripting/squirrel_util.hpp"
#include "supertux/collision.hpp"
#include "supertux/constants.hpp"
update_game_objects();
- if(solid_tilemaps.size() < 1) log_warning << "sector '" << name << "' does not contain a solid tile layer." << std::endl;
+ if(solid_tilemaps.size() < 1) { log_warning << "sector '" << name << "' does not contain a solid tile layer." << std::endl; }
fix_old_tiles();
if(!camera) {
update_game_objects();
- if(solid_tilemaps.size() < 1) log_warning << "sector '" << name << "' does not contain a solid tile layer." << std::endl;
+ if(solid_tilemaps.size() < 1) { log_warning << "sector '" << name << "' does not contain a solid tile layer." << std::endl; }
fix_old_tiles();
update_game_objects();
add_object(new InvisibleBlock(pos));
solids->change(x, y, 0);
} else if(tile->getAttributes() & Tile::COIN) {
- add_object(new Coin(pos));
+ add_object(new Coin(pos, solids));
solids->change(x, y, 0);
} else if(tile->getAttributes() & Tile::FULLBOX) {
add_object(new BonusBlock(pos, tile->getData()));
solids->change(x, y, 0);
} else if(tile->getAttributes() & Tile::BRICK) {
- add_object(new Brick(pos, tile->getData()));
+ if( ( id == 78 ) || ( id == 105 ) ){
+ add_object( new Brick(pos, tile->getData(), "images/objects/bonus_block/brickIce.sprite") );
+ } else if( ( id == 77 ) || ( id == 104 ) ){
+ add_object( new Brick(pos, tile->getData(), "images/objects/bonus_block/brick.sprite") );
+ } else {
+ log_warning << "attribute 'brick #t' is not supported for tile-id " << id << std::endl;
+ add_object( new Brick(pos, tile->getData(), "images/objects/bonus_block/brick.sprite") );
+ }
solids->change(x, y, 0);
} else if(tile->getAttributes() & Tile::GOAL) {
std::string sequence = tile->getData() == 0 ? "endsequence" : "stoptux";
}
}
+ //FIXME: This is a really dirty workaround for this strange camera jump
+ player->move(player->get_pos()+Vector(-32, 0));
camera->reset(player->get_pos());
+ camera->update(1);
+ player->move(player->get_pos()+(Vector(32, 0)));
+ camera->update(1);
+
update_game_objects();
//Run default.nut just before init script
std::string basedir = FileSystem::dirname(get_level()->filename);
if(PHYSFS_exists((basedir + "/info").c_str())) {
try {
- IFileStream in(basedir + "/default.nut");
+ IFileStreambuf ins(basedir + "/default.nut");
+ std::istream in(&ins);
run_script(in, "default.nut");
} catch(std::exception& ) {
// doesn't exist or erroneous; do nothing
if(tile->is_slope ()) { // slope tile
AATriangle triangle;
int slope_data = tile->getData();
- if (solids->get_drawing_effect() == VERTICAL_FLIP)
+ if (solids->get_drawing_effect() & VERTICAL_FLIP)
slope_data = AATriangle::vertical_flip(slope_data);
triangle = AATriangle(tile_bbox, slope_data);