diff --git a/.gitignore b/.gitignore index 920e92335..3892c39b5 100644 --- a/.gitignore +++ b/.gitignore @@ -430,3 +430,6 @@ MigrationBackup/ # Fody - auto-generated XML schema FodyWeavers.xsd + +# imgui.ini +imgui.ini diff --git a/engine/source/editor/include/editor_scene_manager.h b/engine/source/editor/include/editor_scene_manager.h index 18541b6d9..88f1abd68 100644 --- a/engine/source/editor/include/editor_scene_manager.h +++ b/engine/source/editor/include/editor_scene_manager.h @@ -62,7 +62,7 @@ namespace Piccolo private: EditorTranslationAxis m_translation_axis; EditorRotationAxis m_rotation_axis; - EditorScaleAxis m_scale_aixs; + EditorScaleAxis m_scale_axis; GObjectID m_selected_gobject_id{ k_invalid_gobject_id }; Matrix4x4 m_selected_object_matrix{ Matrix4x4::IDENTITY }; diff --git a/engine/source/editor/source/editor.cpp b/engine/source/editor/source/editor.cpp index 49194da1b..26312a495 100644 --- a/engine/source/editor/source/editor.cpp +++ b/engine/source/editor/source/editor.cpp @@ -12,15 +12,15 @@ namespace Piccolo { - void registerEdtorTickComponent(std::string component_type_name) + void registerEditorTickComponent(std::string component_type_name) { g_editor_tick_component_types.insert(component_type_name); } PiccoloEditor::PiccoloEditor() { - registerEdtorTickComponent("TransformComponent"); - registerEdtorTickComponent("MeshComponent"); + registerEditorTickComponent("TransformComponent"); + registerEditorTickComponent("MeshComponent"); } PiccoloEditor::~PiccoloEditor() {} diff --git a/engine/source/editor/source/editor_scene_manager.cpp b/engine/source/editor/source/editor_scene_manager.cpp index 094ce2b4e..dd452d7ad 100644 --- a/engine/source/editor/source/editor_scene_manager.cpp +++ b/engine/source/editor/source/editor_scene_manager.cpp @@ -57,7 +57,7 @@ namespace Piccolo { return m_selected_axis; } - RenderEntity* selected_aixs = getAxisMeshByType(m_axis_mode); + RenderEntity* selected_axis = getAxisMeshByType(m_axis_mode); m_selected_axis = 3; if (m_is_show_axis == false) { @@ -65,7 +65,7 @@ namespace Piccolo } else { - Matrix4x4 model_matrix = selected_aixs->m_model_matrix; + Matrix4x4 model_matrix = selected_axis->m_model_matrix; Vector3 model_scale; Quaternion model_rotation; Vector3 model_translation; @@ -198,7 +198,7 @@ namespace Piccolo axis_mesh = &m_rotation_axis; break; case EditorAxisMode::ScaleMode: - axis_mesh = &m_scale_aixs; + axis_mesh = &m_scale_axis; break; default: break; @@ -221,17 +221,17 @@ namespace Piccolo Matrix4x4 translation_matrix = Matrix4x4::getTrans(translation); Matrix4x4 scale_matrix = Matrix4x4::buildScaleMatrix(1.0f, 1.0f, 1.0f); Matrix4x4 axis_model_matrix = translation_matrix * scale_matrix; - RenderEntity* selected_aixs = getAxisMeshByType(m_axis_mode); + RenderEntity* selected_axis = getAxisMeshByType(m_axis_mode); if (m_axis_mode == EditorAxisMode::TranslateMode || m_axis_mode == EditorAxisMode::RotateMode) { - selected_aixs->m_model_matrix = axis_model_matrix; + selected_axis->m_model_matrix = axis_model_matrix; } else if (m_axis_mode == EditorAxisMode::ScaleMode) { - selected_aixs->m_model_matrix = axis_model_matrix * Matrix4x4(rotation); + selected_axis->m_model_matrix = axis_model_matrix * Matrix4x4(rotation); } - g_editor_global_context.m_render_system->setVisibleAxis(*selected_aixs); + g_editor_global_context.m_render_system->setVisibleAxis(*selected_axis); } else { @@ -414,7 +414,7 @@ namespace Piccolo m_translation_axis.m_model_matrix = axis_model_matrix; m_rotation_axis.m_model_matrix = axis_model_matrix; - m_scale_aixs.m_model_matrix = axis_model_matrix; + m_scale_axis.m_model_matrix = axis_model_matrix; g_editor_global_context.m_render_system->setVisibleAxis(m_translation_axis); @@ -485,7 +485,7 @@ namespace Piccolo transform_component->setPosition(new_translation); transform_component->setRotation(new_rotation); transform_component->setScale(new_scale); - m_scale_aixs.m_model_matrix = new_model_matrix; + m_scale_axis.m_model_matrix = new_model_matrix; } else if (m_axis_mode == EditorAxisMode::ScaleMode) // scale { @@ -562,13 +562,13 @@ namespace Piccolo GameObjectPartId axis_instance_id = {0xFFCC, 0xFFCC}; MeshSourceDesc mesh_source_desc = {"%%scale_axis%%"}; - m_scale_aixs.m_instance_id = instance_id_allocator.allocGuid(axis_instance_id); - m_scale_aixs.m_mesh_asset_id = mesh_asset_id_allocator.allocGuid(mesh_source_desc); + m_scale_axis.m_instance_id = instance_id_allocator.allocGuid(axis_instance_id); + m_scale_axis.m_mesh_asset_id = mesh_asset_id_allocator.allocGuid(mesh_source_desc); } g_editor_global_context.m_render_system->createAxis( - {m_translation_axis, m_rotation_axis, m_scale_aixs}, - {m_translation_axis.m_mesh_data, m_rotation_axis.m_mesh_data, m_scale_aixs.m_mesh_data}); + {m_translation_axis, m_rotation_axis, m_scale_axis}, + {m_translation_axis.m_mesh_data, m_rotation_axis.m_mesh_data, m_scale_axis.m_mesh_data}); } size_t EditorSceneManager::getGuidOfPickedMesh(const Vector2& picked_uv) const diff --git a/engine/source/runtime/core/meta/reflection/reflection.cpp b/engine/source/runtime/core/meta/reflection/reflection.cpp index 43193f0f3..8e5c549a5 100644 --- a/engine/source/runtime/core/meta/reflection/reflection.cpp +++ b/engine/source/runtime/core/meta/reflection/reflection.cpp @@ -71,14 +71,14 @@ namespace Piccolo m_fields.clear(); m_methods.clear(); - auto fileds_iter = m_field_map.equal_range(type_name); - while (fileds_iter.first != fileds_iter.second) + auto fields_iter = m_field_map.equal_range(type_name); + while (fields_iter.first != fields_iter.second) { - FieldAccessor f_field(fileds_iter.first->second); + FieldAccessor f_field(fields_iter.first->second); m_fields.emplace_back(f_field); m_is_valid = true; - ++fileds_iter.first; + ++fields_iter.first; } auto methods_iter = m_method_map.equal_range(type_name); diff --git a/engine/source/runtime/core/meta/reflection/reflection.h b/engine/source/runtime/core/meta/reflection/reflection.h index f92fe2ffd..25a2f06b3 100644 --- a/engine/source/runtime/core/meta/reflection/reflection.h +++ b/engine/source/runtime/core/meta/reflection/reflection.h @@ -23,14 +23,14 @@ namespace Piccolo #endif // __REFLECTION_PARSER__ #define REFLECTION_BODY(class_name) \ - friend class Reflection::TypeFieldReflectionOparator::Type##class_name##Operator; \ + friend class Reflection::TypeFieldReflectionOperator::Type##class_name##Operator; \ friend class Serializer; // public: virtual std::string getTypeName() override {return #class_name;} #define REFLECTION_TYPE(class_name) \ namespace Reflection \ { \ - namespace TypeFieldReflectionOparator \ + namespace TypeFieldReflectionOperator \ { \ class Type##class_name##Operator; \ } \ @@ -76,9 +76,9 @@ namespace Piccolo class ArrayAccessor; class ReflectionInstance; } // namespace Reflection - typedef std::function SetFuncion; - typedef std::function GetFuncion; - typedef std::function GetNameFuncion; + typedef std::function SetFunction; + typedef std::function GetFunction; + typedef std::function GetNameFunction; typedef std::function SetArrayFunc; typedef std::function GetArrayFunc; typedef std::function GetSizeFunc; @@ -89,11 +89,11 @@ namespace Piccolo typedef std::function WriteJsonByName; typedef std::function GetBaseClassReflectionInstanceListFunc; - typedef std::tuple + typedef std::tuple FieldFunctionTuple; - typedef std::tuple MethodFunctionTuple; + typedef std::tuple MethodFunctionTuple; typedef std::tuple ClassFunctionTuple; - typedef std::tuple ArrayFunctionTuple; + typedef std::tuple ArrayFunctionTuple; namespace Reflection { diff --git a/engine/source/runtime/function/character/character.cpp b/engine/source/runtime/function/character/character.cpp index 7bade52b5..0e8644698 100644 --- a/engine/source/runtime/function/character/character.cpp +++ b/engine/source/runtime/function/character/character.cpp @@ -46,7 +46,7 @@ namespace Piccolo unsigned int command = g_runtime_global_context.m_input_system->getGameCommand(); if (command < (unsigned int)GameCommand::invalid) { - if ((((unsigned int)GameCommand::free_carema & command) > 0) != m_is_free_camera) + if ((((unsigned int)GameCommand::free_camera & command) > 0) != m_is_free_camera) { toggleFreeCamera(); } diff --git a/engine/source/runtime/function/framework/component/motor/motor_component.cpp b/engine/source/runtime/function/framework/component/motor/motor_component.cpp index 9a3b8f958..a16f96193 100644 --- a/engine/source/runtime/function/framework/component/motor/motor_component.cpp +++ b/engine/source/runtime/function/framework/component/motor/motor_component.cpp @@ -87,7 +87,7 @@ namespace Piccolo bool has_move_command = ((unsigned int)GameCommand::forward | (unsigned int)GameCommand::backward | (unsigned int)GameCommand::left | (unsigned int)GameCommand::right) & command; - has_move_command &= ((unsigned int)GameCommand::free_carema & command) == 0; + has_move_command &= ((unsigned int)GameCommand::free_camera & command) == 0; bool has_sprint_command = (unsigned int)GameCommand::sprint & command; bool is_acceleration = false; diff --git a/engine/source/runtime/function/input/input_system.cpp b/engine/source/runtime/function/input/input_system.cpp index aea0e8c2f..2ae7f8090 100644 --- a/engine/source/runtime/function/input/input_system.cpp +++ b/engine/source/runtime/function/input/input_system.cpp @@ -62,7 +62,7 @@ namespace Piccolo m_game_command |= (unsigned int)GameCommand::sprint; break; case GLFW_KEY_F: - m_game_command ^= (unsigned int)GameCommand::free_carema; + m_game_command ^= (unsigned int)GameCommand::free_camera; break; default: break; diff --git a/engine/source/runtime/function/input/input_system.h b/engine/source/runtime/function/input/input_system.h index 31b776406..c911d0f47 100644 --- a/engine/source/runtime/function/input/input_system.h +++ b/engine/source/runtime/function/input/input_system.h @@ -14,7 +14,7 @@ namespace Piccolo squat = 1 << 5, // not implemented yet sprint = 1 << 6, // LEFT SHIFT fire = 1 << 7, // not implemented yet - free_carema = 1 << 8, // F + free_camera = 1 << 8, // F invalid = (unsigned int)(1 << 31) // lost focus }; diff --git a/engine/source/runtime/function/particle/emitter_id_allocator.cpp b/engine/source/runtime/function/particle/emitter_id_allocator.cpp index f2dcf463e..954111622 100644 --- a/engine/source/runtime/function/particle/emitter_id_allocator.cpp +++ b/engine/source/runtime/function/particle/emitter_id_allocator.cpp @@ -10,7 +10,7 @@ namespace Piccolo { std::atomic new_emitter_ret = m_next_id.load(); m_next_id++; - if (m_next_id >= k_invalid_particke_emmiter_id) + if (m_next_id >= k_invalid_particle_emitter_id) { LOG_FATAL("particle emitter id overflow"); } diff --git a/engine/source/runtime/function/particle/emitter_id_allocator.h b/engine/source/runtime/function/particle/emitter_id_allocator.h index a158c8f93..f9ee321dc 100644 --- a/engine/source/runtime/function/particle/emitter_id_allocator.h +++ b/engine/source/runtime/function/particle/emitter_id_allocator.h @@ -7,7 +7,7 @@ namespace Piccolo { using ParticleEmitterID = std::size_t; - constexpr ParticleEmitterID k_invalid_particke_emmiter_id = std::numeric_limits::max(); + constexpr ParticleEmitterID k_invalid_particle_emitter_id = std::numeric_limits::max(); class ParticleEmitterIDAllocator { diff --git a/engine/source/runtime/function/particle/particle_common.h b/engine/source/runtime/function/particle/particle_common.h index ad95bf4df..87662b836 100644 --- a/engine/source/runtime/function/particle/particle_common.h +++ b/engine/source/runtime/function/particle/particle_common.h @@ -15,11 +15,11 @@ namespace Piccolo static constexpr int s_default_particle_life_time{ 10 }; static constexpr float s_default_particle_time_step{ 0.004 }; - static const Vector4 s_default_emiter_position{ 5.71, 13.53, 3.0, 0.5 }; - static const Vector4 s_default_emiter_velocity{ 0.02, 0.02, 2.5, 4.0 }; - static const Vector4 s_default_emiter_acceleration{ 0.00, 0.00, -2.5, 0.0 }; - static const Vector3 s_default_emiter_size{ 0.02, 0.02, 0.0 }; - static const Vector2 s_default_emiter_life{ 1.2, 0.0 }; + static const Vector4 s_default_emitter_position{ 5.71, 13.53, 3.0, 0.5 }; + static const Vector4 s_default_emitter_velocity{ 0.02, 0.02, 2.5, 4.0 }; + static const Vector4 s_default_emitter_acceleration{ 0.00, 0.00, -2.5, 0.0 }; + static const Vector3 s_default_emitter_size{ 0.02, 0.02, 0.0 }; + static const Vector2 s_default_emitter_life{ 1.2, 0.0 }; enum class EMITTER_TYPE { diff --git a/engine/source/runtime/function/render/passes/directional_light_pass.cpp b/engine/source/runtime/function/render/passes/directional_light_pass.cpp index ca0dccf5f..c5a0742c7 100644 --- a/engine/source/runtime/function/render/passes/directional_light_pass.cpp +++ b/engine/source/runtime/function/render/passes/directional_light_pass.cpp @@ -465,7 +465,7 @@ namespace Piccolo directional_light_mesh_drawcall_batch; // reorganize mesh - for (RenderMeshNode& node : *(m_visiable_nodes.p_directional_light_visible_mesh_nodes)) + for (RenderMeshNode& node : *(m_visible_nodes.p_directional_light_visible_mesh_nodes)) { auto& mesh_instanced = directional_light_mesh_drawcall_batch[node.ref_material]; auto& mesh_nodes = mesh_instanced[node.ref_mesh]; diff --git a/engine/source/runtime/function/render/passes/main_camera_pass.cpp b/engine/source/runtime/function/render/passes/main_camera_pass.cpp index 3300e4638..19b99b4de 100644 --- a/engine/source/runtime/function/render/passes/main_camera_pass.cpp +++ b/engine/source/runtime/function/render/passes/main_camera_pass.cpp @@ -26,7 +26,7 @@ namespace Piccolo RenderPass::initialize(nullptr); const MainCameraPassInitInfo* _init_info = static_cast(init_info); - m_enable_fxaa = _init_info->enble_fxaa; + m_enable_fxaa = _init_info->enable_fxaa; setupAttachments(); setupRenderPass(); @@ -2112,7 +2112,7 @@ namespace Piccolo std::map>> main_camera_mesh_drawcall_batch; // reorganize mesh - for (RenderMeshNode& node : *(m_visiable_nodes.p_main_camera_visible_mesh_nodes)) + for (RenderMeshNode& node : *(m_visible_nodes.p_main_camera_visible_mesh_nodes)) { auto& mesh_instanced = main_camera_mesh_drawcall_batch[node.ref_material]; auto& mesh_nodes = mesh_instanced[node.ref_mesh]; @@ -2385,7 +2385,7 @@ namespace Piccolo std::map>> main_camera_mesh_drawcall_batch; // reorganize mesh - for (RenderMeshNode& node : *(m_visiable_nodes.p_main_camera_visible_mesh_nodes)) + for (RenderMeshNode& node : *(m_visible_nodes.p_main_camera_visible_mesh_nodes)) { auto& mesh_instanced = main_camera_mesh_drawcall_batch[node.ref_material]; auto& mesh_nodes = mesh_instanced[node.ref_mesh]; @@ -2683,11 +2683,11 @@ namespace Piccolo &perframe_dynamic_offset); m_axis_storage_buffer_object.selected_axis = m_selected_axis; - m_axis_storage_buffer_object.model_matrix = m_visiable_nodes.p_axis_node->model_matrix; + m_axis_storage_buffer_object.model_matrix = m_visible_nodes.p_axis_node->model_matrix; - RHIBuffer* vertex_buffers[3] = {m_visiable_nodes.p_axis_node->ref_mesh->mesh_vertex_position_buffer, - m_visiable_nodes.p_axis_node->ref_mesh->mesh_vertex_varying_enable_blending_buffer, - m_visiable_nodes.p_axis_node->ref_mesh->mesh_vertex_varying_buffer}; + RHIBuffer* vertex_buffers[3] = {m_visible_nodes.p_axis_node->ref_mesh->mesh_vertex_position_buffer, + m_visible_nodes.p_axis_node->ref_mesh->mesh_vertex_varying_enable_blending_buffer, + m_visible_nodes.p_axis_node->ref_mesh->mesh_vertex_varying_buffer}; RHIDeviceSize offsets[3] = {0, 0, 0}; m_rhi->cmdBindVertexBuffersPFN(m_rhi->getCurrentCommandBuffer(), 0, @@ -2695,7 +2695,7 @@ namespace Piccolo vertex_buffers, offsets); m_rhi->cmdBindIndexBufferPFN(m_rhi->getCurrentCommandBuffer(), - m_visiable_nodes.p_axis_node->ref_mesh->mesh_index_buffer, + m_visible_nodes.p_axis_node->ref_mesh->mesh_index_buffer, 0, RHI_INDEX_TYPE_UINT16); (*reinterpret_cast(reinterpret_cast( @@ -2703,7 +2703,7 @@ namespace Piccolo m_axis_storage_buffer_object; m_rhi->cmdDrawIndexedPFN(m_rhi->getCurrentCommandBuffer(), - m_visiable_nodes.p_axis_node->ref_mesh->mesh_index_count, + m_visible_nodes.p_axis_node->ref_mesh->mesh_index_count, 1, 0, 0, diff --git a/engine/source/runtime/function/render/passes/main_camera_pass.h b/engine/source/runtime/function/render/passes/main_camera_pass.h index 357ccab13..5ead2504b 100644 --- a/engine/source/runtime/function/render/passes/main_camera_pass.h +++ b/engine/source/runtime/function/render/passes/main_camera_pass.h @@ -15,7 +15,7 @@ namespace Piccolo struct MainCameraPassInitInfo : RenderPassInitInfo { - bool enble_fxaa; + bool enable_fxaa; }; class MainCameraPass : public RenderPass diff --git a/engine/source/runtime/function/render/passes/particle_pass.cpp b/engine/source/runtime/function/render/passes/particle_pass.cpp index cadafeed8..c5645ca57 100644 --- a/engine/source/runtime/function/render/passes/particle_pass.cpp +++ b/engine/source/runtime/function/render/passes/particle_pass.cpp @@ -653,7 +653,7 @@ namespace Piccolo m_rhi->freeCommandBuffers(m_rhi->getCommandPoor(), 1, copyCmd); } - const VkDeviceSize staggingBuferSize = s_max_particles * sizeof(Particle); + const VkDeviceSize staggingBufferSize = s_max_particles * sizeof(Particle); m_emitter_buffer_batches[id].m_emitter_desc = desc; // fill in data @@ -681,7 +681,7 @@ namespace Piccolo RHI_MEMORY_PROPERTY_HOST_VISIBLE_BIT, m_emitter_buffer_batches[id].m_position_host_buffer, m_emitter_buffer_batches[id].m_position_host_memory, - staggingBuferSize); + staggingBufferSize); // Flush writes to host visible buffer void* mapped; @@ -697,14 +697,14 @@ namespace Piccolo RHI_MEMORY_PROPERTY_DEVICE_LOCAL_BIT, m_emitter_buffer_batches[id].m_position_device_buffer, m_emitter_buffer_batches[id].m_position_device_memory, - staggingBuferSize); + staggingBufferSize); m_rhi->createBufferAndInitialize(RHI_BUFFER_USAGE_STORAGE_BUFFER_BIT | RHI_BUFFER_USAGE_TRANSFER_SRC_BIT | RHI_BUFFER_USAGE_TRANSFER_DST_BIT, RHI_MEMORY_PROPERTY_DEVICE_LOCAL_BIT, m_emitter_buffer_batches[id].m_position_render_buffer, m_emitter_buffer_batches[id].m_position_render_memory, - staggingBuferSize); + staggingBufferSize); // Copy to staging buffer RHICommandBufferAllocateInfo cmdBufAllocateInfo {}; @@ -727,7 +727,7 @@ namespace Piccolo RHIBufferCopy copyRegion = {}; copyRegion.srcOffset = 0; copyRegion.dstOffset = 0; - copyRegion.size = staggingBuferSize; + copyRegion.size = staggingBufferSize; m_rhi->cmdCopyBuffer(copyCmd, m_emitter_buffer_batches[id].m_position_host_buffer, m_emitter_buffer_batches[id].m_position_device_buffer, @@ -814,11 +814,11 @@ namespace Piccolo { RHIDescriptorSetLayoutBinding particle_layout_bindings[11] = {}; { - RHIDescriptorSetLayoutBinding& uniform_layout_bingding = particle_layout_bindings[0]; - uniform_layout_bingding.binding = 0; - uniform_layout_bingding.descriptorType = RHI_DESCRIPTOR_TYPE_UNIFORM_BUFFER; - uniform_layout_bingding.descriptorCount = 1; - uniform_layout_bingding.stageFlags = RHI_SHADER_STAGE_COMPUTE_BIT; + RHIDescriptorSetLayoutBinding& uniform_layout_binding = particle_layout_bindings[0]; + uniform_layout_binding.binding = 0; + uniform_layout_binding.descriptorType = RHI_DESCRIPTOR_TYPE_UNIFORM_BUFFER; + uniform_layout_binding.descriptorCount = 1; + uniform_layout_binding.stageFlags = RHI_SHADER_STAGE_COMPUTE_BIT; } { diff --git a/engine/source/runtime/function/render/passes/pick_pass.cpp b/engine/source/runtime/function/render/passes/pick_pass.cpp index 90ad4a1a6..045bb6d03 100644 --- a/engine/source/runtime/function/render/passes/pick_pass.cpp +++ b/engine/source/runtime/function/render/passes/pick_pass.cpp @@ -434,7 +434,7 @@ namespace Piccolo std::map>> main_camera_mesh_drawcall_batch; // reorganize mesh - for (RenderMeshNode& node : *(m_visiable_nodes.p_main_camera_visible_mesh_nodes)) + for (RenderMeshNode& node : *(m_visible_nodes.p_main_camera_visible_mesh_nodes)) { auto& mesh_instanced = main_camera_mesh_drawcall_batch[node.ref_material]; auto& model_nodes = mesh_instanced[node.ref_mesh]; diff --git a/engine/source/runtime/function/render/passes/point_light_pass.cpp b/engine/source/runtime/function/render/passes/point_light_pass.cpp index e503cb1ca..d62e3d910 100644 --- a/engine/source/runtime/function/render/passes/point_light_pass.cpp +++ b/engine/source/runtime/function/render/passes/point_light_pass.cpp @@ -479,7 +479,7 @@ namespace Piccolo std::map>> point_lights_mesh_drawcall_batch; // reorganize mesh - for (RenderMeshNode& node : *(m_visiable_nodes.p_point_lights_visible_mesh_nodes)) + for (RenderMeshNode& node : *(m_visible_nodes.p_point_lights_visible_mesh_nodes)) { auto& mesh_instanced = point_lights_mesh_drawcall_batch[node.ref_material]; auto& mesh_nodes = mesh_instanced[node.ref_mesh]; diff --git a/engine/source/runtime/function/render/render_common.h b/engine/source/runtime/function/render/render_common.h index 9cda39c34..5b5feab72 100644 --- a/engine/source/runtime/function/render/render_common.h +++ b/engine/source/runtime/function/render/render_common.h @@ -133,7 +133,7 @@ namespace Piccolo float _padding_right_position; Vector3 up_direction; float _padding_up_direction; - Vector3 foward_direction; + Vector3 forward_direction; float _padding_forward_position; }; diff --git a/engine/source/runtime/function/render/render_mesh.h b/engine/source/runtime/function/render/render_mesh.h index 20d553cf8..2d38778ba 100644 --- a/engine/source/runtime/function/render/render_mesh.h +++ b/engine/source/runtime/function/render/render_mesh.h @@ -11,7 +11,7 @@ namespace Piccolo { struct MeshVertex { - struct VulkanMeshVertexPostition + struct VulkanMeshVertexPosition { Vector3 position; }; @@ -39,7 +39,7 @@ namespace Piccolo // position binding_descriptions[0].binding = 0; - binding_descriptions[0].stride = sizeof(VulkanMeshVertexPostition); + binding_descriptions[0].stride = sizeof(VulkanMeshVertexPosition); binding_descriptions[0].inputRate = RHI_VERTEX_INPUT_RATE_VERTEX; // varying blending binding_descriptions[1].binding = 1; @@ -60,7 +60,7 @@ namespace Piccolo attribute_descriptions[0].binding = 0; attribute_descriptions[0].location = 0; attribute_descriptions[0].format = RHI_FORMAT_R32G32B32_SFLOAT; - attribute_descriptions[0].offset = offsetof(VulkanMeshVertexPostition, position); + attribute_descriptions[0].offset = offsetof(VulkanMeshVertexPosition, position); // varying blending attribute_descriptions[1].binding = 1; diff --git a/engine/source/runtime/function/render/render_pass.cpp b/engine/source/runtime/function/render/render_pass.cpp index b6aa6940d..5fd067c33 100644 --- a/engine/source/runtime/function/render/render_pass.cpp +++ b/engine/source/runtime/function/render/render_pass.cpp @@ -5,7 +5,7 @@ #include "runtime/function/render/render_resource.h" #include "runtime/function/render/interface/vulkan/vulkan_rhi.h" -Piccolo::VisiableNodes Piccolo::RenderPass::m_visiable_nodes; +Piccolo::VisibleNodes Piccolo::RenderPass::m_visible_nodes; namespace Piccolo { diff --git a/engine/source/runtime/function/render/render_pass.h b/engine/source/runtime/function/render/render_pass.h index d0c2ba2f3..7abe34b95 100644 --- a/engine/source/runtime/function/render/render_pass.h +++ b/engine/source/runtime/function/render/render_pass.h @@ -42,7 +42,7 @@ namespace Piccolo _main_camera_subpass_count }; - struct VisiableNodes + struct VisibleNodes { std::vector* p_directional_light_visible_mesh_nodes {nullptr}; std::vector* p_point_lights_visible_mesh_nodes {nullptr}; @@ -98,7 +98,7 @@ namespace Piccolo virtual std::vector getFramebufferImageViews() const; virtual std::vector getDescriptorSetLayouts() const; - static VisiableNodes m_visiable_nodes; + static VisibleNodes m_visible_nodes; private: }; diff --git a/engine/source/runtime/function/render/render_pipeline.cpp b/engine/source/runtime/function/render/render_pipeline.cpp index 4b9f3f076..2f10e4d1e 100644 --- a/engine/source/runtime/function/render/render_pipeline.cpp +++ b/engine/source/runtime/function/render/render_pipeline.cpp @@ -62,7 +62,7 @@ namespace Piccolo std::static_pointer_cast(m_directional_light_pass)->m_framebuffer.attachments[0].view; MainCameraPassInitInfo main_camera_init_info; - main_camera_init_info.enble_fxaa = init_info.enable_fxaa; + main_camera_init_info.enable_fxaa = init_info.enable_fxaa; main_camera_pass->setParticlePass(particle_pass); m_main_camera_pass->initialize(&main_camera_init_info); diff --git a/engine/source/runtime/function/render/render_resource.cpp b/engine/source/runtime/function/render/render_resource.cpp index 8f8ac52b3..0d23902dd 100644 --- a/engine/source/runtime/function/render/render_resource.cpp +++ b/engine/source/runtime/function/render/render_resource.cpp @@ -162,7 +162,7 @@ namespace Piccolo m_particlebillboard_perframe_storage_buffer_object.proj_view_matrix = proj_view_matrix; m_particlebillboard_perframe_storage_buffer_object.right_direction = camera->right(); - m_particlebillboard_perframe_storage_buffer_object.foward_direction = camera->forward(); + m_particlebillboard_perframe_storage_buffer_object.forward_direction = camera->forward(); m_particlebillboard_perframe_storage_buffer_object.up_direction = camera->up(); } @@ -633,7 +633,7 @@ namespace Piccolo assert(0 == (index_buffer_size % sizeof(uint16_t))); uint32_t index_count = index_buffer_size / sizeof(uint16_t); - RHIDeviceSize vertex_position_buffer_size = sizeof(MeshVertex::VulkanMeshVertexPostition) * vertex_count; + RHIDeviceSize vertex_position_buffer_size = sizeof(MeshVertex::VulkanMeshVertexPosition) * vertex_count; RHIDeviceSize vertex_varying_enable_blending_buffer_size = sizeof(MeshVertex::VulkanMeshVertexVaryingEnableBlending) * vertex_count; RHIDeviceSize vertex_varying_buffer_size = sizeof(MeshVertex::VulkanMeshVertexVarying) * vertex_count; @@ -666,8 +666,8 @@ namespace Piccolo 0, &inefficient_staging_buffer_data); - MeshVertex::VulkanMeshVertexPostition* mesh_vertex_positions = - reinterpret_cast( + MeshVertex::VulkanMeshVertexPosition* mesh_vertex_positions = + reinterpret_cast( reinterpret_cast(inefficient_staging_buffer_data) + vertex_position_buffer_offset); MeshVertex::VulkanMeshVertexVaryingEnableBlending* mesh_vertex_blending_varyings = reinterpret_cast( @@ -842,7 +842,7 @@ namespace Piccolo assert(0 == (vertex_buffer_size % sizeof(MeshVertexDataDefinition))); uint32_t vertex_count = vertex_buffer_size / sizeof(MeshVertexDataDefinition); - RHIDeviceSize vertex_position_buffer_size = sizeof(MeshVertex::VulkanMeshVertexPostition) * vertex_count; + RHIDeviceSize vertex_position_buffer_size = sizeof(MeshVertex::VulkanMeshVertexPosition) * vertex_count; RHIDeviceSize vertex_varying_enable_blending_buffer_size = sizeof(MeshVertex::VulkanMeshVertexVaryingEnableBlending) * vertex_count; RHIDeviceSize vertex_varying_buffer_size = sizeof(MeshVertex::VulkanMeshVertexVarying) * vertex_count; @@ -871,8 +871,8 @@ namespace Piccolo 0, &inefficient_staging_buffer_data); - MeshVertex::VulkanMeshVertexPostition* mesh_vertex_positions = - reinterpret_cast( + MeshVertex::VulkanMeshVertexPosition* mesh_vertex_positions = + reinterpret_cast( reinterpret_cast(inefficient_staging_buffer_data) + vertex_position_buffer_offset); MeshVertex::VulkanMeshVertexVaryingEnableBlending* mesh_vertex_blending_varyings = reinterpret_cast( diff --git a/engine/source/runtime/function/render/render_resource_base.cpp b/engine/source/runtime/function/render/render_resource_base.cpp index 09199d5ca..3cdd8b1da 100644 --- a/engine/source/runtime/function/render/render_resource_base.cpp +++ b/engine/source/runtime/function/render/render_resource_base.cpp @@ -163,7 +163,7 @@ namespace Piccolo return ret; } - AxisAlignedBox RenderResourceBase::getCachedBoudingBox(const MeshSourceDesc& source) const + AxisAlignedBox RenderResourceBase::getCachedBoundingBox(const MeshSourceDesc& source) const { auto find_it = m_bounding_box_cache_map.find(source); if (find_it != m_bounding_box_cache_map.end()) diff --git a/engine/source/runtime/function/render/render_resource_base.h b/engine/source/runtime/function/render/render_resource_base.h index 64c4b8b36..0d73adbc4 100644 --- a/engine/source/runtime/function/render/render_resource_base.h +++ b/engine/source/runtime/function/render/render_resource_base.h @@ -44,7 +44,7 @@ namespace Piccolo std::shared_ptr loadTexture(std::string file, bool is_srgb = false); RenderMeshData loadMeshData(const MeshSourceDesc& source, AxisAlignedBox& bounding_box); RenderMaterialData loadMaterialData(const MaterialSourceDesc& source); - AxisAlignedBox getCachedBoudingBox(const MeshSourceDesc& source) const; + AxisAlignedBox getCachedBoundingBox(const MeshSourceDesc& source) const; private: StaticMeshData loadStaticMesh(std::string mesh_file, AxisAlignedBox& bounding_box); diff --git a/engine/source/runtime/function/render/render_scene.cpp b/engine/source/runtime/function/render/render_scene.cpp index e8bd4965d..1cdbc5aa8 100644 --- a/engine/source/runtime/function/render/render_scene.cpp +++ b/engine/source/runtime/function/render/render_scene.cpp @@ -21,17 +21,17 @@ namespace Piccolo void RenderScene::setVisibleNodesReference() { - RenderPass::m_visiable_nodes.p_directional_light_visible_mesh_nodes = &m_directional_light_visible_mesh_nodes; - RenderPass::m_visiable_nodes.p_point_lights_visible_mesh_nodes = &m_point_lights_visible_mesh_nodes; - RenderPass::m_visiable_nodes.p_main_camera_visible_mesh_nodes = &m_main_camera_visible_mesh_nodes; - RenderPass::m_visiable_nodes.p_axis_node = &m_axis_node; + RenderPass::m_visible_nodes.p_directional_light_visible_mesh_nodes = &m_directional_light_visible_mesh_nodes; + RenderPass::m_visible_nodes.p_point_lights_visible_mesh_nodes = &m_point_lights_visible_mesh_nodes; + RenderPass::m_visible_nodes.p_main_camera_visible_mesh_nodes = &m_main_camera_visible_mesh_nodes; + RenderPass::m_visible_nodes.p_axis_node = &m_axis_node; } GuidAllocator& RenderScene::getInstanceIdAllocator() { return m_instance_id_allocator; } GuidAllocator& RenderScene::getMeshAssetIdAllocator() { return m_mesh_asset_id_allocator; } - GuidAllocator& RenderScene::getMaterialAssetdAllocator() + GuidAllocator& RenderScene::getMaterialAssetAllocator() { return m_material_asset_id_allocator; } diff --git a/engine/source/runtime/function/render/render_scene.h b/engine/source/runtime/function/render/render_scene.h index 71d95fe4e..e2626403e 100644 --- a/engine/source/runtime/function/render/render_scene.h +++ b/engine/source/runtime/function/render/render_scene.h @@ -48,7 +48,7 @@ namespace Piccolo GuidAllocator& getInstanceIdAllocator(); GuidAllocator& getMeshAssetIdAllocator(); - GuidAllocator& getMaterialAssetdAllocator(); + GuidAllocator& getMaterialAssetAllocator(); void addInstanceIdToMap(uint32_t instance_id, GObjectID go_id); GObjectID getGObjectIDByMeshID(uint32_t mesh_id) const; diff --git a/engine/source/runtime/function/render/render_swap_context.cpp b/engine/source/runtime/function/render/render_swap_context.cpp index 04833acf3..5195cb7e1 100644 --- a/engine/source/runtime/function/render/render_swap_context.cpp +++ b/engine/source/runtime/function/render/render_swap_context.cpp @@ -53,7 +53,7 @@ namespace Piccolo m_swap_data[m_render_swap_data_index].m_emitter_transform_request.has_value()); } - void RenderSwapContext::resetLevelRsourceSwapData() + void RenderSwapContext::resetLevelResourceSwapData() { m_swap_data[m_render_swap_data_index].m_level_resource_desc.reset(); } @@ -68,7 +68,7 @@ namespace Piccolo m_swap_data[m_render_swap_data_index].m_game_object_to_delete.reset(); } - void RenderSwapContext::resetPartilceBatchSwapData() + void RenderSwapContext::resetParticleBatchSwapData() { m_swap_data[m_render_swap_data_index].m_particle_submit_request.reset(); } @@ -87,13 +87,13 @@ namespace Piccolo void RenderSwapContext::swap() { - resetLevelRsourceSwapData(); + resetLevelResourceSwapData(); resetGameObjectResourceSwapData(); resetGameObjectToDelete(); resetCameraSwapData(); resetEmitterTickSwapData(); resetEmitterTransformSwapData(); - resetPartilceBatchSwapData(); + resetParticleBatchSwapData(); std::swap(m_logic_swap_data_index, m_render_swap_data_index); } diff --git a/engine/source/runtime/function/render/render_swap_context.h b/engine/source/runtime/function/render/render_swap_context.h index 52c6386db..82d91fe4b 100644 --- a/engine/source/runtime/function/render/render_swap_context.h +++ b/engine/source/runtime/function/render/render_swap_context.h @@ -112,11 +112,11 @@ namespace Piccolo RenderSwapData& getLogicSwapData(); RenderSwapData& getRenderSwapData(); void swapLogicRenderData(); - void resetLevelRsourceSwapData(); + void resetLevelResourceSwapData(); void resetGameObjectResourceSwapData(); void resetGameObjectToDelete(); void resetCameraSwapData(); - void resetPartilceBatchSwapData(); + void resetParticleBatchSwapData(); void resetEmitterTickSwapData(); void resetEmitterTransformSwapData(); diff --git a/engine/source/runtime/function/render/render_system.cpp b/engine/source/runtime/function/render/render_system.cpp index 6429a4944..0a66d7012 100644 --- a/engine/source/runtime/function/render/render_system.cpp +++ b/engine/source/runtime/function/render/render_system.cpp @@ -260,7 +260,7 @@ namespace Piccolo m_render_resource->uploadGlobalRenderResource(m_rhi, *swap_data.m_level_resource_desc); // reset level resource swap data to a clean state - m_swap_context.resetLevelRsourceSwapData(); + m_swap_context.resetLevelResourceSwapData(); } // update game object if needed @@ -295,7 +295,7 @@ namespace Piccolo } else { - render_entity.m_bounding_box = m_render_resource->getCachedBoudingBox(mesh_source); + render_entity.m_bounding_box = m_render_resource->getCachedBoundingBox(mesh_source); } render_entity.m_mesh_asset_id = m_render_scene->getMeshAssetIdAllocator().allocGuid(mesh_source); @@ -329,7 +329,7 @@ namespace Piccolo "", ""}; } - bool is_material_loaded = m_render_scene->getMaterialAssetdAllocator().hasElement(material_source); + bool is_material_loaded = m_render_scene->getMaterialAssetAllocator().hasElement(material_source); RenderMaterialData material_data; if (!is_material_loaded) @@ -338,7 +338,7 @@ namespace Piccolo } render_entity.m_material_asset_id = - m_render_scene->getMaterialAssetdAllocator().allocGuid(material_source); + m_render_scene->getMaterialAssetAllocator().allocGuid(material_source); // create game object on the graphics api side if (!is_mesh_loaded) @@ -426,7 +426,7 @@ namespace Piccolo particle_pass->initializeEmitters(); - m_swap_context.resetPartilceBatchSwapData(); + m_swap_context.resetParticleBatchSwapData(); } if (swap_data.m_emitter_tick_request.has_value()) { diff --git a/engine/source/runtime/resource/config_manager/config_manager.cpp b/engine/source/runtime/resource/config_manager/config_manager.cpp index 6e38d8125..5eb0b3135 100644 --- a/engine/source/runtime/resource/config_manager/config_manager.cpp +++ b/engine/source/runtime/resource/config_manager/config_manager.cpp @@ -15,11 +15,11 @@ namespace Piccolo std::string config_line; while (std::getline(config_file, config_line)) { - size_t seperate_pos = config_line.find_first_of('='); - if (seperate_pos > 0 && seperate_pos < (config_line.length() - 1)) + size_t separate_pos = config_line.find_first_of('='); + if (separate_pos > 0 && separate_pos < (config_line.length() - 1)) { - std::string name = config_line.substr(0, seperate_pos); - std::string value = config_line.substr(seperate_pos + 1, config_line.length() - seperate_pos - 1); + std::string name = config_line.substr(0, separate_pos); + std::string value = config_line.substr(separate_pos + 1, config_line.length() - separate_pos - 1); if (name == "BinaryRootFolder") { m_root_folder = config_file_path.parent_path() / value; diff --git a/engine/template/commonReflectionFile.mustache b/engine/template/commonReflectionFile.mustache index f08e50532..293586ad8 100644 --- a/engine/template/commonReflectionFile.mustache +++ b/engine/template/commonReflectionFile.mustache @@ -7,7 +7,7 @@ namespace Piccolo{ {{#class_defines}}class {{class_name}}; {{/class_defines}} namespace Reflection{ -{{#class_defines}}namespace TypeFieldReflectionOparator{ +{{#class_defines}}namespace TypeFieldReflectionOperator{ class Type{{class_name}}Operator{ public: static const char* getClassName(){ return "{{class_name}}";} @@ -44,7 +44,7 @@ namespace Reflection{ static void invoke_{{class_method_name}}(void * instance){static_cast<{{class_name}}*>(instance)->{{class_method_name}}();} {{/class_method_defines}} }; -}//namespace TypeFieldReflectionOparator +}//namespace TypeFieldReflectionOperator {{#vector_exist}}namespace ArrayReflectionOperator{ {{#vector_defines}}#ifndef Array{{vector_useful_name}}OperatorMACRO #define Array{{vector_useful_name}}OperatorMACRO @@ -71,19 +71,19 @@ namespace Reflection{ void TypeWrapperRegister_{{class_name}}(){ {{#class_field_defines}}FieldFunctionTuple* field_function_tuple_{{class_field_name}}=new FieldFunctionTuple( - &TypeFieldReflectionOparator::Type{{class_name}}Operator::set_{{class_field_name}}, - &TypeFieldReflectionOparator::Type{{class_name}}Operator::get_{{class_field_name}}, - &TypeFieldReflectionOparator::Type{{class_name}}Operator::getClassName, - &TypeFieldReflectionOparator::Type{{class_name}}Operator::getFieldName_{{class_field_name}}, - &TypeFieldReflectionOparator::Type{{class_name}}Operator::getFieldTypeName_{{class_field_name}}, - &TypeFieldReflectionOparator::Type{{class_name}}Operator::isArray_{{class_field_name}}); + &TypeFieldReflectionOperator::Type{{class_name}}Operator::set_{{class_field_name}}, + &TypeFieldReflectionOperator::Type{{class_name}}Operator::get_{{class_field_name}}, + &TypeFieldReflectionOperator::Type{{class_name}}Operator::getClassName, + &TypeFieldReflectionOperator::Type{{class_name}}Operator::getFieldName_{{class_field_name}}, + &TypeFieldReflectionOperator::Type{{class_name}}Operator::getFieldTypeName_{{class_field_name}}, + &TypeFieldReflectionOperator::Type{{class_name}}Operator::isArray_{{class_field_name}}); REGISTER_FIELD_TO_MAP("{{class_name}}", field_function_tuple_{{class_field_name}}); {{/class_field_defines}} {{#class_method_defines}} MethodFunctionTuple* method_function_tuple_{{class_method_name}}=new MethodFunctionTuple( - &TypeFieldReflectionOparator::Type{{class_name}}Operator::getMethodName_{{class_method_name}}, - &TypeFieldReflectionOparator::Type{{class_name}}Operator::invoke_{{class_method_name}}); + &TypeFieldReflectionOperator::Type{{class_name}}Operator::getMethodName_{{class_method_name}}, + &TypeFieldReflectionOperator::Type{{class_name}}Operator::invoke_{{class_method_name}}); REGISTER_Method_TO_MAP("{{class_name}}", method_function_tuple_{{class_method_name}}); {{/class_method_defines}} @@ -96,9 +96,9 @@ namespace Reflection{ REGISTER_ARRAY_TO_MAP("{{{vector_type_name}}}", array_tuple_{{vector_useful_name}}); {{/vector_defines}}{{/vector_exist}} {{#class_need_register}}ClassFunctionTuple* class_function_tuple_{{class_name}}=new ClassFunctionTuple( - &TypeFieldReflectionOparator::Type{{class_name}}Operator::get{{class_name}}BaseClassReflectionInstanceList, - &TypeFieldReflectionOparator::Type{{class_name}}Operator::constructorWithJson, - &TypeFieldReflectionOparator::Type{{class_name}}Operator::writeByName); + &TypeFieldReflectionOperator::Type{{class_name}}Operator::get{{class_name}}BaseClassReflectionInstanceList, + &TypeFieldReflectionOperator::Type{{class_name}}Operator::constructorWithJson, + &TypeFieldReflectionOperator::Type{{class_name}}Operator::writeByName); REGISTER_BASE_CLASS_TO_MAP("{{class_name}}", class_function_tuple_{{class_name}}); {{/class_need_register}} }{{/class_defines}}