1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-12 13:20:55 +00:00

ObjectID converted to a structure, fixes many bugs where used incorrectly as 32 bits.

This commit is contained in:
Juan Linietsky
2020-02-12 14:24:06 -03:00
parent 4aa31a2851
commit cf8c679a23
89 changed files with 337 additions and 287 deletions

View File

@@ -374,7 +374,7 @@ ObjectID PhysicsServerSW::area_get_object_instance_id(RID p_area) const {
p_area = space->get_default_area()->get_self();
}
AreaSW *area = area_owner.getornull(p_area);
ERR_FAIL_COND_V(!area, 0);
ERR_FAIL_COND_V(!area, ObjectID());
return area->get_instance_id();
}
@@ -446,7 +446,7 @@ void PhysicsServerSW::area_set_monitor_callback(RID p_area, Object *p_receiver,
AreaSW *area = area_owner.getornull(p_area);
ERR_FAIL_COND(!area);
area->set_monitor_callback(p_receiver ? p_receiver->get_instance_id() : 0, p_method);
area->set_monitor_callback(p_receiver ? p_receiver->get_instance_id() : ObjectID(), p_method);
}
void PhysicsServerSW::area_set_ray_pickable(RID p_area, bool p_enable) {
@@ -470,7 +470,7 @@ void PhysicsServerSW::area_set_area_monitor_callback(RID p_area, Object *p_recei
AreaSW *area = area_owner.getornull(p_area);
ERR_FAIL_COND(!area);
area->set_area_monitor_callback(p_receiver ? p_receiver->get_instance_id() : 0, p_method);
area->set_area_monitor_callback(p_receiver ? p_receiver->get_instance_id() : ObjectID(), p_method);
}
/* BODY API */
@@ -665,7 +665,7 @@ uint32_t PhysicsServerSW::body_get_collision_mask(RID p_body) const {
return body->get_collision_mask();
}
void PhysicsServerSW::body_attach_object_instance_id(RID p_body, uint32_t p_id) {
void PhysicsServerSW::body_attach_object_instance_id(RID p_body, ObjectID p_id) {
BodySW *body = body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
@@ -673,10 +673,10 @@ void PhysicsServerSW::body_attach_object_instance_id(RID p_body, uint32_t p_id)
body->set_instance_id(p_id);
};
uint32_t PhysicsServerSW::body_get_object_instance_id(RID p_body) const {
ObjectID PhysicsServerSW::body_get_object_instance_id(RID p_body) const {
BodySW *body = body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, 0);
ERR_FAIL_COND_V(!body, ObjectID());
return body->get_instance_id();
};
@@ -934,7 +934,7 @@ void PhysicsServerSW::body_set_force_integration_callback(RID p_body, Object *p_
BodySW *body = body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
body->set_force_integration_callback(p_receiver ? p_receiver->get_instance_id() : ObjectID(0), p_method, p_udata);
body->set_force_integration_callback(p_receiver ? p_receiver->get_instance_id() : ObjectID(), p_method, p_udata);
}
void PhysicsServerSW::body_set_ray_pickable(RID p_body, bool p_enable) {