Remove entity arms - bad idea

This commit is contained in:
2024-02-07 11:02:06 +01:00
parent 32caeeb995
commit 28ee6da17b
7 changed files with 1 additions and 123 deletions

View File

@@ -40,7 +40,6 @@ Vector2 entityGetCenter(Position position, HitBox hitBox) {
ecs_entity_t renderCollidersSystem;
ecs_entity_t renderOrientDirSystem;
ecs_entity_t renderArmPositionSystem;
ecs_entity_t renderDebugPathSystem;
ECS_DTOR(SpatialGridID, gridID, {
@@ -64,21 +63,6 @@ ECS_MOVE(Path, dst, src, {
*dst = *src;
})
ECS_DTOR(Arms, arms, {
if (arms->primary) {
ecs_delete(ECS, arms->primary);
arms->primary = 0;
}
if (arms->secondary) {
ecs_delete(ECS, arms->secondary);
arms->secondary = 0;
}
})
ECS_MOVE(Arms, dst, src, {
*dst = *src;
})
ECS_DTOR(Building, building, {
Vec2i pos = building->pos;
Vec2i size = building->size;
@@ -98,10 +82,6 @@ void setupSystems() {
.dtor = ecs_dtor(Path),
.move_dtor = ecs_move(Path)
});
ecs_set_hooks(ECS, Arms, {
.dtor = ecs_dtor(Arms),
.move_dtor = ecs_move(Arms)
});
ecs_set_hooks(ECS, Building, {
.dtor = ecs_dtor(Building),
.move_dtor = ecs_move(Building)
@@ -123,7 +103,6 @@ void setupSystems() {
ECS_SYSTEM(ECS, entityMoveToTarget, EcsOnUpdate, Position, Velocity, TargetPosition, Steering);
ECS_SYSTEM(ECS, entityFollowPath, EcsOnUpdate, Path);
ECS_SYSTEM(ECS, entityUpdateArms, EcsOnUpdate, Position, Velocity, Rotation, Orientation, Arms);
ECS_SYSTEM(ECS, resetHarvestCount, EcsOnUpdate, Harvestable);
ECS_SYSTEM(ECS, updateAISystem, EcsOnUpdate, BzBTState);
@@ -136,11 +115,9 @@ void setupSystems() {
ECS_SYSTEM(ECS, renderColliders, EcsOnUpdate, Position, HitBox);
ECS_SYSTEM(ECS, renderOrientationDirection, EcsOnUpdate, Position, Orientation);
ECS_SYSTEM(ECS, renderArmPosition, EcsOnUpdate, Position, Arm);
renderDebugPathSystem = renderDebugPath;
renderOrientDirSystem = renderOrientationDirection;
renderArmPositionSystem = renderArmPosition;
renderCollidersSystem = renderColliders;
//ecs_enable(ECS, renderOrientDirSystem, false);