Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/badges/files.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"schemaVersion": 1,
"label": "source files",
"message": "1574",
"color": "green"
"schemaVersion": 1,
"label": "source files",
"message": "1574",
"color": "green"
}
18 changes: 9 additions & 9 deletions .github/badges/loc-breakdown.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"schemaVersion": 1,
"total": 510938,
"files": 1574,
"engine": 261074,
"editor": 85302,
"game": 57841,
"tests": 104330,
"tools": 2391,
"updated": "2026-04-06T13:14:10Z"
"schemaVersion": 1,
"total": 510938,
"files": 1574,
"engine": 261074,
"editor": 85303,
"game": 57841,
"tests": 104329,
"tools": 2391,
"updated": "2026-04-06T14:24:43Z"
}
12 changes: 6 additions & 6 deletions .github/badges/loc.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"schemaVersion": 1,
"label": "C++ lines of code",
"message": "510938",
"color": "blue",
"namedLogo": "cplusplus",
"logoColor": "white"
"schemaVersion": 1,
"label": "C++ lines of code",
"message": "510938",
"color": "blue",
"namedLogo": "cplusplus",
"logoColor": "white"
}
28 changes: 14 additions & 14 deletions SparkEditor/Source/Core/EditorLogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,25 +110,25 @@ namespace SparkEditor

bool EditorLogger::Initialize(const std::string& logDirectory, size_t maxMemoryEntries)
{
std::lock_guard<std::mutex> lock(m_mutex);

if (m_initialized)
{
return true;
}
std::lock_guard<std::mutex> lock(m_mutex);

// Add console target
AddTarget(std::make_unique<ConsoleLogTarget>());
if (m_initialized)
{
return true;
}

// Add memory target
AddTarget(std::make_unique<MemoryLogTarget>(maxMemoryEntries));
// Push targets directly — calling AddTarget() would deadlock on m_mutex
m_targets.push_back(std::make_unique<ConsoleLogTarget>());
m_targets.push_back(std::make_unique<MemoryLogTarget>(maxMemoryEntries));

// Add file target
std::string logFile = logDirectory + "/editor.log";
AddTarget(std::make_unique<FileLogTarget>(logFile));
std::string logFile = logDirectory + "/editor.log";
m_targets.push_back(std::make_unique<FileLogTarget>(logFile));

m_initialized = true;
m_initialized = true;
}

// Log after releasing m_mutex — Log() acquires it internally
Log(LogLevel::INFO, "Logger", "Editor logger initialized");
return true;
}
Expand All @@ -142,7 +142,7 @@ namespace SparkEditor
return;
}

Log(LogLevel::INFO, "Logger", "Editor logger shutting down");
// Don't call Log() here — it would deadlock on m_mutex

// Flush all targets
for (auto& target : m_targets)
Expand Down
3 changes: 2 additions & 1 deletion SparkEditor/Source/Prefabs/PrefabManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "Utils/LogMacros.h"
#include "Utils/Validate.h"
#include <algorithm>
#include <cinttypes>
#include <filesystem>
#include <iostream>
#include <set>
Expand Down Expand Up @@ -79,7 +80,7 @@ namespace SparkEditor
}

m_prefabs[prefabName] = std::move(prefab);
SPARK_LOG_INFO(Spark::LogCategory::Editor, "Created prefab from entity %llu: '%s'", entityId,
SPARK_LOG_INFO(Spark::LogCategory::Editor, "Created prefab from entity %" PRIu64 ": '%s'", entityId,
prefabName.c_str());
NotifyPrefabsChanged();
return &m_prefabs[prefabName];
Expand Down
4 changes: 2 additions & 2 deletions SparkEngine/Source/Engine/AI/AIDebugRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ namespace Spark::AI
from.y += 0.1f;
to.y += 0.1f;

DebugColor segColor = (i < currentIndex) ? visitedColor : pathColor;
[[maybe_unused]] DebugColor segColor = (i < currentIndex) ? visitedColor : pathColor;
DEBUG_DRAW_LINE(from, to, segColor);
}

Expand All @@ -263,7 +263,7 @@ namespace Spark::AI
XMFLOAT3 pos = path[i].position;
pos.y += 0.1f;

