Correction du bug de l'affichage du premier point en pbp manuel

This commit is contained in:
Tatiyk
2017-01-27 19:15:11 +01:00
parent 7f7edc98ca
commit 98149be568
2 changed files with 26 additions and 22 deletions

@ -88,28 +88,7 @@ Point** affichageLogs(sfRenderWindow *const window, sfRenderTexture *renderTextu
afficherPoint(renderTexture, tabPoint[i].posConv, &tabPointeursCercle[(*nbPointsAffiches)++], COULEUR_POINT);
}
}
else
{
if(tabPoint[i].type != AGGLOMERAT)
{
if(i>0)
{
free(tabPointeursCercle[*nbPointsAffiches]);
afficherPoint(renderTexture, tabPoint[i-1].posConv, &tabPointeursCercle[*nbPointsAffiches], COULEUR_POINT);
}
tmpPtsAffiches[i - nbPtsNonAffiches] = tabPoint + i;
afficherPoint(renderTexture, tabPoint[i].posConv, &tabPointeursCercle[(*nbPointsAffiches)++], COULEUR_POINT_ACTUEL);
}
else
{
afficherAgglo(renderTexture, &agglos[numAgglo], &tabPointeursCercleAgglos[numAgglo], nbPointAgglosMin, carte, COULEUR_AGGLO);
i += agglos[numAgglo].nbPts;
nbPtsNonAffiches += agglos[numAgglo].nbPts;
numAgglo++;
}
}
tmpPtsAffiches[i - nbPtsNonAffiches] = tabPoint + i;
}
@ -150,6 +129,7 @@ Point** affichageLogs(sfRenderWindow *const window, sfRenderTexture *renderTextu
if(optimisation)
{
displayBackgroundSprite(window, renderSprite);
}
}
}
@ -229,6 +209,26 @@ Point** affichageLogs(sfRenderWindow *const window, sfRenderTexture *renderTextu
sfTexture_destroy(originalTexture);
}
if(mode == MODE_PBP_MANUAL || mode == MODE_PBP_AUTOMATIC)
{
if(tabPoint[i].type != AGGLOMERAT)
{
if(i>0)
{
free(tabPointeursCercle[*nbPointsAffiches]);
afficherPoint(renderTexture, tabPoint[i-1].posConv, &tabPointeursCercle[*nbPointsAffiches], COULEUR_POINT);
}
tmpPtsAffiches[i - nbPtsNonAffiches] = tabPoint + i;
afficherPoint(renderTexture, tabPoint[i].posConv, &tabPointeursCercle[(*nbPointsAffiches)++], COULEUR_POINT_ACTUEL);
}
else
{
afficherAgglo(renderTexture, &agglos[numAgglo], &tabPointeursCercleAgglos[numAgglo], nbPointAgglosMin, carte, COULEUR_AGGLO);
i += agglos[numAgglo].nbPts;
nbPtsNonAffiches += agglos[numAgglo].nbPts;
numAgglo++;
}
}
}
// Pour le mode MODE_GLOBAL, une fois l'affichage terminé, on y rajoute les agglomérats

@ -106,6 +106,10 @@
* @brief Couleur utilisée par défaut pour afficher un agglomérat.*/
#define COULEUR_AGGLO (sfColor){0, 0, 255, 128}
/** @def COULEUR_AGGLO_ACTUEL
* @brief Couleur utilisée pour afficher le dernier agglo affiché en mode point par point.*/
#define COULEUR_AGGLO_ACTUEL (sfColor){1, 215, 88, 128}
/** @def COULEUR_AGGLO_SUPPRIME
* @brief Couleur utilisée pour afficher un agglomérat sélectionné pour être supprimé.*/
#define COULEUR_AGGLO_SUPPRIME (sfColor){0, 0, 0, 128}