@@ -275,8 +275,8 @@ public SystemBuilder orderBy(long componentId, ComparatorId comparator) {
275275
276276 public <T > SystemBuilder orderBy (long componentId , ComparatorComponent <T > comparator ) {
277277 Component <T > component = this .world .componentRegistry ().getComponentById (componentId );
278- MemorySegment callbackStub = ecs_order_by_action_t .allocate ((_ , componentASeg , _ , componentBSeg ) ->
279- comparator .compare (component .read (componentASeg , 0 ), component .read (componentBSeg , 0 )), this .world .arena ());
278+ MemorySegment callbackStub = ecs_order_by_action_t .allocate ((_ , componentAdressA , _ , componentAdressB ) ->
279+ comparator .compare (component .read (MemorySegment . ofAddress ( componentAdressA ) , 0 ), component .read (MemorySegment . ofAddress ( componentAdressB ) , 0 )), this .world .arena ());
280280
281281 MemorySegment queryDescSeg = ecs_system_desc_t .query (this .desc );
282282 ecs_query_desc_t .order_by_callback (queryDescSeg , callbackStub );
@@ -287,11 +287,11 @@ public <T> SystemBuilder orderBy(long componentId, ComparatorComponent<T> compar
287287 @ SuppressWarnings ("unchecked" )
288288 public <V extends ComponentView > SystemBuilder orderBy (long componentId , ComparatorComponentView <V > comparator ) {
289289 Class <?> componentClass = this .world .componentRegistry ().getComponentClassById (componentId );
290- MemorySegment callbackStub = ecs_order_by_action_t .allocate ((_ , componentASeg , _ , componentBSeg ) -> {
290+ MemorySegment callbackStub = ecs_order_by_action_t .allocate ((_ , componentAdressA , _ , componentAdressB ) -> {
291291 V componentViewA = (V ) this .world .viewCache ().getComponentView (componentClass );
292- componentViewA .setBaseAddress (componentASeg . address () );
292+ componentViewA .setBaseAddress (componentAdressA );
293293 V componentViewB = (V ) this .world .viewCache ().getComponentView (componentClass );
294- componentViewB .setBaseAddress (componentBSeg . address () );
294+ componentViewB .setBaseAddress (componentAdressB );
295295 return comparator .compare (componentViewA , componentViewB );
296296 }, this .world .arena ());
297297
0 commit comments