Commit 60cc07dd authored by Sam Lantinga's avatar Sam Lantinga

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

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402586
parent 1c3727d1
...@@ -149,7 +149,20 @@ SDL_AddDirtyRect(SDL_DirtyRectList * list, const SDL_Rect * rect) ...@@ -149,7 +149,20 @@ SDL_AddDirtyRect(SDL_DirtyRectList * list, const SDL_Rect * rect)
void void
SDL_ClearDirtyRects(SDL_DirtyRectList * list) 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->list = NULL;
list->count = 0; list->count = 0;
} }
......
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