From a8057c3d1726484928a3091fdd5c7a3d810f5f63 Mon Sep 17 00:00:00 2001 From: Ingo Ruhnke Date: Tue, 12 Aug 2014 23:14:54 +0200 Subject: [PATCH] Removed trailing whitespace from all *.?pp files --- src/addon/addon.cpp | 10 +++--- src/addon/addon.hpp | 6 ++-- src/addon/addon_manager.cpp | 22 ++++++------- src/addon/md5.cpp | 14 ++++---- src/addon/md5.hpp | 16 ++++----- src/audio/ogg_sound_file.cpp | 2 +- src/audio/sound_file.cpp | 2 +- src/audio/sound_manager.cpp | 8 ++--- src/audio/stream_sound_source.cpp | 4 +-- src/badguy/angrystone.cpp | 2 +- src/badguy/badguy.hpp | 18 +++++------ src/badguy/bomb.cpp | 6 ++-- src/badguy/bomb.hpp | 2 +- src/badguy/captainsnowball.cpp | 4 +-- src/badguy/dart.cpp | 4 +-- src/badguy/dart.hpp | 2 +- src/badguy/darttrap.cpp | 6 ++-- src/badguy/dispenser.cpp | 8 ++--- src/badguy/fish.cpp | 4 +-- src/badguy/flame.cpp | 10 +++--- src/badguy/flyingsnowball.cpp | 4 +-- src/badguy/ghostflame.cpp | 14 ++++---- src/badguy/ghosttree.cpp | 18 +++++------ src/badguy/goldbomb.cpp | 2 +- src/badguy/haywire.cpp | 4 +-- src/badguy/haywire.hpp | 2 +- src/badguy/iceflame.cpp | 14 ++++---- src/badguy/igel.cpp | 2 +- src/badguy/jumpy.cpp | 2 +- src/badguy/kamikazesnowball.cpp | 4 +-- src/badguy/kugelblitz.cpp | 8 ++--- src/badguy/kugelblitz.hpp | 2 +- src/badguy/livefire.cpp | 2 +- src/badguy/livefire.hpp | 2 +- src/badguy/mole.cpp | 4 +-- src/badguy/mole_rock.cpp | 4 +-- src/badguy/mrbomb.hpp | 2 +- src/badguy/mriceblock.cpp | 8 ++--- src/badguy/mriceblock.hpp | 2 +- src/badguy/root.cpp | 6 ++-- src/badguy/snail.cpp | 8 ++--- src/badguy/spidermite.cpp | 2 +- src/badguy/stumpy.cpp | 4 +-- src/badguy/treewillowisp.cpp | 8 ++--- src/badguy/walking_badguy.cpp | 50 ++++++++++++++-------------- src/badguy/walking_badguy.hpp | 24 +++++++------- src/badguy/willowisp.cpp | 8 ++--- src/badguy/willowisp.hpp | 2 +- src/control/input_manager.cpp | 4 +-- src/control/input_manager.hpp | 2 +- src/control/keyboard_manager.cpp | 24 +++++++------- src/gui/menu_manager.cpp | 2 +- src/gui/mousecursor.cpp | 2 +- src/gui/mousecursor.hpp | 2 +- src/lisp/lexer.cpp | 4 +-- src/lisp/list_iterator.cpp | 2 +- src/lisp/parser.cpp | 6 ++-- src/math/size.hpp | 52 ++++++++++++++--------------- src/math/sizef.hpp | 54 +++++++++++++++---------------- src/object/ambient_sound.cpp | 2 +- src/object/ambient_sound.hpp | 4 +-- src/object/background.cpp | 12 +++---- src/object/background.hpp | 2 +- src/object/bicycle_platform.cpp | 34 +++++++++---------- src/object/block.cpp | 12 +++---- src/object/bouncy_coin.cpp | 2 +- src/object/broken_brick.cpp | 4 +-- src/object/bullet.cpp | 2 +- src/object/camera.cpp | 2 +- src/object/camera.hpp | 4 +-- src/object/candle.cpp | 6 ++-- src/object/candle.hpp | 2 +- src/object/cloud_particle_system.hpp | 2 +- src/object/coin_explode.cpp | 2 +- src/object/coin_rain.cpp | 2 +- src/object/display_effect.cpp | 10 +++--- src/object/display_effect.hpp | 2 +- src/object/endsequence.cpp | 6 ++-- src/object/explosion.cpp | 4 +-- src/object/firefly.cpp | 2 +- src/object/floating_image.cpp | 8 ++--- src/object/floating_text.cpp | 2 +- src/object/flower.cpp | 2 +- src/object/flower.hpp | 2 +- src/object/ghost_particle_system.hpp | 2 +- src/object/icecrusher.cpp | 16 ++++----- src/object/infoblock.cpp | 4 +-- src/object/invisible_block.cpp | 4 +-- src/object/invisible_wall.cpp | 4 +-- src/object/ispy.cpp | 24 +++++++------- src/object/lantern.cpp | 4 +-- src/object/level_time.cpp | 6 ++-- src/object/level_time.hpp | 2 +- src/object/light.cpp | 4 +-- src/object/moving_sprite.cpp | 10 +++--- src/object/moving_sprite.hpp | 22 ++++++------- src/object/particles.cpp | 6 ++-- src/object/particles.hpp | 4 +-- src/object/particlesystem.hpp | 2 +- src/object/particlesystem_interactive.hpp | 4 +-- src/object/path_walker.cpp | 10 +++--- src/object/path_walker.hpp | 2 +- src/object/platform.cpp | 24 +++++++------- src/object/platform.hpp | 2 +- src/object/player.cpp | 40 +++++++++++------------ src/object/player.hpp | 8 ++--- src/object/pneumatic_platform.cpp | 22 ++++++------- src/object/portable.hpp | 2 +- src/object/pulsing_light.cpp | 4 +-- src/object/pushbutton.cpp | 2 +- src/object/rain_particle_system.hpp | 2 +- src/object/rock.hpp | 2 +- src/object/scripted_object.cpp | 6 ++-- src/object/scripted_object.hpp | 4 +-- src/object/skull_tile.cpp | 4 +-- src/object/text_object.cpp | 6 ++-- src/object/text_object.hpp | 8 ++--- src/object/thunderstorm.cpp | 2 +- src/object/thunderstorm.hpp | 2 +- src/object/tilemap.cpp | 50 ++++++++++++++-------------- src/object/tilemap.hpp | 2 +- src/object/trampoline.cpp | 2 +- src/object/unstable_tile.cpp | 2 +- src/object/weak_block.cpp | 4 +-- src/object/wind.cpp | 4 +-- src/object/wind.hpp | 2 +- src/scripting/player.hpp | 2 +- src/sprite/sprite.cpp | 2 +- src/supertux/collision.hpp | 14 ++++---- src/supertux/console.cpp | 16 ++++----- src/supertux/game_object.cpp | 8 ++--- src/supertux/game_object.hpp | 6 ++-- src/supertux/game_session.cpp | 10 +++--- src/supertux/game_session.hpp | 2 +- src/supertux/gameconfig.cpp | 4 +-- src/supertux/gameconfig.hpp | 2 +- src/supertux/info_box_line.cpp | 8 ++--- src/supertux/level.cpp | 6 ++-- src/supertux/levelintro.cpp | 10 +++--- src/supertux/main.hpp | 2 +- src/supertux/menu/addon_menu.cpp | 42 ++++++++++++------------ src/supertux/menu/contrib_menu.hpp | 2 +- src/supertux/menu/contrib_world_menu.cpp | 2 +- src/supertux/menu/keyboard_menu.cpp | 2 +- src/supertux/menu/language_menu.cpp | 10 +++--- src/supertux/menu/menu_storage.hpp | 4 +-- src/supertux/menu/profile_menu.cpp | 4 +-- src/supertux/moving_object.hpp | 2 +- src/supertux/object_factory.cpp | 4 +-- src/supertux/object_factory.hpp | 2 +- src/supertux/physic.cpp | 6 ++-- src/supertux/physic.hpp | 2 +- src/supertux/player_status.cpp | 8 ++--- src/supertux/resources.cpp | 2 +- src/supertux/resources.hpp | 2 +- src/supertux/screen.hpp | 2 +- src/supertux/screen_fade.hpp | 2 +- src/supertux/sector.cpp | 12 +++---- src/supertux/sector.hpp | 2 +- src/supertux/shrinkfade.cpp | 6 ++-- src/supertux/spawn_point.cpp | 2 +- src/supertux/statistics.cpp | 30 ++++++++--------- src/supertux/statistics.hpp | 2 +- src/supertux/tile.cpp | 26 +++++++-------- src/supertux/tile_manager.cpp | 2 +- src/supertux/tile_set_parser.cpp | 52 ++++++++++++++--------------- src/supertux/tile_set_parser.hpp | 6 ++-- src/supertux/timer.cpp | 4 +-- src/supertux/title_screen.hpp | 2 +- src/trigger/climbable.cpp | 4 +-- src/trigger/secretarea_trigger.hpp | 2 +- src/trigger/trigger_base.cpp | 6 ++-- src/trigger/trigger_base.hpp | 4 +-- src/util/gettext.hpp | 2 +- src/util/log.cpp | 8 ++--- src/util/ref.hpp | 2 +- src/util/utf8_iterator.cpp | 4 +-- src/video/color.hpp | 10 +++--- src/video/renderer.hpp | 2 +- src/video/sdl/sdl_lightmap.cpp | 4 +-- src/video/sdl_surface_ptr.hpp | 2 +- src/video/surface.cpp | 12 +++---- src/video/texture.hpp | 2 +- src/worldmap/level.cpp | 6 ++-- src/worldmap/spawn_point.cpp | 2 +- src/worldmap/special_tile.cpp | 6 ++-- src/worldmap/sprite_change.cpp | 2 +- src/worldmap/tux.cpp | 2 +- src/worldmap/worldmap.hpp | 6 ++-- 189 files changed, 704 insertions(+), 704 deletions(-) diff --git a/src/addon/addon.cpp b/src/addon/addon.cpp index 0bbe885b5..2ab094eb1 100644 --- a/src/addon/addon.cpp +++ b/src/addon/addon.cpp @@ -63,7 +63,7 @@ void Addon::parse(const Reader& lisp) { try { - lisp.get("kind", kind); + lisp.get("kind", kind); lisp.get("title", title); lisp.get("author", author); lisp.get("license", license); @@ -97,7 +97,7 @@ void Addon::write(lisp::Writer& writer) const { writer.start_list("supertux-addoninfo"); - if (kind != "") writer.write("kind", kind); + if (kind != "") writer.write("kind", kind); if (title != "") writer.write("title", title); if (author != "") writer.write("author", author); if (license != "") writer.write("license", license); @@ -107,14 +107,14 @@ Addon::write(lisp::Writer& writer) const writer.end_list("supertux-addoninfo"); } -void +void Addon::write(std::string fname) const { lisp::Writer writer(fname); write(writer); } -bool +bool Addon::operator==(Addon addon2) const { std::string s1 = this->get_md5(); @@ -125,7 +125,7 @@ Addon::operator==(Addon addon2) const if (this->title != addon2.title) return false; if (this->author != addon2.author) return false; if (this->kind != addon2.kind) return false; - return true; + return true; } /* EOF */ diff --git a/src/addon/addon.hpp b/src/addon/addon.hpp index bfe6066c5..69b0bd9fc 100644 --- a/src/addon/addon.hpp +++ b/src/addon/addon.hpp @@ -69,7 +69,7 @@ public: void write(std::string fname) const; /** - * Checks if Add-on is the same as given one. + * Checks if Add-on is the same as given one. * If available, checks MD5 sum, else relies on kind, author and title alone. */ bool operator==(Addon addon2) const; @@ -85,8 +85,8 @@ protected: author(), license(), http_url(), - suggested_filename(), - installed_physfs_filename(), + suggested_filename(), + installed_physfs_filename(), installed_absolute_filename(), stored_md5(), installed(), diff --git a/src/addon/addon_manager.cpp b/src/addon/addon_manager.cpp index e2c3c5538..cf3e69aa0 100644 --- a/src/addon/addon_manager.cpp +++ b/src/addon/addon_manager.cpp @@ -135,10 +135,10 @@ AddonManager::check_online() if(!addons_lisp) throw std::runtime_error("Downloaded file is not an Add-on list"); lisp::ListIterator iter(addons_lisp); - while(iter.next()) + while(iter.next()) { const std::string& token = iter.item(); - if(token != "supertux-addoninfo") + if(token != "supertux-addoninfo") { log_warning << "Unknown token '" << token << "' in Add-on list" << std::endl; continue; @@ -148,20 +148,20 @@ AddonManager::check_online() addon->installed = false; addon->loaded = false; - // make sure the list of known Add-ons does not already contain this one + // make sure the list of known Add-ons does not already contain this one bool exists = false; for (std::vector::const_iterator i = addons.begin(); i != addons.end(); i++) { if (**i == *addon) { - exists = true; - break; + exists = true; + break; } } - if (exists) + if (exists) { // do nothing } - else if (addon->suggested_filename.find_first_not_of("match.quiz-proxy_gwenblvdjfks0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ") != std::string::npos) + else if (addon->suggested_filename.find_first_not_of("match.quiz-proxy_gwenblvdjfks0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ") != std::string::npos) { // make sure the Add-on's file name does not contain weird characters log_warning << "Add-on \"" << addon->title << "\" contains unsafe file name. Skipping." << std::endl; @@ -244,7 +244,7 @@ AddonManager::install(Addon* addon) if (addon->get_md5() != addon->stored_md5) { addon->installed = false; PHYSFS_delete(fileName.c_str()); - std::string why = "MD5 checksums differ"; + std::string why = "MD5 checksums differ"; throw std::runtime_error("Downloading Add-on failed: " + why); } @@ -413,7 +413,7 @@ AddonManager::load_addons() addon->loaded = true; addons.push_back(addon); - // check if the Addon is disabled + // check if the Addon is disabled if (std::find(ignored_addon_filenames.begin(), ignored_addon_filenames.end(), fileName) != ignored_addon_filenames.end()) { unload(addon); } @@ -431,13 +431,13 @@ AddonManager::load_addons() void AddonManager::read(const Reader& lisp) { - lisp.get("disabled-addons", ignored_addon_filenames); + lisp.get("disabled-addons", ignored_addon_filenames); } void AddonManager::write(lisp::Writer& writer) { - writer.write("disabled-addons", ignored_addon_filenames); + writer.write("disabled-addons", ignored_addon_filenames); } /* EOF */ diff --git a/src/addon/md5.cpp b/src/addon/md5.cpp index deb069445..cc5e83cba 100644 --- a/src/addon/md5.cpp +++ b/src/addon/md5.cpp @@ -12,8 +12,8 @@ // implied warranty of any kind. // // The translators/modifiers do not claim: -// (1) that MD5 will do what you think it does; -// (2) that this translation/ modification is accurate; or +// (1) that MD5 will do what you think it does; +// (2) that this translation/ modification is accurate; or // (3) that this software is "merchantible." // // based on: @@ -26,20 +26,20 @@ // is identified as the "RSA Data Security, Inc. MD5 Message-Digest // Algorithm" in all material mentioning or referencing this software // or this function. -// +// // License is also granted to make and use derivative works provided // that such works are identified as "derived from the RSA Data // Security, Inc. MD5 Message-Digest Algorithm" in all material // mentioning or referencing the derived work. -// +// // RSA Data Security, Inc. makes no representations concerning either // the merchantability of this software or the suitability of this // software for any particular purpose. It is provided "as is" // without express or implied warranty of any kind. -// +// // These notices must be retained in any copies of any part of this // documentation and/or software. -// +// #include "addon/md5.hpp" @@ -127,7 +127,7 @@ MD5::MD5(FILE *file) : finalize (); } -MD5::MD5(std::istream& stream) : +MD5::MD5(std::istream& stream) : finalized() { init(); // must called by all constructors diff --git a/src/addon/md5.hpp b/src/addon/md5.hpp index 2f441e012..49801c17d 100644 --- a/src/addon/md5.hpp +++ b/src/addon/md5.hpp @@ -12,8 +12,8 @@ // implied warranty of any kind. // // The translators/modifiers do not claim: -// (1) that MD5 will do what you think it does; -// (2) that this translation/ modification is accurate; or +// (1) that MD5 will do what you think it does; +// (2) that this translation/ modification is accurate; or // (3) that this software is "merchantible." // // based on: @@ -26,20 +26,20 @@ // is identified as the "RSA Data Security, Inc. MD5 Message-Digest // Algorithm" in all material mentioning or referencing this software // or this function. -// +// // License is also granted to make and use derivative works provided // that such works are identified as "derived from the RSA Data // Security, Inc. MD5 Message-Digest Algorithm" in all material // mentioning or referencing the derived work. -// +// // RSA Data Security, Inc. makes no representations concerning either // the merchantability of this software or the suitability of this // software for any particular purpose. It is provided "as is" // without express or implied warranty of any kind. -// +// // These notices must be retained in any copies of any part of this // documentation and/or software. -// +// #ifndef HEADER_SUPERTUX_ADDON_MD5_HPP #define HEADER_SUPERTUX_ADDON_MD5_HPP @@ -47,10 +47,10 @@ #include #include -class MD5 +class MD5 { public: - MD5(); + MD5(); MD5(uint8_t* string); /**< digest string, finalize */ MD5(std::istream& stream); /**< digest stream, finalize */ MD5(FILE *file); /**< digest file, close, finalize */ diff --git a/src/audio/ogg_sound_file.cpp b/src/audio/ogg_sound_file.cpp index fd7c7fc3e..5429b5a89 100644 --- a/src/audio/ogg_sound_file.cpp +++ b/src/audio/ogg_sound_file.cpp @@ -23,7 +23,7 @@ OggSoundFile::OggSoundFile(PHYSFS_file* file, double loop_begin, double loop_at) vorbis_file(), loop_begin(), loop_at(), - normal_buffer_loop() + normal_buffer_loop() { this->file = file; diff --git a/src/audio/sound_file.cpp b/src/audio/sound_file.cpp index c710c3b97..576ab85ca 100644 --- a/src/audio/sound_file.cpp +++ b/src/audio/sound_file.cpp @@ -47,7 +47,7 @@ SoundFile* load_music_file(const std::string& filename) music->get("file", raw_music_file); music->get("loop-begin", loop_begin); music->get("loop-at", loop_at); - + if(loop_begin < 0) { throw SoundError("can't loop from negative value"); } diff --git a/src/audio/sound_manager.cpp b/src/audio/sound_manager.cpp index 9f2b36f62..b51c0e48d 100644 --- a/src/audio/sound_manager.cpp +++ b/src/audio/sound_manager.cpp @@ -28,9 +28,9 @@ #include "util/log.hpp" SoundManager::SoundManager() : - device(0), - context(0), - sound_enabled(false), + device(0), + context(0), + sound_enabled(false), buffers(), sources(), update_list(), @@ -56,7 +56,7 @@ SoundManager::SoundManager() : } catch(std::exception& e) { if(context != NULL) { alcDestroyContext(context); - context = NULL; + context = NULL; } if(device != NULL) { alcCloseDevice(device); diff --git a/src/audio/stream_sound_source.cpp b/src/audio/stream_sound_source.cpp index bb178725d..fceab8063 100644 --- a/src/audio/stream_sound_source.cpp +++ b/src/audio/stream_sound_source.cpp @@ -21,8 +21,8 @@ #include "util/log.hpp" StreamSoundSource::StreamSoundSource() : - file(0), - fade_state(NoFading), + file(0), + fade_state(NoFading), fade_start_time(), fade_time(), looping(false) diff --git a/src/badguy/angrystone.cpp b/src/badguy/angrystone.cpp index bb0b476b2..ab3d4c2eb 100644 --- a/src/badguy/angrystone.cpp +++ b/src/badguy/angrystone.cpp @@ -27,7 +27,7 @@ static const float ATTACK_TIME = 1; static const float RECOVER_TIME = .5; AngryStone::AngryStone(const Reader& reader) : - BadGuy(reader, "images/creatures/angrystone/angrystone.sprite"), + BadGuy(reader, "images/creatures/angrystone/angrystone.sprite"), attackDirection(), oldWallDirection(), timer(), diff --git a/src/badguy/badguy.hpp b/src/badguy/badguy.hpp index bda8d053d..8e9670b29 100644 --- a/src/badguy/badguy.hpp +++ b/src/badguy/badguy.hpp @@ -53,7 +53,7 @@ public: /** Set the badguy to kill/falling state, which makes him falling of the screen (his sprite is turned upside-down) */ virtual void kill_fall(); - + /** Call this, if you use custom kill_fall() or kill_squashed(GameObject& object) */ virtual void run_dead_script(); @@ -131,7 +131,7 @@ protected: /** called immediately before the first call to initialize */ virtual void initialize(); - + /** called when the badguy has been activated. (As a side effect the dir variable might have been changed so that it faces towards the player. */ @@ -185,7 +185,7 @@ protected: bool is_active(); /** changes colgroup_active. Also calls set_group when badguy is in STATE_ACTIVE */ - void set_colgroup_active(CollisionGroup group); + void set_colgroup_active(CollisionGroup group); private: void try_activate(); @@ -193,14 +193,14 @@ private: protected: Physic physic; -public: +public: /** Count this badguy to the statistics? This value should not be changed during runtime. */ bool countMe; protected: /** true if initialize() has already been called */ - bool is_initialized; + bool is_initialized; Vector start_position; @@ -220,18 +220,18 @@ private: /** true if state was STATE_ACTIVE at the beginning of the last call to update() */ - bool is_active_flag; + bool is_active_flag; Timer state_timer; /** true if we touched something solid from above and update_on_ground_flag was called last frame */ - bool on_ground_flag; + bool on_ground_flag; /** floor normal stored the last time when update_on_ground_flag was called and we touched something solid from above */ - Vector floor_normal; - + Vector floor_normal; + /** CollisionGroup the badguy should be in while active */ CollisionGroup colgroup_active; diff --git a/src/badguy/bomb.cpp b/src/badguy/bomb.cpp index 0283fb595..b0d43c03f 100644 --- a/src/badguy/bomb.cpp +++ b/src/badguy/bomb.cpp @@ -22,9 +22,9 @@ #include "supertux/sector.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(), - grabbed(false), + grabbed(false), grabber(NULL), ticking() { @@ -83,7 +83,7 @@ Bomb::explode() // Bomb class. if (grabber != NULL) { Player* player = dynamic_cast(grabber); - + if (player) player->stop_grabbing(); } diff --git a/src/badguy/bomb.hpp b/src/badguy/bomb.hpp index a45dd2298..5721b3022 100644 --- a/src/badguy/bomb.hpp +++ b/src/badguy/bomb.hpp @@ -21,7 +21,7 @@ #include "badguy/badguy.hpp" #include "object/portable.hpp" -class Bomb : public BadGuy, +class Bomb : public BadGuy, public Portable { public: diff --git a/src/badguy/captainsnowball.cpp b/src/badguy/captainsnowball.cpp index 4e3e7daa2..0ce2c0c06 100644 --- a/src/badguy/captainsnowball.cpp +++ b/src/badguy/captainsnowball.cpp @@ -21,7 +21,7 @@ #include "supertux/sector.hpp" namespace{ - static const float CAPTAIN_WALK_SPEED = 100; + static const float CAPTAIN_WALK_SPEED = 100; static const float BOARDING_SPEED = 200; } @@ -61,7 +61,7 @@ CaptainSnowball::might_climb(int width, int height) x1 = bbox.p2.x + 1; x2 = bbox.p2.x + width; } - return ((!Sector::current()->is_free_of_statics(Rectf(x1, y1a, x2, y2a))) && + return ((!Sector::current()->is_free_of_statics(Rectf(x1, y1a, x2, y2a))) && (Sector::current()->is_free_of_statics(Rectf(x1, y1b, x2, y2b)))); } diff --git a/src/badguy/dart.cpp b/src/badguy/dart.cpp index be6123dd2..deac0ffda 100644 --- a/src/badguy/dart.cpp +++ b/src/badguy/dart.cpp @@ -28,7 +28,7 @@ const float DART_SPEED = 200; static const std::string DART_SOUND = "sounds/flame.wav"; Dart::Dart(const Reader& reader) : - BadGuy(reader, "images/creatures/dart/dart.sprite"), + BadGuy(reader, "images/creatures/dart/dart.sprite"), parent(0), sound_source() { @@ -40,7 +40,7 @@ Dart::Dart(const Reader& reader) : } Dart::Dart(const Vector& pos, Direction d, const BadGuy* parent = 0) : - BadGuy(pos, d, "images/creatures/dart/dart.sprite"), + BadGuy(pos, d, "images/creatures/dart/dart.sprite"), parent(parent), sound_source() { diff --git a/src/badguy/dart.hpp b/src/badguy/dart.hpp index 8ba5f2ac7..58ef3addf 100644 --- a/src/badguy/dart.hpp +++ b/src/badguy/dart.hpp @@ -34,7 +34,7 @@ public: void initialize(); void activate(); void deactivate(); - + void active_update(float elapsed_time); void collision_solid(const CollisionHit& hit); diff --git a/src/badguy/darttrap.cpp b/src/badguy/darttrap.cpp index cfbc06e87..c07d447e3 100644 --- a/src/badguy/darttrap.cpp +++ b/src/badguy/darttrap.cpp @@ -29,9 +29,9 @@ const float MUZZLE_Y = 25; /**< [px] muzzle y-offset from top */ DartTrap::DartTrap(const Reader& reader) : BadGuy(reader, "images/creatures/darttrap/darttrap.sprite", LAYER_TILES-1), - initial_delay(0), - fire_delay(2), - ammo(-1), + initial_delay(0), + fire_delay(2), + ammo(-1), state(IDLE), fire_timer() { diff --git a/src/badguy/dispenser.cpp b/src/badguy/dispenser.cpp index 071e17dcc..542d0f550 100644 --- a/src/badguy/dispenser.cpp +++ b/src/badguy/dispenser.cpp @@ -145,7 +145,7 @@ Dispenser::active_update(float ) { if (dispense_timer.check()) { // auto always shoots in Tux's direction - if( autotarget ){ + if( autotarget ){ if( sprite->animation_done()) { sprite->set_action(dir == LEFT ? "working-left" : "working-right"); swivel = false; @@ -154,7 +154,7 @@ Dispenser::active_update(float ) Player* player = this->get_nearest_player(); if( player && !swivel ){ Direction targetdir = (player->get_pos().x > get_pos().x) ? RIGHT : LEFT; - if( dir != targetdir ){ // no target: swivel cannon + if( dir != targetdir ){ // no target: swivel cannon swivel = true; dir = targetdir; sprite->set_action(dir == LEFT ? "swivel-left" : "swivel-right", 1); @@ -178,8 +178,8 @@ Dispenser::launch_badguy() Player* player = this->get_nearest_player(); if( player ){ launchdir = (player->get_pos().x > get_pos().x) ? RIGHT : LEFT; - } - } + } + } if (badguys.size() > 1) { if (random) { diff --git a/src/badguy/fish.cpp b/src/badguy/fish.cpp index f6d3f7c2e..67743d3bf 100644 --- a/src/badguy/fish.cpp +++ b/src/badguy/fish.cpp @@ -24,7 +24,7 @@ static const float FISH_JUMP_POWER = -600; static const float FISH_WAIT_TIME = 1; Fish::Fish(const Reader& reader) : - BadGuy(reader, "images/creatures/fish/fish.sprite", LAYER_TILES-1), + BadGuy(reader, "images/creatures/fish/fish.sprite", LAYER_TILES-1), waiting(), stop_y(0) { @@ -32,7 +32,7 @@ Fish::Fish(const Reader& reader) : } Fish::Fish(const Vector& pos) : - BadGuy(pos, "images/creatures/fish/fish.sprite", LAYER_TILES-1), + BadGuy(pos, "images/creatures/fish/fish.sprite", LAYER_TILES-1), waiting(), stop_y(0) { diff --git a/src/badguy/flame.cpp b/src/badguy/flame.cpp index a06039f2d..6df88e056 100644 --- a/src/badguy/flame.cpp +++ b/src/badguy/flame.cpp @@ -30,9 +30,9 @@ static const std::string FLAME_SOUND = "sounds/flame.wav"; Flame::Flame(const Reader& reader) : - BadGuy(reader, "images/creatures/flame/flame.sprite", LAYER_FLOATINGOBJECTS), - angle(0), - radius(100), + BadGuy(reader, "images/creatures/flame/flame.sprite", LAYER_FLOATINGOBJECTS), + angle(0), + radius(100), speed(2), light(0.0f,0.0f,0.0f), lightsprite(sprite_manager->create("images/objects/lightmap_light/lightmap_light-small.sprite")), @@ -46,7 +46,7 @@ Flame::Flame(const Reader& reader) : sound_manager->preload(FLAME_SOUND); set_colgroup_active(COLGROUP_TOUCHABLE); - + lightsprite->set_blend(Blend(GL_SRC_ALPHA, GL_ONE)); lightsprite->set_color(Color(0.21f, 0.13f, 0.08f)); } @@ -112,7 +112,7 @@ Flame::freeze() sprite->set_action("fade", 1); Sector::current()->add_object(new SpriteParticle("images/objects/particles/smoke.sprite", "default", bbox.get_middle(), ANCHOR_MIDDLE, Vector(0, -150), Vector(0,0), LAYER_BACKGROUNDTILES+2)); set_group(COLGROUP_DISABLED); - + // start dead-script run_dead_script(); } diff --git a/src/badguy/flyingsnowball.cpp b/src/badguy/flyingsnowball.cpp index 2ad19e45f..1102e9aad 100644 --- a/src/badguy/flyingsnowball.cpp +++ b/src/badguy/flyingsnowball.cpp @@ -88,14 +88,14 @@ FlyingSnowBall::active_update(float elapsed_time) } else if (get_pos().y < start_position.y - 2*32) { - // Flying too high - decreased propeller speed + // Flying too high - decreased propeller speed physic.set_acceleration_y(-grav*0.8); physic.set_velocity_y(physic.get_velocity_y() * 0.99f); } else { - // Flying at acceptable altitude - normal propeller speed + // Flying at acceptable altitude - normal propeller speed physic.set_acceleration_y(-grav*normal_propeller_speed); } diff --git a/src/badguy/ghostflame.cpp b/src/badguy/ghostflame.cpp index f731e5615..843f9d848 100644 --- a/src/badguy/ghostflame.cpp +++ b/src/badguy/ghostflame.cpp @@ -28,9 +28,9 @@ #include "util/reader.hpp" Ghostflame::Ghostflame(const Reader& reader) : - BadGuy(reader, "images/creatures/flame/ghostflame.sprite", LAYER_FLOATINGOBJECTS), - angle(0), - radius(100), + BadGuy(reader, "images/creatures/flame/ghostflame.sprite", LAYER_FLOATINGOBJECTS), + angle(0), + radius(100), speed(2), light(0.0f,0.0f,0.0f), lightsprite(sprite_manager->create("images/objects/lightmap_light/lightmap_light-small.sprite")) @@ -42,12 +42,12 @@ Ghostflame::Ghostflame(const Reader& reader) : countMe = false; //TODO: get unique death sound sound_manager->preload("sounds/fizz.wav"); - + set_colgroup_active(COLGROUP_TOUCHABLE); - + lightsprite->set_blend(Blend(GL_SRC_ALPHA, GL_ONE)); lightsprite->set_color(Color(0.21f, 0.00f, 0.21f)); - + } void @@ -57,7 +57,7 @@ Ghostflame::active_update(float elapsed_time) Vector newpos(start_position.x + cos(angle) * radius, start_position.y + sin(angle) * radius); movement = newpos - get_pos(); - + } void diff --git a/src/badguy/ghosttree.cpp b/src/badguy/ghosttree.cpp index 89ce7e967..d0d234275 100644 --- a/src/badguy/ghosttree.cpp +++ b/src/badguy/ghosttree.cpp @@ -37,18 +37,18 @@ static const Vector SUCK_TARGET_OFFSET = Vector(-16,-16); static const float SUCK_TARGET_SPREAD = 8; GhostTree::GhostTree(const Reader& lisp) : - BadGuy(lisp, "images/creatures/ghosttree/ghosttree.sprite", LAYER_OBJECTS - 10), + BadGuy(lisp, "images/creatures/ghosttree/ghosttree.sprite", LAYER_OBJECTS - 10), mystate(STATE_IDLE), willowisp_timer(), willo_spawn_y(0), - willo_radius(200), - willo_speed(1.8f), + willo_radius(200), + willo_speed(1.8f), willo_color(0), glow_sprite(), colorchange_timer(), suck_timer(), root_timer(), - treecolor(0), + treecolor(0), suck_lantern_color(), suck_lantern(0), willowisps() @@ -67,8 +67,8 @@ void GhostTree::die() { mystate = STATE_DYING; - sprite->set_action("dying", 1); - glow_sprite->set_action("dying", 1); + sprite->set_action("dying", 1); + glow_sprite->set_action("dying", 1); std::vector::iterator iter; for(iter = willowisps.begin(); iter != willowisps.end(); ++iter) { @@ -126,7 +126,7 @@ GhostTree::active_update(float elapsed_time) 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 + TreeWillOWisp *willowisp = new TreeWillOWisp(this, pos, 200 + willo_radius, willo_speed); Sector::current()->add_object(willowisp); @@ -182,7 +182,7 @@ GhostTree::active_update(float elapsed_time) suck_lantern->ungrab(*this, RIGHT); suck_lantern->remove_me(); suck_lantern = 0; - sprite->set_action("swallow", 1); + sprite->set_action("swallow", 1); } else { pos += dir; suck_lantern->grab(*this, pos, RIGHT); @@ -202,7 +202,7 @@ GhostTree::active_update(float elapsed_time) } } -bool +bool GhostTree::is_color_deadly(Color color) const { if (color == Color(0,0,0)) return false; Color my_color = glow_sprite->get_color(); diff --git a/src/badguy/goldbomb.cpp b/src/badguy/goldbomb.cpp index c177a9928..6b626a69a 100644 --- a/src/badguy/goldbomb.cpp +++ b/src/badguy/goldbomb.cpp @@ -153,7 +153,7 @@ GoldBomb::kill_fall() // GoldBomb class. if (grabber != NULL) { Player* player = dynamic_cast(grabber); - + if (player) player->stop_grabbing(); } diff --git a/src/badguy/haywire.cpp b/src/badguy/haywire.cpp index d1bfa5804..87b2cf11d 100644 --- a/src/badguy/haywire.cpp +++ b/src/badguy/haywire.cpp @@ -83,7 +83,7 @@ Haywire::collision_squished(GameObject& object) player->bounce (*this); return true; } - + if(WalkingBadguy::is_frozen()) { WalkingBadguy::unfreeze(); } @@ -105,7 +105,7 @@ Haywire::collision_squished(GameObject& object) grunting->set_position(get_pos()); grunting->set_looping(true); grunting->set_reference_distance(32); - grunting->play(); + grunting->play(); } time_stunned = TIME_STUNNED; diff --git a/src/badguy/haywire.hpp b/src/badguy/haywire.hpp index c7a1e54dc..874d73ace 100644 --- a/src/badguy/haywire.hpp +++ b/src/badguy/haywire.hpp @@ -43,7 +43,7 @@ private: float time_until_explosion; bool is_stunned; float time_stunned; - + std::unique_ptr ticking; std::unique_ptr grunting; }; diff --git a/src/badguy/iceflame.cpp b/src/badguy/iceflame.cpp index 716003663..46b5e8597 100644 --- a/src/badguy/iceflame.cpp +++ b/src/badguy/iceflame.cpp @@ -28,9 +28,9 @@ #include "util/reader.hpp" Iceflame::Iceflame(const Reader& reader) : - BadGuy(reader, "images/creatures/flame/iceflame.sprite", LAYER_FLOATINGOBJECTS), - angle(0), - radius(100), + BadGuy(reader, "images/creatures/flame/iceflame.sprite", LAYER_FLOATINGOBJECTS), + angle(0), + radius(100), speed(2), light(0.0f,0.0f,0.0f), lightsprite(sprite_manager->create("images/objects/lightmap_light/lightmap_light-small.sprite")) @@ -41,12 +41,12 @@ Iceflame::Iceflame(const Reader& reader) : start_position.y + sin(angle) * radius)); countMe = false; sound_manager->preload("sounds/sizzle.ogg"); - + set_colgroup_active(COLGROUP_TOUCHABLE); - + lightsprite->set_blend(Blend(GL_SRC_ALPHA, GL_ONE)); lightsprite->set_color(Color(0.00f, 0.13f, 0.18f)); - + } void @@ -56,7 +56,7 @@ Iceflame::active_update(float elapsed_time) Vector newpos(start_position.x + cos(angle) * radius, start_position.y + sin(angle) * radius); movement = newpos - get_pos(); - + if (sprite->get_action() == "fade" && sprite->animation_done()) remove_me(); } diff --git a/src/badguy/igel.cpp b/src/badguy/igel.cpp index c1769a40a..1fc48c0c7 100644 --- a/src/badguy/igel.cpp +++ b/src/badguy/igel.cpp @@ -29,7 +29,7 @@ const float RANGE_OF_VISION = 256; /**< range in px at which we can see bullets } // namespace Igel::Igel(const Reader& reader) : - WalkingBadguy(reader, "images/creatures/igel/igel.sprite", "walking-left", "walking-right"), + WalkingBadguy(reader, "images/creatures/igel/igel.sprite", "walking-left", "walking-right"), turn_recover_timer() { walk_speed = IGEL_SPEED; diff --git a/src/badguy/jumpy.cpp b/src/badguy/jumpy.cpp index 272e6aea1..6b04ebbb4 100644 --- a/src/badguy/jumpy.cpp +++ b/src/badguy/jumpy.cpp @@ -25,7 +25,7 @@ static const float JUMPY_MID_TOLERANCE=4; static const float JUMPY_LOW_TOLERANCE=2; Jumpy::Jumpy(const Reader& reader) : - BadGuy(reader, "images/creatures/snowjumpy/snowjumpy.sprite"), + BadGuy(reader, "images/creatures/snowjumpy/snowjumpy.sprite"), pos_groundhit(), groundhit_pos_set(false) { diff --git a/src/badguy/kamikazesnowball.cpp b/src/badguy/kamikazesnowball.cpp index 838969fd1..b82a53311 100644 --- a/src/badguy/kamikazesnowball.cpp +++ b/src/badguy/kamikazesnowball.cpp @@ -20,9 +20,9 @@ #include "sprite/sprite.hpp" #include "supertux/object_factory.hpp" -/* +/* * Kamikaze Snowball will fly in one direction until he hits something. - * On impact he is destroyed, trying to kill what he hit or hit him. + * On impact he is destroyed, trying to kill what he hit or hit him. */ namespace{ static const float KAMIKAZE_SPEED = 200; diff --git a/src/badguy/kugelblitz.cpp b/src/badguy/kugelblitz.cpp index c1c774270..ea3911416 100644 --- a/src/badguy/kugelblitz.cpp +++ b/src/badguy/kugelblitz.cpp @@ -33,7 +33,7 @@ #define RAND_SPEED 150 Kugelblitz::Kugelblitz(const Reader& reader) : - BadGuy(reader, "images/creatures/kugelblitz/kugelblitz.sprite"), + BadGuy(reader, "images/creatures/kugelblitz/kugelblitz.sprite"), pos_groundhit(), groundhit_pos_set(false), dying(), @@ -48,9 +48,9 @@ Kugelblitz::Kugelblitz(const Reader& reader) : sprite->set_action("falling"); physic.enable_gravity(false); countMe = false; - + lightsprite->set_blend(Blend(GL_SRC_ALPHA, GL_ONE)); - lightsprite->set_color(Color(0.2f, 0.1f, 0.0f)); + lightsprite->set_color(Color(0.2f, 0.1f, 0.0f)); } void @@ -159,7 +159,7 @@ void Kugelblitz::draw(DrawingContext& context) { sprite->draw(context, get_pos(), layer); - + //Only draw light in dark areas context.get_light( get_bbox().get_middle(), &light ); if (light.red + light.green < 2.0){ diff --git a/src/badguy/kugelblitz.hpp b/src/badguy/kugelblitz.hpp index 95d402c9b..b235aec6f 100644 --- a/src/badguy/kugelblitz.hpp +++ b/src/badguy/kugelblitz.hpp @@ -32,7 +32,7 @@ public: void active_update(float); void kill_fall(); void explode(); - + virtual void draw(DrawingContext& context); private: diff --git a/src/badguy/livefire.cpp b/src/badguy/livefire.cpp index 46b0ba59e..d62d036f5 100644 --- a/src/badguy/livefire.cpp +++ b/src/badguy/livefire.cpp @@ -27,7 +27,7 @@ LiveFire::LiveFire(const Reader& reader) : WalkingBadguy(reader, "images/creatures/livefire/livefire.sprite", "left", "right"), lightsprite(sprite_manager->create("images/objects/lightmap_light/lightmap_light-medium.sprite")), death_sound("sounds/fall.wav"), - state(STATE_WALKING) + state(STATE_WALKING) { walk_speed = 80; max_drop_height = 20; diff --git a/src/badguy/livefire.hpp b/src/badguy/livefire.hpp index e1c6e8acc..e863c972c 100644 --- a/src/badguy/livefire.hpp +++ b/src/badguy/livefire.hpp @@ -61,7 +61,7 @@ class LiveFireDormant : public LiveFire { public: LiveFireDormant(const Reader& reader); - + void initialize(); }; diff --git a/src/badguy/mole.cpp b/src/badguy/mole.cpp index 46daf14d8..2921ddbeb 100644 --- a/src/badguy/mole.cpp +++ b/src/badguy/mole.cpp @@ -30,7 +30,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 Reader& reader) : - BadGuy(reader, "images/creatures/mole/mole.sprite", LAYER_TILES-1), + BadGuy(reader, "images/creatures/mole/mole.sprite", LAYER_TILES-1), state(PRE_THROWING), timer(), throw_timer() @@ -42,7 +42,7 @@ Mole::Mole(const Reader& reader) : } Mole::Mole(const Vector& pos) : - BadGuy(pos, "images/creatures/mole/mole.sprite", LAYER_TILES-1), + BadGuy(pos, "images/creatures/mole/mole.sprite", LAYER_TILES-1), state(PRE_THROWING), timer(), throw_timer() diff --git a/src/badguy/mole_rock.cpp b/src/badguy/mole_rock.cpp index 786b39677..a0cf0c081 100644 --- a/src/badguy/mole_rock.cpp +++ b/src/badguy/mole_rock.cpp @@ -32,8 +32,8 @@ MoleRock::MoleRock(const Reader& 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), + BadGuy(pos, LEFT, "images/creatures/mole/mole_rock.sprite", LAYER_TILES - 2), + parent(parent), initial_velocity(velocity) { physic.enable_gravity(true); diff --git a/src/badguy/mrbomb.hpp b/src/badguy/mrbomb.hpp index 8c06a36d1..d3b131169 100644 --- a/src/badguy/mrbomb.hpp +++ b/src/badguy/mrbomb.hpp @@ -19,7 +19,7 @@ #include "badguy/walking_badguy.hpp" -class MrBomb : public WalkingBadguy, +class MrBomb : public WalkingBadguy, public Portable { public: diff --git a/src/badguy/mriceblock.cpp b/src/badguy/mriceblock.cpp index fa8e0efd3..8cf3bdbf2 100644 --- a/src/badguy/mriceblock.cpp +++ b/src/badguy/mriceblock.cpp @@ -31,8 +31,8 @@ const float NOKICK_TIME = 0.1f; } MrIceBlock::MrIceBlock(const Reader& reader) : - WalkingBadguy(reader, "images/creatures/mr_iceblock/mr_iceblock.sprite", "left", "right"), - ice_state(ICESTATE_NORMAL), + WalkingBadguy(reader, "images/creatures/mr_iceblock/mr_iceblock.sprite", "left", "right"), + ice_state(ICESTATE_NORMAL), nokick_timer(), flat_timer(), squishcount(0) @@ -45,8 +45,8 @@ MrIceBlock::MrIceBlock(const Reader& reader) : } MrIceBlock::MrIceBlock(const Vector& pos, Direction d) : - WalkingBadguy(pos, d, "images/creatures/mr_iceblock/mr_iceblock.sprite", "left", "right"), - ice_state(ICESTATE_NORMAL), + WalkingBadguy(pos, d, "images/creatures/mr_iceblock/mr_iceblock.sprite", "left", "right"), + ice_state(ICESTATE_NORMAL), nokick_timer(), flat_timer(), squishcount(0) diff --git a/src/badguy/mriceblock.hpp b/src/badguy/mriceblock.hpp index 6254527ef..e0ff607cf 100644 --- a/src/badguy/mriceblock.hpp +++ b/src/badguy/mriceblock.hpp @@ -20,7 +20,7 @@ #include "badguy/walking_badguy.hpp" #include "object/portable.hpp" -class MrIceBlock : public WalkingBadguy, +class MrIceBlock : public WalkingBadguy, public Portable { public: diff --git a/src/badguy/root.cpp b/src/badguy/root.cpp index e1fd55f3e..58ecfa5b1 100644 --- a/src/badguy/root.cpp +++ b/src/badguy/root.cpp @@ -24,7 +24,7 @@ static const float HATCH_TIME = 0.75; Root::Root(const Vector& pos) : BadGuy(pos, "images/creatures/ghosttree/root.sprite", LAYER_TILES-1), - mystate(STATE_APPEARING), + mystate(STATE_APPEARING), base_sprite(), offset_y(0), hatch_timer() @@ -50,7 +50,7 @@ Root::deactivate() void Root::active_update(float elapsed_time) { - if (mystate == STATE_APPEARING) { + if (mystate == STATE_APPEARING) { if (base_sprite->animation_done()) { hatch_timer.start(HATCH_TIME); mystate = STATE_HATCHING; @@ -73,7 +73,7 @@ Root::active_update(float elapsed_time) offset_y = 0; mystate = STATE_VANISHING; base_sprite->set_action("vanishing", 2); - base_sprite->set_animation_loops(2); // TODO: doesn't seem to work for loops=1 + base_sprite->set_animation_loops(2); // TODO: doesn't seem to work for loops=1 } set_pos(start_position + Vector(0, offset_y)); } diff --git a/src/badguy/snail.cpp b/src/badguy/snail.cpp index c3b3e8c4d..7592c158f 100644 --- a/src/badguy/snail.cpp +++ b/src/badguy/snail.cpp @@ -30,8 +30,8 @@ const float SNAIL_KICK_SPEED_Y = -500; /**< y-velocity gained when kicked */ } Snail::Snail(const Reader& reader) : - WalkingBadguy(reader, "images/creatures/snail/snail.sprite", "left", "right"), - state(STATE_NORMAL), + WalkingBadguy(reader, "images/creatures/snail/snail.sprite", "left", "right"), + state(STATE_NORMAL), kicked_delay_timer(), squishcount(0) { @@ -43,8 +43,8 @@ Snail::Snail(const Reader& reader) : } Snail::Snail(const Vector& pos, Direction d) : - WalkingBadguy(pos, d, "images/creatures/snail/snail.sprite", "left", "right"), - state(STATE_NORMAL), + WalkingBadguy(pos, d, "images/creatures/snail/snail.sprite", "left", "right"), + state(STATE_NORMAL), kicked_delay_timer(), squishcount(0) { diff --git a/src/badguy/spidermite.cpp b/src/badguy/spidermite.cpp index f8b2fc69f..b3e528087 100644 --- a/src/badguy/spidermite.cpp +++ b/src/badguy/spidermite.cpp @@ -32,7 +32,7 @@ SpiderMite::SpiderMite(const Reader& reader) : } SpiderMite::SpiderMite(const Vector& pos) : - BadGuy(pos, "images/creatures/spidermite/spidermite.sprite"), + BadGuy(pos, "images/creatures/spidermite/spidermite.sprite"), mode(), timer() { diff --git a/src/badguy/stumpy.cpp b/src/badguy/stumpy.cpp index f06f20efe..5a61070c8 100644 --- a/src/badguy/stumpy.cpp +++ b/src/badguy/stumpy.cpp @@ -29,7 +29,7 @@ static const float STUMPY_SPEED = 120; static const float INVINCIBLE_TIME = 1; Stumpy::Stumpy(const Reader& reader) : - WalkingBadguy(reader, "images/creatures/mr_tree/stumpy.sprite","left","right"), + WalkingBadguy(reader, "images/creatures/mr_tree/stumpy.sprite","left","right"), mystate(STATE_NORMAL), invincible_timer() { @@ -39,7 +39,7 @@ Stumpy::Stumpy(const Reader& reader) : } Stumpy::Stumpy(const Vector& pos, Direction d) : - WalkingBadguy(pos, d, "images/creatures/mr_tree/stumpy.sprite","left","right"), + WalkingBadguy(pos, d, "images/creatures/mr_tree/stumpy.sprite","left","right"), mystate(STATE_INVINCIBLE), invincible_timer() { diff --git a/src/badguy/treewillowisp.cpp b/src/badguy/treewillowisp.cpp index 2b6c87ec6..4888a2ed4 100644 --- a/src/badguy/treewillowisp.cpp +++ b/src/badguy/treewillowisp.cpp @@ -31,9 +31,9 @@ static const float SUCKSPEED = 25; TreeWillOWisp::TreeWillOWisp(GhostTree* tree, const Vector& pos, float radius, float speed) : BadGuy(tree->get_pos() + pos, "images/creatures/willowisp/willowisp.sprite", - LAYER_OBJECTS - 20), - was_sucked(false), - mystate(STATE_DEFAULT), + LAYER_OBJECTS - 20), + was_sucked(false), + mystate(STATE_DEFAULT), color(), angle(), radius(), @@ -96,7 +96,7 @@ TreeWillOWisp::collides(GameObject& other, const CollisionHit& ) { return true; if (dynamic_cast(&other)) return true; - + return false; } diff --git a/src/badguy/walking_badguy.cpp b/src/badguy/walking_badguy.cpp index 203d5f727..ad74358b1 100644 --- a/src/badguy/walking_badguy.cpp +++ b/src/badguy/walking_badguy.cpp @@ -20,46 +20,46 @@ #include "sprite/sprite.hpp" -WalkingBadguy::WalkingBadguy(const Vector& pos, - const std::string& sprite_name, - const std::string& walk_left_action, - const std::string& walk_right_action, +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), + BadGuy(pos, sprite_name, layer), + walk_left_action(walk_left_action), + walk_right_action(walk_right_action), + walk_speed(80), max_drop_height(-1), turn_around_timer(), turn_around_counter() { } -WalkingBadguy::WalkingBadguy(const Vector& pos, - Direction direction, - const std::string& sprite_name, - const std::string& walk_left_action, - const std::string& walk_right_action, +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), + 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), turn_around_timer(), turn_around_counter() { } -WalkingBadguy::WalkingBadguy(const Reader& reader, - const std::string& sprite_name, - const std::string& walk_left_action, - const std::string& walk_right_action, +WalkingBadguy::WalkingBadguy(const Reader& 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), + BadGuy(reader, sprite_name, layer), + walk_left_action(walk_left_action), + walk_right_action(walk_right_action), + walk_speed(80), max_drop_height(-1), turn_around_timer(), turn_around_counter() diff --git a/src/badguy/walking_badguy.hpp b/src/badguy/walking_badguy.hpp index 038d87668..26c2f47b2 100644 --- a/src/badguy/walking_badguy.hpp +++ b/src/badguy/walking_badguy.hpp @@ -27,20 +27,20 @@ class Timer; class WalkingBadguy : public BadGuy { public: - WalkingBadguy(const Vector& pos, - const std::string& sprite_name, - const std::string& walk_left_action, - const std::string& walk_right_action, + WalkingBadguy(const Vector& pos, + const std::string& sprite_name, + const std::string& walk_left_action, + const std::string& walk_right_action, int layer = LAYER_OBJECTS); - WalkingBadguy(const Vector& pos, Direction direction, - const std::string& sprite_name, - const std::string& walk_left_action, - const std::string& walk_right_action, + 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 = LAYER_OBJECTS); - WalkingBadguy(const Reader& reader, - const std::string& sprite_name, - const std::string& walk_left_action, - const std::string& walk_right_action, + WalkingBadguy(const Reader& reader, + const std::string& sprite_name, + const std::string& walk_left_action, + const std::string& walk_right_action, int layer = LAYER_OBJECTS); void initialize(); diff --git a/src/badguy/willowisp.cpp b/src/badguy/willowisp.cpp index 8f8746a3e..88e28d8b4 100644 --- a/src/badguy/willowisp.cpp +++ b/src/badguy/willowisp.cpp @@ -35,9 +35,9 @@ static const float VANISH_RANGE = 512; /**< at what distance to stop tracking an static const std::string SOUNDFILE = "sounds/willowisp.wav"; WillOWisp::WillOWisp(const Reader& reader) : - BadGuy(reader, "images/creatures/willowisp/willowisp.sprite", LAYER_FLOATINGOBJECTS), - mystate(STATE_IDLE), - target_sector("main"), + BadGuy(reader, "images/creatures/willowisp/willowisp.sprite", LAYER_FLOATINGOBJECTS), + mystate(STATE_IDLE), + target_sector("main"), target_spawnpoint("main"), hit_script(), sound_source(), @@ -287,7 +287,7 @@ WillOWisp::expose(HSQUIRRELVM vm, SQInteger table_idx) scripting::WillOWisp* _this = static_cast (this); expose_object(vm, table_idx, _this, name); } - + void WillOWisp::unexpose(HSQUIRRELVM vm, SQInteger table_idx) { diff --git a/src/badguy/willowisp.hpp b/src/badguy/willowisp.hpp index 22e2c62d7..0cf10dcf7 100644 --- a/src/badguy/willowisp.hpp +++ b/src/badguy/willowisp.hpp @@ -26,7 +26,7 @@ class SoundSource; #include "scripting/willowisp.hpp" #include "supertux/script_interface.hpp" -class WillOWisp : public BadGuy, +class WillOWisp : public BadGuy, public scripting::WillOWisp, public ScriptInterface { diff --git a/src/control/input_manager.cpp b/src/control/input_manager.cpp index 6f6ab3757..a4cad707e 100644 --- a/src/control/input_manager.cpp +++ b/src/control/input_manager.cpp @@ -58,13 +58,13 @@ void InputManager::read(const Reader& lisp) { const lisp::Lisp* keymap_lisp = lisp.get_lisp("keymap"); - if (keymap_lisp) + if (keymap_lisp) { keyboard_manager->read(keymap_lisp); } const lisp::Lisp* joystick_lisp = lisp.get_lisp(_("joystick")); - if (joystick_lisp) + if (joystick_lisp) { joystick_manager->read(joystick_lisp); } diff --git a/src/control/input_manager.hpp b/src/control/input_manager.hpp index ba1df178e..1a0736c06 100644 --- a/src/control/input_manager.hpp +++ b/src/control/input_manager.hpp @@ -66,7 +66,7 @@ private: public: bool m_use_game_controller; std::unique_ptr keyboard_manager; - std::unique_ptr joystick_manager; + std::unique_ptr joystick_manager; std::unique_ptr game_controller_manager; private: diff --git a/src/control/keyboard_manager.cpp b/src/control/keyboard_manager.cpp index 912a02e91..d46e4f624 100644 --- a/src/control/keyboard_manager.cpp +++ b/src/control/keyboard_manager.cpp @@ -63,15 +63,15 @@ KeyboardManager::process_key_event(const SDL_KeyboardEvent& event) KeyMap::iterator key_mapping = keymap.find(event.keysym.sym); // if console key was pressed: toggle console - if (key_mapping != keymap.end() && + if (key_mapping != keymap.end() && key_mapping->second == Controller::CONSOLE) { if (event.type == SDL_KEYDOWN) { Console::instance->toggle(); } - } - else if (Console::instance->hasFocus()) + } + else if (Console::instance->hasFocus()) { // if console is open: send key there process_console_key_event(event); @@ -81,12 +81,12 @@ KeyboardManager::process_key_event(const SDL_KeyboardEvent& event) // if menu mode: send key there process_menu_key_event(event); } - else if (key_mapping == keymap.end()) + else if (key_mapping == keymap.end()) { // default action: update controls //log_debug << "Key " << event.key.SDL_Keycode.sym << " is unbound" << std::endl; } - else + else { auto control = key_mapping->second; bool value = (event.type == SDL_KEYDOWN); @@ -157,13 +157,13 @@ void KeyboardManager::process_menu_key_event(const SDL_KeyboardEvent& event) { // wait for key mode? - if (wait_for_key >= 0) + if (wait_for_key >= 0) { if (event.type == SDL_KEYUP) return; - if (event.keysym.sym != SDLK_ESCAPE && - event.keysym.sym != SDLK_PAUSE) + if (event.keysym.sym != SDLK_ESCAPE && + event.keysym.sym != SDLK_PAUSE) { bind_key(event.keysym.sym, static_cast(wait_for_key)); } @@ -172,10 +172,10 @@ KeyboardManager::process_menu_key_event(const SDL_KeyboardEvent& event) wait_for_key = -1; return; } - - if (m_parent->joystick_manager->wait_for_joystick >= 0) + + if (m_parent->joystick_manager->wait_for_joystick >= 0) { - if (event.keysym.sym == SDLK_ESCAPE) + if (event.keysym.sym == SDLK_ESCAPE) { m_parent->reset(); MenuManager::instance().refresh(); @@ -244,7 +244,7 @@ KeyboardManager::bind_key(SDL_Keycode key, Controller::Control control) SDL_Keycode KeyboardManager::reversemap_key(Controller::Control c) { - for(KeyMap::iterator i = keymap.begin(); i != keymap.end(); ++i) + for(KeyMap::iterator i = keymap.begin(); i != keymap.end(); ++i) { if (i->second == c) { diff --git a/src/gui/menu_manager.cpp b/src/gui/menu_manager.cpp index 001f7b740..d30f06501 100644 --- a/src/gui/menu_manager.cpp +++ b/src/gui/menu_manager.cpp @@ -182,7 +182,7 @@ MenuManager::draw(DrawingContext& context) m_transition->update(); m_transition->draw(context); } - else + else { if (current()) { diff --git a/src/gui/mousecursor.cpp b/src/gui/mousecursor.cpp index f03dd1c20..ae3f5a5ec 100644 --- a/src/gui/mousecursor.cpp +++ b/src/gui/mousecursor.cpp @@ -28,7 +28,7 @@ MouseCursor* MouseCursor::current_ = 0; MouseCursor::MouseCursor(const std::string& cursor_file, const std::string& cursor_click_file, const std::string& cursor_link_file) : - m_mid_x(0), + m_mid_x(0), m_mid_y(0), m_state(MC_NORMAL), m_cursor() diff --git a/src/gui/mousecursor.hpp b/src/gui/mousecursor.hpp index 0f517f66c..4aaa11df8 100644 --- a/src/gui/mousecursor.hpp +++ b/src/gui/mousecursor.hpp @@ -64,7 +64,7 @@ public: /// Set current cursor. static void set_current(MouseCursor* pcursor) { current_ = pcursor; }; - + private: int m_mid_x; int m_mid_y; diff --git a/src/lisp/lexer.cpp b/src/lisp/lexer.cpp index 23e95cdd6..99ffa8151 100644 --- a/src/lisp/lexer.cpp +++ b/src/lisp/lexer.cpp @@ -24,8 +24,8 @@ namespace lisp { Lexer::Lexer(std::istream& newstream) : - stream(newstream), - eof(false), + stream(newstream), + eof(false), linenumber(0), bufend(), bufpos(), diff --git a/src/lisp/list_iterator.cpp b/src/lisp/list_iterator.cpp index c344fa04e..d26ee15cc 100644 --- a/src/lisp/list_iterator.cpp +++ b/src/lisp/list_iterator.cpp @@ -21,7 +21,7 @@ namespace lisp { ListIterator::ListIterator(const lisp::Lisp* newlisp) : current_item(), - current_lisp(0), + current_lisp(0), cur(newlisp) { } diff --git a/src/lisp/parser.cpp b/src/lisp/parser.cpp index 701091baf..53f646960 100644 --- a/src/lisp/parser.cpp +++ b/src/lisp/parser.cpp @@ -31,9 +31,9 @@ namespace lisp { Parser::Parser(bool translate) : - lexer(0), + lexer(0), filename(), - dictionary_manager(0), + dictionary_manager(0), dictionary(0), token(), searchpath(), @@ -42,7 +42,7 @@ Parser::Parser(bool translate) : if(translate) { dictionary_manager = new tinygettext::DictionaryManager(); dictionary_manager->set_charset("UTF-8"); - if (g_config && (g_config->locale != "")) + if (g_config && (g_config->locale != "")) dictionary_manager->set_language(tinygettext::Language::from_name(g_config->locale)); } diff --git a/src/math/size.hpp b/src/math/size.hpp index 722b840a2..47d8366fb 100644 --- a/src/math/size.hpp +++ b/src/math/size.hpp @@ -25,13 +25,13 @@ class Size { public: Size() : - width(0), + width(0), height(0) {} Size(int width_, int height_) : - width(width_), - height(height_) + width(width_), + height(height_) {} Size(const Size& rhs) : @@ -57,16 +57,16 @@ public: Size& operator+=(const Size& rhs) { - width += rhs.width; - height += rhs.height; - return *this; + width += rhs.width; + height += rhs.height; + return *this; } Size& operator-=(const Size& rhs) - { + { width -= rhs.width; - height -= rhs.height; - return *this; + height -= rhs.height; + return *this; } public: @@ -75,43 +75,43 @@ public: }; inline Size operator*(const Size& lhs, int factor) -{ - return Size(lhs.width * factor, - lhs.height * factor); +{ + return Size(lhs.width * factor, + lhs.height * factor); } inline Size operator*(int factor, const Size& rhs) -{ - return Size(rhs.width * factor, - rhs.height * factor); +{ + return Size(rhs.width * factor, + rhs.height * factor); } inline Size operator/(const Size& lhs, int divisor) -{ - return Size(lhs.width / divisor, - lhs.height / divisor); +{ + return Size(lhs.width / divisor, + lhs.height / divisor); } inline Size operator+(const Size& lhs, const Size& rhs) -{ - return Size(lhs.width + rhs.width, - lhs.height + rhs.height); +{ + return Size(lhs.width + rhs.width, + lhs.height + rhs.height); } inline Size operator-(const Size& lhs, const Size& rhs) { - return Size(lhs.width - rhs.width, - lhs.height - rhs.height); + return Size(lhs.width - rhs.width, + lhs.height - rhs.height); } inline bool operator==(const Size& lhs, const Size& rhs) { - return (lhs.width == rhs.width) && (lhs.height == rhs.height); + return (lhs.width == rhs.width) && (lhs.height == rhs.height); } inline bool operator!=(const Size& lhs, const Size& rhs) -{ - return (lhs.width != rhs.width) || (lhs.height != rhs.height); +{ + return (lhs.width != rhs.width) || (lhs.height != rhs.height); } std::ostream& operator<<(std::ostream& s, const Size& size); diff --git a/src/math/sizef.hpp b/src/math/sizef.hpp index 448cb5512..636416a56 100644 --- a/src/math/sizef.hpp +++ b/src/math/sizef.hpp @@ -30,8 +30,8 @@ public: {} Sizef(float width_, float height_) : - width(width_), - height(height_) + width(width_), + height(height_) {} Sizef(const Sizef& rhs) : @@ -56,17 +56,17 @@ public: } Sizef& operator+=(const Sizef& rhs) - { - width += rhs.width; - height += rhs.height; - return *this; + { + width += rhs.width; + height += rhs.height; + return *this; } Sizef& operator-=(const Sizef& rhs) - { - width -= rhs.width; - height -= rhs.height; - return *this; + { + width -= rhs.width; + height -= rhs.height; + return *this; } public: @@ -75,43 +75,43 @@ public: }; inline Sizef operator*(const Sizef& lhs, float factor) -{ - return Sizef(lhs.width * factor, - lhs.height * factor); +{ + return Sizef(lhs.width * factor, + lhs.height * factor); } inline Sizef operator*(float factor, const Sizef& rhs) -{ - return Sizef(rhs.width * factor, - rhs.height * factor); +{ + return Sizef(rhs.width * factor, + rhs.height * factor); } inline Sizef operator/(const Sizef& lhs, float divisor) -{ - return Sizef(lhs.width / divisor, - lhs.height / divisor); +{ + return Sizef(lhs.width / divisor, + lhs.height / divisor); } inline Sizef operator+(const Sizef& lhs, const Sizef& rhs) -{ - return Sizef(lhs.width + rhs.width, - lhs.height + rhs.height); +{ + return Sizef(lhs.width + rhs.width, + lhs.height + rhs.height); } inline Sizef operator-(const Sizef& lhs, const Sizef& rhs) { - return Sizef(lhs.width - rhs.width, - lhs.height - rhs.height); + return Sizef(lhs.width - rhs.width, + lhs.height - rhs.height); } inline bool operator==(const Sizef& lhs, const Sizef& rhs) { - return (lhs.width == rhs.width) && (rhs.height == rhs.height); + return (lhs.width == rhs.width) && (rhs.height == rhs.height); } inline bool operator!=(const Sizef& lhs, const Sizef& rhs) -{ - return (lhs.width != rhs.width) || (lhs.height != rhs.height); +{ + return (lhs.width != rhs.width) || (lhs.height != rhs.height); } std::ostream& operator<<(std::ostream& s, const Sizef& size); diff --git a/src/object/ambient_sound.cpp b/src/object/ambient_sound.cpp index 730e7a723..f39726409 100644 --- a/src/object/ambient_sound.cpp +++ b/src/object/ambient_sound.cpp @@ -142,7 +142,7 @@ AmbientSound::hit(Player& ) } void -AmbientSound::stop_playing() +AmbientSound::stop_playing() { delete sound_source; sound_source = 0; diff --git a/src/object/ambient_sound.hpp b/src/object/ambient_sound.hpp index 8567c323c..1f059efe3 100644 --- a/src/object/ambient_sound.hpp +++ b/src/object/ambient_sound.hpp @@ -47,8 +47,8 @@ class Player; class SoundSource; -class AmbientSound : public GameObject, - public ScriptInterface, +class AmbientSound : public GameObject, + public ScriptInterface, public scripting::AmbientSound { public: diff --git a/src/object/background.cpp b/src/object/background.cpp index bef5d400e..f49e05c62 100644 --- a/src/object/background.cpp +++ b/src/object/background.cpp @@ -179,8 +179,8 @@ Background::draw_image(DrawingContext& context, const Vector& pos) case TOP_ALIGNMENT: for(int x = start_x; x < end_x; ++x) { - Vector p(pos.x + x * image->get_width() - image->get_width() / 2.0f, - pos.y - parallax_image_size.height / 2.0f); + Vector p(pos.x + x * image->get_width() - image->get_width() / 2.0f, + pos.y - parallax_image_size.height / 2.0f); context.draw_surface(image, p, layer); } break; @@ -188,8 +188,8 @@ Background::draw_image(DrawingContext& context, const Vector& pos) case BOTTOM_ALIGNMENT: for(int x = start_x; x < end_x; ++x) { - Vector p(pos.x + x * image->get_width() - image->get_width() / 2.0f, - pos.y - image->get_height() + parallax_image_size.height / 2.0f); + Vector p(pos.x + x * image->get_width() - image->get_width() / 2.0f, + pos.y - image->get_height() + parallax_image_size.height / 2.0f); context.draw_surface(image, p, layer); } break; @@ -198,7 +198,7 @@ Background::draw_image(DrawingContext& context, const Vector& pos) for(int y = start_y; y < end_y; ++y) for(int x = start_x; x < end_x; ++x) { - Vector p(pos.x + x * image->get_width() - image->get_width()/2, + Vector p(pos.x + x * image->get_width() - image->get_width()/2, pos.y + y * image->get_height() - image->get_height()/2); if (image_top.get() != NULL && (y < 0)) @@ -228,7 +228,7 @@ Background::draw(DrawingContext& context) Sector::current()->get_height()); Sizef screen(SCREEN_WIDTH, SCREEN_HEIGHT); Sizef translation_range = level_size - screen; - Vector center_offset(context.get_translation().x - translation_range.width / 2.0f, + Vector center_offset(context.get_translation().x - translation_range.width / 2.0f, context.get_translation().y - translation_range.height / 2.0f); // FIXME: We are not handling 'pos' diff --git a/src/object/background.hpp b/src/object/background.hpp index 4c55d7c0b..632b8f381 100644 --- a/src/object/background.hpp +++ b/src/object/background.hpp @@ -43,7 +43,7 @@ public: void draw_image(DrawingContext& context, const Vector& pos); private: - enum Alignment { + enum Alignment { NO_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, diff --git a/src/object/bicycle_platform.cpp b/src/object/bicycle_platform.cpp index f38f6d194..76388e21f 100644 --- a/src/object/bicycle_platform.cpp +++ b/src/object/bicycle_platform.cpp @@ -24,13 +24,13 @@ #include "supertux/sector.hpp" BicyclePlatform::BicyclePlatform(const Reader& reader) : - MovingSprite(reader, LAYER_OBJECTS, COLGROUP_STATIC), + MovingSprite(reader, LAYER_OBJECTS, COLGROUP_STATIC), master(0), - slave(0), + slave(0), center(), - radius(128), - angle(0), - angular_speed(0), + radius(128), + angle(0), + angular_speed(0), contacts(), momentum(0) { @@ -38,13 +38,13 @@ BicyclePlatform::BicyclePlatform(const Reader& reader) : } BicyclePlatform::BicyclePlatform(BicyclePlatform* master) : - MovingSprite(*master), - master(master), - slave(this), - center(master->center), - radius(master->radius), - angle(master->angle + M_PI), - angular_speed(0), + MovingSprite(*master), + master(master), + slave(this), + center(master->center), + radius(master->radius), + angle(master->angle + M_PI), + angular_speed(0), contacts(), momentum(0) { @@ -53,7 +53,7 @@ BicyclePlatform::BicyclePlatform(BicyclePlatform* master) : master->slave = this; } -BicyclePlatform::~BicyclePlatform() +BicyclePlatform::~BicyclePlatform() { if ((this == master) && (master)) { slave->master = 0; @@ -100,8 +100,8 @@ BicyclePlatform::update(float elapsed_time) } if (this == slave) { angle = master->angle + M_PI; - while (angle < 0) { angle += 2*M_PI; } - while (angle > 2*M_PI) { angle -= 2*M_PI; } + while (angle < 0) { angle += 2*M_PI; } + while (angle > 2*M_PI) { angle -= 2*M_PI; } Vector dest = center + Vector(cosf(angle), sinf(angle)) * radius - (bbox.get_size() * 0.5); movement = dest - get_pos(); } @@ -115,8 +115,8 @@ BicyclePlatform::update(float elapsed_time) angular_speed += (angular_momentum * elapsed_time) * M_PI; angular_speed *= 1 - elapsed_time * 0.2; angle += angular_speed * elapsed_time; - while (angle < 0) { angle += 2*M_PI; } - while (angle > 2*M_PI) { angle -= 2*M_PI; } + while (angle < 0) { angle += 2*M_PI; } + while (angle > 2*M_PI) { angle -= 2*M_PI; } angular_speed = std::min(std::max(angular_speed, static_cast(-128*M_PI*elapsed_time)), static_cast(128*M_PI*elapsed_time)); Vector dest = center + Vector(cosf(angle), sinf(angle)) * radius - (bbox.get_size() * 0.5); movement = dest - get_pos(); diff --git a/src/object/block.cpp b/src/object/block.cpp index c18fef3d8..1f05d7918 100644 --- a/src/object/block.cpp +++ b/src/object/block.cpp @@ -31,11 +31,11 @@ static const float EPSILON = .0001f; static const float BUMP_ROTATION_ANGLE = 10; Block::Block(SpritePtr newsprite) : - sprite(newsprite), - bouncing(false), - breaking(false), - bounce_dir(0), - bounce_offset(0), + sprite(newsprite), + bouncing(false), + breaking(false), + bounce_dir(0), + bounce_offset(0), original_y(-1) { bbox.set_size(32, 32.1f); @@ -79,7 +79,7 @@ Block::collision(GameObject& other, const CollisionHit& ) if(coin) { coin->collect(); } - + //Eggs get jumped GrowUp* growup = dynamic_cast (&other); if(growup) { diff --git a/src/object/bouncy_coin.cpp b/src/object/bouncy_coin.cpp index d89b56822..12b3148e9 100644 --- a/src/object/bouncy_coin.cpp +++ b/src/object/bouncy_coin.cpp @@ -26,7 +26,7 @@ static const float LIFE_TIME = .5f; BouncyCoin::BouncyCoin(const Vector& pos, bool emerge) : sprite(), - position(pos), + position(pos), timer(), emerge_distance(0) { diff --git a/src/object/broken_brick.cpp b/src/object/broken_brick.cpp index 4f88d6a08..3de3031c1 100644 --- a/src/object/broken_brick.cpp +++ b/src/object/broken_brick.cpp @@ -22,8 +22,8 @@ BrokenBrick::BrokenBrick(SpritePtr sprite, const Vector& pos, const Vector& nmovement) : timer(), - sprite(sprite), - position(pos), + sprite(sprite), + position(pos), movement(nmovement) { timer.start(.2f); diff --git a/src/object/bullet.cpp b/src/object/bullet.cpp index 659267c55..f1a3d8a5b 100644 --- a/src/object/bullet.cpp +++ b/src/object/bullet.cpp @@ -29,7 +29,7 @@ const float BULLET_STARTING_YM = 0; Bullet::Bullet(const Vector& pos, float xm, int dir, BonusType type) : physic(), - life_count(3), + life_count(3), sprite(), light(0.0f,0.0f,0.0f), lightsprite(sprite_manager->create("images/objects/lightmap_light/lightmap_light-small.sprite")), diff --git a/src/object/camera.cpp b/src/object/camera.cpp index b7e94328c..0f7539636 100644 --- a/src/object/camera.cpp +++ b/src/object/camera.cpp @@ -114,7 +114,7 @@ public: Camera::Camera(Sector* newsector, std::string name) : mode(NORMAL), translation(), - sector(newsector), + sector(newsector), lookahead_mode(LOOKAHEAD_NONE), changetime(), lookahead_pos(), diff --git a/src/object/camera.hpp b/src/object/camera.hpp index 3c53f8440..53aecb73e 100644 --- a/src/object/camera.hpp +++ b/src/object/camera.hpp @@ -30,7 +30,7 @@ class Path; class PathWalker; class CameraConfig; -class Camera : public GameObject, +class Camera : public GameObject, public ScriptInterface { public: @@ -39,7 +39,7 @@ public: /// parse camera mode from lisp file void parse(const Reader& reader); - + /// reset camera position void reset(const Vector& tuxpos); diff --git a/src/object/candle.cpp b/src/object/candle.cpp index 10c549d3b..a9abc9d42 100644 --- a/src/object/candle.cpp +++ b/src/object/candle.cpp @@ -24,8 +24,8 @@ #include "util/reader.hpp" Candle::Candle(const Reader& lisp) - : MovingSprite(lisp, "images/objects/candle/candle.sprite", LAYER_BACKGROUNDTILES+1, COLGROUP_DISABLED), - burning(true), + : MovingSprite(lisp, "images/objects/candle/candle.sprite", LAYER_BACKGROUNDTILES+1, COLGROUP_DISABLED), + burning(true), flicker(true), lightcolor(1.0f, 1.0f, 1.0f), candle_light_1(sprite_manager->create("images/objects/candle/candle-light-1.sprite")), @@ -48,7 +48,7 @@ Candle::Candle(const Reader& lisp) candle_light_1->set_action("white"); candle_light_2->set_action("white"); } - + if (burning) { sprite->set_action("on"); } else { diff --git a/src/object/candle.hpp b/src/object/candle.hpp index 4ea74bab9..5c5342e05 100644 --- a/src/object/candle.hpp +++ b/src/object/candle.hpp @@ -23,7 +23,7 @@ /** * A burning candle: Simple, scriptable level decoration. */ -class Candle : public MovingSprite, +class Candle : public MovingSprite, public ScriptInterface { public: diff --git a/src/object/cloud_particle_system.hpp b/src/object/cloud_particle_system.hpp index 225d24636..f4c45fa0e 100644 --- a/src/object/cloud_particle_system.hpp +++ b/src/object/cloud_particle_system.hpp @@ -29,7 +29,7 @@ public: virtual ~CloudParticleSystem(); void parse(const Reader& lisp); - + virtual void update(float elapsed_time); std::string type() const diff --git a/src/object/coin_explode.cpp b/src/object/coin_explode.cpp index dad8962fa..a900def1c 100644 --- a/src/object/coin_explode.cpp +++ b/src/object/coin_explode.cpp @@ -21,7 +21,7 @@ #include "supertux/sector.hpp" CoinExplode::CoinExplode(const Vector& pos) : - position(pos) + position(pos) { } diff --git a/src/object/coin_rain.cpp b/src/object/coin_rain.cpp index 41f4529df..05426e62f 100644 --- a/src/object/coin_rain.cpp +++ b/src/object/coin_rain.cpp @@ -26,7 +26,7 @@ static const float DROP_TIME = .1f; // time duration between "drops" of coin rai CoinRain::CoinRain(const Vector& pos, bool emerge) : sprite(), - position(pos), + position(pos), emerge_distance(0), timer(), counter(0), diff --git a/src/object/display_effect.cpp b/src/object/display_effect.cpp index b32e83976..89ac199df 100644 --- a/src/object/display_effect.cpp +++ b/src/object/display_effect.cpp @@ -23,13 +23,13 @@ static const float BORDER_SIZE = 75; DisplayEffect::DisplayEffect(std::string name) : - screen_fade(NO_FADE), - screen_fadetime(0), + screen_fade(NO_FADE), + screen_fadetime(0), screen_fading(0), - border_fade(NO_FADE), - border_fadetime(0), + border_fade(NO_FADE), + border_fadetime(0), border_fading(), - border_size(0), + border_size(0), black(false), borders(false) { diff --git a/src/object/display_effect.hpp b/src/object/display_effect.hpp index 00f471011..f2f877439 100644 --- a/src/object/display_effect.hpp +++ b/src/object/display_effect.hpp @@ -21,7 +21,7 @@ #include "supertux/game_object.hpp" #include "supertux/script_interface.hpp" -class DisplayEffect : public GameObject, +class DisplayEffect : public GameObject, public scripting::DisplayEffect, public ScriptInterface { diff --git a/src/object/endsequence.cpp b/src/object/endsequence.cpp index 1531b674b..183d2479e 100644 --- a/src/object/endsequence.cpp +++ b/src/object/endsequence.cpp @@ -20,11 +20,11 @@ #include "supertux/sector.hpp" EndSequence::EndSequence() : - isrunning(false), - isdone(false), + isrunning(false), + isdone(false), tux_may_walk(true), end_sequence_controller(0) -{ +{ } EndSequence::~EndSequence() diff --git a/src/object/explosion.cpp b/src/object/explosion.cpp index b7428c012..12d164eb5 100644 --- a/src/object/explosion.cpp +++ b/src/object/explosion.cpp @@ -68,7 +68,7 @@ Explosion::explode() set_action(hurt ? "default" : "pop", 1); sprite->set_animation_loops(1); //TODO: this is necessary because set_action will not set "loops" when "action" is the default action sprite->set_angle(graphicsRandom.randf(0, 360)); // a random rotation on the sprite to make explosions appear more random - sound_manager->play(hurt ? "sounds/explosion.wav" : "sounds/firecracker.ogg", get_pos()); + sound_manager->play(hurt ? "sounds/explosion.wav" : "sounds/firecracker.ogg", get_pos()); #if 0 // spawn some particles @@ -121,7 +121,7 @@ Explosion::explode() } /* if (push) */ } -void +void Explosion::update(float ) { switch(state) { diff --git a/src/object/firefly.cpp b/src/object/firefly.cpp index 81bb8f785..44e60c5da 100644 --- a/src/object/firefly.cpp +++ b/src/object/firefly.cpp @@ -28,7 +28,7 @@ #include "util/reader.hpp" Firefly::Firefly(const Reader& lisp) : - MovingSprite(lisp, "images/objects/resetpoints/default-resetpoint.sprite", LAYER_TILES, COLGROUP_TOUCHABLE), + MovingSprite(lisp, "images/objects/resetpoints/default-resetpoint.sprite", LAYER_TILES, COLGROUP_TOUCHABLE), activated(false), initial_position() { diff --git a/src/object/floating_image.cpp b/src/object/floating_image.cpp index 856bafc5a..0c1956641 100644 --- a/src/object/floating_image.cpp +++ b/src/object/floating_image.cpp @@ -21,11 +21,11 @@ FloatingImage::FloatingImage(const std::string& spritefile) : sprite(sprite_manager->create(spritefile)), - layer(LAYER_FOREGROUND1 + 1), - visible(false), - anchor(ANCHOR_MIDDLE), + layer(LAYER_FOREGROUND1 + 1), + visible(false), + anchor(ANCHOR_MIDDLE), pos(), - fading(0), + fading(0), fadetime(0) { } diff --git a/src/object/floating_text.cpp b/src/object/floating_text.cpp index 34a1f0826..c9f83b3ff 100644 --- a/src/object/floating_text.cpp +++ b/src/object/floating_text.cpp @@ -22,7 +22,7 @@ #include "video/drawing_context.hpp" FloatingText::FloatingText(const Vector& pos, const std::string& text_) : - position(pos), + position(pos), text(text_), timer() { diff --git a/src/object/flower.cpp b/src/object/flower.cpp index f3bcdca5c..3f18845ac 100644 --- a/src/object/flower.cpp +++ b/src/object/flower.cpp @@ -29,7 +29,7 @@ Flower::Flower(BonusType _type) : { bbox.set_size(32, 32); lightsprite->set_blend(Blend(GL_SRC_ALPHA, GL_ONE)); - + if(type == FIRE_BONUS) { sprite = sprite_manager->create("images/powerups/fireflower/fireflower.sprite"); sound_manager->preload("sounds/fire-flower.wav"); diff --git a/src/object/flower.hpp b/src/object/flower.hpp index 2bba798a6..8ee947c45 100644 --- a/src/object/flower.hpp +++ b/src/object/flower.hpp @@ -41,7 +41,7 @@ private: Flower& operator=(const Flower&); Color light; SpritePtr lightsprite; - + friend class FlipLevelTransformer; }; diff --git a/src/object/ghost_particle_system.hpp b/src/object/ghost_particle_system.hpp index 26caabdda..1b66f3785 100644 --- a/src/object/ghost_particle_system.hpp +++ b/src/object/ghost_particle_system.hpp @@ -29,7 +29,7 @@ public: virtual ~GhostParticleSystem(); void parse(const Reader& lisp); - + virtual void update(float elapsed_time); std::string type() const diff --git a/src/object/icecrusher.cpp b/src/object/icecrusher.cpp index 3956eaec9..a83efced7 100644 --- a/src/object/icecrusher.cpp +++ b/src/object/icecrusher.cpp @@ -41,7 +41,7 @@ const float PAUSE_TIME_LARGE = 1.0; IceCrusher::IceCrusher(const Reader& reader) : MovingSprite(reader, "images/creatures/icecrusher/icecrusher.sprite", LAYER_OBJECTS, COLGROUP_STATIC), - state(IDLE), + state(IDLE), start_position(), physic(), cooldown_timer(0.0), @@ -56,7 +56,7 @@ IceCrusher::IceCrusher(const Reader& reader) : start_position = get_bbox().p1; set_state(state, true); - + float sprite_width = sprite->get_width (); if (sprite_width >= 128.0) ic_size = LARGE; @@ -71,15 +71,15 @@ IceCrusher::IceCrusher(const Reader& reader) : /* 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); } */ -void -IceCrusher::set_state(IceCrusherState state, bool force) +void +IceCrusher::set_state(IceCrusherState state, bool force) { if ((this->state == state) && (!force)) return; switch(state) { @@ -131,8 +131,8 @@ IceCrusher::collision(GameObject& other, const CollisionHit& hit) } return FORCE_MOVE; } - -void + +void IceCrusher::collision_solid(const CollisionHit& hit) { switch(state) { diff --git a/src/object/infoblock.cpp b/src/object/infoblock.cpp index f1e6e04e2..4269829b8 100644 --- a/src/object/infoblock.cpp +++ b/src/object/infoblock.cpp @@ -33,9 +33,9 @@ const float HEIGHT = 200; } InfoBlock::InfoBlock(const Reader& lisp) : - Block(sprite_manager->create("images/objects/bonus_block/infoblock.sprite")), + Block(sprite_manager->create("images/objects/bonus_block/infoblock.sprite")), message(), - shown_pct(0), + shown_pct(0), dest_pct(0), lines(), lines_height() diff --git a/src/object/invisible_block.cpp b/src/object/invisible_block.cpp index 755435192..07884819a 100644 --- a/src/object/invisible_block.cpp +++ b/src/object/invisible_block.cpp @@ -22,7 +22,7 @@ #include "supertux/constants.hpp" InvisibleBlock::InvisibleBlock(const Vector& pos) : - Block(sprite_manager->create("images/objects/bonus_block/invisibleblock.sprite")), + Block(sprite_manager->create("images/objects/bonus_block/invisibleblock.sprite")), visible(false) { bbox.set_pos(pos); @@ -44,7 +44,7 @@ InvisibleBlock::collides(GameObject& other, const CollisionHit& ) // if we're not visible, only register a collision if this will make us visible Player* player = dynamic_cast (&other); - if ((player) + if ((player) && (player->get_movement().y <= 0) && (player->get_bbox().get_top() > get_bbox().get_bottom() - SHIFT_DELTA)) { return true; diff --git a/src/object/invisible_wall.cpp b/src/object/invisible_wall.cpp index 788ced31a..bb16a3baf 100644 --- a/src/object/invisible_wall.cpp +++ b/src/object/invisible_wall.cpp @@ -20,9 +20,9 @@ #include "util/reader.hpp" InvisibleWall::InvisibleWall(const Reader& lisp) : - MovingSprite(lisp, "images/objects/invisible/invisible.sprite", LAYER_TILES, COLGROUP_STATIC), + MovingSprite(lisp, "images/objects/invisible/invisible.sprite", LAYER_TILES, COLGROUP_STATIC), physic(), - width(32), + width(32), height(32) { lisp.get("width", width); diff --git a/src/object/ispy.cpp b/src/object/ispy.cpp index 2e760b371..fa9e73ec2 100644 --- a/src/object/ispy.cpp +++ b/src/object/ispy.cpp @@ -27,8 +27,8 @@ #include Ispy::Ispy(const Reader& reader) : - MovingSprite(reader, "images/objects/ispy/ispy.sprite", LAYER_TILES+5, COLGROUP_DISABLED), - state(ISPYSTATE_IDLE), + MovingSprite(reader, "images/objects/ispy/ispy.sprite", LAYER_TILES+5, COLGROUP_DISABLED), + state(ISPYSTATE_IDLE), script(), dir(AUTO) { @@ -67,20 +67,20 @@ Ispy::line_intersects_line(Vector line1_start, Vector line1_end, Vector line2_st float den2 = (d2-b2)*(a1-a2) + (a2-c2)*(b1-b2); // normalize to positive numerator - if (num < 0) { - num = -num; - den1 = -den1; - den2 = -den2; + if (num < 0) { + num = -num; + den1 = -den1; + den2 = -den2; } // numerator is zero -> Check for parallel or coinciding lines if (num == 0) { if ((b1-b2)*(c1-a2) != (a1-a2)*(d1-b2)) return false; - if (a1 == a2) { - std::swap(a1, b1); - std::swap(a2, b2); - std::swap(c1, d1); - std::swap(c2, d2); + if (a1 == a2) { + std::swap(a1, b1); + std::swap(a2, b2); + std::swap(c1, d1); + std::swap(c2, d2); } if (a1 > a2) std::swap(a1, a2); if (c1 > c2) std::swap(c1, c2); @@ -146,7 +146,7 @@ Ispy::free_line_of_sight(Vector line_start, Vector line_end, const MovingObject* return true; } -void +void Ispy::update(float ) { diff --git a/src/object/lantern.cpp b/src/object/lantern.cpp index fcdc675f6..bde417162 100644 --- a/src/object/lantern.cpp +++ b/src/object/lantern.cpp @@ -123,8 +123,8 @@ Lantern::ungrab(MovingObject& object, Direction dir) Rock::ungrab(object, dir); } - -bool + +bool Lantern::is_open() { return ((grabbed) && lightcolor.red == 0 && lightcolor.green == 0 && lightcolor.blue == 0); diff --git a/src/object/level_time.cpp b/src/object/level_time.cpp index 011cb4f9b..4cf041d0d 100644 --- a/src/object/level_time.cpp +++ b/src/object/level_time.cpp @@ -33,7 +33,7 @@ static const float TIME_WARNING = 20; LevelTime::LevelTime(const Reader& reader) : time_surface(), - running(true), + running(true), time_left(0) { reader.get("name", name); @@ -92,8 +92,8 @@ LevelTime::draw(DrawingContext& context) { float all_width = time_surface->get_width() + Resources::normal_font->get_text_width(time_text); context.draw_surface(time_surface, Vector((SCREEN_WIDTH - all_width)/2, BORDER_Y + 1), LAYER_FOREGROUND1); - context.draw_text(Resources::normal_font, time_text, - Vector((SCREEN_WIDTH - all_width)/2 + time_surface->get_width(), BORDER_Y), + context.draw_text(Resources::normal_font, time_text, + Vector((SCREEN_WIDTH - all_width)/2 + time_surface->get_width(), BORDER_Y), ALIGN_LEFT, LAYER_FOREGROUND1, LevelTime::text_color); } } diff --git a/src/object/level_time.hpp b/src/object/level_time.hpp index 3650c9c75..9e4d5aaf6 100644 --- a/src/object/level_time.hpp +++ b/src/object/level_time.hpp @@ -25,7 +25,7 @@ #include "video/color.hpp" #include "video/surface_ptr.hpp" -class LevelTime : public GameObject, +class LevelTime : public GameObject, public ScriptInterface { static Color text_color; diff --git a/src/object/light.cpp b/src/object/light.cpp index bd00ceff7..ca707ace2 100644 --- a/src/object/light.cpp +++ b/src/object/light.cpp @@ -18,8 +18,8 @@ #include "sprite/sprite.hpp" #include "sprite/sprite_manager.hpp" -Light::Light(const Vector& center, const Color& color) : - position(center), +Light::Light(const Vector& center, const Color& color) : + position(center), color(color), sprite() { diff --git a/src/object/moving_sprite.cpp b/src/object/moving_sprite.cpp index b98972f35..a512d9a0a 100644 --- a/src/object/moving_sprite.cpp +++ b/src/object/moving_sprite.cpp @@ -21,9 +21,9 @@ #include -MovingSprite::MovingSprite(const Vector& pos, const std::string& sprite_name, +MovingSprite::MovingSprite(const Vector& pos, const std::string& sprite_name, int layer, CollisionGroup collision_group) : - sprite_name(sprite_name), + sprite_name(sprite_name), sprite(), layer(layer) { @@ -34,7 +34,7 @@ MovingSprite::MovingSprite(const Vector& pos, const std::string& sprite_name, } MovingSprite::MovingSprite(const Reader& reader, const Vector& pos, int layer, CollisionGroup collision_group) : - sprite_name(), + sprite_name(), sprite(), layer(layer) { @@ -48,7 +48,7 @@ MovingSprite::MovingSprite(const Reader& reader, const Vector& pos, int layer, C } MovingSprite::MovingSprite(const Reader& reader, const std::string& sprite_name, int layer, CollisionGroup collision_group) : - sprite_name(sprite_name), + sprite_name(sprite_name), sprite(), layer(layer) { @@ -77,7 +77,7 @@ MovingSprite::MovingSprite(const Reader& reader, int layer, CollisionGroup colli } MovingSprite::MovingSprite(const MovingSprite& other) : - MovingObject(other), + MovingObject(other), sprite_name(), sprite(), layer(other.layer) diff --git a/src/object/moving_sprite.hpp b/src/object/moving_sprite.hpp index a75e2cad0..1bace0be4 100644 --- a/src/object/moving_sprite.hpp +++ b/src/object/moving_sprite.hpp @@ -29,20 +29,20 @@ class MovingSprite : public MovingObject { public: - MovingSprite(const Vector& pos, - const std::string& sprite_name, - int layer = LAYER_OBJECTS, + MovingSprite(const Vector& pos, + const std::string& sprite_name, + int layer = LAYER_OBJECTS, CollisionGroup collision_group = COLGROUP_MOVING); - MovingSprite(const Reader& reader, - const Vector& pos, - int layer = LAYER_OBJECTS, + MovingSprite(const Reader& reader, + const Vector& pos, + int layer = LAYER_OBJECTS, CollisionGroup collision_group = COLGROUP_MOVING); - MovingSprite(const Reader& reader, - const std::string& sprite_name, - int layer = LAYER_OBJECTS, + MovingSprite(const Reader& reader, + const std::string& sprite_name, + int layer = LAYER_OBJECTS, CollisionGroup collision_group = COLGROUP_MOVING); - MovingSprite(const Reader& reader, - int layer = LAYER_OBJECTS, + MovingSprite(const Reader& reader, + int layer = LAYER_OBJECTS, CollisionGroup collision_group = COLGROUP_MOVING); MovingSprite(const MovingSprite& moving_sprite); //MovingSprite& operator=(const MovingSprite& moving_sprite); diff --git a/src/object/particles.cpp b/src/object/particles.cpp index d4b1c11d7..424c4f2fa 100644 --- a/src/object/particles.cpp +++ b/src/object/particles.cpp @@ -27,11 +27,11 @@ Particles::Particles(const Vector& epicenter, int min_angle, int max_angle, const Vector& initial_velocity, const Vector& acceleration, int number, Color color_, int size_, float life_time, int drawing_layer_) : - accel(acceleration), + accel(acceleration), timer(), live_forever(), - color(color_), - size(size_), + color(color_), + size(size_), drawing_layer(drawing_layer_), particles() { diff --git a/src/object/particles.hpp b/src/object/particles.hpp index 858266508..c98aa57cd 100644 --- a/src/object/particles.hpp +++ b/src/object/particles.hpp @@ -38,8 +38,8 @@ private: struct Particle { Vector pos, vel; - Particle() : - pos(), + Particle() : + pos(), vel() {} // float angle; diff --git a/src/object/particlesystem.hpp b/src/object/particlesystem.hpp index 78e3616f4..d02a63be2 100644 --- a/src/object/particlesystem.hpp +++ b/src/object/particlesystem.hpp @@ -58,7 +58,7 @@ protected: angle(), texture() {} - + virtual ~Particle() {} diff --git a/src/object/particlesystem_interactive.hpp b/src/object/particlesystem_interactive.hpp index e703c27ac..b38a7ce1b 100644 --- a/src/object/particlesystem_interactive.hpp +++ b/src/object/particlesystem_interactive.hpp @@ -47,8 +47,8 @@ protected: class Particle { public: - Particle() : - pos(), + Particle() : + pos(), texture() {} diff --git a/src/object/path_walker.cpp b/src/object/path_walker.cpp index 840e92438..3df9ed03a 100644 --- a/src/object/path_walker.cpp +++ b/src/object/path_walker.cpp @@ -20,11 +20,11 @@ #include PathWalker::PathWalker(const Path* path, bool running) : - path(path), - running(running), - current_node_nr(0), - next_node_nr(0), - stop_at_node_nr(running?-1:0), + path(path), + running(running), + current_node_nr(0), + next_node_nr(0), + stop_at_node_nr(running?-1:0), node_time(0), node_mult(), walking_speed(1.0) diff --git a/src/object/path_walker.hpp b/src/object/path_walker.hpp index d85b97cbf..2574b07b0 100644 --- a/src/object/path_walker.hpp +++ b/src/object/path_walker.hpp @@ -51,7 +51,7 @@ public: bool is_moving() { return running; } - + const Path* path; private: diff --git a/src/object/platform.cpp b/src/object/platform.cpp index 7c38238b1..258a5864e 100644 --- a/src/object/platform.cpp +++ b/src/object/platform.cpp @@ -24,12 +24,12 @@ #include "util/reader.hpp" Platform::Platform(const Reader& reader) : - MovingSprite(reader, Vector(0,0), LAYER_OBJECTS, COLGROUP_STATIC), + MovingSprite(reader, Vector(0,0), LAYER_OBJECTS, COLGROUP_STATIC), path(), walker(), - speed(Vector(0,0)), - automatic(false), - player_contact(false), + speed(Vector(0,0)), + automatic(false), + player_contact(false), last_player_contact(false) { bool running = true; @@ -47,11 +47,11 @@ Platform::Platform(const Reader& reader) : /* Platform::Platform(const Platform& other) : - MovingSprite(other), - ScriptInterface(other), - speed(other.speed), - automatic(other.automatic), - player_contact(false), + MovingSprite(other), + ScriptInterface(other), + speed(other.speed), + automatic(other.automatic), + player_contact(false), last_player_contact(false) { name = other.name; @@ -79,7 +79,7 @@ Platform::update(float elapsed_time) // Travel to node nearest to nearest player // FIXME: does not really use nearest player - Player* player = 0; + Player* player = 0; std::vector players = Sector::current()->get_players(); for (std::vector::iterator playerIter = players.begin(); playerIter != players.end(); ++playerIter) { player = *playerIter; @@ -90,7 +90,7 @@ Platform::update(float elapsed_time) goto_node(nearest_node_id); } } - } + } if (player_contact && !last_player_contact && !walker->is_moving()) { // Player touched platform, didn't touch last frame and Platform is not moving @@ -99,7 +99,7 @@ Platform::update(float elapsed_time) int farthest_node_id = path->get_farthest_node_no(get_pos()); if (farthest_node_id != -1) { goto_node(farthest_node_id); - } + } } // Clear player_contact flag set by collision() method diff --git a/src/object/platform.hpp b/src/object/platform.hpp index f9ba370b5..fa95ef864 100644 --- a/src/object/platform.hpp +++ b/src/object/platform.hpp @@ -24,7 +24,7 @@ /** * This class is the base class for platforms that tux can stand on */ -class Platform : public MovingSprite, +class Platform : public MovingSprite, public ScriptInterface { public: diff --git a/src/object/player.cpp b/src/object/player.cpp index 02aed87f4..5d7e640d5 100644 --- a/src/object/player.cpp +++ b/src/object/player.cpp @@ -63,7 +63,7 @@ static const std::string IDLE_STAGES[] = /** acceleration in horizontal direction when walking * (all accelerations are in pixel/s^2) */ static const float WALK_ACCELERATION_X = 300; -/** acceleration in horizontal direction when running */ +/** acceleration in horizontal direction when running */ static const float RUN_ACCELERATION_X = 400; /** acceleration when skidding */ static const float SKID_XM = 200; @@ -113,7 +113,7 @@ Player::Player(PlayerStatus* _player_status, const std::string& name) : deactivated(), controller(), scripting_controller(), - player_status(_player_status), + player_status(_player_status), duck(), dead(), dying(), @@ -135,7 +135,7 @@ Player::Player(PlayerStatus* _player_status, const std::string& name) : on_ground_flag(), jumping(), can_jump(), - jump_button_timer(), + jump_button_timer(), wants_buttjump(), does_buttjump(), invincible_timer(), @@ -148,12 +148,12 @@ Player::Player(PlayerStatus* _player_status, const std::string& name) : backflip_timer(), physic(), visible(), - grabbed_object(NULL), + grabbed_object(NULL), sprite(), airarrow(), floor_normal(), - ghost_mode(false), - edit_mode(false), + ghost_mode(false), + edit_mode(false), unduck_hurt_timer(), idle_timer(), idle_stage(0), @@ -274,7 +274,7 @@ Player::set_winning() } } -void +void Player::use_scripting_controller(bool use_or_release) { if ((use_or_release == true) && (controller != scripting_controller.get())) { @@ -287,7 +287,7 @@ Player::use_scripting_controller(bool use_or_release) } } -void +void Player::do_scripting_controller(std::string control, bool pressed) { for(int i = 0; Controller::controlNames[i] != 0; ++i) { @@ -430,7 +430,7 @@ Player::update(float elapsed_time) Vector ppos = Vector(px, py); Vector pspeed = Vector(0, 0); Vector paccel = Vector(0, 0); - Sector::current()->add_object(new SpriteParticle("images/objects/particles/sparkle.sprite", + Sector::current()->add_object(new SpriteParticle("images/objects/particles/sparkle.sprite", // draw bright sparkle when there is lots of time left, dark sparkle when invincibility is about to end (invincible_timer.get_timeleft() > TUX_INVINCIBLE_TIME_WARNING) ? // make every other a longer sparkle to make trail a bit fuzzy @@ -668,7 +668,7 @@ Player::do_jump(float yspeed) { } void -Player::early_jump_apex() +Player::early_jump_apex() { if (!jump_early_apex) { @@ -696,13 +696,13 @@ Player::handle_vertical_input() jump_button_timer.stop(); if (duck) { // when running, only jump a little bit; else do a backflip - if ((physic.get_velocity_x() != 0) || - (controller->hold(Controller::LEFT)) || - (controller->hold(Controller::RIGHT))) + if ((physic.get_velocity_x() != 0) || + (controller->hold(Controller::LEFT)) || + (controller->hold(Controller::RIGHT))) { do_jump(-300); } - else + else { do_backflip(); } @@ -1206,7 +1206,7 @@ Player::collision_solid(const CollisionHit& hit) on_ground_flag = true; floor_normal = hit.slope_normal; - // Butt Jump landed + // Butt Jump landed if (does_buttjump) { does_buttjump = false; physic.set_velocity_y(-300); @@ -1427,7 +1427,7 @@ Player::add_velocity(const Vector& velocity, const Vector& end_speed) physic.set_velocity_y(std::max(physic.get_velocity_y() + velocity.y, end_speed.y)); } -Vector +Vector Player::get_velocity() { return physic.get_velocity(); @@ -1502,7 +1502,7 @@ Player::set_edit_mode(bool enable) edit_mode = enable; } -void +void Player::start_climbing(Climbable& climbable) { if (climbing || !&climbable) return; @@ -1518,14 +1518,14 @@ Player::start_climbing(Climbable& climbable) } } -void +void Player::stop_climbing(Climbable& /*climbable*/) { if (!climbing) return; climbing = 0; - if (grabbed_object) { + if (grabbed_object) { grabbed_object->ungrab(*this, dir); grabbed_object = NULL; } @@ -1569,7 +1569,7 @@ Player::handle_input_climbing() if (can_jump) { stop_climbing(*climbing); return; - } + } } else { can_jump = true; } diff --git a/src/object/player.hpp b/src/object/player.hpp index e2a514b2e..3dda1fd75 100644 --- a/src/object/player.hpp +++ b/src/object/player.hpp @@ -45,8 +45,8 @@ static const float TUX_BACKFLIP_TIME = 2.1f; // minimum air time that backflip r class Camera; class PlayerStatus; -class Player : public MovingObject, - public scripting::Player, +class Player : public MovingObject, + public scripting::Player, public ScriptInterface { public: @@ -169,7 +169,7 @@ public: * Adds velocity to the player until given end speed is reached */ void add_velocity(const Vector& velocity, const Vector& end_speed); - + /** * Returns the current velocity of the player */ @@ -222,7 +222,7 @@ public: * Orders the current GameSession to start a sequence */ void trigger_sequence(std::string sequence_name); - + /** * Requests that the player start climbing the given Climbable */ diff --git a/src/object/pneumatic_platform.cpp b/src/object/pneumatic_platform.cpp index 99fd2c6f3..cba90384e 100644 --- a/src/object/pneumatic_platform.cpp +++ b/src/object/pneumatic_platform.cpp @@ -22,11 +22,11 @@ #include "supertux/sector.hpp" PneumaticPlatform::PneumaticPlatform(const Reader& reader) : - MovingSprite(reader, LAYER_OBJECTS, COLGROUP_STATIC), - master(0), - slave(0), + MovingSprite(reader, LAYER_OBJECTS, COLGROUP_STATIC), + master(0), + slave(0), start_y(0), - offset_y(0), + offset_y(0), speed_y(0), contacts() { @@ -34,11 +34,11 @@ PneumaticPlatform::PneumaticPlatform(const Reader& reader) : } PneumaticPlatform::PneumaticPlatform(PneumaticPlatform* master) : - MovingSprite(*master), - master(master), - slave(this), + MovingSprite(*master), + master(master), + slave(this), start_y(master->start_y), - offset_y(-master->offset_y), + offset_y(-master->offset_y), speed_y(0), contacts() { @@ -47,7 +47,7 @@ PneumaticPlatform::PneumaticPlatform(PneumaticPlatform* master) : master->slave = this; } -PneumaticPlatform::~PneumaticPlatform() +PneumaticPlatform::~PneumaticPlatform() { if ((this == master) && (master)) { slave->master = 0; @@ -105,8 +105,8 @@ PneumaticPlatform::update(float elapsed_time) speed_y -= (offset_y * elapsed_time * 0.5f); speed_y *= 1 - elapsed_time; offset_y += speed_y * elapsed_time; - if (offset_y < -256) { offset_y = -256; speed_y = 0; } - if (offset_y > 256) { offset_y = 256; speed_y = -0; } + if (offset_y < -256) { offset_y = -256; speed_y = 0; } + if (offset_y > 256) { offset_y = 256; speed_y = -0; } movement = Vector(0, (start_y + offset_y) - get_pos().y); } } diff --git a/src/object/portable.hpp b/src/object/portable.hpp index 87b6af30e..93f8dbc53 100644 --- a/src/object/portable.hpp +++ b/src/object/portable.hpp @@ -45,7 +45,7 @@ public: { return true; } - + /** * Is the object so heavy/bulky/fragile that Tux can't run while * carrying it? diff --git a/src/object/pulsing_light.cpp b/src/object/pulsing_light.cpp index 2fff27cf3..0133a5ce1 100644 --- a/src/object/pulsing_light.cpp +++ b/src/object/pulsing_light.cpp @@ -22,8 +22,8 @@ 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), + max_alpha(max_alpha), + cycle_len(cycle_len), t(0) { assert(cycle_len > 0); diff --git a/src/object/pushbutton.cpp b/src/object/pushbutton.cpp index 454966cb8..19cc9f9aa 100644 --- a/src/object/pushbutton.cpp +++ b/src/object/pushbutton.cpp @@ -31,7 +31,7 @@ const std::string BUTTON_SOUND = "sounds/switch.ogg"; } PushButton::PushButton(const Reader& lisp) : - MovingSprite(lisp, "images/objects/pushbutton/pushbutton.sprite", LAYER_BACKGROUNDTILES+1, COLGROUP_MOVING), + MovingSprite(lisp, "images/objects/pushbutton/pushbutton.sprite", LAYER_BACKGROUNDTILES+1, COLGROUP_MOVING), script(), state(OFF) { diff --git a/src/object/rain_particle_system.hpp b/src/object/rain_particle_system.hpp index 296740e34..09f28a0e4 100644 --- a/src/object/rain_particle_system.hpp +++ b/src/object/rain_particle_system.hpp @@ -41,7 +41,7 @@ private: public: float speed; - RainParticle() : + RainParticle() : speed() {} }; diff --git a/src/object/rock.hpp b/src/object/rock.hpp index 63db76767..f1b0f0c26 100644 --- a/src/object/rock.hpp +++ b/src/object/rock.hpp @@ -23,7 +23,7 @@ class Sprite; -class Rock : public MovingSprite, +class Rock : public MovingSprite, public Portable { public: diff --git a/src/object/scripted_object.cpp b/src/object/scripted_object.cpp index 68d13188a..b76d150da 100644 --- a/src/object/scripted_object.cpp +++ b/src/object/scripted_object.cpp @@ -27,9 +27,9 @@ ScriptedObject::ScriptedObject(const Reader& lisp) : MovingSprite(lisp, LAYER_OBJECTS, COLGROUP_MOVING_STATIC), physic(), name(), - solid(true), - physic_enabled(true), - visible(true), + solid(true), + physic_enabled(true), + visible(true), new_vel_set(false), new_vel() { diff --git a/src/object/scripted_object.hpp b/src/object/scripted_object.hpp index 69b82a0ea..a2b66d500 100644 --- a/src/object/scripted_object.hpp +++ b/src/object/scripted_object.hpp @@ -22,8 +22,8 @@ #include "supertux/physic.hpp" #include "supertux/script_interface.hpp" -class ScriptedObject : public MovingSprite, - public scripting::ScriptedObject, +class ScriptedObject : public MovingSprite, + public scripting::ScriptedObject, public ScriptInterface { public: diff --git a/src/object/skull_tile.cpp b/src/object/skull_tile.cpp index 9aff79fc6..48d9ed220 100644 --- a/src/object/skull_tile.cpp +++ b/src/object/skull_tile.cpp @@ -25,10 +25,10 @@ static const float CRACKTIME = 0.3f; static const float FALLTIME = 0.8f; SkullTile::SkullTile(const Reader& lisp) : - MovingSprite(lisp, "images/objects/skull_tile/skull_tile.sprite", LAYER_TILES, COLGROUP_STATIC), + MovingSprite(lisp, "images/objects/skull_tile/skull_tile.sprite", LAYER_TILES, COLGROUP_STATIC), physic(), timer(), - hit(false), + hit(false), falling(false) { } diff --git a/src/object/text_object.cpp b/src/object/text_object.cpp index d5ee81ca3..7db2cac8a 100644 --- a/src/object/text_object.cpp +++ b/src/object/text_object.cpp @@ -24,9 +24,9 @@ TextObject::TextObject(std::string name) : font(), text(), - fading(0), - fadetime(0), - visible(false), + fading(0), + fadetime(0), + visible(false), centered(), anchor(ANCHOR_MIDDLE), pos(0, 0) diff --git a/src/object/text_object.hpp b/src/object/text_object.hpp index c8903e79a..4605eefa2 100644 --- a/src/object/text_object.hpp +++ b/src/object/text_object.hpp @@ -25,7 +25,7 @@ #include "video/font_ptr.hpp" /** A text object intended for scripts that want to tell a story */ -class TextObject : public GameObject, +class TextObject : public GameObject, public scripting::Text, public ScriptInterface { @@ -53,13 +53,13 @@ public: } void set_pos(const Vector& pos) { - this->pos = pos; - } + this->pos = pos; + } void set_pos(float x, float y) { set_pos(Vector(x, y)); } const Vector& get_pos() const { - return pos; + return pos; } float get_pos_x() { return pos.x; diff --git a/src/object/thunderstorm.cpp b/src/object/thunderstorm.cpp index 14830576d..793d6ab3f 100644 --- a/src/object/thunderstorm.cpp +++ b/src/object/thunderstorm.cpp @@ -32,7 +32,7 @@ const float ELECTRIFY_TIME = 0.5f; Thunderstorm::Thunderstorm(const Reader& reader) : running(true), - interval(10.0f), + interval(10.0f), layer(LAYER_BACKGROUNDTILES-1), time_to_thunder(), time_to_lightning(), diff --git a/src/object/thunderstorm.hpp b/src/object/thunderstorm.hpp index 24e0ba2cb..d0e481c16 100644 --- a/src/object/thunderstorm.hpp +++ b/src/object/thunderstorm.hpp @@ -27,7 +27,7 @@ /** * Thunderstorm scriptable GameObject; plays thunder, lightning and electrifies water at regular interval */ -class Thunderstorm : public GameObject, +class Thunderstorm : public GameObject, public ScriptInterface { public: diff --git a/src/object/tilemap.cpp b/src/object/tilemap.cpp index 3a4520ac4..ed3d4723f 100644 --- a/src/object/tilemap.cpp +++ b/src/object/tilemap.cpp @@ -26,19 +26,19 @@ #include "util/reader.hpp" TileMap::TileMap(const TileSet *new_tileset) : - tileset(new_tileset), + tileset(new_tileset), tiles(), real_solid(false), effective_solid(false), - speed_x(1), - speed_y(1), + speed_x(1), + speed_y(1), width(0), - height(0), - z_pos(0), + height(0), + z_pos(0), offset(Vector(0,0)), movement(0,0), drawing_effect(NO_EFFECT), - alpha(1.0), + alpha(1.0), current_alpha(1.0), remaining_fade_time(0), path(), @@ -52,16 +52,16 @@ TileMap::TileMap(const Reader& reader) : tiles(), real_solid(false), effective_solid(false), - speed_x(1), - speed_y(1), + speed_x(1), + speed_y(1), width(-1), - height(-1), - z_pos(0), + height(-1), + z_pos(0), offset(Vector(0,0)), - movement(Vector(0,0)), + movement(Vector(0,0)), drawing_effect(NO_EFFECT), - alpha(1.0), - current_alpha(1.0), + alpha(1.0), + current_alpha(1.0), remaining_fade_time(0), path(), walker(), @@ -76,7 +76,7 @@ TileMap::TileMap(const Reader& reader) : reader.get("speed-y", speed_y); z_pos = reader_get_layer (reader, /* default = */ 0); - + if(real_solid && ((speed_x != 1) || (speed_y != 1))) { log_warning << "Speed of solid tilemap is not 1. fixing" << std::endl; speed_x = 1; @@ -136,21 +136,21 @@ TileMap::TileMap(const Reader& reader) : TileMap::TileMap(const TileSet *new_tileset, std::string name, int z_pos, bool solid, size_t width, size_t height) : - tileset(new_tileset), + tileset(new_tileset), tiles(), real_solid(solid), effective_solid(solid), - speed_x(1), - speed_y(1), + speed_x(1), + speed_y(1), width(0), - height(0), - z_pos(z_pos), + height(0), + z_pos(z_pos), offset(Vector(0,0)), movement(Vector(0,0)), - drawing_effect(NO_EFFECT), - alpha(1.0), + drawing_effect(NO_EFFECT), + alpha(1.0), current_alpha(1.0), - remaining_fade_time(0), + remaining_fade_time(0), path(), walker(), draw_target(DrawingContext::NORMAL) @@ -422,7 +422,7 @@ TileMap::fade(float alpha, float seconds) this->remaining_fade_time = seconds; } -void +void TileMap::set_alpha(float alpha) { this->alpha = alpha; @@ -431,12 +431,12 @@ TileMap::set_alpha(float alpha) update_effective_solid (); } -float +float TileMap::get_alpha() { return this->current_alpha; } - + /* * Private methods */ diff --git a/src/object/tilemap.hpp b/src/object/tilemap.hpp index 428c5f42a..5732920e4 100644 --- a/src/object/tilemap.hpp +++ b/src/object/tilemap.hpp @@ -36,7 +36,7 @@ class TileSet; /** * This class is responsible for drawing the level tiles */ -class TileMap : public GameObject, +class TileMap : public GameObject, public ScriptInterface { public: diff --git a/src/object/trampoline.cpp b/src/object/trampoline.cpp index 199fe1615..9d4e12a13 100644 --- a/src/object/trampoline.cpp +++ b/src/object/trampoline.cpp @@ -49,7 +49,7 @@ Trampoline::Trampoline(const Reader& lisp) : } } -Trampoline::Trampoline(const Vector& pos, bool port) : +Trampoline::Trampoline(const Vector& pos, bool port) : Rock(pos, "images/objects/trampoline/trampoline.sprite"), portable(port) { diff --git a/src/object/unstable_tile.cpp b/src/object/unstable_tile.cpp index 91f6e49b6..50ba0c624 100644 --- a/src/object/unstable_tile.cpp +++ b/src/object/unstable_tile.cpp @@ -25,7 +25,7 @@ #include "supertux/object_factory.hpp" UnstableTile::UnstableTile(const Reader& lisp) : - MovingSprite(lisp, LAYER_TILES, COLGROUP_STATIC), + MovingSprite(lisp, LAYER_TILES, COLGROUP_STATIC), physic(), state(STATE_NORMAL), slowfall_timer() diff --git a/src/object/weak_block.cpp b/src/object/weak_block.cpp index 6b89cc182..3a3f07edf 100644 --- a/src/object/weak_block.cpp +++ b/src/object/weak_block.cpp @@ -123,7 +123,7 @@ WeakBlock::update(float ) } else lightsprite->set_color(Color(0.3f, 0.2f, 0.1f)); } - + if (sprite->animation_done()) { state = STATE_DISINTEGRATING; sprite->set_action("disintegrating", 1); @@ -162,7 +162,7 @@ WeakBlock::draw(DrawingContext& context) } } } - + void WeakBlock::startBurning() { diff --git a/src/object/wind.cpp b/src/object/wind.cpp index 6dc3e0496..b3af59f44 100644 --- a/src/object/wind.cpp +++ b/src/object/wind.cpp @@ -27,9 +27,9 @@ #include "video/drawing_context.hpp" Wind::Wind(const Reader& reader) : - blowing(true), + blowing(true), speed(), - acceleration(100), + acceleration(100), elapsed_time(0) { reader.get("name", name); diff --git a/src/object/wind.hpp b/src/object/wind.hpp index 89af18c2d..a08f3f4f3 100644 --- a/src/object/wind.hpp +++ b/src/object/wind.hpp @@ -26,7 +26,7 @@ class Player; /** * Defines an area that will gently push Players in one direction */ -class Wind : public MovingObject, +class Wind : public MovingObject, public ScriptInterface { public: diff --git a/src/scripting/player.hpp b/src/scripting/player.hpp index 3551f50b8..a8f63b769 100644 --- a/src/scripting/player.hpp +++ b/src/scripting/player.hpp @@ -131,7 +131,7 @@ public: virtual void use_scripting_controller(bool use_or_release) = 0; /** - * Instructs the scriptable controller to press or release a button + * Instructs the scriptable controller to press or release a button */ virtual void do_scripting_controller(std::string control, bool pressed) = 0; diff --git a/src/sprite/sprite.cpp b/src/sprite/sprite.cpp index bec57344c..11c819fca 100644 --- a/src/sprite/sprite.cpp +++ b/src/sprite/sprite.cpp @@ -38,7 +38,7 @@ Sprite::Sprite(SpriteData& newdata) : } Sprite::Sprite(const Sprite& other) : - data(other.data), + data(other.data), frame(other.frame), frameidx(other.frameidx), animation_loops(other.animation_loops), diff --git a/src/supertux/collision.hpp b/src/supertux/collision.hpp index 67b2f2031..835c22b74 100644 --- a/src/supertux/collision.hpp +++ b/src/supertux/collision.hpp @@ -42,8 +42,8 @@ public: speed_top(), speed_bottom() { - float infinity = (std::numeric_limits::has_infinity ? - std::numeric_limits::infinity() : + float infinity = (std::numeric_limits::has_infinity ? + std::numeric_limits::infinity() : std::numeric_limits::max()); position_left = -infinity; position_right = infinity; @@ -56,15 +56,15 @@ public: speed_bottom = infinity; } - bool has_constraints() const + bool has_constraints() const { float infinity = (std::numeric_limits::has_infinity ? - std::numeric_limits::infinity() : + std::numeric_limits::infinity() : std::numeric_limits::max()); return - position_left > -infinity || - position_right < infinity || - position_top > -infinity || + position_left > -infinity || + position_right < infinity || + position_top > -infinity || position_bottom < infinity; } diff --git a/src/supertux/console.cpp b/src/supertux/console.cpp index 6e663f5c0..b624e3fa3 100644 --- a/src/supertux/console.cpp +++ b/src/supertux/console.cpp @@ -30,20 +30,20 @@ static const float FADE_SPEED = 1; Console::Console() : history(), - history_position(history.end()), + history_position(history.end()), lines(), background(), background2(), - vm(NULL), + vm(NULL), vm_object(), backgroundOffset(0), height(0), - alpha(1.0), - offset(0), - focused(false), + alpha(1.0), + offset(0), + focused(false), font(), fontheight(), - stayOpen(0) + stayOpen(0) { fontheight = 8; } @@ -143,7 +143,7 @@ Console::execute_script(const std::string& command) } } -void +void Console::input(char c) { inputBuffer.insert(inputBufferPosition, 1, c); @@ -203,7 +203,7 @@ Console::show_history(int offset) } } -void +void Console::move_cursor(int offset) { if (offset == -65535) inputBufferPosition = 0; diff --git a/src/supertux/game_object.cpp b/src/supertux/game_object.cpp index 05347abcb..aef45f928 100644 --- a/src/supertux/game_object.cpp +++ b/src/supertux/game_object.cpp @@ -18,7 +18,7 @@ #include "supertux/object_remove_listener.hpp" GameObject::GameObject() : - wants_to_die(false), + wants_to_die(false), remove_listeners(NULL), name() { @@ -29,7 +29,7 @@ GameObject::GameObject(const GameObject& rhs) : wants_to_die(rhs.wants_to_die), remove_listeners(NULL), name(rhs.name) -{ +{ } GameObject::~GameObject() @@ -43,8 +43,8 @@ GameObject::~GameObject() entry = next; } } - -void + +void GameObject::add_remove_listener(ObjectRemoveListener* listener) { RemoveListenerListEntry* entry = new RemoveListenerListEntry(); diff --git a/src/supertux/game_object.hpp b/src/supertux/game_object.hpp index 29410049e..180630ee4 100644 --- a/src/supertux/game_object.hpp +++ b/src/supertux/game_object.hpp @@ -27,7 +27,7 @@ class ObjectRemoveListener; /** * Base class for all the things that make up Levels' Sectors. * - * Each sector of a level will hold a list of active GameObject while the + * Each sector of a level will hold a list of active GameObject while the * game is played. * * This class is responsible for: @@ -71,8 +71,8 @@ public: * gets removed/destroyed */ void add_remove_listener(ObjectRemoveListener* listener); - - /** + + /** * unregisters a remove listener, so it will no longer be called if the object * gets removed/destroyed */ diff --git a/src/supertux/game_session.cpp b/src/supertux/game_session.cpp index 0f19933c0..7a7ddb37f 100644 --- a/src/supertux/game_session.cpp +++ b/src/supertux/game_session.cpp @@ -54,19 +54,19 @@ GameSession::GameSession(const std::string& levelfile_, PlayerStatus* player_sta end_sequence(0), game_pause(false), speed_before_pause(g_screen_manager->get_speed()), - levelfile(levelfile_), + levelfile(levelfile_), reset_sector(), reset_pos(), newsector(), newspawnpoint(), best_level_statistics(statistics), player_status(player_status), - capture_demo_stream(0), + capture_demo_stream(0), capture_file(), - playback_demo_stream(0), + playback_demo_stream(0), demo_controller(0), - play_time(0), - edit_mode(false), + play_time(0), + edit_mode(false), levelintro_shown(false), coins_at_start(), bonus_at_start(), diff --git a/src/supertux/game_session.hpp b/src/supertux/game_session.hpp index f2f18f1f3..af2b77836 100644 --- a/src/supertux/game_session.hpp +++ b/src/supertux/game_session.hpp @@ -145,7 +145,7 @@ private: bool edit_mode; /**< true if GameSession runs in level editor mode */ bool levelintro_shown; /**< true if the LevelIntro screen was already shown */ - + int coins_at_start; /** How many coins does the player have at the start */ BonusType bonus_at_start; /** What bonuses does the player have at the start */ int max_fire_bullets_at_start; /** How many fire bullets does the player have */ diff --git a/src/supertux/gameconfig.cpp b/src/supertux/gameconfig.cpp index d874f6a19..2ddadb8d3 100644 --- a/src/supertux/gameconfig.cpp +++ b/src/supertux/gameconfig.cpp @@ -84,7 +84,7 @@ Config::load() config_video_lisp->get("aspect_width", aspect_size.width); config_video_lisp->get("aspect_height", aspect_size.height); - + config_video_lisp->get("magnification", magnification); } @@ -131,7 +131,7 @@ Config::save() writer.write("aspect_width", aspect_size.width); writer.write("aspect_height", aspect_size.height); - + writer.write("magnification", magnification); writer.end_list("video"); diff --git a/src/supertux/gameconfig.hpp b/src/supertux/gameconfig.hpp index 5836644ac..8558d6902 100644 --- a/src/supertux/gameconfig.hpp +++ b/src/supertux/gameconfig.hpp @@ -42,7 +42,7 @@ public: /** the aspect ratio */ Size aspect_size; - + float magnification; bool use_fullscreen; diff --git a/src/supertux/info_box_line.cpp b/src/supertux/info_box_line.cpp index e7ff52e80..77b81959f 100644 --- a/src/supertux/info_box_line.cpp +++ b/src/supertux/info_box_line.cpp @@ -87,17 +87,17 @@ InfoBoxLine::LineType get_linetype_by_format_char(char format_char) { } // namespace -InfoBoxLine::InfoBoxLine(char format_char, const std::string& text) : +InfoBoxLine::InfoBoxLine(char format_char, const std::string& text) : lineType(NORMAL), - font(Resources::normal_font), + font(Resources::normal_font), color(), - text(text), + text(text), image() { font = get_font_by_format_char(format_char); lineType = get_linetype_by_format_char(format_char); color = get_color_by_format_char(format_char); - if (lineType == IMAGE) + if (lineType == IMAGE) { image = Surface::create(text); } diff --git a/src/supertux/level.cpp b/src/supertux/level.cpp index b3644d6d6..83e838be1 100644 --- a/src/supertux/level.cpp +++ b/src/supertux/level.cpp @@ -32,8 +32,8 @@ using namespace std; Level::Level() : - name("noname"), - author("Mr. X"), + name("noname"), + author("Mr. X"), contact(), license(), filename(), @@ -41,7 +41,7 @@ Level::Level() : sectors(), stats(), target_time(), - tileset(NULL), + tileset(NULL), free_tileset(false) { } diff --git a/src/supertux/levelintro.cpp b/src/supertux/levelintro.cpp index 426602141..02215f945 100644 --- a/src/supertux/levelintro.cpp +++ b/src/supertux/levelintro.cpp @@ -29,10 +29,10 @@ #include LevelIntro::LevelIntro(const Level* level, const Statistics* best_level_statistics) : - level(level), - best_level_statistics(best_level_statistics), + level(level), + best_level_statistics(best_level_statistics), player_sprite(), - player_sprite_py(0), + player_sprite_py(0), player_sprite_vy(0), player_sprite_jump_timer() { @@ -73,7 +73,7 @@ LevelIntro::update(float elapsed_time) player_sprite_vy = -300; player_sprite_jump_timer.start(graphicsRandom.randf(2,3)); } - + } void @@ -123,7 +123,7 @@ LevelIntro::draw(DrawingContext& context) context.draw_center_text(Resources::normal_font, ss.str(), Vector(0, py), LAYER_FOREGROUND1,LevelIntro::stat_color); py += static_cast(Resources::normal_font->get_height()); } - + { std::stringstream ss; ss << _("Secrets") << ": " << Statistics::secrets_to_string((best_level_statistics && (best_level_statistics->coins >= 0)) ? best_level_statistics->secrets : 0, stats.total_secrets); diff --git a/src/supertux/main.hpp b/src/supertux/main.hpp index e76dfcc3c..dc91929ce 100644 --- a/src/supertux/main.hpp +++ b/src/supertux/main.hpp @@ -36,7 +36,7 @@ private: void quit_audio(); public: - /** We call it run() instead of main() as main collides with + /** We call it run() instead of main() as main collides with #define main SDL_main from SDL.h */ int run(int argc, char** argv); }; diff --git a/src/supertux/menu/addon_menu.cpp b/src/supertux/menu/addon_menu.cpp index 6564fec64..3494062d8 100644 --- a/src/supertux/menu/addon_menu.cpp +++ b/src/supertux/menu/addon_menu.cpp @@ -48,7 +48,7 @@ AddonMenu::refresh() // refresh list of addons m_addons = adm.get_addons(); - + // sort list std::sort(m_addons.begin(), m_addons.end(), generate_addons_menu_sorter); @@ -65,11 +65,11 @@ AddonMenu::refresh() //add_hl(); - for (unsigned int i = 0; i < m_addons.size(); i++) + for (unsigned int i = 0; i < m_addons.size(); i++) { const Addon& addon = *m_addons[i]; std::string text = ""; - + if (!addon.kind.empty()) { std::string kind = addon.kind; @@ -124,18 +124,18 @@ AddonMenu::check_menu() { int index = check(); - if (index == -1) + if (index == -1) { // do nothing } else if (index == 0) // check if "Check Online" was chosen { - try + try { AddonManager::get_instance().check_online(); refresh(); set_active_item(index); - } + } catch (std::exception& e) { log_warning << "Check for available Add-ons failed: " << e.what() << std::endl; @@ -144,40 +144,40 @@ AddonMenu::check_menu() else { // if one of the Addons listed was chosen, take appropriate action - if ((index >= ADDON_LIST_START_ID) && (index < ADDON_LIST_START_ID) + m_addons.size()) + if ((index >= ADDON_LIST_START_ID) && (index < ADDON_LIST_START_ID) + m_addons.size()) { Addon& addon = *m_addons[index - ADDON_LIST_START_ID]; - if (!addon.installed) + if (!addon.installed) { - try + try { AddonManager::get_instance().install(&addon); - } - catch (std::exception& e) + } + catch (std::exception& e) { log_warning << "Installing Add-on failed: " << e.what() << std::endl; } set_toggled(index, addon.loaded); - } - else if (!addon.loaded) + } + else if (!addon.loaded) { - try + try { AddonManager::get_instance().enable(&addon); - } - catch (std::exception& e) + } + catch (std::exception& e) { log_warning << "Enabling Add-on failed: " << e.what() << std::endl; } set_toggled(index, addon.loaded); - } - else + } + else { - try + try { AddonManager::get_instance().disable(&addon); - } - catch (std::exception& e) + } + catch (std::exception& e) { log_warning << "Disabling Add-on failed: " << e.what() << std::endl; } diff --git a/src/supertux/menu/contrib_menu.hpp b/src/supertux/menu/contrib_menu.hpp index 94dcc1fff..d83f8c231 100644 --- a/src/supertux/menu/contrib_menu.hpp +++ b/src/supertux/menu/contrib_menu.hpp @@ -30,7 +30,7 @@ private: public: ContribMenu(); ~ContribMenu(); - + void check_menu(); private: diff --git a/src/supertux/menu/contrib_world_menu.cpp b/src/supertux/menu/contrib_world_menu.cpp index 799e410e9..548fab3c4 100644 --- a/src/supertux/menu/contrib_world_menu.cpp +++ b/src/supertux/menu/contrib_world_menu.cpp @@ -49,7 +49,7 @@ ContribWorldMenu::check_menu() { int index = check(); if (index != -1) { - if (get_item_by_id(index).kind == MN_ACTION) + if (get_item_by_id(index).kind == MN_ACTION) { sound_manager->stop_music(); GameManager::current()->start_level(std::move(m_world), index); diff --git a/src/supertux/menu/keyboard_menu.cpp b/src/supertux/menu/keyboard_menu.cpp index f647370a8..052ed3db2 100644 --- a/src/supertux/menu/keyboard_menu.cpp +++ b/src/supertux/menu/keyboard_menu.cpp @@ -92,7 +92,7 @@ KeyboardMenu::menu_action(MenuItem* item) controller->keyboard_manager->wait_for_key = item->id; } else if( item->id == Controller::CONTROLCOUNT) { controller->keyboard_manager->jump_with_up_kbd = item->toggled; - } + } } void diff --git a/src/supertux/menu/language_menu.cpp b/src/supertux/menu/language_menu.cpp index 399ec2103..373b8fc17 100644 --- a/src/supertux/menu/language_menu.cpp +++ b/src/supertux/menu/language_menu.cpp @@ -31,7 +31,7 @@ enum { MNID_LANGUAGE_NEXT = 10 }; -LanguageMenu::LanguageMenu() +LanguageMenu::LanguageMenu() { add_label(_("Language")); add_hl(); @@ -40,7 +40,7 @@ LanguageMenu::LanguageMenu() int mnid = MNID_LANGUAGE_NEXT; std::set languages = dictionary_manager->get_languages(); - for (std::set::iterator i = languages.begin(); i != languages.end(); i++) + for (std::set::iterator i = languages.begin(); i != languages.end(); i++) { add_entry(mnid++, i->get_name()); } @@ -50,7 +50,7 @@ LanguageMenu::LanguageMenu() } void -LanguageMenu::menu_action(MenuItem* item) +LanguageMenu::menu_action(MenuItem* item) { if (item->id == MNID_LANGUAGE_AUTO_DETECT) // auto detect { @@ -76,9 +76,9 @@ LanguageMenu::menu_action(MenuItem* item) int mnid = MNID_LANGUAGE_NEXT; std::set languages = dictionary_manager->get_languages(); - for (std::set::iterator i = languages.begin(); i != languages.end(); i++) + for (std::set::iterator i = languages.begin(); i != languages.end(); i++) { - if (item->id == mnid++) + if (item->id == mnid++) { g_config->locale = i->str(); dictionary_manager->set_language(*i); diff --git a/src/supertux/menu/menu_storage.hpp b/src/supertux/menu/menu_storage.hpp index 80e0a56ab..44aaf5160 100644 --- a/src/supertux/menu/menu_storage.hpp +++ b/src/supertux/menu/menu_storage.hpp @@ -52,9 +52,9 @@ public: public: MenuStorage(); ~MenuStorage(); - + std::unique_ptr create(MenuId menu_id); - + private: MenuStorage(const MenuStorage&); MenuStorage& operator=(const MenuStorage&); diff --git a/src/supertux/menu/profile_menu.cpp b/src/supertux/menu/profile_menu.cpp index 4878bbd08..e24ceaa15 100644 --- a/src/supertux/menu/profile_menu.cpp +++ b/src/supertux/menu/profile_menu.cpp @@ -24,7 +24,7 @@ #include "supertux/globals.hpp" #include "util/gettext.hpp" -ProfileMenu::ProfileMenu() +ProfileMenu::ProfileMenu() { add_label(_("Select Profile")); add_hl(); @@ -47,7 +47,7 @@ ProfileMenu::ProfileMenu() } void -ProfileMenu::menu_action(MenuItem* item) +ProfileMenu::menu_action(MenuItem* item) { g_config->profile = item->id; MenuManager::instance().clear_menu_stack(); diff --git a/src/supertux/moving_object.hpp b/src/supertux/moving_object.hpp index 7642ac5d5..c1158526c 100644 --- a/src/supertux/moving_object.hpp +++ b/src/supertux/moving_object.hpp @@ -175,7 +175,7 @@ protected: private: /** this is only here for internal collision detection use (don't touch this from outside collision detection code) - + This field holds the currently anticipated destination of the object during collision detection */ Rectf dest; diff --git a/src/supertux/object_factory.cpp b/src/supertux/object_factory.cpp index 2165970c2..2c1fd84d5 100644 --- a/src/supertux/object_factory.cpp +++ b/src/supertux/object_factory.cpp @@ -283,7 +283,7 @@ ObjectFactory::create(const std::string& name, const Reader& reader) { Factories::iterator i = factories.find(name); - if (i == factories.end()) + if (i == factories.end()) { std::stringstream msg; msg << "No factory for object '" << name << "' found."; @@ -306,7 +306,7 @@ ObjectFactory::create(const std::string& name, const Vector& pos, const Directio lisp::Parser parser; const lisp::Lisp* lisp = parser.parse(lisptext, "create_object"); - + GameObject* object = create(name, *(lisp->get_car())); return object; } diff --git a/src/supertux/object_factory.hpp b/src/supertux/object_factory.hpp index f79c39c68..d6b16248b 100644 --- a/src/supertux/object_factory.hpp +++ b/src/supertux/object_factory.hpp @@ -44,7 +44,7 @@ template class ConcreteObjectFactory : public AbstractObjectFactory { public: - ConcreteObjectFactory() {} + ConcreteObjectFactory() {} ~ConcreteObjectFactory() {} GameObject* create(const Reader& reader) diff --git a/src/supertux/physic.cpp b/src/supertux/physic.cpp index 729e0be13..065e174fc 100644 --- a/src/supertux/physic.cpp +++ b/src/supertux/physic.cpp @@ -20,9 +20,9 @@ #include "supertux/sector.hpp" Physic::Physic() : - ax(0), ay(0), - vx(0), vy(0), - gravity_enabled_flag(true), + ax(0), ay(0), + vx(0), vy(0), + gravity_enabled_flag(true), gravity_modifier(1.0f) { } diff --git a/src/supertux/physic.hpp b/src/supertux/physic.hpp index 12b1bc82a..f81543e00 100644 --- a/src/supertux/physic.hpp +++ b/src/supertux/physic.hpp @@ -76,7 +76,7 @@ private: /** horizontal and vertical velocity */ float vx, vy; - + /** should we respect gravity in our calculations? */ bool gravity_enabled_flag; diff --git a/src/supertux/player_status.cpp b/src/supertux/player_status.cpp index 6980414ce..2a599254b 100644 --- a/src/supertux/player_status.cpp +++ b/src/supertux/player_status.cpp @@ -155,13 +155,13 @@ PlayerStatus::draw(DrawingContext& context) if (coin_surface) { - context.draw_surface(coin_surface, - Vector(SCREEN_WIDTH - BORDER_X - coin_surface->get_width() - Resources::fixed_font->get_text_width(coins_text), + context.draw_surface(coin_surface, + Vector(SCREEN_WIDTH - BORDER_X - coin_surface->get_width() - Resources::fixed_font->get_text_width(coins_text), BORDER_Y + 1 + (Resources::fixed_font->get_text_height(coins_text) + 5) * player_id), LAYER_HUD); } - context.draw_text(Resources::fixed_font, - coins_text, + context.draw_text(Resources::fixed_font, + coins_text, Vector(SCREEN_WIDTH - BORDER_X - Resources::fixed_font->get_text_width(coins_text), BORDER_Y + (Resources::fixed_font->get_text_height(coins_text) + 5) * player_id), ALIGN_LEFT, diff --git a/src/supertux/resources.cpp b/src/supertux/resources.cpp index c29fa90bc..aed7571c9 100644 --- a/src/supertux/resources.cpp +++ b/src/supertux/resources.cpp @@ -88,7 +88,7 @@ Resources::unload_shared() small_font.reset(); if(big_font != NULL) big_font.reset(); - + /* Free tilesets */ delete tile_manager; tile_manager = 0; diff --git a/src/supertux/resources.hpp b/src/supertux/resources.hpp index 746601028..243947bd4 100644 --- a/src/supertux/resources.hpp +++ b/src/supertux/resources.hpp @@ -39,7 +39,7 @@ public: static SurfacePtr back; static SurfacePtr arrow_left; static SurfacePtr arrow_right; - + public: static void load_shared(); static void unload_shared(); diff --git a/src/supertux/screen.hpp b/src/supertux/screen.hpp index 3629b4785..1075e5275 100644 --- a/src/supertux/screen.hpp +++ b/src/supertux/screen.hpp @@ -22,7 +22,7 @@ class DrawingContext; /** * Abstract base class for code the MainLoop runs exclusively and full-screen. * - * Examples of Screens are: The TitleScreen, a WorldMap, a level's + * Examples of Screens are: The TitleScreen, a WorldMap, a level's * GameSession, a TextScroller, ... */ class Screen diff --git a/src/supertux/screen_fade.hpp b/src/supertux/screen_fade.hpp index 4991a30ac..1433681e1 100644 --- a/src/supertux/screen_fade.hpp +++ b/src/supertux/screen_fade.hpp @@ -20,7 +20,7 @@ class DrawingContext; /** - * Screen to be displayed simultaneously with another Screen. + * Screen to be displayed simultaneously with another Screen. * * This is used for Screen transition effects like a fade-out or a shrink-fade */ diff --git a/src/supertux/sector.cpp b/src/supertux/sector.cpp index ac5f76def..38e66ad74 100644 --- a/src/supertux/sector.cpp +++ b/src/supertux/sector.cpp @@ -65,7 +65,7 @@ bool Sector::show_collrects = false; bool Sector::draw_solids_only = false; Sector::Sector(Level* parent) : - level(parent), + level(parent), name(), bullets(), init_script(), @@ -73,16 +73,16 @@ Sector::Sector(Level* parent) : currentmusic(LEVEL_MUSIC), sector_table(), scripts(), - ambient_light( 1.0f, 1.0f, 1.0f, 1.0f ), + ambient_light( 1.0f, 1.0f, 1.0f, 1.0f ), gameobjects(), moving_objects(), spawnpoints(), portables(), music(), - gravity(10.0), - player(0), + gravity(10.0), + player(0), solid_tilemaps(), - camera(0), + camera(0), effect(0) { add_object(new Player(GameSession::current()->get_player_status(), "Tux")); @@ -607,7 +607,7 @@ Sector::activate(const Vector& player_pos) camera->update(1); player->move(player->get_pos()+(Vector(32, 0))); camera->update(1); - + update_game_objects(); //Run default.nut just before init script diff --git a/src/supertux/sector.hpp b/src/supertux/sector.hpp index 7016653b4..e5da1d722 100644 --- a/src/supertux/sector.hpp +++ b/src/supertux/sector.hpp @@ -75,7 +75,7 @@ public: /// read sector from lisp file void parse(const Reader& lisp); void parse_old_format(const Reader& lisp); - + /// activates this sector (change music, initialize player class, ...) void activate(const std::string& spawnpoint); void activate(const Vector& player_pos); diff --git a/src/supertux/shrinkfade.cpp b/src/supertux/shrinkfade.cpp index 03ca3c183..e74a5b23e 100644 --- a/src/supertux/shrinkfade.cpp +++ b/src/supertux/shrinkfade.cpp @@ -19,8 +19,8 @@ #include "video/drawing_context.hpp" ShrinkFade::ShrinkFade(const Vector& dest, float fade_time) : - dest(dest), - fade_time(fade_time), + dest(dest), + fade_time(fade_time), accum_time(0), speedleft(), speedright(), @@ -50,7 +50,7 @@ ShrinkFade::draw(DrawingContext& context) { float progress = accum_time / fade_time; context.draw_inverse_ellipse(dest, - Vector(2*SCREEN_WIDTH * (1.0f - progress), + Vector(2*SCREEN_WIDTH * (1.0f - progress), 2*SCREEN_HEIGHT * (1.0f - progress)), Color(0, 0, 0), LAYER_GUI+1); } diff --git a/src/supertux/spawn_point.cpp b/src/supertux/spawn_point.cpp index 8cc24c00e..5b6618202 100644 --- a/src/supertux/spawn_point.cpp +++ b/src/supertux/spawn_point.cpp @@ -26,7 +26,7 @@ SpawnPoint::SpawnPoint() : {} SpawnPoint::SpawnPoint(const SpawnPoint& other) : - name(other.name), + name(other.name), pos(other.pos) {} diff --git a/src/supertux/statistics.cpp b/src/supertux/statistics.cpp index e14f4bd19..56cb3cdf7 100644 --- a/src/supertux/statistics.cpp +++ b/src/supertux/statistics.cpp @@ -39,15 +39,15 @@ float WMAP_INFO_RIGHT_X; float WMAP_INFO_TOP_Y1; float WMAP_INFO_TOP_Y2; -Statistics::Statistics() : - coins(nv_coins), - total_coins(nv_coins), - badguys(nv_badguys), - total_badguys(nv_badguys), - time(nv_time), - secrets(nv_secrets), - total_secrets(nv_secrets), - valid(true) +Statistics::Statistics() : + coins(nv_coins), + total_coins(nv_coins), + badguys(nv_badguys), + total_badguys(nv_badguys), + time(nv_time), + secrets(nv_secrets), + total_secrets(nv_secrets), + valid(true) { WMAP_INFO_LEFT_X = SCREEN_WIDTH - 32 - 256; WMAP_INFO_RIGHT_X = WMAP_INFO_LEFT_X + 256; @@ -113,9 +113,9 @@ Statistics::draw_worldmap_info(DrawingContext& context, float target_time) WMAP_INFO_TOP_Y1 = SCREEN_HEIGHT - 100; WMAP_INFO_TOP_Y2 = WMAP_INFO_TOP_Y1 + 16; } - - context.draw_text(Resources::small_font, std::string("- ") + _("Best Level Statistics") + " -", - Vector((WMAP_INFO_LEFT_X + WMAP_INFO_RIGHT_X) / 2, WMAP_INFO_TOP_Y1), + + context.draw_text(Resources::small_font, std::string("- ") + _("Best Level Statistics") + " -", + Vector((WMAP_INFO_LEFT_X + WMAP_INFO_RIGHT_X) / 2, WMAP_INFO_TOP_Y1), ALIGN_CENTER, LAYER_HUD,Statistics::header_color); std::string caption_buf; @@ -284,8 +284,8 @@ Statistics::operator+=(const Statistics& s2) bool Statistics::completed(const Statistics& stats, const float target_time) { - return (stats.coins == stats.total_coins && - stats.badguys == stats.total_badguys && + return (stats.coins == stats.total_coins && + stats.badguys == stats.total_badguys && stats.secrets == stats.total_secrets && ((!target_time) || (stats.time <= target_time))); } @@ -310,7 +310,7 @@ Statistics::frags_to_string(int badguys, int total_badguys) { return os.str(); } -std::string +std::string Statistics::time_to_string(float time) { int time_csecs = std::min(static_cast(time * 100), 99 * 6000 + 9999); int mins = (time_csecs / 6000); diff --git a/src/supertux/statistics.hpp b/src/supertux/statistics.hpp index 37a7710a4..964b055e7 100644 --- a/src/supertux/statistics.hpp +++ b/src/supertux/statistics.hpp @@ -68,7 +68,7 @@ public: bool completed(const Statistics& stats, const float target_time); /* Check if stats match total stats */ void declare_invalid(); /**< marks statistics as invalid for their entire lifetime (e.g. after cheating). Invalid statistics will not be merged or drawn. */ - + static std::string coins_to_string(int coins, int total_coins); static std::string frags_to_string(int badguys, int total_badguys); static std::string time_to_string(float time); diff --git a/src/supertux/tile.cpp b/src/supertux/tile.cpp index b81595308..61a2e0634 100644 --- a/src/supertux/tile.cpp +++ b/src/supertux/tile.cpp @@ -30,20 +30,20 @@ Tile::Tile() : images(), editor_imagespecs(), editor_images(), - attributes(0), - data(0), + attributes(0), + data(0), fps(1) { } -Tile::Tile(const std::vector& imagespecs_, const std::vector& editor_imagespecs_, +Tile::Tile(const std::vector& imagespecs_, const std::vector& editor_imagespecs_, uint32_t attributes, uint32_t data, float fps) : imagespecs(imagespecs_), images(), editor_imagespecs(editor_imagespecs_), editor_images(), - attributes(attributes), - data(data), + attributes(attributes), + data(data), fps(fps) { correct_attributes(); @@ -59,16 +59,16 @@ Tile::load_images() if(images.size() == 0 && imagespecs.size() != 0) { assert(images.size() == 0); - for(std::vector::iterator i = imagespecs.begin(); i != imagespecs.end(); ++i) + for(std::vector::iterator i = imagespecs.begin(); i != imagespecs.end(); ++i) { const ImageSpec& spec = *i; SurfacePtr surface; - if(spec.rect.get_width() <= 0) + if(spec.rect.get_width() <= 0) { surface = Surface::create(spec.file); } - else + else { surface = Surface::create(spec.file, Rect((int) spec.rect.p1.x, @@ -83,16 +83,16 @@ Tile::load_images() if(editor_images.size() == 0 && editor_imagespecs.size() != 0) { assert(editor_images.size() == 0); - for(std::vector::iterator i = editor_imagespecs.begin(); i != editor_imagespecs.end(); ++i) + for(std::vector::iterator i = editor_imagespecs.begin(); i != editor_imagespecs.end(); ++i) { const ImageSpec& spec = *i; SurfacePtr surface; - if(spec.rect.get_width() <= 0) + if(spec.rect.get_width() <= 0) { surface = Surface::create(spec.file); } - else + else { surface = Surface::create(spec.file, Rect((int) spec.rect.p1.x, @@ -142,9 +142,9 @@ void Tile::print_debug(int id) const { log_debug << " Tile: id " << id << ", data " << getData() << ", attributes " << getAttributes() << ":" << std::endl; - for(std::vector::const_iterator im = editor_imagespecs.begin(); im != editor_imagespecs.end(); ++im) + for(std::vector::const_iterator im = editor_imagespecs.begin(); im != editor_imagespecs.end(); ++im) log_debug << " Editor Imagespec: file " << im->file << "; rect " << im->rect << std::endl; - for(std::vector::const_iterator im = imagespecs.begin(); im != imagespecs.end(); ++im) + for(std::vector::const_iterator im = imagespecs.begin(); im != imagespecs.end(); ++im) log_debug << " Imagespec: file " << im->file << "; rect " << im->rect << std::endl; } diff --git a/src/supertux/tile_manager.cpp b/src/supertux/tile_manager.cpp index 090b55c7e..e3072a765 100644 --- a/src/supertux/tile_manager.cpp +++ b/src/supertux/tile_manager.cpp @@ -62,7 +62,7 @@ TileManager::parse_tileset_definition(const Reader& reader) } const lisp::Lisp* tileset_reader = iter.lisp(); - std::string file; + std::string file; if (!tileset_reader->get("file", file)) { log_warning << "Skipping tileset import without file name" << std::endl; continue; diff --git a/src/supertux/tile_set_parser.cpp b/src/supertux/tile_set_parser.cpp index 0d414afd2..fee700b76 100644 --- a/src/supertux/tile_set_parser.cpp +++ b/src/supertux/tile_set_parser.cpp @@ -29,7 +29,7 @@ TileSetParser::TileSetParser(TileSet& tileset, const std::string& filename) : m_tileset(tileset), m_filename(filename), m_tiles_path() -{ +{ } void @@ -48,21 +48,21 @@ TileSetParser::parse() throw std::runtime_error("file is not a supertux tiles file."); lisp::ListIterator iter(tiles_lisp); - while(iter.next()) + while(iter.next()) { - if (iter.item() == "tile") + if (iter.item() == "tile") { parse_tile(*iter.lisp()); - } - else if (iter.item() == "tilegroup") + } + else if (iter.item() == "tilegroup") { /* tilegroups are only interesting for the editor */ - } - else if (iter.item() == "tiles") + } + else if (iter.item() == "tiles") { parse_tiles(*iter.lisp()); } - else + else { log_warning << "Unknown symbol '" << iter.item() << "' in tileset file" << std::endl; } @@ -73,7 +73,7 @@ void TileSetParser::parse_tile(const Reader& reader) { uint32_t id; - if (!reader.get("id", id)) + if (!reader.get("id", id)) { throw std::runtime_error("Missing tile-id."); } @@ -120,7 +120,7 @@ TileSetParser::parse_tile(const Reader& reader) float fps = 10; reader.get("fps", fps); - if(reader.get("slope-type", data)) + if(reader.get("slope-type", data)) { attributes |= Tile::SOLID | Tile::SLOPE; } @@ -142,11 +142,11 @@ TileSetParser::parse_tile(const Reader& reader) if (id >= m_tileset.tiles.size()) m_tileset.tiles.resize(id+1, 0); - if (m_tileset.tiles[id] != 0) + if (m_tileset.tiles[id] != 0) { log_warning << "Tile with ID " << id << " redefined" << std::endl; - } - else + } + else { m_tileset.tiles[id] = tile.release(); } @@ -158,11 +158,11 @@ TileSetParser::parse_tile_images(const Reader& images_lisp) std::vector imagespecs; const lisp::Lisp* list = &images_lisp; - while(list) + while(list) { const lisp::Lisp* cur = list->get_car(); - if(cur->get_type() == lisp::Lisp::TYPE_STRING) + if(cur->get_type() == lisp::Lisp::TYPE_STRING) { std::string file; cur->get(file); @@ -170,7 +170,7 @@ TileSetParser::parse_tile_images(const Reader& images_lisp) } else if(cur->get_type() == lisp::Lisp::TYPE_CONS && cur->get_car()->get_type() == lisp::Lisp::TYPE_SYMBOL && - cur->get_car()->get_symbol() == "region") + cur->get_car()->get_symbol() == "region") { const lisp::Lisp* ptr = cur->get_cdr(); @@ -185,8 +185,8 @@ TileSetParser::parse_tile_images(const Reader& images_lisp) ptr->get_car()->get(w); ptr = ptr->get_cdr(); ptr->get_car()->get(h); imagespecs.push_back(Tile::ImageSpec(m_tiles_path + file, Rectf(x, y, x+w, y+h))); - } - else + } + else { log_warning << "Expected string or list in images tag" << std::endl; } @@ -249,11 +249,11 @@ TileSetParser::parse_tiles(const Reader& reader) { throw std::runtime_error("Height is zero."); } - else if (fps < 0) + else if (fps < 0) { throw std::runtime_error("Negative fps."); } - else if (ids.size() != width*height) + else if (ids.size() != width*height) { std::ostringstream err; err << "Number of ids (" << ids.size() << ") and " @@ -268,8 +268,8 @@ TileSetParser::parse_tiles(const Reader& reader) << ") mismatch for image '" << image_name << "', but must be equal"; throw std::runtime_error(err.str()); } - else if (has_datas && ids.size() != datas.size()) - { + else if (has_datas && ids.size() != datas.size()) + { std::ostringstream err; err << "Number of ids (" << ids.size() << ") and datas (" << datas.size() << ") mismatch for image '" << image_name << "', but must be equal"; @@ -277,7 +277,7 @@ TileSetParser::parse_tiles(const Reader& reader) } else { - for(std::vector::size_type i = 0; i < ids.size() && i < width*height; ++i) + for(std::vector::size_type i = 0; i < ids.size() && i < width*height; ++i) { if (ids[i] != 0) { @@ -288,13 +288,13 @@ TileSetParser::parse_tiles(const Reader& reader) int y = 32*(i / width); std::vector imagespecs; - for(std::vector::const_iterator j = images.begin(); j != images.end(); ++j) + for(std::vector::const_iterator j = images.begin(); j != images.end(); ++j) { imagespecs.push_back(Tile::ImageSpec(m_tiles_path + *j, Rectf(x, y, x + 32, y + 32))); } std::vector editor_imagespecs; - for(std::vector::const_iterator j = editor_images.begin(); j != editor_images.end(); ++j) + for(std::vector::const_iterator j = editor_images.begin(); j != editor_images.end(); ++j) { editor_imagespecs.push_back(Tile::ImageSpec(m_tiles_path + *j, Rectf(x, y, x + 32, y + 32))); } @@ -308,7 +308,7 @@ TileSetParser::parse_tiles(const Reader& reader) } } } - } + } } /* EOF */ diff --git a/src/supertux/tile_set_parser.hpp b/src/supertux/tile_set_parser.hpp index 09849b0d6..38ecff116 100644 --- a/src/supertux/tile_set_parser.hpp +++ b/src/supertux/tile_set_parser.hpp @@ -34,17 +34,17 @@ private: TileSet& m_tileset; std::string m_filename; std::string m_tiles_path; - + public: TileSetParser(TileSet& tileset, const std::string& filename); - + void parse(); private: void parse_tile(const Reader& reader); void parse_tiles(const Reader& reader); std::vector parse_tile_images(const Reader& cur); - + private: TileSetParser(const TileSetParser&); TileSetParser& operator=(const TileSetParser&); diff --git a/src/supertux/timer.cpp b/src/supertux/timer.cpp index 90e765534..3df088dc5 100644 --- a/src/supertux/timer.cpp +++ b/src/supertux/timer.cpp @@ -19,8 +19,8 @@ #include "supertux/timer.hpp" Timer::Timer() : - period(0), -cycle_start(0), + period(0), +cycle_start(0), cyclic(false) { } diff --git a/src/supertux/title_screen.hpp b/src/supertux/title_screen.hpp index a749791fb..7df407877 100644 --- a/src/supertux/title_screen.hpp +++ b/src/supertux/title_screen.hpp @@ -46,7 +46,7 @@ public: private: void make_tux_jump(); - + private: SurfacePtr frame; std::unique_ptr controller; diff --git a/src/trigger/climbable.cpp b/src/trigger/climbable.cpp index 1d7eb66e3..42b8f60e4 100644 --- a/src/trigger/climbable.cpp +++ b/src/trigger/climbable.cpp @@ -57,7 +57,7 @@ Climbable::~Climbable() } } -void +void Climbable::update(float /*elapsed_time*/) { if (!climbed_by) return; @@ -106,7 +106,7 @@ Climbable::event(Player& player, EventType type) } bool -Climbable::may_climb(Player& player) +Climbable::may_climb(Player& player) { if (player.get_bbox().p1.x < get_bbox().p1.x - GRACE_DX) return false; if (player.get_bbox().p2.x > get_bbox().p2.x + GRACE_DX) return false; diff --git a/src/trigger/secretarea_trigger.hpp b/src/trigger/secretarea_trigger.hpp index 9f1e441b3..3160afeac 100644 --- a/src/trigger/secretarea_trigger.hpp +++ b/src/trigger/secretarea_trigger.hpp @@ -40,7 +40,7 @@ public: private: Timer message_timer; bool message_displayed; - std::string message; /**< message to display, default "You found a secret area!" */ + std::string message; /**< message to display, default "You found a secret area!" */ std::string fade_tilemap; /**< tilemap to fade away when trigger is activated, or empty if you don't care */ std::string script; /**< optional script to run when trigger is activated */ }; diff --git a/src/trigger/trigger_base.cpp b/src/trigger/trigger_base.cpp index 247ee2bf1..1407cad7c 100644 --- a/src/trigger/trigger_base.cpp +++ b/src/trigger/trigger_base.cpp @@ -21,7 +21,7 @@ TriggerBase::TriggerBase() : sprite(), - lasthit(false), + lasthit(false), hit(false), losetouch_listeners() { @@ -77,8 +77,8 @@ TriggerBase::collision(GameObject& other, const CollisionHit& ) return ABORT_MOVE; } - -void + +void TriggerBase::object_removed(GameObject* object) { for (std::list::iterator i = losetouch_listeners.begin(); i != losetouch_listeners.end(); i++) { diff --git a/src/trigger/trigger_base.hpp b/src/trigger/trigger_base.hpp index 5d07527ea..d2fb236b1 100644 --- a/src/trigger/trigger_base.hpp +++ b/src/trigger/trigger_base.hpp @@ -29,7 +29,7 @@ class Player; /** This class is the base class for all objects you can interact with in some * way. There are several interaction types defined like touch and activate */ -class TriggerBase : public MovingObject, +class TriggerBase : public MovingObject, public ObjectRemoveListener { public: @@ -50,7 +50,7 @@ public: * Receive trigger events */ virtual void event(Player& player, EventType type) = 0; - + /** * Called by GameObject destructor of an object in losetouch_listeners */ diff --git a/src/util/gettext.hpp b/src/util/gettext.hpp index c73548d49..f4186953a 100644 --- a/src/util/gettext.hpp +++ b/src/util/gettext.hpp @@ -1,4 +1,4 @@ -// SuperTux +// SuperTux // Copyright (C) 2006 Ingo Ruhnke // // This program is free software: you can redistribute it and/or modify diff --git a/src/util/log.cpp b/src/util/log.cpp index 2125afca7..cb8ed6db7 100644 --- a/src/util/log.cpp +++ b/src/util/log.cpp @@ -38,22 +38,22 @@ static std::ostream& log_generic_f (const char *prefix, const char* file, int li return (get_logging_instance ()); } -std::ostream& log_debug_f(const char* file, int line) +std::ostream& log_debug_f(const char* file, int line) { return (log_generic_f ("[DEBUG]", file, line)); } -std::ostream& log_info_f(const char* file, int line) +std::ostream& log_info_f(const char* file, int line) { return (log_generic_f ("[INFO]", file, line)); } -std::ostream& log_warning_f(const char* file, int line) +std::ostream& log_warning_f(const char* file, int line) { return (log_generic_f ("[WARNING]", file, line)); } -std::ostream& log_fatal_f(const char* file, int line) +std::ostream& log_fatal_f(const char* file, int line) { return (log_generic_f ("[FATAL]", file, line)); } diff --git a/src/util/ref.hpp b/src/util/ref.hpp index 90c9e622b..608686783 100644 --- a/src/util/ref.hpp +++ b/src/util/ref.hpp @@ -42,7 +42,7 @@ public: if(object) object->unref(); } - + Ref& operator= (const Ref& other) { *this = other.get(); diff --git a/src/util/utf8_iterator.cpp b/src/util/utf8_iterator.cpp index f2550a3df..5bd0923c7 100644 --- a/src/util/utf8_iterator.cpp +++ b/src/util/utf8_iterator.cpp @@ -99,13 +99,13 @@ UTF8Iterator::UTF8Iterator(const std::string& text_) : } } - bool + bool UTF8Iterator::done() const { return pos > text.size(); } - UTF8Iterator& + UTF8Iterator& UTF8Iterator::operator++() { try { chr = decode_utf8(text, pos); diff --git a/src/video/color.hpp b/src/video/color.hpp index a3c360eb3..6900d7cf1 100644 --- a/src/video/color.hpp +++ b/src/video/color.hpp @@ -26,16 +26,16 @@ class Color { public: Color() : - red(0), - green(0), - blue(0), + red(0), + green(0), + blue(0), alpha(1.0f) {} Color(float red_, float green_, float blue_, float alpha_ = 1.0) : red(red_), - green(green_), - blue(blue_), + green(green_), + blue(blue_), alpha(alpha_) { assert(0 <= red && red <= 1.0); diff --git a/src/video/renderer.hpp b/src/video/renderer.hpp index a2a2a500b..03d0b91ea 100644 --- a/src/video/renderer.hpp +++ b/src/video/renderer.hpp @@ -57,7 +57,7 @@ public: virtual SDL_Window* get_window() const = 0; static Renderer* instance() { assert(instance_); return instance_; } - + protected: static Renderer* instance_; }; diff --git a/src/video/sdl/sdl_lightmap.cpp b/src/video/sdl/sdl_lightmap.cpp index 794b918d6..641e8ad89 100644 --- a/src/video/sdl/sdl_lightmap.cpp +++ b/src/video/sdl/sdl_lightmap.cpp @@ -56,7 +56,7 @@ void SDLLightmap::start_draw(const Color &ambient_color) { SDL_SetRenderTarget(renderer, texture); - + Uint8 r = static_cast(ambient_color.red * 255); Uint8 g = static_cast(ambient_color.green * 255); Uint8 b = static_cast(ambient_color.blue * 255); @@ -112,7 +112,7 @@ SDLLightmap::draw_filled_rect(const DrawingRequest& request) void SDLLightmap::get_light(const DrawingRequest& request) const { - const GetLightRequest* getlightrequest + const GetLightRequest* getlightrequest = (GetLightRequest*) request.request_data; SDL_Rect rect; diff --git a/src/video/sdl_surface_ptr.hpp b/src/video/sdl_surface_ptr.hpp index 8a4ba6bd3..ac1c126a2 100644 --- a/src/video/sdl_surface_ptr.hpp +++ b/src/video/sdl_surface_ptr.hpp @@ -35,7 +35,7 @@ public: m_surface(surface) {} - ~SDLSurfacePtr() + ~SDLSurfacePtr() { SDL_FreeSurface(m_surface); } diff --git a/src/video/surface.cpp b/src/video/surface.cpp index f9eb560e8..790aa3ffd 100644 --- a/src/video/surface.cpp +++ b/src/video/surface.cpp @@ -38,7 +38,7 @@ Surface::create(const std::string& file, const Rect& rect) Surface::Surface(const std::string& file) : texture(texture_manager->get(file)), surface_data(), - rect(0, 0, + rect(0, 0, Size(texture->get_image_width(), texture->get_image_height())), flipx(false) @@ -93,7 +93,7 @@ Surface::get_texture() const return texture; } -SurfaceData* +SurfaceData* Surface::get_surface_data() const { return surface_data; @@ -111,13 +111,13 @@ Surface::get_y() const return rect.top; } -int +int Surface::get_width() const { return rect.get_width(); } -int +int Surface::get_height() const { return rect.get_height(); @@ -126,13 +126,13 @@ Surface::get_height() const Vector Surface::get_position() const { - return Vector(get_x(), get_y()); + return Vector(get_x(), get_y()); } Vector Surface::get_size() const { - return Vector(get_width(), get_height()); + return Vector(get_width(), get_height()); } /* EOF */ diff --git a/src/video/texture.hpp b/src/video/texture.hpp index ca0b68c79..0a316cf63 100644 --- a/src/video/texture.hpp +++ b/src/video/texture.hpp @@ -53,7 +53,7 @@ private: public: Texture() : cache_filename() {} - virtual ~Texture() + virtual ~Texture() { if (texture_manager && cache_filename != "") /* The cache entry is now useless: its weak pointer to us has been diff --git a/src/worldmap/level.cpp b/src/worldmap/level.cpp index 8619408d2..dd4dbef12 100644 --- a/src/worldmap/level.cpp +++ b/src/worldmap/level.cpp @@ -32,14 +32,14 @@ namespace worldmap { LevelTile::LevelTile(const std::string& basedir, const Reader& lisp) : pos(), title(), - solved(false), + solved(false), perfect(false), - auto_play(false), + auto_play(false), sprite(), statistics(), target_time(), extro_script(), - basedir(basedir), + basedir(basedir), picture_cached(false), picture(0) { diff --git a/src/worldmap/spawn_point.cpp b/src/worldmap/spawn_point.cpp index c821326cd..a5e42d4e0 100644 --- a/src/worldmap/spawn_point.cpp +++ b/src/worldmap/spawn_point.cpp @@ -23,7 +23,7 @@ namespace worldmap { -SpawnPoint::SpawnPoint(const Reader& slisp) : +SpawnPoint::SpawnPoint(const Reader& slisp) : name(), pos(), auto_dir(D_NONE) diff --git a/src/worldmap/special_tile.cpp b/src/worldmap/special_tile.cpp index b4a94df42..b51766b7c 100644 --- a/src/worldmap/special_tile.cpp +++ b/src/worldmap/special_tile.cpp @@ -28,12 +28,12 @@ SpecialTile::SpecialTile(const Reader& lisp) : pos(), sprite(), map_message(), - passive_message(false), + passive_message(false), script(), invisible(false), - apply_action_north(true), + apply_action_north(true), apply_action_east(true), - apply_action_south(true), + apply_action_south(true), apply_action_west(true) { lisp.get("x", pos.x); diff --git a/src/worldmap/sprite_change.cpp b/src/worldmap/sprite_change.cpp index e35c5584c..705d5b45b 100644 --- a/src/worldmap/sprite_change.cpp +++ b/src/worldmap/sprite_change.cpp @@ -25,7 +25,7 @@ namespace worldmap { SpriteChange::SpriteChange(const Reader& lisp) : pos(), - change_on_touch(false), + change_on_touch(false), sprite(), stay_action(), stay_group(), diff --git a/src/worldmap/tux.cpp b/src/worldmap/tux.cpp index dda69c649..35e98e204 100644 --- a/src/worldmap/tux.cpp +++ b/src/worldmap/tux.cpp @@ -164,7 +164,7 @@ Tux::tryStartWalking() bool Tux::canWalk(int tile_data, Direction dir) { - return ghost_mode || + return ghost_mode || ((tile_data & Tile::WORLDMAP_NORTH && dir == D_NORTH) || (tile_data & Tile::WORLDMAP_SOUTH && dir == D_SOUTH) || (tile_data & Tile::WORLDMAP_EAST && dir == D_EAST) || diff --git a/src/worldmap/worldmap.hpp b/src/worldmap/worldmap.hpp index ba2eed6c9..4e5d43fc4 100644 --- a/src/worldmap/worldmap.hpp +++ b/src/worldmap/worldmap.hpp @@ -127,7 +127,7 @@ public: ~WorldMap(); void add_object(GameObject* object); - + void try_expose(GameObject* object); void try_unexpose(GameObject* object); @@ -145,13 +145,13 @@ public: Vector get_next_tile(Vector pos, Direction direction); /** - * gets a bitfield of Tile::WORLDMAP_NORTH | Tile::WORLDMAP_WEST | ... values, + * gets a bitfield of Tile::WORLDMAP_NORTH | Tile::WORLDMAP_WEST | ... values, * which indicates the directions Tux can move to when at the given position. */ int available_directions_at(Vector pos); /** - * returns a bitfield representing the union of all Tile::WORLDMAP_XXX values + * returns a bitfield representing the union of all Tile::WORLDMAP_XXX values * of all solid tiles at the given position */ int tile_data_at(Vector pos); -- 2.11.0