/ * ExtractAnimation: Get an animation structure from ptr, and increment * ptr appropriately. Place data in given animation structure. */
| 220 | * ptr appropriately. Place data in given animation structure. |
| 221 | */ |
| 222 | void ExtractAnimation(char **ptr, Animate *a) |
| 223 | { |
| 224 | Extract(ptr, &a->animation, SIZE_ANIMATE); |
| 225 | |
| 226 | // Read animation-type dependent stuff |
| 227 | switch(a->animation) |
| 228 | { |
| 229 | case ANIMATE_NONE: |
| 230 | Extract(ptr, &a->group, SIZE_ANIMATE_GROUP); |
| 231 | a->group = BitmapGroupSToC(a->group); |
| 232 | break; |
| 233 | |
| 234 | case ANIMATE_CYCLE: |
| 235 | Extract(ptr, &a->period, 4); |
| 236 | Extract(ptr, &a->group_low, SIZE_ANIMATE_GROUP); |
| 237 | Extract(ptr, &a->group_high, SIZE_ANIMATE_GROUP); |
| 238 | a->group_low = BitmapGroupSToC(a->group_low); |
| 239 | a->group_high = BitmapGroupSToC(a->group_high); |
| 240 | a->group = a->group_low; |
| 241 | a->tick = a->period; |
| 242 | break; |
| 243 | |
| 244 | case ANIMATE_ONCE: |
| 245 | Extract(ptr, &a->period, 4); |
| 246 | Extract(ptr, &a->group_low, SIZE_ANIMATE_GROUP); |
| 247 | Extract(ptr, &a->group_high, SIZE_ANIMATE_GROUP); |
| 248 | Extract(ptr, &a->group_final, SIZE_ANIMATE_GROUP); |
| 249 | a->group_low = BitmapGroupSToC(a->group_low); |
| 250 | a->group_high = BitmapGroupSToC(a->group_high); |
| 251 | a->group_final = BitmapGroupSToC(a->group_final); |
| 252 | a->group = a->group_low; |
| 253 | a->tick = a->period; |
| 254 | break; |
| 255 | |
| 256 | default: |
| 257 | debug(("Unknown animation type %d read from server\n", a->animation)); |
| 258 | a->group = 0; |
| 259 | break; |
| 260 | } |
| 261 | } |
| 262 | /********************************************************************/ |
| 263 | /* |
| 264 | * ExtractOverlays: Get overlay structures from ptr, |
no test coverage detected