From 1da356d8a64c45c99871aca156ee9fdd3e10ec15 Mon Sep 17 00:00:00 2001 From: Matthew Kosarek Date: Wed, 27 Sep 2023 08:03:04 -0400 Subject: Simplification of the Theme system with a more OO model --- themes/src/autumn/AutumnTheme.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'themes/src/autumn/AutumnTheme.cpp') diff --git a/themes/src/autumn/AutumnTheme.cpp b/themes/src/autumn/AutumnTheme.cpp index affcc00..c6431a1 100644 --- a/themes/src/autumn/AutumnTheme.cpp +++ b/themes/src/autumn/AutumnTheme.cpp @@ -8,6 +8,17 @@ namespace const int NUM_HILLS = 3; } +AutumnTheme::AutumnTheme(Renderer2d* renderer) + : renderer{renderer} +{ + load(renderer); +} + +AutumnTheme::~AutumnTheme() +{ + unload(); +} + void AutumnTheme::load(Renderer2d* renderer) { renderer->clearColor = Vector4(252, 210, 153, 255).toNormalizedColor(); auto lr = tree.load(renderer); @@ -45,7 +56,8 @@ void AutumnTheme::update(f32 dtSeconds) { leafParticles.update(dtSeconds); } -void AutumnTheme::render(Renderer2d* renderer) { +void AutumnTheme::render() { + renderer->render(); background->render(); background_hill->render(); tree.render(renderer); -- cgit v1.2.1