mirror of
https://github.com/yawut/SDL.git
synced 2026-08-26 02:35:06 -05:00
Whoops, it's not quite that easy - fixed bug in SDL_ClearDirtyRects()
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user