Cleanup editor code
This commit is contained in:
@@ -17,8 +17,6 @@
|
||||
namespace fgl::engine::filesystem
|
||||
{
|
||||
|
||||
//! Textures for files (pre-rendered image, images, ect)
|
||||
|
||||
constexpr std::uint32_t DESIRED_SIZE { 128 };
|
||||
constexpr std::uint32_t PADDING { 2 };
|
||||
|
||||
@@ -28,24 +26,6 @@ namespace fgl::engine::filesystem
|
||||
{
|
||||
ZoneScoped;
|
||||
|
||||
/*
|
||||
if ( ImGui::BeginMenuBar() )
|
||||
{
|
||||
if ( ImGui::BeginMenu( "File" ) )
|
||||
{
|
||||
if ( ImGui::MenuItem( "Open File" ) )
|
||||
{}
|
||||
|
||||
if ( ImGui::MenuItem( "Open Folder" ) )
|
||||
{}
|
||||
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
|
||||
ImGui::EndMenuBar();
|
||||
}
|
||||
*/
|
||||
|
||||
if ( !m_current_dir )
|
||||
{
|
||||
m_current_dir = std::make_unique< DirInfo >( std::filesystem::current_path() );
|
||||
@@ -111,11 +91,13 @@ namespace fgl::engine::filesystem
|
||||
{
|
||||
return format_ns::format( "{} B", size );
|
||||
}
|
||||
else if ( size < 1000 * 1000 )
|
||||
|
||||
if ( size < 1000 * 1000 )
|
||||
{
|
||||
return format_ns::format( "{:0.2f} KB", static_cast< float >( size ) / 1000.0f );
|
||||
}
|
||||
else if ( size < 1000 * 1000 * 1000 )
|
||||
|
||||
if ( size < 1000 * 1000 * 1000 )
|
||||
{
|
||||
return format_ns::format( "{:0.2f} MB", static_cast< float >( size ) / 1000.0f / 1000.0f );
|
||||
}
|
||||
@@ -151,7 +133,7 @@ namespace fgl::engine::filesystem
|
||||
}
|
||||
}
|
||||
|
||||
void FileBrowser::drawBinary( [[maybe_unused]] const FileInfo& info )
|
||||
void FileBrowser::drawBinary( [[maybe_unused]] const FileInfo& info ) const
|
||||
{
|
||||
// file_texture->drawImGui( { 128, 128 } );
|
||||
m_file_texture->drawImGuiButton( { DESIRED_SIZE, DESIRED_SIZE } );
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace fgl::engine::filesystem
|
||||
void drawFolder( const DirInfo& data );
|
||||
|
||||
// drawers
|
||||
void drawBinary( const FileInfo& info );
|
||||
void drawBinary( const FileInfo& info ) const;
|
||||
void drawModel( const FileInfo& info );
|
||||
void drawTexture( const FileInfo& info );
|
||||
};
|
||||
|
||||
@@ -106,7 +106,7 @@ namespace fgl::engine::gui
|
||||
|
||||
Camera& camera { *camera_ptr };
|
||||
|
||||
std::string name { "" };
|
||||
std::string name {};
|
||||
|
||||
if ( camera.getName() == "" )
|
||||
name = std::format( "Camera: ID {}", camera.getIDX() );
|
||||
|
||||
@@ -20,21 +20,21 @@ namespace fgl::engine::gui
|
||||
vk::DeviceSize m_total;
|
||||
vk::DeviceSize m_used;
|
||||
|
||||
inline vk::DeviceSize free() const { return m_total - m_used; }
|
||||
vk::DeviceSize free() const { return m_total - m_used; }
|
||||
|
||||
vk::DeviceSize m_largest_free_block { std::numeric_limits< vk::DeviceSize >::max() };
|
||||
};
|
||||
|
||||
AllocationInfo gpu {};
|
||||
AllocationInfo host {};
|
||||
AllocationInfo m_gpu {};
|
||||
AllocationInfo m_host {};
|
||||
};
|
||||
|
||||
AllocationList getTotalAllocated()
|
||||
{
|
||||
AllocationList info {};
|
||||
|
||||
auto& [ gpu_allocated, gpu_used, gpu_largest_free ] = info.gpu;
|
||||
auto& [ host_allocated, host_used, host_largest_free ] = info.host;
|
||||
auto& [ gpu_allocated, gpu_used, gpu_largest_free ] = info.m_gpu;
|
||||
auto& [ host_allocated, host_used, host_largest_free ] = info.m_host;
|
||||
|
||||
for ( const auto* buffer : memory::getActiveBuffers() )
|
||||
{
|
||||
@@ -113,10 +113,10 @@ namespace fgl::engine::gui
|
||||
ImGui::Begin( "Stats" );
|
||||
|
||||
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 );
|
||||
ImGui::Text( "Draw instances: %zu", counters.m_instance_count );
|
||||
const auto& [ verts_drawn, models_draw, instance_count ] { profiling::getCounters() };
|
||||
ImGui::Text( "Models drawn: %zu", models_draw );
|
||||
ImGui::Text( "Verts drawn: %zu", verts_drawn );
|
||||
ImGui::Text( "Draw instances: %zu", instance_count );
|
||||
|
||||
if ( ImGui::CollapsingHeader( "Memory" ) )
|
||||
{
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
#include "engine/assets/model/Model.hpp"
|
||||
#include "engine/assets/model/builders/SceneBuilder.hpp"
|
||||
#include "engine/camera/Camera.hpp"
|
||||
#include "engine/camera/GBufferSwapchain.hpp"
|
||||
#include "engine/filesystem/scanner/FileScanner.hpp"
|
||||
#include "engine/filesystem/types.hpp"
|
||||
#include "engine/gameobjects/components/ModelComponent.hpp"
|
||||
|
||||
@@ -4,5 +4,5 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#define DRAG_TYPE_FILE_MODEL_INFO "_MODEL_FILE_INFO"
|
||||
#define DRAG_TYPE_FILE_TEXTURE_INFO "_TEXTURE_FILE_INFO"
|
||||
inline static constexpr char* DRAG_TYPE_FILE_MODEL_INFO { "_MODEL_FILE_INFO" };
|
||||
inline static constexpr char* DRAG_TYPE_FILE_TEXTURE_INFO { "_TEXTURE_FILE_INFO" };
|
||||
|
||||
Reference in New Issue
Block a user