novelrt / NovelRT

A cross-platform 2D game engine accompanied by a strong toolset for visual novels.
MIT License
183 stars 43 forks source link

Inconsistent NovelRT.h dependency #579

Open capnkenny opened 1 year ago

capnkenny commented 1 year ago

Describe the issue: At the moment, certain implementation files still include NovelRT.h as a header file, causing all other headers to be included at once. This may be acceptable for Interop/external sources that will depend on the Engine, but we should probably attempt to have all Engine-specific sources isolated to their own required headers instead of pulling all of the things. (Fixing this would also make platform-dependent changes a little easier to manage.)

Please provide the steps to reproduce if possible:

  1. Clone the repo
  2. Open project in IDE
  3. Perform a search across the repository for "NovelRT.h"
  4. Observe results

Expected behaviour: When building the Engine target of NovelRT, the following files should not reference NovelRT.h:

Please tell us about your environment:

Additional context: The biggest issue here is that certain legacy areas may not be properly include guarded, causing NovelRT.h to pull in more headers than required. Also, since NovelRT.h is used as a "catch-all" in these areas (w.r.t platform-specific includes), it is difficult to try and take these out without breaks occurring. Instead, it should be reverted only to a ease-of-use header that includes all default areas in order to provide feature parity for the likes of the Engine_Tests target, as well as the Interop namespaces (so that Interop does not break)., This, and that the offending files should be delegated to their proper namespace headers with proper include guards (if already existing - if not, one should be created for this purpose.)

RubyNova commented 1 year ago

This is a leftover of moving to the newer namespace-based header system. We should update these ASAP.