Getting rid of nasty tabs
authorRyan Flegel <rflegel@gmail.com>
Thu, 12 Jun 2008 05:23:28 +0000 (05:23 +0000)
committerRyan Flegel <rflegel@gmail.com>
Thu, 12 Jun 2008 05:23:28 +0000 (05:23 +0000)
SVN-Revision: 5563

92 files changed:
src/addon/addon_manager.cpp
src/audio/sound_file.cpp
src/audio/sound_manager.cpp
src/audio/sound_manager.hpp
src/badguy/angrystone.cpp
src/badguy/badguy.cpp
src/badguy/bomb.cpp
src/badguy/bouncing_snowball.cpp
src/badguy/dart.cpp
src/badguy/darttrap.cpp
src/badguy/dispenser.cpp
src/badguy/fish.cpp
src/badguy/flyingsnowball.cpp
src/badguy/ghosttree.cpp
src/badguy/kamikazesnowball.cpp
src/badguy/mole.cpp
src/badguy/mole_rock.cpp
src/badguy/mrbomb.cpp
src/badguy/mriceblock.cpp
src/badguy/mrrocket.cpp
src/badguy/plant.cpp
src/badguy/poisonivy.cpp
src/badguy/skullyhop.cpp
src/badguy/smartball.cpp
src/badguy/snail.cpp
src/badguy/spidermite.cpp
src/badguy/spiky.cpp
src/badguy/sspiky.cpp
src/badguy/stalactite.cpp
src/badguy/stumpy.cpp
src/badguy/toad.cpp
src/badguy/totem.cpp
src/badguy/walking_badguy.cpp
src/badguy/walkingleaf.cpp
src/badguy/willowisp.cpp
src/badguy/yeti.cpp
src/badguy/zeekling.cpp
src/console.cpp
src/control/joystickkeyboardcontroller.cpp
src/game_session.cpp
src/gui/button.cpp
src/gui/menu.cpp
src/lisp/parser.cpp
src/object/ambient_sound.cpp
src/object/bicycle_platform.cpp
src/object/candle.cpp
src/object/coin.cpp
src/object/explosion.cpp
src/object/firefly.cpp
src/object/growup.cpp
src/object/hurting_platform.cpp
src/object/icecrusher.cpp
src/object/invisible_wall.cpp
src/object/ispy.cpp
src/object/magicblock.cpp
src/object/moving_sprite.cpp
src/object/oneup.cpp
src/object/particlesystem.cpp
src/object/particlesystem.hpp
src/object/particlesystem_interactive.cpp
src/object/platform.cpp
src/object/player.cpp
src/object/pneumatic_platform.cpp
src/object/pulsing_light.cpp
src/object/pushbutton.cpp
src/object/skull_tile.cpp
src/object/sprite_particle.cpp
src/object/star.cpp
src/object/thunderstorm.cpp
src/object/trampoline.cpp
src/object/unstable_tile.cpp
src/physfs/physfs_sdl.cpp
src/physfs/physfs_stream.cpp
src/random_generator.cpp
src/scripting/functions.cpp
src/scripting/thunderstorm.cpp
src/sector.cpp
src/statistics.cpp
src/tile.hpp
src/tile_set.cpp
src/tinygettext/tinygettext.cpp
src/title.cpp
src/trigger/door.cpp
src/trigger/secretarea_trigger.cpp
src/trigger/switch.cpp
src/video/gl_lightmap.cpp
src/video/gl_renderer.cpp
src/video/sdl_lightmap.cpp
src/video/sdl_renderer.cpp
src/worldmap/level.cpp
src/worldmap/tux.cpp
src/worldmap/worldmap.cpp

index 1ec5c59..cf7ab80 100644 (file)
@@ -387,10 +387,10 @@ AddonManager::load_addons()
       // make sure it looks like an infoFile
       static const std::string infoExt = ".nfo";
       if (potentialInfoFileName.length() <= infoExt.length())
-         continue;
+        continue;
 
       if (potentialInfoFileName.compare(potentialInfoFileName.length()-infoExt.length(), infoExt.length(), infoExt) != 0)
-         continue;
+        continue;
 
       // make sure it's in the current archive
       std::string infoFileDir = PHYSFS_getRealDir(potentialInfoFileName.c_str());
