Open-GD / OpenGD

Open source implementation of Geometry Dash powered by a fork of cocos2dx 4.0.
GNU General Public License v3.0
182 stars 28 forks source link

Header include minimization #44

Closed mcmlevi closed 1 year ago

mcmlevi commented 1 year ago

All header files in the main OpenGD project now only include the files they actually need and forward declare the rest. This also then includes the needed files in the .cpp files wherever needed. This should help improve compile times as well as reduce how often specific files need to be recompiled when changes get made as the dependencies are as minimal as possible.

SergeyMC9730 commented 1 year ago

This pull request breaks GCC and Clang support. Please, test your code before sending PL.

mcmlevi commented 1 year ago

Yeah my bad, it was a rather straightforward refractor and I was not expecting it to break on GCC and clang. Regardless I should have really tested it GCC and or Clang as well. https://stackoverflow.com/questions/71416/forward-declaring-an-enum-in-c/1280969#1280969

I know forward-declaring enums was possible however I missed the fact that forward-declaring a regular enum is actually not something that is possible without specifying the size. The fix should be rather straight forward and can be something I can make in a bit what will be changing the enum to an enum class and the forward declarations as well.