Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
AnimationErrorHandler.cpp
Go to the documentation of this file.
1/*
2Olympe Engine V2 2025
3Animation System - Error Handler Implementation
4*/
5
7#include "../system/system_utils.h"
8
9namespace OlympeAnimation
10{
11 // ========================================================================
12 // AnimationErrorHandler Implementation
13 // ========================================================================
14
16 const std::string& entityName,
17 const std::string& graphPath,
18 const std::string& stateName,
19 const std::string& animName)
20 {
21 std::string errorKey = "MISSING_ANIM:" + entityName + ":" + graphPath + ":" + stateName + ":" + animName;
22
23 if (m_loggedErrors.find(errorKey) == m_loggedErrors.end())
24 {
26 SYSTEM_LOG << "[ANIMATION ERROR] Missing animation:\n"
27 << " Entity: " << entityName << "\n"
28 << " Graph: " << graphPath << "\n"
29 << " State: " << stateName << "\n"
30 << " Animation: " << animName << "\n"
31 << " Using fallback placeholder.\n";
32 }
33 }
34
36 const std::string& entityName,
37 const std::string& spritesheetId,
38 const std::string& animName)
39 {
40 std::string errorKey = "MISSING_SPRITE:" + entityName + ":" + spritesheetId + ":" + animName;
41
42 if (m_loggedErrors.find(errorKey) == m_loggedErrors.end())
43 {
45 SYSTEM_LOG << "[ANIMATION ERROR] Missing spritesheet:\n"
46 << " Entity: " << entityName << "\n"
47 << " Spritesheet ID: " << spritesheetId << "\n"
48 << " Animation: " << animName << "\n"
49 << " Using fallback placeholder.\n";
50 }
51 }
52
53 void AnimationErrorHandler::LogError(const std::string& message)
54 {
55 std::string errorKey = GenerateErrorKey(message);
56
57 if (m_loggedErrors.find(errorKey) == m_loggedErrors.end())
58 {
60 SYSTEM_LOG << "[ANIMATION ERROR] " << message << "\n";
61 }
62 }
63
68
69 std::string AnimationErrorHandler::GenerateErrorKey(const std::string& error)
70 {
71 return "GENERIC:" + error;
72 }
73
74} // namespace OlympeAnimation
ComponentTypeID GetComponentTypeID_Static()
Definition ECS_Entity.h:56
std::string GenerateErrorKey(const std::string &error)
void LogMissingSpritesheet(const std::string &entityName, const std::string &spritesheetId, const std::string &animName)
void LogError(const std::string &message)
void LogMissingAnimation(const std::string &entityName, const std::string &graphPath, const std::string &stateName, const std::string &animName)
std::unordered_set< std::string > m_loggedErrors
#define SYSTEM_LOG