From f6fe40e125a99bd3ea47c476f6a95b6e820a51aa Mon Sep 17 00:00:00 2001 From: Matthew Kosarek Date: Wed, 13 Oct 2021 07:29:09 -0400 Subject: Adding square leaves to the tree --- themes/TreeShape.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'themes/TreeShape.h') diff --git a/themes/TreeShape.h b/themes/TreeShape.h index d7570da..06a8f81 100644 --- a/themes/TreeShape.h +++ b/themes/TreeShape.h @@ -33,6 +33,15 @@ struct TreeBranchLoadData { struct TreeBranchUpdateData { int32 tier = 0; float32 randomOffset = 0; + Renderer2dVertex* vertices = NULL; +}; + +struct TreeShapeLoadResult { + Vector2 lowerBounds; + Vector2 upperBounds; + Vector2 center; + TreeBranchUpdateData* updateData; + uint32 numBranches = 0; }; struct TreeShape { @@ -50,8 +59,10 @@ struct TreeShape { uint32 numVertices = 0; Mat4x4 model; - void load(Renderer2d* renderer); - void createBranch(TreeLoadData* ld, TreeBranchLoadData* branchList, int32 numBranches, int32* branchIndex, int32 branchLevel, float32 width, float32 height, Vector2 position, float32 rotation, Renderer2dVertex* vertices); + TreeShapeLoadResult load(Renderer2d* renderer); + void createBranch(TreeLoadData* ld, TreeBranchLoadData* branchList, int32 numBranches, + int32* branchIndex, int32 branchLevel, float32 width, float32 height, + Vector2 position, float32 rotation, Renderer2dVertex* vertices, TreeShapeLoadResult* lr); void update(float32 dtSeconds); void render(Renderer2d* renderer); void unload(); -- cgit v1.2.1