Ticket #1864: ft_1093867.diff

File ft_1093867.diff, 1.6 KB (added by cyxx, 19 years ago)
  • scumm/actor.cpp

    RCS file: /cvsroot/scummvm/scummvm/scumm/actor.cpp,v
    retrieving revision 1.360
    diff -u -r1.360 actor.cpp
     
    981981        for (int i = 1; i < _numActors; i++) {
    982982                if (_version == 8 && _actors[i]._layer < 0)
    983983                        continue;
    984                 if (_actors[i].isInCurrentRoom() && _actors[i]._costume)
     984                if (_actors[i].isInCurrentRoom()) {
    985985                        _sortedActors[numactors++] = &_actors[i];
     986                }
    986987        }
    987988        if (!numactors) {
    988989                return;
     
    990991
    991992        // Sort actors by position before we draw them (to ensure that actors in
    992993        // front are drawn after those "behind" them).
    993         qsort(_sortedActors, numactors, sizeof (Actor*), compareDrawOrder);
    994 
    995         Actor** end = _sortedActors + numactors;
     994        for (int j = 0; j < numactors; ++j) {
     995                for (int i = 0; i < numactors; ++i) {
     996                        int sc_actor1 = _sortedActors[j]->_pos.y - _sortedActors[j]->_layer * 2000;
     997                        int sc_actor2 = _sortedActors[i]->_pos.y - _sortedActors[i]->_layer * 2000;
     998                        if (sc_actor1 < sc_actor2) {
     999                                SWAP(_sortedActors[i], _sortedActors[j]);
     1000                        }
     1001                }
     1002        }
    9961003
    9971004        // Finally draw the now sorted actors
     1005        Actor** end = _sortedActors + numactors;
    9981006        for (Actor** ac = _sortedActors; ac != end; ++ac) {
    9991007                Actor* a = *ac;
    1000                 CHECK_HEAP
    1001                 a->drawActorCostume();
    1002                 CHECK_HEAP
    1003                 a->animateCostume();
     1008                if (a->_costume) {
     1009                        a->drawActorCostume();
     1010                        a->animateCostume();
     1011                }
    10041012        }
    10051013       
    10061014        if (_features & GF_NEW_COSTUMES)