summaryrefslogtreecommitdiff
path: root/themes/main.cpp
diff options
context:
space:
mode:
authorMatthew Kosarek <mattkae@protonmail.com>2021-10-13 07:29:09 -0400
committerMatthew Kosarek <mattkae@protonmail.com>2021-10-13 07:29:09 -0400
commitf6fe40e125a99bd3ea47c476f6a95b6e820a51aa (patch)
tree0c4675c30d9b2aa556594c3a0e697388269006de /themes/main.cpp
parent2074f6be3096386fb543f040dec314290f6eb920 (diff)
Adding square leaves to the tree
Diffstat (limited to 'themes/main.cpp')
-rw-r--r--themes/main.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/themes/main.cpp b/themes/main.cpp
index c3ecad0..e037dcf 100644
--- a/themes/main.cpp
+++ b/themes/main.cpp
@@ -4,6 +4,7 @@
#include "Renderer2d.h"
#include "types.h"
#include "TreeShape.h"
+#include "LeafParticleRender.h"
enum Theme {
Default = 0,
@@ -12,6 +13,7 @@ enum Theme {
struct AutumnTheme {
TreeShape tree;
+ LeafParticleRender leafParticles;
void load(Renderer2d* renderer);
void update(float32 dtSeconds);
@@ -114,18 +116,22 @@ EM_BOOL selectAutumn(int eventType, const EmscriptenMouseEvent* mouseEvent, void
// -- Autumn theme3
void AutumnTheme::load(Renderer2d* renderer) {
renderer->clearColor = Vector4(252,76,2, 0.5).toNormalizedColor();
- tree.load(renderer);
+ auto lr = tree.load(renderer);
+ leafParticles.load(renderer, &lr);
}
void AutumnTheme::update(float32 dtSeconds) {
tree.update(dtSeconds);
+ leafParticles.update(dtSeconds);
}
void AutumnTheme::render(Renderer2d* renderer) {
tree.render(renderer);
+ leafParticles.render(renderer);
}
void AutumnTheme::unload() {
tree.unload();
+ leafParticles.unload();
}