From ef28ab5a84ac1c5ed260477a6e5b386ac6083e06 Mon Sep 17 00:00:00 2001 From: Joris <joris.dauphin@gmail.com> Date: Fri, 27 Apr 2012 10:44:07 +0200 Subject: [PATCH] [AStyle] --- src/include/viewport.h | 2 +- src/ui/botpanel.cpp | 4 ++-- src/ui/mouse.cpp | 4 ++-- src/unit/unit.cpp | 5 +++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/include/viewport.h b/src/include/viewport.h index 04e33761b..373858b7d 100644 --- a/src/include/viewport.h +++ b/src/include/viewport.h @@ -110,7 +110,7 @@ private: void DrawMapFogOfWar() const; public: -//private: + //private: PixelPos TopLeftPos; /// Screen pixel top-left corner PixelPos BottomRightPos; /// Screen pixel bottom-right corner diff --git a/src/ui/botpanel.cpp b/src/ui/botpanel.cpp index 66165d5f8..51359ff2d 100644 --- a/src/ui/botpanel.cpp +++ b/src/ui/botpanel.cpp @@ -778,8 +778,8 @@ void DrawPopup(const ButtonAction *button, const CUIButton *uibutton) case ButtonBuild: case ButtonTrain: case ButtonUpgradeTo: - memcpy(Costs, UnitTypes[button->Value]->Stats[ThisPlayer->Index].Costs, - sizeof(UnitTypes[button->Value]->Stats[ThisPlayer->Index].Costs)); + memcpy(Costs, UnitTypes[button->Value]->Stats[ThisPlayer->Index].Costs, + sizeof(UnitTypes[button->Value]->Stats[ThisPlayer->Index].Costs)); break; default: break; diff --git a/src/ui/mouse.cpp b/src/ui/mouse.cpp index c3e5df5d6..1549106fd 100644 --- a/src/ui/mouse.cpp +++ b/src/ui/mouse.cpp @@ -617,7 +617,7 @@ static void HandleMouseOn(int x, int y) if (NumSelected == 1 && Selected[0]->Type->CanTransport() && Selected[0]->BoardCount) { const size_t size = UI.TransportingButtons.size(); - for (size_t i = std::min<size_t>(Selected[0]->BoardCount, size); i != 0; ) { + for (size_t i = std::min<size_t>(Selected[0]->BoardCount, size); i != 0;) { --i; if (UI.TransportingButtons[i].Contains(screenPos)) { ButtonAreaUnderCursor = ButtonAreaTransporting; @@ -909,7 +909,7 @@ void UIHandleMouseMove(int x, int y) // NOTE: If unit is not selectable as a goal, you can't get a cursor hint if (UnitUnderCursor != NULL && !UnitUnderCursor->IsVisibleAsGoal(*ThisPlayer) && !ReplayRevealMap) { - UnitUnderCursor = NoUnitP; + UnitUnderCursor = NoUnitP; } // diff --git a/src/unit/unit.cpp b/src/unit/unit.cpp index b5a35b291..e71be729e 100644 --- a/src/unit/unit.cpp +++ b/src/unit/unit.cpp @@ -1477,8 +1477,9 @@ bool CUnit::IsVisibleInViewport(const CViewport *vp) const int x = tilePos.x * PixelTileSize.x + IX - (Type->Width - Type->TileWidth * PixelTileSize.x) / 2 + Type->OffsetX; int y = tilePos.y * PixelTileSize.y + IY - (Type->Height - Type->TileHeight * PixelTileSize.y) / 2 + Type->OffsetY; const PixelSize vpSize = vp->GetPixelSize(); - const PixelPos vpTopLeftMapPos = {vp->MapX * PixelTileSize.x + vp->OffsetX, - vp->MapY * PixelTileSize.y + vp->OffsetY}; + const PixelPos vpTopLeftMapPos = {vp->MapX *PixelTileSize.x + vp->OffsetX, + vp->MapY *PixelTileSize.y + vp->OffsetY + }; const PixelPos vpBottomRightMapPos = vpTopLeftMapPos + vpSize; if (x + Type->Width < vpTopLeftMapPos.x || x > vpBottomRightMapPos.x