diff --git a/source/code/DialogBox.cpp b/source/code/DialogBox.cpp index 136d9cc..797aa86 100644 --- a/source/code/DialogBox.cpp +++ b/source/code/DialogBox.cpp @@ -26,7 +26,7 @@ http://www.blockattack.net #include "common.h" #include "ReadKeyboard.h" -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}); diff --git a/source/code/HelpAboutState.cpp b/source/code/HelpAboutState.cpp index 46acdcb..a0376fc 100644 --- a/source/code/HelpAboutState.cpp +++ b/source/code/HelpAboutState.cpp @@ -35,7 +35,7 @@ extern sago::SagoSprite bExit; -static void setHelpGamepadFont(const sago::SagoDataHolder* holder, sago::SagoTextField& field, const char* text){ +static void setHelpGamepadFont(const sago::SagoDataHolder* holder, sago::SagoTextField& field, const char* text) { field.SetHolder(holder); field.SetFont("freeserif"); field.SetColor({255,255,255,255}); @@ -44,7 +44,7 @@ static void setHelpGamepadFont(const sago::SagoDataHolder* holder, sago::SagoTex field.SetText(text); } -static void setHelpGamepadFont(const sago::SagoDataHolder* holder, sago::SagoTextBox& field, const char* text){ +static void setHelpGamepadFont(const sago::SagoDataHolder* holder, sago::SagoTextBox& field, const char* text) { field.SetHolder(holder); field.SetFont("freeserif"); field.SetColor({255,255,255,255}); @@ -120,8 +120,8 @@ void HelpAboutState::Update() { bMouseUp = false; //The Score button: - if ((globalData.mousex>xsize-buttonOffset) && (globalData.mousexysize-buttonOffset) && (globalData.mouseyxsize-buttonOffset) && (globalData.mousexysize-buttonOffset) && (globalData.mouseyGetDataHolder()); @@ -129,8 +129,8 @@ void HelpGamepadState::Update() { bMouseUp = false; //The Score button: - if ((globalData.mousex>xsize-buttonOffset) && (globalData.mousexysize-buttonOffset) && (globalData.mouseyxsize-buttonOffset) && (globalData.mousexysize-buttonOffset) && (globalData.mousey lastTick + animationSpeed) { lastTick = tick; switch (state) { - case 0: - cursorPos = 1; - break; - case 1: //fallthough - case 3: - std::swap(brickStr[cursorPos], brickStr[cursorPos + 1]); - break; - case 2: - cursorPos = 0; - break; + case 0: + cursorPos = 1; + break; + case 1: //fallthough + case 3: + std::swap(brickStr[cursorPos], brickStr[cursorPos + 1]); + break; + case 2: + cursorPos = 0; + break; } ++state; if (state > 3) { @@ -100,13 +100,13 @@ public: lines.push_back(line); return *this; } - + void Render(SDL_Renderer* target, int x, int y) { for (size_t i = 0; i < lines.size(); ++i) { RenderRowOfBricks(target, lines[i], x, y+i*50); } } - + }; HorizontalSwitchAnimation switchAnimation; @@ -221,8 +221,8 @@ void HelpHowtoState::Update() { bMouseUp = false; //The Score button: - if ((globalData.mousex>xsize-buttonOffset) && (globalData.mousexysize-buttonOffset) && (globalData.mouseyxsize-buttonOffset) && (globalData.mousexysize-buttonOffset) && (globalData.mouseyGetSprite(menu_unmarked).Draw(globalData.screen, SDL_GetTicks(), b.x, b.y); } - standardButton.getLabel(b.label)->Draw(globalData.screen, b.x+standardButton.xsize/2,b.y+standardButton.ysize/2, - sago::SagoTextField::Alignment::center, sago::SagoTextField::VerticalAlignment::center); + standardButton.getLabel(b.label)->Draw(globalData.screen, b.x+standardButton.xsize/2,b.y+standardButton.ysize/2, + sago::SagoTextField::Alignment::center, sago::SagoTextField::VerticalAlignment::center); //standardButton.thefont->drawCenterAlsoHeight(globalData.screen, b.x+standardButton.xsize/2,b.y+standardButton.ysize/2, b.label); } diff --git a/source/code/ScoresDisplay.cpp b/source/code/ScoresDisplay.cpp index 8c99a93..09ecc78 100644 --- a/source/code/ScoresDisplay.cpp +++ b/source/code/ScoresDisplay.cpp @@ -31,7 +31,7 @@ using std::string; using std::cerr; using std::vector; -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}); diff --git a/source/code/main.cpp b/source/code/main.cpp index 79dfb45..e55ea41 100644 --- a/source/code/main.cpp +++ b/source/code/main.cpp @@ -180,7 +180,7 @@ static int InitImages(sago::SagoSpriteHolder& holder) { bRetry = holder.GetSprite("b_blank"); globalData.mouse = holder.GetSprite("mouse"); backBoard = holder.GetSprite("back_board"); - + sagoTextSetBlueFont(player1name); sagoTextSetBlueFont(player2name); sagoTextSetBlueFont(player1time); @@ -191,7 +191,7 @@ static int InitImages(sago::SagoSpriteHolder& holder) { sagoTextSetBlueFont(player2chain); sagoTextSetBlueFont(player1speed); sagoTextSetBlueFont(player2speed); - + //Loads the sound if sound present if (!globalData.NoSound) { @@ -414,19 +414,19 @@ static void DrawBalls() { DrawIMG(iChainFrame,globalData.screen,x,y); getSmallInt(globalData.theTextManager.textArray[i].getText())->Draw(globalData.screen, x+12, y+7, - sago::SagoTextField::Alignment::center); + sago::SagoTextField::Alignment::center); } } } //DrawBalls -template void sagoTextSetHelpFont(T& field){ +template void sagoTextSetHelpFont(T& field) { field.SetHolder(&globalData.spriteHolder->GetDataHolder()); field.SetFont("freeserif"); field.SetFontSize(30); field.SetOutline(1, {128,128,128,255}); } -void sagoTextSetHelpFont(sago::SagoTextField& gametypeNameField){ +void sagoTextSetHelpFont(sago::SagoTextField& gametypeNameField) { sagoTextSetHelpFont(gametypeNameField); } @@ -561,8 +561,8 @@ void DrawEverything(int xsize, int ysize,BlockGameSdl* theGame, BlockGameSdl* th //Write the keys that are in use int y = theGame2->GetTopY()+400; std::string controldBoxText = std::string(_("Movement keys:"))+"\n"+getKeyName(keySettings[0].left)+", "+getKeyName(keySettings[0].right)+",\n" - + getKeyName(keySettings[0].up)+", "+getKeyName(keySettings[0].down)+"\n" - + _("Switch: ") + getKeyName(keySettings[0].change); + + getKeyName(keySettings[0].up)+", "+getKeyName(keySettings[0].down)+"\n" + + _("Switch: ") + getKeyName(keySettings[0].change); if (theGame->isPuzzleMode()) { controldBoxText += std::string("\n") + _("Restart: ")+getKeyName(keySettings[0].push); }