minetest icon indicating copy to clipboard operation
minetest copied to clipboard

Replace "SMeshBuffer.h" with "CMeshBuffer.h"

Open omicron1100 opened this issue 11 months ago • 6 comments

  • 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.

omicron1100 avatar May 02 '25 23:05 omicron1100

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 avatar May 03 '25 07:05 sfan5

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 avatar May 04 '25 23:05 omicron1100

Oops, I didn't mean to push here

omicron1100 avatar May 05 '25 02:05 omicron1100

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.

sfan5 avatar May 05 '25 13:05 sfan5

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?

omicron1100 avatar May 05 '25 14:05 omicron1100

Dunno.

sfan5 avatar May 05 '25 16:05 sfan5