Skip to content

Commit 6916539

Browse files
committed
style: apply clang-format-18 across codebase and remove stale graphics/ui paths
1 parent c786b60 commit 6916539

177 files changed

Lines changed: 6453 additions & 10048 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

editor/action_commands.cpp

Lines changed: 64 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -5,75 +5,76 @@
55
namespace Chained
66
{
77

8-
void EditorActionCommands::RenameAsset(const std::filesystem::path& path, const std::string& newName)
9-
{
10-
if (!std::filesystem::exists(path))
11-
{
12-
CH_CORE_WARN("RenameAsset: source does not exist: {}", path.string());
13-
return;
14-
}
8+
void EditorActionCommands::RenameAsset(const std::filesystem::path& path, const std::string& newName)
9+
{
10+
if (!std::filesystem::exists(path))
11+
{
12+
CH_CORE_WARN("RenameAsset: source does not exist: {}", path.string());
13+
return;
14+
}
1515

16-
std::filesystem::path newPath = path.parent_path() / newName;
17-
if (std::filesystem::exists(newPath))
18-
{
19-
CH_CORE_ERROR("RenameAsset: destination already exists: {}", newPath.string());
20-
return;
21-
}
16+
std::filesystem::path newPath = path.parent_path() / newName;
17+
if (std::filesystem::exists(newPath))
18+
{
19+
CH_CORE_ERROR("RenameAsset: destination already exists: {}", newPath.string());
20+
return;
21+
}
2222

23-
std::error_code ec;
24-
std::filesystem::rename(path, newPath, ec);
25-
if (ec)
26-
{
27-
CH_CORE_ERROR("RenameAsset: failed to rename '{}' -> '{}': {}", path.string(), newPath.string(), ec.message());
28-
}
29-
}
23+
std::error_code ec;
24+
std::filesystem::rename(path, newPath, ec);
25+
if (ec)
26+
{
27+
CH_CORE_ERROR("RenameAsset: failed to rename '{}' -> '{}': {}", path.string(), newPath.string(),
28+
ec.message());
29+
}
30+
}
3031

31-
void EditorActionCommands::DeleteAsset(const std::filesystem::path& path)
32-
{
33-
if (!std::filesystem::exists(path))
34-
{
35-
CH_CORE_WARN("DeleteAsset: path does not exist: {}", path.string());
36-
return;
37-
}
32+
void EditorActionCommands::DeleteAsset(const std::filesystem::path& path)
33+
{
34+
if (!std::filesystem::exists(path))
35+
{
36+
CH_CORE_WARN("DeleteAsset: path does not exist: {}", path.string());
37+
return;
38+
}
3839

39-
std::error_code ec;
40-
std::filesystem::remove_all(path, ec);
41-
if (ec)
42-
{
43-
CH_CORE_ERROR("DeleteAsset: failed to delete '{}': {}", path.string(), ec.message());
44-
}
45-
}
40+
std::error_code ec;
41+
std::filesystem::remove_all(path, ec);
42+
if (ec)
43+
{
44+
CH_CORE_ERROR("DeleteAsset: failed to delete '{}': {}", path.string(), ec.message());
45+
}
46+
}
4647

47-
void EditorActionCommands::CreateFolder(const std::filesystem::path& parentPath, const std::string& name)
48-
{
49-
if (!std::filesystem::exists(parentPath))
50-
{
51-
CH_CORE_ERROR("CreateFolder: parent does not exist: {}", parentPath.string());
52-
return;
53-
}
48+
void EditorActionCommands::CreateFolder(const std::filesystem::path& parentPath, const std::string& name)
49+
{
50+
if (!std::filesystem::exists(parentPath))
51+
{
52+
CH_CORE_ERROR("CreateFolder: parent does not exist: {}", parentPath.string());
53+
return;
54+
}
5455

55-
std::filesystem::path newDir = parentPath / name;
56-
if (std::filesystem::exists(newDir))
57-
{
58-
int i = 1;
59-
constexpr int kMaxAttempts = 1000;
60-
do
61-
{
62-
newDir = parentPath / (name + " " + std::to_string(i++));
63-
if (i > kMaxAttempts)
64-
{
65-
CH_CORE_ERROR("CreateFolder: too many conflicts for '{}' in {}", name, parentPath.string());
66-
return;
67-
}
68-
} while (std::filesystem::exists(newDir));
69-
}
56+
std::filesystem::path newDir = parentPath / name;
57+
if (std::filesystem::exists(newDir))
58+
{
59+
int i = 1;
60+
constexpr int kMaxAttempts = 1000;
61+
do
62+
{
63+
newDir = parentPath / (name + " " + std::to_string(i++));
64+
if (i > kMaxAttempts)
65+
{
66+
CH_CORE_ERROR("CreateFolder: too many conflicts for '{}' in {}", name, parentPath.string());
67+
return;
68+
}
69+
} while (std::filesystem::exists(newDir));
70+
}
7071

71-
std::error_code ec;
72-
std::filesystem::create_directory(newDir, ec);
73-
if (ec)
74-
{
75-
CH_CORE_ERROR("CreateFolder: failed to create '{}': {}", newDir.string(), ec.message());
76-
}
77-
}
72+
std::error_code ec;
73+
std::filesystem::create_directory(newDir, ec);
74+
if (ec)
75+
{
76+
CH_CORE_ERROR("CreateFolder: failed to create '{}': {}", newDir.string(), ec.message());
77+
}
78+
}
7879

7980
} // namespace Chained

