Skip to content

Replace "SMeshBuffer.h" with "CMeshBuffer.h" #16106

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

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

Conversation

omicron1100
Copy link

@omicron1100 omicron1100 commented May 2, 2025

  • Replaces references to SMeshBuffer.h with CMeshBuffer.h in header files
  • Adds using namespace irr; to the corresponding .cpp files in /src
    • This will make it easier to remove using namespace irr from header files in the future
  • Make namespaces more explicit (video::SColor to irr::video::SColor)
    • This will also make it easier to remove using namespace irr from header files in the future
  • Organize header includes to better indicate what includes come from /irr directly
    • #include "irr_ptr.h" -> #include <irr_ptr.h> as an example
    • Moved irr includes so they are visually separate from other includes
  • Delete SMeshBuffer.h

To do

This PR is Ready for Review.

@Zughy Zughy added Maintenance Tasks to keep the codebase and related parts in order, including architectural improvements @ Engine Core What happens inside the very engine labels May 2, 2025
@sfan5
Copy link
Collaborator

sfan5 commented May 3, 2025

Make namespaces more explicit (video::SColor to irr::video::SColor)

  • This will also make it easier to remove using namespace irr from header files in the future

I don't think we want this. The current way is fine, less visual clutter and faster to type.

@sfan5 sfan5 added the Action / change needed Code still needs changes (PR) / more information requested (Issues) label May 4, 2025
@omicron1100
Copy link
Author

Make namespaces more explicit (video::SColor to irr::video::SColor)

  • This will also make it easier to remove using namespace irr from header files in the future

I don't think we want this. The current way is fine, less visual clutter and faster to type.

True, but I think we should aim to take using out of header files as it's bad C++ practice and would eliminate namespace poisoning.

Would it be acceptable to add something like namespace color = irr::color; to the top of the header files instead?

@omicron1100
Copy link
Author

Oops, I didn't mean to push here

@omicron1100 omicron1100 force-pushed the clean_headers branch 4 times, most recently from 2fb09e2 to 5b57e0a Compare May 5, 2025 04:41
@sfan5
Copy link
Collaborator

sfan5 commented May 5, 2025

True, but I think we should aim to take using out of header files as it's bad C++ practice and would eliminate namespace poisoning.

Would it be acceptable to add something like namespace color = irr::color; to the top of the header files instead?

This makes sense in principle, but Irrlicht is not an external library (anymore) and entirely under our control.
The irr namespace has very few direct members.

@omicron1100
Copy link
Author

This makes sense in principle, but Irrlicht is not an external library (anymore) and entirely under our control. The irr namespace has very few direct members.

I see. Would the ultimate goal be to get rid of the irr namespace then?

@sfan5
Copy link
Collaborator

sfan5 commented May 5, 2025

Dunno.

@sfan5 sfan5 removed the Action / change needed Code still needs changes (PR) / more information requested (Issues) label May 15, 2025
#include <IMeshManipulator.h>
#include <CMeshBuffer.h>

using namespace irr;
Copy link
Contributor

@appgurueu appgurueu May 28, 2025

Choose a reason for hiding this comment

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

This PR adds a bunch of these (as well as namespace scene = irr:scene; namespace video = irr:video;) which are redundant, as there is still the using namespace irr; in irrlichttypes.h?

For now I would curtail the scope of this PR and simply get rid of them.

I would prefer it if this was just what the PR title currently says it is which is something like a clean 10 loc diff, but I'm fine with keeping the header cleanup in here (and maybe updating the PR title).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@ Engine Core What happens inside the very engine Maintenance Tasks to keep the codebase and related parts in order, including architectural improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants