diff --git a/source/code/BlockGame.hpp b/source/code/BlockGame.hpp index 2b272c3..e09acfc 100644 --- a/source/code/BlockGame.hpp +++ b/source/code/BlockGame.hpp @@ -70,11 +70,10 @@ struct BlockGameStartInfo { int handicap = 0; int gameSpeed = 0; template - void serialize( Archive & ar ) - { + void serialize( Archive& ar ) { ar( CEREAL_NVP(ticks), CEREAL_NVP(timeTrial), CEREAL_NVP(stageClear), CEREAL_NVP(puzzleMode), CEREAL_NVP(singlePuzzle), - CEREAL_NVP(level), CEREAL_NVP(AI), CEREAL_NVP(recordStats), CEREAL_NVP(vsMode), CEREAL_NVP(vsAI), - CEREAL_NVP(startBlocks), CEREAL_NVP(handicap), CEREAL_NVP(gameSpeed) ); + CEREAL_NVP(level), CEREAL_NVP(AI), CEREAL_NVP(recordStats), CEREAL_NVP(vsMode), CEREAL_NVP(vsAI), + CEREAL_NVP(startBlocks), CEREAL_NVP(handicap), CEREAL_NVP(gameSpeed) ); } }; @@ -88,8 +87,7 @@ struct GarbageStruct { height = h; } template - void serialize( Archive & ar ) - { + void serialize( Archive& ar ) { ar( CEREAL_NVP(greyGarbage), CEREAL_NVP(width), CEREAL_NVP(height) ); } }; @@ -103,8 +101,7 @@ struct BlockGameAction { int y = 0; std::vector garbage; template - void serialize( Archive & ar ) - { + void serialize( Archive& ar ) { ar( CEREAL_NVP(action), CEREAL_NVP(tick), CEREAL_NVP(way), CEREAL_NVP(x), CEREAL_NVP(y), CEREAL_NVP(garbage) ); } }; @@ -114,8 +111,7 @@ struct BlockGameInfoExtra { int score = 0; int seconds = 0; template - void serialize( Archive & ar ) - { + void serialize( Archive& ar ) { ar( CEREAL_NVP(name), CEREAL_NVP(score), CEREAL_NVP(seconds) ); } }; @@ -125,8 +121,7 @@ struct BlockGameInfo { std::deque actions; BlockGameInfoExtra extra; template - void serialize( Archive & ar ) - { + void serialize( Archive& ar ) { ar( CEREAL_NVP(startInfo), CEREAL_NVP(actions), CEREAL_NVP(extra) ); } }; @@ -134,8 +129,7 @@ struct BlockGameInfo { //////////////////////////////////////////////////////////////////////////////// //The BloackGame class represents a board, score, time etc. for a single player/ //////////////////////////////////////////////////////////////////////////////// -class BlockGame -{ +class BlockGame { private: int prevTowerHeight = 0; bool bGarbageFallLeft = false; @@ -152,8 +146,8 @@ private: int AI_LineOffset = 0; //how many lines have changed since command int hangTicks = 0; //How many times have hang been decreased? //int the two following index 0 may NOT be used (what the fuck did I meen?) - int chainSize[NUMBEROFCHAINS]{}; //Contains the chains - bool chainUsed[NUMBEROFCHAINS]{}; //True if the chain is used + int chainSize[NUMBEROFCHAINS] {}; //Contains the chains + bool chainUsed[NUMBEROFCHAINS] {}; //True if the chain is used unsigned int nextRandomNumber = 0; int Level = 0; //Only used in stageClear and puzzle (not implemented) @@ -169,7 +163,7 @@ protected: bool bDraw = false; unsigned int ticks = 0; unsigned int gameStartedAt = 0; - unsigned int gameEndedAfter = 0; //How long did the game last? + unsigned int gameEndedAfter = 0; //How long did the game last? int linesCleared = 0; int TowerHeight = 0; int board[7][30]; @@ -228,7 +222,7 @@ public: virtual void TimeTrialEndEvent() const {} virtual void EndlessHighscoreEvent() const {} - void NewGame(const BlockGameStartInfo &s); + void NewGame(const BlockGameStartInfo& s); void DoAction (const BlockGameAction& action); /** * This function returns all the garbage. @@ -255,13 +249,15 @@ public: int GetTowerHeight() const; int GetCursorX() const; int GetCursorY() const; - void GetMouseCursor(bool& pressed, int& x, int&y) const; + void GetMouseCursor(bool& pressed, int& x, int& y) const; bool GetIsWinner() const; bool isSinglePuzzle() const; int getLevel() const; bool GetAIenabled() const; bool IsNearDeath() const; - double GetBaseSpeed() const { return baseSpeed; } + double GetBaseSpeed() const { + return baseSpeed; + } const BlockGameInfo& GetBlockGameInfo() { return replayInfo; } diff --git a/source/code/BlockGameSdl.hpp b/source/code/BlockGameSdl.hpp index 3f21140..b4da2e7 100644 --- a/source/code/BlockGameSdl.hpp +++ b/source/code/BlockGameSdl.hpp @@ -32,7 +32,7 @@ extern BallManager theBallManager; extern ExplosionManager theExplosionManager; -static void setScoreboardFont(const sago::SagoDataHolder* holder, sago::SagoTextField& field, const char* text){ +static void setScoreboardFont(const sago::SagoDataHolder* holder, sago::SagoTextField& field, const char* text) { field.SetHolder(holder); field.SetFont("penguinattack"); field.SetColor({255,255,255,255}); @@ -40,7 +40,7 @@ static void setScoreboardFont(const sago::SagoDataHolder* holder, sago::SagoText field.SetText(text); } -static void setButtonFont(const sago::SagoDataHolder* holder, sago::SagoTextField& field, const char* text){ +static void setButtonFont(const sago::SagoDataHolder* holder, sago::SagoTextField& field, const char* text) { field.SetHolder(holder); field.SetFont("freeserif"); field.SetColor({255,255,255,255}); @@ -50,10 +50,10 @@ static void setButtonFont(const sago::SagoDataHolder* holder, sago::SagoTextFiel } template void sagoTextSetHelpFont(T& field) { - field.SetHolder(&globalData.spriteHolder->GetDataHolder()); - field.SetFont("freeserif"); - field.SetFontSize(30); - field.SetOutline(1, {128,128,128,255}); + field.SetHolder(&globalData.spriteHolder->GetDataHolder()); + field.SetFont("freeserif"); + field.SetFontSize(30); + field.SetOutline(1, {128,128,128,255}); } class BlockGameSdl : public BlockGame { @@ -70,13 +70,13 @@ public: setButtonFont(holder, buttonSkip, _("Skip")); setButtonFont(holder, stopIntField, ""); - sagoTextSetBlueFont(player_name); - sagoTextSetBlueFont(player_time); - sagoTextSetBlueFont(player_score); - sagoTextSetBlueFont(player_chain); - sagoTextSetBlueFont(player_speed); + sagoTextSetBlueFont(player_name); + sagoTextSetBlueFont(player_time); + sagoTextSetBlueFont(player_score); + sagoTextSetBlueFont(player_chain); + sagoTextSetBlueFont(player_speed); } - + void DrawImgBoard(const sago::SagoSprite& img, int x, int y) const { DrawIMG(img, globalData.screen, x+topx, y+topy); @@ -87,10 +87,10 @@ public: } void PrintTextCenteredBoard(int x, int y, sago::SagoTextField& field) { - field.Draw(globalData.screen, x+topx+60, y+topy+20, - sago::SagoTextField::Alignment::center, sago::SagoTextField::VerticalAlignment::center); + field.Draw(globalData.screen, x+topx+60, y+topy+20, + sago::SagoTextField::Alignment::center, sago::SagoTextField::VerticalAlignment::center); } - + void SetTopXY(int tx, int ty) { topx = tx; topy = ty; @@ -102,7 +102,7 @@ public: int GetTopY() const { return topy; } - + /** * Retrives the coordinate to a given brick based on mouse input. * @param match true if the coordinate are within borders @@ -120,14 +120,14 @@ public: x = (mousex-topx) / bsize; y = (bsize*12+topy-mousey-pixels) / bsize; } - + bool IsInTheBoard(int mousex, int mousey) const { if (mousex < topx || mousex > topx+bsize*6 || mousey < topy || mousey > topy+bsize*12) { return false; } return true; } - + bool IsUnderTheBoard(int mousex, int mousey) const { if (mousex < topx || mousex > topx+bsize*6 || mousey < topy+bsize*12) { return false; @@ -333,12 +333,12 @@ private: int size_y = 0; int number = board[topx][topy]; for (int i=topy; i < 30 ; ++i) { - if(number == board[topx][i]) { + if (number == board[topx][i]) { ++size_y; } } for (int i=topx; i < 7 ; ++i) { - if(number == board[i][topy]) { + if (number == board[i][topy]) { ++size_x; } } @@ -558,119 +558,119 @@ public: globalData.tbDraw.Draw(globalData.screen, topx+150, topy+200, sago::SagoTextField::Alignment::center); } else { - if (this->infostring.empty()) { - globalData.tbGameOver.Draw(globalData.screen, topx+150, topy+200, sago::SagoTextField::Alignment::center); - } + if (this->infostring.empty()) { + globalData.tbGameOver.Draw(globalData.screen, topx+150, topy+200, sago::SagoTextField::Alignment::center); + } } } } - std::string strHolder; - strHolder = std::to_string(this->GetScore()+this->GetHandicap()); - player_score.SetText(strHolder); - player_score.Draw(globalData.screen, this->GetTopX()+310,this->GetTopY()+100); - if (this->GetAIenabled()) { - player_name.SetText(_("AI")); - } - else { - player_name.SetText(name); - } - player_name.Draw(globalData.screen, this->GetTopX()+10,this->GetTopY()-34); - if (this->isTimeTrial()) { - int tid = (int)SDL_GetTicks()-this->GetGameStartedAt(); - int minutes; - int seconds; - if (tid>=0) { - minutes = (2*60*1000-(abs((int)SDL_GetTicks()-(int)this->GetGameStartedAt())))/60/1000; - seconds = ((2*60*1000-(abs((int)SDL_GetTicks()-(int)this->GetGameStartedAt())))%(60*1000))/1000; - } - else { - minutes = ((abs((int)SDL_GetTicks()-(int)this->GetGameStartedAt())))/60/1000; - seconds = (((abs((int)SDL_GetTicks()-(int)this->GetGameStartedAt())))%(60*1000))/1000; - } - if (this->isGameOver()) { - minutes=0; - } - if (this->isGameOver()) { - seconds=0; - } - if (seconds>9) { - strHolder = std::to_string(minutes)+":"+std::to_string(seconds); - } - else { - strHolder = std::to_string(minutes)+":0"+std::to_string(seconds); - } - player_time.SetText(strHolder); - } - else { - int minutes = ((abs((int)SDL_GetTicks()-(int)this->GetGameStartedAt())))/60/1000; - int seconds = (((abs((int)SDL_GetTicks()-(int)this->GetGameStartedAt())))%(60*1000))/1000; - if (this->isGameOver()) { - minutes=(this->GetGameEndedAt()/1000/60)%100; - } - if (this->isGameOver()) { - seconds=(this->GetGameEndedAt()/1000)%60; - } - if (seconds>9) { - strHolder = std::to_string(minutes)+":"+std::to_string(seconds); - } - else { - strHolder = std::to_string(minutes)+":0"+std::to_string(seconds); - } - player_time.SetText(strHolder); - } - player_time.Draw(globalData.screen, this->GetTopX()+310,this->GetTopY()+150); - strHolder = std::to_string(this->GetChains()); - player_chain.SetText(strHolder); - player_chain.Draw(globalData.screen, this->GetTopX()+310,this->GetTopY()+200); - //drawspeedLevel: - strHolder = std::to_string(this->GetSpeedLevel()); - player_speed.SetText(strHolder); - player_speed.Draw(globalData.screen, this->GetTopX()+310,this->GetTopY()+250); - if ((this->isStageClear()) &&(this->GetTopY()+700+50*(this->GetStageClearLimit()-this->GetLinesCleared())-this->GetPixels()-1<600+this->GetTopY())) { - oldBubleX = this->GetTopX()+280; - oldBubleY = this->GetTopY()+650+50*(this->GetStageClearLimit()-this->GetLinesCleared())-this->GetPixels()-1; - DrawIMG(globalData.stageBobble,globalData.screen,this->GetTopX()+280,this->GetTopY()+650+50*(this->GetStageClearLimit()-this->GetLinesCleared())-this->GetPixels()-1); - } - - if (infostring.length() > 0) { - static sago::SagoTextBox infoBox; - static sago::SagoTextField objectiveField; - static sago::SagoTextField gametypeNameField; - sagoTextSetHelpFont(infoBox); - infoBox.SetMaxWidth(290); - infoBox.SetText(infostring); - sagoTextSetHelpFont(objectiveField); - objectiveField.SetText(_("Objective:")); - sagoTextSetHelpFont(gametypeNameField); - gametypeNameField.SetText(infostringName); - gametypeNameField.Draw(globalData.screen, this->GetTopX()+7,this->GetTopY()+10); - objectiveField.Draw(globalData.screen, this->GetTopX()+7, this->GetTopY()+160); - infoBox.Draw(globalData.screen, this->GetTopX()+7, this->GetTopY()+160+32); - - int y = this->GetTopY()+400; - static sago::SagoTextBox controldBox; - controldBox.SetHolder(&globalData.spriteHolder->GetDataHolder()); - sagoTextSetHelpFont(controldBox); - controldBox.SetMaxWidth(290); - controldBox.SetText(controldBoxText); - controldBox.Draw(globalData.screen, this->GetTopX()+7,y); - } + std::string strHolder; + strHolder = std::to_string(this->GetScore()+this->GetHandicap()); + player_score.SetText(strHolder); + player_score.Draw(globalData.screen, this->GetTopX()+310,this->GetTopY()+100); + if (this->GetAIenabled()) { + player_name.SetText(_("AI")); + } + else { + player_name.SetText(name); + } + player_name.Draw(globalData.screen, this->GetTopX()+10,this->GetTopY()-34); + if (this->isTimeTrial()) { + int tid = (int)SDL_GetTicks()-this->GetGameStartedAt(); + int minutes; + int seconds; + if (tid>=0) { + minutes = (2*60*1000-(abs((int)SDL_GetTicks()-(int)this->GetGameStartedAt())))/60/1000; + seconds = ((2*60*1000-(abs((int)SDL_GetTicks()-(int)this->GetGameStartedAt())))%(60*1000))/1000; + } + else { + minutes = ((abs((int)SDL_GetTicks()-(int)this->GetGameStartedAt())))/60/1000; + seconds = (((abs((int)SDL_GetTicks()-(int)this->GetGameStartedAt())))%(60*1000))/1000; + } + if (this->isGameOver()) { + minutes=0; + } + if (this->isGameOver()) { + seconds=0; + } + if (seconds>9) { + strHolder = std::to_string(minutes)+":"+std::to_string(seconds); + } + else { + strHolder = std::to_string(minutes)+":0"+std::to_string(seconds); + } + player_time.SetText(strHolder); + } + else { + int minutes = ((abs((int)SDL_GetTicks()-(int)this->GetGameStartedAt())))/60/1000; + int seconds = (((abs((int)SDL_GetTicks()-(int)this->GetGameStartedAt())))%(60*1000))/1000; + if (this->isGameOver()) { + minutes=(this->GetGameEndedAt()/1000/60)%100; + } + if (this->isGameOver()) { + seconds=(this->GetGameEndedAt()/1000)%60; + } + if (seconds>9) { + strHolder = std::to_string(minutes)+":"+std::to_string(seconds); + } + else { + strHolder = std::to_string(minutes)+":0"+std::to_string(seconds); + } + player_time.SetText(strHolder); + } + player_time.Draw(globalData.screen, this->GetTopX()+310,this->GetTopY()+150); + strHolder = std::to_string(this->GetChains()); + player_chain.SetText(strHolder); + player_chain.Draw(globalData.screen, this->GetTopX()+310,this->GetTopY()+200); + //drawspeedLevel: + strHolder = std::to_string(this->GetSpeedLevel()); + player_speed.SetText(strHolder); + player_speed.Draw(globalData.screen, this->GetTopX()+310,this->GetTopY()+250); + if ((this->isStageClear()) &&(this->GetTopY()+700+50*(this->GetStageClearLimit()-this->GetLinesCleared())-this->GetPixels()-1<600+this->GetTopY())) { + oldBubleX = this->GetTopX()+280; + oldBubleY = this->GetTopY()+650+50*(this->GetStageClearLimit()-this->GetLinesCleared())-this->GetPixels()-1; + DrawIMG(globalData.stageBobble,globalData.screen,this->GetTopX()+280,this->GetTopY()+650+50*(this->GetStageClearLimit()-this->GetLinesCleared())-this->GetPixels()-1); + } + + if (infostring.length() > 0) { + static sago::SagoTextBox infoBox; + static sago::SagoTextField objectiveField; + static sago::SagoTextField gametypeNameField; + sagoTextSetHelpFont(infoBox); + infoBox.SetMaxWidth(290); + infoBox.SetText(infostring); + sagoTextSetHelpFont(objectiveField); + objectiveField.SetText(_("Objective:")); + sagoTextSetHelpFont(gametypeNameField); + gametypeNameField.SetText(infostringName); + gametypeNameField.Draw(globalData.screen, this->GetTopX()+7,this->GetTopY()+10); + objectiveField.Draw(globalData.screen, this->GetTopX()+7, this->GetTopY()+160); + infoBox.Draw(globalData.screen, this->GetTopX()+7, this->GetTopY()+160+32); + + int y = this->GetTopY()+400; + static sago::SagoTextBox controldBox; + controldBox.SetHolder(&globalData.spriteHolder->GetDataHolder()); + sagoTextSetHelpFont(controldBox); + controldBox.SetMaxWidth(290); + controldBox.SetText(controldBoxText); + controldBox.Draw(globalData.screen, this->GetTopX()+7,y); + } } - sago::SagoTextField player_name; - sago::SagoTextField player_time; - sago::SagoTextField player_score; - sago::SagoTextField player_chain; - sago::SagoTextField player_speed; + sago::SagoTextField player_name; + sago::SagoTextField player_time; + sago::SagoTextField player_score; + sago::SagoTextField player_chain; + sago::SagoTextField player_speed; - //Old Stage Clear Buble - int oldBubleX; - int oldBubleY; + //Old Stage Clear Buble + int oldBubleX; + int oldBubleY; - std::string infostring; - std::string infostringName; - std::string controldBoxText; + std::string infostring; + std::string infostringName; + std::string controldBoxText; private: diff --git a/source/code/DialogBox.hpp b/source/code/DialogBox.hpp index d8d4272..065da60 100644 --- a/source/code/DialogBox.hpp +++ b/source/code/DialogBox.hpp @@ -36,8 +36,8 @@ struct VirtualKeyboard { const std::string rightChar = "›"; const std::string backspace = "«"; std::string alphabet = std::string(_("ABCDEFGHIJKLMNOPQRSTUVWXYZ" - "abcdefghijklmnopqrstuvwxyz" - ".,:!?+_^@#%&=*")) + leftChar + rightChar + backspace; + "abcdefghijklmnopqrstuvwxyz" + ".,:!?+_^@#%&=*")) + leftChar + rightChar + backspace; std::vector gamePadChars; std::vector gamePadCharFields; int selectedChar = 0; @@ -52,12 +52,12 @@ public: bool IsActive() override; void Draw(SDL_Renderer* target) override; - void ProcessInput(const SDL_Event& event, bool &processed) override; + void ProcessInput(const SDL_Event& event, bool& processed) override; void SetName(const std::string& name); std::string GetName() const; bool IsUpdated() const; private: - void virtualKeyboardWriteSelectedChar(ReadKeyboard *rk, const std::string& insertChar) const; + void virtualKeyboardWriteSelectedChar(ReadKeyboard* rk, const std::string& insertChar) const; bool isActive = true; bool bMouseUp = false; std::shared_ptr rk; diff --git a/source/code/HelpCommon.hpp b/source/code/HelpCommon.hpp index 080fe55..16a796e 100644 --- a/source/code/HelpCommon.hpp +++ b/source/code/HelpCommon.hpp @@ -43,7 +43,7 @@ public: virtual ~HelpCommonState() = default; bool IsActive() override; - void ProcessInput(const SDL_Event& event, bool &processed) override; + void ProcessInput(const SDL_Event& event, bool& processed) override; void Draw(SDL_Renderer* target) override; void Update() override; const int buttonOffset = 160; diff --git a/source/code/HelpGamepadState.hpp b/source/code/HelpGamepadState.hpp index 1ecb0e0..7140e6b 100644 --- a/source/code/HelpGamepadState.hpp +++ b/source/code/HelpGamepadState.hpp @@ -34,7 +34,7 @@ public: HelpGamepadState(const HelpGamepadState& orig) = delete; virtual ~HelpGamepadState(); void Draw(SDL_Renderer* target) override; - void ProcessInput(const SDL_Event& event, bool &processed) override; + void ProcessInput(const SDL_Event& event, bool& processed) override; private: sago::SagoTextField moveLabel; sago::SagoTextField pushLabel; diff --git a/source/code/ReplayPlayer.hpp b/source/code/ReplayPlayer.hpp index 0c3cc75..91bb4c9 100644 --- a/source/code/ReplayPlayer.hpp +++ b/source/code/ReplayPlayer.hpp @@ -31,10 +31,10 @@ public: ReplayPlayer(); ReplayPlayer(const ReplayPlayer& orig) = delete; virtual ~ReplayPlayer(); - + bool IsActive() override; void Draw(SDL_Renderer* target) override; - void ProcessInput(const SDL_Event& event, bool &processed) override; + void ProcessInput(const SDL_Event& event, bool& processed) override; void Update() override; private: bool isActive = true; diff --git a/source/code/ScoresDisplay.hpp b/source/code/ScoresDisplay.hpp index ff73fcb..3fae1d6 100644 --- a/source/code/ScoresDisplay.hpp +++ b/source/code/ScoresDisplay.hpp @@ -30,14 +30,14 @@ http://www.blockattack.net #include #include "highscore.h" -class ScoresDisplay : public HelpCommonState{ +class ScoresDisplay : public HelpCommonState { public: ScoresDisplay(); ScoresDisplay(const ScoresDisplay& orig) = delete; virtual ~ScoresDisplay(); void Draw(SDL_Renderer* target) override; - void ProcessInput(const SDL_Event& event, bool &processed) override; + void ProcessInput(const SDL_Event& event, bool& processed) override; void Update() override; int page = 0; diff --git a/source/code/TextManager.hpp b/source/code/TextManager.hpp index a489476..2905fa9 100644 --- a/source/code/TextManager.hpp +++ b/source/code/TextManager.hpp @@ -36,7 +36,7 @@ private: unsigned long int placeTime = 0; //Then the text was placed public: bool inUse = false; - + TextMessage() { } diff --git a/source/code/global.hpp b/source/code/global.hpp index 3bc01da..9e05721 100644 --- a/source/code/global.hpp +++ b/source/code/global.hpp @@ -22,7 +22,7 @@ http://www.blockattack.net */ #ifndef _GLOBAL_HPP -#define _GLOBAL_HPP +#define _GLOBAL_HPP #include #include "sago/SagoSpriteHolder.hpp" @@ -74,8 +74,7 @@ const int SCREEN_HIGHT = 768; const int BOARD_WIDTH = 300; const int BOARD_HEIGHT = 600; -struct ButtonCords -{ +struct ButtonCords { int x; int y; int xsize; @@ -98,7 +97,7 @@ struct GlobalData { std::string replayArgument; //Name of the replay to play (if given as a commandline argument) std::string player1name; std::string player2name; - SDL_Renderer *screen = nullptr; //The whole screen; + SDL_Renderer* screen = nullptr; //The whole screen; sago::SoundHandler typingChunk; sago::SagoSprite mouse; bool highPriority = false; @@ -123,7 +122,7 @@ struct GlobalData { sago::SoundHandler counterChunk; //When counting down sago::SoundHandler counterFinalChunk; - sago::SagoSprite garbageTL; //the Garbage Blocks + sago::SagoSprite garbageTL; //the Garbage Blocks sago::SagoSprite garbageT; sago::SagoSprite garbageTR; sago::SagoSprite garbageR; @@ -142,8 +141,8 @@ struct GlobalData { sago::SagoSprite bSkip; sago::SagoSprite bRetry; - sago::SagoSprite blackLine; //The seperator in stage clear - sago::SagoSprite stageBobble; //The bobble instage clear + sago::SagoSprite blackLine; //The seperator in stage clear + sago::SagoSprite stageBobble; //The bobble instage clear sago::SagoTextBox tbGameOver; sago::SagoTextBox tbWinner; sago::SagoTextBox tbDraw; @@ -169,5 +168,5 @@ struct GlobalData { extern GlobalData globalData; -#endif /* _GLOBAL_HPP */ +#endif /* _GLOBAL_HPP */ diff --git a/source/code/puzzlehandler.hpp b/source/code/puzzlehandler.hpp index e6c6390..5048b41 100644 --- a/source/code/puzzlehandler.hpp +++ b/source/code/puzzlehandler.hpp @@ -22,7 +22,7 @@ http://www.blockattack.net */ #ifndef PUZZLEHANDLER_HPP -#define PUZZLEHANDLER_HPP +#define PUZZLEHANDLER_HPP #include @@ -36,5 +36,5 @@ void PuzzleSetClear(int level); const std::string& PuzzleGetName(); void PuzzleSetName(const std::string& name); -#endif /* PUZZLEHANDLER_HPP */ +#endif /* PUZZLEHANDLER_HPP */ diff --git a/source/code/replayhandler.hpp b/source/code/replayhandler.hpp index 8b8db90..3d06165 100644 --- a/source/code/replayhandler.hpp +++ b/source/code/replayhandler.hpp @@ -28,8 +28,7 @@ struct SavedReplayStruct { int numberOfPlayers = 0; std::vector playerInfo; template - void serialize( Archive & ar ) - { + void serialize( Archive& ar ) { ar( CEREAL_NVP(numberOfPlayers), CEREAL_NVP(playerInfo) ); } }; diff --git a/source/code/scopeHelpers.hpp b/source/code/scopeHelpers.hpp index dc8027c..cfbc90f 100644 --- a/source/code/scopeHelpers.hpp +++ b/source/code/scopeHelpers.hpp @@ -22,7 +22,7 @@ https://blockattack.net */ #ifndef SCOPEHELPERS_HPP -#define SCOPEHELPERS_HPP +#define SCOPEHELPERS_HPP #include "common.h" @@ -34,7 +34,7 @@ public: dieOnNullptr(input, "Failed to get render"); ptr = input; } - + ~SDL_RendererHolder() { SDL_DestroyRenderer(ptr); } @@ -45,11 +45,11 @@ public: SDL_TextInput() { SDL_StartTextInput(); } - + ~SDL_TextInput() { SDL_StopTextInput(); } }; -#endif /* SCOPEHELPERS_HPP */ +#endif /* SCOPEHELPERS_HPP */ diff --git a/source/code/stageclearhandler.hpp b/source/code/stageclearhandler.hpp index 47e629f..effa3ca 100644 --- a/source/code/stageclearhandler.hpp +++ b/source/code/stageclearhandler.hpp @@ -22,7 +22,7 @@ http://blockattack.net */ -/* +/* * File: stageclearhandler.hpp * Author: poul * @@ -43,7 +43,7 @@ bool IsStageCleared(int level); int GetStageScores(int level); int GetStageTime(int level); -const int nrOfStageLevels = 50; //number of stages in stage Clear +const int nrOfStageLevels = 50; //number of stages in stage Clear #endif /* STAGECLEARHANDLER_HPP */ diff --git a/source/code/themes.hpp b/source/code/themes.hpp index 5f0977b..aecc0dc 100644 --- a/source/code/themes.hpp +++ b/source/code/themes.hpp @@ -27,9 +27,10 @@ https://www.blockattack.net #include enum class ImgScale { Stretch, - Tile, - Resize, - Cut }; + Tile, + Resize, + Cut + }; struct BackGroundData { std::string name = "standard"; diff --git a/source/misc/astyle/runAstyle.sh b/source/misc/astyle/runAstyle.sh index 91eb459..a713205 100755 --- a/source/misc/astyle/runAstyle.sh +++ b/source/misc/astyle/runAstyle.sh @@ -1,4 +1,5 @@ #! /bin/bash astyle -t -j -y -c -k1 -z2 -A2 --pad-header ../../code/*.cpp +astyle -t -j -y -c -k1 -z2 -A2 --pad-header ../../code/*.hpp astyle -t -j -y -c -k1 -z2 -A2 --pad-header ../../code/sago/*.cpp astyle -t -j -y -c -k1 -z2 -A2 --pad-header ../../code/sago/*.hpp