big refactor

This commit is contained in:
2025-04-12 12:46:00 +02:00
parent 8c23e1fe44
commit 52ca20f244
14 changed files with 105 additions and 88 deletions
+5 -7
View File
@@ -1,8 +1,6 @@
#ifndef LOGO_H
#define LOGO_H
#include "applicationstate.h"
typedef struct {
int frameCounter;
int positionX;
@@ -30,10 +28,10 @@ void InitLogo(LogoState *l) {
l->alpha = 1.0f;
}
void UpdateLogo(LogoState *l, State *state) {
void UpdateLogo(LogoState *l, View *currentView, bool *running) {
if (WindowShouldClose() && !IsKeyPressed(KEY_ESCAPE)) {
state->running = false;
*running = false;
}
l->frameCounter++;
@@ -76,11 +74,11 @@ void UpdateLogo(LogoState *l, State *state) {
}
}
else if (l->state == 4) {
state->currentScreen = MENU;
*currentView = MENU;
}
}
void RenderLogo(const LogoState *l, const State *appState) {
void RenderLogo(const LogoState *l, bool *showFPS) {
BeginDrawing();
ClearBackground(RAYWHITE);
@@ -109,7 +107,7 @@ void RenderLogo(const LogoState *l, const State *appState) {
DrawText(TextSubtext("raylib", 0, l->lettersCount), GetScreenWidth() / 2 - 44, GetScreenHeight() / 2 + 48, 50, Fade(BLACK, l->alpha));
}
if (appState->flagFPS){
if (*showFPS){
DrawFPS(10, 10);
}