editor/asset_types.h

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,27 @@
88
namespace Chained
99
{
1010

11-
enum class EditorAssetType
12-
{
13-
Directory,
14-
Scene,
15-
Script,
16-
Model,
17-
Texture,
18-
Audio,
19-
Prefab,
20-
Shader,
21-
Other
22-
};
11+
enum class EditorAssetType
12+
{
13+
Directory,
14+
Scene,
15+
Script,
16+
Model,
17+
Texture,
18+
Audio,
19+
Prefab,
20+
Shader,
21+
Other
22+
};
2323

24-
struct AssetEntry
25-
{
26-
std::string name;
27-
std::filesystem::path path;
28-
EditorAssetType type;
29-
uint32_t icon = 0;
30-
bool isDirectory = false;
31-
};
24+
struct AssetEntry
25+
{
26+
std::string name;
27+
std::filesystem::path path;
28+
EditorAssetType type;
29+
uint32_t icon = 0;
30+
bool isDirectory = false;
31+
};
3232

3333
} // namespace Chained
3434

editor/editor_colors.h

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -5,45 +5,45 @@
55

66
namespace Chained
77
{
8-
namespace EditorColors
9-
{
10-
// Toolbar & buttons
11-
inline constexpr ImVec4 TransparentButton = {0.1f, 0.1f, 0.1f, 0.0f};
12-
inline constexpr ImVec4 ActiveToolOrange = {0.9f, 0.45f, 0.0f, 1.0f};
13-
inline constexpr ImVec4 PlayGreen = {0.3f, 1.0f, 0.3f, 1.0f};
14-
inline constexpr ImVec4 SimulateOrange = {1.0f, 0.64f, 0.0f, 1.0f};
15-
inline constexpr ImVec4 ActiveSnapBlue = {0.3f, 0.8f, 1.0f, 1.0f};
8+
namespace EditorColors
9+
{
10+
// Toolbar & buttons
11+
inline constexpr ImVec4 TransparentButton = {0.1f, 0.1f, 0.1f, 0.0f};
12+
inline constexpr ImVec4 ActiveToolOrange = {0.9f, 0.45f, 0.0f, 1.0f};
13+
inline constexpr ImVec4 PlayGreen = {0.3f, 1.0f, 0.3f, 1.0f};
14+
inline constexpr ImVec4 SimulateOrange = {1.0f, 0.64f, 0.0f, 1.0f};
15+
inline constexpr ImVec4 ActiveSnapBlue = {0.3f, 0.8f, 1.0f, 1.0f};
1616

17-
// Panel backgrounds
18-
inline constexpr ImVec4 ToolbarBg = {0.1f, 0.1f, 0.12f, 0.8f};
19-
inline constexpr ImVec4 FloatingToolbarBg = {0.1f, 0.1f, 0.12f, 0.0f};
17+
// Panel backgrounds
18+
inline constexpr ImVec4 ToolbarBg = {0.1f, 0.1f, 0.12f, 0.8f};
19+
inline constexpr ImVec4 FloatingToolbarBg = {0.1f, 0.1f, 0.12f, 0.0f};
2020

21-
// Selection & highlights
22-
inline constexpr ImVec4 SelectionYellow = {1.0f, 1.0f, 0.0f, 1.0f};
23-
inline constexpr ImVec4 SelectionGreen = {0.0f, 1.0f, 0.0f, 1.0f};
21+
// Selection & highlights
22+
inline constexpr ImVec4 SelectionYellow = {1.0f, 1.0f, 0.0f, 1.0f};
23+
inline constexpr ImVec4 SelectionGreen = {0.0f, 1.0f, 0.0f, 1.0f};
2424

25-
// Loading overlay
26-
inline constexpr ImVec4 LoadingOverlayBg = {0.02f, 0.02f, 0.02f, 0.92f};
25+
// Loading overlay
26+
inline constexpr ImVec4 LoadingOverlayBg = {0.02f, 0.02f, 0.02f, 0.92f};
2727

28-
// Content browser / project selector
29-
inline constexpr ImVec4 SidebarBg = {0.15f, 0.15f, 0.18f, 1.0f};
30-
inline constexpr ImVec4 DarkPanelBg = {0.02f, 0.02f, 0.02f, 1.0f};
31-
inline constexpr ImVec4 ProjectCardBg = {0.12f, 0.12f, 0.13f, 1.0f};
32-
inline constexpr ImVec4 ProjectCardHover = {0.18f, 0.18f, 0.19f, 1.0f};
33-
inline constexpr ImVec4 ProjectCardActive = {0.1f, 0.1f, 0.1f, 1.0f};
34-
inline constexpr ImVec4 ProjectCardBorder = {0.18f, 0.18f, 0.20f, 1.0f};
35-
inline constexpr ImVec4 ProjectCardBorderHover = {0.26f, 0.26f, 0.28f, 1.0f};
36-
inline constexpr ImVec4 ProjectCardBorderActive = {0.14f, 0.14f, 0.16f, 1.0f};
37-
inline constexpr ImVec4 SubCardBg = {0.06f, 0.06f, 0.07f, 1.0f};
38-
inline constexpr ImVec4 SubCardBorder = {0.14f, 0.14f, 0.16f, 1.0f};
39-
inline constexpr ImVec4 SubCardBorderHover = {0.22f, 0.22f, 0.24f, 1.0f};
40-
inline constexpr ImVec4 SubCardBorderActive = {0.10f, 0.10f, 0.12f, 1.0f};
41-
inline constexpr ImVec4 PrimaryButton = {0.13f, 0.45f, 0.80f, 1.0f};
42-
inline constexpr ImVec4 PrimaryButtonHover = {0.20f, 0.55f, 0.92f, 1.0f};
43-
inline constexpr ImVec4 PrimaryButtonActive = {0.10f, 0.38f, 0.70f, 1.0f};
44-
inline constexpr ImVec4 MutedText = {0.5f, 0.5f, 0.5f, 1.0f};
45-
inline constexpr ImVec4 BrightText = {0.9f, 0.9f, 0.9f, 1.0f};
46-
} // namespace EditorColors
28+
// Content browser / project selector
29+
inline constexpr ImVec4 SidebarBg = {0.15f, 0.15f, 0.18f, 1.0f};
30+
inline constexpr ImVec4 DarkPanelBg = {0.02f, 0.02f, 0.02f, 1.0f};
31+
inline constexpr ImVec4 ProjectCardBg = {0.12f, 0.12f, 0.13f, 1.0f};
32+
inline constexpr ImVec4 ProjectCardHover = {0.18f, 0.18f, 0.19f, 1.0f};
33+
inline constexpr ImVec4 ProjectCardActive = {0.1f, 0.1f, 0.1f, 1.0f};
34+
inline constexpr ImVec4 ProjectCardBorder = {0.18f, 0.18f, 0.20f, 1.0f};
35+
inline constexpr ImVec4 ProjectCardBorderHover = {0.26f, 0.26f, 0.28f, 1.0f};
36+
inline constexpr ImVec4 ProjectCardBorderActive = {0.14f, 0.14f, 0.16f, 1.0f};
37+
inline constexpr ImVec4 SubCardBg = {0.06f, 0.06f, 0.07f, 1.0f};
38+
inline constexpr ImVec4 SubCardBorder = {0.14f, 0.14f, 0.16f, 1.0f};
39+
inline constexpr ImVec4 SubCardBorderHover = {0.22f, 0.22f, 0.24f, 1.0f};
40+
inline constexpr ImVec4 SubCardBorderActive = {0.10f, 0.10f, 0.12f, 1.0f};
41+
inline constexpr ImVec4 PrimaryButton = {0.13f, 0.45f, 0.80f, 1.0f};
42+
inline constexpr ImVec4 PrimaryButtonHover = {0.20f, 0.55f, 0.92f, 1.0f};
43+
inline constexpr ImVec4 PrimaryButtonActive = {0.10f, 0.38f, 0.70f, 1.0f};
44+
inline constexpr ImVec4 MutedText = {0.5f, 0.5f, 0.5f, 1.0f};
45+
inline constexpr ImVec4 BrightText = {0.9f, 0.9f, 0.9f, 1.0f};
46+
} // namespace EditorColors
4747
} // namespace Chained
4848

