heydocode / limitpush

Was it so easy to create a 3D bevy game using a single template..? LimitPush is a bevy template which is focused on cross-platform support and performance
https://heydocode.github.io/limitpush/
Creative Commons Zero v1.0 Universal
2 stars 0 forks source link

Better conditional compilation #2

Closed heydocode closed 14 hours ago

heydocode commented 3 days ago

It will be better to move the code (which is currently in lib.rs) bellow to the debug crate:

// Enable debug tools in development mode (only when `debug_assertions` is enabled).
        #[cfg(debug_assertions)]
        {
            app.add_plugins((
                FrameTimeDiagnosticsPlugin, // Tracks frame time for performance tuning.
                LogDiagnosticsPlugin::default(), // Logs performance data to the console.
            ));
        }

The reason to that is pretty simple: the debug crate is only imported by lib.rs when debug_assertions are enabled, so if the logs plugin declarations move to the debug crate, nothing will change except the better readability of the code.

This decision is the same for others things. For instance, it will be great to rewrite conditional compilation to improve the readability and the organization of the repository (for example in the debug crate I can add directories for families of targets, such as mobile, desktop and web to focus on native possibilities and improvements).

heydocode commented 14 hours ago

Fixed & rewritted some code, I'll try to make sure that everything is well designed in future commits too.