File tree Expand file tree Collapse file tree 3 files changed +8
-18
lines changed
Expand file tree Collapse file tree 3 files changed +8
-18
lines changed Original file line number Diff line number Diff line change @@ -9393,9 +9393,9 @@ void flecs_cmd_batch_for_entity(
93939393 }
93949394 }
93959395
9396- int32_t index = (i >= 64) + (i >= 128) + (i >= 192);
9397- int32_t shift = i - 64 * index ;
9398- set_mask[index ] |= ( 1llu << shift );
9396+ ecs_assert (i < 256, ECS_UNSUPPORTED,
9397+ "cannot add more than 256 components in a single operation") ;
9398+ set_mask[i >> 6 ] |= 1llu << (i & 63 );
93999399
94009400 world->info.cmd.batched_command_count ++;
94019401 break;
@@ -13395,12 +13395,7 @@ void flecs_emit(
1339513395 if (set_mask && event == EcsOnAdd) {
1339613396 ecs_assert(i < 256, ECS_UNSUPPORTED,
1339713397 "cannot add more than 256 components in a single operation");
13398-
13399- int32_t index = (i >= 64) + (i >= 128) + (i >= 192);
13400- int32_t shift = i - 64 * index;
13401-
13402- ecs_flags64_t id_bit = 1llu << shift;
13403- if (id_bit & set_mask[index]) {
13398+ if (set_mask[i >> 6] & (1llu << (i & 63))) {
1340413399 /* Component is already set, so don't override with prefab value */
1340513400 id_can_override = false;
1340613401 }
Original file line number Diff line number Diff line change @@ -4907,9 +4907,9 @@ void flecs_cmd_batch_for_entity(
49074907 }
49084908 }
49094909
4910- int32_t index = (i >= 64 ) + ( i >= 128 ) + ( i >= 192 );
4911- int32_t shift = i - 64 * index ;
4912- set_mask [index ] |= ( 1llu << shift );
4910+ ecs_assert (i < 256 , ECS_UNSUPPORTED ,
4911+ "cannot add more than 256 components in a single operation" ) ;
4912+ set_mask [i >> 6 ] |= 1llu << ( i & 63 );
49134913
49144914 world -> info .cmd .batched_command_count ++ ;
49154915 break ;
Original file line number Diff line number Diff line change @@ -1273,12 +1273,7 @@ void flecs_emit(
12731273 if (set_mask && event == EcsOnAdd ) {
12741274 ecs_assert (i < 256 , ECS_UNSUPPORTED ,
12751275 "cannot add more than 256 components in a single operation" );
1276-
1277- int32_t index = (i >= 64 ) + (i >= 128 ) + (i >= 192 );
1278- int32_t shift = i - 64 * index ;
1279-
1280- ecs_flags64_t id_bit = 1llu << shift ;
1281- if (id_bit & set_mask [index ]) {
1276+ if (set_mask [i >> 6 ] & (1llu << (i & 63 ))) {
12821277 /* Component is already set, so don't override with prefab value */
12831278 id_can_override = false;
12841279 }
You can’t perform that action at this time.
0 commit comments