comparison src/video/SDL_rect.c @ 2224:29cc9e9c76bd

Whoops, it's not quite that easy - fixed bug in SDL_ClearDirtyRects()
author Sam Lantinga <slouken@libsdl.org>
date Sat, 11 Aug 2007 21:42:36 +0000
parents 175754591a13
children 12ea0fdc0df2
comparison
equal deleted inserted replaced
2223:175754591a13 2224:29cc9e9c76bd
147 } 147 }
148 148
149 void 149 void
150 SDL_ClearDirtyRects(SDL_DirtyRectList * list) 150 SDL_ClearDirtyRects(SDL_DirtyRectList * list)
151 { 151 {
152 list->free = list->list; 152 SDL_DirtyRect *prev, *curr;
153
154 /* Skip to the end of the free list */
155 prev = NULL;
156 for (curr = list->free; curr; curr = curr->next) {
157 prev = curr;
158 }
159
160 /* Add the list entries to the end */
161 if (prev) {
162 prev->next = list->list;
163 } else {
164 list->free = list->list;
165 }
153 list->list = NULL; 166 list->list = NULL;
154 list->count = 0; 167 list->count = 0;
155 } 168 }
156 169
157 void 170 void