const mania
This commit is contained in:
parent
76cd5c4e63
commit
0c72d11ab9
1 changed files with 5 additions and 5 deletions
|
@ -2,9 +2,8 @@
|
||||||
#include "../includes/Ecran.hpp"
|
#include "../includes/Ecran.hpp"
|
||||||
#include "../includes/PieceDames.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
|
// Création du plateau vide
|
||||||
plateau = new Piece **[t];
|
|
||||||
for (int i = 0; i < t; i++) {
|
for (int i = 0; i < t; i++) {
|
||||||
plateau[i] = new Piece *[t];
|
plateau[i] = new Piece *[t];
|
||||||
for (int j = 0; j < t; j++) {
|
for (int j = 0; j < t; j++) {
|
||||||
|
@ -41,7 +40,8 @@ void Plateau::initialiserPlateau(Joueur &j1, Joueur &j2) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Plateau::afficherPlateau(const bool d) {
|
void Plateau::afficherPlateau(const bool d) {
|
||||||
float tailleCellule = static_cast<float>(Ecran::window.getSize().x) / taille;
|
const float tailleCellule =
|
||||||
|
static_cast<float>(Ecran::window.getSize().x) / taille;
|
||||||
|
|
||||||
// Adapte la vue pour le redimensionnement
|
// Adapte la vue pour le redimensionnement
|
||||||
const float tailleFenetre = taille * tailleCellule;
|
const float tailleFenetre = taille * tailleCellule;
|
||||||
|
@ -52,8 +52,8 @@ void Plateau::afficherPlateau(const bool d) {
|
||||||
sf::RectangleShape cell(sf::Vector2f(tailleCellule, tailleCellule));
|
sf::RectangleShape cell(sf::Vector2f(tailleCellule, tailleCellule));
|
||||||
for (int i = 0; i < taille; i++) {
|
for (int i = 0; i < taille; i++) {
|
||||||
for (int j = 0; j < taille; j++) {
|
for (int j = 0; j < taille; j++) {
|
||||||
float x = i * tailleCellule;
|
const float x = i * tailleCellule;
|
||||||
float y = j * tailleCellule;
|
const float y = j * tailleCellule;
|
||||||
|
|
||||||
// Position de la cellule
|
// Position de la cellule
|
||||||
cell.setPosition(x, y);
|
cell.setPosition(x, y);
|
||||||
|
|
Reference in a new issue