From f314b56da42e1ead200e2373e9b214f77290d03b Mon Sep 17 00:00:00 2001 From: physick Date: Sun, 12 Jul 2026 13:08:33 +0500 Subject: fun popup animation --- src/scenes/sceneManager.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/scenes/sceneManager.c') diff --git a/src/scenes/sceneManager.c b/src/scenes/sceneManager.c index 8d4c4e7..e5ab397 100644 --- a/src/scenes/sceneManager.c +++ b/src/scenes/sceneManager.c @@ -1,4 +1,5 @@ #include "scenes.h" +#include #include #include @@ -6,10 +7,15 @@ Scene **sceneStack = NULL; size_t sceneStackDepth = 0; Scene *getCurrentScene() { - if (sceneStackDepth == 0) return false; + if (sceneStackDepth == 0) return NULL; return sceneStack[sceneStackDepth - 1]; } +Scene *getPreviousScene() { + if (sceneStackDepth <= 1) return NULL; + return sceneStack[sceneStackDepth - 2]; +} + bool InitSceneStack() { sceneStack = malloc(sizeof(Scene) * SCENE_STACK_SIZE); return sceneStack != NULL; @@ -35,6 +41,10 @@ void DeleteSceneFromStack() { bool DrawScene() { Scene *currentScene = getCurrentScene(); if (currentScene == NULL) return false; + if (currentScene->IsTransparent) { + Scene *prevScene = getPreviousScene(); + if (prevScene != NULL) prevScene->Draw(prevScene); + } return currentScene->Draw(currentScene); } -- cgit v1.3