From bb9cd555756f322c8329fe0da720fd9910487333 Mon Sep 17 00:00:00 2001 From: lawnjelly Date: Sat, 16 Mar 2024 16:50:47 +0000 Subject: [PATCH] Physics Interpolation 2D - change transform API to use const ref --- servers/rendering/rendering_server_canvas.cpp | 6 +++--- servers/rendering/rendering_server_canvas.h | 6 +++--- servers/rendering/rendering_server_raster.h | 6 +++--- servers/rendering/rendering_server_wrap_mt.h | 6 +++--- servers/rendering_server.h | 6 +++--- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/servers/rendering/rendering_server_canvas.cpp b/servers/rendering/rendering_server_canvas.cpp index 6bd291a6b..0a2b3f5af 100644 --- a/servers/rendering/rendering_server_canvas.cpp +++ b/servers/rendering/rendering_server_canvas.cpp @@ -1676,7 +1676,7 @@ void RenderingServerCanvas::canvas_item_set_skeleton_relative_xform(RID p_item, } // Useful especially for origin shifting. -void RenderingServerCanvas::canvas_item_transform_physics_interpolation(RID p_item, Transform2D p_transform) { +void RenderingServerCanvas::canvas_item_transform_physics_interpolation(RID p_item, const Transform2D &p_transform) { Item *canvas_item = canvas_item_owner.getornull(p_item); ERR_FAIL_COND(!canvas_item); canvas_item->xform_prev = p_transform * canvas_item->xform_prev; @@ -1707,7 +1707,7 @@ void RenderingServerCanvas::canvas_light_reset_physics_interpolation(RID p_light clight->xform_prev = clight->xform_curr; } -void RenderingServerCanvas::canvas_light_transform_physics_interpolation(RID p_light, Transform2D p_transform) { +void RenderingServerCanvas::canvas_light_transform_physics_interpolation(RID p_light, const Transform2D &p_transform) { RasterizerCanvas::Light *clight = canvas_light_owner.get(p_light); ERR_FAIL_COND(!clight); clight->xform_prev = p_transform * clight->xform_prev; @@ -1726,7 +1726,7 @@ void RenderingServerCanvas::canvas_light_occluder_reset_physics_interpolation(RI occluder->xform_prev = occluder->xform_curr; } -void RenderingServerCanvas::canvas_light_occluder_transform_physics_interpolation(RID p_occluder, Transform2D p_transform) { +void RenderingServerCanvas::canvas_light_occluder_transform_physics_interpolation(RID p_occluder, const Transform2D &p_transform) { RasterizerCanvas::LightOccluderInstance *occluder = canvas_light_occluder_owner.get(p_occluder); ERR_FAIL_COND(!occluder); occluder->xform_prev = p_transform * occluder->xform_prev; diff --git a/servers/rendering/rendering_server_canvas.h b/servers/rendering/rendering_server_canvas.h index e03b10429..7ef5480e6 100644 --- a/servers/rendering/rendering_server_canvas.h +++ b/servers/rendering/rendering_server_canvas.h @@ -268,7 +268,7 @@ public: void canvas_item_set_interpolated(RID p_item, bool p_interpolated); void canvas_item_reset_physics_interpolation(RID p_item); - void canvas_item_transform_physics_interpolation(RID p_item, Transform2D p_transform); + void canvas_item_transform_physics_interpolation(RID p_item, const Transform2D &p_transform); void _canvas_item_invalidate_local_bound(RID p_item); void _canvas_item_remove_references(RID p_item, RID p_rid); @@ -297,7 +297,7 @@ public: void canvas_light_set_interpolated(RID p_light, bool p_interpolated); void canvas_light_reset_physics_interpolation(RID p_light); - void canvas_light_transform_physics_interpolation(RID p_light, Transform2D p_transform); + void canvas_light_transform_physics_interpolation(RID p_light, const Transform2D &p_transform); RID canvas_light_occluder_create(); void canvas_light_occluder_attach_to_canvas(RID p_occluder, RID p_canvas); @@ -308,7 +308,7 @@ public: void canvas_light_occluder_set_interpolated(RID p_occluder, bool p_interpolated); void canvas_light_occluder_reset_physics_interpolation(RID p_occluder); - void canvas_light_occluder_transform_physics_interpolation(RID p_occluder, Transform2D p_transform); + void canvas_light_occluder_transform_physics_interpolation(RID p_occluder, const Transform2D &p_transform); RID canvas_occluder_polygon_create(); void canvas_occluder_polygon_set_shape(RID p_occluder_polygon, const PoolVector &p_shape, bool p_closed); diff --git a/servers/rendering/rendering_server_raster.h b/servers/rendering/rendering_server_raster.h index 53f16740d..4ab4b2ede 100644 --- a/servers/rendering/rendering_server_raster.h +++ b/servers/rendering/rendering_server_raster.h @@ -632,7 +632,7 @@ public: BIND2(canvas_item_set_interpolated, RID, bool) BIND1(canvas_item_reset_physics_interpolation, RID) - BIND2(canvas_item_transform_physics_interpolation, RID, Transform2D) + BIND2(canvas_item_transform_physics_interpolation, RID, const Transform2D &) BIND0R(RID, canvas_light_create) BIND2(canvas_light_attach_to_canvas, RID, RID) @@ -660,7 +660,7 @@ public: BIND2(canvas_light_set_interpolated, RID, bool) BIND1(canvas_light_reset_physics_interpolation, RID) - BIND2(canvas_light_transform_physics_interpolation, RID, Transform2D) + BIND2(canvas_light_transform_physics_interpolation, RID, const Transform2D &) BIND0R(RID, canvas_light_occluder_create) BIND2(canvas_light_occluder_attach_to_canvas, RID, RID) @@ -671,7 +671,7 @@ public: BIND2(canvas_light_occluder_set_interpolated, RID, bool) BIND1(canvas_light_occluder_reset_physics_interpolation, RID) - BIND2(canvas_light_occluder_transform_physics_interpolation, RID, Transform2D) + BIND2(canvas_light_occluder_transform_physics_interpolation, RID, const Transform2D &) BIND0R(RID, canvas_occluder_polygon_create) BIND3(canvas_occluder_polygon_set_shape, RID, const PoolVector &, bool) diff --git a/servers/rendering/rendering_server_wrap_mt.h b/servers/rendering/rendering_server_wrap_mt.h index 797566d2b..76f625681 100644 --- a/servers/rendering/rendering_server_wrap_mt.h +++ b/servers/rendering/rendering_server_wrap_mt.h @@ -539,7 +539,7 @@ public: FUNC2(canvas_item_set_interpolated, RID, bool) FUNC1(canvas_item_reset_physics_interpolation, RID) - FUNC2(canvas_item_transform_physics_interpolation, RID, Transform2D) + FUNC2(canvas_item_transform_physics_interpolation, RID, const Transform2D &) FUNC0R(RID, canvas_light_create) FUNC2(canvas_light_attach_to_canvas, RID, RID) @@ -567,7 +567,7 @@ public: FUNC2(canvas_light_set_interpolated, RID, bool) FUNC1(canvas_light_reset_physics_interpolation, RID) - FUNC2(canvas_light_transform_physics_interpolation, RID, Transform2D) + FUNC2(canvas_light_transform_physics_interpolation, RID, const Transform2D &) FUNCRID(canvas_light_occluder) FUNC2(canvas_light_occluder_attach_to_canvas, RID, RID) @@ -578,7 +578,7 @@ public: FUNC2(canvas_light_occluder_set_interpolated, RID, bool) FUNC1(canvas_light_occluder_reset_physics_interpolation, RID) - FUNC2(canvas_light_occluder_transform_physics_interpolation, RID, Transform2D) + FUNC2(canvas_light_occluder_transform_physics_interpolation, RID, const Transform2D &) FUNCRID(canvas_occluder_polygon) FUNC3(canvas_occluder_polygon_set_shape, RID, const PoolVector &, bool) diff --git a/servers/rendering_server.h b/servers/rendering_server.h index 733e38905..6f29b7826 100644 --- a/servers/rendering_server.h +++ b/servers/rendering_server.h @@ -972,7 +972,7 @@ public: virtual void canvas_item_set_interpolated(RID p_item, bool p_interpolated) = 0; virtual void canvas_item_reset_physics_interpolation(RID p_item) = 0; - virtual void canvas_item_transform_physics_interpolation(RID p_item, Transform2D p_transform) = 0; + virtual void canvas_item_transform_physics_interpolation(RID p_item, const Transform2D &p_transform) = 0; virtual RID canvas_light_create() = 0; virtual void canvas_light_attach_to_canvas(RID p_light, RID p_canvas) = 0; @@ -991,7 +991,7 @@ public: virtual void canvas_light_set_interpolated(RID p_light, bool p_interpolated) = 0; virtual void canvas_light_reset_physics_interpolation(RID p_light) = 0; - virtual void canvas_light_transform_physics_interpolation(RID p_light, Transform2D p_transform) = 0; + virtual void canvas_light_transform_physics_interpolation(RID p_light, const Transform2D &p_transform) = 0; enum CanvasLightMode { CANVAS_LIGHT_MODE_ADD, @@ -1027,7 +1027,7 @@ public: virtual void canvas_light_occluder_set_interpolated(RID p_occluder, bool p_interpolated) = 0; virtual void canvas_light_occluder_reset_physics_interpolation(RID p_occluder) = 0; - virtual void canvas_light_occluder_transform_physics_interpolation(RID p_occluder, Transform2D p_transform) = 0; + virtual void canvas_light_occluder_transform_physics_interpolation(RID p_occluder, const Transform2D &p_transform) = 0; virtual RID canvas_occluder_polygon_create() = 0; virtual void canvas_occluder_polygon_set_shape(RID p_occluder_polygon, const PoolVector &p_shape, bool p_closed) = 0;