diff -ur ScummVM-cvs20030119/scummvm/scumm/object.cpp ScummVM-cvs20030119+hack/scummvm/scumm/object.cpp
old
|
new
|
|
410 | 410 | } |
411 | 411 | } |
412 | 412 | |
| 413 | void Scumm::clearRoomObjects() |
| 414 | { |
| 415 | int i; |
| 416 | |
| 417 | if (_features & GF_SMALL_HEADER) { |
| 418 | for (i = 0; i < _numLocalObjects; i++) { |
| 419 | _objs[i].obj_nr = 0; |
| 420 | } |
| 421 | } else { |
| 422 | // FIXME: Locking/FlObjects stuff? |
| 423 | for (i = 0; i < _numLocalObjects; i++) { |
| 424 | if (_objs[i].obj_nr < 1) // Optimise codepath |
| 425 | continue; |
| 426 | |
| 427 | // Nuke all non-flObjects (flObjects are nuked in script.cpp) |
| 428 | if (_objs[i].fl_object_index == 0) { |
| 429 | _objs[i].obj_nr = 0; |
| 430 | } else { |
| 431 | // Nuke all unlocked flObjects |
| 432 | if (!(res.flags[rtFlObject][_objs[i].fl_object_index] & RF_LOCK)) { |
| 433 | nukeResource(rtFlObject, _objs[i].fl_object_index); |
| 434 | _objs[i].obj_nr = 0; |
| 435 | _objs[i].fl_object_index = 0; |
| 436 | } |
| 437 | } |
| 438 | } |
| 439 | } |
| 440 | } |
| 441 | |
413 | 442 | void Scumm::loadRoomObjects() |
414 | 443 | { |
415 | 444 | int i, j; |
… |
… |
|
432 | 461 | else |
433 | 462 | _numObjectsInRoom = READ_LE_UINT16(&(roomhdr->old.numObjects)); |
434 | 463 | |
435 | | // Clear out old room objects (FIXME: Locking/FlObjects stuff?) |
436 | | for (i = 0; i < _numLocalObjects; i++) { |
437 | | if (_objs[i].obj_nr < 1) // Optimise codepath |
438 | | continue; |
439 | | |
440 | | // Nuke all non-flObjects (flObjects are nuked in script.cpp) |
441 | | if (_objs[i].fl_object_index == 0) { |
442 | | _objs[i].obj_nr = 0; |
443 | | } else { |
444 | | // Nuke all unlocked flObjects |
445 | | if (!(res.flags[rtFlObject][_objs[i].fl_object_index] & RF_LOCK)) { |
446 | | nukeResource(rtFlObject, _objs[i].fl_object_index); |
447 | | _objs[i].obj_nr = 0; |
448 | | _objs[i].fl_object_index = 0; |
449 | | } |
450 | | } |
451 | | } |
452 | | |
453 | 464 | if (_numObjectsInRoom == 0) |
454 | 465 | return; |
455 | 466 | |
… |
… |
|
544 | 555 | if (_numObjectsInRoom > _numLocalObjects) |
545 | 556 | error("More than %d objects in room %d", _numLocalObjects, _roomResource); |
546 | 557 | |
547 | | // Clear out old room objects |
548 | | for (i = 0; i < _numLocalObjects; i++) { |
549 | | _objs[i].obj_nr = 0; |
550 | | } |
551 | | |
552 | 558 | searchptr = room; |
553 | 559 | for (i = 0; i < _numObjectsInRoom; i++) { |
554 | 560 | od = &_objs[findLocalObjectSlot()]; |
diff -ur ScummVM-cvs20030119/scummvm/scumm/scumm.h ScummVM-cvs20030119+hack/scummvm/scumm/scumm.h
old
|
new
|
|
532 | 532 | bool isResourceInUse(int type, int i); |
533 | 533 | bool isResourceLoaded(int type, int index); |
534 | 534 | void initRoomSubBlocks(); |
| 535 | void clearRoomObjects(); |
535 | 536 | void loadRoomObjects(); |
536 | 537 | void loadRoomObjectsSmall(); |
537 | 538 | void readArrayFromIndexFile(); |
diff -ur ScummVM-cvs20030119/scummvm/scumm/scummvm.cpp ScummVM-cvs20030119+hack/scummvm/scumm/scummvm.cpp
old
|
new
|
|
651 | 651 | if (room != 0) |
652 | 652 | ensureResourceLoaded(rtRoom, room); |
653 | 653 | |
| 654 | clearRoomObjects(); |
| 655 | |
654 | 656 | if (_currentRoom == 0) { |
655 | 657 | _ENCD_offs = _EXCD_offs = 0; |
656 | 658 | _numObjectsInRoom = 0; |