diff --git a/Source/Engine/Core/Collections/Array.h b/Source/Engine/Core/Collections/Array.h index 53a0ccea8..01fe21b38 100644 --- a/Source/Engine/Core/Collections/Array.h +++ b/Source/Engine/Core/Collections/Array.h @@ -17,18 +17,15 @@ API_CLASS(InBuild) class Array { friend Array; public: - typedef T ItemType; typedef typename AllocationType::template Data AllocationData; private: - int32 _count; int32 _capacity; AllocationData _allocation; public: - /// /// Initializes a new instance of the class. /// @@ -208,7 +205,6 @@ public: } public: - /// /// Gets the amount of the items in the collection. /// @@ -334,7 +330,6 @@ public: } public: - FORCE_INLINE T* begin() { return &_allocation.Get()[0]; @@ -356,7 +351,6 @@ public: } public: - /// /// Clear the collection without changing its capacity. /// @@ -738,7 +732,6 @@ public: } public: - /// /// Performs push on stack operation (stack grows at the end of the collection). /// @@ -777,7 +770,6 @@ public: } public: - /// /// Performs enqueue to queue operation (queue head is in the beginning of queue). /// @@ -800,7 +792,6 @@ public: } public: - /// /// Searches for the given item within the entire collection. /// @@ -869,7 +860,6 @@ public: } public: - bool operator==(const Array& other) const { if (_count == other._count) @@ -891,7 +881,6 @@ public: } public: - /// /// The collection iterator. /// @@ -915,7 +904,6 @@ public: } public: - Iterator() : _array(nullptr) , _index(-1) @@ -935,7 +923,6 @@ public: } public: - FORCE_INLINE Array* GetArray() const { return _array; @@ -1008,7 +995,6 @@ public: }; public: - /// /// Gets iterator for beginning of the collection. /// diff --git a/Source/Engine/Core/Collections/ArrayExtensions.h b/Source/Engine/Core/Collections/ArrayExtensions.h index 176d05e4a..d83238f5e 100644 --- a/Source/Engine/Core/Collections/ArrayExtensions.h +++ b/Source/Engine/Core/Collections/ArrayExtensions.h @@ -17,11 +17,9 @@ class IGrouping : public Array friend ArrayExtensions; protected: - TKey _key; public: - /// /// Gets the common key. /// @@ -47,7 +45,6 @@ public: class ArrayExtensions { public: - /// /// Searches for the specified object using a custom query and returns the zero-based index of the first occurrence within the entire collection. /// diff --git a/Source/Engine/Core/Collections/BitArray.h b/Source/Engine/Core/Collections/BitArray.h index 00cfc9717..7d6d50773 100644 --- a/Source/Engine/Core/Collections/BitArray.h +++ b/Source/Engine/Core/Collections/BitArray.h @@ -15,18 +15,15 @@ API_CLASS(InBuild) class BitArray friend BitArray; public: - typedef uint64 ItemType; typedef typename AllocationType::template Data AllocationData; private: - int32 _count; int32 _capacity; AllocationData _allocation; public: - /// /// Initializes a new instance of the class. /// @@ -119,7 +116,6 @@ public: } public: - /// /// Gets the pointer to the bits storage data (linear allocation). /// @@ -216,7 +212,6 @@ public: } public: - /// /// Clear the collection without changing its capacity. /// diff --git a/Source/Engine/Core/Collections/ChunkedArray.h b/Source/Engine/Core/Collections/ChunkedArray.h index 98a56673d..89c2bfe64 100644 --- a/Source/Engine/Core/Collections/ChunkedArray.h +++ b/Source/Engine/Core/Collections/ChunkedArray.h @@ -17,7 +17,6 @@ class ChunkedArray friend ChunkedArray; private: - // TODO: don't use Array but small struct and don't InlinedArray or Chunk* but Chunk (less dynamic allocations) typedef Array Chunk; @@ -25,7 +24,6 @@ private: Array> _chunks; public: - ChunkedArray() { } @@ -36,7 +34,6 @@ public: } public: - /// /// Gets the amount of the elements in the collection. /// @@ -70,7 +67,6 @@ public: } public: - // Gets element by index FORCE_INLINE T& At(int32 index) const { @@ -93,7 +89,6 @@ public: } public: - /// /// Chunked array iterator. /// @@ -102,7 +97,6 @@ public: friend ChunkedArray; private: - ChunkedArray* _collection; int32 _chunkIndex; int32 _index; @@ -115,7 +109,6 @@ public: } public: - Iterator() : _collection(nullptr) , _chunkIndex(INVALID_INDEX) @@ -131,7 +124,6 @@ public: } public: - FORCE_INLINE ChunkedArray* GetChunkedArray() const { return _collection; @@ -143,7 +135,6 @@ public: } public: - bool IsEnd() const { ASSERT(_collection); @@ -157,7 +148,6 @@ public: } public: - FORCE_INLINE T& operator*() const { return _collection->_chunks[_chunkIndex]->At(_index); @@ -169,7 +159,6 @@ public: } public: - FORCE_INLINE bool operator==(const Iterator& v) const { return _collection == v._collection && _chunkIndex == v._chunkIndex && _index == v._index; @@ -181,7 +170,6 @@ public: } public: - Iterator& operator++() { ASSERT(_collection); @@ -280,7 +268,6 @@ public: }; public: - /// /// Adds the specified item to the collection. /// @@ -482,7 +469,6 @@ public: } public: - Iterator Begin() const { return Iterator(this, 0); diff --git a/Source/Engine/Core/Collections/CollectionPoolCache.h b/Source/Engine/Core/Collections/CollectionPoolCache.h index 1a19df34c..490794ec7 100644 --- a/Source/Engine/Core/Collections/CollectionPoolCache.h +++ b/Source/Engine/Core/Collections/CollectionPoolCache.h @@ -39,7 +39,6 @@ template ClearCallback = class CollectionPoolCache { public: - /// /// Helper object used to access the pooled collection and return it to the pool after usage (on code scope execution end). /// @@ -48,7 +47,6 @@ public: friend CollectionPoolCache; private: - CollectionPoolCache* _pool; ScopeCache(CollectionPoolCache* pool, T* value) @@ -58,7 +56,6 @@ public: } public: - T* Value; ScopeCache() = delete; @@ -99,7 +96,6 @@ public: }; private: - CriticalSection _locker; Array> _pool; @@ -111,7 +107,6 @@ private: } public: - /// /// Finalizes an instance of the class. /// @@ -121,7 +116,6 @@ public: } public: - /// /// Gets the collection instance from the pool. Can reuse the object from the pool or create a new one. Returns collection is always cleared and ready to use. /// diff --git a/Source/Engine/Core/Collections/Dictionary.h b/Source/Engine/Core/Collections/Dictionary.h index 1979c4e74..0ee455195 100644 --- a/Source/Engine/Core/Collections/Dictionary.h +++ b/Source/Engine/Core/Collections/Dictionary.h @@ -18,7 +18,6 @@ API_CLASS(InBuild) class Dictionary { friend Dictionary; public: - /// /// Describes single portion of space for the key and value pair in a hash map. /// @@ -106,14 +105,12 @@ public: typedef typename AllocationType::template Data AllocationData; private: - int32 _elementsCount = 0; int32 _deletedCount = 0; int32 _size = 0; AllocationData _allocation; public: - /// /// Initializes a new instance of the class. /// @@ -200,7 +197,6 @@ public: } public: - /// /// Gets the amount of the elements in the collection. /// @@ -234,7 +230,6 @@ public: } public: - /// /// The Dictionary collection iterator. /// @@ -359,7 +354,6 @@ public: }; public: - /// /// Gets element by the key (will add default ValueType element if key not found). /// @@ -460,7 +454,6 @@ public: } public: - /// /// Clears the collection but without changing its capacity (all inserted elements: keys and values will be removed). /// @@ -571,7 +564,6 @@ public: } public: - /// /// Add pair element to the collection. /// @@ -700,7 +692,6 @@ public: } public: - /// /// Finds the element with given key in the collection. /// @@ -775,7 +766,6 @@ public: } public: - /// /// Clones other collection into this. /// @@ -813,7 +803,6 @@ public: } public: - Iterator Begin() const { Iterator i(*this, -1); @@ -851,7 +840,6 @@ public: } protected: - /// /// The result container of the dictionary item lookup searching. /// @@ -898,7 +886,7 @@ protected: if (insertPos == -1) insertPos = bucketIndex; } - // Occupied bucket by target key + // Occupied bucket by target key else if (bucket.Key == key) { // Found key diff --git a/Source/Engine/Core/Collections/HashSet.h b/Source/Engine/Core/Collections/HashSet.h index 22bdfe65a..debd91cfd 100644 --- a/Source/Engine/Core/Collections/HashSet.h +++ b/Source/Engine/Core/Collections/HashSet.h @@ -17,7 +17,6 @@ API_CLASS(InBuild) class HashSet { friend HashSet; public: - /// /// Describes single portion of space for the item in a hash map. /// @@ -31,7 +30,7 @@ public: Deleted, Occupied, }; - + /// The item. T Item; @@ -78,18 +77,16 @@ public: return _state != Occupied; } }; - + typedef typename AllocationType::template Data AllocationData; private: - int32 _elementsCount = 0; int32 _deletedCount = 0; int32 _size = 0; AllocationData _allocation; public: - /// /// Initializes a new instance of the class. /// @@ -176,7 +173,6 @@ public: } public: - /// /// Gets the amount of the elements in the collection. /// @@ -210,7 +206,6 @@ public: } public: - /// /// The hash set collection iterator. /// @@ -234,7 +229,6 @@ public: } public: - Iterator(const Iterator& i) : _collection(i._collection) , _index(i._index) @@ -248,7 +242,6 @@ public: } public: - FORCE_INLINE bool IsEnd() const { return _index == _collection.Capacity(); @@ -332,7 +325,6 @@ public: }; public: - /// /// Removes all elements from the collection. /// @@ -431,7 +423,6 @@ public: } public: - /// /// Add element to the collection. /// @@ -513,7 +504,6 @@ public: } public: - /// /// Find element with given item in the collection /// @@ -545,7 +535,6 @@ public: } public: - /// /// Clones other collection into this /// @@ -561,7 +550,6 @@ public: } public: - Iterator Begin() const { Iterator i(*this, -1); @@ -599,7 +587,6 @@ public: } protected: - /// /// The result container of the set item lookup searching. /// @@ -646,7 +633,7 @@ protected: if (insertPos == -1) insertPos = bucketIndex; } - // Occupied bucket by target item + // Occupied bucket by target item else if (bucket.Item == item) { // Found item diff --git a/Source/Engine/Core/Collections/RingBuffer.h b/Source/Engine/Core/Collections/RingBuffer.h index b7eb17f94..27edc59cc 100644 --- a/Source/Engine/Core/Collections/RingBuffer.h +++ b/Source/Engine/Core/Collections/RingBuffer.h @@ -13,92 +13,89 @@ template class RingBuffer { public: - - typedef T ItemType; - typedef typename AllocationType::template Data AllocationData; + typedef T ItemType; + typedef typename AllocationType::template Data AllocationData; private: - - int32 _front = 0, _back = 0, _count = 0, _capacity = 0; - AllocationData _allocation; + int32 _front = 0, _back = 0, _count = 0, _capacity = 0; + AllocationData _allocation; public: + ~RingBuffer() + { + Memory::DestructItems(Get() + Math::Min(_front, _back), _count); + } - ~RingBuffer() - { - Memory::DestructItems(Get() + Math::Min(_front, _back), _count); - } + FORCE_INLINE T* Get() + { + return _allocation.Get(); + } - FORCE_INLINE T* Get() - { - return _allocation.Get(); - } + FORCE_INLINE int32 Count() const + { + return _count; + } - FORCE_INLINE int32 Count() const - { - return _count; - } + FORCE_INLINE int32 Capacity() const + { + return _capacity; + } - FORCE_INLINE int32 Capacity() const - { - return _capacity; - } + void PushBack(const T& data) + { + if (_capacity == 0 || _capacity == _count) + { + const int32 capacity = _allocation.CalculateCapacityGrow(_capacity, _count + 1); + AllocationData alloc; + alloc.Allocate(capacity); + const int32 frontCount = Math::Min(_capacity - _front, _count); + Memory::MoveItems(alloc.Get(), _allocation.Get() + _front, frontCount); + Memory::DestructItems(_allocation.Get() + _front, frontCount); + const int32 backCount = _count - frontCount; + Memory::MoveItems(alloc.Get() + frontCount, _allocation.Get(), backCount); + Memory::DestructItems(_allocation.Get(), backCount); + _allocation.Swap(alloc); + _front = 0; + _back = _count; + _capacity = capacity; + } + Memory::ConstructItems(_allocation.Get() + _back, &data, 1); + _back = (_back + 1) % _capacity; + _count++; + } - void PushBack(const T& data) - { - if (_capacity == 0 || _capacity == _count) - { - const int32 capacity = _allocation.CalculateCapacityGrow(_capacity, _count + 1); - AllocationData alloc; - alloc.Allocate(capacity); - const int32 frontCount = Math::Min(_capacity - _front, _count); - Memory::MoveItems(alloc.Get(), _allocation.Get() + _front, frontCount); - Memory::DestructItems(_allocation.Get() + _front, frontCount); - const int32 backCount = _count - frontCount; - Memory::MoveItems(alloc.Get() + frontCount, _allocation.Get(), backCount); - Memory::DestructItems(_allocation.Get(), backCount); - _allocation.Swap(alloc); - _front = 0; - _back = _count; - _capacity = capacity; - } - Memory::ConstructItems(_allocation.Get() + _back, &data, 1); - _back = (_back + 1) % _capacity; - _count++; - } + FORCE_INLINE T& PeekFront() + { + return _allocation.Get()[_front]; + } - FORCE_INLINE T& PeekFront() - { - return _allocation.Get()[_front]; - } - - FORCE_INLINE const T& PeekFront() const - { - return _allocation.Get()[_front]; - } + FORCE_INLINE const T& PeekFront() const + { + return _allocation.Get()[_front]; + } FORCE_INLINE T& operator[](int32 index) { ASSERT(index >= 0 && index < _count); - return _allocation.Get()[(_front + index) % _capacity]; + return _allocation.Get()[(_front + index) % _capacity]; } FORCE_INLINE const T& operator[](int32 index) const { ASSERT(index >= 0 && index < _count); - return _allocation.Get()[(_front + index) % _capacity]; + return _allocation.Get()[(_front + index) % _capacity]; } - void PopFront() - { - Memory::DestructItems(_allocation.Get() + _front, 1); - _front = (_front + 1) % _capacity; - _count--; - } + void PopFront() + { + Memory::DestructItems(_allocation.Get() + _front, 1); + _front = (_front + 1) % _capacity; + _count--; + } - void Clear() - { - Memory::DestructItems(Get() + Math::Min(_front, _back), _count); - _front = _back = _count = 0; - } + void Clear() + { + Memory::DestructItems(Get() + Math::Min(_front, _back), _count); + _front = _back = _count = 0; + } }; diff --git a/Source/Engine/Core/Collections/SamplesBuffer.h b/Source/Engine/Core/Collections/SamplesBuffer.h index 650ae4478..2d6d1e27b 100644 --- a/Source/Engine/Core/Collections/SamplesBuffer.h +++ b/Source/Engine/Core/Collections/SamplesBuffer.h @@ -12,12 +12,10 @@ template class SamplesBuffer { protected: - int32 _count = 0; T _data[Size]; public: - /// /// Gets amount of elements in the collection. /// @@ -110,7 +108,6 @@ public: } public: - /// /// Adds the specified value to the buffer. /// @@ -146,7 +143,6 @@ public: } public: - /// /// Gets the minimum value in the buffer. /// diff --git a/Source/Engine/Core/Collections/Sorting.h b/Source/Engine/Core/Collections/Sorting.h index 5d2a01044..34c0e8240 100644 --- a/Source/Engine/Core/Collections/Sorting.h +++ b/Source/Engine/Core/Collections/Sorting.h @@ -11,14 +11,12 @@ class FLAXENGINE_API Sorting { public: - /// /// Helper collection used by the sorting algorithms. Implements stack using single linear allocation with variable capacity. /// class FLAXENGINE_API SortingStack { public: - static SortingStack& Get(); int32 Count = 0; @@ -47,7 +45,6 @@ public: }; public: - /// /// Sorts the linear data array using Quick Sort algorithm (non recursive version, uses temporary stack collection). /// diff --git a/Source/Engine/Core/Types/CommonValue.h b/Source/Engine/Core/Types/CommonValue.h index 1ceebce0b..9820c6e35 100644 --- a/Source/Engine/Core/Types/CommonValue.h +++ b/Source/Engine/Core/Types/CommonValue.h @@ -51,7 +51,6 @@ class ScriptingObject; struct FLAXENGINE_API CommonValue { public: - /// /// Type /// @@ -86,7 +85,6 @@ public: }; public: - // 0.0f (floating-point value type) static const CommonValue Zero; @@ -103,7 +101,6 @@ public: static const CommonValue True; public: - /// /// Default constructor (bool) /// @@ -365,7 +362,6 @@ public: } public: - /// /// Assignment operator /// @@ -426,7 +422,6 @@ public: } public: - /// /// Gets value as boolean (if can convert it) /// @@ -742,7 +737,6 @@ public: } public: - /// /// Set new value and change type to Bool /// @@ -944,7 +938,6 @@ public: } public: - /// /// Change common value type /// @@ -975,7 +968,6 @@ public: } public: - /// /// Casts value from its type to another /// @@ -1027,7 +1019,6 @@ public: } public: - friend bool operator==(const CommonValue& a, const CommonValue& b) { ASSERT(a.Type == b.Type); @@ -1097,20 +1088,20 @@ public: return a.AsVector3 > b.AsVector3; case CommonType::Vector4: return a.AsVector4 > b.AsVector4; - //case CommonType::Color: return a.AsColor > b.AsColor; - //case CommonType::Guid: return a.AsGuid > b.AsGuid; + //case CommonType::Color: return a.AsColor > b.AsColor; + //case CommonType::Guid: return a.AsGuid > b.AsGuid; case CommonType::String: return StringUtils::Compare(a.AsString, b.AsString) > 0; - //case CommonType::Box: return a.AsBox > b.AsBox; - //case CommonType::Rotation: return a.AsRotation > b.AsRotation; - //case CommonType::Transform: return a.AsTransform > b.AsTransform; - //case CommonType::Sphere: return a.AsSphere > b.AsSphere; - //case CommonType::Rectangle: return a.AsRectangle > b.AsRectangle; - //case CommonType::Ray: return a.AsRay > b.AsRay; + //case CommonType::Box: return a.AsBox > b.AsBox; + //case CommonType::Rotation: return a.AsRotation > b.AsRotation; + //case CommonType::Transform: return a.AsTransform > b.AsTransform; + //case CommonType::Sphere: return a.AsSphere > b.AsSphere; + //case CommonType::Rectangle: return a.AsRectangle > b.AsRectangle; + //case CommonType::Ray: return a.AsRay > b.AsRay; case CommonType::Pointer: case CommonType::Object: return a.AsPointer > b.AsPointer; - //case CommonType::Matrix: return a.AsMatrix > b.AsMatrix; + //case CommonType::Matrix: return a.AsMatrix > b.AsMatrix; case CommonType::Blob: return a.AsBlob.Length > b.AsBlob.Length; default: CRASH; @@ -1134,7 +1125,6 @@ public: } public: - static bool NearEqual(const CommonValue& a, const CommonValue& b, float epsilon); static CommonValue Lerp(const CommonValue& a, const CommonValue& b, float alpha); @@ -1143,7 +1133,6 @@ public: Guid GetObjectId() const; private: - void OnObjectDeleted(ScriptingObject* obj) { AsObject = nullptr; diff --git a/Source/Engine/Core/Types/DataContainer.h b/Source/Engine/Core/Types/DataContainer.h index 76893b421..de6da6a34 100644 --- a/Source/Engine/Core/Types/DataContainer.h +++ b/Source/Engine/Core/Types/DataContainer.h @@ -15,15 +15,12 @@ template class DataContainer : public Span { public: - typedef Span Base; private: - bool _isAllocated; public: - /// /// Initializes a new instance of the class. /// @@ -129,7 +126,6 @@ public: } public: - /// /// Returns true if data is allocated by container itself, otherwise it's just linked. /// @@ -339,7 +335,6 @@ public: } public: - template void Read(ReadStream* stream, int32 length) { diff --git a/Source/Engine/Core/Types/DateTime.h b/Source/Engine/Core/Types/DateTime.h index 3ac7264ab..8b593a405 100644 --- a/Source/Engine/Core/Types/DateTime.h +++ b/Source/Engine/Core/Types/DateTime.h @@ -23,14 +23,12 @@ DECLARE_ENUM_EX_12(MonthOfYear, int32, 1, January, February, March, April, May, API_STRUCT(InBuild, Namespace="System") struct FLAXENGINE_API DateTime { public: - /// /// Ticks in 100 nanoseconds resolution since January 1, 0001 A.D. /// int64 Ticks; public: - /// /// Empty constructor. /// @@ -60,7 +58,6 @@ public: DateTime(int32 year, int32 month, int32 day, int32 hour = 0, int32 minute = 0, int32 second = 0, int32 millisecond = 0); public: - /// /// Gets the string. /// @@ -72,7 +69,6 @@ public: String ToFileNameString() const; public: - DateTime operator+(const TimeSpan& other) const; DateTime& operator+=(const TimeSpan& other); TimeSpan operator-(const DateTime& other) const; @@ -110,7 +106,6 @@ public: } public: - /// /// Gets the date part of this date. The time part is truncated and becomes 00:00:00.000. /// @@ -210,7 +205,6 @@ public: int32 ToUnixTimestamp() const; public: - /// /// Gets the number of days in the year and month. /// diff --git a/Source/Engine/Core/Types/Guid.cpp b/Source/Engine/Core/Types/Guid.cpp index c910e89dd..b515839d9 100644 --- a/Source/Engine/Core/Types/Guid.cpp +++ b/Source/Engine/Core/Types/Guid.cpp @@ -63,7 +63,7 @@ FORCE_INLINE void GuidToString(const CharType* cachedGuidDigits, CharType* buffe break; } case Guid::FormatType::B: - // TODO: impl GuidToString for FormatType::B: + // TODO: impl GuidToString for FormatType::B: case Guid::FormatType::P: // TODO: impl GuidToString for FormatType::P: default: @@ -89,7 +89,7 @@ FORCE_INLINE bool GuidParse(const StringViewType& text, Guid& value) { switch (text.Length()) { - // FormatType::N + // FormatType::N case 32: { return @@ -98,7 +98,7 @@ FORCE_INLINE bool GuidParse(const StringViewType& text, Guid& value) StringUtils::ParseHex(*text + 16, 8, &value.C) || StringUtils::ParseHex(*text + 24, 8, &value.D); } - // FormatType::D + // FormatType::D case 36: { StringType b = StringType(text.Substring(9, 4)) + text.Substring(14, 4); @@ -109,8 +109,8 @@ FORCE_INLINE bool GuidParse(const StringViewType& text, Guid& value) StringUtils::ParseHex(*c, &value.C) || StringUtils::ParseHex(*text + 28, 8, &value.D); } - // FormatType::B - // FormatType::P + // FormatType::B + // FormatType::P case 38: { StringType b = StringType(text.Substring(10, 4)) + text.Substring(15, 4); diff --git a/Source/Engine/Core/Types/Guid.h b/Source/Engine/Core/Types/Guid.h index 76c4fc61f..721d75385 100644 --- a/Source/Engine/Core/Types/Guid.h +++ b/Source/Engine/Core/Types/Guid.h @@ -15,7 +15,6 @@ class String; API_STRUCT(InBuild, Namespace="System") struct FLAXENGINE_API Guid { public: - /// /// Accepted format specifiers for the format parameter /// @@ -39,7 +38,6 @@ public: }; public: - union { struct @@ -65,12 +63,10 @@ public: }; public: - // Empty Guid (considered as invalid ID) static Guid Empty; public: - /// /// Empty constructor. /// @@ -92,7 +88,6 @@ public: } public: - // Compares two Guids for equality // @param left The first Guid to compare // @param right The second Guid to compare @@ -152,14 +147,12 @@ public: } public: - String ToString() const; String ToString(FormatType format) const; void ToString(char* buffer, FormatType format) const; void ToString(Char* buffer, FormatType format) const; public: - /// /// Try to parse Guid from string /// diff --git a/Source/Engine/Core/Types/LayersMask.h b/Source/Engine/Core/Types/LayersMask.h index 62dd5cbf2..f4cd5f116 100644 --- a/Source/Engine/Core/Types/LayersMask.h +++ b/Source/Engine/Core/Types/LayersMask.h @@ -10,7 +10,7 @@ /// API_STRUCT() struct FLAXENGINE_API LayersMask { -DECLARE_SCRIPTING_TYPE_MINIMAL(LayersMask); + DECLARE_SCRIPTING_TYPE_MINIMAL(LayersMask); /// /// The layers selection mask. @@ -18,7 +18,6 @@ DECLARE_SCRIPTING_TYPE_MINIMAL(LayersMask); API_FIELD() uint32 Mask = MAX_uint32; public: - FORCE_INLINE LayersMask() { } diff --git a/Source/Engine/Core/Types/Nullable.h b/Source/Engine/Core/Types/Nullable.h index aeb09182b..6ad8590be 100644 --- a/Source/Engine/Core/Types/Nullable.h +++ b/Source/Engine/Core/Types/Nullable.h @@ -11,12 +11,10 @@ template struct NullableBase { protected: - bool _hasValue; T _value; public: - /// /// Initializes a new instance of the struct. /// @@ -46,7 +44,6 @@ public: } public: - /// /// Gets a value indicating whether the current NullableBase{T} object has a valid value of its underlying type. /// @@ -95,7 +92,6 @@ public: } public: - /// /// Indicates whether the current NullableBase{T} object is equal to a specified object. /// @@ -129,7 +125,6 @@ template struct Nullable : NullableBase { public: - /// /// Initializes a new instance of the struct. /// @@ -164,7 +159,6 @@ template<> struct Nullable : NullableBase { public: - /// /// Initializes a new instance of the struct. /// @@ -192,7 +186,6 @@ public: } public: - /// /// Gets a value indicating whether the current Nullable{T} object has a valid value and it's set to true. /// diff --git a/Source/Engine/Core/Types/Pair.h b/Source/Engine/Core/Types/Pair.h index 0c5c41a14..339a8ddfe 100644 --- a/Source/Engine/Core/Types/Pair.h +++ b/Source/Engine/Core/Types/Pair.h @@ -12,7 +12,6 @@ template class Pair { public: - /// /// The first element. /// @@ -24,7 +23,6 @@ public: U Second; public: - /// /// Initializes a new instance of the class. /// @@ -64,7 +62,6 @@ public: } public: - Pair& operator=(const Pair& other) { if (this == &other) diff --git a/Source/Engine/Core/Types/Span.h b/Source/Engine/Core/Types/Span.h index a10811342..cf508a901 100644 --- a/Source/Engine/Core/Types/Span.h +++ b/Source/Engine/Core/Types/Span.h @@ -11,12 +11,10 @@ template class Span { protected: - T* _data; int32 _length; public: - /// /// Initializes a new instance of the class. /// @@ -38,7 +36,6 @@ public: } public: - /// /// Returns true if data is valid. /// @@ -95,7 +92,6 @@ public: } public: - /// /// Gets or sets the element by index /// diff --git a/Source/Engine/Core/Types/String.h b/Source/Engine/Core/Types/String.h index 7d5b382b7..464c7ff2e 100644 --- a/Source/Engine/Core/Types/String.h +++ b/Source/Engine/Core/Types/String.h @@ -13,12 +13,10 @@ template class StringBase { protected: - T* _data = nullptr; int32 _length = 0; public: - /// /// Finalizes an instance of the class. /// @@ -28,7 +26,6 @@ public: } public: - /// /// Clears this instance. Frees the memory and sets the string to empty. /// @@ -40,7 +37,6 @@ public: } public: - /// /// Gets the character at the specific index. /// @@ -64,7 +60,6 @@ public: } public: - /// /// Lexicographically tests how this string compares to the other given string. /// In case sensitive mode 'A' is less than 'a'. @@ -80,7 +75,6 @@ public: } public: - /// /// Returns true if string is empty. /// @@ -154,7 +148,6 @@ public: } public: - /// /// Checks whether this string contains the specified substring. /// @@ -353,7 +346,6 @@ public: } public: - bool StartsWith(T c, StringSearchCase searchCase = StringSearchCase::CaseSensitive) const { const int32 length = Length(); @@ -551,14 +543,12 @@ public: API_CLASS(InBuild) class FLAXENGINE_API String : public StringBase { public: - /// /// Instance of the empty string. /// static String Empty; public: - /// /// Initializes a new instance of the class. /// @@ -646,7 +636,6 @@ public: explicit String(const StringAnsiView& str); public: - /// /// Sets an array of characters to the string. /// @@ -775,7 +764,6 @@ public: } public: - /// /// Sets the text value. /// @@ -848,7 +836,6 @@ public: } public: - // @formatter:off FORCE_INLINE friend String operator+(const String& a, const String& b) { @@ -941,7 +928,6 @@ public: // @formatter:on public: - /// /// Checks if string contains only ANSI characters. /// @@ -949,7 +935,6 @@ public: bool IsANSI() const; public: - using StringBase::StartsWith; bool StartsWith(const StringView& prefix, StringSearchCase searchCase = StringSearchCase::CaseSensitive) const; @@ -1060,7 +1045,6 @@ public: String TrimTrailing() const; public: - /// /// Formats the message and gets it as a string. /// @@ -1077,7 +1061,6 @@ public: } public: - /// /// Concatenates this path with given path ensuring the '/' character is used between them. /// @@ -1167,7 +1150,6 @@ public: } public: - String ToString() const { return *this; @@ -1176,7 +1158,6 @@ public: StringAnsi ToStringAnsi() const; private: - template static String ConcatStrings(T1 left, T2 right) { @@ -1267,14 +1248,12 @@ namespace fmt API_CLASS(InBuild) class FLAXENGINE_API StringAnsi : public StringBase { public: - /// /// Instance of the empty string. /// static StringAnsi Empty; public: - /// /// Initializes a new instance of the class. /// @@ -1361,7 +1340,6 @@ public: explicit StringAnsi(const StringAnsiView& str); public: - /// /// Sets an array of characters to the string. /// @@ -1483,7 +1461,6 @@ public: } public: - /// /// Sets the text value. /// @@ -1556,7 +1533,6 @@ public: } public: - // @formatter:off FORCE_INLINE friend StringAnsi operator+(const StringAnsi& a, const StringAnsi& b) { @@ -1641,7 +1617,6 @@ public: // @formatter:on public: - using StringBase::StartsWith; bool StartsWith(const StringAnsiView& prefix, StringSearchCase searchCase = StringSearchCase::CaseSensitive) const; @@ -1727,7 +1702,6 @@ public: void Split(char c, Array& results) const; public: - /// /// Formats the message and gets it as a string. /// @@ -1744,7 +1718,6 @@ public: } public: - String ToString() const { return String(Get(), Length()); @@ -1756,7 +1729,6 @@ public: } private: - template static StringAnsi ConcatStrings(T1 left, T2 right) { diff --git a/Source/Engine/Core/Types/StringBuilder.h b/Source/Engine/Core/Types/StringBuilder.h index b3feea939..eb29985ea 100644 --- a/Source/Engine/Core/Types/StringBuilder.h +++ b/Source/Engine/Core/Types/StringBuilder.h @@ -11,14 +11,12 @@ class FLAXENGINE_API StringBuilder { private: - /// /// Array with characters of the string (it's not null-terminated) /// Array _data; public: - /// /// Init /// @@ -36,7 +34,6 @@ public: } public: - /// /// Gets capacity /// @@ -82,7 +79,6 @@ public: } public: - // Append single character to the string // @param c Character to append // @return Current String Builder instance @@ -175,7 +171,6 @@ public: } public: - StringBuilder& AppendLine() { Append(TEXT(PLATFORM_LINE_TERMINATOR)); @@ -224,7 +219,6 @@ public: } public: - // Retrieves substring created from characters starting from startIndex // @param startIndex Index of the first character to subtract // @param count Amount of characters to retrieve @@ -236,7 +230,6 @@ public: } public: - // Get pointer to the string // @returns Pointer to Array of Chars if Num, otherwise the empty string FORCE_INLINE const Char* operator*() const @@ -264,7 +257,6 @@ public: } public: - String ToString() const { return String(_data.Get(), _data.Count()); diff --git a/Source/Engine/Core/Types/StringView.h b/Source/Engine/Core/Types/StringView.h index 1fcd51a32..61ac3c6ec 100644 --- a/Source/Engine/Core/Types/StringView.h +++ b/Source/Engine/Core/Types/StringView.h @@ -13,7 +13,6 @@ template class StringViewBase { protected: - const T* _data; int32 _length; @@ -30,7 +29,6 @@ protected: } public: - /// /// Gets the specific const character from this string. /// @@ -41,7 +39,7 @@ public: ASSERT(index >= 0 && index <= _length); return _data[index]; } - + FORCE_INLINE StringViewBase& operator=(const StringViewBase& other) { if (this != &other) @@ -53,8 +51,7 @@ public: } /// - /// Lexicographically tests how this string compares to the other given string. - /// In case sensitive mode 'A' is less than 'a'. + /// Lexicographically tests how this string compares to the other given string. In case sensitive mode 'A' is less than 'a'. /// /// The another string test against. /// The case sensitivity mode. @@ -63,9 +60,7 @@ public: { const bool thisIsShorter = Length() < str.Length(); const int32 minLength = thisIsShorter ? Length() : str.Length(); - const int32 prefixCompare = (searchCase == StringSearchCase::CaseSensitive) - ? StringUtils::Compare(this->GetNonTerminatedText(), str.GetNonTerminatedText(), minLength) - : StringUtils::CompareIgnoreCase(this->GetNonTerminatedText(), str.GetNonTerminatedText(), minLength); + const int32 prefixCompare = searchCase == StringSearchCase::CaseSensitive ? StringUtils::Compare(GetNonTerminatedText(), str.GetNonTerminatedText(), minLength) : StringUtils::CompareIgnoreCase(GetNonTerminatedText(), str.GetNonTerminatedText(), minLength); if (prefixCompare != 0) return prefixCompare; if (Length() == str.Length()) @@ -74,7 +69,6 @@ public: } public: - /// /// Returns true if string is empty. /// @@ -124,7 +118,6 @@ public: } public: - /// /// Searches the string for the occurrence of a character. /// @@ -205,14 +198,12 @@ public: API_CLASS(InBuild) class FLAXENGINE_API StringView : public StringViewBase { public: - /// /// Instance of the empty string. /// static StringView Empty; public: - /// /// Initializes a new instance of the class. /// @@ -257,7 +248,6 @@ public: } public: - /// /// Assigns the static string. /// @@ -325,7 +315,6 @@ public: bool operator!=(const String& other) const; public: - /// /// Gets the left most given number of characters. /// @@ -356,7 +345,6 @@ public: StringView Substring(int32 startIndex, int32 count) const; public: - String ToString() const; StringAnsi ToStringAnsi() const; }; @@ -394,14 +382,12 @@ namespace fmt API_CLASS(InBuild) class FLAXENGINE_API StringAnsiView : public StringViewBase { public: - /// /// Instance of the empty string. /// static StringAnsiView Empty; public: - /// /// Initializes a new instance of the class. /// @@ -446,7 +432,6 @@ public: } public: - /// /// Assigns the static string. /// @@ -514,7 +499,6 @@ public: bool operator!=(const StringAnsi& other) const; public: - /// /// Retrieves substring created from characters starting from startIndex to the String end. /// @@ -531,7 +515,6 @@ public: StringAnsi Substring(int32 startIndex, int32 count) const; public: - String ToString() const; StringAnsi ToStringAnsi() const; }; diff --git a/Source/Engine/Core/Types/TimeSpan.h b/Source/Engine/Core/Types/TimeSpan.h index 398c06321..827a36a31 100644 --- a/Source/Engine/Core/Types/TimeSpan.h +++ b/Source/Engine/Core/Types/TimeSpan.h @@ -33,14 +33,12 @@ namespace Constants API_STRUCT(InBuild, Namespace="System") struct FLAXENGINE_API TimeSpan { public: - /// /// Time span in 100 nanoseconds resolution. /// int64 Ticks; public: - /// /// Empty constructor. /// @@ -88,7 +86,6 @@ public: } public: - // Get string String ToString() const; @@ -99,7 +96,6 @@ public: String ToString(const char option) const; public: - FORCE_INLINE TimeSpan operator+(const TimeSpan& other) const { return TimeSpan(Ticks + other.Ticks); @@ -169,7 +165,6 @@ public: } public: - /// /// Gets the days component of this time span. /// @@ -259,7 +254,6 @@ public: } public: - /// /// Creates a time span that represents the specified number of days. /// @@ -296,7 +290,6 @@ public: static TimeSpan FromSeconds(double seconds); public: - /// /// Returns the maximum time span value. /// @@ -325,7 +318,6 @@ public: } private: - void Set(int32 days, int32 hours, int32 minutes, int32 seconds, int32 milliseconds); }; diff --git a/Source/Engine/Core/Types/Variant.h b/Source/Engine/Core/Types/Variant.h index 94142b536..78a8ce47b 100644 --- a/Source/Engine/Core/Types/Variant.h +++ b/Source/Engine/Core/Types/Variant.h @@ -78,7 +78,6 @@ API_STRUCT(InBuild) struct FLAXENGINE_API VariantType }; public: - /// /// The type of the variant. /// @@ -90,7 +89,6 @@ public: char* TypeName; public: - FORCE_INLINE VariantType() { Type = Null; @@ -116,7 +114,6 @@ public: } public: - VariantType& operator=(const Types& type); VariantType& operator=(VariantType&& other); VariantType& operator=(const VariantType& other); @@ -129,7 +126,6 @@ public: } public: - void SetTypeName(const StringView& typeName); void SetTypeName(const StringAnsiView& typeName); const char* GetTypeName() const; @@ -179,7 +175,6 @@ API_STRUCT(InBuild) struct FLAXENGINE_API Variant }; public: - // 0.0f (floating-point value type) static const Variant Zero; @@ -196,7 +191,6 @@ public: static const Variant True; public: - FORCE_INLINE Variant() { } @@ -252,7 +246,6 @@ public: ~Variant(); public: - Variant& operator=(Variant&& other); Variant& operator=(const Variant& other); bool operator==(const Variant& other) const; @@ -279,7 +272,6 @@ public: } public: - explicit operator bool() const; explicit operator Char() const; explicit operator int8() const; @@ -293,8 +285,8 @@ public: explicit operator float() const; explicit operator double() const; explicit operator void*() const; - explicit operator StringView() const; // Returned StringView, if not empty, is guaranteed to point to a null terminated buffer. - explicit operator StringAnsiView() const; // Returned StringView, if not empty, is guaranteed to point to a null terminated buffer. + explicit operator StringView() const; // Returned StringView, if not empty, is guaranteed to point to a null terminated buffer. + explicit operator StringAnsiView() const; // Returned StringView, if not empty, is guaranteed to point to a null terminated buffer. explicit operator ScriptingObject*() const; explicit operator struct _MonoObject*() const; explicit operator Asset*() const; @@ -346,7 +338,6 @@ public: const Array& AsArray() const; public: - void SetType(const VariantType& type); void SetType(VariantType&& type); void SetString(const StringView& str); @@ -366,7 +357,6 @@ public: } public: - template static typename TEnableIf::Value, Variant>::Type Enum(VariantType&& type, const T value) { @@ -393,7 +383,6 @@ public: static Variant Lerp(const Variant& a, const Variant& b, float alpha); private: - void OnObjectDeleted(ScriptingObject* obj) { AsObject = nullptr; diff --git a/Source/Engine/Core/Types/Version.h b/Source/Engine/Core/Types/Version.h index 205adc1c3..189351865 100644 --- a/Source/Engine/Core/Types/Version.h +++ b/Source/Engine/Core/Types/Version.h @@ -12,14 +12,12 @@ struct FLAXENGINE_API Version { private: - int32 _major; int32 _minor; int32 _build; int32 _revision; public: - /// /// Initializes a new instance of the Version class with the specified major, minor, build, and revision numbers. /// @@ -74,7 +72,6 @@ public: } public: - /// /// Gets the value of the build component of the version number for the current Version object. /// @@ -130,7 +127,6 @@ public: } public: - /// /// Compares the current Version object to a specified Version object and returns an indication of their relative values. /// @@ -209,7 +205,6 @@ public: } public: - /// /// Converts the value of the current Version object to its equivalent representation. /// A specified count indicates the number of components to return. @@ -221,7 +216,6 @@ public: String ToString() const; public: - /// /// Try to parse Version from string. /// diff --git a/Source/Engine/Level/Actor.h b/Source/Engine/Level/Actor.h index 872f4798b..a13b57410 100644 --- a/Source/Engine/Level/Actor.h +++ b/Source/Engine/Level/Actor.h @@ -26,7 +26,7 @@ class SceneRenderTask; /// API_CLASS(Abstract) class FLAXENGINE_API Actor : public SceneObject { -DECLARE_SCENE_OBJECT(Actor); + DECLARE_SCENE_OBJECT(Actor); friend Level; friend PrefabManager; friend Scene; @@ -35,7 +35,6 @@ DECLARE_SCENE_OBJECT(Actor); friend PrefabInstanceData; protected: - int8 _isActive : 1; int8 _isActiveInHierarchy : 1; int8 _isPrefabRoot : 1; @@ -53,13 +52,11 @@ protected: PhysicsScene* _physicsScene; private: - // Disable copying Actor(Actor const&) = delete; Actor& operator=(Actor const&) = delete; public: - /// /// List with all child actors attached to the actor (readonly). All items are valid (not null). /// @@ -79,7 +76,6 @@ public: HideFlags HideFlags; public: - /// /// Gets the object layer (index). Can be used for selective rendering or ignoring raycasts. /// @@ -164,7 +160,6 @@ public: API_PROPERTY() void SetName(const StringView& value); public: - /// /// Gets the scene object which contains this actor. /// @@ -251,7 +246,6 @@ public: API_FUNCTION(Attributes="NoAnimate") void DestroyChildren(float timeLeft = 0.0f); public: - /// /// Gets amount of scripts. /// @@ -308,7 +302,6 @@ public: } public: - /// /// Gets value indicating if actor is active in the scene. /// @@ -401,7 +394,6 @@ public: } public: - /// /// Gets the actor's world transformation. /// @@ -475,7 +467,6 @@ public: API_PROPERTY() void SetRotation(const Matrix& value); public: - /// /// Gets the random per-instance value (normalized to range 0-1). /// @@ -501,7 +492,6 @@ public: API_PROPERTY() void SetDirection(const Float3& value); public: - /// /// Resets the actor local transform. /// @@ -599,7 +589,6 @@ public: } public: - /// /// Gets actor bounding sphere that defines 3D space intersecting with the actor (for determination of the visibility for actor). /// @@ -646,7 +635,6 @@ public: void UnregisterObjectHierarchy(); public: - /// /// Draws this actor. Called by Scene Rendering service. This call is more optimized than generic Draw (eg. geometry is rendered during all pass types but other actors are drawn only during GBufferFill pass). /// @@ -668,7 +656,6 @@ public: #endif public: - /// /// Changes the script order. /// @@ -689,7 +676,6 @@ public: API_PROPERTY() bool IsPrefabRoot() const; public: - /// /// Tries to find the actor with the given name in this actor hierarchy (checks this actor and all children hierarchy). /// @@ -790,7 +776,6 @@ public: API_FUNCTION() Quaternion LookingAt(const Vector3& worldPos, const Vector3& worldUp) const; public: - /// /// Execute custom action on actors tree. /// Action should returns false to stop calling deeper. @@ -827,7 +812,6 @@ public: } public: - /// /// Performs actors serialization to the raw bytes. /// @@ -887,7 +871,6 @@ public: API_FUNCTION() void FromJson(const StringAnsiView& json); public: - /// /// Called when actor gets added to game systems. Occurs on BeginPlay event or when actor gets activated in hierarchy. Use this event to register object to other game system (eg. audio). /// @@ -969,10 +952,11 @@ public: API_PROPERTY(Attributes="HideInEditor") PhysicsScene* GetPhysicsScene() const; protected: - virtual void OnPhysicsSceneChanged(PhysicsScene* previous) {} + virtual void OnPhysicsSceneChanged(PhysicsScene* previous) + { + } private: - void SetSceneInHierarchy(Scene* scene); void OnEnableInHierarchy(); void OnDisableInHierarchy(); @@ -982,7 +966,6 @@ private: static bool IsSubClassOf(const Script* object, const MClass* klass); public: - // [ScriptingObject] String ToString() const override; void OnDeleteObject() override; diff --git a/Source/Engine/Level/Actors/AnimatedModel.cpp b/Source/Engine/Level/Actors/AnimatedModel.cpp index 94b8002ee..3a0ab2641 100644 --- a/Source/Engine/Level/Actors/AnimatedModel.cpp +++ b/Source/Engine/Level/Actors/AnimatedModel.cpp @@ -693,9 +693,9 @@ void AnimatedModel::Update() void AnimatedModel::Draw(RenderContext& renderContext) { if (renderContext.View.Pass == DrawPass::GlobalSDF) - return; // TODO: Animated Model rendering to Global SDF + return; // TODO: Animated Model rendering to Global SDF if (renderContext.View.Pass == DrawPass::GlobalSurfaceAtlas) - return; // No supported + return; // No supported GEOMETRY_DRAW_STATE_EVENT_BEGIN(_drawState, _world); const DrawPass drawModes = (DrawPass)(DrawModes & renderContext.View.Pass & (int32)renderContext.View.GetShadowsDrawPassMask(ShadowsMode)); diff --git a/Source/Engine/Level/Actors/AnimatedModel.h b/Source/Engine/Level/Actors/AnimatedModel.h index 90f96ed69..63efa487a 100644 --- a/Source/Engine/Level/Actors/AnimatedModel.h +++ b/Source/Engine/Level/Actors/AnimatedModel.h @@ -14,10 +14,9 @@ /// API_CLASS() class FLAXENGINE_API AnimatedModel : public ModelInstanceActor { -DECLARE_SCENE_OBJECT(AnimatedModel); + DECLARE_SCENE_OBJECT(AnimatedModel); friend class AnimationsSystem; public: - /// /// Describes the animation graph updates frequency for the animated model. /// @@ -55,7 +54,6 @@ public: }; private: - BoundingBox _boxLocal; Matrix _world; GeometryDrawStateData _drawState; @@ -68,7 +66,6 @@ private: ScriptingObjectReference _masterPose; public: - /// /// The skinned model asset used for rendering. /// @@ -154,7 +151,6 @@ public: ScriptingObjectReference RootMotionTarget; public: - /// /// The graph instance data container. For dynamic usage only at runtime, not serialized. /// @@ -238,7 +234,6 @@ public: API_FUNCTION() void SetMasterPoseModel(AnimatedModel* masterPose); public: - /// /// Gets the anim graph instance parameters collection. /// @@ -283,7 +278,6 @@ public: API_FUNCTION() void SetParameterValue(const Guid& id, const Variant& value); public: - /// /// Gets the weight of the blend shape. /// @@ -304,7 +298,6 @@ public: API_FUNCTION() void ClearBlendShapeWeights(); public: - /// /// Plays the animation on the slot in Anim Graph. /// @@ -353,7 +346,6 @@ public: API_FUNCTION() bool IsPlayingSlotAnimation(const StringView& slotName, Animation* anim); private: - void ApplyRootMotion(const RootMotionData& rootMotionDelta); void SyncParameters(); @@ -372,7 +364,6 @@ private: void OnGraphLoaded(); public: - // [ModelInstanceActor] bool HasContentLoaded() const override; void Draw(RenderContext& renderContext) override; @@ -387,7 +378,6 @@ public: bool IntersectsEntry(const Ray& ray, Real& distance, Vector3& normal, int32& entryIndex) override; protected: - // [ModelInstanceActor] void BeginPlay(SceneBeginData* data) override; void EndPlay() override; diff --git a/Source/Engine/Level/Actors/BoneSocket.cpp b/Source/Engine/Level/Actors/BoneSocket.cpp index 924dc768a..d287fedcb 100644 --- a/Source/Engine/Level/Actors/BoneSocket.cpp +++ b/Source/Engine/Level/Actors/BoneSocket.cpp @@ -104,7 +104,7 @@ void BoneSocket::OnParentChanged() { // Base Actor::OnParentChanged(); - + if (!IsDuringPlay()) return; diff --git a/Source/Engine/Level/Actors/BoneSocket.h b/Source/Engine/Level/Actors/BoneSocket.h index e1f158a47..e3ed1e5f4 100644 --- a/Source/Engine/Level/Actors/BoneSocket.h +++ b/Source/Engine/Level/Actors/BoneSocket.h @@ -9,16 +9,14 @@ /// API_CLASS() class FLAXENGINE_API BoneSocket : public Actor { -DECLARE_SCENE_OBJECT(BoneSocket); + DECLARE_SCENE_OBJECT(BoneSocket); private: - String _node; int32 _index; bool _useScale; public: - /// /// Gets the target node name to link to it. /// @@ -54,7 +52,6 @@ public: void SetUseScale(bool value); public: - /// /// Updates the actor transformation based on a skeleton node. /// @@ -62,7 +59,6 @@ public: void UpdateTransformation(); public: - // [Actor] #if USE_EDITOR void OnDebugDrawSelected() override; @@ -71,7 +67,6 @@ public: void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override; protected: - // [Actor] void OnTransformChanged() override; void OnParentChanged() override; diff --git a/Source/Engine/Level/Actors/BoxBrush.h b/Source/Engine/Level/Actors/BoxBrush.h index 6a7d24330..718fd5d55 100644 --- a/Source/Engine/Level/Actors/BoxBrush.h +++ b/Source/Engine/Level/Actors/BoxBrush.h @@ -12,7 +12,7 @@ /// API_STRUCT() struct BrushSurface : ISerializable { -DECLARE_SCRIPTING_TYPE_NO_SPAWN(BrushSurface); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(BrushSurface); /// /// The parent brush. @@ -57,7 +57,6 @@ DECLARE_SCRIPTING_TYPE_NO_SPAWN(BrushSurface); float ScaleInLightmap = 1.0f; public: - // [ISerializable] void Serialize(SerializeStream& stream, const void* otherObj) override; void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override; @@ -68,16 +67,14 @@ public: /// API_CLASS() class FLAXENGINE_API BoxBrush : public Actor, public CSG::Brush { -DECLARE_SCENE_OBJECT(BoxBrush); + DECLARE_SCENE_OBJECT(BoxBrush); private: - Vector3 _center; Vector3 _size; OrientedBoundingBox _bounds; BrushMode _mode; public: - /// /// Brush surfaces scale in lightmap /// @@ -161,7 +158,6 @@ public: API_FUNCTION() void SetMaterial(int32 surfaceIndex, MaterialBase* material); public: - /// /// Gets the volume bounding box (oriented). /// @@ -191,7 +187,6 @@ public: API_FUNCTION() void GetVertices(int32 surfaceIndex, API_PARAM(Out) Array& outputData) const; private: - FORCE_INLINE void UpdateBounds() { OrientedBoundingBox::CreateCentered(_center, _size, _bounds); @@ -201,7 +196,6 @@ private: } public: - // [Actor] void Serialize(SerializeStream& stream, const void* otherObj) override; void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override; @@ -219,7 +213,6 @@ public: int32 GetSurfacesCount() override; protected: - // [Actor] void OnTransformChanged() override; void OnActiveInTreeChanged() override; diff --git a/Source/Engine/Level/Actors/BoxVolume.h b/Source/Engine/Level/Actors/BoxVolume.h index cb957f572..e6a9d41b1 100644 --- a/Source/Engine/Level/Actors/BoxVolume.h +++ b/Source/Engine/Level/Actors/BoxVolume.h @@ -10,14 +10,12 @@ /// API_CLASS(Abstract) class FLAXENGINE_API BoxVolume : public Actor { -DECLARE_SCENE_OBJECT(BoxVolume); + DECLARE_SCENE_OBJECT(BoxVolume); protected: - Vector3 _size; OrientedBoundingBox _bounds; public: - /// /// Gets the size of the volume (in local space). /// @@ -41,7 +39,6 @@ public: } protected: - virtual void OnBoundsChanged(const BoundingBox& prevBounds) { } @@ -51,7 +48,6 @@ protected: #endif public: - // [Actor] #if USE_EDITOR void OnDebugDraw() override; @@ -61,7 +57,6 @@ public: void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override; protected: - // [Actor] void OnTransformChanged() override; }; diff --git a/Source/Engine/Level/Actors/Camera.h b/Source/Engine/Level/Actors/Camera.h index e029ad972..9c380dcfc 100644 --- a/Source/Engine/Level/Actors/Camera.h +++ b/Source/Engine/Level/Actors/Camera.h @@ -20,7 +20,7 @@ /// API_CLASS(Sealed) class FLAXENGINE_API Camera : public Actor { -DECLARE_SCENE_OBJECT(Camera); + DECLARE_SCENE_OBJECT(Camera); // List with all created cameras actors on the scene static Array Cameras; @@ -35,7 +35,6 @@ DECLARE_SCENE_OBJECT(Camera); API_PROPERTY() static Camera* GetMainCamera(); private: - Matrix _view, _projection; BoundingFrustum _frustum; @@ -56,7 +55,6 @@ private: #endif public: - /// /// Gets the view matrix. /// @@ -82,7 +80,6 @@ public: } public: - /// /// Gets the value indicating if camera should use perspective rendering mode, otherwise it will use orthographic projection. /// @@ -174,7 +171,6 @@ public: LayersMask RenderLayersMask; public: - /// /// Projects the point from 3D world-space to game window coordinates (in screen pixels for default viewport calculated from ). /// @@ -231,14 +227,12 @@ public: #endif private: - #if USE_EDITOR void OnPreviewModelLoaded(); #endif void UpdateCache(); public: - // [Actor] #if USE_EDITOR BoundingBox GetEditorBox() const override; @@ -250,7 +244,6 @@ public: void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override; protected: - // [Actor] void OnEnable() override; void OnDisable() override; diff --git a/Source/Engine/Level/Actors/Decal.h b/Source/Engine/Level/Actors/Decal.h index 10eccb635..3e2d6a18c 100644 --- a/Source/Engine/Level/Actors/Decal.h +++ b/Source/Engine/Level/Actors/Decal.h @@ -12,16 +12,14 @@ /// API_CLASS() class FLAXENGINE_API Decal : public Actor { -DECLARE_SCENE_OBJECT(Decal); + DECLARE_SCENE_OBJECT(Decal); private: - Vector3 _size; OrientedBoundingBox _bounds; Matrix _world; int32 _sceneRenderingKey = -1; public: - /// /// The decal material. Must have domain mode to Decal type. /// @@ -56,7 +54,6 @@ public: API_PROPERTY() void SetSize(const Vector3& value); public: - /// /// Utility to crate a new virtual Material Instance asset, set its parent to the currently applied material, and assign it to the decal. Can be used to modify the decal material parameters from code. /// @@ -73,7 +70,6 @@ public: } public: - // [Actor] #if USE_EDITOR void OnDebugDrawSelected() override; @@ -86,7 +82,6 @@ public: bool IntersectsItself(const Ray& ray, Real& distance, Vector3& normal) override; protected: - // [Actor] void OnEnable() override; void OnDisable() override; diff --git a/Source/Engine/Level/Actors/EmptyActor.h b/Source/Engine/Level/Actors/EmptyActor.h index ec85afd19..00d1cf0a8 100644 --- a/Source/Engine/Level/Actors/EmptyActor.h +++ b/Source/Engine/Level/Actors/EmptyActor.h @@ -9,16 +9,14 @@ /// API_CLASS() class FLAXENGINE_API EmptyActor : public Actor { -DECLARE_SCENE_OBJECT(EmptyActor); + DECLARE_SCENE_OBJECT(EmptyActor); public: - // [Actor] #if USE_EDITOR BoundingBox GetEditorBox() const override; #endif protected: - // [Actor] void OnTransformChanged() override; }; diff --git a/Source/Engine/Level/Actors/EnvironmentProbe.h b/Source/Engine/Level/Actors/EnvironmentProbe.h index 52ccda3fb..cc84d2f1b 100644 --- a/Source/Engine/Level/Actors/EnvironmentProbe.h +++ b/Source/Engine/Level/Actors/EnvironmentProbe.h @@ -11,16 +11,14 @@ /// API_CLASS() class FLAXENGINE_API EnvironmentProbe : public Actor { -DECLARE_SCENE_OBJECT(EnvironmentProbe); + DECLARE_SCENE_OBJECT(EnvironmentProbe); private: - float _radius; bool _isUsingCustomProbe; int32 _sceneRenderingKey = -1; AssetReference _probe; public: - /// /// The reflections brightness. /// @@ -40,7 +38,6 @@ public: float CaptureNearPlane = 10.0f; public: - /// /// Gets the probe radius. /// @@ -108,7 +105,6 @@ public: API_PROPERTY() void SetCustomProbe(CubeTexture* probe); public: - /// /// Bakes that probe. It won't be performed now but on async graphics rendering task. /// @@ -122,11 +118,9 @@ public: void SetProbeData(TextureData& data); private: - void UpdateBounds(); public: - // [Actor] #if USE_EDITOR BoundingBox GetEditorBox() const override @@ -146,7 +140,6 @@ public: bool IntersectsItself(const Ray& ray, Real& distance, Vector3& normal) override; protected: - // [Actor] void OnEnable() override; void OnDisable() override; diff --git a/Source/Engine/Level/Actors/ExponentialHeightFog.cpp b/Source/Engine/Level/Actors/ExponentialHeightFog.cpp index 5481cb080..d2b2b6952 100644 --- a/Source/Engine/Level/Actors/ExponentialHeightFog.cpp +++ b/Source/Engine/Level/Actors/ExponentialHeightFog.cpp @@ -33,10 +33,10 @@ void ExponentialHeightFog::Draw(RenderContext& renderContext) { // Render only when shader is valid and fog can be rendered // Do not render exponential fog in orthographic views - if ((renderContext.View.Flags & ViewFlags::Fog) != 0 + if ((renderContext.View.Flags & ViewFlags::Fog) != 0 && renderContext.View.Pass & DrawPass::GBuffer - && _shader - && _shader->IsLoaded() + && _shader + && _shader->IsLoaded() && renderContext.View.IsPerspectiveProjection()) { // Prepare diff --git a/Source/Engine/Level/Actors/Light.h b/Source/Engine/Level/Actors/Light.h index 688081f6f..5c2491773 100644 --- a/Source/Engine/Level/Actors/Light.h +++ b/Source/Engine/Level/Actors/Light.h @@ -11,9 +11,8 @@ /// API_CLASS(Abstract) class FLAXENGINE_API Light : public Actor { -DECLARE_SCENE_OBJECT_ABSTRACT(Light); + DECLARE_SCENE_OBJECT_ABSTRACT(Light); public: - /// /// Color of the light /// @@ -51,12 +50,10 @@ public: bool CastVolumetricShadow = true; protected: - // Adjust the light brightness used during rendering (called by light types inside SetupLightData callback) void AdjustBrightness(const RenderView& view, float& brightness) const; public: - // [Actor] #if USE_EDITOR BoundingBox GetEditorBox() const override @@ -74,9 +71,8 @@ public: /// API_CLASS(Abstract) class FLAXENGINE_API LightWithShadow : public Light { -DECLARE_SCENE_OBJECT_ABSTRACT(LightWithShadow); + DECLARE_SCENE_OBJECT_ABSTRACT(LightWithShadow); public: - /// /// The minimum roughness value used to clamp material surface roughness during shading pixel. /// @@ -132,7 +128,6 @@ public: ShadowsCastingMode ShadowsMode = ShadowsCastingMode::All; public: - // [Light] void Serialize(SerializeStream& stream, const void* otherObj) override; void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override; diff --git a/Source/Engine/Level/Actors/ModelInstanceActor.h b/Source/Engine/Level/Actors/ModelInstanceActor.h index 37f0ff636..f218fc005 100644 --- a/Source/Engine/Level/Actors/ModelInstanceActor.h +++ b/Source/Engine/Level/Actors/ModelInstanceActor.h @@ -11,13 +11,11 @@ /// API_CLASS(Abstract) class FLAXENGINE_API ModelInstanceActor : public Actor { -DECLARE_SCENE_OBJECT_ABSTRACT(ModelInstanceActor); + DECLARE_SCENE_OBJECT_ABSTRACT(ModelInstanceActor); protected: - int32 _sceneRenderingKey = -1; public: - /// /// The model instance buffer. /// @@ -84,12 +82,10 @@ public: } public: - // [Actor] void OnLayerChanged() override; protected: - // [Actor] void OnEnable() override; void OnDisable() override; diff --git a/Source/Engine/Level/Actors/PostFxVolume.h b/Source/Engine/Level/Actors/PostFxVolume.h index b7764ce3b..bc269eb22 100644 --- a/Source/Engine/Level/Actors/PostFxVolume.h +++ b/Source/Engine/Level/Actors/PostFxVolume.h @@ -11,16 +11,14 @@ /// API_CLASS() class FLAXENGINE_API PostFxVolume : public BoxVolume, public IPostFxSettingsProvider { -DECLARE_SCENE_OBJECT(PostFxVolume); + DECLARE_SCENE_OBJECT(PostFxVolume); private: - int32 _priority; float _blendRadius; float _blendWeight; bool _isBounded; public: - /// /// The ambient occlusion effect settings. /// @@ -100,7 +98,6 @@ public: PostFxMaterialsSettings PostFxMaterials; public: - /// /// Gets the order in which multiple volumes are blended together. /// The volume with the highest priority takes precedence over all other overlapping volumes. @@ -184,7 +181,6 @@ public: } public: - /// /// Adds the post fx material to the settings. /// @@ -198,7 +194,6 @@ public: API_FUNCTION() void RemovePostFxMaterial(MaterialBase* material); public: - // [BoxVolume] bool HasContentLoaded() const override; void Serialize(SerializeStream& stream, const void* otherObj) override; @@ -209,7 +204,6 @@ public: void Blend(PostProcessSettings& other, float weight) override; protected: - // [BoxVolume] void OnEnable() override; void OnDisable() override; diff --git a/Source/Engine/Level/Actors/Ragdoll.h b/Source/Engine/Level/Actors/Ragdoll.h index 39a2b790d..e0e8be411 100644 --- a/Source/Engine/Level/Actors/Ragdoll.h +++ b/Source/Engine/Level/Actors/Ragdoll.h @@ -10,15 +10,13 @@ /// API_CLASS() class FLAXENGINE_API Ragdoll : public Actor { -DECLARE_SCENE_OBJECT(Ragdoll); -API_AUTO_SERIALIZATION(); + DECLARE_SCENE_OBJECT(Ragdoll); + API_AUTO_SERIALIZATION(); private: - AnimatedModel* _animatedModel = nullptr; Dictionary _bonesOffsets; public: - /// /// The default bones weight where 0 means fully animated bone and 1 means fully simulate bones. Can be used to control all bones simulation mode but is overriden by per-bone BonesWeights. /// @@ -53,7 +51,6 @@ public: float MaxDepenetrationVelocity = MAX_float; public: - /// /// Calculates the total mass of all ragdoll bodies. /// @@ -70,13 +67,11 @@ public: API_FUNCTION() void SetAngularVelocity(const Vector3& value) const; private: - float InitBone(RigidBody* rigidBody, int32& nodeIndex, Transform& localPose); void OnFixedUpdate(); void OnAnimationUpdating(struct AnimGraphImpulse* localPose); public: - // [Actor] void OnEnable() override; void OnDisable() override; diff --git a/Source/Engine/Level/Actors/Spline.h b/Source/Engine/Level/Actors/Spline.h index 4a1b04f05..eb72c3efe 100644 --- a/Source/Engine/Level/Actors/Spline.h +++ b/Source/Engine/Level/Actors/Spline.h @@ -10,15 +10,13 @@ /// API_CLASS() class FLAXENGINE_API Spline : public Actor { -DECLARE_SCENE_OBJECT(Spline); + DECLARE_SCENE_OBJECT(Spline); typedef BezierCurveKeyframe Keyframe; private: - bool _loop = false; BoundingBox _localBounds; public: - /// /// The spline bezier curve points represented as series of transformations in 3D space (with tangents). Points are stored in local-space of the actor. /// @@ -37,7 +35,6 @@ public: API_PROPERTY() void SetIsLoop(bool value); public: - /// /// Evaluates the spline curve at the given time and calculates the point location in 3D (world-space). /// @@ -215,7 +212,6 @@ public: API_FUNCTION() void GetSplineLocalPoints(API_PARAM(Out) Array& points) const; public: - /// /// Clears the spline to be empty. /// @@ -345,7 +341,6 @@ public: API_FUNCTION() void SetTangentsSmooth(); public: - /// /// Called when spline gets updated (eg. after curve modification). /// @@ -357,7 +352,6 @@ public: API_FUNCTION() virtual void UpdateSpline(); protected: - #if USE_EDITOR virtual Color GetSplineColor() { @@ -366,7 +360,6 @@ protected: #endif private: - // Internal bindings #if !COMPILE_WITHOUT_CSHARP API_FUNCTION(NoProxy) void GetKeyframes(MonoArray* data); @@ -374,7 +367,6 @@ private: #endif public: - // [Actor] #if USE_EDITOR void OnDebugDraw() override; diff --git a/Source/Engine/Level/Actors/SplineModel.cpp b/Source/Engine/Level/Actors/SplineModel.cpp index 925fb3995..6fc12edd6 100644 --- a/Source/Engine/Level/Actors/SplineModel.cpp +++ b/Source/Engine/Level/Actors/SplineModel.cpp @@ -351,9 +351,9 @@ void SplineModel::Draw(RenderContext& renderContext) return; auto model = Model.Get(); if (renderContext.View.Pass == DrawPass::GlobalSDF) - return; // TODO: Spline Model rendering to Global SDF + return; // TODO: Spline Model rendering to Global SDF if (renderContext.View.Pass == DrawPass::GlobalSurfaceAtlas) - return; // TODO: Spline Model rendering to Global Surface Atlas + return; // TODO: Spline Model rendering to Global Surface Atlas if (!Entries.IsValidFor(model)) Entries.Setup(model); diff --git a/Source/Engine/Level/Actors/SplineModel.h b/Source/Engine/Level/Actors/SplineModel.h index 4446e47f8..1d8d49fc8 100644 --- a/Source/Engine/Level/Actors/SplineModel.h +++ b/Source/Engine/Level/Actors/SplineModel.h @@ -12,9 +12,8 @@ class Spline; /// API_CLASS() class FLAXENGINE_API SplineModel : public ModelInstanceActor { -DECLARE_SCENE_OBJECT(SplineModel); + DECLARE_SCENE_OBJECT(SplineModel); private: - struct Instance { BoundingSphere Sphere; @@ -33,7 +32,6 @@ private: float _chunksPerSegment, _meshMinZ, _meshMaxZ; public: - ~SplineModel(); /// @@ -104,14 +102,12 @@ public: API_PROPERTY() void SetForcedLOD(int32 value); private: - void OnModelChanged(); void OnModelLoaded(); void OnSplineUpdated(); void UpdateDeformationBuffer(); public: - // [ModelInstanceActor] bool HasContentLoaded() const override; void Draw(RenderContext& renderContext) override; @@ -121,7 +117,6 @@ public: void OnParentChanged() override; protected: - // [ModelInstanceActor] void OnTransformChanged() override; void OnActiveInTreeChanged() override; diff --git a/Source/Engine/Level/Actors/SpotLight.h b/Source/Engine/Level/Actors/SpotLight.h index 103264618..294b5fdc5 100644 --- a/Source/Engine/Level/Actors/SpotLight.h +++ b/Source/Engine/Level/Actors/SpotLight.h @@ -11,9 +11,8 @@ /// API_CLASS() class FLAXENGINE_API SpotLight : public LightWithShadow { -DECLARE_SCENE_OBJECT(SpotLight); + DECLARE_SCENE_OBJECT(SpotLight); private: - Vector3 _direction; float _radius; float _outerConeAngle; @@ -24,7 +23,6 @@ private: int32 _sceneRenderingKey = -1; public: - /// /// Light source bulb radius /// @@ -62,7 +60,6 @@ public: float IESBrightnessScale = 1.0f; public: - /// /// Computes light brightness value /// @@ -122,11 +119,9 @@ public: API_PROPERTY() void SetInnerConeAngle(float value); private: - void UpdateBounds(); public: - // [LightWithShadow] void Draw(RenderContext& renderContext) override; #if USE_EDITOR @@ -138,7 +133,6 @@ public: bool IntersectsItself(const Ray& ray, Real& distance, Vector3& normal) override; protected: - // [LightWithShadow] void OnEnable() override; void OnDisable() override; diff --git a/Source/Engine/Level/Actors/StaticModel.h b/Source/Engine/Level/Actors/StaticModel.h index 09836e5aa..2068c2384 100644 --- a/Source/Engine/Level/Actors/StaticModel.h +++ b/Source/Engine/Level/Actors/StaticModel.h @@ -12,9 +12,8 @@ /// API_CLASS() class FLAXENGINE_API StaticModel : public ModelInstanceActor { -DECLARE_SCENE_OBJECT(StaticModel); + DECLARE_SCENE_OBJECT(StaticModel); private: - Matrix _world; GeometryDrawStateData _drawState; float _scaleInLightmap; @@ -28,7 +27,6 @@ private: Model* _residencyChangedModel = nullptr; public: - /// /// Finalizes an instance of the class. /// @@ -52,7 +50,6 @@ public: LightmapEntry Lightmap; public: - /// /// Gets the model world matrix transform. /// @@ -180,14 +177,12 @@ public: API_FUNCTION() void RemoveVertexColors(); private: - void OnModelChanged(); void OnModelLoaded(); void OnModelResidencyChanged(); void UpdateBounds(); public: - // [ModelInstanceActor] bool HasContentLoaded() const override; void Draw(RenderContext& renderContext) override; @@ -198,7 +193,6 @@ public: bool IntersectsEntry(const Ray& ray, Real& distance, Vector3& normal, int32& entryIndex) override; protected: - // [ModelInstanceActor] void OnTransformChanged() override; void OnEnable() override; diff --git a/Source/Engine/Level/ActorsCache.h b/Source/Engine/Level/ActorsCache.h index 57364278f..3c2566a09 100644 --- a/Source/Engine/Level/ActorsCache.h +++ b/Source/Engine/Level/ActorsCache.h @@ -12,13 +12,11 @@ class ActorsCache { public: - typedef ActorsLookup ActorsLookupType; typedef Array ActorsListType; typedef Array SceneObjectsListType; public: - /// /// Gets the actors lookup cached. Safe allocation, per thread, uses caching. /// diff --git a/Source/Engine/Level/Level.cpp b/Source/Engine/Level/Level.cpp index 5ff5d8c89..ddcc7797a 100644 --- a/Source/Engine/Level/Level.cpp +++ b/Source/Engine/Level/Level.cpp @@ -59,7 +59,6 @@ enum class SceneEventType class SceneAction { public: - virtual ~SceneAction() { } @@ -113,7 +112,6 @@ using namespace LevelImpl; class LevelService : public EngineService { public: - LevelService() : EngineService(TEXT("Scene Manager"), 30) { @@ -401,7 +399,6 @@ void Level::CollectPostFxVolumes(RenderContext& renderContext) class LoadSceneAction : public SceneAction { public: - Guid SceneId; AssetReference SceneAsset; @@ -444,7 +441,6 @@ public: class UnloadSceneAction : public SceneAction { public: - Guid TargetScene; UnloadSceneAction(Scene* scene) @@ -464,7 +460,6 @@ public: class UnloadScenesAction : public SceneAction { public: - UnloadScenesAction() { } @@ -478,7 +473,6 @@ public: class SaveSceneAction : public SceneAction { public: - Scene* TargetScene; bool PrettyJson; @@ -504,7 +498,6 @@ public: class ReloadScriptsAction : public SceneAction { public: - ReloadScriptsAction() { } @@ -655,7 +648,6 @@ void Level::ScriptsReloadRegisterObject(ScriptingObject*& obj) class SpawnActorAction : public SceneAction { public: - ScriptingObjectReference TargetActor; ScriptingObjectReference ParentActor; @@ -674,7 +666,6 @@ public: class DeleteActorAction : public SceneAction { public: - ScriptingObjectReference TargetActor; DeleteActorAction(Actor* actor) diff --git a/Source/Engine/Level/Level.h b/Source/Engine/Level/Level.h index 8a6e53aae..ae01cd572 100644 --- a/Source/Engine/Level/Level.h +++ b/Source/Engine/Level/Level.h @@ -21,7 +21,7 @@ struct RenderContext; /// API_CLASS(Static) class FLAXENGINE_API Level { -DECLARE_SCRIPTING_TYPE_NO_SPAWN(Level); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(Level); friend Engine; friend Actor; friend PrefabManager; @@ -33,7 +33,6 @@ DECLARE_SCRIPTING_TYPE_NO_SPAWN(Level); #endif public: - /// /// The scenes collection lock. /// @@ -45,7 +44,6 @@ public: API_FIELD(ReadOnly) static Array Scenes; public: - /// /// Occurs when new actor gets spawned to the game. /// @@ -77,7 +75,6 @@ public: API_EVENT() static Delegate ActorActiveChanged; public: - /// /// Checks if any scene has been loaded. Loaded scene means deserialized and added to the scenes collection. /// @@ -124,7 +121,6 @@ public: } public: - /// /// Spawn actor on the scene /// @@ -160,7 +156,6 @@ public: static void CallBeginPlay(Actor* obj); public: - /// /// Draws all the actors. /// @@ -174,7 +169,6 @@ public: static void CollectPostFxVolumes(RenderContext& renderContext); public: - /// /// Fired when scene starts saving. /// @@ -246,7 +240,6 @@ public: #endif public: - /// /// Saves scene to the asset. /// @@ -342,7 +335,6 @@ public: #endif public: - /// /// Tries to find actor with the given ID. It's very fast O(1) lookup. /// @@ -413,7 +405,6 @@ public: API_FUNCTION() static Scene* FindScene(const Guid& id); public: - /// /// Gets the scenes. /// @@ -433,7 +424,6 @@ public: static void GetScenes(Array& scenes); public: - /// /// Construct valid and solid list with actors from input list with whole tree for them (valid for fast serialization) /// @@ -449,7 +439,6 @@ public: static void ConstructParentActorsTreeList(const Array& input, Array& output); public: - /// /// The tags names. /// @@ -479,7 +468,6 @@ public: API_FUNCTION() static int32 GetLayerIndex(const StringView& layer); private: - // Actor API enum class ActorEventType { diff --git a/Source/Engine/Level/Scene/Lightmap.h b/Source/Engine/Level/Scene/Lightmap.h index f07f89472..86d8ae59c 100644 --- a/Source/Engine/Level/Scene/Lightmap.h +++ b/Source/Engine/Level/Scene/Lightmap.h @@ -14,7 +14,6 @@ class SceneLightmapsData; class Lightmap { private: - SceneLightmapsData* _manager; int32 _index; #if USE_EDITOR @@ -23,7 +22,6 @@ private: AssetReference _textures[3]; public: - /// /// Initializes a new instance of the class. /// @@ -33,7 +31,6 @@ public: Lightmap(SceneLightmapsData* manager, int32 index, const SavedLightmapInfo& info); public: - /// /// Gets attached texture objects /// @@ -99,7 +96,6 @@ public: bool IsReady() const; private: - #if USE_EDITOR bool OnInitLightmap(class TextureData& image); #endif diff --git a/Source/Engine/Level/Scene/Scene.h b/Source/Engine/Level/Scene/Scene.h index 927a5a58e..27b09a8f9 100644 --- a/Source/Engine/Level/Scene/Scene.h +++ b/Source/Engine/Level/Scene/Scene.h @@ -19,7 +19,7 @@ API_CLASS() class FLAXENGINE_API Scene : public Actor { friend class Level; friend class ReloadScriptsAction; -DECLARE_SCENE_OBJECT(Scene); + DECLARE_SCENE_OBJECT(Scene); /// /// Finalizes an instance of the class. @@ -27,7 +27,6 @@ DECLARE_SCENE_OBJECT(Scene); ~Scene(); public: - /// /// The scene metadata. /// @@ -80,7 +79,6 @@ public: API_PROPERTY() void SetLightmapSettings(const LightmapSettings& value); public: - /// /// Removes all baked lightmap textures from the scene. /// @@ -120,7 +118,6 @@ public: #endif private: - MeshCollider* TryGetCsgCollider(); StaticModel* TryGetCsgModel(); void CreateCsgCollider(); @@ -132,7 +129,6 @@ private: #endif public: - // [Actor] void Serialize(SerializeStream& stream, const void* otherObj) override; void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override; @@ -140,7 +136,6 @@ public: void EndPlay() override; protected: - // [Actor] void PostLoad() override; void PostSpawn() override; diff --git a/Source/Engine/Level/Scene/SceneAsset.h b/Source/Engine/Level/Scene/SceneAsset.h index 541c45782..47466eaec 100644 --- a/Source/Engine/Level/Scene/SceneAsset.h +++ b/Source/Engine/Level/Scene/SceneAsset.h @@ -9,7 +9,7 @@ /// API_CLASS(NoSpawn) class SceneAsset : public JsonAsset { -DECLARE_ASSET_HEADER(SceneAsset); + DECLARE_ASSET_HEADER(SceneAsset); protected: bool IsInternalType() const override; }; diff --git a/Source/Engine/Level/Scene/SceneCSGData.h b/Source/Engine/Level/Scene/SceneCSGData.h index d1d13e6f4..457f4a840 100644 --- a/Source/Engine/Level/Scene/SceneCSGData.h +++ b/Source/Engine/Level/Scene/SceneCSGData.h @@ -20,11 +20,9 @@ namespace CSG class SceneCSGData : public ISerializable { private: - Scene* _scene; public: - /// /// Initializes a new instance of the class. /// @@ -32,7 +30,6 @@ namespace CSG SceneCSGData(Scene* scene); public: - /// /// CSG mesh building action time (registered by CSG::Builder, in UTC format). Invalid if not build by active engine instance. /// @@ -64,7 +61,6 @@ namespace CSG Action PostCSGBuild; public: - /// /// Build CSG geometry for the given scene. /// @@ -77,7 +73,6 @@ namespace CSG bool HasData() const; public: - struct SurfaceData { Array Triangles; @@ -95,11 +90,9 @@ namespace CSG bool TryGetSurfaceData(const Guid& brushId, int32 brushSurfaceIndex, SurfaceData& outData); private: - void OnDataChanged(); public: - // [ISerializable] void Serialize(SerializeStream& stream, const void* otherObj) override; void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override; diff --git a/Source/Engine/Level/Scene/SceneLightmapsData.h b/Source/Engine/Level/Scene/SceneLightmapsData.h index b6d15c9e4..7c1ffe045 100644 --- a/Source/Engine/Level/Scene/SceneLightmapsData.h +++ b/Source/Engine/Level/Scene/SceneLightmapsData.h @@ -13,12 +13,10 @@ class Lightmap; class SceneLightmapsData { private: - Array _lightmaps; Scene* _scene; public: - /// /// Initializes a new instance of the class. /// @@ -31,7 +29,6 @@ public: ~SceneLightmapsData(); public: - FORCE_INLINE Scene* GetScene() const { return _scene; @@ -64,7 +61,6 @@ public: } public: - #if USE_EDITOR /// @@ -84,7 +80,6 @@ public: #endif public: - /// /// Clear baked lightmaps data /// diff --git a/Source/Engine/Level/Scene/SceneNavigation.h b/Source/Engine/Level/Scene/SceneNavigation.h index daf966d54..7b42487d0 100644 --- a/Source/Engine/Level/Scene/SceneNavigation.h +++ b/Source/Engine/Level/Scene/SceneNavigation.h @@ -13,7 +13,6 @@ class NavMeshBoundsVolume; class FLAXENGINE_API SceneNavigation { public: - /// /// The list of registered navigation bounds volumes (on the scene). /// diff --git a/Source/Engine/Level/Scene/SceneTicking.h b/Source/Engine/Level/Scene/SceneTicking.h index 5ad183cec..6d590fba9 100644 --- a/Source/Engine/Level/Scene/SceneTicking.h +++ b/Source/Engine/Level/Scene/SceneTicking.h @@ -11,7 +11,6 @@ class FLAXENGINE_API SceneTicking { public: - /// /// Tick function type. /// @@ -48,7 +47,6 @@ public: class FLAXENGINE_API TickData { public: - Array Scripts; Array Ticks; #if USE_EDITOR @@ -93,7 +91,6 @@ public: class FLAXENGINE_API FixedUpdateTickData : public TickData { public: - FixedUpdateTickData(); void TickScripts(const Array& scripts) override; }; @@ -101,7 +98,6 @@ public: class FLAXENGINE_API UpdateTickData : public TickData { public: - UpdateTickData(); void TickScripts(const Array& scripts) override; }; @@ -109,13 +105,11 @@ public: class FLAXENGINE_API LateUpdateTickData : public TickData { public: - LateUpdateTickData(); void TickScripts(const Array& scripts) override; }; public: - /// /// Adds the script to scene ticking system. /// @@ -134,7 +128,6 @@ public: void Clear(); public: - /// /// The fixed update tick function. /// diff --git a/Source/Engine/Level/SceneInfo.h b/Source/Engine/Level/SceneInfo.h index f475349ec..a0c802e02 100644 --- a/Source/Engine/Level/SceneInfo.h +++ b/Source/Engine/Level/SceneInfo.h @@ -14,7 +14,6 @@ class SceneInfo : public Object, public ISerializable { public: - /// /// Scene title /// @@ -31,7 +30,6 @@ public: String Copyright; public: - /// /// Array with cached lightmaps ID for the scene /// @@ -43,7 +41,6 @@ public: LightmapSettings LightmapSettings; public: - // [Object] String ToString() const override; diff --git a/Source/Engine/Level/SceneObject.h b/Source/Engine/Level/SceneObject.h index 94d13d2c7..a69eaada2 100644 --- a/Source/Engine/Level/SceneObject.h +++ b/Source/Engine/Level/SceneObject.h @@ -24,7 +24,6 @@ class Level; class SceneBeginData { public: - /// /// The joints to create after setup. /// @@ -57,7 +56,7 @@ typedef Dictionary ActorsLookup; /// API_CLASS(Abstract, NoSpawn) class FLAXENGINE_API SceneObject : public ScriptingObject, public ISerializable { -DECLARE_SCRIPTING_TYPE_NO_SPAWN(SceneObject); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(SceneObject); friend PrefabInstanceData; friend Actor; friend Level; @@ -78,7 +77,6 @@ public: // - Destroy protected: - Actor* _parent; Guid _prefabID; Guid _prefabObjectID; @@ -90,14 +88,12 @@ protected: SceneObject(const SpawnParams& params); public: - /// /// Finalizes an instance of the class. /// ~SceneObject(); public: - /// /// Determines whether object is during play (spawned/loaded and fully initialized). /// @@ -162,7 +158,6 @@ public: API_PROPERTY() virtual void SetOrderInParent(int32 index) = 0; public: - /// /// Gets a value indicating whether this object has a valid linkage to the prefab asset. /// @@ -211,7 +206,6 @@ public: API_FUNCTION() String GetNamePath(Char separatorChar = '/') const; public: - /// /// Called after whole scene or local group of scene objects deserialization. /// @@ -234,7 +228,6 @@ public: virtual void EndPlay() = 0; public: - // [ISerializable] void Serialize(SerializeStream& stream, const void* otherObj) override; void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override; diff --git a/Source/Engine/Level/SceneObjectsFactory.h b/Source/Engine/Level/SceneObjectsFactory.h index 832e0a954..9ba75fc75 100644 --- a/Source/Engine/Level/SceneObjectsFactory.h +++ b/Source/Engine/Level/SceneObjectsFactory.h @@ -11,7 +11,6 @@ class FLAXENGINE_API SceneObjectsFactory { public: - struct PrefabInstance { Guid RootId; @@ -60,7 +59,6 @@ public: static Actor* CreateActor(int32 typeId, const Guid& id); public: - struct PrefabSyncData { friend SceneObjectsFactory; @@ -117,6 +115,5 @@ public: static void SynchronizePrefabInstances(Context& context, PrefabSyncData& data); private: - static void SynchronizeNewPrefabInstance(Context& context, PrefabSyncData& data, Prefab* prefab, Actor* actor, const Guid& prefabObjectId); }; diff --git a/Source/Engine/Level/SceneQuery.cpp b/Source/Engine/Level/SceneQuery.cpp index 5ceef6d72..e2037d718 100644 --- a/Source/Engine/Level/SceneQuery.cpp +++ b/Source/Engine/Level/SceneQuery.cpp @@ -9,7 +9,7 @@ Actor* SceneQuery::RaycastScene(const Ray& ray) PROFILE_CPU(); #if SCENE_QUERIES_WITH_LOCK - ScopeLock lock(Level::ScenesLock); + ScopeLock lock(Level::ScenesLock); #endif Actor* target; @@ -94,7 +94,7 @@ void SceneQuery::GetAllActors(Array& actors) PROFILE_CPU(); #if SCENE_QUERIES_WITH_LOCK - ScopeLock lock(Level::ScenesLock); + ScopeLock lock(Level::ScenesLock); #endif for (int32 i = 0; i < Level::Scenes.Count(); i++) diff --git a/Source/Engine/Level/SceneQuery.h b/Source/Engine/Level/SceneQuery.h index 5374363a1..b04ee8fc9 100644 --- a/Source/Engine/Level/SceneQuery.h +++ b/Source/Engine/Level/SceneQuery.h @@ -17,7 +17,6 @@ class FLAXENGINE_API SceneQuery { public: - /// /// Try to find actor hit by the given ray /// @@ -26,7 +25,6 @@ public: static Actor* RaycastScene(const Ray& ray); public: - /// /// Gets all scene objects from the actor into linear list. Appends them (without the given actor). /// @@ -55,7 +53,6 @@ public: static void GetAllActors(Array& actors); public: - /// /// Execute custom action on actors tree. /// Action should returns false to stop calling deeper. @@ -67,7 +64,7 @@ public: static void TreeExecute(Function& action, Params ... args) { #if SCENE_QUERIES_WITH_LOCK - ScopeLock lock(Level::ScenesLock); + ScopeLock lock(Level::ScenesLock); #endif for (int32 i = 0; i < Level::Scenes.Count(); i++) diff --git a/Source/Engine/UI/SpriteRender.h b/Source/Engine/UI/SpriteRender.h index 49f034d00..bb976da5e 100644 --- a/Source/Engine/UI/SpriteRender.h +++ b/Source/Engine/UI/SpriteRender.h @@ -12,9 +12,8 @@ /// API_CLASS() class FLAXENGINE_API SpriteRender : public Actor { -DECLARE_SCENE_OBJECT(SpriteRender); + DECLARE_SCENE_OBJECT(SpriteRender); private: - Color _color; Float2 _size; SpriteHandle _sprite; @@ -26,7 +25,6 @@ private: int32 _sceneRenderingKey = -1; public: - /// /// Gets the size of the sprite. /// @@ -86,12 +84,10 @@ public: DrawPass DrawModes = DrawPass::Default; private: - void OnMaterialLoaded(); void SetImage(); public: - // [Actor] bool HasContentLoaded() const override; void Draw(RenderContext& renderContext) override; @@ -101,7 +97,6 @@ public: void OnEndPlay() override; protected: - // [Actor] void OnEnable() override; void OnDisable() override; diff --git a/Source/Engine/UI/TextRender.h b/Source/Engine/UI/TextRender.h index 9048fa307..cf4030903 100644 --- a/Source/Engine/UI/TextRender.h +++ b/Source/Engine/UI/TextRender.h @@ -21,9 +21,8 @@ /// API_CLASS() class FLAXENGINE_API TextRender : public Actor { -DECLARE_SCENE_OBJECT(TextRender); + DECLARE_SCENE_OBJECT(TextRender); private: - struct DrawChunk { TextRender* Actor; @@ -55,7 +54,6 @@ private: Array> _drawChunks; public: - /// /// Gets the text. /// @@ -154,7 +152,6 @@ public: #endif private: - void Invalidate() { // Invalidate data @@ -162,7 +159,6 @@ private: } public: - // [Actor] bool HasContentLoaded() const override; void Draw(RenderContext& renderContext) override; @@ -175,7 +171,6 @@ public: void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override; protected: - // [Actor] void OnEnable() override; void OnDisable() override; diff --git a/Source/Engine/UI/UICanvas.h b/Source/Engine/UI/UICanvas.h index 013f2ae95..4eff6cebc 100644 --- a/Source/Engine/UI/UICanvas.h +++ b/Source/Engine/UI/UICanvas.h @@ -9,9 +9,8 @@ /// API_CLASS(Sealed, NoConstructor) class FLAXENGINE_API UICanvas : public Actor { -DECLARE_SCENE_OBJECT(UICanvas); + DECLARE_SCENE_OBJECT(UICanvas); public: - // [Actor] #if USE_EDITOR BoundingBox GetEditorBox() const override; @@ -20,7 +19,6 @@ public: void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override; protected: - // [Actor] void BeginPlay(SceneBeginData* data) final override; void EndPlay() final override; diff --git a/Source/Engine/Utilities/Crc.h b/Source/Engine/Utilities/Crc.h index 7b13bd06e..ce32ce56b 100644 --- a/Source/Engine/Utilities/Crc.h +++ b/Source/Engine/Utilities/Crc.h @@ -9,7 +9,6 @@ class Crc { public: - // Helper lookup table with cached CRC values. static uint32 CachedCRCTablesSB8[8][256]; diff --git a/Source/Engine/Utilities/Delaunay2D.h b/Source/Engine/Utilities/Delaunay2D.h index 8ae8ab425..e0b564e09 100644 --- a/Source/Engine/Utilities/Delaunay2D.h +++ b/Source/Engine/Utilities/Delaunay2D.h @@ -12,7 +12,6 @@ class Delaunay2D { public: - struct Triangle { int32 Indices[3]; @@ -125,7 +124,6 @@ public: } private: - struct Edge { int32 Indices[2]; diff --git a/Source/Engine/Utilities/Encryption.h b/Source/Engine/Utilities/Encryption.h index 90dcf6e4e..dc7d3d06e 100644 --- a/Source/Engine/Utilities/Encryption.h +++ b/Source/Engine/Utilities/Encryption.h @@ -10,7 +10,6 @@ class FLAXENGINE_API Encryption { public: - /// /// Encrypt bytes with custom data /// @@ -26,7 +25,6 @@ public: static void DecryptBytes(byte* data, uint64 size); public: - static int32 Base64EncodeLength(int32 size); static int32 Base64DecodeLength(const char* encoded, int32 length); static void Base64Encode(const byte* bytes, int32 size, Array& encoded); diff --git a/Source/Engine/Utilities/Screenshot.cpp b/Source/Engine/Utilities/Screenshot.cpp index 3867be8dd..e7e9c12ad 100644 --- a/Source/Engine/Utilities/Screenshot.cpp +++ b/Source/Engine/Utilities/Screenshot.cpp @@ -24,7 +24,6 @@ class CaptureScreenshot : public ThreadPoolTask { friend Screenshot; private: - TextureData _data; GPUTextureReference _texture; ScriptingObjectReference _renderTask; @@ -32,7 +31,6 @@ private: DateTime _startTime; public: - /// /// Initializes a new instance of the class. /// @@ -60,7 +58,6 @@ public: } public: - /// /// Gets the texture data container. /// @@ -71,7 +68,6 @@ public: } protected: - // [ThreadPoolTask] bool Run() override; void OnFail() override; diff --git a/Source/Engine/Utilities/Screenshot.h b/Source/Engine/Utilities/Screenshot.h index 4519e3de4..914d1820e 100644 --- a/Source/Engine/Utilities/Screenshot.h +++ b/Source/Engine/Utilities/Screenshot.h @@ -14,7 +14,7 @@ class GPUTexture; /// API_CLASS(Static) class FLAXENGINE_API Screenshot { -DECLARE_SCRIPTING_TYPE_NO_SPAWN(Screenshot); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(Screenshot); /// /// Captures the specified render target contents and saves it to the file. diff --git a/Source/Engine/Utilities/StateMachine.h b/Source/Engine/Utilities/StateMachine.h index 7feeeccb7..280ab4b93 100644 --- a/Source/Engine/Utilities/StateMachine.h +++ b/Source/Engine/Utilities/StateMachine.h @@ -14,11 +14,9 @@ class FLAXENGINE_API State friend StateMachine; protected: - StateMachine* _parent; protected: - /// /// Init /// @@ -31,7 +29,6 @@ protected: ~State(); public: - /// /// State's activity /// @@ -58,7 +55,6 @@ public: } protected: - virtual void enterState() { } @@ -76,12 +72,10 @@ class FLAXENGINE_API StateMachine friend State; protected: - State* _currentState; Array _states; public: - /// /// Init /// @@ -93,7 +87,6 @@ public: virtual ~StateMachine(); public: - /// /// Gets current state /// @@ -113,7 +106,6 @@ public: } public: - /// /// Go to state /// @@ -130,6 +122,5 @@ public: virtual void GoToState(State* state); protected: - virtual void switchState(State* nextState); }; diff --git a/Source/Engine/Utilities/StringConverter.h b/Source/Engine/Utilities/StringConverter.h index df1345791..180b64e55 100644 --- a/Source/Engine/Utilities/StringConverter.h +++ b/Source/Engine/Utilities/StringConverter.h @@ -9,20 +9,17 @@ template class StringAsBase { protected: - const CharType* _static = nullptr; CharType* _dynamic = nullptr; CharType _inlined[InlinedSize]; public: - ~StringAsBase() { Allocator::Free(_dynamic); } public: - const CharType* Get() const { return _static ? _static : (_dynamic ? _dynamic : _inlined); @@ -38,12 +35,10 @@ template class StringAsANSI : public StringAsBase { public: - typedef char CharType; typedef StringAsBase Base; public: - StringAsANSI(const char* text) { this->_static = text; @@ -74,12 +69,10 @@ template class StringAsUTF8 : public StringAsBase { public: - typedef char CharType; typedef StringAsBase Base; public: - StringAsUTF8(const char* text) { this->_static = text; @@ -110,12 +103,10 @@ template class StringAsUTF16 : public StringAsBase { public: - typedef Char CharType; typedef StringAsBase Base; public: - StringAsUTF16(const char* text) : StringAsUTF16(text, StringUtils::Length(text)) { diff --git a/Source/Engine/Utilities/TextProcessing.h b/Source/Engine/Utilities/TextProcessing.h index f903da382..cdd65d7fa 100644 --- a/Source/Engine/Utilities/TextProcessing.h +++ b/Source/Engine/Utilities/TextProcessing.h @@ -14,19 +14,16 @@ class FLAXENGINE_API TextProcessing : public NonCopyable { public: - /// /// Separator structure /// struct SeparatorData { public: - char C0; char C1; public: - SeparatorData() : C0(0) , C1(0) @@ -52,7 +49,6 @@ public: } public: - bool IsWhiteSpace() const { return *this == SeparatorData('\r', '\n') @@ -62,7 +58,6 @@ public: } public: - bool operator==(const SeparatorData& other) const { return C0 == other.C0 && C1 == other.C1; @@ -80,13 +75,11 @@ public: struct Token { public: - const char* Start; int32 Length; SeparatorData Separator; public: - Token() : Start(nullptr) , Length(0) @@ -135,14 +128,12 @@ public: }*/ public: - StringAnsi ToString() const { return StringAnsi(Start, Length); } public: - FORCE_INLINE bool Equals(const Token& other) const { return Equals(other.Start, other.Length); @@ -159,7 +150,6 @@ public: } public: - FORCE_INLINE bool EqualsIgnoreCase(const Token& other) const { return EqualsIgnoreCase(other.Start, other.Length); @@ -176,7 +166,6 @@ public: } public: - FORCE_INLINE bool operator==(const char* text) const { auto token = Token(text); @@ -195,7 +184,6 @@ public: }; private: - const char* _buffer; int32 _length; char* _cursor; @@ -203,7 +191,6 @@ private: int32 _line; public: - /// /// Init /// @@ -212,7 +199,6 @@ public: TextProcessing(const char* input, int32 length); public: - /// /// Array with all token separators /// @@ -224,14 +210,12 @@ public: Array Whitespaces; public: - /// /// Set separators and white chars for HLSL language /// void Setup_HLSL(); public: - /// /// Returns true if there are still characters in the buffer and can read data from it /// @@ -260,7 +244,6 @@ public: } public: - /// /// Read single character from the buffer /// @@ -290,7 +273,6 @@ public: void ReadLine(); private: - char moveForward(); char moveBack(); }; diff --git a/Source/Engine/Utilities/TextWriter.h b/Source/Engine/Utilities/TextWriter.h index 5d2eb231e..c213d6ba2 100644 --- a/Source/Engine/Utilities/TextWriter.h +++ b/Source/Engine/Utilities/TextWriter.h @@ -15,11 +15,9 @@ template class TextWriter : public Object, public NonCopyable { private: - MemoryWriteStream _buffer; public: - /// /// Init with default capacity /// @@ -37,7 +35,6 @@ public: } public: - /// /// Gets writer private buffer /// @@ -57,7 +54,6 @@ public: } public: - /// /// Write line terminator sign /// @@ -139,7 +135,6 @@ public: } public: - /// /// Clear whole data /// @@ -149,7 +144,6 @@ public: } public: - // [Object] String ToString() const override { diff --git a/Source/Engine/Visject/Graph.h b/Source/Engine/Visject/Graph.h index 00110070f..cf342f158 100644 --- a/Source/Engine/Visject/Graph.h +++ b/Source/Engine/Visject/Graph.h @@ -23,14 +23,12 @@ template class Graph { public: - typedef Graph GraphType; typedef NodeType Node; typedef BoxType Box; typedef ParameterType Parameter; private: - struct TmpConnectionHint { Node* Node; @@ -56,7 +54,6 @@ public: VisjectMeta Meta; public: - /// /// Initializes a new instance of the class. /// @@ -72,7 +69,6 @@ public: } public: - /// /// Save graph to the stream /// @@ -456,7 +452,6 @@ public: } public: - /// /// Find node by ID /// @@ -528,7 +523,6 @@ public: } public: - #if USE_EDITOR /// @@ -561,7 +555,6 @@ public: #endif protected: - virtual bool onNodeCreated(Node* n) { return false; diff --git a/Source/Engine/Visject/GraphNode.h b/Source/Engine/Visject/GraphNode.h index cbd94e40e..ec6f48d5c 100644 --- a/Source/Engine/Visject/GraphNode.h +++ b/Source/Engine/Visject/GraphNode.h @@ -19,7 +19,6 @@ class GraphNode; class GraphBox { public: - /// /// The parent node /// @@ -41,7 +40,6 @@ public: Array> Connections; public: - GraphBox() : Parent(nullptr) , ID(0) @@ -75,7 +73,6 @@ public: } public: - /// /// Gets the parent node. /// @@ -101,12 +98,10 @@ template class GraphNode { public: - typedef BoxType Box; typedef GraphNode Node; public: - /// /// Unique node ID (within a graph). /// @@ -139,7 +134,6 @@ public: VisjectMeta Meta; public: - GraphNode() : ID(0) , Type(0) @@ -154,7 +148,6 @@ public: } public: - /// /// Gets all the valid boxes. /// diff --git a/Source/Engine/Visject/GraphParameter.h b/Source/Engine/Visject/GraphParameter.h index e82ad1899..93eba061a 100644 --- a/Source/Engine/Visject/GraphParameter.h +++ b/Source/Engine/Visject/GraphParameter.h @@ -41,9 +41,8 @@ API_ENUM() enum class ChannelMask /// API_CLASS() class FLAXENGINE_API GraphParameter : public ScriptingObject { -DECLARE_SCRIPTING_TYPE_WITH_CONSTRUCTOR_IMPL(GraphParameter, ScriptingObject); + DECLARE_SCRIPTING_TYPE_WITH_CONSTRUCTOR_IMPL(GraphParameter, ScriptingObject); public: - /// /// Parameter type /// @@ -75,7 +74,6 @@ public: VisjectMeta Meta; public: - /// /// Gets the typename of the parameter type (excluding in-build types). /// diff --git a/Source/Engine/Visject/ShaderGraph.cpp b/Source/Engine/Visject/ShaderGraph.cpp index e2d70d192..5b3b6550b 100644 --- a/Source/Engine/Visject/ShaderGraph.cpp +++ b/Source/Engine/Visject/ShaderGraph.cpp @@ -64,7 +64,7 @@ void ShaderGenerator::ProcessGroupConstants(Box* box, Node* node, Value& value) { switch (node->TypeID) { - // Constant value + // Constant value case 1: case 2: case 3: @@ -96,7 +96,7 @@ void ShaderGenerator::ProcessGroupConstants(Box* box, Node* node, Value& value) value = Value::Zero; break; } - // PI + // PI case 10: { value = Value(PI); @@ -129,7 +129,7 @@ void ShaderGenerator::ProcessGroupMath(Box* box, Node* node, Value& value) { switch (node->TypeID) { - // Add, Subtract, Multiply, Divide, Modulo + // Add, Subtract, Multiply, Divide, Modulo case 1: case 2: case 3: @@ -175,7 +175,7 @@ void ShaderGenerator::ProcessGroupMath(Box* box, Node* node, Value& value) value = writeOperation2(node, v1, v2, op); break; } - // Absolute Value, Ceil, Cosine, Floor, Normalize, Round, Saturate, Sine, Sqrt, Tangent + // Absolute Value, Ceil, Cosine, Floor, Normalize, Round, Saturate, Sine, Sqrt, Tangent case 7: case 8: case 9: @@ -193,14 +193,14 @@ void ShaderGenerator::ProcessGroupMath(Box* box, Node* node, Value& value) value = writeFunction1(node, v1, function); break; } - // Length + // Length case 11: { String text = String::Format(TEXT("length({0})"), tryGetValue(node->GetBox(0), Value::Zero).Value); value = writeLocal(ValueType::Float, text, node); break; } - // Cross, Max, Min, Pow + // Cross, Max, Min, Pow case 18: case 21: case 22: @@ -214,7 +214,7 @@ void ShaderGenerator::ProcessGroupMath(Box* box, Node* node, Value& value) value = writeFunction2(node, v1, v2, function); break; } - // Distance, Dot + // Distance, Dot case 19: case 20: { @@ -226,7 +226,7 @@ void ShaderGenerator::ProcessGroupMath(Box* box, Node* node, Value& value) value = writeFunction2(node, v1, v2, function, ValueType::Float); break; } - // Clamp + // Clamp case 24: { Box* b1 = node->GetBox(0); @@ -238,7 +238,7 @@ void ShaderGenerator::ProcessGroupMath(Box* box, Node* node, Value& value) value = writeFunction3(node, v1, v2, v3, TEXT("clamp"), v1.Type); break; } - // Lerp + // Lerp case 25: { Value a = tryGetValue(node->GetBox(0), 0, Value::Zero); @@ -248,7 +248,7 @@ void ShaderGenerator::ProcessGroupMath(Box* box, Node* node, Value& value) value = writeLocal(a.Type, text, node); break; } - // Reflect + // Reflect case 26: { Box* b1 = node->GetBox(0); @@ -259,7 +259,7 @@ void ShaderGenerator::ProcessGroupMath(Box* box, Node* node, Value& value) value = writeFunction2(node, v1, v2, function); break; } - // Negate + // Negate case 27: { Box* b1 = node->GetBox(0); @@ -267,21 +267,21 @@ void ShaderGenerator::ProcessGroupMath(Box* box, Node* node, Value& value) value = writeLocal(v1.Type, String(TEXT("-")) + v1.Value, node); break; } - // 1 - Value + // 1 - Value case 28: { Value v1 = tryGetValue(node->GetBox(0), Value::Zero); value = writeOperation2(node, Value::InitForOne(v1.Type), v1, '-'); break; } - // Derive Normal Z + // Derive Normal Z case 29: { Value inXY = tryGetValue(node->GetBox(0), Value::Zero).AsFloat2(); value = writeLocal(ValueType::Float3, String::Format(TEXT("float3({0}, sqrt(saturate(1.0 - dot({0}.xy, {0}.xy))))"), inXY.Value), node); break; } - // Mad + // Mad case 31: { Value v1 = tryGetValue(node->GetBox(0), Value::Zero); @@ -291,7 +291,7 @@ void ShaderGenerator::ProcessGroupMath(Box* box, Node* node, Value& value) value = writeLocal(v1.Type, text, node); break; } - // Extract Largest Component + // Extract Largest Component case 32: { Value v1 = tryGetValue(node->GetBox(0), Value::Zero); @@ -300,25 +300,25 @@ void ShaderGenerator::ProcessGroupMath(Box* box, Node* node, Value& value) _includes.Add(TEXT("./Flax/Math.hlsl")); break; } - // Asine + // Asine case 33: { value = writeFunction1(node, tryGetValue(node->GetBox(0), Value::Zero), TEXT("asin")); break; } - // Acosine + // Acosine case 34: { value = writeFunction1(node, tryGetValue(node->GetBox(0), Value::Zero), TEXT("acos")); break; } - // Atan + // Atan case 35: { value = writeFunction1(node, tryGetValue(node->GetBox(0), Value::Zero), TEXT("atan")); break; } - // Bias and Scale + // Bias and Scale case 36: { ASSERT(node->Values.Count() == 2 && node->Values[0].Type == VariantType::Float && node->Values[1].Type == VariantType::Float); @@ -329,7 +329,7 @@ void ShaderGenerator::ProcessGroupMath(Box* box, Node* node, Value& value) value = writeLocal(input.Type, text, node); break; } - // Rotate About Axis + // Rotate About Axis case 37: { const auto normalizedRotationAxis = tryGetValue(node->GetBox(0), Value::Zero).AsFloat3(); @@ -341,19 +341,19 @@ void ShaderGenerator::ProcessGroupMath(Box* box, Node* node, Value& value) value = writeLocal(ValueType::Float3, text, node); break; } - // Trunc + // Trunc case 38: { value = writeFunction1(node, tryGetValue(node->GetBox(0), Value::Zero), TEXT("trunc")); break; } - // Frac + // Frac case 39: { value = writeFunction1(node, tryGetValue(node->GetBox(0), Value::Zero), TEXT("frac")); break; } - // Fmod + // Fmod case 40: { Value v1 = tryGetValue(node->GetBox(0), Value::Zero); @@ -361,7 +361,7 @@ void ShaderGenerator::ProcessGroupMath(Box* box, Node* node, Value& value) value = writeFunction2(node, v1, v2, TEXT("fmod")); break; } - // Atan2 + // Atan2 case 41: { Value v1 = tryGetValue(node->GetBox(0), Value::Zero); @@ -369,7 +369,7 @@ void ShaderGenerator::ProcessGroupMath(Box* box, Node* node, Value& value) value = writeFunction2(node, v1, v2, TEXT("atan2")); break; } - // Near Equal + // Near Equal case 42: { Value v1 = tryGetValue(node->GetBox(0), Value::Zero); @@ -378,30 +378,30 @@ void ShaderGenerator::ProcessGroupMath(Box* box, Node* node, Value& value) value = writeLocal(ValueType::Bool, String::Format(TEXT("distance({0},{1}) < {2}"), v1.Value, v2.Value, epsilon.Value), node); break; } - // Degrees + // Degrees case 43: { value = writeFunction1(node, tryGetValue(node->GetBox(0), Value::Zero), TEXT("degrees")); break; } - // Radians + // Radians case 44: { value = writeFunction1(node, tryGetValue(node->GetBox(0), Value::Zero), TEXT("radians")); break; } - // Remap + // Remap case 48: { - const auto inVal = tryGetValue(node->GetBox(0), node->Values[0].AsFloat); + const auto inVal = tryGetValue(node->GetBox(0), node->Values[0].AsFloat); const auto rangeA = tryGetValue(node->GetBox(1), node->Values[1].AsFloat2()); const auto rangeB = tryGetValue(node->GetBox(2), node->Values[2].AsFloat2()); - const auto clamp = tryGetValue(node->GetBox(3), node->Values[3]).AsBool(); + const auto clamp = tryGetValue(node->GetBox(3), node->Values[3]).AsBool(); const auto mapFunc = String::Format(TEXT("{2}.x + ({0} - {1}.x) * ({2}.y - {2}.x) / ({1}.y - {1}.x)"), inVal.Value, rangeA.Value, rangeB.Value); value = writeLocal(ValueType::Float, String::Format(TEXT("{2} ? clamp({0}, {1}.x, {1}.y) : {0}"), mapFunc, rangeB.Value, clamp.Value), node); break; } - // Rotate Vector + // Rotate Vector case 49: { const Value quaternion = tryGetValue(node->GetBox(0), Value::InitForZero(VariantType::Quaternion)).Cast(VariantType::Quaternion); @@ -418,7 +418,7 @@ void ShaderGenerator::ProcessGroupPacking(Box* box, Node* node, Value& value) { switch (node->TypeID) { - // Pack + // Pack case 20: { Box* bX = node->GetBox(1); @@ -460,7 +460,7 @@ void ShaderGenerator::ProcessGroupPacking(Box* box, Node* node, Value& value) value = Value::Zero; break; } - // Unpack + // Unpack case 30: { Box* b = node->GetBox(0); @@ -502,7 +502,7 @@ void ShaderGenerator::ProcessGroupPacking(Box* box, Node* node, Value& value) value = Value::Zero; break; } - // Mask X, Y, Z, W + // Mask X, Y, Z, W case 40: case 41: case 42: @@ -512,7 +512,7 @@ void ShaderGenerator::ProcessGroupPacking(Box* box, Node* node, Value& value) value = Value(ValueType::Float, v.Value + _subs[node->TypeID - 40]); break; } - // Mask XY, YZ, XZ,... + // Mask XY, YZ, XZ,... case 44: { value = tryGetValue(node->GetBox(0), Float2::Zero).AsFloat2(); @@ -536,13 +536,13 @@ void ShaderGenerator::ProcessGroupPacking(Box* box, Node* node, Value& value) value = Value(ValueType::Float2, v.Value + TEXT(".zw")); break; } - // Mask XYZ + // Mask XYZ case 70: { value = tryGetValue(node->GetBox(0), Float4::Zero).AsFloat3(); break; } - // Append + // Append case 100: { auto in0 = node->GetBox(0); @@ -586,7 +586,7 @@ void ShaderGenerator::ProcessGroupTools(Box* box, Node* node, Value& value) { switch (node->TypeID) { - // Desaturation + // Desaturation case 2: { Value input = tryGetValue(node->GetBox(0), Value::Zero).AsFloat3(); @@ -596,7 +596,7 @@ void ShaderGenerator::ProcessGroupTools(Box* box, Node* node, Value& value) value = writeFunction3(node, input, dot, scale, TEXT("lerp"), ValueType::Float3); break; } - // Color Gradient + // Color Gradient case 10: { Value time, prevTime, curTime; @@ -661,7 +661,7 @@ void ShaderGenerator::ProcessGroupTools(Box* box, Node* node, Value& value) } break; } - // Curve + // Curve #define SAMPLE_CURVE(id, curves, type, graphType) \ case id: \ { \ @@ -675,7 +675,7 @@ void ShaderGenerator::ProcessGroupTools(Box* box, Node* node, Value& value) SAMPLE_CURVE(14, Float3Curves, AsFloat3, Float3) SAMPLE_CURVE(15, Float4Curves, AsFloat4, Float4) #undef SETUP_CURVE - // Get Gameplay Global + // Get Gameplay Global case 16: { // Get the variable type @@ -723,7 +723,7 @@ void ShaderGenerator::ProcessGroupTools(Box* box, Node* node, Value& value) value.Value = param->ShaderName; break; } - // Platform Switch + // Platform Switch case 17: { bool usesAnyPlatformSpecificInput = false; @@ -768,7 +768,7 @@ void ShaderGenerator::ProcessGroupTools(Box* box, Node* node, Value& value) #undef PLATFORM_CASE break; } - // Reroute + // Reroute case 29: value = tryGetValue(node->GetBox(0), Value::Zero); break; @@ -781,7 +781,7 @@ void ShaderGenerator::ProcessGroupBoolean(Box* box, Node* node, Value& value) { switch (node->TypeID) { - // NOT + // NOT case 1: { // Get A value @@ -791,7 +791,7 @@ void ShaderGenerator::ProcessGroupBoolean(Box* box, Node* node, Value& value) value = writeLocal(ValueType::Bool, String::Format(TEXT("!{0}"), a.Value), node); break; } - // AND, OR, XOR, NOR, NAND + // AND, OR, XOR, NOR, NAND case 2: case 3: case 4: @@ -806,28 +806,28 @@ void ShaderGenerator::ProcessGroupBoolean(Box* box, Node* node, Value& value) const Char* op; switch (node->TypeID) { - // AND + // AND case 2: op = TEXT("{0} && {1}"); break; - // OR + // OR case 3: op = TEXT("{0} || {1}"); break; - // XOR + // XOR case 4: op = TEXT("!{0} != !{1}"); break; - // NOR + // NOR case 5: op = TEXT("!({0} || {1})"); break; - // NAND + // NAND case 6: op = TEXT("!({0} && {1})"); break; default: - CRASH; + CRASH; return; } value = writeLocal(ValueType::Bool, String::Format(op, a.Value, b.Value), node); @@ -842,7 +842,7 @@ void ShaderGenerator::ProcessGroupBitwise(Box* box, Node* node, Value& value) { switch (node->TypeID) { - // NOT + // NOT case 1: { // Get A value @@ -852,7 +852,7 @@ void ShaderGenerator::ProcessGroupBitwise(Box* box, Node* node, Value& value) value = writeLocal(ValueType::Int, String::Format(TEXT("!{0}"), a.Value), node); break; } - // AND, OR, XOR + // AND, OR, XOR case 2: case 3: case 4: @@ -865,20 +865,20 @@ void ShaderGenerator::ProcessGroupBitwise(Box* box, Node* node, Value& value) const Char* op; switch (node->TypeID) { - // AND + // AND case 2: op = TEXT("{0} & {1}"); break; - // OR + // OR case 3: op = TEXT("{0} | {1}"); break; - // XOR + // XOR case 4: op = TEXT("{0} ^ {1}"); break; default: - CRASH; + CRASH; return; } value = writeLocal(ValueType::Int, String::Format(op, a.Value, b.Value), node); @@ -893,7 +893,7 @@ void ShaderGenerator::ProcessGroupComparisons(Box* box, Node* node, Value& value { switch (node->TypeID) { - // ==, !=, >, <=, >= + // ==, !=, >, <=, >= case 1: case 2: case 3: @@ -928,13 +928,13 @@ void ShaderGenerator::ProcessGroupComparisons(Box* box, Node* node, Value& value op = TEXT("{0} >= {1}"); break; default: - CRASH; + CRASH; return; } value = writeLocal(ValueType::Bool, String::Format(op, a.Value, b.Value), node); break; } - // Switch On Bool + // Switch On Bool case 7: { const Value condition = tryGetValue(node->GetBox(0), Value::False).AsBool(); @@ -1114,7 +1114,7 @@ ShaderGenerator::Value ShaderGenerator::writeLocal(ValueType type, const String& ShaderGenerator::Value ShaderGenerator::writeOperation2(Node* caller, const Value& valueA, const Value& valueB, Char op1) { - const Char op1Str[2] = { op1, 0}; + const Char op1Str[2] = { op1, 0 }; const String value = String::Format(TEXT("{0} {1} {2}"), valueA.Value, op1Str, Value::Cast(valueB, valueA.Type).Value); return writeLocal(valueA.Type, value, caller); } diff --git a/Source/Engine/Visject/ShaderGraph.h b/Source/Engine/Visject/ShaderGraph.h index c4ce62a05..9708fdead 100644 --- a/Source/Engine/Visject/ShaderGraph.h +++ b/Source/Engine/Visject/ShaderGraph.h @@ -23,14 +23,12 @@ class ShaderGraphNode; class ShaderGraphBox : public GraphBox { public: - /// /// The cached value. /// ShaderGraphValue Cache; public: - ShaderGraphBox() : GraphBox() { @@ -47,7 +45,6 @@ public: } public: - FORCE_INLINE ShaderGraphBox* FirstConnection() const { return (ShaderGraphBox*)Connections[0]; @@ -58,7 +55,6 @@ template class ShaderGraphNode : public GraphNode { public: - struct CurveData { /// @@ -79,14 +75,12 @@ public: }; public: - ShaderGraphNode() : GraphNode() { } public: - /// /// The custom data (depends on node type). Used to cache data for faster usage at runtime. /// @@ -96,7 +90,6 @@ public: class ShaderGraphParameter : public GraphParameter { public: - ShaderGraphParameter() : GraphParameter(SpawnParams(Guid::New(), TypeInitializer)) { @@ -123,12 +116,10 @@ template, class BoxType = ShaderGraphBox, cla class ShaderGraph : public Graph { public: - typedef ShaderGraphValue Value; typedef Graph Base; public: - /// /// The float curves used by the graph. /// @@ -150,18 +141,17 @@ public: Array> Float4Curves; public: - // [Graph] bool onNodeLoaded(NodeType* n) override { // Check if this node needs a state or data cache switch (n->GroupID) { - // Tools + // Tools case 7: switch (n->TypeID) { - // Curves + // Curves #define SETUP_CURVE(id, curves, access) \ case id: \ { \ @@ -201,7 +191,6 @@ public: class ShaderGenerator { public: - typedef ShaderGraph<> Graph; typedef ShaderGraph<>::Node Node; typedef ShaderGraph<>::Box Box; @@ -212,7 +201,6 @@ public: typedef Function ProcessBoxHandler; protected: - int32 _localIndex; Dictionary _functions; Array _parameters; @@ -223,7 +211,6 @@ protected: Array> _graphStack; public: - /// /// Initializes a new instance of the class. /// @@ -235,7 +222,6 @@ public: ~ShaderGenerator(); public: - ErrorHandler Error; /// @@ -244,7 +230,6 @@ public: AssetsContainer Assets; public: - void OnError(Node* node, Box* box, const StringView& message); void ProcessGroupConstants(Box* box, Node* node, Value& value); @@ -256,12 +241,10 @@ public: void ProcessGroupComparisons(Box* box, Node* node, Value& value); protected: - static const Char* _mathFunctions[]; static const Char* _subs[]; protected: - Value eatBox(Node* caller, Box* box); Value tryGetValue(Box* box, int32 defaultValueBoxIndex, const Value& defaultValue); Value tryGetValue(Box* box, const Value& defaultValue); diff --git a/Source/Engine/Visject/ShaderGraphValue.h b/Source/Engine/Visject/ShaderGraphValue.h index 79f53ab8c..d6cd89730 100644 --- a/Source/Engine/Visject/ShaderGraphValue.h +++ b/Source/Engine/Visject/ShaderGraphValue.h @@ -12,11 +12,9 @@ struct ShaderGraphValue : Object { private: - static const Char* _subs[]; public: - /// /// The value type. /// @@ -28,7 +26,6 @@ public: String Value; public: - /// /// Zero value (as float). /// @@ -55,7 +52,6 @@ public: static const ShaderGraphValue False; public: - /// /// Initializes a new instance of the struct. /// @@ -134,7 +130,6 @@ public: explicit ShaderGraphValue(const Variant& v); public: - /// /// Returns true if value is valid. /// @@ -175,7 +170,6 @@ public: } public: - /// /// Formats thw value. /// @@ -227,7 +221,6 @@ public: } public: - /// /// Initializes the shader variable for given connection type Zero. /// @@ -301,7 +294,6 @@ public: } public: - /// /// Gets the X component of the value. Valid only for single or vector types. /// @@ -339,7 +331,6 @@ public: } public: - /// /// Casts the value to the bool type. /// @@ -422,7 +413,6 @@ public: static ShaderGraphValue Cast(const ShaderGraphValue& v, VariantType::Types to); public: - // [Object] String ToString() const override { diff --git a/Source/Engine/Visject/VisjectGraph.cpp b/Source/Engine/Visject/VisjectGraph.cpp index 5535387f7..5f14d99de 100644 --- a/Source/Engine/Visject/VisjectGraph.cpp +++ b/Source/Engine/Visject/VisjectGraph.cpp @@ -51,7 +51,7 @@ void VisjectExecutor::ProcessGroupConstants(Box* box, Node* node, Value& value) { switch (node->TypeID) { - // Constant value + // Constant value case 1: case 2: case 3: @@ -89,15 +89,15 @@ void VisjectExecutor::ProcessGroupConstants(Box* box, Node* node, Value& value) case 9: value = node->Values[0]; break; - // PI + // PI case 10: value = PI; break; - // Enum + // Enum case 11: value = node->Values[0]; break; - // Array + // Array case 13: value = node->Values[0]; if (value.Type.Type == VariantType::Array) @@ -152,7 +152,7 @@ void VisjectExecutor::ProcessGroupMath(Box* box, Node* node, Value& value) { switch (node->TypeID) { - // Add, Subtract, Multiply, Divide, Modulo, Max, Min, Pow, Fmod, Atan2 + // Add, Subtract, Multiply, Divide, Modulo, Max, Min, Pow, Fmod, Atan2 case 1: case 2: case 3: @@ -174,7 +174,7 @@ void VisjectExecutor::ProcessGroupMath(Box* box, Node* node, Value& value) GraphUtilities::ApplySomeMathHere(node->TypeID, value, v1, v2); break; } - // Absolute Value, Ceil, Cosine, Floor, Round, Saturate, Sine, Sqrt, Tangent, Negate, 1 - Value, Asine, Acosine, Atan, Trunc, Frac, Degrees, Radians + // Absolute Value, Ceil, Cosine, Floor, Round, Saturate, Sine, Sqrt, Tangent, Negate, 1 - Value, Asine, Acosine, Atan, Trunc, Frac, Degrees, Radians case 7: case 8: case 9: @@ -198,7 +198,7 @@ void VisjectExecutor::ProcessGroupMath(Box* box, Node* node, Value& value) GraphUtilities::ApplySomeMathHere(node->TypeID, value, v1); break; } - // Length, Normalize + // Length, Normalize case 11: case 12: { @@ -269,7 +269,7 @@ void VisjectExecutor::ProcessGroupMath(Box* box, Node* node, Value& value) } break; } - // Cross, Distance, Dot + // Cross, Distance, Dot case 18: case 19: case 20: @@ -346,7 +346,7 @@ void VisjectExecutor::ProcessGroupMath(Box* box, Node* node, Value& value) } break; } - // Clamp + // Clamp case 24: { Value v1 = tryGetValue(node->GetBox(0), Value::Zero); @@ -358,7 +358,7 @@ void VisjectExecutor::ProcessGroupMath(Box* box, Node* node, Value& value) }); break; } - // Lerp + // Lerp case 25: { Value a = tryGetValue(node->GetBox(0), 0, Value::Zero); @@ -367,7 +367,7 @@ void VisjectExecutor::ProcessGroupMath(Box* box, Node* node, Value& value) value = Value::Lerp(a, b, alpha.AsFloat); break; } - // Reflect + // Reflect case 26: { Value v1 = tryGetValue(node->GetBox(0), Value::Zero); @@ -388,7 +388,7 @@ void VisjectExecutor::ProcessGroupMath(Box* box, Node* node, Value& value) } break; } - // Mad + // Mad case 31: { Value v1 = tryGetValue(node->GetBox(0), Value::Zero); @@ -400,14 +400,14 @@ void VisjectExecutor::ProcessGroupMath(Box* box, Node* node, Value& value) }); break; } - // Extract Largest Component + // Extract Largest Component case 32: { const auto v1 = (Float3)tryGetValue(node->GetBox(0), Value::Zero); value = Math::ExtractLargestComponent(v1); break; } - // Bias and Scale + // Bias and Scale case 36: { ASSERT(node->Values.Count() == 2 && node->Values[0].Type == VariantType::Float && node->Values[1].Type == VariantType::Float); @@ -417,7 +417,7 @@ void VisjectExecutor::ProcessGroupMath(Box* box, Node* node, Value& value) value = (input + bias) * scale; break; } - // Rotate About Axis + // Rotate About Axis case 37: { const auto normalizedRotationAxis = (Float3)tryGetValue(node->GetBox(0), Value::Zero); @@ -427,7 +427,7 @@ void VisjectExecutor::ProcessGroupMath(Box* box, Node* node, Value& value) value = Math::RotateAboutAxis(normalizedRotationAxis, rotationAngle, pivotPoint, position); break; } - // Near Equal + // Near Equal case 42: { const Value a = tryGetValue(node->GetBox(0), node->Values[0]); @@ -436,23 +436,23 @@ void VisjectExecutor::ProcessGroupMath(Box* box, Node* node, Value& value) value = Value::NearEqual(a, b, epsilon); break; } - // Enum Value + // Enum Value case 45: value = (uint64)tryGetValue(node->GetBox(0), Value::Zero); break; - // Enum AND + // Enum AND case 46: value = tryGetValue(node->GetBox(0), Value::Zero); if (value.Type.Type == VariantType::Enum) value.AsUint64 = value.AsUint64 & (uint64)tryGetValue(node->GetBox(1), Value::Zero); break; - // Enum OR + // Enum OR case 47: value = tryGetValue(node->GetBox(0), Value::Zero); if (value.Type.Type == VariantType::Enum) value.AsUint64 = value.AsUint64 | (uint64)tryGetValue(node->GetBox(1), Value::Zero); break; - // Remap + // Remap case 48: { const float inVal = tryGetValue(node->GetBox(0), node->Values[0]).AsFloat; @@ -463,7 +463,7 @@ void VisjectExecutor::ProcessGroupMath(Box* box, Node* node, Value& value) value = clamp ? Math::Clamp(mapFunc, rangeB.X, rangeB.Y) : mapFunc; break; } - // Rotate Vector + // Rotate Vector case 49: { const Quaternion quaternion = (Quaternion)tryGetValue(node->GetBox(0), Quaternion::Identity); @@ -480,7 +480,7 @@ void VisjectExecutor::ProcessGroupPacking(Box* box, Node* node, Value& value) { switch (node->TypeID) { - // Pack + // Pack case 20: { float vX = (float)tryGetValue(node->GetBox(1), node->Values[0]); @@ -528,7 +528,7 @@ void VisjectExecutor::ProcessGroupPacking(Box* box, Node* node, Value& value) value = Variant(BoundingBox(vX, vY)); break; } - // Unpack + // Unpack case 30: { Float2 v = (Float2)tryGetValue(node->GetBox(0), Float2::Zero); @@ -592,7 +592,7 @@ void VisjectExecutor::ProcessGroupPacking(Box* box, Node* node, Value& value) } break; } - // Pack Structure + // Pack Structure case 26: { // Find type @@ -675,7 +675,7 @@ void VisjectExecutor::ProcessGroupPacking(Box* box, Node* node, Value& value) } break; } - // Unpack Structure + // Unpack Structure case 36: { // Get value with structure data @@ -765,7 +765,7 @@ void VisjectExecutor::ProcessGroupPacking(Box* box, Node* node, Value& value) } break; } - // Mask X, Y, Z, W + // Mask X, Y, Z, W case 40: case 41: case 42: @@ -775,7 +775,7 @@ void VisjectExecutor::ProcessGroupPacking(Box* box, Node* node, Value& value) value = v.Raw[node->TypeID - 40]; break; } - // Mask XY, YZ, XZ,... + // Mask XY, YZ, XZ,... case 44: { value = (Float2)tryGetValue(node->GetBox(0), Float2::Zero); @@ -799,13 +799,13 @@ void VisjectExecutor::ProcessGroupPacking(Box* box, Node* node, Value& value) value = Float2(v.Z, v.W); break; } - // Mask XYZ + // Mask XYZ case 70: { value = (Float3)tryGetValue(node->GetBox(0), Float3::Zero); break; } - // Append + // Append case 100: { auto in0 = node->GetBox(0); @@ -860,7 +860,7 @@ void VisjectExecutor::ProcessGroupTools(Box* box, Node* node, Value& value) { switch (node->TypeID) { - // Color Gradient + // Color Gradient case 10: { float time, prevTime, curTime; @@ -916,7 +916,7 @@ void VisjectExecutor::ProcessGroupTools(Box* box, Node* node, Value& value) } break; } - // Curve + // Curve #define SAMPLE_CURVE(id, curves, type, graphType) \ case id: \ { \ @@ -931,7 +931,7 @@ void VisjectExecutor::ProcessGroupTools(Box* box, Node* node, Value& value) SAMPLE_CURVE(14, Float3Curves, Float3, Float3) SAMPLE_CURVE(15, Float4Curves, Float4, Float4) #undef SETUP_CURVE - // Get Gameplay Global + // Get Gameplay Global case 16: if (const auto asset = node->Assets[0].As()) { @@ -944,7 +944,7 @@ void VisjectExecutor::ProcessGroupTools(Box* box, Node* node, Value& value) value = Value::Zero; } break; - // Platform Switch + // Platform Switch case 17: { int32 boxId = 1; @@ -985,19 +985,19 @@ void VisjectExecutor::ProcessGroupTools(Box* box, Node* node, Value& value) value = tryGetValue(node->GetBox(node->GetBox(boxId)->HasConnection() ? boxId : 1), Value::Zero); break; } - // Asset Reference + // Asset Reference case 18: value = ::LoadAsset((Guid)node->Values[0], Asset::TypeInitializer); break; - // To String + // To String case 20: value.SetString(tryGetValue(node->GetBox(1), Value(StringView::Empty)).ToString()); break; - // Actor Reference + // Actor Reference case 21: value = Scripting::FindObject((Guid)node->Values[0]); break; - // As + // As case 22: { value = Value::Null; @@ -1013,7 +1013,7 @@ void VisjectExecutor::ProcessGroupTools(Box* box, Node* node, Value& value) } break; } - // Type Reference node + // Type Reference node case 23: { const StringView typeName(node->Values[0]); @@ -1023,7 +1023,7 @@ void VisjectExecutor::ProcessGroupTools(Box* box, Node* node, Value& value) value = typeName; break; } - // Is + // Is case 24: { value = Value::False; @@ -1038,15 +1038,15 @@ void VisjectExecutor::ProcessGroupTools(Box* box, Node* node, Value& value) } break; } - // Is Null + // Is Null case 27: value = (void*)tryGetValue(node->GetBox(1), Value::Null) == nullptr; break; - // Is Valid + // Is Valid case 28: value = (void*)tryGetValue(node->GetBox(1), Value::Null) != nullptr; break; - // Reroute + // Reroute case 29: value = tryGetValue(node->GetBox(0), Value::Zero); break; @@ -1059,14 +1059,14 @@ void VisjectExecutor::ProcessGroupBoolean(Box* box, Node* node, Value& value) { switch (node->TypeID) { - // NOT + // NOT case 1: { const bool a = (bool)tryGetValue(node->GetBox(0), Value::False); value = !a; break; } - // AND, OR, XOR, NOR, NAND + // AND, OR, XOR, NOR, NAND case 2: case 3: case 4: @@ -1078,23 +1078,23 @@ void VisjectExecutor::ProcessGroupBoolean(Box* box, Node* node, Value& value) bool result = false; switch (node->TypeID) { - // AND + // AND case 2: result = a && b; break; - // OR + // OR case 3: result = a || b; break; - // XOR + // XOR case 4: result = !a != !b; break; - // NOR + // NOR case 5: result = !(a || b); break; - // NAND + // NAND case 6: result = !(a && b); break; @@ -1111,14 +1111,14 @@ void VisjectExecutor::ProcessGroupBitwise(Box* box, Node* node, Value& value) { switch (node->TypeID) { - // NOT + // NOT case 1: { const int32 a = (int32)tryGetValue(node->GetBox(0), Value(0)); value = !a; break; } - // AND, OR, XOR + // AND, OR, XOR case 2: case 3: case 4: @@ -1128,15 +1128,15 @@ void VisjectExecutor::ProcessGroupBitwise(Box* box, Node* node, Value& value) int32 result = 0; switch (node->TypeID) { - // AND + // AND case 2: result = a & b; break; - // OR + // OR case 3: result = a | b; break; - // XOR + // XOR case 4: result = a ^ b; break; @@ -1153,7 +1153,7 @@ void VisjectExecutor::ProcessGroupComparisons(Box* box, Node* node, Value& value { switch (node->TypeID) { - // ==, !=, >, <=, >= + // ==, !=, >, <=, >= case 1: case 2: case 3: @@ -1188,7 +1188,7 @@ void VisjectExecutor::ProcessGroupComparisons(Box* box, Node* node, Value& value value = result; break; } - // Switch On Bool + // Switch On Bool case 7: { const Value condition = tryGetValue(node->GetBox(0), Value::False); @@ -1198,7 +1198,7 @@ void VisjectExecutor::ProcessGroupComparisons(Box* box, Node* node, Value& value value = tryGetValue(node->GetBox(1), 0, Value::Zero); break; } - // Switch On Enum + // Switch On Enum case 8: { const Value v = tryGetValue(node->GetBox(0), Value::Null); @@ -1227,31 +1227,31 @@ void VisjectExecutor::ProcessGroupParticles(Box* box, Node* node, Value& value) { switch (node->TypeID) { - // Random Float + // Random Float case 208: { value = RAND; break; } - // Random Vector2 + // Random Vector2 case 209: { value = Float2(RAND, RAND); break; } - // Random Vector3 + // Random Vector3 case 210: { value = Float3(RAND, RAND, RAND); break; } - // Random Vector4 + // Random Vector4 case 211: { value = Float4(RAND, RAND, RAND, RAND); break; } - // Random Float Range + // Random Float Range case 213: { auto& a = node->Values[0].AsFloat; @@ -1259,7 +1259,7 @@ void VisjectExecutor::ProcessGroupParticles(Box* box, Node* node, Value& value) value = Math::Lerp(a, b, RAND); break; } - // Random Vector2 Range + // Random Vector2 Range case 214: { auto a = (Float2)node->Values[0]; @@ -1270,7 +1270,7 @@ void VisjectExecutor::ProcessGroupParticles(Box* box, Node* node, Value& value) ); break; } - // Random Vector3 Range + // Random Vector3 Range case 215: { auto a = (Float3)node->Values[0]; @@ -1282,7 +1282,7 @@ void VisjectExecutor::ProcessGroupParticles(Box* box, Node* node, Value& value) ); break; } - // Random Vector4 Range + // Random Vector4 Range case 216: { auto a = (Float4)node->Values[0]; @@ -1313,39 +1313,39 @@ void VisjectExecutor::ProcessGroupCollections(Box* box, Node* node, Value& value Box* b; switch (node->TypeID) { - // Count + // Count case 1: value = array.Count(); break; - // Contains + // Contains case 2: value = array.Contains(tryGetValue(node->GetBox(1), Value::Null)); break; - // Find + // Find case 3: b = node->GetBox(1); ENSURE(b->HasConnection(), TEXT("Missing value to find.")); value = array.Find(eatBox(b->GetParent(), b->FirstConnection())); break; - // Find Last + // Find Last case 4: b = node->GetBox(1); ENSURE(b->HasConnection(), TEXT("Missing value to find.")); value = array.FindLast(eatBox(b->GetParent(), b->FirstConnection())); break; - // Clear + // Clear case 5: array.Clear(); value = MoveTemp(v); break; - // Remove + // Remove case 6: b = node->GetBox(1); ENSURE(b->HasConnection(), TEXT("Missing value to remove.")); array.Remove(eatBox(b->GetParent(), b->FirstConnection())); value = MoveTemp(v); break; - // Remove At + // Remove At case 7: { const int32 index = (int32)tryGetValue(node->GetBox(1), 0, Value::Null); @@ -1354,14 +1354,14 @@ void VisjectExecutor::ProcessGroupCollections(Box* box, Node* node, Value& value value = MoveTemp(v); break; } - // Add + // Add case 8: b = node->GetBox(1); ENSURE(b->HasConnection(), TEXT("Missing value to add.")); array.Add(eatBox(b->GetParent(), b->FirstConnection())); value = MoveTemp(v); break; - // Insert + // Insert case 9: { b = node->GetBox(1); @@ -1372,7 +1372,7 @@ void VisjectExecutor::ProcessGroupCollections(Box* box, Node* node, Value& value value = MoveTemp(v); break; } - // Get + // Get case 10: { const int32 index = (int32)tryGetValue(node->GetBox(1), 0, Value::Null); @@ -1380,7 +1380,7 @@ void VisjectExecutor::ProcessGroupCollections(Box* box, Node* node, Value& value value = MoveTemp(array[index]); break; } - // Set + // Set case 11: { b = node->GetBox(2); @@ -1391,17 +1391,17 @@ void VisjectExecutor::ProcessGroupCollections(Box* box, Node* node, Value& value value = MoveTemp(v); break; } - // Sort + // Sort case 12: Sorting::QuickSort(array.Get(), array.Count()); value = MoveTemp(v); break; - // Reverse + // Reverse case 13: array.Reverse(); value = MoveTemp(v); break; - // Add Unique + // Add Unique case 14: b = node->GetBox(1); ENSURE(b->HasConnection(), TEXT("Missing value to add.")); diff --git a/Source/Engine/Visject/VisjectGraph.h b/Source/Engine/Visject/VisjectGraph.h index 845ee9106..6e2c338b1 100644 --- a/Source/Engine/Visject/VisjectGraph.h +++ b/Source/Engine/Visject/VisjectGraph.h @@ -19,7 +19,6 @@ class VisjectGraphNode; class VisjectGraphBox : public GraphBox { public: - VisjectGraphBox() : GraphBox() { @@ -45,7 +44,6 @@ template class VisjectGraphNode : public GraphNode { public: - struct CurveData { /// @@ -82,14 +80,12 @@ public: }; public: - VisjectGraphNode() : GraphNode() { } public: - /// /// The custom data (depends on node type). Used to cache data for faster usage at runtime. /// @@ -107,9 +103,8 @@ public: /// API_CLASS() class VisjectGraphParameter : public GraphParameter { -DECLARE_SCRIPTING_TYPE_WITH_CONSTRUCTOR_IMPL(VisjectGraphParameter, GraphParameter); + DECLARE_SCRIPTING_TYPE_WITH_CONSTRUCTOR_IMPL(VisjectGraphParameter, GraphParameter); public: - VisjectGraphParameter(const VisjectGraphParameter& other) : VisjectGraphParameter() { @@ -136,7 +131,6 @@ public: typedef Graph Base; public: - /// /// The float curves used by the graph. /// @@ -158,17 +152,16 @@ public: Array> Float4Curves; public: - // [Graph] bool onNodeLoaded(NodeType* n) override { switch (n->GroupID) { - // Tools + // Tools case 7: switch (n->TypeID) { - // Curves + // Curves #define SETUP_CURVE(id, curves, access) \ case id: \ { \ @@ -193,7 +186,7 @@ public: SETUP_CURVE(14, Float3Curves, AsFloat3()) SETUP_CURVE(15, Float4Curves, AsFloat4()) #undef SETUP_CURVE - // Get Gameplay Global + // Get Gameplay Global case 16: { n->Assets[0] = ::LoadAsset((Guid)n->Values[0], Asset::TypeInitializer); @@ -223,11 +216,9 @@ public: typedef void (VisjectExecutor::*ProcessBoxHandler)(Box*, Node*, Value&); protected: - ProcessBoxHandler _perGroupProcessCall[19]; public: - /// /// Initializes a new instance of the class. /// @@ -239,11 +230,9 @@ public: ~VisjectExecutor(); public: - ErrorHandler Error; public: - virtual void OnError(Node* node, Box* box, const StringView& message); void ProcessGroupConstants(Box* box, Node* node, Value& value); @@ -257,7 +246,6 @@ public: void ProcessGroupCollections(Box* box, Node* node, Value& value); protected: - virtual Value eatBox(Node* caller, Box* box) = 0; virtual Graph* GetCurrentGraph() const = 0; diff --git a/Source/Engine/Visject/VisjectMeta.h b/Source/Engine/Visject/VisjectMeta.h index 17e6fc497..08a40b299 100644 --- a/Source/Engine/Visject/VisjectMeta.h +++ b/Source/Engine/Visject/VisjectMeta.h @@ -11,7 +11,6 @@ class VisjectMeta { public: - /// /// Metadata entry /// @@ -23,14 +22,12 @@ public: }; public: - /// /// All meta entries /// Array> Entries; public: - /// /// Initializes a new instance of the class. /// @@ -44,7 +41,6 @@ public: } public: - /// /// Load from the stream ///