Skip to content

Commit 014649b

Browse files
committed
(Utils) Improved build time.
1 parent 21c5c92 commit 014649b

34 files changed

Lines changed: 287 additions & 165 deletions

inc/Utils/ECS/Component.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ namespace SR_UTILS_NS {
5151
virtual void OnMaskDirty();
5252
virtual void OnPriorityChanged();
5353

54-
/// Вызывается при загрузке компонента на игровой объект
55-
virtual void OnLoaded();
5654
/// Вызывается после добавления компонента к игровому объекту
5755
virtual void OnAttached();
5856
/// Вызывается когда компонент убирается с объекта, но до OnDestroy и только если был OnAttached
@@ -88,7 +86,6 @@ namespace SR_UTILS_NS {
8886
void SetEnabled(bool value);
8987
void SetIndexIdSceneUpdater(int32_t index);
9088

91-
SR_NODISCARD bool IsComponentLoaded() const noexcept;
9289
SR_NODISCARD bool IsComponentValid() const noexcept;
9390
SR_NODISCARD bool IsAttached() const noexcept;
9491

@@ -140,7 +137,6 @@ namespace SR_UTILS_NS {
140137
void SetParent(IComponentable* pParent);
141138

142139
protected:
143-
bool m_isComponentLoaded = false;
144140
bool m_isAttached = false;
145141
bool m_isActive = false;
146142
bool m_isAwake = false;

inc/Utils/ECS/EntityRef.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ namespace SR_UTILS_NS {
5555

5656
SR_NODISCARD SR_HTYPES_NS::SharedPtr<T> Get() const noexcept {
5757
if constexpr (!std::is_same_v<T, void>) {
58-
return GetEntity().template StaticCast<T>();
58+
return SR_UTILS_NS::StaticPointerCast<T>(GetEntity());
5959
}
6060
else {
6161
return SR_HTYPES_NS::SharedPtr<T>();

inc/Utils/ECS/IComponentable.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ namespace SR_UTILS_NS {
6767
SR_ERROR("IComponentable::AddComponent() : failed to add component of type: {}", T::GetClassStaticName());
6868
return nullptr;
6969
}
70-
return pComponent.DynamicCast<T>();
70+
return DynamicPointerCast<T>(pComponent);
7171
}
7272

7373
void RemoveComponents();
@@ -78,7 +78,7 @@ namespace SR_UTILS_NS {
7878
virtual void ForEachComponent(const std::function<bool(ComponentPtr&)>& fun);
7979

8080
template<typename T> SR_HTYPES_NS::SharedPtr<T> GetComponent() {
81-
return GetComponent(T::GetClassStaticName()).template DynamicCast<T>();
81+
return DynamicPointerCast<T>(GetComponent(T::GetClassStaticName()));
8282
}
8383

8484
virtual void OnPriorityChanged();

inc/Utils/ECS/SceneObject.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ namespace SR_UTILS_NS {
123123
/// Освобождает память объекта
124124
void DestroyImpl();
125125

126+
void CloneTo(SRClass& clone) const override;
126127
void OnPostLoad() override;
127128
void OnRootRegistered();
128129

inc/Utils/ECS/Transform3D.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ namespace SR_UTILS_NS {
3737
void SetRotation(const SR_MATH_NS::Quaternion& quaternion) override;
3838
void SetScale(const SR_MATH_NS::FVector3& scale) override;
3939
void SetSkew(const SR_MATH_NS::FVector3& skew) override;
40+
void SetAABB(const SR_MATH_NS::AABB& aabb);
4041

4142
SR_NODISCARD const SR_MATH_NS::Matrix4x4& GetMatrix() const override;
4243
SR_NODISCARD const SR_MATH_NS::AABB& GetAABB() const override;
@@ -70,7 +71,6 @@ namespace SR_UTILS_NS {
7071
mutable SR_MATH_NS::Matrix4x4 m_matrix = SR_MATH_NS::Matrix4x4::Identity();
7172
mutable SR_MATH_NS::Quaternion m_globalRotation = SR_MATH_NS::Quaternion::Identity();
7273
mutable SR_MATH_NS::AABB m_cachedAABB;
73-
SR_MATH_NS::AABB m_aabb = SR_MATH_NS::AABB::UnitCube();
7474

7575
mutable bool m_eulersDirty = true;
7676

@@ -84,6 +84,8 @@ namespace SR_UTILS_NS {
8484
SR_MATH_NS::FVector3 m_scale = SR_MATH_NS::FVector3::One();
8585
/// @property @setter(SetSkew) @defaultValue(SR_MATH_NS::FVector3::One()) @drag(0.01f) @resetValue(SR_MATH_NS::FVector3::One()) @hidden
8686
SR_MATH_NS::FVector3 m_skew = SR_MATH_NS::FVector3::One();
87+
/// @property @setter(SetAABB) @defaultValue(SR_MATH_NS::AABB::UnitCube())
88+
SR_MATH_NS::AABB m_aabb = SR_MATH_NS::AABB::UnitCube();
8789

8890
bool m_skewEnabled = false;
8991

inc/Utils/Game/DebugLogComponent.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ namespace SR_UTILS_NS {
1515
SR_CLASS()
1616
using Super = Component;
1717
public:
18-
void OnLoaded() override { SR_DEBUG_LOG("DebugLogComponent::OnLoaded()"); Super::OnLoaded(); }
1918
void Start() override { SR_DEBUG_LOG("DebugLogComponent::Start()"); Super::Start(); }
2019
void Awake() override { SR_DEBUG_LOG("DebugLogComponent::Awake()"); Super::Awake(); }
2120
void OnEnable() override { SR_DEBUG_LOG("DebugLogComponent::OnEnable()"); Super::OnEnable(); }

inc/Utils/Localization/Convert.h

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -5,40 +5,40 @@
55
#ifndef SR_ENGINE_CONVERT_H
66
#define SR_ENGINE_CONVERT_H
77

8-
#include <Utils/Localization/Icu.h>
9-
10-
namespace SR_UTILS_NS::Localization {
11-
//std::string ConvertBetween(
12-
// const char *begin,
13-
// const char *end,
14-
// const std::string& to_charset,
15-
// const std::string& from_charset,
16-
// EncMethodType how = EncMethodType::Default
17-
// ) {
18-
// auto&& from = ICU::IcuStdConverter<char>(from_charset, how);
19-
// auto&& to = ICU::IcuStdConverter<char>(to_charset, how);
20-
// return to.Std(from.Icu(begin, end));
21-
// }
22-
23-
template<typename CharType> std::basic_string<CharType> ConvertTo(const char *begin, const char *end, const char *charset, EncMethodType how = EncMethodType::Default) {
24-
#ifdef SR_ICU
25-
auto&& from = ICU::IcuStdConverter<char>(charset, how);
26-
auto&& to = ICU::IcuStdConverter<CharType>("UTF-8", how);
27-
return to.Std(from.IcuChecked(begin, end));
28-
#else
29-
return std::basic_string<CharType>();
30-
#endif
31-
}
32-
33-
template<typename CharType> std::string ConvertFrom(const CharType *begin, const CharType *end, const char *charset, EncMethodType how = EncMethodType::Default) {
34-
#ifdef SR_ICU
35-
auto&& from = ICU::IcuStdConverter<CharType>("UTF-8", how);
36-
auto&& to = ICU::IcuStdConverter<char>(charset, how);
37-
return to.Std(from.IcuChecked(begin, end));
38-
#else
39-
return std::string();
40-
#endif
41-
}
42-
}
8+
//#include <Utils/Localization/Icu.h>
9+
//
10+
//namespace SR_UTILS_NS::Localization {
11+
// //std::string ConvertBetween(
12+
// // const char *begin,
13+
// // const char *end,
14+
// // const std::string& to_charset,
15+
// // const std::string& from_charset,
16+
// // EncMethodType how = EncMethodType::Default
17+
// // ) {
18+
// // auto&& from = ICU::IcuStdConverter<char>(from_charset, how);
19+
// // auto&& to = ICU::IcuStdConverter<char>(to_charset, how);
20+
// // return to.Std(from.Icu(begin, end));
21+
// // }
22+
//
23+
// template<typename CharType> std::basic_string<CharType> ConvertTo(const char *begin, const char *end, const char *charset, EncMethodType how = EncMethodType::Default) {
24+
// #ifdef SR_ICU
25+
// auto&& from = ICU::IcuStdConverter<char>(charset, how);
26+
// auto&& to = ICU::IcuStdConverter<CharType>("UTF-8", how);
27+
// return to.Std(from.IcuChecked(begin, end));
28+
// #else
29+
// return std::basic_string<CharType>();
30+
// #endif
31+
// }
32+
//
33+
// template<typename CharType> std::string ConvertFrom(const CharType *begin, const CharType *end, const char *charset, EncMethodType how = EncMethodType::Default) {
34+
// #ifdef SR_ICU
35+
// auto&& from = ICU::IcuStdConverter<CharType>("UTF-8", how);
36+
// auto&& to = ICU::IcuStdConverter<char>(charset, how);
37+
// return to.Std(from.IcuChecked(begin, end));
38+
// #else
39+
// return std::string();
40+
// #endif
41+
// }
42+
//}
4343

4444
#endif //SR_ENGINE_CONVERT_H
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//
2+
// Created by Monika on 06.03.2026.
3+
//
4+
5+
#ifndef SR_ENGINE_COMMON_ENC_METHOD_TYPE_H
6+
#define SR_ENGINE_COMMON_ENC_METHOD_TYPE_H
7+
8+
#include <Utils/stdInclude.h>
9+
10+
namespace SR_UTILS_NS::Localization {
11+
enum class EncMethodType {
12+
Skip = 0, ///< Skip illegal/unconvertable characters
13+
Stop = 1, ///< Stop conversion and throw conversion_error
14+
Default = Skip ///< Default method - skip
15+
};
16+
}
17+
18+
#endif //SR_ENGINE_COMMON_ENC_METHOD_TYPE_H

inc/Utils/Localization/Encoding.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#include <Utils/Localization/Convert.h>
99
#include <Utils/Localization/UTF.h>
10+
#include <Utils/Localization/EncMethodType.h>
1011

1112
namespace SR_UTILS_NS::Localization {
1213
SR_MAYBE_UNUSED static void SetLocale() {

inc/Utils/Localization/Icu.h

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#define SR_ENGINE_ICU_H
77

88
#include <Utils/Debug.h>
9+
#include <Utils/Localization/EncMethodType.h>
910

1011
#define U_DISABLE_RENAMING 1
1112
#define U_COMMON_IMPLEMENTATION 0
@@ -22,14 +23,6 @@
2223
#include <unicode/utf16.h>
2324
#endif
2425

25-
namespace SR_UTILS_NS::Localization {
26-
enum class EncMethodType {
27-
Skip = 0, ///< Skip illegal/unconvertable characters
28-
Stop = 1, ///< Stop conversion and throw conversion_error
29-
Default = Skip ///< Default method - skip
30-
};
31-
}
32-
3326
#define SR_UCNV_GET_MAX_BYTES_FOR_STRING(length, maxCharSize) \
3427
(((int32_t)(length)+10)*(int32_t)(maxCharSize))
3528

0 commit comments

Comments
 (0)