summaryrefslogtreecommitdiff
path: root/themes/src/autumn
diff options
context:
space:
mode:
Diffstat (limited to 'themes/src/autumn')
-rw-r--r--themes/src/autumn/AutumnTheme.cpp41
-rw-r--r--themes/src/autumn/AutumnTheme.hpp4
-rw-r--r--themes/src/autumn/TreeShape.cpp2
3 files changed, 40 insertions, 7 deletions
diff --git a/themes/src/autumn/AutumnTheme.cpp b/themes/src/autumn/AutumnTheme.cpp
index 754a841..affcc00 100644
--- a/themes/src/autumn/AutumnTheme.cpp
+++ b/themes/src/autumn/AutumnTheme.cpp
@@ -3,16 +3,41 @@
#include "../shapes_2d.h"
#include <memory>
+namespace
+{
+ const int NUM_HILLS = 3;
+}
+
void AutumnTheme::load(Renderer2d* renderer) {
renderer->clearColor = Vector4(252, 210, 153, 255).toNormalizedColor();
auto lr = tree.load(renderer);
leafParticles.load(renderer, &lr);
- background = new RectangularGradient(*renderer,
- Vector4{135, 206, 235, 255}.toNormalizedColor(),
- Vector4(252, 210, 153, 255).toNormalizedColor(),
- renderer->get_width(),
- renderer->get_height(),
- {0, 0});
+ background = new RectangularGradient(
+ *renderer,
+ Vector4{135, 206, 235, 255}.toNormalizedColor(),
+ Vector4(252, 210, 153, 255).toNormalizedColor(),
+ renderer->get_width(),
+ renderer->get_height(),
+ {0, 0});
+
+
+ background_hill = new Circleish(
+ *renderer,
+ 1000,
+ Vector4(137, 129, 33, 255).toNormalizedColor(),
+ 100,
+ 0,
+ 50);
+ background_hill->mesh.model = background_hill->mesh.model.translateByVec2({1200, -700});
+
+ tree_hill = new Circleish(
+ *renderer,
+ 500,
+ Vector4{ 76, 75, 22, 255 }.toNormalizedColor(),
+ 100,
+ 0,
+ 50);
+ tree_hill->mesh.model = tree_hill->mesh.model.translateByVec2(Vector2(300, -290));
}
void AutumnTheme::update(f32 dtSeconds) {
@@ -22,7 +47,9 @@ void AutumnTheme::update(f32 dtSeconds) {
void AutumnTheme::render(Renderer2d* renderer) {
background->render();
+ background_hill->render();
tree.render(renderer);
+ tree_hill->render();
leafParticles.render(renderer);
}
@@ -30,4 +57,6 @@ void AutumnTheme::unload() {
tree.unload();
leafParticles.unload();
delete background;
+ delete background_hill;
+ delete tree_hill;
}
diff --git a/themes/src/autumn/AutumnTheme.hpp b/themes/src/autumn/AutumnTheme.hpp
index 7c1f4f2..2d9958c 100644
--- a/themes/src/autumn/AutumnTheme.hpp
+++ b/themes/src/autumn/AutumnTheme.hpp
@@ -5,14 +5,18 @@
#include "LeafParticleRender.h"
#include "../types.h"
#include <memory>
+#include <vector>
struct Renderer2d;
class RectangularGradient;
+class Circleish;
struct AutumnTheme {
TreeShape tree;
LeafParticleRender leafParticles;
RectangularGradient* background;
+ Circleish* tree_hill;
+ Circleish* background_hill;
void load(Renderer2d* renderer);
void update(f32 dtSeconds);
diff --git a/themes/src/autumn/TreeShape.cpp b/themes/src/autumn/TreeShape.cpp
index 9738fd5..7c80929 100644
--- a/themes/src/autumn/TreeShape.cpp
+++ b/themes/src/autumn/TreeShape.cpp
@@ -42,7 +42,7 @@ TreeShapeLoadResult TreeShape::load(Renderer2d* renderer) {
lr.updateData = updateData;
lr.numBranches = numBranches;
i32 branchIndex = 0;
- createBranch(&ld, generationData, numBranches, &branchIndex, 0, ld.trunkWidth, ld.trunkHeight, Vector2 { 300.f, 50.f }, 0, NULL, vertices, &lr);
+ createBranch(&ld, generationData, numBranches, &branchIndex, 0, ld.trunkWidth, ld.trunkHeight, Vector2 { 300.f, 200.f }, 0, NULL, vertices, &lr);
useShader(renderer->shader);