Fixes a bunch of compilation warnings

This commit is contained in:
2025-02-17 02:21:10 -05:00
parent 02930ea3b7
commit 920d728360
54 changed files with 315 additions and 154 deletions

View File

@@ -24,7 +24,7 @@ namespace fgl::engine
const auto& model { *this->m_model };
ImGui::Text( "%i primitives", model.m_primitives.size() );
ImGui::Text( "%li primitives", model.m_primitives.size() );
}
std::string_view ModelComponent::humanName() const

View File

@@ -25,8 +25,8 @@ namespace fgl::engine::gui
auto& yaw_change { original_rotation };
auto& pitch_change { original_rotation };
constexpr double pitch_rate { 1.0 };
constexpr double yaw_rate { 1.0 };
constexpr float pitch_rate { 1.0 };
constexpr float yaw_rate { 1.0 };
if ( ImGui::IsKeyDown( ImGuiKey_UpArrow ) )
{

View File

@@ -92,11 +92,16 @@ namespace fgl::engine::gui
for ( const auto* buffer : memory::getActiveBuffers() )
{
ImGui::Text( "Name: %s", buffer->m_debug_name.c_str() );
const double used_percent { static_cast< float >( buffer->used() )
/ static_cast< float >( buffer->size() ) * 100.0f };
ImGui::Text(
"Allocated: %s/%s (%2.1f\%)",
"Allocated: %s/%s (%2.1f%%)",
toString( buffer->used() ).c_str(),
toString( buffer->size() ).c_str(),
( static_cast< float >( buffer->used() ) / static_cast< float >( buffer->size() ) * 100.0f ) );
static_cast< double >( used_percent ) );
ImGui::Text( "Largest block: %s", toString( buffer->largestBlock() ).c_str() );
ImGui::Separator();
}
@@ -107,7 +112,7 @@ namespace fgl::engine::gui
{
ImGui::Begin( "Stats" );
ImGui::Text( "FPS: %0.1f", ImGui::GetIO().Framerate );
ImGui::Text( "FPS: %0.1f", static_cast< double >( ImGui::GetIO().Framerate ) );
const auto& counters { profiling::getCounters() };
ImGui::Text( "Models drawn: %zu", counters.m_models_draw );
ImGui::Text( "Verts drawn: %zu", counters.m_verts_drawn );

View File

@@ -4,7 +4,10 @@
#pragma once
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#include "glm/vec3.hpp"
#pragma GCC diagnostic pop
#include "safe_include.hpp"
namespace fgl::engine

View File

@@ -2,25 +2,25 @@
// Created by kj16609 on 1/29/25.
//
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wold-style-cast"
#pragma GCC diagnostic ignored "-Weffc++"
#include <imgui.h>
#pragma GCC diagnostic pop
#include "FrameInfo.hpp"
namespace fgl::engine::gui
{
void drawMenubar( FrameInfo& info )
void drawMenubar( [[maybe_unused]] FrameInfo& info )
{
ImGui::BeginMainMenuBar();
if ( ImGui::BeginMenu( "File" ) )
{
if ( ImGui::MenuItem( "Save..." ) )
{
}
{}
ImGui::EndMenu();
}

View File

@@ -96,7 +96,7 @@ namespace fgl::engine::gui
float width_size { ratio * static_cast< float >( max_extent.height ) };
// If the width is higher then the max extent, Then we wanna use the width instead
if ( width_size > max_extent.width )
if ( width_size > static_cast< float >( max_extent.width ) )
{
width_size = static_cast< float >( max_extent.width );
height_size = static_cast< float >( max_extent.width ) / ratio;
@@ -110,7 +110,10 @@ namespace fgl::engine::gui
FGL_FORCE_INLINE_FLATTEN inline vk::Extent2D calculateTargetSize( const float ratio, const ImVec2 max_extent )
{
return calculateTargetSize( ratio, vk::Extent2D( max_extent.x, max_extent.y ) );
const vk::Extent2D max_size_i { static_cast< std::uint32_t >( max_extent.x ),
static_cast< std::uint32_t >( max_extent.y ) };
return calculateTargetSize( ratio, max_size_i );
}
enum RenderingOutputSelection : std::uint_fast8_t
@@ -154,7 +157,7 @@ namespace fgl::engine::gui
current = Position;
}
if ( ImGui::MenuItem( "Enable Hotkeys" ), nullptr, hotkeys_enabled )
if ( ImGui::MenuItem( "Enable Hotkeys", nullptr, hotkeys_enabled ) )
{
hotkeys_enabled = !hotkeys_enabled;
}

View File

@@ -33,10 +33,10 @@ int main()
const auto patch { ( version & PATCH_BITMASK ) >> 0};
const auto minor { ( version & MINOR_BITMASK ) >> 10};
const auto major { ( version & MAJOR_BITMASK ) >> (10 + 12)};
const auto variant { ( version & VARIANT_BITMASK ) >> (10 + 12 + 7) };
// clang-format on
[[maybe_unused]] const auto variant { ( version & VARIANT_BITMASK ) >> (10 + 12 + 7) };
// clang-format on
log::debug( "Vulkan instance version: {}.{}.{}.{}", major, minor, patch, minor );
log::debug( "Vulkan instance version: {}.{}.{}.{}", major, minor, patch, minor );
try
{