X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fobject%2Fparticlesystem_interactive.cpp;h=94955e9989529ce1dc9b8691a9ccfc05050f8fe4;hb=657fc40723665c04b3150946f5bd66b6b0af9230;hp=0a45cb53cf7c2b7aff29c27f7606a8d6b7ac9681;hpb=011924797f070a383d5010f53cb90b04b4c124a1;p=supertux.git diff --git a/src/object/particlesystem_interactive.cpp b/src/object/particlesystem_interactive.cpp index 0a45cb53c..94955e998 100644 --- a/src/object/particlesystem_interactive.cpp +++ b/src/object/particlesystem_interactive.cpp @@ -61,7 +61,7 @@ ParticleSystem_Interactive::~ParticleSystem_Interactive() void ParticleSystem_Interactive::draw(DrawingContext& context) { context.push_transform(); - + std::vector::iterator i; for(i = particles.begin(); i != particles.end(); ++i) { Particle* particle = *i; @@ -99,31 +99,31 @@ ParticleSystem_Interactive::collision(Particle* object, Vector movement) TileMap* solids = *i; for(int x = starttilex; x*32 < max_x; ++x) { for(int y = starttiley; y*32 < max_y; ++y) { - const Tile* tile = solids->get_tile(x, y); - if(!tile) - continue; - // skip non-solid tiles, except water - if(! (tile->getAttributes() & (Tile::WATER | Tile::SOLID))) - continue; - - if(tile->getAttributes() & Tile::SLOPE) { // slope tile - AATriangle triangle; - Vector p1(x*32, y*32); - Vector p2((x+1)*32, (y+1)*32); - triangle = AATriangle(p1, p2, tile->getData()); - - if(rectangle_aatriangle(&constraints, dest, triangle)) { - if(tile->getAttributes() & Tile::WATER) - water = true; - } - } else { // normal rectangular tile - Rect rect(x*32, y*32, (x+1)*32, (y+1)*32); - if(intersects(dest, rect)) { - if(tile->getAttributes() & Tile::WATER) - water = true; - set_rectangle_rectangle_constraints(&constraints, dest, rect); - } - } + const Tile* tile = solids->get_tile(x, y); + if(!tile) + continue; + // skip non-solid tiles, except water + if(! (tile->getAttributes() & (Tile::WATER | Tile::SOLID))) + continue; + + if(tile->getAttributes() & Tile::SLOPE) { // slope tile + AATriangle triangle; + Vector p1(x*32, y*32); + Vector p2((x+1)*32, (y+1)*32); + triangle = AATriangle(p1, p2, tile->getData()); + + if(rectangle_aatriangle(&constraints, dest, triangle)) { + if(tile->getAttributes() & Tile::WATER) + water = true; + } + } else { // normal rectangular tile + Rect rect(x*32, y*32, (x+1)*32, (y+1)*32); + if(intersects(dest, rect)) { + if(tile->getAttributes() & Tile::WATER) + water = true; + set_rectangle_rectangle_constraints(&constraints, dest, rect); + } + } } } } @@ -183,7 +183,7 @@ void RainParticleSystem::write(lisp::Writer& writer) { writer.start_list("particles-rain"); - writer.write_int("z-pos", z_pos); + writer.write("z-pos", z_pos); writer.end_list("particles-rain"); } @@ -265,7 +265,7 @@ void CometParticleSystem::write(lisp::Writer& writer) { writer.start_list("particles-comets"); - writer.write_int("z-pos", z_pos); + writer.write("z-pos", z_pos); writer.end_list("particles-comets"); }