Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Whoops, it's not quite that easy - fixed bug in SDL_ClearDirtyRects()
  • Loading branch information
slouken committed Aug 11, 2007
1 parent 79a03a1 commit 50fab65
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/video/SDL_rect.c
Expand Up @@ -149,7 +149,20 @@ SDL_AddDirtyRect(SDL_DirtyRectList * list, const SDL_Rect * rect)
void
SDL_ClearDirtyRects(SDL_DirtyRectList * list)
{
list->free = list->list;
SDL_DirtyRect *prev, *curr;

/* Skip to the end of the free list */
prev = NULL;
for (curr = list->free; curr; curr = curr->next) {
prev = curr;
}

/* Add the list entries to the end */
if (prev) {
prev->next = list->list;
} else {
list->free = list->list;
}
list->list = NULL;
list->count = 0;
}
Expand Down

0 comments on commit 50fab65

Please sign in to comment.