Asserts, Asserts everywhere

This commit is contained in:
2024-03-08 13:55:53 -05:00
parent 7bb1ee0074
commit d9932e18e7
5 changed files with 18 additions and 4 deletions

View File

@@ -446,9 +446,7 @@ namespace fgl::engine
#if ENABLE_IMGUI
{
#if TRACY_ENABLE
TracyVkZone( tracy_ctx, command_buffer, "ImGui Rendering" );
#endif
debug::world::
drawPointText( Coordinate< CoordinateSpace::World >( 0.0f, 0.0f, 0.0f ), { 1.0f, 0.0f, 0.0f } );

View File

@@ -29,6 +29,7 @@ namespace fgl::engine
void KeyboardMovementController::moveInPlaneXZ( GLFWwindow* window, float dt, fgl::engine::GameObject& target )
{
assert( window );
constexpr float rotation_rate { 1.0f };
constexpr float pitch_modifier { 1.0f };
constexpr float yaw_modifier { 1.0f };

View File

@@ -30,7 +30,13 @@ namespace fgl::engine
void setMaxFramesInFlight( std::uint16_t max ) { m_suballocations.resize( max ); }
Suballocation& operator[]( std::uint16_t index ) { return *m_suballocations[ index ]; }
Suballocation& operator[]( std::uint16_t index )
{
assert( m_suballocations.size() >= index );
assert( m_suballocations[ index ] );
return *m_suballocations[ index ];
}
void bindForFrame( vk::CommandBuffer& cmd_buffer, std::uint16_t frame_idx )
{

View File

@@ -21,6 +21,7 @@ namespace fgl::engine
for ( auto* leaf : info.game_objects.getAllLeafsInFrustum( frustum ) )
{
assert( leaf );
for ( auto& obj : *leaf )
{
//Has model?

View File

@@ -25,9 +25,16 @@ namespace fgl::engine
{
case 0: // NodeArray
{
assert( std::holds_alternative< NodeArray >( m_node_data ) );
NodeArray& node_array { std::get< NodeArray >( m_node_data ) };
//Search deeper
#ifndef NDEBUG
for ( int x = 0; x < 2; ++x )
for ( int y = 0; y < 2; ++y )
for ( int z = 0; z < 2; ++z ) assert( node_array[ x ][ y ][ z ] );
#endif
{
const auto ret { node_array[ LEFT ][ FORWARD ][ TOP ]->getAllLeafsInFrustum( frustum ) };
leafs = std::move( ret );
@@ -67,10 +74,11 @@ namespace fgl::engine
}
case 1: // NodeLeaf
{
assert( std::holds_alternative< NodeLeaf >( m_node_data ) );
leafs.reserve( 4096 );
leafs.emplace_back( &std::get< NodeLeaf >( m_node_data ) );
// debug::world::drawBoundingBox( m_bounds );
//debug::world::drawBoundingBox( m_bounds );
return leafs;
}