From 0802ee19573e880e319a61ae814ee42c01e28cd3 Mon Sep 17 00:00:00 2001 From: hachem Date: Thu, 20 Aug 2026 02:05:45 +0200 Subject: refactor: trailing return types in engine and states --- src/states/world_builder_state.cpp | 42 +++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'src/states/world_builder_state.cpp') diff --git a/src/states/world_builder_state.cpp b/src/states/world_builder_state.cpp index ab3e2b3..be74eb6 100644 --- a/src/states/world_builder_state.cpp +++ b/src/states/world_builder_state.cpp @@ -28,7 +28,7 @@ namespace Donut { - void WorldBuilderState::on_enter() + auto WorldBuilderState::on_enter() -> void { DONUT_INFO("Entering World Builder State"); @@ -78,12 +78,12 @@ namespace Donut m_initialized = true; } - void WorldBuilderState::on_exit() + auto WorldBuilderState::on_exit() -> void { DONUT_INFO("Exiting World Builder State"); } - void WorldBuilderState::on_update(float delta_time) + auto WorldBuilderState::on_update(float delta_time) -> void { if (m_camera_dragging && !ImGuizmo::IsUsing()) @@ -112,7 +112,7 @@ namespace Donut } } - void WorldBuilderState::on_render() + auto WorldBuilderState::on_render() -> void { auto& hdri_manager = HDRIManager::get(); m_hdri_environment = hdri_manager.get_current_hdri(); @@ -129,7 +129,7 @@ namespace Donut render_scene(); } - void WorldBuilderState::on_event(Event& event) + auto WorldBuilderState::on_event(Event& event) -> void { EventDispatcher dispatcher(event); @@ -309,7 +309,7 @@ namespace Donut }); } - void WorldBuilderState::on_im_ui_render() + auto WorldBuilderState::on_im_ui_render() -> void { GLFWwindow* window = static_cast(Application::get().get_window().get_native_window()); int width, height; @@ -376,7 +376,7 @@ namespace Donut ImGui::Spacing(); - if (ImGui::CollapsingHeader("Create Object")) + if (ImGui::CollapsingHeader("create Object")) { ImGui::TextColored(ImVec4(0.9f, 0.9f, 1.0f, 1.0f), "New Sphere"); ImGui::Separator(); @@ -403,12 +403,12 @@ namespace Donut if (m_scene.objs.size() >= 16) { ImGui::PushStyleVar(ImGuiStyleVar_Alpha, 0.5f); - ImGui::Button("Add Sphere (Limit Reached)", ImVec2(ImGui::GetWindowWidth() - 20, 30)); + ImGui::Button("add Sphere (Limit Reached)", ImVec2(ImGui::GetWindowWidth() - 20, 30)); ImGui::PopStyleVar(); } else { - if (ImGui::Button("Add Sphere", ImVec2(ImGui::GetWindowWidth() - 20, 30))) + if (ImGui::Button("add Sphere", ImVec2(ImGui::GetWindowWidth() - 20, 30))) add_sphere(); } } @@ -576,7 +576,7 @@ namespace Donut save_scene(); ImGui::SameLine(); - if (ImGui::Button("Load Scene", ImVec2(button_width, 30))) + if (ImGui::Button("load Scene", ImVec2(button_width, 30))) load_scene(); ImGui::Spacing(); @@ -643,7 +643,7 @@ namespace Donut } } - void WorldBuilderState::add_sphere() + auto WorldBuilderState::add_sphere() -> void { if (m_scene.objs.size() >= 16) { @@ -666,7 +666,7 @@ namespace Donut DONUT_INFO("Added sphere to scene and selected it"); } - void WorldBuilderState::remove_selected_object() + auto WorldBuilderState::remove_selected_object() -> void { if (m_selected_object_index >= 0 && m_selected_object_index < static_cast(m_scene.objs.size())) { @@ -676,14 +676,14 @@ namespace Donut } } - void WorldBuilderState::clear_scene() + auto WorldBuilderState::clear_scene() -> void { m_scene.objs.clear(); m_selected_object_index = -1; DONUT_INFO("Cleared scene (black hole remains at center)"); } - void WorldBuilderState::save_scene() + auto WorldBuilderState::save_scene() -> void { nlohmann::json scene_data; scene_data["objects"] = nlohmann::json::array(); @@ -722,7 +722,7 @@ namespace Donut DONUT_ERROR("Failed to save scene"); } - void WorldBuilderState::load_scene() + auto WorldBuilderState::load_scene() -> void { std::ifstream file("Scene.json"); if (file.is_open()) @@ -770,7 +770,7 @@ namespace Donut DONUT_ERROR("Failed to load scene"); } - void WorldBuilderState::initialize_sphere_geometry() + auto WorldBuilderState::initialize_sphere_geometry() -> void { std::vector vertices; std::vector indices; @@ -837,7 +837,7 @@ namespace Donut m_sphere_vao->set_index_buffer(index_buffer); } - void WorldBuilderState::render_scene() + auto WorldBuilderState::render_scene() -> void { GLFWwindow* window = static_cast(Application::get().get_window().get_native_window()); int width, height; @@ -920,7 +920,7 @@ namespace Donut - void WorldBuilderState::initialize_skybox_geometry() + auto WorldBuilderState::initialize_skybox_geometry() -> void { float skybox_vertices[] = { @@ -976,7 +976,7 @@ namespace Donut m_skybox_vao->add_vertex_buffer(vertex_buffer); } - void WorldBuilderState::render_skybox() + auto WorldBuilderState::render_skybox() -> void { if (!m_skybox_shader || !m_skybox_vao || !m_hdri_environment) return; @@ -1006,7 +1006,7 @@ namespace Donut RenderCommand::enable_depth_test(); } - void WorldBuilderState::initialize_grid_geometry() + auto WorldBuilderState::initialize_grid_geometry() -> void { if (m_grid_vao) { @@ -1070,7 +1070,7 @@ namespace Donut m_grid_vao->unbind(); } - void WorldBuilderState::render_grid() + auto WorldBuilderState::render_grid() -> void { if (!m_grid_shader || !m_grid_vao) return; -- cgit v1.3