DucktapeEngine / Ducktape

Ducktape - An open source 3d C++ game engine.
MIT License
127 stars 25 forks source link

Fix most warnings. Add UNUSED macro. #156

Closed cappe987 closed 2 years ago

cappe987 commented 2 years ago

Issue #134.

UNUSED macro can be used on unused variables to suppress the compiler warning. Most warnings were unused variables.

One warning fixed was ImGui::Text, which wants to use a format string.

Two warnings are still there and I do not know how to solve them. The variables require a fallback value if none of the if-statements are true, otherwise it is uninitialized. But I do not know what would be a good fallback value.

Ducktape/Engine/Renderer/Cubemap.cpp:39:24: warning: ‘format’ may be used uninitialized in this function [-Wmaybe-uninitialized]
Ducktape/Engine/Renderer/Texture.cpp:49:25: warning: ‘format’ may be used uninitialized in this function [-Wmaybe-uninitialized]
aryanbaburajan commented 2 years ago

@cappe987 Awesome!

But I do not know what would be a good fallback value.

As for this, as far as I know, atleast one of those 3 if statements must pass in any situation, so the default value wouldn't really matter anyway, so I think just setting it to GL_RGB by default is enough.

cappe987 commented 2 years ago

Added GL_RGB as fallback for those two. Now it compiles without warnings.