correção da impressão por nivel

parent 83f0ea91
...@@ -261,15 +261,18 @@ void cutRange(quadtree* qt) { ...@@ -261,15 +261,18 @@ void cutRange(quadtree* qt) {
} }
void printarCompacto(quadtree* qt, SDL_Surface* img, SDL_Renderer *renderer, int &pixels) { void printarCompacto(quadtree* qt, SDL_Surface* img, SDL_Renderer *renderer, int &pixels) {
pixels++;
if (qt->nivel == nivelCompacto ) { if (qt->nivel == nivelCompacto ) {
pixels++;
SDL_SetRenderDrawColor(renderer, qt->r, qt->g, qt->b, 0); SDL_SetRenderDrawColor(renderer, qt->r, qt->g, qt->b, 0);
for (int i = qt->x1; i < (qt->x2 + qt->x1); i++) { if (qt->x2 > 0) {
for (int j = qt->y1; j < (qt->y2 + qt->y1); j++) { SDL_Rect rect;
rect.x = qt->x1; rect.y = qt->y1;
SDL_RenderDrawPoint(renderer, i, j); rect.w = qt->x2 ; rect.h = qt->y2;
} SDL_RenderFillRect(renderer,&rect);
} }
else
SDL_RenderDrawPoint(renderer, qt->x, qt->y);
} }
else { else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment