From 8e6a206770bedc27416c99cbdb9b892ed431d5c9 Mon Sep 17 00:00:00 2001 From: Thomas Date: Mon, 10 Jan 2022 09:36:38 +0100 Subject: [PATCH] fixed some warnings --- headers/configManagement.h | 6 ------ headers/game.h | 5 ++--- headers/god.h | 2 +- headers/menu.h | 5 +++-- headers/pixelManager.h | 2 +- headers/utils.h | 2 +- src/configManagement.cpp | 7 +++++++ src/drawMenu.cpp | 5 ++--- src/game/display.cpp | 3 +-- src/game/gameBasics.cpp | 2 +- src/invaderGrids.cpp | 2 +- src/scoresManager.cpp | 1 - 12 files changed, 20 insertions(+), 22 deletions(-) diff --git a/headers/configManagement.h b/headers/configManagement.h index 180a908..8206bdf 100644 --- a/headers/configManagement.h +++ b/headers/configManagement.h @@ -41,10 +41,4 @@ private: void readInvaderType(const configKey& baseKey, InvaderTypeDef&); }; -void ConfigBuilder::dumpInternalValues() const { - for(const auto& ite : internalValues){ - cerr << ite.first << " -> " << ite.second << endl; - } -} - #endif diff --git a/headers/game.h b/headers/game.h index 661545e..b91761b 100644 --- a/headers/game.h +++ b/headers/game.h @@ -133,10 +133,9 @@ private: /*! * @brief main display function, clear the window and calls sub display functions - * @param[in] fps : current screen framerate - * @fn void displayAll(unsigned fps) const; + * @fn void displayAll() const; */ - void displayAll(unsigned fps) const; + void displayAll() const; /*! * @brief display God related objets diff --git a/headers/god.h b/headers/god.h index 6fac89f..6999ad0 100644 --- a/headers/god.h +++ b/headers/god.h @@ -6,7 +6,7 @@ * @version 1.0 * @brief Special entity known as "God" * - * Well, i (Djalim) discovered that Thomas put God in the game + * Well, I (Djalim) discovered that Thomas put God in the game * I didnt think it was a good idea but no man can stop Thomas * */ diff --git a/headers/menu.h b/headers/menu.h index 6b35c6b..d881198 100644 --- a/headers/menu.h +++ b/headers/menu.h @@ -11,8 +11,9 @@ #ifndef GUARD_MENU_H #define GUARD_MENU_H -#include"vector" -#include"string" + +#include +#include /*! * @struct Menu diff --git a/headers/pixelManager.h b/headers/pixelManager.h index 4976f0e..94d2e45 100644 --- a/headers/pixelManager.h +++ b/headers/pixelManager.h @@ -267,7 +267,7 @@ private: * @param[in] rowSize : size of a line of pixel * @fn vector mirrorData(const vector& inPixels, unsigned rowSize); */ - vector mirrorData(const vector& inPixels, unsigned rowSize); + static vector mirrorData(const vector& inPixels, unsigned rowSize); }; diff --git a/headers/utils.h b/headers/utils.h index ebd50ef..e423b37 100644 --- a/headers/utils.h +++ b/headers/utils.h @@ -12,7 +12,7 @@ #define GUARD_UTILS_H #include -#include +#include "mingl/mingl.h" // hardcoded values #define PLAYER_HEIGHT 100 diff --git a/src/configManagement.cpp b/src/configManagement.cpp index 405a702..607bad8 100644 --- a/src/configManagement.cpp +++ b/src/configManagement.cpp @@ -30,6 +30,12 @@ void sanitizeValue(string& val) { } } +void ConfigBuilder::dumpInternalValues() const { + for(const auto& ite : internalValues){ + cerr << ite.first << " -> " << ite.second << endl; + } +} + /* WARNING : This implementation of YAML is not meant to be complete, but to work with our specific needs * It also can't detect and report errors in a non-YAML-compliant file*/ @@ -213,6 +219,7 @@ int ConfigBuilder::getInt(const configKey& key, int def, int min, int max) const throw config_error("Value for key " + key + " do not follow preconditions : " + to_string(min) + "<=" + to_string(val) + "<=" + to_string(max)); } + return val; }catch(config_error& e){ cerr << e.what() << " . Using default value" << endl; return def; diff --git a/src/drawMenu.cpp b/src/drawMenu.cpp index 14207c6..9e1e791 100644 --- a/src/drawMenu.cpp +++ b/src/drawMenu.cpp @@ -11,11 +11,10 @@ #include #include -#include +#include "mingl/shape/rectangle.h" +#include "playMode.h" #include "pixelManager.h" #include "utils.h" -#include "god.h" -#include "mingl/shape/rectangle.h" using namespace nsShape; using namespace nsGraphics; diff --git a/src/game/display.cpp b/src/game/display.cpp index 1730160..54c9abb 100644 --- a/src/game/display.cpp +++ b/src/game/display.cpp @@ -15,7 +15,7 @@ /** Displays the screen once, and returns * The more important stuff must be drawn last */ -void Game::displayAll(unsigned fps) const { +void Game::displayAll() const { pm.drawSprite(pm.gameBackground); for (unsigned i = 0; i < this->grid.size(); ++i){ for (unsigned j = 0; j < this->grid[i].size(); ++j){ @@ -92,7 +92,6 @@ void applyBezier(Position& pos, const Position& point, const double percent) { pos += (point-pos)*percent; } -#include void Game::displayGod() const { switch (god.state) { case GodState::NONE: diff --git a/src/game/gameBasics.cpp b/src/game/gameBasics.cpp index 8f4fe73..76b0341 100644 --- a/src/game/gameBasics.cpp +++ b/src/game/gameBasics.cpp @@ -127,7 +127,7 @@ WinValue Game::enterGameLoop(){ // returns when game is finished if(arePlayersDead())return WinValue::INVADERS; - displayAll(fps); + displayAll(); pm.endFrame(); diff --git a/src/invaderGrids.cpp b/src/invaderGrids.cpp index 956af28..e71791b 100644 --- a/src/invaderGrids.cpp +++ b/src/invaderGrids.cpp @@ -8,8 +8,8 @@ * */ -#include #include +#include "invadersGrid.h" bool InvadersColumn::hasNoValid() const { return getOutterInvader()==size(); diff --git a/src/scoresManager.cpp b/src/scoresManager.cpp index d77e947..38a0684 100644 --- a/src/scoresManager.cpp +++ b/src/scoresManager.cpp @@ -12,7 +12,6 @@ #include #include #include -#include #include "scoresManager.h" // Our own format : kustom