Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DIRECTOR: LINGO: Implement kTheRegPoint STUBs on BitmapCastMember::getField() and setField() #3996

Merged
merged 1 commit into from Jun 28, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 19 additions & 3 deletions engines/director/lingo/lingo-object.cpp
Expand Up @@ -886,7 +886,10 @@ Datum BitmapCastMember::getField(int field) {
warning("STUB: BitmapCastMember::getField(): Unprocessed getting field \"%s\" of cast %d", g_lingo->field2str(field), _castId);
break;
case kTheRegPoint:
warning("STUB: BitmapCastMember::getField(): Unprocessed getting field \"%s\" of cast %d", g_lingo->field2str(field), _castId);
d.type = POINT;
d.u.farr = new FArray;
d.u.farr->arr.push_back(_regX);
d.u.farr->arr.push_back(_regY);
break;
case kThePalette:
d = _clut;
Expand All @@ -907,8 +910,21 @@ bool BitmapCastMember::setField(int field, const Datum &d) {
warning("STUB: BitmapCastMember::setField(): Unprocessed setting field \"%s\" of cast %d", g_lingo->field2str(field), _castId);
return false;
case kTheRegPoint:
warning("STUB: BitmapCastMember::setField(): Unprocessed setting field \"%s\" of cast %d", g_lingo->field2str(field), _castId);
return false;
if (d.type == POINT || (d.type == ARRAY && d.u.farr->arr.size() >= 2)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And what about RECTs? Those could potentially work as well, being arrays of size 4

auto temp = _img;
_modified = true;
Score *score = g_director->getCurrentMovie()->getScore();
score->renderSprites(score->getCurrentFrame(), kRenderForceUpdate);
_img = nullptr;
_regX = d.u.farr->arr[0].asInt();
_regY = d.u.farr->arr[1].asInt();
_img = temp;
_modified = true;
} else {
warning("BitmapCastMember::setField(): Wrong Datum type %d for kTheRegPoint", d.type);
return false;
}
return true;
case kThePalette:
_clut = d.asInt();
return true;
Expand Down