From 2f08ad347042a310b359420ebc6d161d1ddccedf Mon Sep 17 00:00:00 2001 From: b_lindeijer Date: Sat, 12 Aug 2006 01:26:54 +0000 Subject: [PATCH] Each module now includes its own header first. Removed sstream.h and the definition of max. --- ChangeLog | 10 +++++++++- src/ActionRecorder.cxx | 4 +++- src/ActionRecorder.h | 2 +- src/Attack.cxx | 4 ++-- src/Block.cxx | 3 ++- src/BlockManager.cxx | 2 +- src/CelebrationManager.cxx | 3 ++- src/Clock.cxx | 3 ++- src/ComboManager.cxx | 3 ++- src/ComboTabulator.cxx | 3 ++- src/Communicator.cxx | 3 ++- src/Communicator.h | 2 +- src/ComputerPlayer.cxx | 3 ++- src/ComputerPlayerAI.cxx | 2 ++ src/Controller.cxx | 3 ++- src/Controller.h | 1 - src/CountDownManager.cxx | 3 ++- src/Creep.cxx | 3 ++- src/Displayer.cxx | 6 +++--- src/DrawBlocks.cxx | 1 - src/DrawCandy.cxx | 1 - src/DrawCountDown.cxx | 1 - src/DrawExternalCandy.cxx | 1 - src/DrawGarbage.cxx | 2 -- src/DrawLevelLights.cxx | 1 - src/DrawMessages.cxx | 1 - src/DrawScoreRecord.cxx | 1 - src/DrawSwapper.cxx | 1 - src/DrawWinRecord.cxx | 1 - src/Game.cxx | 4 ++-- src/Game.h | 5 ----- src/Garbage.cxx | 3 ++- src/GarbageFlavorImage.cxx | 7 +++---- src/GarbageGenerator.cxx | 4 ++-- src/GarbageManager.cxx | 2 +- src/GarbageQueue.cxx | 1 + src/Grid.cxx | 2 +- src/LevelLights.cxx | 2 +- src/LightManager.cxx | 4 ++-- src/LoseBar.cxx | 4 ++-- src/LoseBar.h | 3 ++- src/MessageManager.cxx | 2 -- src/MessageManager.h | 1 - src/MetaState.cxx | 4 ++-- src/Music.cxx | 3 ++- src/OBJModel.cxx | 7 +++---- src/Random.cxx | 6 +++--- src/Score.cxx | 3 ++- src/ScoreRecordManager.cxx | 2 +- src/SignManager.cxx | 2 +- src/Sine.cxx | 3 ++- src/Sound.cxx | 4 +++- src/SparkleManager.cxx | 2 +- src/Spring.cxx | 2 -- src/String.cxx | 4 ++-- src/Swapper.cxx | 2 +- src/TextureLoader.cxx | 3 ++- src/TextureLoader.h | 2 +- src/WinRecord.cxx | 4 ++-- src/X.cxx | 2 +- src/obj_clock.cxx | 1 - src/obj_external_candy.cxx | 1 - src/obj_garbage.cxx | 7 +++---- src/obj_garbage_small.cxx | 1 - src/obj_garbage_thick_corner.cxx | 1 - src/obj_garbage_thick_edge.cxx | 1 - src/obj_garbage_thick_middle.cxx | 1 - src/obj_garbage_thin_cap.cxx | 1 - src/obj_garbage_thin_middle.cxx | 1 - src/obj_level_lights.cxx | 1 - src/obj_messages.cxx | 3 +-- src/obj_name.cxx | 1 - src/obj_score_record.cxx | 3 +-- src/obj_sign.cxx | 6 +++--- src/obj_sparkle.cxx | 1 - src/obj_swapper.cxx | 1 - src/sstream.h | 36 ------------------------------------ 77 files changed, 98 insertions(+), 142 deletions(-) delete mode 100644 src/sstream.h diff --git a/ChangeLog b/ChangeLog index 2931c83..dea8e4b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,5 +5,13 @@ is already being cleaned up automatically once the program exists. * src/Makefile.am, src/gtk-gui/Makefile.am: Removed linking with the Xmu library, since we don't seem to use it anywhere. - * src/*: Cleaned up most occurances of "using namespace std;". + * src/*: Cleaned up most occurances of "using namespace std;". Also + made sure that each module includes its own header first, in order to + ensure that no header silently depends on another header to be + included first. + * src/Game.h: Removed definition of max since it conflicts with the + definition of std::max. + * src/sstream.h: Removed this file since it was only solving a + compatibility issue for old versions of MSVC. Modern compilers should + support the sstream header fine. diff --git a/src/ActionRecorder.cxx b/src/ActionRecorder.cxx index 9cef91e..56a89a6 100644 --- a/src/ActionRecorder.cxx +++ b/src/ActionRecorder.cxx @@ -20,10 +20,12 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include "ActionRecorder.h" + #include + #include "TextureLoader.h" -#include "ActionRecorder.h" std::vector ActionRecorder::actions; diff --git a/src/ActionRecorder.h b/src/ActionRecorder.h index 3a4f146..a9742c8 100644 --- a/src/ActionRecorder.h +++ b/src/ActionRecorder.h @@ -56,4 +56,4 @@ private: static std::vector actions; }; -#endif +#endif diff --git a/src/Attack.cxx b/src/Attack.cxx index 45e423d..a1f6692 100644 --- a/src/Attack.cxx +++ b/src/Attack.cxx @@ -24,6 +24,8 @@ * Columbus, OH 43210 */ +#include "Attack.h" + #include #include #include @@ -37,9 +39,7 @@ # endif #endif - #include "TextureLoader.h" -#include "Attack.h" #include "Communicator.h" #include "MetaState.h" #include "Random.h" diff --git a/src/Block.cxx b/src/Block.cxx index f2718f9..b96a032 100644 --- a/src/Block.cxx +++ b/src/Block.cxx @@ -25,8 +25,9 @@ * The block object, of which each block is one. */ -#include "Game.h" #include "Block.h" + +#include "Game.h" #include "BlockManager.h" #include "ComboTabulator.h" #include "Garbage.h" diff --git a/src/BlockManager.cxx b/src/BlockManager.cxx index b65e31b..01fb4fb 100644 --- a/src/BlockManager.cxx +++ b/src/BlockManager.cxx @@ -25,9 +25,9 @@ * Allocates and frees blocks. */ +#include "BlockManager.h" #include "Game.h" -#include "BlockManager.h" #include "ComboTabulator.h" #include "Random.h" #include "X.h" diff --git a/src/CelebrationManager.cxx b/src/CelebrationManager.cxx index 6f48bf4..77395cf 100644 --- a/src/CelebrationManager.cxx +++ b/src/CelebrationManager.cxx @@ -25,10 +25,11 @@ * Handles the celebration after a game. */ +#include "CelebrationManager.h" + #include "Game.h" #include "MetaState.h" #include "Displayer.h" -#include "CelebrationManager.h" #include "SparkleManager.h" #include "MessageManager.h" #include "WinRecord.h" diff --git a/src/Clock.cxx b/src/Clock.cxx index e5f13f0..2fe9036 100644 --- a/src/Clock.cxx +++ b/src/Clock.cxx @@ -25,8 +25,9 @@ * Handles the timer state. */ -#include "Game.h" #include "Clock.h" + +#include "Game.h" #include "WinRecord.h" diff --git a/src/ComboManager.cxx b/src/ComboManager.cxx index 9c71e6d..69057f4 100644 --- a/src/ComboManager.cxx +++ b/src/ComboManager.cxx @@ -26,8 +26,9 @@ * blocks. Handles the combo tabulator free store. */ -#include "Game.h" #include "ComboManager.h" + +#include "Game.h" #include "ComboTabulator.h" #include "GarbageGenerator.h" #include "Score.h" diff --git a/src/ComboTabulator.cxx b/src/ComboTabulator.cxx index 42ef477..979f79c 100644 --- a/src/ComboTabulator.cxx +++ b/src/ComboTabulator.cxx @@ -25,10 +25,11 @@ * Each one keeps track of a set of or potential set of elimination combos. */ +#include "ComboTabulator.h" + #include "Game.h" #include "Block.h" #include "GarbageGenerator.h" -#include "ComboTabulator.h" #include "SparkleManager.h" #include "SignManager.h" #include "BlockManager.h" diff --git a/src/Communicator.cxx b/src/Communicator.cxx index 93fe9fb..0854a6b 100644 --- a/src/Communicator.cxx +++ b/src/Communicator.cxx @@ -27,6 +27,8 @@ * integers on various systems. */ +#include "Communicator.h" + #include #include #include @@ -45,7 +47,6 @@ #endif #include "Game.h" -#include "Communicator.h" #include "Displayer.h" #include "GarbageGenerator.h" #include "GarbageFlavorImage.h" diff --git a/src/Communicator.h b/src/Communicator.h index 0060409..417f5ba 100644 --- a/src/Communicator.h +++ b/src/Communicator.h @@ -28,7 +28,7 @@ //#include -//#include "Game.h" +#include "Game.h" #include "enet/enet.h" // default communication port diff --git a/src/ComputerPlayer.cxx b/src/ComputerPlayer.cxx index ec55395..d8552bb 100644 --- a/src/ComputerPlayer.cxx +++ b/src/ComputerPlayer.cxx @@ -19,9 +19,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include "ComputerPlayer.h" + #include #include "LevelLights.h" -#include "ComputerPlayer.h" #include "Score.h" diff --git a/src/ComputerPlayerAI.cxx b/src/ComputerPlayerAI.cxx index 3d6b161..7013d7e 100644 --- a/src/ComputerPlayerAI.cxx +++ b/src/ComputerPlayerAI.cxx @@ -19,7 +19,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "ComputerPlayerAI.h" + #include "Score.h" #include "Garbage.h" #include "GarbageGenerator.h" diff --git a/src/Controller.cxx b/src/Controller.cxx index c3f55f5..525f474 100644 --- a/src/Controller.cxx +++ b/src/Controller.cxx @@ -25,13 +25,14 @@ * Keeps track of the button pressing. */ +#include "Controller.h" + #include #include #include "glext.h" #include "Game.h" -#include "Controller.h" #include "ActionRecorder.h" #include "MetaState.h" #include "Grid.h" diff --git a/src/Controller.h b/src/Controller.h index 4a16cc6..4ad76c7 100644 --- a/src/Controller.h +++ b/src/Controller.h @@ -26,7 +26,6 @@ #ifndef CONTORLLER_H #define CONTORLLER_H - #define CC_LEFT (1 << 0) #define CC_RIGHT (1 << 1) #define CC_UP (1 << 2) diff --git a/src/CountDownManager.cxx b/src/CountDownManager.cxx index 8a54412..898fb8f 100644 --- a/src/CountDownManager.cxx +++ b/src/CountDownManager.cxx @@ -25,8 +25,9 @@ * Very simple, but I need somewhere to put this code. */ -#include "Game.h" #include "CountDownManager.h" + +#include "Game.h" #include "MessageManager.h" #include "Displayer.h" #ifdef AUDIO_ENABLED diff --git a/src/Creep.cxx b/src/Creep.cxx index 74b99e5..100132a 100644 --- a/src/Creep.cxx +++ b/src/Creep.cxx @@ -29,8 +29,9 @@ * worth the extra dereference we'd have to do each time we access the grid? */ -#include "Game.h" #include "Creep.h" + +#include "Game.h" #include "Grid.h" #include "BlockManager.h" #include "Controller.h" diff --git a/src/Displayer.cxx b/src/Displayer.cxx index c3e3e5a..3ce882c 100644 --- a/src/Displayer.cxx +++ b/src/Displayer.cxx @@ -26,6 +26,8 @@ * Handles all the prettyness; or uglyness, as it now stands. */ +#include "Displayer.h" + #include #include #include @@ -35,15 +37,13 @@ #ifdef DEVELOPMENT #include -#include "sstream.h" +#include #endif #include - #include "TextureLoader.h" #include "Game.h" -#include "Displayer.h" #include "CelebrationManager.h" #include "GarbageFlavorImage.h" #include "SignManager.h" diff --git a/src/DrawBlocks.cxx b/src/DrawBlocks.cxx index e4e9971..362f3dc 100644 --- a/src/DrawBlocks.cxx +++ b/src/DrawBlocks.cxx @@ -30,7 +30,6 @@ #include "glext.h" - #include "Game.h" #include "Displayer.h" #include "Creep.h" diff --git a/src/DrawCandy.cxx b/src/DrawCandy.cxx index 0a31151..4fc6800 100644 --- a/src/DrawCandy.cxx +++ b/src/DrawCandy.cxx @@ -29,7 +29,6 @@ #include "glext.h" - #include "Game.h" #include "Displayer.h" #include "SparkleManager.h" diff --git a/src/DrawCountDown.cxx b/src/DrawCountDown.cxx index c251739..6554b85 100644 --- a/src/DrawCountDown.cxx +++ b/src/DrawCountDown.cxx @@ -29,7 +29,6 @@ #include "glext.h" - #include "Game.h" #include "Displayer.h" #include "CountDownManager.h" diff --git a/src/DrawExternalCandy.cxx b/src/DrawExternalCandy.cxx index 87eee13..41787e9 100644 --- a/src/DrawExternalCandy.cxx +++ b/src/DrawExternalCandy.cxx @@ -29,7 +29,6 @@ #include "glext.h" - #include "Game.h" #include "Displayer.h" #include "MetaState.h" diff --git a/src/DrawGarbage.cxx b/src/DrawGarbage.cxx index e0d9037..c405d96 100644 --- a/src/DrawGarbage.cxx +++ b/src/DrawGarbage.cxx @@ -29,11 +29,9 @@ #define GL_GLEXT_PROTOTYPES #include -#include #include "glext.h" - #include "Game.h" #include "Block.h" #include "Creep.h" diff --git a/src/DrawLevelLights.cxx b/src/DrawLevelLights.cxx index 60fb162..23e35b1 100644 --- a/src/DrawLevelLights.cxx +++ b/src/DrawLevelLights.cxx @@ -29,7 +29,6 @@ #include "glext.h" - #include "Game.h" #include "Displayer.h" #include "LevelLights.h" diff --git a/src/DrawMessages.cxx b/src/DrawMessages.cxx index db53b42..360406d 100644 --- a/src/DrawMessages.cxx +++ b/src/DrawMessages.cxx @@ -29,7 +29,6 @@ #include "glext.h" - #include "Game.h" #include "Displayer.h" #include "Communicator.h" diff --git a/src/DrawScoreRecord.cxx b/src/DrawScoreRecord.cxx index 2147b9c..d5f37e9 100644 --- a/src/DrawScoreRecord.cxx +++ b/src/DrawScoreRecord.cxx @@ -29,7 +29,6 @@ #include "glext.h" - #include "Game.h" #include "Displayer.h" #include "ScoreRecordManager.h" diff --git a/src/DrawSwapper.cxx b/src/DrawSwapper.cxx index e314569..3d62fc5 100644 --- a/src/DrawSwapper.cxx +++ b/src/DrawSwapper.cxx @@ -29,7 +29,6 @@ #include "glext.h" - #include "Game.h" #include "Displayer.h" #include "Swapper.h" diff --git a/src/DrawWinRecord.cxx b/src/DrawWinRecord.cxx index f141a3b..5318a99 100644 --- a/src/DrawWinRecord.cxx +++ b/src/DrawWinRecord.cxx @@ -29,7 +29,6 @@ #include "glext.h" - #include "Game.h" #include "Displayer.h" #include "WinRecord.h" diff --git a/src/Game.cxx b/src/Game.cxx index 0b6239b..1b6618f 100644 --- a/src/Game.cxx +++ b/src/Game.cxx @@ -26,6 +26,8 @@ * Remove dying_count_2. */ +#include "Game.h" + #include #include "glext.h" @@ -34,8 +36,6 @@ #include - -#include "Game.h" #include "BlockManager.h" #include "CelebrationManager.h" #include "Clock.h" diff --git a/src/Game.h b/src/Game.h index 267078a..d313c5d 100644 --- a/src/Game.h +++ b/src/Game.h @@ -268,11 +268,6 @@ #define GC_RESOLUTION_3 (970) #define GC_RESOLUTION_4 (1170) -// other crap -#ifndef max -# define max(a, b) ((a) > (b) ? (a) : (b)) -#endif - // insure that our communication int is the same length on all machines #if (INT_MAX == 2147483647) typedef unsigned int uint32; diff --git a/src/Garbage.cxx b/src/Garbage.cxx index 8f3ba64..687a64d 100644 --- a/src/Garbage.cxx +++ b/src/Garbage.cxx @@ -25,9 +25,10 @@ * The garbage blocks is what this details. */ +#include "Garbage.h" + #include "Game.h" #include "Grid.h" -#include "Garbage.h" #include "BlockManager.h" #include "GarbageManager.h" #include "Displayer.h" diff --git a/src/GarbageFlavorImage.cxx b/src/GarbageFlavorImage.cxx index 69e6dfa..e821b55 100644 --- a/src/GarbageFlavorImage.cxx +++ b/src/GarbageFlavorImage.cxx @@ -26,15 +26,14 @@ * Handles the the garbage flavor image. */ -#include - -#include "sstream.h" +#include "GarbageFlavorImage.h" +#include +#include #include "TextureLoader.h" #include "Game.h" #include "Displayer.h" -#include "GarbageFlavorImage.h" #include "Random.h" int GarbageFlavorImage::current_texture; diff --git a/src/GarbageGenerator.cxx b/src/GarbageGenerator.cxx index bd3bae9..874a0e3 100644 --- a/src/GarbageGenerator.cxx +++ b/src/GarbageGenerator.cxx @@ -25,11 +25,11 @@ * Displays and sends garbage to the opponent. */ -#include +#include "GarbageGenerator.h" +#include #include "Game.h" -#include "GarbageGenerator.h" #include "Block.h" #include "BlockManager.h" #include "Garbage.h" diff --git a/src/GarbageManager.cxx b/src/GarbageManager.cxx index a68f374..607af54 100644 --- a/src/GarbageManager.cxx +++ b/src/GarbageManager.cxx @@ -25,9 +25,9 @@ * Allocates and frees blocks. */ +#include "GarbageManager.h" #include "Game.h" -#include "GarbageManager.h" #include "Grid.h" #include "Random.h" diff --git a/src/GarbageQueue.cxx b/src/GarbageQueue.cxx index 7c64640..eaf4fc7 100644 --- a/src/GarbageQueue.cxx +++ b/src/GarbageQueue.cxx @@ -21,6 +21,7 @@ */ #include "GarbageQueue.h" + #include "GarbageGenerator.h" #include "GarbageManager.h" diff --git a/src/Grid.cxx b/src/Grid.cxx index e2a5a76..f75592e 100644 --- a/src/Grid.cxx +++ b/src/Grid.cxx @@ -25,9 +25,9 @@ * Holds a map of the play area and also deals with elimination checks. */ +#include "Grid.h" #include "Game.h" -#include "Grid.h" #include "Garbage.h" #include "ComboManager.h" #include "LevelLights.h" diff --git a/src/LevelLights.cxx b/src/LevelLights.cxx index 7ce91c9..a210caa 100644 --- a/src/LevelLights.cxx +++ b/src/LevelLights.cxx @@ -25,9 +25,9 @@ * Handles the level lights' states. */ +#include "LevelLights.h" #include "Game.h" -#include "LevelLights.h" #include "Grid.h" #include "Communicator.h" #include "MetaState.h" diff --git a/src/LightManager.cxx b/src/LightManager.cxx index ef3dd03..18549e7 100644 --- a/src/LightManager.cxx +++ b/src/LightManager.cxx @@ -25,13 +25,13 @@ * Handles turning on and off the required lights during drawing. */ +#include "LightManager.h" + #include #include "glext.h" - #include "Game.h" #include "Displayer.h" -#include "LightManager.h" #include "SparkleManager.h" #include "CountDownManager.h" #include "CelebrationManager.h" diff --git a/src/LoseBar.cxx b/src/LoseBar.cxx index ba8297a..9846e50 100644 --- a/src/LoseBar.cxx +++ b/src/LoseBar.cxx @@ -25,15 +25,15 @@ * Handles the losebar. */ +#include "LoseBar.h" + #include #include "glext.h" - #include "Game.h" #include "Creep.h" #include "Displayer.h" -#include "LoseBar.h" GLfloat LoseBar::bar; int LoseBar::fade_timer; diff --git a/src/LoseBar.h b/src/LoseBar.h index db6f0d3..0dba698 100644 --- a/src/LoseBar.h +++ b/src/LoseBar.h @@ -26,8 +26,9 @@ #ifndef LOSEBAR_H #define LOSEBAR_H -#include +#include "Displayer.h" +#include #define LB_INACTIVE (1 << 0) #define LB_LOW_ALERT (1 << 1) diff --git a/src/MessageManager.cxx b/src/MessageManager.cxx index 7c5d98a..a5f7768 100644 --- a/src/MessageManager.cxx +++ b/src/MessageManager.cxx @@ -25,8 +25,6 @@ * Not too much to this guy. */ - -#include "Game.h" #include "MessageManager.h" int MessageManager::message_shape; diff --git a/src/MessageManager.h b/src/MessageManager.h index 8386689..fa91ac0 100644 --- a/src/MessageManager.h +++ b/src/MessageManager.h @@ -26,7 +26,6 @@ #ifndef MESSAGEMANAGER_H #define MESSAGEMANAGER_H - #include "Displayer.h" // message shapes diff --git a/src/MetaState.cxx b/src/MetaState.cxx index 26967bd..d96b403 100644 --- a/src/MetaState.cxx +++ b/src/MetaState.cxx @@ -26,14 +26,14 @@ * Handles the program's state and transfers between them. */ +#include "MetaState.h" + #include #include #include "glext.h" - #include "Game.h" -#include "MetaState.h" #include "Displayer.h" #include "CelebrationManager.h" #include "Controller.h" diff --git a/src/Music.cxx b/src/Music.cxx index 7e4baa7..3f0d8ce 100644 --- a/src/Music.cxx +++ b/src/Music.cxx @@ -25,10 +25,11 @@ * Miguel Ángel Vilela García - www.miguev.net */ +#include "Music.h" + #include "TextureLoader.h" #include "Random.h" #include "Sound.h" -#include "Music.h" Mix_Music *music = NULL; int music_available = 0; diff --git a/src/OBJModel.cxx b/src/OBJModel.cxx index dcd7c80..bae7edd 100644 --- a/src/OBJModel.cxx +++ b/src/OBJModel.cxx @@ -15,16 +15,15 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * $Id: OBJModel.cxx,v 1.1 2006/07/19 01:56:21 lorien420 Exp $ + * $Id: OBJModel.cxx,v 1.2 2006/08/12 01:26:55 b_lindeijer Exp $ */ +#include "OBJModel.h" + #include #include -#include #include -#include "OBJModel.h" - using namespace std; static void stripNewline(char *str) diff --git a/src/Random.cxx b/src/Random.cxx index fb5e272..796649e 100644 --- a/src/Random.cxx +++ b/src/Random.cxx @@ -25,13 +25,13 @@ * Handles all the random number tables. */ -#include +#include "Random.h" +#include +#include #include "Game.h" -#include "Random.h" -#include Angle Random::angle_table[GC_SIZE_RANDOM_ANGLE_TABLE]; Angle Random::angle_death_spark_table[GC_SIZE_RANDOM_ANGLE_TABLE]; diff --git a/src/Score.cxx b/src/Score.cxx index 3636cc2..6d2e600 100644 --- a/src/Score.cxx +++ b/src/Score.cxx @@ -26,13 +26,14 @@ * Handles the score for solo games. */ +#include "Score.h" + #include #include #include "TextureLoader.h" #include "Game.h" #include "MetaState.h" -#include "Score.h" using namespace std; diff --git a/src/ScoreRecordManager.cxx b/src/ScoreRecordManager.cxx index cff41c7..de89c45 100644 --- a/src/ScoreRecordManager.cxx +++ b/src/ScoreRecordManager.cxx @@ -25,6 +25,7 @@ * Handles the complexities of displaying the score record. */ +#include "ScoreRecordManager.h" #include "Game.h" #include "Displayer.h" @@ -32,7 +33,6 @@ #include "WinRecord.h" #include "Score.h" #include "Controller.h" -#include "ScoreRecordManager.h" int ScoreRecordManager::top_rank; int ScoreRecordManager::top_texture; diff --git a/src/SignManager.cxx b/src/SignManager.cxx index a5ddf64..8ca26ae 100644 --- a/src/SignManager.cxx +++ b/src/SignManager.cxx @@ -25,9 +25,9 @@ * Handles all the little reward signs. */ +#include "SignManager.h" #include "Game.h" -#include "SignManager.h" #include "Random.h" int SignManager::sign_count; diff --git a/src/Sine.cxx b/src/Sine.cxx index e47d547..bc61a2c 100644 --- a/src/Sine.cxx +++ b/src/Sine.cxx @@ -25,9 +25,10 @@ * Approximates sin(x) with a table and interpolation. */ +#include "Sine.h" + #include "Game.h" #include "MetaState.h" -#include "Sine.h" float Sine::table[GC_SINE_TABLE_LENGTH]; diff --git a/src/Sound.cxx b/src/Sound.cxx index a2e9656..f1dd1dd 100644 --- a/src/Sound.cxx +++ b/src/Sound.cxx @@ -25,9 +25,11 @@ * Miguel Ángel Vilela García - www.miguev.net */ +#include "Sound.h" + #include "TextureLoader.h" #include "Random.h" -#include "Sound.h" + #include #include diff --git a/src/SparkleManager.cxx b/src/SparkleManager.cxx index ea0ad0d..92c5916 100644 --- a/src/SparkleManager.cxx +++ b/src/SparkleManager.cxx @@ -25,12 +25,12 @@ * Handles all the pretty sparkles! */ +#include "SparkleManager.h" #include "Game.h" #include "Displayer.h" #include "MetaState.h" #include "Random.h" -#include "SparkleManager.h" int SparkleManager::spark_count; Spark SparkleManager::sparks[DC_MAX_SPARK_NUMBER]; diff --git a/src/Spring.cxx b/src/Spring.cxx index ea3f8ea..8f88d7e 100644 --- a/src/Spring.cxx +++ b/src/Spring.cxx @@ -25,8 +25,6 @@ * Handles the garbage block impacts. */ - -#include "Game.h" #include "Spring.h" float Spring::y; diff --git a/src/String.cxx b/src/String.cxx index 2b67741..26e696c 100644 --- a/src/String.cxx +++ b/src/String.cxx @@ -26,17 +26,17 @@ * Holds string display utilities. */ +#include "String.h" + #include #include #include #include "glext.h" - #include "TextureLoader.h" #include "Game.h" #include "Displayer.h" -#include "String.h" const char *String::letter_texture_files[DC_FONT_NUMBER][DC_LETTER_NUMBER] = { { GC_DATA_DIRECTORY("font0_0.tga"), diff --git a/src/Swapper.cxx b/src/Swapper.cxx index d83a5b3..44ecc87 100644 --- a/src/Swapper.cxx +++ b/src/Swapper.cxx @@ -25,9 +25,9 @@ * The thingy you swap blocks with. */ +#include "Swapper.h" #include "Game.h" -#include "Swapper.h" #include "Grid.h" #include "Block.h" #include "Controller.h" diff --git a/src/TextureLoader.cxx b/src/TextureLoader.cxx index a5bed03..e62c11b 100644 --- a/src/TextureLoader.cxx +++ b/src/TextureLoader.cxx @@ -26,6 +26,8 @@ * Loads textures from uncompressed TGA files. */ +#include "TextureLoader.h" + #include #include #include @@ -38,7 +40,6 @@ #include "glext.h" -#include "TextureLoader.h" #include "Game.h" using namespace std; diff --git a/src/TextureLoader.h b/src/TextureLoader.h index 096358e..712b382 100644 --- a/src/TextureLoader.h +++ b/src/TextureLoader.h @@ -30,7 +30,7 @@ #include #include "glext.h" -#include "sstream.h" +#include #include "Game.h" diff --git a/src/WinRecord.cxx b/src/WinRecord.cxx index 101c9ff..e304211 100644 --- a/src/WinRecord.cxx +++ b/src/WinRecord.cxx @@ -25,13 +25,13 @@ * Handles the win/loss record. */ +#include "WinRecord.h" + #include #include "glext.h" - #include "Game.h" -#include "WinRecord.h" #include "Displayer.h" #include "Random.h" diff --git a/src/X.cxx b/src/X.cxx index 7f19557..5fe9f3d 100644 --- a/src/X.cxx +++ b/src/X.cxx @@ -25,12 +25,12 @@ * Holds the X-treme state. */ +#include "X.h" #include "Game.h" #include "Grid.h" #include "Block.h" #include "Swapper.h" -#include "X.h" int X::reverse_controls; int X::invisible_swapper; diff --git a/src/obj_clock.cxx b/src/obj_clock.cxx index 335bdb9..e9e5476 100644 --- a/src/obj_clock.cxx +++ b/src/obj_clock.cxx @@ -30,7 +30,6 @@ #include "glext.h" - #include "TextureLoader.h" #include "Game.h" #include "Displayer.h" diff --git a/src/obj_external_candy.cxx b/src/obj_external_candy.cxx index 829b139..5bcf127 100644 --- a/src/obj_external_candy.cxx +++ b/src/obj_external_candy.cxx @@ -30,7 +30,6 @@ #include "glext.h" - #include "TextureLoader.h" #include "Game.h" #include "Displayer.h" diff --git a/src/obj_garbage.cxx b/src/obj_garbage.cxx index b4a4e25..437b241 100644 --- a/src/obj_garbage.cxx +++ b/src/obj_garbage.cxx @@ -34,7 +34,6 @@ #include "glext.h" - #include "TextureLoader.h" #include "Game.h" #include "Displayer.h" @@ -243,10 +242,10 @@ void Displayer::generateGarbageExtras ( ) if (Displayer::state & DS_MULTITEXTURING) { glActiveTextureARB(GL_TEXTURE1_ARB); - + glBindTexture(GL_TEXTURE_2D, garbage_lightmap); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); - + glActiveTextureARB(GL_TEXTURE0_ARB); glNewList(garbage_flavor_list, GL_COMPILE); @@ -292,7 +291,7 @@ void Displayer::generateGarbageExtras ( ) } glDrawArrays(GL_TRIANGLE_STRIP, 0, 6); - + glEndList(); #ifndef NO_MULTITEXTURING } diff --git a/src/obj_garbage_small.cxx b/src/obj_garbage_small.cxx index 63958f1..aba199b 100644 --- a/src/obj_garbage_small.cxx +++ b/src/obj_garbage_small.cxx @@ -29,7 +29,6 @@ #include "glext.h" - #include "Game.h" #include "Displayer.h" diff --git a/src/obj_garbage_thick_corner.cxx b/src/obj_garbage_thick_corner.cxx index 7ed6e1c..201e924 100644 --- a/src/obj_garbage_thick_corner.cxx +++ b/src/obj_garbage_thick_corner.cxx @@ -29,7 +29,6 @@ #include "glext.h" - #include "Game.h" #include "Displayer.h" diff --git a/src/obj_garbage_thick_edge.cxx b/src/obj_garbage_thick_edge.cxx index aff2434..237ed86 100644 --- a/src/obj_garbage_thick_edge.cxx +++ b/src/obj_garbage_thick_edge.cxx @@ -29,7 +29,6 @@ #include "glext.h" - #include "Game.h" #include "Displayer.h" diff --git a/src/obj_garbage_thick_middle.cxx b/src/obj_garbage_thick_middle.cxx index 25c03c4..0717877 100644 --- a/src/obj_garbage_thick_middle.cxx +++ b/src/obj_garbage_thick_middle.cxx @@ -29,7 +29,6 @@ #include "glext.h" - #include "Game.h" #include "Displayer.h" diff --git a/src/obj_garbage_thin_cap.cxx b/src/obj_garbage_thin_cap.cxx index 5c1b535..516eb1e 100644 --- a/src/obj_garbage_thin_cap.cxx +++ b/src/obj_garbage_thin_cap.cxx @@ -29,7 +29,6 @@ #include "glext.h" - #include "Game.h" #include "Displayer.h" diff --git a/src/obj_garbage_thin_middle.cxx b/src/obj_garbage_thin_middle.cxx index 1528013..c844c27 100644 --- a/src/obj_garbage_thin_middle.cxx +++ b/src/obj_garbage_thin_middle.cxx @@ -29,7 +29,6 @@ #include "glext.h" - #include "Game.h" #include "Displayer.h" diff --git a/src/obj_level_lights.cxx b/src/obj_level_lights.cxx index 202a73f..ff77ba9 100644 --- a/src/obj_level_lights.cxx +++ b/src/obj_level_lights.cxx @@ -29,7 +29,6 @@ #include "glext.h" - #include "Game.h" #include "Displayer.h" diff --git a/src/obj_messages.cxx b/src/obj_messages.cxx index 890ce23..307e18b 100644 --- a/src/obj_messages.cxx +++ b/src/obj_messages.cxx @@ -29,10 +29,9 @@ #include #include +#include #include "glext.h" -#include "sstream.h" - #include "TextureLoader.h" #include "Game.h" diff --git a/src/obj_name.cxx b/src/obj_name.cxx index 7021ea1..b46c9df 100644 --- a/src/obj_name.cxx +++ b/src/obj_name.cxx @@ -29,7 +29,6 @@ #include "glext.h" - #include "Game.h" #include "Displayer.h" #include "String.h" diff --git a/src/obj_score_record.cxx b/src/obj_score_record.cxx index 3055240..46cf27d 100644 --- a/src/obj_score_record.cxx +++ b/src/obj_score_record.cxx @@ -25,11 +25,10 @@ #include #include +#include -#include "sstream.h" #include "glext.h" - #include "Game.h" #include "Displayer.h" #include "MetaState.h" diff --git a/src/obj_sign.cxx b/src/obj_sign.cxx index fee0c0b..4f470fa 100644 --- a/src/obj_sign.cxx +++ b/src/obj_sign.cxx @@ -30,7 +30,6 @@ #include "glext.h" - #include "TextureLoader.h" #include "Game.h" #include "Displayer.h" @@ -67,8 +66,9 @@ const char *sign_large_subtexture_files[DC_NUMBER_LARGE_SIGN_SUBTEXTURES] void Displayer::generateSignList ( ) { - GLubyte *subtextures - [max(DC_NUMBER_SMALL_SIGN_SUBTEXTURES, DC_NUMBER_LARGE_SIGN_SUBTEXTURES)]; + GLubyte *subtextures[std::max( + DC_NUMBER_SMALL_SIGN_SUBTEXTURES, + DC_NUMBER_LARGE_SIGN_SUBTEXTURES)]; // load and pack the small sign textures diff --git a/src/obj_sparkle.cxx b/src/obj_sparkle.cxx index 4a25704..1e9d0a4 100644 --- a/src/obj_sparkle.cxx +++ b/src/obj_sparkle.cxx @@ -30,7 +30,6 @@ #include "glext.h" - #include "Game.h" #include "Displayer.h" diff --git a/src/obj_swapper.cxx b/src/obj_swapper.cxx index a520670..2addd1e 100644 --- a/src/obj_swapper.cxx +++ b/src/obj_swapper.cxx @@ -29,7 +29,6 @@ #include "glext.h" - #include "Game.h" #include "Displayer.h" diff --git a/src/sstream.h b/src/sstream.h deleted file mode 100644 index 91144f4..0000000 --- a/src/sstream.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * GarbageQueue.cxx - * - * Crack Attack! is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT file - * distributed with this source distribution for a full listing. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef _SSTREAM_H_ -#define _SSTREAM_H_ - -#ifndef _WIN32 -# include -#else -# ifndef __MINGW32__ -# include -# else -# include -# endif -#endif - -#endif -- 2.11.4.GIT