git repos / blockattack-game

commit 18c5059e

sago007 · 2016-10-08 17:41
18c5059e41c6e3cc8c9bba5a7db84582f6d758a0 patch · browse files
parent 7b384c3fe0bb10c020f1cd41acd68c27716e2d44

Removed some methods that should not be methods

Changed files

M source/code/MenuSystem.cpp before
M source/code/MenuSystem.h before
diff --git a/source/code/MenuSystem.cpp b/source/code/MenuSystem.cpp index eb597d5..be0db0c 100644 --- a/source/code/MenuSystem.cpp +++ b/source/code/MenuSystem.cpp
@@ -90,15 +90,6 @@ bool Button::isPopOnRun() const {
return popOnRun;
}
-
-int Button::getHeight() const {
- return standardButton.ysize;
-}
-
-int Button::getWidth() const {
- return standardButton.xsize;
-}
-
static void drawToScreen(const Button &b) {
if (b.marked) {
spriteHolder->GetSprite(menu_marked).Draw(screen, SDL_GetTicks(), b.x, b.y);
@@ -133,10 +124,10 @@ void Menu::placeButtons() {
int nextY = 100;
int X = 50;
for (Button* it : buttons) {
- X = (xsize - it->getWidth())/2;
+ X = (xsize - standardButton.xsize)/2;
it->x = X;
it->y = nextY;
- nextY += it->getHeight()+10;
+ nextY += standardButton.ysize+10;
}
exit.x = X;
exit.y = nextY;
diff --git a/source/code/MenuSystem.h b/source/code/MenuSystem.h index cf0e763..03d4dde 100644 --- a/source/code/MenuSystem.h +++ b/source/code/MenuSystem.h
@@ -77,8 +77,6 @@ public:
virtual void doAction(); //Run the callback function
void setPopOnRun(bool popOnRun);
bool isPopOnRun() const;
- int getHeight() const;
- int getWidth() const;
//May hold any other information the callback might need
int iGeneric1 = 0;