RCS file: /cvsroot/scummvm/scummvm/scumm/actor.cpp,v
retrieving revision 1.360
diff -u -r1.360 actor.cpp
|
|
|
981 | 981 | for (int i = 1; i < _numActors; i++) { |
982 | 982 | if (_version == 8 && _actors[i]._layer < 0) |
983 | 983 | continue; |
984 | | if (_actors[i].isInCurrentRoom() && _actors[i]._costume) |
| 984 | if (_actors[i].isInCurrentRoom()) { |
985 | 985 | _sortedActors[numactors++] = &_actors[i]; |
| 986 | } |
986 | 987 | } |
987 | 988 | if (!numactors) { |
988 | 989 | return; |
… |
… |
|
990 | 991 | |
991 | 992 | // Sort actors by position before we draw them (to ensure that actors in |
992 | 993 | // 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 | } |
996 | 1003 | |
997 | 1004 | // Finally draw the now sorted actors |
| 1005 | Actor** end = _sortedActors + numactors; |
998 | 1006 | for (Actor** ac = _sortedActors; ac != end; ++ac) { |
999 | 1007 | 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 | } |
1004 | 1012 | } |
1005 | 1013 | |
1006 | 1014 | if (_features & GF_NEW_COSTUMES) |