diff --git a/src/Plateau.cpp b/src/Plateau.cpp index b006b47..f6ba726 100644 --- a/src/Plateau.cpp +++ b/src/Plateau.cpp @@ -2,9 +2,8 @@ #include "../includes/Ecran.hpp" #include "../includes/PieceDames.hpp" -Plateau::Plateau(int t) : taille(t) { +Plateau::Plateau(int t) : taille(t), plateau(new Piece **[t]) { // Création du plateau vide - plateau = new Piece **[t]; for (int i = 0; i < t; i++) { plateau[i] = new Piece *[t]; for (int j = 0; j < t; j++) { @@ -41,7 +40,8 @@ void Plateau::initialiserPlateau(Joueur &j1, Joueur &j2) { } void Plateau::afficherPlateau(const bool d) { - float tailleCellule = static_cast(Ecran::window.getSize().x) / taille; + const float tailleCellule = + static_cast(Ecran::window.getSize().x) / taille; // Adapte la vue pour le redimensionnement const float tailleFenetre = taille * tailleCellule; @@ -52,8 +52,8 @@ void Plateau::afficherPlateau(const bool d) { sf::RectangleShape cell(sf::Vector2f(tailleCellule, tailleCellule)); for (int i = 0; i < taille; i++) { for (int j = 0; j < taille; j++) { - float x = i * tailleCellule; - float y = j * tailleCellule; + const float x = i * tailleCellule; + const float y = j * tailleCellule; // Position de la cellule cell.setPosition(x, y);