index 6352110..2af95ca 100644 (file)
@@ -400,11 +400,11 @@ SoundFile* load_sound_file(const std::string& filename)
   if(!file) {
     log_warning << "Couldn't open '" << filename << "': " << PHYSFS_getLastError() << ", using dummy sound file." << std::endl;
     file = PHYSFS_openRead("sounds/empty.wav");
-       if (!file) {
+    if (!file) {
     std::stringstream msg;
-       msg << "Couldn't open dummy sound file '" << filename << "': " << PHYSFS_getLastError();
-               throw std::runtime_error(msg.str());
-       }
+    msg << "Couldn't open dummy sound file '" << filename << "': " << PHYSFS_getLastError();
+      throw std::runtime_error(msg.str());
+    }
   }
 
   try {
index b2697c1..b842903 100644 (file)
@@ -234,7 +234,7 @@ void
 SoundManager::remove_from_update( StreamSoundSource* sss  ){
   if( sss != NULL ){
     StreamSoundSources::iterator i = update_list.begin();
-       while( i != update_list.end() ){
+    while( i != update_list.end() ){
       if( *i == sss ){
         i = update_list.erase(i);
       } else {
index 12f1944..290147a 100644 (file)
@@ -75,7 +75,7 @@ public:
   bool is_sound_enabled() { return sound_enabled; }
 
   bool is_audio_enabled() {
-                       return device != 0 && context != 0;
+    return device != 0 && context != 0;
   }
 
   void update();
index d44f9d8..34ea9c1 100644 (file)
@@ -29,7 +29,7 @@ static const float ATTACK_TIME = 1;
 static const float RECOVER_TIME = .5;
 
 AngryStone::AngryStone(const lisp::Lisp& reader)
-       : BadGuy(reader, "images/creatures/angrystone/angrystone.sprite"), state(IDLE)
+        : BadGuy(reader, "images/creatures/angrystone/angrystone.sprite"), state(IDLE)
 {
   physic.set_velocity_x(0);
   physic.set_velocity_y(0);
index 0e9347e..fd3ef26 100644 (file)
@@ -211,7 +211,7 @@ BadGuy::collision(GameObject& other, const CollisionHit& hit)
     // hit from above?
     if (badguy->get_bbox().p2.y < (bbox.p1.y + 16)) {
       if(collision_squished(*badguy)) {
-       return ABORT_MOVE;
+        return ABORT_MOVE;
       }
     }
 
@@ -224,7 +224,7 @@ BadGuy::collision(GameObject& other, const CollisionHit& hit)
     // hit from above?
     if (player->get_bbox().p2.y < (bbox.p1.y + 16)) {
       if(collision_squished(*player)) {
-       return ABORT_MOVE;
+        return ABORT_MOVE;
       }
     }
 
index cbc96c0..5327515 100644 (file)
@@ -24,7 +24,7 @@
 #include "object/explosion.hpp"
 
 Bomb::Bomb(const Vector& pos, Direction dir, std::string custom_sprite /*= "images/creatures/mr_bomb/mr_bomb.sprite"*/ )
-       : BadGuy( pos, dir, custom_sprite )
+        : BadGuy( pos, dir, custom_sprite )
 {
   state = STATE_TICKING;
   set_action(dir == LEFT ? "ticking-left" : "ticking-right", 1);
@@ -39,7 +39,7 @@ Bomb::Bomb(const Vector& pos, Direction dir, std::string custom_sprite /*= "imag
 }
 
 Bomb::Bomb(const Bomb& other)
-       : BadGuy(other), state(other.state)
+        : BadGuy(other), state(other.state)
 {
   if (state == STATE_TICKING) {
     ticking.reset(sound_manager->create_sound_source("sounds/fizz.wav"));
index ae9e91d..2d90433 100644 (file)
@@ -25,7 +25,7 @@ static const float JUMPSPEED = -450;
 static const float WALKSPEED = 80;
 
 BouncingSnowball::BouncingSnowball(const lisp::Lisp& reader)
-       : BadGuy(reader, "images/creatures/bouncing_snowball/bouncing_snowball.sprite")
+        : BadGuy(reader, "images/creatures/bouncing_snowball/bouncing_snowball.sprite")
 {
 }
 
index f952492..bfed64a 100644 (file)
@@ -29,7 +29,7 @@ namespace {
 static const std::string SOUNDFILE = "sounds/flame.wav";
 
 Dart::Dart(const lisp::Lisp& reader)
-       : BadGuy(reader, "images/creatures/dart/dart.sprite"), parent(0)
+        : BadGuy(reader, "images/creatures/dart/dart.sprite"), parent(0)
 {
   physic.enable_gravity(false);
   countMe = false;
@@ -39,7 +39,7 @@ Dart::Dart(const lisp::Lisp& reader)
 }
 
 Dart::Dart(const Vector& pos, Direction d, const BadGuy* parent = 0)
-       : BadGuy(pos, d, "images/creatures/dart/dart.sprite"), parent(parent)
+        : BadGuy(pos, d, "images/creatures/dart/dart.sprite"), parent(parent)
 {
   physic.enable_gravity(false);
   countMe = false;
@@ -49,7 +49,7 @@ Dart::Dart(const Vector& pos, Direction d, const BadGuy* parent = 0)
 }
 
 Dart::Dart(const Dart& other)
-       : BadGuy(other), parent(other.parent)
+        : BadGuy(other), parent(other.parent)
 {
   sound_manager->preload(SOUNDFILE);
   sound_manager->preload("sounds/darthit.wav");
index 41cc585..b2e7f55 100644 (file)
@@ -27,7 +27,7 @@ namespace {
 }
 
 DartTrap::DartTrap(const lisp::Lisp& reader)
-       : BadGuy(reader, "images/creatures/darttrap/darttrap.sprite", LAYER_TILES-1), initial_delay(0), fire_delay(2), ammo(-1), state(IDLE)
+  : BadGuy(reader, "images/creatures/darttrap/darttrap.sprite", LAYER_TILES-1), initial_delay(0), fire_delay(2), ammo(-1), state(IDLE)
 {
   reader.get("initial-delay", initial_delay);
   reader.get("fire-delay", fire_delay);
index 14615f4..3bbe81b 100644 (file)
@@ -24,7 +24,7 @@
 #include "random_generator.hpp"
 
 Dispenser::Dispenser(const lisp::Lisp& reader)
-       : BadGuy(reader, "images/creatures/dispenser/dispenser.sprite")
+        : BadGuy(reader, "images/creatures/dispenser/dispenser.sprite")
 {
   set_colgroup_active(COLGROUP_MOVING_STATIC);
   sound_manager->preload("sounds/squish.wav");
index e34c4b6..e83fbd4 100644 (file)
@@ -28,13 +28,13 @@ static const float FISH_JUMP_POWER = -600;
 static const float FISH_WAIT_TIME = 1;
 
 Fish::Fish(const lisp::Lisp& reader)
-       : BadGuy(reader, "images/creatures/fish/fish.sprite", LAYER_TILES-1), stop_y(0)
+  : BadGuy(reader, "images/creatures/fish/fish.sprite", LAYER_TILES-1), stop_y(0)
 {
   physic.enable_gravity(true);
 }
 
 Fish::Fish(const Vector& pos)
-       : BadGuy(pos, "images/creatures/fish/fish.sprite", LAYER_TILES-1), stop_y(0)
+  : BadGuy(pos, "images/creatures/fish/fish.sprite", LAYER_TILES-1), stop_y(0)
 {
   physic.enable_gravity(true);
 }
index baeed33..9b76261 100644 (file)
@@ -31,13 +31,13 @@ namespace {
 }
 
 FlyingSnowBall::FlyingSnowBall(const lisp::Lisp& reader)
-       : BadGuy(reader, "images/creatures/flying_snowball/flying_snowball.sprite")
+        : BadGuy(reader, "images/creatures/flying_snowball/flying_snowball.sprite")
 {
   physic.enable_gravity(true);
 }
 
 FlyingSnowBall::FlyingSnowBall(const Vector& pos)
-       : BadGuy(pos, "images/creatures/flying_snowball/flying_snowball.sprite")
+        : BadGuy(pos, "images/creatures/flying_snowball/flying_snowball.sprite")
 {
   physic.enable_gravity(true);
 }
index e343621..124712e 100644 (file)
@@ -83,13 +83,13 @@ GhostTree::active_update(float elapsed_time)
 
       Color col;
       switch(treecolor) {
-       case 0: col = Color(1, 0, 0); break;
-       case 1: col = Color(0, 1, 0); break;
-       case 2: col = Color(0, 0, 1); break;
-       case 3: col = Color(1, 1, 0); break;
-       case 4: col = Color(1, 0, 1); break;
-       case 5: col = Color(0, 1, 1); break;
-       default: assert(false);
+        case 0: col = Color(1, 0, 0); break;
+        case 1: col = Color(0, 1, 0); break;
+        case 2: col = Color(0, 0, 1); break;
+        case 3: col = Color(1, 1, 0); break;
+        case 4: col = Color(1, 0, 1); break;
+        case 5: col = Color(0, 1, 1); break;
+        default: assert(false);
       }
       glow_sprite->set_color(col);
     }
@@ -99,50 +99,50 @@ GhostTree::active_update(float elapsed_time)
       sound_manager->play("sounds/tree_suck.ogg", get_pos());
       std::vector<TreeWillOWisp*>::iterator iter;
       for(iter = willowisps.begin(); iter != willowisps.end(); ++iter) {
-       TreeWillOWisp *willo = *iter;
-       if(willo->get_color() == col) {
-         willo->start_sucking(get_bbox().get_middle() + SUCK_TARGET_OFFSET + Vector(systemRandom.randf(-SUCK_TARGET_SPREAD, SUCK_TARGET_SPREAD), systemRandom.randf(-SUCK_TARGET_SPREAD, SUCK_TARGET_SPREAD)));
-       }
+        TreeWillOWisp *willo = *iter;
+        if(willo->get_color() == col) {
+          willo->start_sucking(get_bbox().get_middle() + SUCK_TARGET_OFFSET + Vector(systemRandom.randf(-SUCK_TARGET_SPREAD, SUCK_TARGET_SPREAD), systemRandom.randf(-SUCK_TARGET_SPREAD, SUCK_TARGET_SPREAD)));
+        }
       }
       mystate = STATE_SUCKING;
     }
 
     if(willowisp_timer.check()) {
       if(willowisps.size() < WILLOWISP_COUNT) {
-       Vector pos = Vector(bbox.get_width() / 2, bbox.get_height() / 2 + willo_spawn_y + WILLOWISP_TOP_OFFSET);
-       TreeWillOWisp *willowisp 
-               = new TreeWillOWisp(this, pos, 200 + willo_radius, willo_speed);
+        Vector pos = Vector(bbox.get_width() / 2, bbox.get_height() / 2 + willo_spawn_y + WILLOWISP_TOP_OFFSET);
+        TreeWillOWisp *willowisp 
+            = new TreeWillOWisp(this, pos, 200 + willo_radius, willo_speed);
 
-       Sector::current()->add_object(willowisp);
-       willowisps.push_back(willowisp);
+        Sector::current()->add_object(willowisp);
+        willowisps.push_back(willowisp);
 
-       willo_spawn_y -= 40;
-       if(willo_spawn_y < -160)
-         willo_spawn_y = 0;
+        willo_spawn_y -= 40;
+        if(willo_spawn_y < -160)
+          willo_spawn_y = 0;
 
-       willo_radius += 20;
-       if(willo_radius > 120)
-         willo_radius = 0;
+        willo_radius += 20;
+        if(willo_radius > 120)
+          willo_radius = 0;
 
-       if(willo_speed == 1.8f) {
-         willo_speed = 1.5f;
-       } else {
-         willo_speed = 1.8f;
-       }
+        if(willo_speed == 1.8f) {
+          willo_speed = 1.5f;
+        } else {
+          willo_speed = 1.8f;
+        }
 
-       do {
-         willo_color = (willo_color + 1) % 3;
-       } while(willo_color == treecolor);
+        do {
+          willo_color = (willo_color + 1) % 3;
+        } while(willo_color == treecolor);
 
-       switch(willo_color) {
-         case 0: willowisp->set_color(Color(1, 0, 0)); break;
-         case 1: willowisp->set_color(Color(0, 1, 0)); break;
-         case 2: willowisp->set_color(Color(0, 0, 1)); break;
-         case 3: willowisp->set_color(Color(1, 1, 0)); break;
-         case 4: willowisp->set_color(Color(1, 0, 1)); break;
-         case 5: willowisp->set_color(Color(0, 1, 1)); break;
-         default: assert(false);
-       }
+        switch(willo_color) {
+          case 0: willowisp->set_color(Color(1, 0, 0)); break;
+          case 1: willowisp->set_color(Color(0, 1, 0)); break;
+          case 2: willowisp->set_color(Color(0, 0, 1)); break;
+          case 3: willowisp->set_color(Color(1, 1, 0)); break;
+          case 4: willowisp->set_color(Color(1, 0, 1)); break;
+          case 5: willowisp->set_color(Color(0, 1, 1)); break;
+          default: assert(false);
+        }
       }
     }
 
index ebfdc36..17ba0c9 100644 (file)
@@ -31,13 +31,13 @@ namespace{
 }
 
 KamikazeSnowball::KamikazeSnowball(const lisp::Lisp& reader)
-       : BadGuy(reader, "images/creatures/snowball/kamikaze-snowball.sprite")
+  : BadGuy(reader, "images/creatures/snowball/kamikaze-snowball.sprite")
 {
   sound_manager->preload(SPLAT_SOUND);
 }
 
 KamikazeSnowball::KamikazeSnowball(const Vector& pos, Direction d)
-       : BadGuy(pos, d, "images/creatures/snowball/kamikaze-snowball.sprite")
+  : BadGuy(pos, d, "images/creatures/snowball/kamikaze-snowball.sprite")
 {
   sound_manager->preload(SPLAT_SOUND);
 }
index 96d585f..7f1bb7e 100644 (file)
@@ -33,7 +33,7 @@ static const float THROW_INTERVAL = 1; /**< time between two thrown rocks */
 static const float THROW_VELOCITY = 400; /**< initial velocity of thrown rocks */
 
 Mole::Mole(const lisp::Lisp& reader)
-       : BadGuy(reader, "images/creatures/mole/mole.sprite", LAYER_TILES-1), state(PRE_THROWING)
+  : BadGuy(reader, "images/creatures/mole/mole.sprite", LAYER_TILES-1), state(PRE_THROWING)
 {
   physic.enable_gravity(false);
   sound_manager->preload("sounds/fall.wav");
@@ -42,7 +42,7 @@ Mole::Mole(const lisp::Lisp& reader)
 }
 
 Mole::Mole(const Vector& pos)
-       : BadGuy(pos, "images/creatures/mole/mole.sprite", LAYER_TILES-1), state(PRE_THROWING)
+  : BadGuy(pos, "images/creatures/mole/mole.sprite", LAYER_TILES-1), state(PRE_THROWING)
 {
   physic.enable_gravity(false);
   sound_manager->preload("sounds/fall.wav");
@@ -110,26 +110,26 @@ Mole::active_update(float elapsed_time)
   switch (state) {
     case PRE_THROWING:
       if (timer.check()) {
-       set_state(THROWING);
+        set_state(THROWING);
       }
       break;
     case THROWING:
       if (throw_timer.check()) {
         throw_rock();
-       throw_timer.start(THROW_INTERVAL);
+        throw_timer.start(THROW_INTERVAL);
       }
       if (timer.check()) {
-       set_state(POST_THROWING);
+        set_state(POST_THROWING);
       }
       break;
     case POST_THROWING:
       if (timer.check()) {
-       set_state(PEEKING);
+        set_state(PEEKING);
       }
       break;
     case PEEKING:
       if (sprite->animation_done()) {
-       set_state(PRE_THROWING);
+        set_state(PRE_THROWING);
       }
       break;
     case DEAD:
index 14529c9..bf91870 100644 (file)
@@ -23,7 +23,7 @@
 #include "mole_rock.hpp"
 
 MoleRock::MoleRock(const lisp::Lisp& reader)
-       : BadGuy(reader, "images/creatures/mole/mole_rock.sprite", LAYER_TILES - 2), parent(0), initial_velocity(Vector(0, -400))
+        : BadGuy(reader, "images/creatures/mole/mole_rock.sprite", LAYER_TILES - 2), parent(0), initial_velocity(Vector(0, -400))
 {
   physic.enable_gravity(true);
   countMe = false;
@@ -32,7 +32,7 @@ MoleRock::MoleRock(const lisp::Lisp& reader)
 }
 
 MoleRock::MoleRock(const Vector& pos, const Vector& velocity, const BadGuy* parent = 0)
-       : BadGuy(pos, LEFT, "images/creatures/mole/mole_rock.sprite", LAYER_TILES - 2), parent(parent), initial_velocity(velocity)
+        : BadGuy(pos, LEFT, "images/creatures/mole/mole_rock.sprite", LAYER_TILES - 2), parent(parent), initial_velocity(velocity)
 {
   physic.enable_gravity(true);
   countMe = false;
@@ -41,7 +41,7 @@ MoleRock::MoleRock(const Vector& pos, const Vector& velocity, const BadGuy* pare
 }
 
 MoleRock::MoleRock(const MoleRock& other)
-       : BadGuy(other), parent(other.parent), initial_velocity(Vector(0, -400))
+        : BadGuy(other), parent(other.parent), initial_velocity(Vector(0, -400))
 {
   sound_manager->preload("sounds/fall.wav");
   sound_manager->preload("sounds/stomp.wav");
index fca8766..1ed8240 100644 (file)
@@ -26,7 +26,7 @@
 #include "audio/sound_manager.hpp"
 
 MrBomb::MrBomb(const lisp::Lisp& reader)
-       : WalkingBadguy(reader, "images/creatures/mr_bomb/mr_bomb.sprite", "left", "right")
+  : WalkingBadguy(reader, "images/creatures/mr_bomb/mr_bomb.sprite", "left", "right")
 {
   walk_speed = 80;
   max_drop_height = 16;
@@ -49,7 +49,7 @@ MrBomb::MrBomb(const lisp::Lisp& reader)
 
 /* MrBomb created by a dispenser always gets default sprite atm.*/
 MrBomb::MrBomb(const Vector& pos, Direction d)
-       : WalkingBadguy(pos, d, "images/creatures/mr_bomb/mr_bomb.sprite", "left", "right")
+  : WalkingBadguy(pos, d, "images/creatures/mr_bomb/mr_bomb.sprite", "left", "right")
 {
   walk_speed = 80;
   max_drop_height = 16;
index 7ab2837..d224537 100644 (file)
@@ -185,7 +185,7 @@ MrIceBlock::collision_squished(GameObject& object)
     case ICESTATE_KICKED:
     case ICESTATE_NORMAL:
       {
-       Player* player = dynamic_cast<Player*>(&object);
+        Player* player = dynamic_cast<Player*>(&object);
         squishcount++;
         if ((squishcount >= MAXSQUISHES) || (player && player->does_buttjump)) {
           kill_fall();
@@ -198,12 +198,12 @@ MrIceBlock::collision_squished(GameObject& object)
       break;
     case ICESTATE_FLAT:
       {
-       MovingObject* movingobject = dynamic_cast<MovingObject*>(&object);
-       if (movingobject && (movingobject->get_pos().x < get_pos().x)) {
-         dir = RIGHT;
-       } else {
-         dir = LEFT;
-       }
+        MovingObject* movingobject = dynamic_cast<MovingObject*>(&object);
+        if (movingobject && (movingobject->get_pos().x < get_pos().x)) {
+          dir = RIGHT;
+        } else {
+          dir = LEFT;
+        }
       }
       if (nokick_timer.check()) set_state(ICESTATE_KICKED);
       break;
index 33c6020..6186160 100644 (file)
 static const float SPEED = 200;
 
 MrRocket::MrRocket(const lisp::Lisp& reader)
-       : BadGuy(reader, "images/creatures/mr_rocket/mr_rocket.sprite")
+        : BadGuy(reader, "images/creatures/mr_rocket/mr_rocket.sprite")
 {
 }
 
 MrRocket::MrRocket(const Vector& pos, Direction d)
-       : BadGuy(pos, d, "images/creatures/mr_rocket/mr_rocket.sprite")
+        : BadGuy(pos, d, "images/creatures/mr_rocket/mr_rocket.sprite")
 {
 }
 
index 27db59b..cebc0c5 100644 (file)
@@ -25,7 +25,7 @@ static const float WALKSPEED = 80;
 static const float WAKE_TIME = .5;
 
 Plant::Plant(const lisp::Lisp& reader)
-       : BadGuy(reader, "images/creatures/plant/plant.sprite")
+        : BadGuy(reader, "images/creatures/plant/plant.sprite")
 {
   state = PLANT_SLEEPING;
 }
index 67b4c7f..4d1d75a 100644 (file)
 #include "object/sprite_particle.hpp"
 
 PoisonIvy::PoisonIvy(const lisp::Lisp& reader)
-       : WalkingBadguy(reader, "images/creatures/poison_ivy/poison_ivy.sprite", "left", "right")
+        : WalkingBadguy(reader, "images/creatures/poison_ivy/poison_ivy.sprite", "left", "right")
 {
   walk_speed = 80;
 }
 
 PoisonIvy::PoisonIvy(const Vector& pos, Direction d)
-       : WalkingBadguy(pos, d, "images/creatures/poison_ivy/poison_ivy.sprite", "left", "right")
+        : WalkingBadguy(pos, d, "images/creatures/poison_ivy/poison_ivy.sprite", "left", "right")
 {
   walk_speed = 80;
 }
index 3c1fe3e..6de656e 100644 (file)
@@ -31,13 +31,13 @@ namespace {
 }
 
 SkullyHop::SkullyHop(const lisp::Lisp& reader)
-       : BadGuy(reader, "images/creatures/skullyhop/skullyhop.sprite")
+        : BadGuy(reader, "images/creatures/skullyhop/skullyhop.sprite")
 {
   sound_manager->preload( HOP_SOUND );
 }
 
 SkullyHop::SkullyHop(const Vector& pos, Direction d)
-       : BadGuy(pos, d, "images/creatures/skullyhop/skullyhop.sprite")
+        : BadGuy(pos, d, "images/creatures/skullyhop/skullyhop.sprite")
 {
   sound_manager->preload( HOP_SOUND );
 }
index aaf433b..b8be2b9 100644 (file)
 #include "smartball.hpp"
 
 SmartBall::SmartBall(const lisp::Lisp& reader)
-       : WalkingBadguy(reader, "images/creatures/snowball/smart-snowball.sprite", "left", "right")
+  : WalkingBadguy(reader, "images/creatures/snowball/smart-snowball.sprite", "left", "right")
 {
   walk_speed = 80;
   max_drop_height = 16;
 }
 
 SmartBall::SmartBall(const Vector& pos, Direction d)
-       : WalkingBadguy(pos, d, "images/creatures/snowball/smart-snowball.sprite", "left", "right")
+  : WalkingBadguy(pos, d, "images/creatures/snowball/smart-snowball.sprite", "left", "right")
 {
   walk_speed = 80;
   max_drop_height = 16;
index 8533d7d..528ed59 100644 (file)
@@ -115,19 +115,19 @@ Snail::active_update(float elapsed_time)
 
     case STATE_FLAT:
       if (flat_timer.started()) {
-       sprite->set_fps(64 - 15 * flat_timer.get_timegone());
+        sprite->set_fps(64 - 15 * flat_timer.get_timegone());
       }
       if (flat_timer.check()) {
-       be_normal();
+        be_normal();
       }
       BadGuy::active_update(elapsed_time);
       break;
 
     case STATE_KICKED_DELAY:
       if (kicked_delay_timer.check()) {
-       physic.set_velocity_x(dir == LEFT ? -KICKSPEED : KICKSPEED);
-       physic.set_velocity_y(KICKSPEED_Y);
-       state = STATE_KICKED;
+        physic.set_velocity_x(dir == LEFT ? -KICKSPEED : KICKSPEED);
+        physic.set_velocity_y(KICKSPEED_Y);
+        state = STATE_KICKED;
       }
       BadGuy::active_update(elapsed_time);
       break;
@@ -152,33 +152,33 @@ Snail::collision_solid(const CollisionHit& hit)
       break;
     case STATE_FLAT:
       if(hit.top || hit.bottom) {
-       physic.set_velocity_y(0);
+        physic.set_velocity_y(0);
       }
       if(hit.left || hit.right) {
       }
       break;
     case STATE_KICKED_DELAY:
       if(hit.top || hit.bottom) {
-       physic.set_velocity_y(0);
+        physic.set_velocity_y(0);
       }
       if(hit.left || hit.right) {
-       physic.set_velocity_x(0);
+        physic.set_velocity_x(0);
       }
       break;
     case STATE_KICKED:
       if(hit.top || hit.bottom) {
-       physic.set_velocity_y(0);
+        physic.set_velocity_y(0);
       }
       if(hit.left || hit.right) {
-       sound_manager->play("sounds/iceblock_bump.wav", get_pos());
+        sound_manager->play("sounds/iceblock_bump.wav", get_pos());
 
-       if( ( dir == LEFT && hit.left ) || ( dir == RIGHT && hit.right) ){
-         dir = (dir == LEFT) ? RIGHT : LEFT;
-         sprite->set_action(dir == LEFT ? "flat-left" : "flat-right");
+        if( ( dir == LEFT && hit.left ) || ( dir == RIGHT && hit.right) ){
+          dir = (dir == LEFT) ? RIGHT : LEFT;
+          sprite->set_action(dir == LEFT ? "flat-left" : "flat-right");
 
-         physic.set_velocity_x(-physic.get_velocity_x()*0.75);
-         if (fabsf(physic.get_velocity_x()) < walk_speed) be_normal();
-       }
+          physic.set_velocity_x(-physic.get_velocity_x()*0.75);
+          if (fabsf(physic.get_velocity_x()) < walk_speed) be_normal();
+        }
 
       }
       break;
@@ -213,7 +213,7 @@ Snail::collision_squished(GameObject& object)
     case STATE_KICKED:
     case STATE_NORMAL:
       {
-       Player* player = dynamic_cast<Player*>(&object);
+        Player* player = dynamic_cast<Player*>(&object);
         squishcount++;
         if ((squishcount >= MAXSQUISHES) || (player && player->does_buttjump)) {
           kill_fall();
@@ -228,12 +228,12 @@ Snail::collision_squished(GameObject& object)
     case STATE_FLAT:
       sound_manager->play("sounds/kick.wav", get_pos());
       {
-       MovingObject* movingobject = dynamic_cast<MovingObject*>(&object);
-       if (movingobject && (movingobject->get_pos().x < get_pos().x)) {
-         dir = RIGHT;
-       } else {
-         dir = LEFT;
-       }
+        MovingObject* movingobject = dynamic_cast<MovingObject*>(&object);
+        if (movingobject && (movingobject->get_pos().x < get_pos().x)) {
+          dir = RIGHT;
+        } else {
+          dir = LEFT;
+        }
       }
       be_kicked();
       break;
index 8ea7e74..28b4a80 100644 (file)
@@ -26,13 +26,13 @@ static const float FLYTIME = 1.2f;
 static const float FLYSPEED = -100.0f;
 
 SpiderMite::SpiderMite(const lisp::Lisp& reader)
-       : BadGuy(reader, "images/creatures/spidermite/spidermite.sprite")
+  : BadGuy(reader, "images/creatures/spidermite/spidermite.sprite")
 {
   physic.enable_gravity(false);
 }
 
 SpiderMite::SpiderMite(const Vector& pos)
-       : BadGuy(pos, "images/creatures/spidermite/spidermite.sprite")
+  : BadGuy(pos, "images/creatures/spidermite/spidermite.sprite")
 {
   physic.enable_gravity(false);
 }
index eebf19a..d27cdfa 100644 (file)
@@ -22,7 +22,7 @@
 #include "spiky.hpp"
 
 Spiky::Spiky(const lisp::Lisp& reader)
-       : WalkingBadguy(reader, "images/creatures/spiky/spiky.sprite", "left", "right")
+        : WalkingBadguy(reader, "images/creatures/spiky/spiky.sprite", "left", "right")
 {
   walk_speed = 80;
   max_drop_height = 600;
index 68ebaaa..3980b9c 100644 (file)
@@ -24,7 +24,7 @@
 static const float WALKSPEED = 80;
 
 SSpiky::SSpiky(const lisp::Lisp& reader)
-       : WalkingBadguy(reader, "images/creatures/spiky/sleepingspiky.sprite", "left", "right"), state(SSPIKY_SLEEPING)
+        : WalkingBadguy(reader, "images/creatures/spiky/sleepingspiky.sprite", "left", "right"), state(SSPIKY_SLEEPING)
 {
   walk_speed = WALKSPEED;
   max_drop_height = -1;
index 8dc7f84..dad7103 100644 (file)
@@ -28,7 +28,7 @@ static const float SQUISH_TIME = 2;
 static const float SHAKE_RANGE_Y = 400;
 
 Stalactite::Stalactite(const lisp::Lisp& lisp)
-       : BadGuy(lisp, "images/creatures/stalactite/stalactite.sprite", LAYER_TILES - 1), state(STALACTITE_HANGING)
+        : BadGuy(lisp, "images/creatures/stalactite/stalactite.sprite", LAYER_TILES - 1), state(STALACTITE_HANGING)
 {
   countMe = false;
 }
@@ -51,7 +51,7 @@ Stalactite::active_update(float elapsed_time)
       if(player->get_bbox().p2.x > bbox.p1.x - SHAKE_RANGE_X
           && player->get_bbox().p1.x < bbox.p2.x + SHAKE_RANGE_X
           && player->get_bbox().p2.y > bbox.p1.y
-         && player->get_bbox().p1.y < bbox.p2.y + SHAKE_RANGE_Y) {
+          && player->get_bbox().p1.y < bbox.p2.y + SHAKE_RANGE_Y) {
         timer.start(SHAKE_TIME);
         state = STALACTITE_SHAKING;
       }
index 2cac026..73dfc6b 100644 (file)
@@ -74,7 +74,7 @@ Stumpy::active_update(float elapsed_time)
   switch (mystate) {
     case STATE_INVINCIBLE:
       if (invincible_timer.check()) {
-       mystate = STATE_NORMAL;
+        mystate = STATE_NORMAL;
         WalkingBadguy::initialize();
       }
       BadGuy::active_update(elapsed_time);
@@ -149,10 +149,10 @@ Stumpy::collision_badguy(BadGuy& badguy, const CollisionHit& hit)
   switch (mystate) {
     case STATE_INVINCIBLE:
       if(hit.top || hit.bottom) {
-       physic.set_velocity_y(0);
+        physic.set_velocity_y(0);
       }
       if(hit.left || hit.right) {
-       physic.set_velocity_x(0);
+        physic.set_velocity_x(0);
       }
       return CONTINUE;
       break;
index 3df4901..0f0582b 100644 (file)
@@ -30,13 +30,13 @@ namespace {
 }
 
 Toad::Toad(const lisp::Lisp& reader)
-       : BadGuy(reader, "images/creatures/toad/toad.sprite")
+        : BadGuy(reader, "images/creatures/toad/toad.sprite")
 {
   sound_manager->preload(HOP_SOUND);
 }
 
 Toad::Toad(const Vector& pos, Direction d)
-       : BadGuy(pos, d, "images/creatures/toad/toad.sprite")
+        : BadGuy(pos, d, "images/creatures/toad/toad.sprite")
 {
   sound_manager->preload(HOP_SOUND);
 }
index cd4d975..6cca78c 100644 (file)
@@ -29,7 +29,7 @@ static const float JUMP_OFF_SPEED_Y = -500;
 static const std::string LAND_ON_TOTEM_SOUND = "sounds/totem.ogg";
 
 Totem::Totem(const lisp::Lisp& reader)
-       : BadGuy(reader, "images/creatures/totem/totem.sprite")
+  : BadGuy(reader, "images/creatures/totem/totem.sprite")
 {
   carrying = 0;
   carried_by = 0;
@@ -37,7 +37,7 @@ Totem::Totem(const lisp::Lisp& reader)
 }
 
 Totem::Totem(const Totem& other)
-       : BadGuy(other), carrying(other.carrying), carried_by(other.carried_by)
+  : BadGuy(other), carrying(other.carrying), carried_by(other.carried_by)
 {
   sound_manager->preload( LAND_ON_TOTEM_SOUND );
 }
@@ -103,27 +103,27 @@ Totem::active_update(float elapsed_time)
     if (s) {
       // jump a bit if we find a suitable totem
       for (std::vector<MovingObject*>::iterator i = s->moving_objects.begin(); i != s->moving_objects.end(); i++) {
-       Totem* t = dynamic_cast<Totem*>(*i);
-       if (!t) continue;
+        Totem* t = dynamic_cast<Totem*>(*i);
+        if (!t) continue;
 
-       // skip if we are not approaching each other
-       if (!((this->dir == LEFT) && (t->dir == RIGHT))) continue;
+        // skip if we are not approaching each other
+        if (!((this->dir == LEFT) && (t->dir == RIGHT))) continue;
 
-       Vector p1 = this->get_pos();
-       Vector p2 = t->get_pos();
+        Vector p1 = this->get_pos();
+        Vector p2 = t->get_pos();
 
-       // skip if not on same height
-       float dy = (p1.y - p2.y);
-       if (fabsf(dy - 0) > 2) continue;
+        // skip if not on same height
+        float dy = (p1.y - p2.y);
+        if (fabsf(dy - 0) > 2) continue;
 
-       // skip if too far away
-       float dx = (p1.x - p2.x);
-       if (fabsf(dx - 128) > 2) continue;
+        // skip if too far away
+        float dx = (p1.x - p2.x);
+        if (fabsf(dx - 128) > 2) continue;
 
-       physic.set_velocity_y(JUMP_ON_SPEED_Y);
-       p1.y -= 1;
-       this->set_pos(p1);
-       break;
+        physic.set_velocity_y(JUMP_ON_SPEED_Y);
+        p1.y -= 1;
+        this->set_pos(p1);
+        break;
       }
     }
   }
index fe57032..3ac8aa5 100644 (file)
 #include "timer.hpp"
 
 WalkingBadguy::WalkingBadguy(const Vector& pos, const std::string& sprite_name, const std::string& walk_left_action, const std::string& walk_right_action, int layer)
-       : BadGuy(pos, sprite_name, layer), walk_left_action(walk_left_action), walk_right_action(walk_right_action), walk_speed(80), max_drop_height(-1)
+  : BadGuy(pos, sprite_name, layer), walk_left_action(walk_left_action), walk_right_action(walk_right_action), walk_speed(80), max_drop_height(-1)
 {
 }
 
 WalkingBadguy::WalkingBadguy(const Vector& pos, Direction direction, const std::string& sprite_name, const std::string& walk_left_action, const std::string& walk_right_action, int layer)
-       : BadGuy(pos, direction, sprite_name, layer), walk_left_action(walk_left_action), walk_right_action(walk_right_action), walk_speed(80), max_drop_height(-1)
+  : BadGuy(pos, direction, sprite_name, layer), walk_left_action(walk_left_action), walk_right_action(walk_right_action), walk_speed(80), max_drop_height(-1)
 {
 }
 
 WalkingBadguy::WalkingBadguy(const lisp::Lisp& reader, const std::string& sprite_name, const std::string& walk_left_action, const std::string& walk_right_action, int layer)
-       : BadGuy(reader, sprite_name, layer), walk_left_action(walk_left_action), walk_right_action(walk_right_action), walk_speed(80), max_drop_height(-1)
+  : BadGuy(reader, sprite_name, layer), walk_left_action(walk_left_action), walk_right_action(walk_right_action), walk_speed(80), max_drop_height(-1)
 {
 }
 
index a057441..c487e0c 100644 (file)
 #include "object/sprite_particle.hpp"
 
 WalkingLeaf::WalkingLeaf(const lisp::Lisp& reader)
-       : WalkingBadguy(reader, "images/creatures/walkingleaf/walkingleaf.sprite", "left", "right")
+        : WalkingBadguy(reader, "images/creatures/walkingleaf/walkingleaf.sprite", "left", "right")
 {
   walk_speed = 60;
   max_drop_height = 16;
 }
 
 WalkingLeaf::WalkingLeaf(const Vector& pos, Direction d)
-       : WalkingBadguy(pos, d, "images/creatures/walkingleaf/walkingleaf.sprite", "left", "right")
+        : WalkingBadguy(pos, d, "images/creatures/walkingleaf/walkingleaf.sprite", "left", "right")
 {
   walk_speed = 60;
   max_drop_height = 16;
index b0fe7c6..eafe287 100644 (file)
@@ -251,7 +251,7 @@ WillOWisp::set_state(const std::string& new_state)
   } else {
     std::ostringstream msg;
     msg << "Can't set unknown willowisp state '" << new_state << "', should "
-               "be stopped, move_path, move_path_track or normal";
+                "be stopped, move_path, move_path_track or normal";
     throw new std::runtime_error(msg.str());
   }
 }
index 1c03906..2eca07e 100644 (file)
@@ -53,7 +53,7 @@ namespace {
 }
 
 Yeti::Yeti(const lisp::Lisp& reader)
-       : BadGuy(reader, "images/creatures/yeti/yeti.sprite")
+  : BadGuy(reader, "images/creatures/yeti/yeti.sprite")
 {
   hit_points = INITIAL_HITPOINTS;
   countMe = false;
@@ -290,28 +290,28 @@ Yeti::collision_solid(const CollisionHit& hit)
     physic.set_velocity_y(0);
     switch (state) {
       case JUMP_DOWN:
-       run();
-       break;
+        run();
+        break;
       case RUN:
-       break;
+        break;
       case JUMP_UP:
-       break;
+        break;
       case BE_ANGRY:
-       // we just landed
-       if(!state_timer.started()) {
-         sprite->set_action((dir==RIGHT)?"stand-right":"stand-left");
-         stomp_count++;
-         drop_stalactite();
-
-         // go to other side after 3 jumps
-         if(stomp_count == 3) {
-           jump_down();
-         } else {
-           // jump again
-           state_timer.start(STOMP_WAIT);
-         }
-       }
-       break;
+        // we just landed
+        if(!state_timer.started()) {
+          sprite->set_action((dir==RIGHT)?"stand-right":"stand-left");
+          stomp_count++;
+          drop_stalactite();
+
+          // go to other side after 3 jumps
+          if(stomp_count == 3) {
+            jump_down();
+          } else {
+            // jump again
+            state_timer.start(STOMP_WAIT);
+          }
+        }
+        break;
       case SQUISHED:
         break;
     }
index ffea907..83c6adf 100644 (file)
@@ -26,7 +26,7 @@
 #include "random_generator.hpp"
 
 Zeekling::Zeekling(const lisp::Lisp& reader)
-       : BadGuy(reader, "images/creatures/zeekling/zeekling.sprite"), last_player(0)
+        : BadGuy(reader, "images/creatures/zeekling/zeekling.sprite"), last_player(0)
 {
   state = FLYING;
   speed = systemRandom.rand(130, 171);
@@ -34,7 +34,7 @@ Zeekling::Zeekling(const lisp::Lisp& reader)
 }
 
 Zeekling::Zeekling(const Vector& pos, Direction d)
-       : BadGuy(pos, d, "images/creatures/zeekling/zeekling.sprite"), last_player(0)
+        : BadGuy(pos, d, "images/creatures/zeekling/zeekling.sprite"), last_player(0)
 {
   state = FLYING;
   speed = systemRandom.rand(130, 171);
index 28ea36c..fb1f5f3 100644 (file)
@@ -233,7 +233,7 @@ sq_insert_command(std::list<std::string>& cmds, HSQUIRRELVM vm, std::string tabl
       key_string+=".";
       if (search_prefix.substr(0, key_string.length()) == key_string) {
         sq_getclass(vm, -1);
-       sq_insert_commands(cmds, vm, key_string, search_prefix);
+        sq_insert_commands(cmds, vm, key_string, search_prefix);
         sq_pop(vm, 1);
       }
       break;
@@ -241,7 +241,7 @@ sq_insert_command(std::list<std::string>& cmds, HSQUIRRELVM vm, std::string tabl
     case OT_CLASS:
       key_string+=".";
       if (search_prefix.substr(0, key_string.length()) == key_string) {
-       sq_insert_commands(cmds, vm, key_string, search_prefix);
+        sq_insert_commands(cmds, vm, key_string, search_prefix);
       }
       break;
     case OT_CLOSURE:
index 3a0b7da..e3bba1b 100644 (file)
@@ -567,7 +567,7 @@ JoystickKeyboardController::process_console_key_event(const SDL_Event& event)
     default:
       int c = event.key.keysym.unicode;
       if ((c >= 32) && (c <= 126)) {
-       Console::instance->input((char)c);
+        Console::instance->input((char)c);
       }
       break;
   }
index 26f65f1..ecf7f92 100644 (file)
@@ -476,7 +476,7 @@ GameSession::setup()
   current_ = this;
 
   if(currentsector != Sector::current()) {
-       currentsector->activate(currentsector->player->get_pos());
+        currentsector->activate(currentsector->player->get_pos());
   }
   currentsector->play_music(LEVEL_MUSIC);
 
@@ -605,7 +605,7 @@ GameSession::start_sequence(const std::string& sequencename)
 
   // abort if a sequence is already playing
   if (end_sequence)
-         return;
+          return;
 
   if (sequencename == "endsequence") {
     if (currentsector->get_players()[0]->physic.get_velocity_x() < 0) {
@@ -631,7 +631,7 @@ GameSession::start_sequence(const std::string& sequencename)
 
   // Stop all clocks.
   for(std::vector<GameObject*>::iterator i = currentsector->gameobjects.begin();
-                 i != currentsector->gameobjects.end(); ++i)
+                  i != currentsector->gameobjects.end(); ++i)
   {
     GameObject* obj = *i;
 
index 6b16a13..b41b1cb 100644 (file)
@@ -94,7 +94,7 @@ switch(event.type)
         state = BT_SELECTED;
       }
     break;
-  case SDL_KEYDOWN:    // key pressed
+  case SDL_KEYDOWN:        // key pressed
     if(event.key.keysym.sym == binding)
       state = BT_SELECTED;
     break;
index 5338ba8..6d6c2f6 100644 (file)
@@ -310,11 +310,11 @@ Menu::add_label(const std::string& text)
 
 MenuItem*
 Menu::add_controlfield(int id, const std::string& text,
-               const std::string& mapping)
+                const std::string& mapping)
 {
   MenuItem* item = new MenuItem(MN_CONTROLFIELD, id);
   item->change_text(text);
-       item->change_input(mapping);
+        item->change_input(mapping);
   additem(item);
   return item;
 }
@@ -561,7 +561,7 @@ Menu::update()
         {
           int i = items[active_item]->input.size();
 
-          while(delete_character > 0)  /* remove characters */
+          while(delete_character > 0)        /* remove characters */
           {
             items[active_item]->input.resize(i-1);
             delete_character--;
index a558adc..4f7697c 100644 (file)
@@ -107,7 +107,7 @@ Parser::parse_error(const char* msg) const
 {
   std::stringstream emsg;
   emsg << "Parse Error at '" << filename << "' line " << lexer->getLineNumber()
-         << ": " << msg;
+       << ": " << msg;
   throw std::runtime_error(emsg.str());
 }
 
@@ -117,7 +117,7 @@ Parser::read()
   Lisp* result;
   switch(token) {
     case Lexer::TOKEN_EOF: {
-         parse_error("Unexpected EOF.");
+      parse_error("Unexpected EOF.");
     }
     case Lexer::TOKEN_CLOSE_PAREN: {
       parse_error("Unexpected ')'.");
@@ -137,7 +137,7 @@ Parser::read()
         // evaluate translation function (_ str) in place here
         token = lexer->getNextToken();
         if(token != Lexer::TOKEN_STRING)
-                 parse_error("Expected string after '(_'");
+          parse_error("Expected string after '(_'");
 
         result = new(obst) Lisp(Lisp::TYPE_STRING);
         if(dictionary) {
@@ -151,7 +151,7 @@ Parser::read()
         }
         token = lexer->getNextToken();
         if(token != Lexer::TOKEN_CLOSE_PAREN)
-                 parse_error("Expected ')' after '(_ string'");
+          parse_error("Expected ')' after '(_ string'");
         break;
       }
 
index d1169d2..8837f91 100644 (file)
@@ -77,7 +77,7 @@ AmbientSound::AmbientSound(const lisp::Lisp& lisp)
   // set default silence_distance
 
   if (distance_factor == 0)
-         silence_distance = std::numeric_limits<float>::max();
+          silence_distance = std::numeric_limits<float>::max();
   else
     silence_distance = 1/distance_factor;
 
@@ -104,7 +104,7 @@ AmbientSound::AmbientSound(Vector pos, float factor, float bias, float vol, std:
   // set default silence_distance
 
   if (distance_factor == 0)
-         silence_distance = std::numeric_limits<float>::max();
+          silence_distance = std::numeric_limits<float>::max();
   else
     silence_distance = 1/distance_factor;
 
@@ -188,15 +188,15 @@ AmbientSound::update(float deltat)
       sound_source->set_gain(currentvolume*maximumvolume);
 
       if (sqrdistance>=silence_distance && currentvolume<1e-3)
-       stop_playing();
+        stop_playing();
       latency=0;
     } else {
       if (sqrdistance<silence_distance) {
-       start_playing();
-       latency=0;
+        start_playing();
+        latency=0;
       }
       else // set a reasonable latency
-       latency=(int)(0.001/distance_factor);
+        latency=(int)(0.001/distance_factor);
       //(int)(10*((sqrdistance-silence_distance)/silence_distance));
     }
   }
index 4014049..bd166d3 100644 (file)
 #include "object/portable.hpp"
 
 BicyclePlatform::BicyclePlatform(const lisp::Lisp& reader)
-       : MovingSprite(reader, LAYER_OBJECTS, COLGROUP_STATIC), 
-       master(0), slave(0), radius(128), angle(0), angular_speed(0), momentum(0)
+        : MovingSprite(reader, LAYER_OBJECTS, COLGROUP_STATIC), 
+        master(0), slave(0), radius(128), angle(0), angular_speed(0), momentum(0)
 {
   center = get_pos();
 }
 
 BicyclePlatform::BicyclePlatform(BicyclePlatform* master)
-       : MovingSprite(*master), 
-       master(master), slave(this), center(master->center), radius(master->radius), angle(master->angle + M_PI), angular_speed(0), momentum(0)
+        : MovingSprite(*master), 
+        master(master), slave(this), center(master->center), radius(master->radius), angle(master->angle + M_PI), angular_speed(0), momentum(0)
 {
   set_pos(get_pos() + Vector(master->get_bbox().get_width(), 0));
   master->master = master;
index 98c48c1..614c42b 100644 (file)
@@ -28,9 +28,9 @@
 #include "random_generator.hpp"
 
 Candle::Candle(const lisp::Lisp& lisp)
-       : MovingSprite(lisp, "images/objects/candle/candle.sprite", LAYER_BACKGROUNDTILES+1, COLGROUP_DISABLED), burning(true),
-       candle_light_1("images/objects/candle/candle-light-1.png"),
-       candle_light_2("images/objects/candle/candle-light-2.png")
+        : MovingSprite(lisp, "images/objects/candle/candle.sprite", LAYER_BACKGROUNDTILES+1, COLGROUP_DISABLED), burning(true),
+        candle_light_1("images/objects/candle/candle-light-1.png"),
+        candle_light_2("images/objects/candle/candle-light-2.png")
 {
   lisp.get("name", name);
   lisp.get("burning", burning);
index c75312f..dd9c0bf 100644 (file)
 #include "timer.hpp"
 
 Coin::Coin(const Vector& pos)
-       : MovingSprite(pos, "images/objects/coin/coin.sprite", LAYER_TILES, COLGROUP_TOUCHABLE)
+        : MovingSprite(pos, "images/objects/coin/coin.sprite", LAYER_TILES, COLGROUP_TOUCHABLE)
 {
   sound_manager->preload("sounds/coin.wav");
 }
 
 Coin::Coin(const lisp::Lisp& reader)
-       : MovingSprite(reader, "images/objects/coin/coin.sprite", LAYER_TILES, COLGROUP_TOUCHABLE)
+        : MovingSprite(reader, "images/objects/coin/coin.sprite", LAYER_TILES, COLGROUP_TOUCHABLE)
 {
   sound_manager->preload("sounds/coin.wav");
 }
@@ -71,44 +71,44 @@ Coin::collect()
   {
     switch ((pitch_one - tile) % 7) {
       case -6:
-       pitch = 1.0/2;
-       break;
+        pitch = 1.0/2;
+        break;
       case -5:
-       pitch = 5.0/8;
-       break;
+        pitch = 5.0/8;
+        break;
       case -4:
-       pitch = 4.0/6;
-       break;
+        pitch = 4.0/6;
+        break;
       case -3:
-       pitch = 3.0/4;
-       break;
+        pitch = 3.0/4;
+        break;
       case -2:
-       pitch = 5.0/6;
-       break;
+        pitch = 5.0/6;
+        break;
       case -1:
-       pitch = 9.0/10;
-       break;
+        pitch = 9.0/10;
+        break;
       case 0:
-       pitch = 1.0;
-       break;
+        pitch = 1.0;
+        break;
       case 1:
-       pitch = 9.0/8;
-       break;
+        pitch = 9.0/8;
+        break;
       case 2:
-       pitch = 5.0/4;
-       break;
+        pitch = 5.0/4;
+        break;
       case 3:
-       pitch = 4.0/3;
-       break;
+        pitch = 4.0/3;
+        break;
       case 4:
-       pitch = 3.0/2;
-       break;
+        pitch = 3.0/2;
+        break;
       case 5:
-       pitch = 5.0/3;
-       break;
+        pitch = 5.0/3;
+        break;
       case 6:
-       pitch = 9.0/5;
-       break;
+        pitch = 9.0/5;
+        break;
     }
     last_pitch = pitch;
   }
index e840e93..8286663 100644 (file)
 #include "random_generator.hpp"
 
 Explosion::Explosion(const Vector& pos)
-       : MovingSprite(pos, "images/objects/explosion/explosion.sprite", LAYER_OBJECTS+40, COLGROUP_TOUCHABLE), state(STATE_WAITING)
+        : MovingSprite(pos, "images/objects/explosion/explosion.sprite", LAYER_OBJECTS+40, COLGROUP_TOUCHABLE), state(STATE_WAITING)
 {
   sound_manager->preload("sounds/explosion.wav");
   set_pos(get_pos() - (get_bbox().get_middle() - get_pos()));
 }
 
 Explosion::Explosion(const lisp::Lisp& reader)
-       : MovingSprite(reader, "images/objects/explosion/explosion.sprite", LAYER_OBJECTS+40, COLGROUP_TOUCHABLE), state(STATE_WAITING)
+        : MovingSprite(reader, "images/objects/explosion/explosion.sprite", LAYER_OBJECTS+40, COLGROUP_TOUCHABLE), state(STATE_WAITING)
 {
   sound_manager->preload("sounds/explosion.wav");
 }
@@ -73,7 +73,7 @@ Explosion::update(float )
       break;
     case STATE_EXPLODING:
       if(sprite->animation_done()) {
-       remove_me();
+        remove_me();
       }
       break;
   }
index bd4f70a..8dd4fe4 100644 (file)
@@ -82,16 +82,16 @@ Firefly::collision(GameObject& other, const CollisionHit& )
     activated = true;
 // spawn some particles
 // TODO: provide convenience function in MovingSprite or MovingObject?
-          for (int i = 0; i < 5; i++) {
-            Vector ppos = bbox.get_middle();
-            float angle = systemRandom.randf(-M_PI_2, M_PI_2);
-            float velocity = systemRandom.randf(450, 900);
-            float vx = sin(angle)*velocity;
-            float vy = -cos(angle)*velocity;
-            Vector pspeed = Vector(vx, vy);
-            Vector paccel = Vector(0, 1000);
-            Sector::current()->add_object(new SpriteParticle("images/objects/particles/reset.sprite", "default", ppos, ANCHOR_MIDDLE, pspeed, paccel, LAYER_OBJECTS-1));
-          }
+       for (int i = 0; i < 5; i++) {
+         Vector ppos = bbox.get_middle();
+         float angle = systemRandom.randf(-M_PI_2, M_PI_2);
+         float velocity = systemRandom.randf(450, 900);
+         float vx = sin(angle)*velocity;
+         float vy = -cos(angle)*velocity;
+         Vector pspeed = Vector(vx, vy);
+         Vector paccel = Vector(0, 1000);
+         Sector::current()->add_object(new SpriteParticle("images/objects/particles/reset.sprite", "default", ppos, ANCHOR_MIDDLE, pspeed, paccel, LAYER_OBJECTS-1));
+       }
     // TODO play sound
     sprite->set_action("ringing");
     GameSession::current()->set_reset_point(Sector::current()->get_name(),
index 1031a83..d422c2a 100644 (file)
@@ -28,7 +28,7 @@
 #include "audio/sound_manager.hpp"
 
 GrowUp::GrowUp(Direction direction)
-       : MovingSprite(Vector(0,0), "images/powerups/egg/egg.sprite", LAYER_OBJECTS, COLGROUP_MOVING)
+        : MovingSprite(Vector(0,0), "images/powerups/egg/egg.sprite", LAYER_OBJECTS, COLGROUP_MOVING)
 {
   physic.enable_gravity(true);
   physic.set_velocity_x((direction == LEFT)?-100:100);
index 2c0a010..f03890c 100644 (file)
@@ -28,7 +28,7 @@
 #include "object_factory.hpp"
 
 HurtingPlatform::HurtingPlatform(const lisp::Lisp& reader)
-       : Platform(reader)
+        : Platform(reader)
 {
   set_group(COLGROUP_TOUCHABLE);
 }
index 421cef0..ffec5cf 100644 (file)
@@ -38,16 +38,16 @@ namespace {
 }
 
 IceCrusher::IceCrusher(const lisp::Lisp& reader)
-       : MovingSprite(reader, "images/creatures/icecrusher/icecrusher.sprite", LAYER_OBJECTS, COLGROUP_STATIC), 
-       state(IDLE), speed(Vector(0,0))
+        : MovingSprite(reader, "images/creatures/icecrusher/icecrusher.sprite", LAYER_OBJECTS, COLGROUP_STATIC), 
+        state(IDLE), speed(Vector(0,0))
 {
   start_position = get_bbox().p1;
   set_state(state, true);
 }
 
 IceCrusher::IceCrusher(const IceCrusher& other)
-       : MovingSprite(other), 
-       state(other.state), speed(other.speed) 
+        : MovingSprite(other), 
+        state(other.state), speed(other.speed) 
 {
   start_position = get_bbox().p1;
   set_state(state, true);
index 4416b23..83f9f69 100644 (file)
 #include "sprite/sprite.hpp"
 
 InvisibleWall::InvisibleWall(const lisp::Lisp& lisp)
-       : MovingSprite(lisp, "images/objects/invisible/invisible.sprite", LAYER_TILES, COLGROUP_STATIC), width(32), height(32)
+        : MovingSprite(lisp, "images/objects/invisible/invisible.sprite", LAYER_TILES, COLGROUP_STATIC), width(32), height(32)
 {
-       lisp.get("width", width);
-       lisp.get("height", height);
-       bbox.set_size(width, height);
+        lisp.get("width", width);
+        lisp.get("height", height);
+        bbox.set_size(width, height);
 }
 
 HitResponse
index fb26842..09a7367 100644 (file)
@@ -143,10 +143,10 @@ Ispy::free_line_of_sight(Vector line_start, Vector line_end, const MovingObject*
     for (float test_y = lsy; test_y <= ley; test_y += 16) {
       for(std::list<TileMap*>::const_iterator i = solid_tilemaps.begin(); i != solid_tilemaps.end(); i++) {
         TileMap* solids = *i;
-       const Tile* tile = solids->get_tile_at(Vector(test_x, test_y));
-       if(!tile) continue;
+        const Tile* tile = solids->get_tile_at(Vector(test_x, test_y));
+        if(!tile) continue;
         // FIXME: check collision with slope tiles
-       if((tile->getAttributes() & Tile::SOLID)) return false;
+        if((tile->getAttributes() & Tile::SOLID)) return false;
       }
     }
   }
index 734186f..99135de 100644 (file)
@@ -42,7 +42,7 @@ namespace {
 }
 
 MagicBlock::MagicBlock(const lisp::Lisp& lisp)
-       : MovingSprite(lisp, "images/objects/magicblock/magicblock.sprite"),
+        : MovingSprite(lisp, "images/objects/magicblock/magicblock.sprite"),
         is_solid(false), solid_time(0), switch_delay(0), light(1.0f,1.0f,1.0f)
 {
   set_group(COLGROUP_STATIC);
index 0c746a5..56cf420 100644 (file)
@@ -36,7 +36,7 @@
 #include "timer.hpp"
 
 MovingSprite::MovingSprite(const Vector& pos, const std::string& sprite_name, int layer, CollisionGroup collision_group)
-       : sprite_name(sprite_name), layer(layer)
+        : sprite_name(sprite_name), layer(layer)
 {
   bbox.set_pos(pos);
   sprite = sprite_manager->create(sprite_name);
@@ -45,7 +45,7 @@ MovingSprite::MovingSprite(const Vector& pos, const std::string& sprite_name, in
 }
 
 MovingSprite::MovingSprite(const lisp::Lisp& reader, const Vector& pos, int layer, CollisionGroup collision_group)
-       : layer(layer)
+        : layer(layer)
 {
   bbox.set_pos(pos);
   if (!reader.get("sprite", sprite_name))
@@ -57,7 +57,7 @@ MovingSprite::MovingSprite(const lisp::Lisp& reader, const Vector& pos, int laye
 }
 
 MovingSprite::MovingSprite(const lisp::Lisp& reader, const std::string& sprite_name, int layer, CollisionGroup collision_group)
-       : sprite_name(sprite_name), layer(layer)
+        : sprite_name(sprite_name), layer(layer)
 {
   if (!reader.get("x", bbox.p1.x))
     throw std::runtime_error("no x position set");
@@ -70,7 +70,7 @@ MovingSprite::MovingSprite(const lisp::Lisp& reader, const std::string& sprite_n
 }
 
 MovingSprite::MovingSprite(const lisp::Lisp& reader, int layer, CollisionGroup collision_group)
-       : layer(layer)
+        : layer(layer)
 {
   if (!reader.get("x", bbox.p1.x))
     throw std::runtime_error("no x position set");
@@ -85,7 +85,7 @@ MovingSprite::MovingSprite(const lisp::Lisp& reader, int layer, CollisionGroup c
 }
 
 MovingSprite::MovingSprite(const MovingSprite& other)
-       : MovingObject(other), layer(other.layer)
+        : MovingObject(other), layer(other.layer)
 {
   sprite = new Sprite(*other.sprite);
 }
index 322cb23..a0dc071 100644 (file)
@@ -29,7 +29,7 @@
 #include "video/drawing_context.hpp"
 
 OneUp::OneUp(const Vector& pos, Direction direction)
-       : MovingSprite(pos, "images/powerups/1up/1up.sprite", LAYER_FLOATINGOBJECTS, COLGROUP_TOUCHABLE)
+        : MovingSprite(pos, "images/powerups/1up/1up.sprite", LAYER_FLOATINGOBJECTS, COLGROUP_TOUCHABLE)
 {
   physic.set_velocity((direction == LEFT)?-100:100, -400);
 }
index 1c446b1..fa435be 100644 (file)
@@ -33,7 +33,7 @@
 #include "random_generator.hpp"
 
 ParticleSystem::ParticleSystem(float max_particle_size)
-       : max_particle_size(max_particle_size)
+        : max_particle_size(max_particle_size)
 {
   virtual_width = SCREEN_WIDTH + max_particle_size * 2;
   virtual_height = SCREEN_HEIGHT + max_particle_size *2;
@@ -203,7 +203,7 @@ void GhostParticleSystem::update(float elapsed_time)
 }
 
 CloudParticleSystem::CloudParticleSystem()
-       : ParticleSystem(128)
+        : ParticleSystem(128)
 {
   cloudimage = new Surface("images/objects/particles/cloud.png");
 
index b3f49a5..d495062 100644 (file)
@@ -94,9 +94,9 @@ private:
     {
     public:
         float speed;
-       float wobble;
-       float anchorx;
-       float drift_speed;
+        float wobble;
+        float anchorx;
+        float drift_speed;
     };
 
     Surface* snowimages[3];
index 2d4a3c2..de9038a 100644 (file)
@@ -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);
+          }
+        }
       }
     }
   }
index c6a2da6..4151cc5 100644 (file)
@@ -36,9 +36,9 @@
 #include "sector.hpp"
 
 Platform::Platform(const lisp::Lisp& reader)
-       : MovingSprite(reader, Vector(0,0), LAYER_OBJECTS, COLGROUP_STATIC), 
-       speed(Vector(0,0)), 
-       automatic(false), player_contact(false), last_player_contact(false)
+        : MovingSprite(reader, Vector(0,0), LAYER_OBJECTS, COLGROUP_STATIC), 
+        speed(Vector(0,0)), 
+        automatic(false), player_contact(false), last_player_contact(false)
 {
   bool running = true;
   reader.get("name", name);
@@ -54,9 +54,9 @@ Platform::Platform(const lisp::Lisp& reader)
 }
 
 Platform::Platform(const Platform& other)
-       : MovingSprite(other), ScriptInterface(other), 
-       speed(other.speed), 
-       automatic(other.automatic), player_contact(false), last_player_contact(false)
+        : MovingSprite(other), ScriptInterface(other), 
+        speed(other.speed), 
+        automatic(other.automatic), player_contact(false), last_player_contact(false)
 {
   name = other.name;
   path.reset(new Path(*other.path));
@@ -85,13 +85,13 @@ Platform::update(float elapsed_time)
       Player* player = 0;      
       std::vector<Player*> players = Sector::current()->get_players();
       for (std::vector<Player*>::iterator playerIter = players.begin(); playerIter != players.end(); ++playerIter) {
-       player = *playerIter;
+        player = *playerIter;
       }
       if (player) {
-       int nearest_node_id = path->get_nearest_node_no(player->get_bbox().p2);
-       if (nearest_node_id != -1) {
-         goto_node(nearest_node_id);
-       }
+        int nearest_node_id = path->get_nearest_node_no(player->get_bbox().p2);
+        if (nearest_node_id != -1) {
+          goto_node(nearest_node_id);
+        }
       }
     } 
 
@@ -101,7 +101,7 @@ Platform::update(float elapsed_time)
       // Travel to node farthest from current position
       int farthest_node_id = path->get_farthest_node_no(get_pos());
       if (farthest_node_id != -1) {
-       goto_node(farthest_node_id);
+        goto_node(farthest_node_id);
       } 
     }
 
index 7d9a572..63770ef 100644 (file)
@@ -345,12 +345,12 @@ Player::update(float elapsed_time)
       Vector paccel = Vector(0, 0);
       // draw bright sparkle when there is lots of time left, dark sparkle when invincibility is about to end
       if (invincible_timer.get_timeleft() > TUX_INVINCIBLE_TIME_WARNING) {
-       // make every other a longer sparkle to make trail a bit fuzzy
-       if (size_t(game_time*20)%2) {
-         Sector::current()->add_object(new SpriteParticle("images/objects/particles/sparkle.sprite", "small", ppos, ANCHOR_MIDDLE, pspeed, paccel, LAYER_OBJECTS+1+5));
-       } else {
-         Sector::current()->add_object(new SpriteParticle("images/objects/particles/sparkle.sprite", "medium", ppos, ANCHOR_MIDDLE, pspeed, paccel, LAYER_OBJECTS+1+5));
-       }
+        // make every other a longer sparkle to make trail a bit fuzzy
+        if (size_t(game_time*20)%2) {
+          Sector::current()->add_object(new SpriteParticle("images/objects/particles/sparkle.sprite", "small", ppos, ANCHOR_MIDDLE, pspeed, paccel, LAYER_OBJECTS+1+5));
+        } else {
+          Sector::current()->add_object(new SpriteParticle("images/objects/particles/sparkle.sprite", "medium", ppos, ANCHOR_MIDDLE, pspeed, paccel, LAYER_OBJECTS+1+5));
+        }
       } else {
         Sector::current()->add_object(new SpriteParticle("images/objects/particles/sparkle.sprite", "dark", ppos, ANCHOR_MIDDLE, pspeed, paccel, LAYER_OBJECTS+1+5));
       }
index 79d3198..f50814f 100644 (file)
 #include "object/portable.hpp"
 
 PneumaticPlatform::PneumaticPlatform(const lisp::Lisp& reader)
-       : MovingSprite(reader, LAYER_OBJECTS, COLGROUP_STATIC), 
-       master(0), slave(0), start_y(0), offset_y(0), speed_y(0)
+        : MovingSprite(reader, LAYER_OBJECTS, COLGROUP_STATIC), 
+        master(0), slave(0), start_y(0), offset_y(0), speed_y(0)
 {
   start_y = get_pos().y;
 }
 
 PneumaticPlatform::PneumaticPlatform(PneumaticPlatform* master)
-       : MovingSprite(*master), 
-       master(master), slave(this), start_y(master->start_y), offset_y(-master->offset_y), speed_y(0)
+        : MovingSprite(*master), 
+        master(master), slave(this), start_y(master->start_y), offset_y(-master->offset_y), speed_y(0)
 {
   set_pos(get_pos() + Vector(master->get_bbox().get_width(), 0));
   master->master = master;
index c5d5872..b404273 100644 (file)
@@ -25,7 +25,7 @@
 #include "random_generator.hpp"
 
 PulsingLight::PulsingLight(const Vector& center, float cycle_len, float min_alpha, float max_alpha, const Color& color)
-       : Light(center, color), min_alpha(min_alpha), max_alpha(max_alpha), cycle_len(cycle_len), t(0)
+        : Light(center, color), min_alpha(min_alpha), max_alpha(max_alpha), cycle_len(cycle_len), t(0)
 {
   assert(cycle_len > 0);
 
index 30e364c..0f1256c 100644 (file)
@@ -34,7 +34,7 @@ namespace {
 }
 
 PushButton::PushButton(const lisp::Lisp& lisp)
-       : MovingSprite(lisp, "images/objects/pushbutton/pushbutton.sprite", LAYER_BACKGROUNDTILES+1, COLGROUP_MOVING), state(OFF)
+        : MovingSprite(lisp, "images/objects/pushbutton/pushbutton.sprite", LAYER_BACKGROUNDTILES+1, COLGROUP_MOVING), state(OFF)
 {
   sound_manager->preload(BUTTON_SOUND);
   set_action("off", -1);
index ef2ead9..7721a5b 100644 (file)
@@ -32,7 +32,7 @@ static const float CRACKTIME = 0.3f;
 static const float FALLTIME = 0.8f;
 
 SkullTile::SkullTile(const lisp::Lisp& lisp)
-       : MovingSprite(lisp, "images/objects/skull_tile/skull_tile.sprite", LAYER_TILES, COLGROUP_STATIC), hit(false), falling(false)
+        : MovingSprite(lisp, "images/objects/skull_tile/skull_tile.sprite", LAYER_TILES, COLGROUP_STATIC), hit(false), falling(false)
 {
 }
 
index e914c0c..f5434fd 100644 (file)
@@ -27,7 +27,7 @@
 #include "log.hpp"
 
 SpriteParticle::SpriteParticle(std::string sprite_name, std::string action, Vector position, AnchorPoint anchor, Vector velocity, Vector acceleration, int drawing_layer)
-       : position(position), velocity(velocity), acceleration(acceleration), drawing_layer(drawing_layer)
+        : position(position), velocity(velocity), acceleration(acceleration), drawing_layer(drawing_layer)
 {
   sprite = sprite_manager->create(sprite_name);
   if (!sprite) throw std::runtime_error("Could not load sprite "+sprite_name);
index 316f572..0af8d6f 100644 (file)
@@ -31,7 +31,7 @@ static const float SPEED = 150;
 static const float JUMPSPEED = -300;
 
 Star::Star(const Vector& pos, Direction direction)
-       : MovingSprite(pos, "images/powerups/star/star.sprite", LAYER_OBJECTS, COLGROUP_MOVING)
+        : MovingSprite(pos, "images/powerups/star/star.sprite", LAYER_OBJECTS, COLGROUP_MOVING)
 {
   physic.set_velocity((direction == LEFT) ? -SPEED : SPEED, INITIALJUMP);
 }
index 656bd0a..f896f25 100644 (file)
@@ -37,8 +37,8 @@
 #include "log.hpp"
 
 namespace {
-       const float LIGHTNING_DELAY = 2.0f;
-       const float FLASH_DISPLAY_TIME = 0.1f;
+  const float LIGHTNING_DELAY = 2.0f;
+  const float FLASH_DISPLAY_TIME = 0.1f;
 }
 
 Thunderstorm::Thunderstorm(const lisp::Lisp& reader)
index 4871cf6..8291072 100644 (file)
@@ -35,7 +35,7 @@ namespace {
 }
 
 Trampoline::Trampoline(const lisp::Lisp& lisp)
-       : Rock(lisp, "images/objects/trampoline/trampoline.sprite")
+        : Rock(lisp, "images/objects/trampoline/trampoline.sprite")
 {
   sound_manager->preload(TRAMPOLINE_SOUND);
 
@@ -73,15 +73,15 @@ Trampoline::collision(GameObject& other, const CollisionHit& hit)
       float vy = player->physic.get_velocity_y();
       //player is falling down on trampoline
       if(hit.top && vy >= 0) {
-       if(player->get_controller()->hold(Controller::JUMP)) {
-         vy = VY_MIN;
-       } else {
-         vy = VY_INITIAL;
-       }
-       player->physic.set_velocity_y(vy);
-       sound_manager->play(TRAMPOLINE_SOUND);
-       sprite->set_action("swinging", 1);
-       return FORCE_MOVE;
+        if(player->get_controller()->hold(Controller::JUMP)) {
+          vy = VY_MIN;
+        } else {
+          vy = VY_INITIAL;
+        }
+        player->physic.set_velocity_y(vy);
+        sound_manager->play(TRAMPOLINE_SOUND);
+        sprite->set_action("swinging", 1);
+        return FORCE_MOVE;
       }
     }
     WalkingBadguy* walking_badguy = dynamic_cast<WalkingBadguy*> (&other);
@@ -90,11 +90,11 @@ Trampoline::collision(GameObject& other, const CollisionHit& hit)
       float vy = walking_badguy->get_velocity_y();
       //walking_badguy is falling down on trampoline
       if(hit.top && vy >= 0) {
-       vy = VY_INITIAL;
-       walking_badguy->set_velocity_y(vy);
-       sound_manager->play(TRAMPOLINE_SOUND);
-       sprite->set_action("swinging", 1);
-       return FORCE_MOVE;
+        vy = VY_INITIAL;
+        walking_badguy->set_velocity_y(vy);
+        sound_manager->play(TRAMPOLINE_SOUND);
+        sprite->set_action("swinging", 1);
+        return FORCE_MOVE;
       }
     }
   }
index 089a18d..0faca94 100644 (file)
@@ -70,8 +70,8 @@ UnstableTile::update(float elapsed_time)
     case STATE_DISINTEGRATING:
       movement = physic.get_movement(elapsed_time);
       if (sprite->animation_done()) {
-       remove_me();
-       return;
+        remove_me();
+        return;
       }
       break;
   }
index 4ad2b6e..9fa1ccd 100644 (file)
@@ -77,11 +77,11 @@ static int funcClose(struct SDL_RWops* context)
 
 SDL_RWops* get_physfs_SDLRWops(const std::string& filename)
 {
-       // check this as PHYSFS seems to be buggy and still returns a
-       // valid pointer in this case
-       if(filename == "") {
-               throw std::runtime_error("Couldn't open file: empty filename");
-       }
+    // check this as PHYSFS seems to be buggy and still returns a
+    // valid pointer in this case
+    if(filename == "") {
+        throw std::runtime_error("Couldn't open file: empty filename");
+    }
 
     PHYSFS_file* file = (PHYSFS_file*) PHYSFS_openRead(filename.c_str());
     if(!file) {
index c4347b2..28d92c5 100644 (file)
 
 IFileStreambuf::IFileStreambuf(const std::string& filename)
 {
-       // check this as PHYSFS seems to be buggy and still returns a
-       // valid pointer in this case
-       if(filename == "") {
-               throw std::runtime_error("Couldn't open file: empty filename");
-       }
+    // check this as PHYSFS seems to be buggy and still returns a
+    // valid pointer in this case
+    if(filename == "") {
+        throw std::runtime_error("Couldn't open file: empty filename");
+    }
     file = PHYSFS_openRead(filename.c_str());
     if(file == 0) {
         std::stringstream msg;
index ea03c41..c3608e8 100644 (file)
@@ -94,8 +94,8 @@ int RandomGenerator::rand(int u, int v) {
 double RandomGenerator::randf(double v) {
     float rv;
     do {
-               rv = ((double)RandomGenerator::random())/RandomGenerator::rand_max * v;
-       } while (rv >= v);                      // rounding might cause rv==v
+        rv = ((double)RandomGenerator::random())/RandomGenerator::rand_max * v;
+    } while (rv >= v);                      // rounding might cause rv==v
 
     if (debug > 0)
         printf("==== rand(): %f =====\n", rv);
index e53a837..4840ac9 100644 (file)
@@ -194,13 +194,13 @@ bool validate_sector_player()
   if (Sector::current() == 0)
   {
     log_info << "No current sector." << std::endl;
-       return false;
+    return false;
   }
 
   if (Sector::current()->player == 0)
   {
     log_info << "No player." << std::endl;
-       return false;
+    return false;
   }
   return true;
 }
index 26fed3a..aed825a 100644 (file)
@@ -31,7 +31,7 @@ namespace Scripting
 {
 
   Thunderstorm::Thunderstorm(::Thunderstorm* thunderstorm)
-         : thunderstorm(thunderstorm)
+      : thunderstorm(thunderstorm)
   {
   }
 
index 35f472e..a5fd7d4 100644 (file)
@@ -404,27 +404,27 @@ Sector::fix_old_tiles()
     TileMap* solids = *i;
     for(size_t x=0; x < solids->get_width(); ++x) {
       for(size_t y=0; y < solids->get_height(); ++y) {
-       uint32_t    id   = solids->get_tile_id(x, y);
-       const Tile *tile = solids->get_tile(x, y);
-       Vector pos(solids->get_x_offset() + x*32, solids->get_y_offset() + y*32);
-
-       if(id == 112) {
-         add_object(new InvisibleBlock(pos));
-         solids->change(x, y, 0);
-       } else if(tile->getAttributes() & Tile::COIN) {
-         add_object(new Coin(pos));
-         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()));
-         solids->change(x, y, 0);
-       } else if(tile->getAttributes() & Tile::GOAL) {
-         std::string sequence = tile->getData() == 0 ? "endsequence" : "stoptux";
-         add_object(new SequenceTrigger(pos, sequence));
-         solids->change(x, y, 0);
-       }
+    uint32_t    id   = solids->get_tile_id(x, y);
+    const Tile *tile = solids->get_tile(x, y);
+    Vector pos(solids->get_x_offset() + x*32, solids->get_y_offset() + y*32);
+
+    if(id == 112) {
+      add_object(new InvisibleBlock(pos));
+      solids->change(x, y, 0);
+    } else if(tile->getAttributes() & Tile::COIN) {
+      add_object(new Coin(pos));
+      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()));
+      solids->change(x, y, 0);
+    } else if(tile->getAttributes() & Tile::GOAL) {
+      std::string sequence = tile->getData() == 0 ? "endsequence" : "stoptux";
+      add_object(new SequenceTrigger(pos, sequence));
+      solids->change(x, y, 0);
+    }
       }
     }
   }
@@ -436,24 +436,24 @@ Sector::fix_old_tiles()
     for(size_t x=0; x < tm->get_width(); ++x) {
       for(size_t y=0; y < tm->get_height(); ++y) {
         uint32_t id = tm->get_tile_id(x, y);
-       Vector pos(tm->get_x_offset() + x*32, tm->get_y_offset() + y*32);
-       Vector center(pos.x + 16, pos.y + 16);
-
-       // torch
-       if (id == 1517) {
-         float pseudo_rnd = (float)((int)pos.x % 10) / 10;
-         add_object(new PulsingLight(center, 1.0f + pseudo_rnd, 0.9f, 1.0f, Color(1.0f, 1.0f, 0.6f, 1.0f)));
-       }
-       // lava or lavaflow
-       if ((id == 173) || (id == 1700) || (id == 1705) || (id == 1706)) {
-         // space lights a bit
-         if ((((tm->get_tile_id(x-1, y)) != tm->get_tile_id(x,y))
-             && (tm->get_tile_id(x, y-1) != tm->get_tile_id(x,y)))
-             || ((x % 3 == 0) && (y % 3 == 0))) {
-           float pseudo_rnd = (float)((int)pos.x % 10) / 10;
-           add_object(new PulsingLight(center, 1.0f + pseudo_rnd, 0.8f, 1.0f, Color(1.0f, 0.3f, 0.0f, 1.0f)));
-         }
-       }
+    Vector pos(tm->get_x_offset() + x*32, tm->get_y_offset() + y*32);
+    Vector center(pos.x + 16, pos.y + 16);
+
+    // torch
+    if (id == 1517) {
+      float pseudo_rnd = (float)((int)pos.x % 10) / 10;
+      add_object(new PulsingLight(center, 1.0f + pseudo_rnd, 0.9f, 1.0f, Color(1.0f, 1.0f, 0.6f, 1.0f)));
+    }
+    // lava or lavaflow
+    if ((id == 173) || (id == 1700) || (id == 1705) || (id == 1706)) {
+      // space lights a bit
+      if ((((tm->get_tile_id(x-1, y)) != tm->get_tile_id(x,y))
+          && (tm->get_tile_id(x, y-1) != tm->get_tile_id(x,y)))
+          || ((x % 3 == 0) && (y % 3 == 0))) {
+        float pseudo_rnd = (float)((int)pos.x % 10) / 10;
+        add_object(new PulsingLight(center, 1.0f + pseudo_rnd, 0.8f, 1.0f, Color(1.0f, 0.3f, 0.0f, 1.0f)));
+      }
+    }
 
       }
     }
@@ -996,30 +996,30 @@ Sector::collision_tilemap(collision::Constraints* constraints,
 
     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
-       if((tile->getAttributes() & Tile::SOLID) == 0)
-         continue;
-       // only handle unisolid when the player is falling down and when he was
-       // above the tile before
-       if(tile->getAttributes() & Tile::UNISOLID) {
-         if(movement.y <= 0 || dest.get_bottom() - movement.y - SHIFT_DELTA > y*32)
-           continue;
-       }
-
-       if(tile->getAttributes() & Tile::SLOPE) { // slope tile
-         AATriangle triangle;
-         Vector p1(x*32 + solids->get_x_offset(), y*32 + solids->get_y_offset());
-         Vector p2((x+1)*32 + solids->get_x_offset(), (y+1)*32 + solids->get_y_offset());
-         triangle = AATriangle(p1, p2, tile->getData());
-
-         collision::rectangle_aatriangle(constraints, dest, triangle, solids->get_movement());
-       } else { // normal rectangular tile
-         Rect rect(x*32 + solids->get_x_offset(), y*32 + solids->get_y_offset(), (x+1)*32 + solids->get_x_offset(), (y+1)*32 + solids->get_y_offset());
-         check_collisions(constraints, movement, dest, rect, NULL, NULL, solids->get_movement());
-       }
+    const Tile* tile = solids->get_tile(x, y);
+    if(!tile)
+      continue;
+    // skip non-solid tiles
+    if((tile->getAttributes() & Tile::SOLID) == 0)
+      continue;
+    // only handle unisolid when the player is falling down and when he was
+    // above the tile before
+    if(tile->getAttributes() & Tile::UNISOLID) {
+      if(movement.y <= 0 || dest.get_bottom() - movement.y - SHIFT_DELTA > y*32)
+        continue;
+    }
+
+    if(tile->getAttributes() & Tile::SLOPE) { // slope tile
+      AATriangle triangle;
+      Vector p1(x*32 + solids->get_x_offset(), y*32 + solids->get_y_offset());
+      Vector p2((x+1)*32 + solids->get_x_offset(), (y+1)*32 + solids->get_y_offset());
+      triangle = AATriangle(p1, p2, tile->getData());
+
+      collision::rectangle_aatriangle(constraints, dest, triangle, solids->get_movement());
+    } else { // normal rectangular tile
+      Rect rect(x*32 + solids->get_x_offset(), y*32 + solids->get_y_offset(), (x+1)*32 + solids->get_x_offset(), (y+1)*32 + solids->get_y_offset());
+      check_collisions(constraints, movement, dest, rect, NULL, NULL, solids->get_movement());
+    }
       }
     }
   }
@@ -1045,10 +1045,10 @@ Sector::collision_tile_attributes(const Rect& dest) const
 
     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;
-       result |= tile->getAttributes();
+    const Tile* tile = solids->get_tile(x, y);
+    if(!tile)
+      continue;
+    result |= tile->getAttributes();
       }
     }
   }
@@ -1381,18 +1381,18 @@ Sector::is_free_of_tiles(const Rect& rect, const bool ignoreUnisolid) const
 
     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;
-       if(tile->getAttributes() & Tile::SLOPE) {
-         AATriangle triangle;
-         Vector p1(x*32 + solids->get_x_offset(), y*32 + solids->get_y_offset());
-         Vector p2((x+1)*32 + solids->get_x_offset(), (y+1)*32 + solids->get_y_offset());
-         triangle = AATriangle(p1, p2, tile->getData());
-         Constraints constraints;
-         return collision::rectangle_aatriangle(&constraints, rect, triangle);
-       }
-       if((tile->getAttributes() & Tile::SOLID) && !ignoreUnisolid) return false;
-       if((tile->getAttributes() & Tile::SOLID) && !(tile->getAttributes() & Tile::UNISOLID)) return false;
+    const Tile* tile = solids->get_tile(x, y);
+    if(!tile) continue;
+    if(tile->getAttributes() & Tile::SLOPE) {
+      AATriangle triangle;
+      Vector p1(x*32 + solids->get_x_offset(), y*32 + solids->get_y_offset());
+      Vector p2((x+1)*32 + solids->get_x_offset(), (y+1)*32 + solids->get_y_offset());
+      triangle = AATriangle(p1, p2, tile->getData());
+      Constraints constraints;
+      return collision::rectangle_aatriangle(&constraints, rect, triangle);
+    }
+    if((tile->getAttributes() & Tile::SOLID) && !ignoreUnisolid) return false;
+    if((tile->getAttributes() & Tile::SOLID) && !(tile->getAttributes() & Tile::UNISOLID)) return false;
       }
     }
   }
index 8f958bc..fbfa94d 100644 (file)
@@ -138,24 +138,24 @@ Statistics::draw_worldmap_info(DrawingContext& context)
     switch (stat_no)
     {
       case 0:
-             caption_buf = _("Max coins collected:");
-             stat_buf = coins_to_string(coins, total_coins);
-             break;
+          caption_buf = _("Max coins collected:");
+          stat_buf = coins_to_string(coins, total_coins);
+          break;
       case 1:
-             caption_buf = _("Max fragging:");
-             stat_buf = frags_to_string(badguys, total_badguys);
-             break;
+          caption_buf = _("Max fragging:");
+          stat_buf = frags_to_string(badguys, total_badguys);
+          break;
       case 2:
-             caption_buf = _("Min time needed:");
-             stat_buf = time_to_string(time);
-             break;
+          caption_buf = _("Min time needed:");
+          stat_buf = time_to_string(time);
+          break;
       case 3:
-             caption_buf = _("Max secrets found:");
-             stat_buf = secrets_to_string(secrets, total_secrets);
-             break;
+          caption_buf = _("Max secrets found:");
+          stat_buf = secrets_to_string(secrets, total_secrets);
+          break;
       default:
-             log_debug << "Invalid stat requested to be drawn" << std::endl;
-             break;
+          log_debug << "Invalid stat requested to be drawn" << std::endl;
+          break;
     }
 
     context.draw_text(white_small_text, caption_buf, Vector(WMAP_INFO_LEFT_X, posy), ALIGN_LEFT, LAYER_GUI);
index d1c7fe7..9518f43 100644 (file)
@@ -77,7 +77,7 @@ public:
     WORLDMAP_SOUTH = 0x0002,
     WORLDMAP_EAST  = 0x0004,
     WORLDMAP_WEST  = 0x0008,
-       WORLDMAP_DIR_MASK = 0x000f,
+    WORLDMAP_DIR_MASK = 0x000f,
 
     WORLDMAP_STOP  = 0x0010,
 
index 02e5bd4..679851c 100644 (file)
@@ -142,7 +142,7 @@ void TileSet::merge(const TileSet *tileset, uint32_t start, uint32_t end,
 
     Tile *tile = tileset->tiles[id];
     if(tile == NULL)
-       continue;
+        continue;
 
     if(tiles[dest_id] != NULL) {
       log_warning << "tileset merge resulted in multiple definitions for id "
index 41e94b4..56cc065 100644 (file)
@@ -288,22 +288,22 @@ DictionaryManager::get_dictionary(const std::string& spec)
                       *filename != 0; filename++) {
 
                 // check if filename matches requested language
-               std::string fname = std::string(*filename);
-               std::string load_from_file = "";
+                std::string fname = std::string(*filename);
+                std::string load_from_file = "";
                 if(fname == lang + ".po") {
-                 load_from_file = fname;
-               } else {
+                  load_from_file = fname;
+                } else {
                   std::string::size_type s = lang.find("_");
                   if(s != std::string::npos) {
                     std::string lang_short = std::string(lang, 0, s);
-                   if (fname == lang_short + ".po") {
-                     load_from_file = lang_short;
-                   }
+                    if (fname == lang_short + ".po") {
+                      load_from_file = lang_short;
+                    }
                   }
-               }
+                }
 
-               // if it matched, load dictionary
-               if (load_from_file != "") {
+                // if it matched, load dictionary
+                if (load_from_file != "") {
                   //log_debug << "Loading dictionary for language \"" << lang << "\" from \"" << filename << "\"" << std::endl;
                   std::string pofile = *p + "/" + *filename;
                   try {
index 47452af..dfd577c 100644 (file)
@@ -149,7 +149,7 @@ TitleScreen::get_level_name(const std::string& filename)
     level->get("name", name);
     return name;
   } catch(std::exception& e) {
-         log_warning << "Problem getting name of '" << filename << "': "
+      log_warning << "Problem getting name of '" << filename << "': "
                   << e.what() << std::endl;
     return "";
   }
@@ -451,7 +451,7 @@ TitleScreen::update(float elapsed_time)
 
         case MNID_QUITMAINMENU:
           main_loop->quit(new FadeOut(0.25));
-                 sound_manager->stop_music(0.25);
+          sound_manager->stop_music(0.25);
           break;
       }
     } else if(menu == contrib_menu.get()) {
index 4f7e50b..970f165 100644 (file)
@@ -31,7 +31,7 @@
 #include "audio/sound_manager.hpp"
 
 Door::Door(const lisp::Lisp& reader)
-       : state(CLOSED)
+        : state(CLOSED)
 {
   reader.get("x", bbox.p1.x);
   reader.get("y", bbox.p1.y);
@@ -46,7 +46,7 @@ Door::Door(const lisp::Lisp& reader)
 }
 
 Door::Door(int x, int y, std::string sector, std::string spawnpoint)
-       : state(CLOSED)
+        : state(CLOSED)
 {
   bbox.set_pos(Vector(x, y));
   target_sector = sector;
@@ -89,23 +89,23 @@ Door::update(float )
     case OPENING:
       // if door has finished opening, start timer and keep door open
       if(sprite->animation_done()) {
-       state = OPEN;
-       sprite->set_action("open");
+        state = OPEN;
+        sprite->set_action("open");
        stay_open_timer.start(1.0);
       }
       break;
     case OPEN:
       // if door was open long enough, start closing it
       if (stay_open_timer.check()) {
-       state = CLOSING;
-       sprite->set_action("closing", 1);
+        state = CLOSING;
+        sprite->set_action("closing", 1);
       }
       break;
     case CLOSING:
       // if door has finished closing, keep it shut
       if(sprite->animation_done()) {
-       state = CLOSED;
-       sprite->set_action("closed");
+        state = CLOSED;
+        sprite->set_action("closed");
       }
       break;
   }
@@ -124,9 +124,9 @@ Door::event(Player& , EventType type)
     case CLOSED:
       // if door was activated, start opening it
       if (type == EVENT_ACTIVATE) {
-       state = OPENING;
+        state = OPENING;
         sound_manager->play("sounds/door.wav");
-       sprite->set_action("opening", 1);
+        sprite->set_action("opening", 1);
       }
       break;
     case OPENING:
@@ -149,12 +149,12 @@ Door::collision(GameObject& other, const CollisionHit& hit)
     case OPEN:
       {
         // if door is open and was touched by a player, teleport the player
-       Player* player = dynamic_cast<Player*> (&other);
-       if (player) {
-         state = CLOSING;
-         sprite->set_action("closing", 1);
-         GameSession::current()->respawn(target_sector, target_spawnpoint);
-       }
+        Player* player = dynamic_cast<Player*> (&other);
+        if (player) {
+          state = CLOSING;
+          sprite->set_action("closing", 1);
+          GameSession::current()->respawn(target_sector, target_spawnpoint);
+        }
       }
       break;
     case CLOSING:
index 1c46495..3debac0 100644 (file)
@@ -33,7 +33,7 @@
 static const float MESSAGE_TIME=3.5;
 
 SecretAreaTrigger::SecretAreaTrigger(const lisp::Lisp& reader)
-       : fade_tilemap("")
+        : fade_tilemap("")
 {
   reader.get("x", bbox.p1.x);
   reader.get("y", bbox.p1.y);
@@ -47,7 +47,7 @@ SecretAreaTrigger::SecretAreaTrigger(const lisp::Lisp& reader)
 }
 
 SecretAreaTrigger::SecretAreaTrigger(const Rect& area, std::string fade_tilemap)
-       : fade_tilemap(fade_tilemap)
+        : fade_tilemap(fade_tilemap)
 {
   bbox = area;
   message_displayed = false;
@@ -96,14 +96,14 @@ SecretAreaTrigger::event(Player& , EventType type)
       Sector::current()->get_level()->stats.secrets++;
 
       if (fade_tilemap != "") {
-       // fade away tilemaps
-       Sector& sector = *Sector::current();
-       for(Sector::GameObjects::iterator i = sector.gameobjects.begin(); i != sector.gameobjects.end(); ++i) {
-         TileMap* tm = dynamic_cast<TileMap*>(*i);
-         if (!tm) continue;
-         if (tm->get_name() != fade_tilemap) continue;
-         tm->fade(0.0, 1.0);
-       }
+        // fade away tilemaps
+        Sector& sector = *Sector::current();
+        for(Sector::GameObjects::iterator i = sector.gameobjects.begin(); i != sector.gameobjects.end(); ++i) {
+          TileMap* tm = dynamic_cast<TileMap*>(*i);
+          if (!tm) continue;
+          if (tm->get_name() != fade_tilemap) continue;
+          tm->fade(0.0, 1.0);
+        }
       }
 
     }
index 23f5754..f260b4b 100644 (file)
@@ -32,7 +32,7 @@ namespace {
 }
 
 Switch::Switch(const lisp::Lisp& reader)
-       : state(OFF)
+    : state(OFF)
 {
   if (!reader.get("x", bbox.p1.x)) throw std::runtime_error("no x position set");
   if (!reader.get("y", bbox.p1.y)) throw std::runtime_error("no y position set");
@@ -68,23 +68,23 @@ Switch::update(float )
       break;
     case TURN_ON:
       if(sprite->animation_done()) {
-       std::istringstream stream(script);
-       Sector::current()->run_script(stream, "Switch");
+    std::istringstream stream(script);
+    Sector::current()->run_script(stream, "Switch");
 
-       sprite->set_action("on", 1);
-       state = ON;
+    sprite->set_action("on", 1);
+    state = ON;
       }
       break;
     case ON:
       if(sprite->animation_done()) {
-       sprite->set_action("turnoff", 1);
-       state = TURN_OFF;
+    sprite->set_action("turnoff", 1);
+    state = TURN_OFF;
       }
       break;
     case TURN_OFF:
       if(sprite->animation_done()) {
-       sprite->set_action("off");
-       state = OFF;
+    sprite->set_action("off");
+    state = OFF;
       }
       break;
   }
@@ -103,9 +103,9 @@ Switch::event(Player& , EventType type)
 
   switch (state) {
     case OFF:
-       sprite->set_action("turnon", 1);
+    sprite->set_action("turnon", 1);
         sound_manager->play( SWITCH_SOUND );
-       state = TURN_ON;
+    state = TURN_ON;
       break;
     case TURN_ON:
       break;
index 0129415..b58f66a 100644 (file)
@@ -98,11 +98,11 @@ inline void intern_draw(float left, float top, float right, float bottom,
     bottom -= center_y;
 
     float vertices[] = {
-               left*ca - top*sa + center_x, left*sa + top*ca + center_y,
-               right*ca - top*sa + center_x, right*sa + top*ca + center_y,
-               right*ca - bottom*sa + center_x, right*sa + bottom*ca + center_y,
-               left*ca - bottom*sa + center_x, left*sa + bottom*ca + center_y
-       };
+        left*ca - top*sa + center_x, left*sa + top*ca + center_y,
+        right*ca - top*sa + center_x, right*sa + top*ca + center_y,
+        right*ca - bottom*sa + center_x, right*sa + bottom*ca + center_y,
+        left*ca - bottom*sa + center_x, left*sa + bottom*ca + center_y
+    };
     glVertexPointer(2, GL_FLOAT, 0, vertices);
 
     float uvs[] = {
index 9621a4d..c39744a 100644 (file)
@@ -103,11 +103,11 @@ inline void intern_draw(float left, float top, float right, float bottom,
     bottom -= center_y;
 
     float vertices[] = {
-               left*ca - top*sa + center_x, left*sa + top*ca + center_y,
-               right*ca - top*sa + center_x, right*sa + top*ca + center_y,
-               right*ca - bottom*sa + center_x, right*sa + bottom*ca + center_y,
-               left*ca - bottom*sa + center_x, left*sa + bottom*ca + center_y
-       };
+        left*ca - top*sa + center_x, left*sa + top*ca + center_y,
+        right*ca - top*sa + center_x, right*sa + top*ca + center_y,
+        right*ca - bottom*sa + center_x, right*sa + bottom*ca + center_y,
+        left*ca - bottom*sa + center_x, left*sa + bottom*ca + center_y
+    };
     glVertexPointer(2, GL_FLOAT, 0, vertices);
 
     float uvs[] = {
index 51e13b9..595da53 100644 (file)
@@ -476,7 +476,7 @@ namespace SDL
     if (transform == 0) {
       std::cerr << "Warning: Tried to draw NULL surface, skipped draw" << std::endl;
       return;
-    }  
+    }
 
     SDL_Rect *src_rect = surface_data->get_src_rect(effect);
     int dstx = (int) request.pos.x * numerator / denominator;
@@ -502,7 +502,7 @@ namespace SDL
     if (transform == 0) {
       std::cerr << "Warning: Tried to draw NULL surface, skipped draw" << std::endl;
       return;
-    }  
+    }
 
     int ox, oy;
     if (effect == HORIZONTAL_FLIP)
index 56cb6b8..33fee59 100644 (file)
@@ -198,7 +198,7 @@ namespace SDL
     if (transform == 0) {
       std::cerr << "Warning: Tried to draw NULL surface, skipped draw" << std::endl;
       return;
-    }  
+    }
 
     SDL_Rect *src_rect = surface_data->get_src_rect(effect);
     SDL_Rect dst_rect;
@@ -266,7 +266,7 @@ namespace SDL
     if (transform == 0) {
       std::cerr << "Warning: Tried to draw NULL surface, skipped draw" << std::endl;
       return;
-    }  
+    }
 
     int ox, oy;
     if (effect == HORIZONTAL_FLIP)
index 2b61124..59984ff 100644 (file)
@@ -77,7 +77,7 @@ LevelTile::get_picture()
   picture_cached = true;
   std::string fname = FileSystem::strip_extension(basedir + name)+".jpg";
   if (!PHYSFS_exists(fname.c_str())) {
-       return 0;
+    return 0;
   }
   picture = new Surface(fname);
   return picture;
index 7fa3526..f505fc2 100644 (file)
@@ -149,9 +149,9 @@ bool
 Tux::canWalk(int tile_data, Direction dir)
 {
   return ((tile_data & Tile::WORLDMAP_NORTH && dir == D_NORTH) ||
-         (tile_data & Tile::WORLDMAP_SOUTH && dir == D_SOUTH) ||
-         (tile_data & Tile::WORLDMAP_EAST && dir == D_EAST) ||
-         (tile_data & Tile::WORLDMAP_WEST && dir == D_WEST));
+      (tile_data & Tile::WORLDMAP_SOUTH && dir == D_SOUTH) ||
+      (tile_data & Tile::WORLDMAP_EAST && dir == D_EAST) ||
+      (tile_data & Tile::WORLDMAP_WEST && dir == D_WEST));
 }
 
 void
@@ -182,9 +182,9 @@ Tux::tryContinueWalking(float elapsed_time)
     // direction and the apply_action_ are opposites, since they "see"
     // directions in a different way
     if((direction == D_NORTH && special_tile->apply_action_south) ||
-                   (direction == D_SOUTH && special_tile->apply_action_north) ||
-                   (direction == D_WEST && special_tile->apply_action_east) ||
-                   (direction == D_EAST && special_tile->apply_action_west))
+            (direction == D_SOUTH && special_tile->apply_action_north) ||
+            (direction == D_WEST && special_tile->apply_action_east) ||
+            (direction == D_EAST && special_tile->apply_action_west))
     {
       if(special_tile->passive_message) {
         worldmap->passive_message = special_tile->map_message;
index 2ed3783..13602da 100644 (file)
@@ -511,10 +511,10 @@ WorldMap::finished_level(Level* gamelevel)
     int dirdata = available_directions_at(tux->get_tile_pos());
     // first, test for crossroads
     if (dirdata == Tile::WORLDMAP_CNSE ||
-               dirdata == Tile::WORLDMAP_CNSW ||
-               dirdata == Tile::WORLDMAP_CNEW ||
-               dirdata == Tile::WORLDMAP_CSEW ||
-               dirdata == Tile::WORLDMAP_CNSEW)
+       dirdata == Tile::WORLDMAP_CNSW ||
+       dirdata == Tile::WORLDMAP_CNEW ||
+       dirdata == Tile::WORLDMAP_CSEW ||
+       dirdata == Tile::WORLDMAP_CNSEW)
       dir = D_NONE;
     else if (dirdata & Tile::WORLDMAP_NORTH
         && tux->back_direction != D_NORTH)
@@ -662,8 +662,8 @@ WorldMap::update(float delta)
         || main_controller->pressed(Controller::MENU_SELECT)) {
       /* some people define UP and JUMP on the same key... */
       if(!main_controller->pressed(Controller::UP))
-           enter_level = true;
-       }
+        enter_level = true;
+    }
     if(main_controller->pressed(Controller::PAUSE_MENU))
       on_escape_press();
 
@@ -1024,13 +1024,13 @@ WorldMap::save_state()
     for(LevelTiles::iterator i = levels.begin(); i != levels.end(); ++i) {
       LevelTile* level = *i;
 
-         sq_pushstring(vm, level->get_name().c_str(), -1);
-         sq_newtable(vm);
+      sq_pushstring(vm, level->get_name().c_str(), -1);
+      sq_newtable(vm);
 
-         store_bool(vm, "solved", level->solved);
-         level->statistics.serialize_to_squirrel(vm);
+        store_bool(vm, "solved", level->solved);
+      level->statistics.serialize_to_squirrel(vm);
 
-         sq_createslot(vm, -3);
+      sq_createslot(vm, -3);
     }
 
     sq_createslot(vm, -3);