git repos / blockattack-game

commit 733af903

sago007 · 2016-03-24 14:58
733af9032714577bb3fa20bbc311abbf19a8fca8 patch · browse files
parent 602d910191f0ec90cc3633ff64676725cb580d47

Some uninitialized variables

Changed files

M source/code/MenuSystem.h before
diff --git a/source/code/MenuSystem.h b/source/code/MenuSystem.h index a33378c..767069b 100644 --- a/source/code/MenuSystem.h +++ b/source/code/MenuSystem.h
@@ -65,10 +65,10 @@ private:
public:
//Is the button marked?
- bool marked;
+ bool marked = false;
//Where is the button on the screen
- int x;
- int y;
+ int x = 0;
+ int y = 0;
Button();
Button(const Button& b);
@@ -89,7 +89,7 @@ public:
int getHeight();
//May hold any other information the callback might need
- int iGeneric1;
+ int iGeneric1 = 0;
};
@@ -100,7 +100,7 @@ private:
Button exit; //The exit button is special since it does not have a callback function
bool isSubmenu; //True if the menu is a submenu
int marked; //The index of the marked button (for keyboard up/down)
- bool running; //The menu is running. The menu will terminate then this is false
+ bool running = true; //The menu is running. The menu will terminate then this is false
SDL_Renderer *screen; //Pointer to the screen to draw to
std::string title;
// SDL_Surface *background; //Pointer to the background image