/ * ExtractObject: Get an object_node from ptr, and increment * ptr appropriately. Place data in given object node. */
| 317 | * ptr appropriately. Place data in given object node. |
| 318 | */ |
| 319 | void ExtractObject(char **ptr, object_node *item, bool includeLight) |
| 320 | { |
| 321 | Extract(ptr, &item->id, SIZE_ID); |
| 322 | if (IsNumberObj(item->id)) |
| 323 | Extract(ptr, &item->amount, SIZE_AMOUNT); |
| 324 | else |
| 325 | item->amount = 0; |
| 326 | Extract(ptr, &item->icon_res, SIZE_ID); |
| 327 | Extract(ptr, &item->name_res, SIZE_ID); |
| 328 | Extract(ptr, &item->flags, 4); // includes drawfx_mask bits |
| 329 | Extract(ptr, &item->rarity, SIZE_ID); |
| 330 | |
| 331 | if (includeLight) |
| 332 | ExtractDLighting(ptr, &item->dLighting); |
| 333 | |
| 334 | ExtractPaletteTranslation(ptr,&item->translation,&item->effect); |
| 335 | item->normal_translation = item->translation; |
| 336 | item->secondtranslation = XLAT_FILTERWHITE90; |
| 337 | |
| 338 | ExtractAnimation(ptr, &item->normal_animate); |
| 339 | item->animate = &item->normal_animate; |
| 340 | |
| 341 | item->normal_overlays = ExtractOverlays(ptr); |
| 342 | item->overlays = &item->normal_overlays; |
| 343 | |
| 344 | if (OF_BOUNCING == (OF_BOUNCING & item->flags)) |
| 345 | { |
| 346 | item->bounceTime = (WORD)(rand() % 1000); |
| 347 | } |
| 348 | if (OF_PHASING == (OF_PHASING & item->flags)) |
| 349 | { |
| 350 | item->phaseTime = (WORD)(rand() % 1000); |
| 351 | } |
| 352 | } |
| 353 | |
| 354 | void ExtractObjectNoLight(char **ptr, object_node *item) |
| 355 | { |
no test coverage detected