4949
#endif // CH_EDITOR_COLORS_H

editor/font_manager.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
#include "engine/app/application.h"
44
#include "engine/assets/asset_manager.h"
55
#include "engine/core/service_locator.h"
6-
#include "engine/graphics/ui/ui_font_registry.h"
7-
#include "engine/graphics/ui/widget_renderer.h"
6+
#include "engine/ui/ui_font_registry.h"
7+
#include "engine/ui/widget_renderer.h"
88
#include "engine/imgui/imgui_layer.h"
99
#include "thirdparty/IconsFontAwesome6.h"
1010

editor/icons.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@
66

77
namespace Chained
88
{
9-
class TextureAsset;
9+
class TextureAsset;
1010

11-
// Cached editor icon textures used during scene rendering.
12-
struct EditorIcons
13-
{
14-
std::shared_ptr<TextureAsset> LightIcon;
15-
std::shared_ptr<TextureAsset> SpawnIcon;
16-
std::shared_ptr<TextureAsset> CameraIcon;
17-
std::shared_ptr<TextureAsset> AudioIcon;
18-
};
11+
// Cached editor icon textures used during scene rendering.
12+
struct EditorIcons
13+
{
14+
std::shared_ptr<TextureAsset> LightIcon;
15+
std::shared_ptr<TextureAsset> SpawnIcon;
16+
std::shared_ptr<TextureAsset> CameraIcon;
17+
std::shared_ptr<TextureAsset> AudioIcon;
18+
};
1919
} // namespace Chained
2020

