From 70fd1ef1e47747d377979c96c3bb0500519fd063 Mon Sep 17 00:00:00 2001 From: Mathnerd314 Date: Mon, 6 Oct 2008 02:19:19 +0000 Subject: [PATCH] Loads more include and header fixes along with eol-style for some files SVN-Revision: 5795 --- src/audio/dummy_sound_source.cpp | 1 + src/audio/dummy_sound_source.hpp | 2 +- src/audio/openal_sound_source.cpp | 1 + src/audio/openal_sound_source.hpp | 1 - src/audio/sound_source.hpp | 2 +- src/badguy/badguy.hpp | 2 - src/control/joystickkeyboardcontroller.cpp | 5 ++- src/control/joystickkeyboardcontroller.hpp | 10 ++++- src/game_session.cpp | 60 ++++++++++++------------------ src/gui/button.cpp | 4 +- src/gui/button.hpp | 6 ++- src/gui/mousecursor.cpp | 4 +- src/gui/mousecursor.hpp | 2 +- src/level.cpp | 20 ++++++---- src/level.hpp | 14 ++----- src/lisp/list_iterator.hpp | 4 +- src/video/drawing_context.cpp | 10 +---- src/video/drawing_context.hpp | 8 +--- src/video/drawing_request.hpp | 4 +- 19 files changed, 73 insertions(+), 87 deletions(-) diff --git a/src/audio/dummy_sound_source.cpp b/src/audio/dummy_sound_source.cpp index 1a9c274e0..40ccdfcb0 100644 --- a/src/audio/dummy_sound_source.cpp +++ b/src/audio/dummy_sound_source.cpp @@ -19,6 +19,7 @@ #include #include "dummy_sound_source.hpp" +#include "sound_source.hpp" class DummySoundSource : public SoundSource { diff --git a/src/audio/dummy_sound_source.hpp b/src/audio/dummy_sound_source.hpp index 458c1e834..9a17d619f 100644 --- a/src/audio/dummy_sound_source.hpp +++ b/src/audio/dummy_sound_source.hpp @@ -19,7 +19,7 @@ #ifndef __DUMMY_SOUND_SOURCE_HPP__ #define __DUMMY_SOUND_SOURCE_HPP__ -#include "sound_source.hpp" +class SoundSource; SoundSource* create_dummy_sound_source(); diff --git a/src/audio/openal_sound_source.cpp b/src/audio/openal_sound_source.cpp index 252cc6ee5..eb674efb1 100644 --- a/src/audio/openal_sound_source.cpp +++ b/src/audio/openal_sound_source.cpp @@ -20,6 +20,7 @@ #include "openal_sound_source.hpp" #include "sound_manager.hpp" +#include "math/vector.hpp" OpenALSoundSource::OpenALSoundSource() { diff --git a/src/audio/openal_sound_source.hpp b/src/audio/openal_sound_source.hpp index 4b03ed6d7..0d989ed73 100644 --- a/src/audio/openal_sound_source.hpp +++ b/src/audio/openal_sound_source.hpp @@ -25,7 +25,6 @@ #include #endif -#include "math/vector.hpp" #include "sound_source.hpp" class OpenALSoundSource : public SoundSource diff --git a/src/audio/sound_source.hpp b/src/audio/sound_source.hpp index 48c3f287a..a7356812f 100644 --- a/src/audio/sound_source.hpp +++ b/src/audio/sound_source.hpp @@ -19,7 +19,7 @@ #ifndef __SOUND_SOURCE_H__ #define __SOUND_SOURCE_H__ -#include "math/vector.hpp" +class Vector; /** * A sound source represents the source of audio output. You can place diff --git a/src/badguy/badguy.hpp b/src/badguy/badguy.hpp index 064d6c238..53ed624c0 100644 --- a/src/badguy/badguy.hpp +++ b/src/badguy/badguy.hpp @@ -27,11 +27,9 @@ #include "physic.hpp" #include "object/player.hpp" #include "serializable.hpp" -#include "resources.hpp" #include "sector.hpp" #include "direction.hpp" #include "object_factory.hpp" -#include "lisp/parser.hpp" #include "lisp/lisp.hpp" #include "lisp/writer.hpp" #include "video/drawing_context.hpp" diff --git a/src/control/joystickkeyboardcontroller.cpp b/src/control/joystickkeyboardcontroller.cpp index e3bba1be2..ee62b4a55 100644 --- a/src/control/joystickkeyboardcontroller.cpp +++ b/src/control/joystickkeyboardcontroller.cpp @@ -20,11 +20,14 @@ #include -#include #include "joystickkeyboardcontroller.hpp" + +#include + #include "log.hpp" #include "gui/menu.hpp" #include "gettext.hpp" +#include "lisp/writer.hpp" #include "lisp/lisp.hpp" #include "lisp/list_iterator.hpp" #include "game_session.hpp" diff --git a/src/control/joystickkeyboardcontroller.hpp b/src/control/joystickkeyboardcontroller.hpp index cd85533af..f989ea6f6 100644 --- a/src/control/joystickkeyboardcontroller.hpp +++ b/src/control/joystickkeyboardcontroller.hpp @@ -21,11 +21,17 @@ #define __JOYSTICKKEYBOARDCONTROLLER_H__ #include "controller.hpp" -#include "lisp/lisp.hpp" -#include "lisp/writer.hpp" + +namespace lisp { +class Writer; +class Lisp; +} + #include + #include #include +#include class Menu; diff --git a/src/game_session.cpp b/src/game_session.cpp index 45198c40b..a5f00763e 100644 --- a/src/game_session.cpp +++ b/src/game_session.cpp @@ -18,6 +18,8 @@ // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include +#include "game_session.hpp" + #include #include #include @@ -32,49 +34,32 @@ #include -#include "game_session.hpp" +#include "file_system.hpp" +#include "gameconfig.hpp" +#include "gettext.hpp" +#include "level.hpp" +#include "levelintro.hpp" #include "log.hpp" -#include "console.hpp" -#include "worldmap/worldmap.hpp" +#include "main.hpp" #include "mainloop.hpp" -#include "audio/sound_manager.hpp" -#include "gui/menu.hpp" -#include "sector.hpp" -#include "level.hpp" -#include "tile.hpp" #include "player_status.hpp" -#include "object/particlesystem.hpp" -#include "object/background.hpp" -#include "object/gradient.hpp" -#include "object/tilemap.hpp" -#include "object/camera.hpp" -#include "object/player.hpp" -#include "object/level_time.hpp" -#include "lisp/lisp.hpp" -#include "lisp/parser.hpp" -#include "resources.hpp" +#include "options_menu.hpp" +#include "random_generator.hpp" +#include "sector.hpp" #include "statistics.hpp" #include "timer.hpp" -#include "options_menu.hpp" -#include "textscroller.hpp" +#include "audio/sound_manager.hpp" #include "control/codecontroller.hpp" #include "control/joystickkeyboardcontroller.hpp" -#include "main.hpp" -#include "file_system.hpp" -#include "gameconfig.hpp" -#include "gettext.hpp" -#include "console.hpp" -#include "flip_level_transformer.hpp" -#include "trigger/secretarea_trigger.hpp" -#include "trigger/sequence_trigger.hpp" -#include "random_generator.hpp" -#include "scripting/squirrel_util.hpp" -#include "object/endsequence_walkright.hpp" -#include "object/endsequence_walkleft.hpp" +#include "gui/menu.hpp" +#include "object/camera.hpp" #include "object/endsequence_fireworks.hpp" -#include "direction.hpp" -#include "scripting/time_scheduler.hpp" -#include "levelintro.hpp" +#include "object/endsequence_walkleft.hpp" +#include "object/endsequence_walkright.hpp" +#include "object/level_time.hpp" +#include "object/player.hpp" +#include "scripting/squirrel_util.hpp" +#include "worldmap/worldmap.hpp" enum GameMenuIDs { MNID_CONTINUE, @@ -129,7 +114,7 @@ GameSession::restart_level() level->load(levelfile); level->stats.total_coins = level->get_total_coins(); level->stats.total_badguys = level->get_total_badguys(); - level->stats.total_secrets = level->get_total_count(); + level->stats.total_secrets = level->get_total_secrets(); level->stats.reset(); if(reset_sector != "") { @@ -477,6 +462,9 @@ GameSession::update(float elapsed_time) sector->activate(newspawnpoint); sector->play_music(LEVEL_MUSIC); currentsector = sector; + //Keep persistent across sectors + if(edit_mode) + currentsector->get_players()[0]->set_edit_mode(edit_mode); newsector = ""; newspawnpoint = ""; } diff --git a/src/gui/button.cpp b/src/gui/button.cpp index b41b1cb17..6288665f3 100644 --- a/src/gui/button.cpp +++ b/src/gui/button.cpp @@ -19,14 +19,16 @@ #include +#include "button.hpp" + #include #include #include "main.hpp" -#include "button.hpp" #include "mousecursor.hpp" #include "video/font.hpp" #include "video/surface.hpp" +#include "video/drawing_context.hpp" Font* Button::info_font = 0; extern SDL_Surface* screen; diff --git a/src/gui/button.hpp b/src/gui/button.hpp index b81f51dbf..649187378 100644 --- a/src/gui/button.hpp +++ b/src/gui/button.hpp @@ -23,11 +23,13 @@ #include #include +#include "SDL.h" + #include "math/vector.hpp" -#include "video/drawing_context.hpp" class Surface; - +class DrawingContext; +class Font; class ButtonGroup; enum { diff --git a/src/gui/mousecursor.cpp b/src/gui/mousecursor.cpp index ba2da7742..3a8732161 100644 --- a/src/gui/mousecursor.cpp +++ b/src/gui/mousecursor.cpp @@ -19,11 +19,13 @@ #include +#include "gui/mousecursor.hpp" + #include #include +#include "video/surface.hpp" #include "video/drawing_context.hpp" -#include "gui/mousecursor.hpp" #include "main.hpp" MouseCursor* MouseCursor::current_ = 0; diff --git a/src/gui/mousecursor.hpp b/src/gui/mousecursor.hpp index b3cb53b4b..797fe6c5a 100644 --- a/src/gui/mousecursor.hpp +++ b/src/gui/mousecursor.hpp @@ -22,7 +22,7 @@ #include -#include "video/surface.hpp" +class Surface; #define MC_STATES_NB 3 diff --git a/src/level.cpp b/src/level.cpp index 78d4a1a6c..33c7c2523 100644 --- a/src/level.cpp +++ b/src/level.cpp @@ -19,6 +19,8 @@ // 02111-1307, USA. #include +#include "level.hpp" + #include #include #include @@ -34,19 +36,12 @@ #include "lisp/lisp.hpp" #include "lisp/list_iterator.hpp" #include "lisp/writer.hpp" -#include "level.hpp" -#include "physic.hpp" #include "sector.hpp" -#include "tile.hpp" #include "tile_set.hpp" #include "tile_manager.hpp" -#include "resources.hpp" -#include "file_system.hpp" -#include "object/gameobjs.hpp" -#include "object/camera.hpp" -#include "object/tilemap.hpp" #include "object/coin.hpp" #include "object/block.hpp" +#include "trigger/secretarea_trigger.hpp" using namespace std; @@ -266,3 +261,12 @@ Level::get_total_badguys() total_badguys += (*i)->get_total_badguys(); return total_badguys; } + +int +Level::get_total_secrets() +{ + int total_secrets = 0; + for(Sectors::iterator i = sectors.begin(); i != sectors.end(); ++i) + total_secrets += (*i)->get_total_count(); + return total_secrets; +} diff --git a/src/level.hpp b/src/level.hpp index 889f8f343..208b64a24 100644 --- a/src/level.hpp +++ b/src/level.hpp @@ -23,14 +23,15 @@ #include #include + #include "statistics.hpp" -#include "sector.hpp" namespace lisp { class Lisp; } class TileSet; +class Sector; /** * Represents a collection of Sectors running in a single GameSession. @@ -79,16 +80,7 @@ public: int get_total_coins(); int get_total_badguys(); - - /** Get total number of GameObjects of given type */ - template int get_total_count() - { - int total = 0; - for(Sectors::iterator i = sectors.begin(); i != sectors.end(); ++i) { - total += (*i)->get_total_count(); - } - return total; - } + int get_total_secrets(); private: void load_old_format(const lisp::Lisp& reader); diff --git a/src/lisp/list_iterator.hpp b/src/lisp/list_iterator.hpp index 0cb5b54b9..bb9fe0366 100644 --- a/src/lisp/list_iterator.hpp +++ b/src/lisp/list_iterator.hpp @@ -20,7 +20,9 @@ #ifndef __LISP_ITERATOR_H__ #define __LISP_ITERATOR_H__ -#include "lisp/lisp.hpp" +#include + +#include "lisp.hpp" namespace lisp { diff --git a/src/video/drawing_context.cpp b/src/video/drawing_context.cpp index 88e288b00..613a3de86 100644 --- a/src/video/drawing_context.cpp +++ b/src/video/drawing_context.cpp @@ -18,16 +18,8 @@ // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include -#include -#include -#include -#include -#include -#include -#include -#include - #include "drawing_context.hpp" + #include "drawing_request.hpp" #include "video_systems.hpp" #include "renderer.hpp" diff --git a/src/video/drawing_context.hpp b/src/video/drawing_context.hpp index 0e24d3a3a..5f392ef0e 100644 --- a/src/video/drawing_context.hpp +++ b/src/video/drawing_context.hpp @@ -25,19 +25,15 @@ #include -#include - -#include "glutil.hpp" #include "obstack/obstack.h" #include "math/vector.hpp" #include "math/rect.hpp" -#include "drawing_request.hpp" -#include "font.hpp" #include "color.hpp" +#include "font.hpp" +#include "drawing_request.hpp" class Surface; class Texture; -struct DrawingRequest; class Renderer; class Lightmap; diff --git a/src/video/drawing_request.hpp b/src/video/drawing_request.hpp index 581438a47..725a346b9 100644 --- a/src/video/drawing_request.hpp +++ b/src/video/drawing_request.hpp @@ -25,12 +25,10 @@ #include -#include - #include "glutil.hpp" -#include "math/vector.hpp" #include "color.hpp" #include "font.hpp" +#include "math/vector.hpp" class Surface; -- 2.11.0