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

Implement drawString Y offsets #2487

Merged
merged 2 commits into from
May 24, 2024
Merged

Conversation

duncanspumpkin
Copy link
Contributor

No description provided.

}

case ControlCodes::Colour::black:
setTextColour(0);
Copy link
Member

Choose a reason for hiding this comment

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

Isn't this just the Colour enum class from Colour.h? Perhaps we can map all of these directly to the enum.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The vast majority of this code is lifted from drawString but yes should probably make this a table or something.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

checked and no its only a limited subset of colour.h.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, I see only the three first entries match, indeed. Perhaps we should introduce a separate TextColour enum, then?

@duncanspumpkin duncanspumpkin marked this pull request as ready for review May 20, 2024 07:02
if (loc.x >= rt.x + rt.width)
return;

if (loc.x < rt.x - 1280)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it might be better to use rt.width here, this code is a bit fuzzy and I believe the correct way to handle this is to use the width of the text, if I'm not mistaken this just deals with the case for when text is ever so slightly behind x (0).

Copy link
Contributor

Choose a reason for hiding this comment

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

We can deal with this later.

Copy link
Contributor

@ZehMatt ZehMatt left a comment

Choose a reason for hiding this comment

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

Tested and all looks fine.

@duncanspumpkin duncanspumpkin added this to the v24.05.1+ milestone May 24, 2024
@duncanspumpkin duncanspumpkin merged commit e800a2e into OpenLoco:master May 24, 2024
9 checks passed
@duncanspumpkin duncanspumpkin deleted the yOffsets branch May 24, 2024 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants