fixed warnings
authorAlma Dejus <almde515@student.liu.se>
Mon, 27 Nov 2023 12:19:33 +0000 (13:19 +0100)
committerAlma Dejus <almde515@student.liu.se>
Mon, 27 Nov 2023 12:19:33 +0000 (13:19 +0100)
src/Menus.cc

index 53accbea98d3f7e420ebf5e7e2d0da4193a5189b..9fa2cf28b96d96afafa541fb13c3783962d7a574 100644 (file)
@@ -4,9 +4,11 @@
 #include "States.h"
 #include "Context.h"
 #include "constants.h"
+
+
 // Start menu --------------------------------------------
-Start_menu::Start_menu() : texture{},  texture2{}, sprite{}, mouse_l{}, mouse_r{}, start_game{false}, exit_game{false}, 
-                           scoreboard{false}, menu_index{1}, starttext{}, scoreboardtext{}, quittext{}, font{}
+Start_menu::Start_menu() : texture{},  texture2{}, sprite{}, mouse_l{}, mouse_r{}, starttext{}, scoreboardtext{},
+                           quittext{}, font{}, start_game{false}, exit_game{false}, scoreboard{false}, menu_index{1}
 {                         
     //sprite
     texture.loadFromFile("assets/meny_bild.png");
@@ -141,7 +143,7 @@ void Start_menu::handle_input(sf::Event& event)
                 break;    
             }
 
-            else;
+            else
             {
                menu_index -= 1;
             }
@@ -153,7 +155,7 @@ void Start_menu::handle_input(sf::Event& event)
                 break;
             }
 
-            else;
+            else
             {
                 menu_index += 1;
             }
@@ -171,8 +173,8 @@ void Start_menu::handle_input(sf::Event& event)
 
 
 // Pause menu --------------------------------------------
-Pause_menu::Pause_menu() : texture{}, texture2{}, sprite{}, resume_game{false}, menu{false}, exit_game{false}, 
-                           resumetext{}, startmenutext{}, quittext{}, mouse_r{}, mouse_l{}, font{}, menu_index{1}
+Pause_menu::Pause_menu() : texture{}, texture2{}, sprite{}, mouse_l{}, mouse_r{}, resumetext{}, startmenutext{}, 
+                           quittext{}, font{}, resume_game{false}, exit_game{false}, menu{false}, menu_index{1}
 {
     texture.loadFromFile("assets/Pause_bild.png");
     sprite.setTexture(texture);;
@@ -195,7 +197,9 @@ Pause_menu::Pause_menu() : texture{}, texture2{}, sprite{}, resume_game{false},
 
     // load textfont
     if ( !font.loadFromFile ("assets/fonts/Philosopher-Regular.ttf") )
-        throw std::invalid_argument ("Unable to load font");
+        {
+            throw std::invalid_argument ("Unable to load font");
+        }
 
 
     // Resume text
@@ -304,7 +308,7 @@ void Pause_menu::handle_input(sf::Event& event)
                 break;    
             }
 
-            else;
+            else
             {
                menu_index -= 1;
             }
@@ -316,7 +320,7 @@ void Pause_menu::handle_input(sf::Event& event)
                 break;
             }
 
-            else;
+            else
             {
                 menu_index += 1;
             }
@@ -334,8 +338,8 @@ void Pause_menu::handle_input(sf::Event& event)
 
 
 // Scoreboard menu --------------------------------------------
-Scoreboard_menu::Scoreboard_menu() : /*texture{},*/ texture2{}, /*sprite{},*/ menu{false}, exit_game{false}, 
-                                 startmenutext{}, quittext{}, mouse_r{}, mouse_l{}, font{}, menu_index{1}
+Scoreboard_menu::Scoreboard_menu() : /*texture{},*/ texture2{}, /*sprite{},*/ mouse_l{}, mouse_r{}, startmenutext{},
+                                     quittext{}, font{}, exit_game{false}, menu{false}, menu_index{1}
 {
     // Add background later
     /*
@@ -448,7 +452,7 @@ void Scoreboard_menu::handle_input(sf::Event& event)
                 break;    
             }
 
-            else;
+            else
             {
                menu_index -= 1;
             }
@@ -460,7 +464,7 @@ void Scoreboard_menu::handle_input(sf::Event& event)
                 break;
             }
 
-            else;
+            else
             {
                 menu_index += 1;
             }
@@ -478,8 +482,8 @@ void Scoreboard_menu::handle_input(sf::Event& event)
 
 
 // GameOver menu --------------------------------------------
-GameOver_menu::GameOver_menu() : /*texture{},*/ texture2{}, /*sprite{},*/ menu{false}, exit_game{false}, 
-                                 startmenutext{}, quittext{}, mouse_r{}, mouse_l{}, font{}, menu_index{1}
+GameOver_menu::GameOver_menu() : /*texture{},*/ texture2{}, /*sprite{},*/ mouse_l{}, mouse_r{}, startmenutext{},
+                                 quittext{},  font{}, exit_game{false}, menu{false}, menu_index{1}
 {
     // Add background later
     /*
@@ -592,7 +596,7 @@ void GameOver_menu::handle_input(sf::Event& event)
                 break;    
             }
 
-            else;
+            else
             {
                menu_index -= 1;
             }
@@ -604,7 +608,7 @@ void GameOver_menu::handle_input(sf::Event& event)
                 break;
             }
 
-            else;
+            else
             {
                 menu_index += 1;
             }