diff options
| author | physick <mynameisgennadiy@vk.com> | 2026-07-12 13:08:33 +0500 |
|---|---|---|
| committer | physick <mynameisgennadiy@vk.com> | 2026-07-12 13:08:33 +0500 |
| commit | f314b56da42e1ead200e2373e9b214f77290d03b (patch) | |
| tree | 52e535e99fe8c82a3a4834f67825ba2183e44283 /src/scenes/sceneManager.c | |
| parent | 71e1f2dc8e9e1b3ee595a2712ec24d11ce243f1c (diff) | |
fun popup animation
Diffstat (limited to 'src/scenes/sceneManager.c')
| -rw-r--r-- | src/scenes/sceneManager.c | 12 |
1 files changed, 11 insertions, 1 deletions
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 <raylib.h> #include <stdlib.h> #include <sys/types.h> @@ -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); } |
