mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-17 07:07:10 +00:00
DIRECTOR: LINGO: Fix window fields
This commit is contained in:
parent
f04cd38da4
commit
0b82839b44
@ -324,34 +324,44 @@ bool Stage::hasProp(const Common::String &propName) {
|
||||
}
|
||||
|
||||
Datum Stage::getProp(const Common::String &propName) {
|
||||
if (g_lingo->_theEntityFields.contains(propName)) {
|
||||
switch (g_lingo->_theEntityFields[propName]->field) {
|
||||
case kTheVisible:
|
||||
return isVisible();
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (g_lingo->_theEntityFields.contains(propName) && g_lingo->_theEntityFields[propName]->entity == kTheWindow) {
|
||||
return getField(g_lingo->_theEntityFields[propName]->field);
|
||||
}
|
||||
|
||||
warning("Stage::getProp: unhandled property '%s'", propName.c_str());
|
||||
warning("Stage::getProp: unknown property '%s'", propName.c_str());
|
||||
return Datum();
|
||||
}
|
||||
|
||||
bool Stage::setProp(const Common::String &propName, const Datum &value) {
|
||||
if (g_lingo->_theEntityFields.contains(propName)) {
|
||||
switch (g_lingo->_theEntityFields[propName]->field) {
|
||||
case kTheVisible:
|
||||
setVisible(value.asInt());
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (g_lingo->_theEntityFields.contains(propName) && g_lingo->_theEntityFields[propName]->entity == kTheWindow) {
|
||||
return setField(g_lingo->_theEntityFields[propName]->field, value);
|
||||
}
|
||||
|
||||
warning("Stage::getProp: unhandled property '%s'", propName.c_str());
|
||||
warning("Stage::setProp: unknown property '%s'", propName.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
Datum Stage::getField(int field) {
|
||||
switch (field) {
|
||||
case kTheVisible:
|
||||
return isVisible();
|
||||
default:
|
||||
warning("Stage::getField: unhandled field '%s'", g_lingo->field2str(field));
|
||||
return Datum();
|
||||
}
|
||||
}
|
||||
|
||||
bool Stage::setField(int field, const Datum &value) {
|
||||
switch (field) {
|
||||
case kTheVisible:
|
||||
setVisible(value.asInt());
|
||||
return true;
|
||||
default:
|
||||
warning("Stage::setField: unhandled field '%s'", g_lingo->field2str(field));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void LM::m_close(int nargs) {
|
||||
Stage *me = static_cast<Stage *>(g_lingo->_currentMe.u.obj);
|
||||
me->setVisible(false);
|
||||
|
@ -56,6 +56,8 @@ public:
|
||||
virtual bool hasProp(const Common::String &propName) = 0;
|
||||
virtual Datum getProp(const Common::String &propName) = 0;
|
||||
virtual bool setProp(const Common::String &propName, const Datum &value) = 0;
|
||||
virtual Datum getField(int field) = 0;
|
||||
virtual bool setField(int field, const Datum &value) = 0;
|
||||
};
|
||||
|
||||
template <typename Derived>
|
||||
@ -157,6 +159,12 @@ public:
|
||||
virtual bool setProp(const Common::String &propName, const Datum &value) {
|
||||
return false;
|
||||
};
|
||||
virtual Datum getField(int field) {
|
||||
return Datum();
|
||||
};
|
||||
virtual bool setField(int field, const Datum &value) {
|
||||
return false;
|
||||
};
|
||||
|
||||
protected:
|
||||
static SymbolHash *_methods;
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include "director/score.h"
|
||||
#include "director/stage.h"
|
||||
#include "director/lingo/lingo.h"
|
||||
#include "director/lingo/lingo-builtins.h"
|
||||
#include "director/lingo/lingo-code.h"
|
||||
#include "director/lingo/lingo-object.h"
|
||||
#include "director/lingo/lingo-the.h"
|
||||
@ -149,7 +150,7 @@ TheEntity entities[] = {
|
||||
{ kTheTraceLoad, "traceLoad", false, 4 }, // D4 p
|
||||
{ kTheTraceLogFile, "traceLogFile", false, 4 }, // D4 p
|
||||
{ kTheUpdateMovieEnabled,"updateMovieEnabled",false,4 },// D4 p
|
||||
// { kTheWindow, "window", true, 4 }, // D4
|
||||
{ kTheWindow, "window", true, 4 }, // D4
|
||||
{ kTheWindowList, "windowList", false, 4 }, // D4 p
|
||||
{ kTheNOEntity, NULL, false, 0 }
|
||||
};
|
||||
@ -578,6 +579,11 @@ Datum Lingo::getTheEntity(int entity, Datum &id, int field) {
|
||||
d.type = INT;
|
||||
d.u.i = _vm->getMacTicks() - _vm->getCurrentMovie()->_lastTimerReset;
|
||||
break;
|
||||
case kTheWindow:
|
||||
g_lingo->push(id);
|
||||
LB::b_window(1);
|
||||
d = g_lingo->pop().u.obj->getField(field);
|
||||
break;
|
||||
case kTheWindowList:
|
||||
d = g_lingo->_windowList;
|
||||
break;
|
||||
@ -666,6 +672,11 @@ void Lingo::setTheEntity(int entity, Datum &id, int field, Datum &d) {
|
||||
case kTheTimeoutScript:
|
||||
setPrimaryEventHandler(kEventTimeout, d.asString());
|
||||
break;
|
||||
case kTheWindow:
|
||||
g_lingo->push(id);
|
||||
LB::b_window(1);
|
||||
g_lingo->pop().u.obj->setField(field, d);
|
||||
break;
|
||||
case kTheWindowList:
|
||||
if (d.type == ARRAY) {
|
||||
g_lingo->_windowList = d;
|
||||
|
@ -142,6 +142,8 @@ class Stage : public Graphics::MacWindow, public Object<Stage> {
|
||||
virtual bool hasProp(const Common::String &propName);
|
||||
virtual Datum getProp(const Common::String &propName);
|
||||
virtual bool setProp(const Common::String &propName, const Datum &value);
|
||||
virtual Datum getField(int field);
|
||||
virtual bool setField(int field, const Datum &value);
|
||||
|
||||
public:
|
||||
Common::List<Common::Rect> _dirtyRects;
|
||||
|
Loading…
Reference in New Issue
Block a user