From 8f236d0df45e953d13138a9af50681d857f4c1c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Leclaire-Fournier?= Date: Wed, 7 Feb 2024 19:46:51 -0500 Subject: [PATCH] Fix artefacts --- GPA675Lab1GOL/GOLTeamH.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/GPA675Lab1GOL/GOLTeamH.cpp b/GPA675Lab1GOL/GOLTeamH.cpp index 21376c5..1989dd0 100644 --- a/GPA675Lab1GOL/GOLTeamH.cpp +++ b/GPA675Lab1GOL/GOLTeamH.cpp @@ -253,7 +253,10 @@ void GOLTeamH::setState(int x, int y, State state) //! \param state L'état d'initialisation des cellules. void GOLTeamH::fill(State state) { - mData.fill(state, mBorderManagement == GOL::BorderManagement::immutableAsIs); + mData.fill(state, + mBorderManagement == GOL::BorderManagement::immutableAsIs || + mBorderManagement == GOL::BorderManagement::warping || + mBorderManagement == GOL::BorderManagement::mirror); modifyBorderIfNecessary(reinterpret_cast(mData.data()), reinterpret_cast(mData.intData())); mIteration = 0; @@ -272,7 +275,10 @@ void GOLTeamH::fill(State state) //! \param firstCell L'état de la première cellule. void GOLTeamH::fillAlternately(State firstCell) { - mData.fillAlternately(firstCell, mBorderManagement == GOL::BorderManagement::immutableAsIs); + mData.fillAlternately(firstCell, + mBorderManagement == GOL::BorderManagement::immutableAsIs || + mBorderManagement == GOL::BorderManagement::warping || + mBorderManagement == GOL::BorderManagement::mirror); modifyBorderIfNecessary(reinterpret_cast(mData.data()), reinterpret_cast(mData.intData())); mIteration = 0; @@ -292,7 +298,10 @@ void GOLTeamH::fillAlternately(State firstCell) //! vivante. La valeur doit être comprise entre 0.0 et 1.0 inclusivement. void GOLTeamH::randomize(double percentAlive) { - mData.randomize(percentAlive, mBorderManagement == GOL::BorderManagement::immutableAsIs); + mData.randomize(percentAlive, + mBorderManagement == GOL::BorderManagement::immutableAsIs || + mBorderManagement == GOL::BorderManagement::warping || + mBorderManagement == GOL::BorderManagement::mirror); modifyBorderIfNecessary(reinterpret_cast(mData.data()), reinterpret_cast(mData.intData())); mIteration = 0;