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

Refactor geom library into geom and shape #1263

Merged
merged 2 commits into from
Dec 23, 2024

Conversation

foxtacles
Copy link
Member

@foxtacles foxtacles commented Dec 23, 2024

One thing that has been bugging me for a while is the geom library. So far it contained classes that, based on their locations in the binary, should not be in the same library. roadmap shows it like this:

CMakeFiles/geom.dir/
0x1009a470      -26688  LEGO1/lego/sources/geom/legoedge.cpp
0x1009a550      -23296  LEGO1/lego/sources/geom/legoweedge.cpp
0x1009a630      -24512  LEGO1/lego/sources/geom/legounkown100db7f4.cpp
0x1009a730      -27171  LEGO1/lego/sources/geom/legowegedge.cpp
0x100d3740     -258000  LEGO1/lego/sources/geom/legobox.cpp
0x100d3770     -258000  LEGO1/lego/sources/geom/legosphere.cpp
0x100d37b0     -258000  LEGO1/lego/sources/geom/legovertex.cpp
0x100d3810     -258000  LEGO1/lego/sources/geom/legomesh.cpp

We can see that legobox until legomesh belong to their own, distinct group of compilation units based on their addresses. The reason we have put them in geom is - and this is something unique - we have copied this code directly from the alpha source code leak. Some of it has been virtually unchanged since then. In the alpha, these classes have been located in:

LEGO/SOURCES/GEOM/

so in the case of the alpha version, these classes are clearly part of the geom library.

The reason we have put legoedge ... legowegedge into geom is because we have this BETA10 assertion:

"C:\\Lego\\Sources\\Geom\\LegoWEGEdge.h" (at 10037357)

which means these classes have also been part of the geom library (at this point). However, the binaries of both Retail and BETA10 indicate that legobox ... legomesh have moved to the very end of the binary. My conclusion is that they separated this old code, created a new library and added this to the compilation at the very end.

This PR refactors the aforementioned libraries into geom and a new library called shape. Note that we also have the class LegoColor in there, which was previously in misc, but is only used internally by legomesh.

roadmap is now showing:

CMakeFiles/geom.dir/
0x1009a470      -26688  LEGO1/lego/sources/geom/legoedge.cpp
0x1009a550      -24032  LEGO1/lego/sources/geom/legoweedge.cpp
0x1009a630      -24512  LEGO1/lego/sources/geom/legounkown100db7f4.cpp
0x1009a730      -27171  LEGO1/lego/sources/geom/legowegedge.cpp

CMakeFiles/util.dir/
0x100d3740      -95632  LEGO1/lego/sources/shape/legobox.cpp
0x100d3770      -95632  LEGO1/lego/sources/shape/legosphere.cpp
0x100d37b0      -95632  LEGO1/lego/sources/shape/legovertex.cpp
0x100d3810      -95632  LEGO1/lego/sources/shape/legomesh.cpp
0x100d3a20      -95632  LEGO1/lego/sources/shape/legocolor.cpp

@foxtacles foxtacles changed the title Refactor geom library into geom and util Refactor geom library into geom and shape Dec 23, 2024
@foxtacles foxtacles merged commit 1b99d75 into isledecomp:master Dec 23, 2024
12 checks passed
@foxtacles foxtacles deleted the refactor-libs branch December 23, 2024 16:25
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.

1 participant