Skip to content

Commit 6387c44

Browse files
authored
UPM package version 3.4.1
1 parent 9a546a0 commit 6387c44

20 files changed

+212
-191
lines changed

CHANGELOG.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Changelog
1+
# Svelto.ECS Changelog
22
All notable changes to this project will be documented in this file. Changes are listed in random order of importance.
33

4-
## [3.4.0] - 03-2023
5-
~~~~
4+
## [3.4.1] - 03-2023
5+
66
* removed static caches used in performance critical paths as they were causing unexpected performance issues (the fetching of static data is slower than i imagined)
77
* add Native prefix in front of the native memory utilities method names
88
* largely improved the console logger system
@@ -18,7 +18,7 @@ All notable changes to this project will be documented in this file. Changes are
1818
* Fix reported bugs
1919
* Minor Svelto Dictionary improvements
2020
* Added ValueContainer, a simple int, Tvalue dictionary based on sparse set. It has very specific use cases at the moment. Mainly to be used for the new ECS OOP Abstraction resoruce manager
21-
21+
* Added IReactOnSubmissionStarted interface
2222

2323
## [3.3.2] - 04-06-2022
2424

Core/CheckEntityUtilities.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ void RemoveGroupID(ExclusiveBuildGroup groupID)
8585
#if DONT_USE
8686
[Conditional("MEANINGLESS")]
8787
#endif
88-
void ClearDebugChecks() { _multipleOperationOnSameEGIDChecker.Clear(); }
88+
void ClearChecksForMultipleOperationsOnTheSameEgid() { _multipleOperationOnSameEGIDChecker.Clear(); }
8989

90-
readonly Svelto.DataStructures.FasterDictionary<EGID, uint> _multipleOperationOnSameEGIDChecker;
91-
readonly Svelto.DataStructures.FasterDictionary<ExclusiveGroupStruct, HashSet<uint>> _idChecker;
90+
readonly DataStructures.FasterDictionary<EGID, uint> _multipleOperationOnSameEGIDChecker;
91+
readonly DataStructures.FasterDictionary<ExclusiveGroupStruct, HashSet<uint>> _idChecker;
9292
}
9393
}

Core/ComponentBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ static void Init()
4848
{
4949
id.Data = Interlocked.Increment(ref BurstCompatibleCounter.counter);
5050

51-
DBC.ECS.Check.Ensure(id.Data < ushort.MaxValue, "too many types registered, HOW :)");
51+
Check.Ensure(id.Data < ushort.MaxValue, "too many types registered, HOW :)");
5252
}
5353
}
5454

Core/DBC.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ public static void Assert(bool assertion)
224224
#endregion // Implementation
225225
} // End Check
226226

