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

Use MxGeometry header #1399

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

disinvite
Copy link
Collaborator

@disinvite disinvite commented Mar 4, 2025

Moving all the 2D datatypes under one roof, following the example from the recently-surfaced MxGeometry.h.

Our hope was that the stubborn GetRectIntersection function could match higher than single digits with this change. Initial tests have shown that we can get to 100%, but it is rare and dependent on the whims of the compiler. That's why we need the big guns: #1384.

Summary:

  • MxPoint32, MxSize32, MxRect32, and MxRect16 are now housed in mxgeometry.h instead of their own headers. All files using these structs had their imports corrected.

  • Similarly, MxRectList is now MxRect32List, also in mxgeometry.h.

  • We had names for the functions on MxRect32 that altered the data. These are now replaced by C++ operator functions. e.g. rect_a.Intersect(rect_b) is now rect_a &= rect_b.

  • Modern compilers complained about the templated utility functions in legoutil.h. They clash with the ones in mxutilities.h because these are now used by mxgeometry.h. The three functions aren't used in legocarbuildpresenter.cpp, but legoutil.h comes from the 96 source so this may well have been correct. They are excluded with an #ifdef for now.

  • InfocenterMapEntry uses the templated struct MxRect<MxS32> directly instead of the subclass MxRect32. I changed Infocenter::InitializeBitmaps to use these rects so it matches the beta a little better. It can never fully match because this function was changed further for retail.

  • In legometerpresenter.h, MeterRect is now MxRect16. We knew from the beta that there were two classes here, but not why.

  • MxStillPresenter::SetPosition had a note to try using the MxSize32 and MxPoint32 structures more. I've done that and it now matches 100%.

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