mirror of
https://github.com/thepigeongenerator/sdl_template.git
synced 2025-12-19 10:35:46 +01:00
get rid of set_gamestatus as it's usecase is no longer relevant
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user