227-
internal class Trace
227+
class Trace
228228
{
229229
internal static void Assert(bool assertion, string v)
230230
{

Core/EGIDMapper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ public ref T Entity(uint entityID)
2525
{
2626
#if DEBUG && !PROFILE_SVELTO
2727
if (_map == null)
28-
throw new System.Exception(
28+
throw new Exception(
2929
"Not initialized EGIDMapper in this group ".FastConcat(typeof(T).ToString()));
3030
if (_map.TryFindIndex(entityID, out var findIndex) == false)
31-
throw new System.Exception("Entity not found in this group ".FastConcat(typeof(T).ToString()));
31+
throw new Exception("Entity not found in this group ".FastConcat(typeof(T).ToString()));
3232
#else
3333
_map.TryFindIndex(entityID, out var findIndex);
3434
#endif

Core/EnginesGroup/SortedEnginesGroup.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public abstract class SortedEnginesGroup<Interface, SequenceOrder> : IStepGroupE
4747
{
4848
protected SortedEnginesGroup(FasterList<Interface> engines)
4949
{
50-
_name = "SortedEnginesGroup - "+this.GetType().Name;
50+
_name = "SortedEnginesGroup - "+GetType().Name;
5151
_instancedSequence = new Sequence<Interface, SequenceOrder>(engines);
5252
}
5353

@@ -80,7 +80,7 @@ public abstract class SortedEnginesGroup<Interface, Parameter, SequenceOrder>: I
8080
{
8181
protected SortedEnginesGroup(FasterList<Interface> engines)
8282
{
83-
_name = "SortedEnginesGroup - "+this.GetType().Name;
83+
_name = "SortedEnginesGroup - "+GetType().Name;
8484
_instancedSequence = new Sequence<Interface, SequenceOrder>(engines);
8585
}
8686

Core/EnginesGroup/UnsortedEnginesGroup.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ public abstract class UnsortedEnginesGroup<Interface> : IStepGroupEngine
1515
{
1616
protected UnsortedEnginesGroup()
1717
{
18-
_name = "UnsortedEnginesGroup - "+this.GetType().Name;
18+
_name = "UnsortedEnginesGroup - "+GetType().Name;
1919
_instancedSequence = new FasterList<Interface>();
2020
}
2121

2222
protected UnsortedEnginesGroup(FasterList<Interface> engines)
2323
{
24-
_name = "UnsortedEnginesGroup - "+this.GetType().Name;
24+
_name = "UnsortedEnginesGroup - "+GetType().Name;
2525
_instancedSequence = engines;
2626
}
2727

@@ -59,13 +59,13 @@ public abstract class UnsortedEnginesGroup<Interface, Parameter> : IStepGroupEng
5959
{
6060
protected UnsortedEnginesGroup()
6161
{
62-
_name = "UnsortedEnginesGroup - "+this.GetType().Name;
62+
_name = "UnsortedEnginesGroup - "+GetType().Name;
6363
_instancedSequence = new FasterList<Interface>();
6464
}
6565

6666
protected UnsortedEnginesGroup(FasterList<Interface> engines)
6767
{
68-
_name = "UnsortedEnginesGroup - "+this.GetType().Name;
68+
_name = "UnsortedEnginesGroup - "+GetType().Name;
6969
_instancedSequence = engines;
7070
}
7171

Core/EnginesRoot.Engines.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ public readonly struct EntitiesSubmitter
330330
{
331331
public EntitiesSubmitter(EnginesRoot enginesRoot): this()
332332
{
333-
_enginesRoot = new Svelto.DataStructures.WeakReference<EnginesRoot>(enginesRoot);
333+
_enginesRoot = new DataStructures.WeakReference<EnginesRoot>(enginesRoot);
334334
}
335335

336336
internal void SubmitEntities()
@@ -360,7 +360,6 @@ internal void SubmitEntities()
360360
#if UNITY_NATIVE
361361
enginesRootTarget.FlushNativeOperations(profiler);
362362
#endif
363-
//todo: proper unit test structural changes made as result of add/remove callbacks
364363
while (enginesRootTarget.HasMadeNewStructuralChangesInThisIteration()
365364
&& iterations++ < MAX_SUBMISSION_ITERATIONS)
366365
{
@@ -385,7 +384,7 @@ internal void SubmitEntities()
385384
}
386385
}
387386

388-
readonly Svelto.DataStructures.WeakReference<EnginesRoot> _enginesRoot;
387+
readonly DataStructures.WeakReference<EnginesRoot> _enginesRoot;
389388
}
390389

391390
~EnginesRoot()

Core/EnginesRoot.GenericEntityFunctions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public void SwapEntityGroup<T>(EGID fromEGID, EGID toEGID, [CallerMemberName] st
104104
enginesRootTarget.CheckAddEntityID(toEGID, TypeCache<T>.type, caller);
105105

106106
enginesRootTarget.QueueSwapEntityOperation(fromEGID, toEGID
107-
, this._enginesRoot.Target.FindRealComponents<T>(fromEGID)
107+
, _enginesRoot.Target.FindRealComponents<T>(fromEGID)
108108
, caller);
109109
}
110110

Core/EnginesRoot.Submission.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ public partial class EnginesRoot
1111
[MethodImpl(MethodImplOptions.AggressiveInlining)]
1212
void SingleSubmission(PlatformProfiler profiler)
1313
{
14+
//clear the data checks before the submission. We want to allow structural changes inside the callbacks
15+
ClearChecksForMultipleOperationsOnTheSameEgid();
16+
1417
_entitiesOperations.ExecuteRemoveAndSwappingOperations(
1518
_swapEntities,
1619
_removeEntities,
@@ -19,8 +22,9 @@ void SingleSubmission(PlatformProfiler profiler)
1922
this);
2023

2124
AddEntities(profiler);
22-
23-
ClearDebugChecks(); //this must be done first as I need the carry the last states after the submission
25+
26+
//clear the data checks after the submission, so if structural changes happened inside the callback, the debug structure is reset for the next frame operations
27+
ClearChecksForMultipleOperationsOnTheSameEgid();
2428
}
2529

2630
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -476,7 +480,7 @@ void SwapEntitiesBetweenGroups(ExclusiveGroupStruct fromGroupId, ExclusiveGroupS
476480

477481
fromDictionary.AddEntitiesToDictionary(toDictionary, toGroupId
478482
#if SLOW_SVELTO_SUBMISSION
479-
, this.entityLocator
483+
, entityLocator
480484
#endif
481485
);
482486
}

0 commit comments

Comments
 (0)