From 94d31ac327a8fe6ff7c007b34cb25772bf96d17e Mon Sep 17 00:00:00 2001 From: reduz Date: Thu, 17 Jun 2021 11:30:20 -0300 Subject: Implement animation slice drawing in CanvasItem * Added a function to ignore subsequent commands if they don't fall within the slice. * This will be used by the new TileMap to properly provide animated tiles. --- servers/rendering/renderer_canvas_render.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'servers/rendering/renderer_canvas_render.h') diff --git a/servers/rendering/renderer_canvas_render.h b/servers/rendering/renderer_canvas_render.h index 0266e137c0..c10b9db035 100644 --- a/servers/rendering/renderer_canvas_render.h +++ b/servers/rendering/renderer_canvas_render.h @@ -180,6 +180,7 @@ public: TYPE_PARTICLES, TYPE_TRANSFORM, TYPE_CLIP_IGNORE, + TYPE_ANIMATION_SLICE, }; Command *next; @@ -286,6 +287,17 @@ public: } }; + struct CommandAnimationSlice : public Command { + double animation_length = 0; + double slice_begin = 0; + double slice_end = 0; + double offset = 0; + + CommandAnimationSlice() { + type = TYPE_ANIMATION_SLICE; + } + }; + struct ViewportRender { RenderingServer *owner; void *udata; -- cgit v1.2.3