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

Conversation

r41k0u
Copy link
Contributor

@r41k0u r41k0u commented Jun 14, 2022

This change implements the getting and setting of the RegPoint property of BItmapCastMembers in lingo-object.cpp and implements their STUB. These changes have been tested using the regpoint of cast workshop movie

warning("BitmapCastMember::setField(): Wrong Datum type %d for kTheRegPoint", d.type);
return false;
}
_regX = d.u.farr->arr[0].asInt();
Copy link
Member

@sev- sev- Jun 14, 2022

Choose a reason for hiding this comment

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

How was it tested? Does the sprite move as these fields are changed?

@sev-
Copy link
Member

@sev- sev- commented Jun 14, 2022

Does the sprite move after this is applied? Does the behaviour match the original?

@r41k0u
Copy link
Contributor Author

@r41k0u r41k0u commented Jun 15, 2022

Yes. The sprite moves after this change and this matches the behaviour observed in BasiliskII

warning("STUB: BitmapCastMember::setField(): Unprocessed setting field \"%s\" of cast %d", g_lingo->field2str(field), _castId);
return false;
{
if (d.type != POINT) {
Copy link
Member

@sev- sev- Jun 15, 2022

Choose a reason for hiding this comment

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

Did you test it with ARRAYs?

}
auto temp = _img;
_modified = true;
g_director->getCurrentMovie()->getScore()->renderSprites(g_director->getCurrentMovie()->getScore()->getCurrentFrame(), kRenderForceUpdate);
Copy link
Member

@djsrv djsrv Jun 16, 2022

Choose a reason for hiding this comment

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

To shorten this line I'd store the result of g_director->getCurrentMovie()->getScore() in a pointer first.

if (d.type == POINT || (d.type == ARRAY && d.u.farr->arr.size() == 2)) {
auto temp = _img;
_modified = true;
Score * score = g_director->getCurrentMovie()->getScore();
Copy link
Member

@sev- sev- Jun 16, 2022

Choose a reason for hiding this comment

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

Formatting is off. Should be Score *score = g_director->ge....

@r41k0u r41k0u changed the title DIRECTOR: LINGO: Implement kTheRegPoint STUBs om BitmapCastMember::getField() and setField() DIRECTOR: LINGO: Implement kTheRegPoint STUBs on BitmapCastMember::getField() and setField() Jun 20, 2022
@@ -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

@sev- sev- Jun 21, 2022

Choose a reason for hiding this comment

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

Did you test it with arrays? Also, did you test it with arrays less than 2 and more than 2 items?

Other tests show that when there are MORE items, it takes the first two and treats them as POINT

@@ -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

@sev- sev- Jun 28, 2022

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

@sev-
Copy link
Member

@sev- sev- commented Jun 28, 2022

Merging, though RECTs could potentially work

@sev- sev- merged commit 84c7b3a into scummvm:master Jun 28, 2022
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants