Skip to content

Commit

Permalink
DIRECTOR: LINGO: Implement kTheModified field in CastMember::getField()
Browse files Browse the repository at this point in the history
  • Loading branch information
r41k0u committed Jun 22, 2022
1 parent 8461189 commit a7b7beb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
7 changes: 7 additions & 0 deletions engines/director/castmember.cpp
Expand Up @@ -48,6 +48,7 @@ CastMember::CastMember(Cast *cast, uint16 castId, Common::SeekableReadStreamEndi
_flags1 = 0;

_modified = true;
_isChanged = false;

_objType = kCastMemberObj;

Expand All @@ -59,6 +60,12 @@ CastMemberInfo *CastMember::getInfo() {
return _cast->getCastMemberInfo(_castId);
}

void CastMember::setModified(bool modified) {
_modified = modified;
if (modified)
_isChanged = true;
}


/////////////////////////////////////
// Bitmap
Expand Down
3 changes: 2 additions & 1 deletion engines/director/castmember.h
Expand Up @@ -73,7 +73,7 @@ class CastMember : public Object<CastMember> {
virtual bool isEditable() { return false; }
virtual void setEditable(bool editable) {}
virtual bool isModified() { return _modified; }
virtual void setModified(bool modified) { _modified = modified; }
void setModified(bool modified);
virtual Graphics::MacWidget *createWidget(Common::Rect &bbox, Channel *channel, SpriteType spriteType) { return nullptr; }
virtual void updateWidget(Graphics::MacWidget *widget, Channel *channel) {}
virtual void updateFromWidget(Graphics::MacWidget *widget) {}
Expand Down Expand Up @@ -110,6 +110,7 @@ class CastMember : public Object<CastMember> {
// a link to the widget we created, we may use it later
Graphics::MacWidget *_widget;
bool _modified;
bool _isChanged;
};

class BitmapCastMember : public CastMember {
Expand Down
2 changes: 1 addition & 1 deletion engines/director/lingo/lingo-object.cpp
Expand Up @@ -661,7 +661,7 @@ Datum CastMember::getField(int field) {
d = 1; // Not loaded handled in Lingo::getTheCast
break;
case kTheModified:
warning("STUB: CastMember::getField():: Unprocessed getting field \"%s\" of cast %d", g_lingo->field2str(field), _castId);
d = (int)_isChanged;
break;
case kTheName:
if (castInfo)
Expand Down

0 comments on commit a7b7beb

Please sign in to comment.