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

Extract SA interfaces to separate files #1 (C3DMarkerSAInterface) #4063

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

Conversation

FileEX
Copy link
Contributor

@FileEX FileEX commented Mar 2, 2025

The SA layer interfaces are currently in the header files of classes, e.g., C3DMarkerSAInterface in C3DMarkerSA.h. However, in many cases, multiple interfaces are in the same file, and often they shouldn't be there. I think a good solution to this mess is to extract the interfaces into separate files in the interfaces directory within the Game SA project.

During this extraction, we can also refine the interfaces and fill in missing fields, as many interface classes have incorrect structures. These PRs are not intended to refactor the actual code (e.g., C3DMarkerSA), only as much as necessary for the new interface structure.

Merging all interfaces in a single PR would obviously be unacceptable, impossible to review, and difficult to test. Therefore, I want to split this into multiple PRs, ideally handling three interfaces per PR. This PR is the first in the series.

  • Improved and completed the CMatrix_Padded class
  • Extracted the C3DMarkerSAInterface and corrected its structure
  • Adjusted some functions to match the new interface structure
  • Removed dead and unused classes XYZ, XYZStore, CMatrixEx from CEntitySA.h

I tested the code after the changes and did not observe any issues with markers or their colors.

@Fernando-A-Rocha
Copy link
Contributor

I love your PRs...thank you.

CVector m_lastPosition; // 144
DWORD m_OnScreenTestTime; // time last screen check was done // 156
};
#include "interfaces/C3DMarkerSAInterface.h"
Copy link
Member

Choose a reason for hiding this comment

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

The idea is interesting, but i think there were some sort of design choices involved. So we store SA interfaces and wrappers in the same file.
What do the other contributors think about that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

I think that generally the separation of MTA wrappers and SA internal structures is reasonable. I don't think that this can harm the existed code in any way.

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.

5 participants