X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fgame.h;h=0770dd81162b9d4568324f4e1c04af7400855d3d;hb=008136120ba46d17071d11cda8cb768394487f04;hp=8389004bc12648533034c6008b7b5c6ed4e601d5;hpb=a93a7e97b2f57377e8b894b52a16b9d5d05dd28f;p=nothing.git diff --git a/src/game.h b/src/game.h index 8389004b..0770dd81 100644 --- a/src/game.h +++ b/src/game.h @@ -1,26 +1,42 @@ #ifndef GAME_H_ #define GAME_H_ -#include +#include -#include "game/sound_medium.h" +#include "game/sound_samples.h" -typedef struct game_t game_t; +typedef struct Game Game; -game_t *create_game(const char *platforms_file_path, - sound_medium_t *sound_medium, +Game *create_game(const char *platforms_file_path, + const char *sound_sample_files[], + size_t sound_sample_files_count, SDL_Renderer *renderer); -void destroy_game(game_t *game); +void destroy_game(Game *game); -int game_render(const game_t *game); -int game_sound(game_t *game); -int game_update(game_t *game, float delta_time); +int game_render(const Game *game); +int game_sound(Game *game); +int game_update(Game *game, float delta_time); -int game_event(game_t *game, const SDL_Event *event); -int game_input(game_t *game, +int game_event(Game *game, const SDL_Event *event); +int game_input(Game *game, const Uint8 *const keyboard_state, SDL_Joystick *the_stick_of_joy); -int game_over_check(const game_t *game); +int game_over_check(const Game *game); + +typedef enum Game_state { + GAME_STATE_LEVEL = 0, + GAME_STATE_LEVEL_PICKER, + GAME_STATE_LEVEL_EDITOR, + GAME_STATE_CREDITS, + GAME_STATE_SETTINGS, + GAME_STATE_QUIT +} Game_state; + +void game_switch_state(Game *game, Game_state state); +int game_load_level(Game *game, const char *filepath); + +// defined in main.c. is there a better place for this to be declared? +float get_display_scale(void); #endif // GAME_H_