Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Whoops, it's not quite that easy - fixed bug in SDL_ClearDirtyRects()

  • Loading branch information
slouken committed Aug 11, 2007
1 parent 79a03a1 commit 50fab65fe70570da6a05f9e188728ed8c6da1186
Showing with 14 additions and 1 deletion.
  1. +14 −1 src/video/SDL_rect.c
@@ -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;
}

0 comments on commit 50fab65

Please sign in to comment.