position Scroller items with a Lua function

add ActorFrame::m_bDrawByZPosition
This commit is contained in:
Chris Danford
2005-05-03 09:29:54 +00:00
parent 18e3ad2666
commit 8eaf93a23d
9 changed files with 166 additions and 110 deletions
+12
View File
@@ -399,6 +399,18 @@ void ActorUtil::LoadAllCommands( Actor& actor, const CString &sType )
}
}
static bool CompareActorsByZPosition(const Actor *p1, const Actor *p2)
{
return p1->GetZ() < p2->GetZ();
}
void ActorUtil::SortByZPosition( vector<Actor*> &vActors )
{
// Preserve ordering of Actors with equal Z positions.
stable_sort( vActors.begin(), vActors.end(), CompareActorsByZPosition );
}
/*
* (c) 2003-2004 Chris Danford
* All rights reserved.