Skip to content

Fix text#350

Merged
rafalh merged 4 commits into
rafalh:masterfrom
is-this-c:dash_text_2d_fix
Dec 20, 2025
Merged

Fix text#350
rafalh merged 4 commits into
rafalh:masterfrom
is-this-c:dash_text_2d_fix

Conversation

@is-this-c

Copy link
Copy Markdown
Contributor

rf::gr::text_2d_mode should ignore fog. RF does not have issues because it just happens to use rf::gr::text_2d_mode after fog has been disabled.

* Fix world hud strings

* Fix `rf::gr::text_2d_mode`

* Move

---------

Co-authored-by: Chris Parsons <gooberCP@gmail.com>
Comment thread game_patch/rf/gr/gr.h Outdated

enum TextureSource
{
enum TextureSource : uint8_t {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I think those enum changes are wrong. In assembly it's clearly visible that GrMode::__ct uses 32 bits for reading those enums from the stack (e.g. in 00411E2A or in 00559E15), so changing underlying type to 8 bit feels like introduction of UB. Why not keep it as is?
I see now that you made the change to make it easier to push the constant, but I assume in this case simple cast would be more correct

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hm. I read C ABI promotes integers to 32-bits including char and enums.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

When pushing yes, but when returning no. Every function in RF that returns bool only sets al. Functions returnings GrMode components set eax meaning those values should be 32-bit. I guess it doesn't break anything unless we hook function returning those enums, assuming they are not used in any struct (I don't think they are), but still IMO it's better to keep RF structs ABI compatible with RF, even if another layout would work, because debugging such things is a nightmare.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I guess so. Updated.

@is-this-c is-this-c requested a review from rafalh December 16, 2025 07:04
@rafalh rafalh merged commit ef64ecc into rafalh:master Dec 20, 2025
2 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

Development

Successfully merging this pull request may close these issues.

2 participants