2121
#endif // CH_EDITOR_ICONS_H

editor/layer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
#include "engine/assets/asset_manager.h"
1717
#include "engine/core/profiler.h"
1818
#include "engine/graphics/api/graphics_device.h"
19-
#include "engine/graphics/ui/ui_font_registry.h"
20-
#include "engine/graphics/ui/widget_renderer.h"
19+
#include "engine/ui/ui_font_registry.h"
20+
#include "engine/ui/widget_renderer.h"
2121
#include "engine/project/project.h"
2222
#include "panels/property_editor.h"
2323
#include "panels/viewport_panel.h"

editor/main.cpp

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,28 @@
44

55
namespace Chained
66
{
7-
Application* CreateApplication(ApplicationCommandLineArgs args)
8-
{
9-
ApplicationSpecification spec;
10-
spec.Name = "ChainedEditor";
11-
spec.CommandLineArgs = args;
7+
Application* CreateApplication(ApplicationCommandLineArgs args)
8+
{
9+
ApplicationSpecification spec;
10+
spec.Name = "ChainedEditor";
11+
spec.CommandLineArgs = args;
12+
spec.Headless = false;
1213

13-
// Default editor window settings
14-
spec.Window.Width = 0;
15-
spec.Window.Height = 0;
16-
spec.Window.Fullscreen = false;
17-
spec.Headless = false;
18-
spec.EnableScripting = true;
14+
// Default editor window settings
15+
spec.Window.Width = 0;
16+
spec.Window.Height = 0;
17+
spec.Window.Fullscreen = false;
18+
spec.EnableScripting = true;
1919

20-
// Set engine root to the executable directory so AssetManager can find
21-
// resources/shaders, resources/icons, resources/font etc.
22-
spec.EngineRoot = Platform::GetExecutableDirectory();
23-
spec.WorkingDirectory = Platform::GetExecutableDirectory().string();
20+
// Set engine root to the executable directory so AssetManager can find
21+
// resources/shaders, resources/icons, resources/font etc.
22+
spec.EngineRoot = Platform::GetExecutableDirectory();
23+
spec.WorkingDirectory = Platform::GetExecutableDirectory().string();
2424

25-
auto* app = new Application(spec);
25+
auto* app = new Application(spec);
2626

27-
app->PushLayer(std::make_unique<EditorLayer>());
27+
app->PushLayer(std::make_unique<EditorLayer>());
2828

29-
return app;
30-
}
29+
return app;
30+
}
3131
} // namespace Chained

0 commit comments

Comments
 (0)