Skip to content

Commit

Permalink
WAGE: Fix object sorting. Fixes many glitches
Browse files Browse the repository at this point in the history
  • Loading branch information
sev- committed Apr 12, 2016
1 parent cd01e2d commit f5979ab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion engines/wage/entities.cpp
Expand Up @@ -141,7 +141,7 @@ void Scene::paint(Graphics::Surface *surface, int x, int y) {
_design->paint(surface, ((WageEngine *)g_engine)->_world->_patterns, x, y);

for (ObjList::const_iterator it = _objs.begin(); it != _objs.end(); ++it) {
debug(2, "paining Obj: %s", (*it)->_name.c_str());
debug(2, "paining Obj: %s, index: %d, type: %d", (*it)->_name.c_str(), (*it)->_index, (*it)->_type);
(*it)->_design->paint(surface, ((WageEngine *)g_engine)->_world->_patterns, x, y);
}

Expand Down
4 changes: 2 additions & 2 deletions engines/wage/world.cpp
Expand Up @@ -431,9 +431,9 @@ static bool objComparator(const Obj *o1, const Obj *o2) {
bool o1Immobile = (o1->_type == Obj::IMMOBILE_OBJECT);
bool o2Immobile = (o2->_type == Obj::IMMOBILE_OBJECT);
if (o1Immobile == o2Immobile) {
return o1->_index - o2->_index;
return o1->_index < o2->_index;
}
return o1Immobile ? -1 : 1;
return o1Immobile;
}

void World::move(Obj *obj, Scene *scene, bool skipSort) {
Expand Down

0 comments on commit f5979ab

Please sign in to comment.