Fix erreur de calculs de pointeurs
This commit is contained in:
parent
b9d1d04462
commit
3451a57bcf
@ -1,9 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <array>
|
||||
#include <optional>
|
||||
#include <bitset>
|
||||
#include <GOL.h>
|
||||
#include "GridTeamH.h"
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "GridTeamH.h"
|
||||
#include "GOL.h"
|
||||
#include <iostream>
|
||||
#include <algorithm>
|
||||
|
||||
// Constructeur Grid par défaut
|
||||
GridTeamH::GridTeamH()
|
||||
@ -25,8 +25,8 @@ void GridTeamH::resize(size_t width, size_t height, CellType initValue)
|
||||
{
|
||||
mWidth = width;
|
||||
mHeight = height;
|
||||
mData.resize((width * height) + width);
|
||||
mIntermediateData.resize((width * height) + width);
|
||||
mData.resize(width * height);
|
||||
mIntermediateData.resize(width * height);
|
||||
|
||||
fill(initValue, false);
|
||||
}
|
||||
@ -170,21 +170,21 @@ void GridTeamH::fillBorder(CellType value)
|
||||
}
|
||||
|
||||
// DROITE
|
||||
e_ptr += mWidth * mHeight;
|
||||
e_ptr += mWidth * (mHeight - 1);
|
||||
while (ptr < e_ptr) {
|
||||
*ptr = value;
|
||||
ptr += mWidth;
|
||||
}
|
||||
|
||||
// DESSOUS
|
||||
e_ptr -= mWidth;
|
||||
e_ptr -= (mWidth - 1);
|
||||
while (ptr > e_ptr) {
|
||||
*ptr = value;
|
||||
ptr--;
|
||||
}
|
||||
|
||||
// GAUCHE
|
||||
e_ptr -= mWidth * mHeight;
|
||||
e_ptr -= mWidth * (mHeight - 1);
|
||||
while (ptr > e_ptr) {
|
||||
*ptr = value;
|
||||
ptr -= mWidth;
|
||||
|
@ -1,6 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
#include <random>
|
||||
#include "GOL.h"
|
||||
|
Loading…
Reference in New Issue
Block a user