get rid of set_gamestatus as it's usecase is no longer relevant

This commit is contained in:
2025-03-22 12:21:34 +01:00
parent aeaba3262f
commit 7e5236db7c
5 changed files with 7 additions and 18 deletions

View File

@@ -6,12 +6,12 @@
#include <stdint.h>
#include <stdlib.h>
#include "../error.h"
#include "gametime.h"
void game_init(gamedata* dat) {
*dat = (gamedata){
gametime_new(),
true,
};
}
@@ -20,7 +20,7 @@ void game_update(gamedata* dat) {
uint8_t const* keys = SDL_GetKeyboardState(NULL);
if (keys[SDL_SCANCODE_ESCAPE])
set_gamestatus(STATUS_SUCCESS);
dat->run = false;
}
void game_free(gamedata* dat) {

View File

@@ -1,6 +1,7 @@
#pragma once
#include <math.h>
#include <stdbool.h>
#include "gametime.h"
@@ -12,6 +13,7 @@
typedef struct {
gametime time;
bool run;
} gamedata;
void game_init(gamedata*); // initializes everything needed to start the game; outputs to game_data