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 TextCastMember property STUB (kTheTextFont, kTheTextHeight, kTheTextStyle, kTheTextSize) #3957

Merged
merged 8 commits into from Jun 6, 2022

Conversation

r41k0u
Copy link
Contributor

@r41k0u r41k0u commented Jun 3, 2022

This Pull Request contains commits required to implement kTheTextFont, kTheTextHeight, kTheTextStyle, kTheTextSize STUBs in the Director Engine. Also contains changes for comparing styles and fonts while ignoring cases.

@r41k0u r41k0u changed the title DIRECTOR: LINGO: Implement STUB kTheTextFont in lingo-object.cpp DIRECTOR: LINGO: Implement TextCastMember property STUB (kTheTextFont, kTheTextHeight, kTheTextStyle, kTheTextSize) Jun 3, 2022
@@ -1036,11 +1036,6 @@ void TextCastMember::importRTE(byte *text) {
}

void TextCastMember::setText(const Common::U32String &text) {
// Do nothing if text did not change
Copy link
Member

@sev- sev- Jun 3, 2022

Choose a reason for hiding this comment

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

Removing this as is will lead to big overhead: text could be set at every frame step.

What you could do instead, is emptying _ptext with _ptext.clear() before calling setText() in the textFont and other setters, thus, this particular condition would be skipped.

@@ -1620,6 +1620,17 @@ Common::U32String MacText::getEditedString() {
return getTextChunk(_editableRow, 0, -1, -1);
}

Common::U32String MacText::getPlainText() {
Common::U32String res("");
Copy link
Member

@sev- sev- Jun 3, 2022

Choose a reason for hiding this comment

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

You do not need to init it with "". It is already there.

r41k0u added 5 commits Jun 5, 2022
…ext(), remove unnecessary initialisation of string in MacText::getPlainText()
…etField() to prevent duplicacy, remove redundant setText() in kTheTextHeight case of TextCastMember::setField()
…mplement STUB kTheTextFont in TextCastMember::setField()
…kTheTextStyle STUB in TextCastMember::setField()
@sev-
Copy link
Member

@sev- sev- commented Jun 6, 2022

Thank you

@sev- sev- merged commit 7846a08 into scummvm:master Jun 6, 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
2 participants