Skip to content

Commit

Permalink
Fixed tidy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Mag1str02 committed Nov 22, 2024
1 parent e8e751a commit d962003
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ jobs:
files-changed-only: false
database: '${{ github.workspace }}/build'
repo-root: '${{ github.workspace }}'
ignore: 'build/**|Examples/**|Sandbox/**|DummyEngine/Core/ECS**|DummyEngine/Platform/Macos/**|DummyEditor/Platform/Macos/**'
ignore: 'build/**|Examples/**|Sandbox/**|DummyEngine/Core/ECS**|DummyEngine/Platform/**|DummyEditor/Platform/**'
step-summary: true
- name: Check Linter Results
if: steps.linter.outputs.checks-failed > 0
Expand Down
2 changes: 1 addition & 1 deletion CMake/Compiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if(${DE_ENABLE_CLANG_TIDY_ON_COMPILATION})
find_program(CLANG_TIDY_EXE NAMES "clang-tidy" "clang-tidy-17" "clang-tidy-18" "clang-tidy-19" REQUIRED)
set(CLANG_TIDY_COMMAND "${CLANG_TIDY_EXE}" "-p" "${CMAKE_CURRENT_SOURCE_DIR}/build")
if (${DE_CLANG_TIDY_WARNINGS_AS_ERRORS})
set(CLANG_TIDY_COMMAND ${CLANG_TIDY_COMMAND} "--warnings-as-errors='*'")
set(CLANG_TIDY_COMMAND ${CLANG_TIDY_COMMAND} "--warnings-as-errors=*")
endif()
message(STATUS "CLANG_TIDY_COMMAND: [${CLANG_TIDY_COMMAND}]")
endif()
Expand Down
3 changes: 3 additions & 0 deletions DummyEditor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@ add_dependencies(DummyEditor DummyEditorScripts)

if (${ENABLE_PRECOMPILED_HEADERS})
target_precompile_headers(DummyEditor REUSE_FROM DummyEngineLib)
endif()
if (${DE_ENABLE_CLANG_TIDY_ON_COMPILATION})
set_target_properties(DummyEditor PROPERTIES CXX_CLANG_TIDY "${CLANG_TIDY_COMMAND}")
endif()
2 changes: 1 addition & 1 deletion DummyEditor/ImGuiUtils/ImGuiManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ namespace DummyEngine {
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0.0f, 0.0f));

ImGui::Begin("DockSpace",
NULL,
nullptr,
ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize |
ImGuiWindowFlags_NoBringToFrontOnFocus | ImGuiWindowFlags_NoNavFocus | ImGuiWindowFlags_MenuBar |
ImGuiWindowFlags_NoDocking);
Expand Down
15 changes: 8 additions & 7 deletions DummyEditor/Panels/ViewportPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ namespace DummyEngine {
if (m_Controller) {
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0.0f, 0.0f));
if (ImGui::Begin((ICON_MD_TV + m_Name).c_str())) {
m_ViewportSize = ImGui::GetContentRegionAvail();
auto buffer = m_FrameBuffer.lock();
viewport_size_ = ImGui::GetContentRegionAvail();
auto buffer = frame_buffer_.lock();
if (buffer) {
if (m_UseDepthAttachment) {
ImGui::Image(buffer->GetDepthAttachment()->GetRendererId(), m_ViewportSize, {0, 1}, {1, 0});
if (use_depth_attachment_) {
ImGui::Image(buffer->GetDepthAttachment()->GetRendererId(), viewport_size_, {0, 1}, {1, 0});
} else {
ImGui::Image(buffer->GetColorAttachment(0)->GetRendererId(), m_ViewportSize, {0, 1}, {1, 0});
ImGui::Image(buffer->GetColorAttachment(0)->GetRendererId(), viewport_size_, {0, 1}, {1, 0});

ToolPanel();
}
}
Expand Down Expand Up @@ -69,7 +70,7 @@ namespace DummyEngine {
++button_amount;
build_and_run = true;
}
ImVec2 cursor_pos{m_ViewportSize.x * 0.5f - (button_amount * button_size.x + (button_amount - 1) * button_padding.x) / 2, button_padding.y};
ImVec2 cursor_pos{viewport_size_.x * 0.5f - (button_amount * button_size.x + (button_amount - 1) * button_padding.x) / 2, button_padding.y};

if (play) {
ImGui::SetCursorPos(cursor_pos);
Expand Down Expand Up @@ -119,6 +120,6 @@ namespace DummyEngine {
}
}
void ViewportPanel::SetFrameBuffer(Ref<FrameBuffer> buffer) {
m_FrameBuffer = buffer;
frame_buffer_ = buffer;
}
} // namespace DummyEngine
12 changes: 6 additions & 6 deletions DummyEditor/Panels/ViewportPanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ namespace DummyEngine {

void ToolPanel();
void SetFrameBuffer(Ref<FrameBuffer> buffer);
U32 GetWidth() const { return m_ViewportSize.x; }
U32 GetHeight() const { return m_ViewportSize.y; }
void UseDepthAttachment(bool f) { m_UseDepthAttachment = f; }
U32 GetWidth() const { return viewport_size_.x; }
U32 GetHeight() const { return viewport_size_.y; }
void UseDepthAttachment(bool f) { use_depth_attachment_ = f; }

private:
bool m_UseDepthAttachment = false;
ImVec2 m_ViewportSize;
WeakRef<FrameBuffer> m_FrameBuffer;
bool use_depth_attachment_ = false;
ImVec2 viewport_size_;
WeakRef<FrameBuffer> frame_buffer_;
};

} // namespace DummyEngine
2 changes: 1 addition & 1 deletion DummyEngine/Utils/DS/Trie.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace DummyEngine {
class Trie {
struct Node {
Node(Ref<Node>& p, char prev) {
Parent = p;
Parent = p;
CharToParent = prev;
}

Expand Down

0 comments on commit d962003

Please sign in to comment.