mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-07 11:27:44 +00:00
GRIM: Make the ObjectState handling more straightforward and similar to original.
This commit is contained in:
parent
4e41869b54
commit
93001ecf1b
@ -930,7 +930,7 @@ void L1_SendObjectToBack() {
|
||||
lua_Object param = lua_getparam(1);
|
||||
if (lua_isuserdata(param) && lua_tag(param) == MKTAG('S','T','A','T')) {
|
||||
ObjectState *state = getobjectstate(param);
|
||||
g_grim->getCurrScene()->moveObjectStateToFirst(state);
|
||||
g_grim->getCurrScene()->moveObjectStateToBack(state);
|
||||
}
|
||||
}
|
||||
|
||||
@ -938,7 +938,7 @@ void L1_SendObjectToFront() {
|
||||
lua_Object param = lua_getparam(1);
|
||||
if (lua_isuserdata(param) && lua_tag(param) == MKTAG('S','T','A','T')) {
|
||||
ObjectState *state = getobjectstate(param);
|
||||
g_grim->getCurrScene()->moveObjectStateToLast(state);
|
||||
g_grim->getCurrScene()->moveObjectStateToFront(state);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -524,7 +524,7 @@ void Scene::drawBackground() const {
|
||||
}
|
||||
|
||||
void Scene::drawBitmaps(ObjectState::Position stage) {
|
||||
for (StateList::iterator i = _states.begin(); i != _states.end(); ++i) {
|
||||
for (StateList::iterator i = _states.reverse_begin(); i != _states.end(); --i) {
|
||||
if ((*i)->getPos() == stage && _currSetup == _setups + (*i)->getSetupID())
|
||||
(*i)->draw();
|
||||
}
|
||||
@ -699,12 +699,16 @@ void Scene::getSoundParameters(int *minVolume, int *maxVolume) {
|
||||
*maxVolume = _maxVolume;
|
||||
}
|
||||
|
||||
void Scene::moveObjectStateToFirst(ObjectState *s) {
|
||||
void Scene::addObjectState(ObjectState *s) {
|
||||
_states.push_front(s);
|
||||
}
|
||||
|
||||
void Scene::moveObjectStateToFront(ObjectState *s) {
|
||||
_states.remove(s);
|
||||
_states.push_front(s);
|
||||
}
|
||||
|
||||
void Scene::moveObjectStateToLast(ObjectState *s) {
|
||||
void Scene::moveObjectStateToBack(ObjectState *s) {
|
||||
_states.remove(s);
|
||||
_states.push_back(s);
|
||||
}
|
||||
|
@ -92,16 +92,13 @@ public:
|
||||
void shrinkBoxes(float radius);
|
||||
void unshrinkBoxes();
|
||||
|
||||
void addObjectState(ObjectState *s) {
|
||||
_states.push_back(s);
|
||||
}
|
||||
|
||||
void addObjectState(ObjectState *s);
|
||||
void deleteObjectState(ObjectState *s) {
|
||||
_states.remove(s);
|
||||
}
|
||||
|
||||
void moveObjectStateToFirst(ObjectState *s);
|
||||
void moveObjectStateToLast(ObjectState *s);
|
||||
void moveObjectStateToFront(ObjectState *s);
|
||||
void moveObjectStateToBack(ObjectState *s);
|
||||
|
||||
ObjectState *findState(const char *filename);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user