Skip to content

Commit ed8f0e9

Browse files
committed
Removing build warnings and fixed sort components
1 parent a8b3ddf commit ed8f0e9

3 files changed

Lines changed: 25 additions & 25 deletions

File tree

engine/core/ecs/SubSystem.h

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,32 +13,32 @@
1313

1414
namespace Supernova{
1515

16-
class Scene;
16+
class Scene;
1717

18-
class SUPERNOVA_API SubSystem {
18+
class SUPERNOVA_API SubSystem {
1919

20-
protected:
21-
Signature signature;
22-
Scene* scene;
23-
24-
public:
20+
protected:
21+
Signature signature;
22+
Scene* scene;
2523

26-
SubSystem(Scene* scene) {
27-
this->scene = scene;
28-
}
24+
public:
2925

30-
virtual void load() = 0;
26+
SubSystem(Scene* scene) {
27+
this->scene = scene;
28+
}
3129

32-
virtual void draw() = 0;
30+
virtual void load() = 0;
3331

34-
virtual void destroy() = 0;
35-
36-
virtual void update(double dt) = 0;
32+
virtual void draw() = 0;
3733

38-
virtual void onComponentAdded(Entity entity, ComponentId componentId) {}
39-
virtual void onComponentRemoved(Entity entity, ComponentId componentId) {}
40-
41-
};
34+
virtual void destroy() = 0;
35+
36+
virtual void update(double dt) = 0;
37+
38+
virtual void onComponentAdded(Entity entity, ComponentId componentId) { (void)entity; (void)componentId; }
39+
virtual void onComponentRemoved(Entity entity, ComponentId componentId) { (void)entity; (void)componentId; }
40+
41+
};
4242

4343
}
4444

engine/core/registry/EntityRegistry.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,9 @@ void EntityRegistry::sortComponentsByTransform(Signature entitySignature){
110110
}
111111

112112
// Lines component
113-
if (entitySignature.test(getComponentId<PointsComponent>())){
114-
auto points = componentManager.getComponentArray<PointsComponent>();
115-
points->sortByComponent<Transform>(componentManager.getComponentArray<Transform>());
113+
if (entitySignature.test(getComponentId<LinesComponent>())){
114+
auto lines = componentManager.getComponentArray<LinesComponent>();
115+
lines->sortByComponent<Transform>(componentManager.getComponentArray<Transform>());
116116
}
117117

118118
// Audio component

engine/core/registry/EntityRegistry.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ namespace Supernova {
6565
void changeTransformChildren(Entity entity);
6666

6767
protected:
68-
virtual void onComponentAdded(Entity entity, ComponentId componentId) {}
69-
virtual void onComponentRemoved(Entity entity, ComponentId componentId) {}
70-
virtual void onEntityDestroyed(Entity entity, Signature signature) {}
68+
virtual void onComponentAdded(Entity entity, ComponentId componentId) { (void)entity; (void)componentId; }
69+
virtual void onComponentRemoved(Entity entity, ComponentId componentId) { (void)entity; (void)componentId; }
70+
virtual void onEntityDestroyed(Entity entity, Signature signature) { (void)entity; (void)signature; }
7171

7272
public:
7373
EntityRegistry();

0 commit comments

Comments
 (0)