DebugColor color = (i == currentIndex) ? activeColor : pathColor;
[[maybe_unused]] DebugColor color = (i == currentIndex) ? activeColor : pathColor;
float size = (i == currentIndex) ? 0.3f : 0.15f;
DEBUG_DRAW_SPHERE(pos, size, color);
}
Expand Down
2 changes: 2 additions & 0 deletions Tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -460,11 +460,13 @@ if(TARGET imgui)
"${CMAKE_SOURCE_DIR}/GameModules/SparkGameARPG/Source/Hero/ARPGHeroSystem.cpp"
"${CMAKE_SOURCE_DIR}/GameModules/SparkGameARPG/Source/Combat/ARPGCombatSystem.cpp"
"${CMAKE_SOURCE_DIR}/GameModules/SparkGameARPG/Source/Loot/ARPGLootSystem.cpp"
"${CMAKE_SOURCE_DIR}/GameModules/SparkGameARPG/Source/Dungeon/ARPGDungeonSystem.cpp"
"${CMAKE_SOURCE_DIR}/GameModules/SparkGameARPG/Source/Core/ARPGEngineSystems.cpp"
)

# Editor sources that require ImGui
target_sources(SparkTests PRIVATE
"${CMAKE_SOURCE_DIR}/SparkEditor/Source/Core/EditorPanel.cpp"
"${CMAKE_SOURCE_DIR}/SparkEditor/Source/Core/EditorTheme.cpp"
"${CMAKE_SOURCE_DIR}/SparkEditor/Source/Search/CommandPalette.cpp"
"${CMAKE_SOURCE_DIR}/SparkEditor/Source/LevelStreaming/LevelStreamingSystem.cpp"
Expand Down
7 changes: 3 additions & 4 deletions Tests/TestCoreAndBuildSystems.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,7 @@ TEST(CSGSystem_UnionCombinesFaces)
auto result = csg.Union(*a, *b);

// Union should at least return a valid solid (faces may vary by implementation)
EXPECT_TRUE(result.operation == Spark::LevelDesign::CSGOperation::Additive ||
result.faces.size() >= 0);
EXPECT_TRUE(result.operation == Spark::LevelDesign::CSGOperation::Additive);

csg.ClearAll();
}
Expand Down Expand Up @@ -400,14 +399,14 @@ TEST(Reflection_TypeRegistryCount)
auto& reg = Spark::TypeRegistry::Get();
// Registry exists and has some count (may be zero or populated by static init)
size_t count = reg.GetTypeCount();
EXPECT_TRUE(count >= 0); // Always true, but confirms no crash
(void)count; // confirms no crash
}

TEST(Reflection_ComponentFactoryCount)
{
auto& factory = Spark::ComponentFactory::Get();
size_t count = factory.GetRegisteredCount();
EXPECT_TRUE(count >= 0);
(void)count; // confirms no crash
}

TEST(Reflection_ComponentFactoryGetNames)
Expand Down
2 changes: 1 addition & 1 deletion Tests/TestEditorSubsystems.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ TEST(ProjectManager_RecentProjects)

auto recent = pm.GetRecentProjects();
// May be empty — just verify it returns without crashing
EXPECT_TRUE(recent.size() >= 0);
(void)recent; // just verify it returns without crashing
pm.Shutdown();
}

Expand Down
2 changes: 1 addition & 1 deletion Tests/TestOpenWorldModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ TEST(Gated_OWWildlife_HuntAnimal)
wildlife.Initialize(nullptr);
auto drops = wildlife.HuntAnimal(1);
// Hunting should produce some resource drops
EXPECT_TRUE(drops.size() >= 0); // may be empty if animal not found
(void)drops; // may be empty if animal not found, just verify no crash
}

TEST(Gated_OWWildlife_Strings)
Expand Down
6 changes: 3 additions & 3 deletions wiki/Codebase-Statistics.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ Comprehensive metrics and analysis of the SparkEngine codebase. Updated 2026-04-
| Section | Lines |
|---------|------:|
| **SparkEngine/Source** | 261074 |
| **SparkEditor/Source** | 85302 |
| **SparkEditor/Source** | 85303 |
| **GameModules** | 57841 |
| **Tests** | 104330 |
| **Tests** | 104329 |
| **SparkConsole/src** | 1858 |
| **SparkShaderCompiler/src** | 533 |
| **Total C++ (excl. ThirdParty)** | **~510938** |
Expand Down Expand Up @@ -99,7 +99,7 @@ Comprehensive metrics and analysis of the SparkEngine codebase. Updated 2026-04-
| Metric | Count |
|--------|------:|
| Editor panel classes | 59 |
| Total editor lines | 85302 |
| Total editor lines | 85303 |

## Testing Metrics

Expand Down
2 changes: 1 addition & 1 deletion wiki/Home.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,5 +185,5 @@ SparkEngine is licensed under the [Spark Open License](https://github.com/Krilli
| Test files | 337 |
| Test cases | 4290+ |
| Wiki pages | 117 |
| *Last synced* | *2026-04-06 13:09* |
| *Last synced* | *2026-04-06 14:23* |
<!-- /AUTO:stats -->
Loading