2021-01-11 13:47:14 +00:00
|
|
|
#pragma once
|
2021-01-11 20:08:16 +00:00
|
|
|
#include "system.h"
|
2021-05-06 15:30:38 +00:00
|
|
|
#include "world_view.h"
|
2021-01-10 16:42:01 +00:00
|
|
|
|
2021-05-12 14:42:22 +00:00
|
|
|
typedef enum {
|
|
|
|
GAMEKIND_SINGLE,
|
|
|
|
GAMEKIND_CLIENT,
|
|
|
|
GAMEKIND_HEADLESS,
|
|
|
|
FORCE_GAMEKIND_UINT8 = UINT8_MAX
|
|
|
|
} game_kind;
|
|
|
|
|
2021-05-12 16:28:39 +00:00
|
|
|
void game_init(game_kind play_mode, uint32_t num_viewers, int32_t seed, uint16_t chunk_size, uint16_t chunk_amount, int8_t is_dash_enabled);
|
2021-01-11 13:47:14 +00:00
|
|
|
void game_shutdown();
|
2021-05-13 14:12:18 +00:00
|
|
|
void game_request_close();
|
2021-01-11 20:08:16 +00:00
|
|
|
uint8_t game_is_running();
|
2021-05-04 19:45:51 +00:00
|
|
|
int8_t game_is_networked();
|
2021-07-27 16:34:31 +00:00
|
|
|
float game_time();
|
2021-01-10 16:42:01 +00:00
|
|
|
|
2021-05-07 14:43:54 +00:00
|
|
|
//~ NOTE(zaklaus): game events
|
2021-01-11 13:47:14 +00:00
|
|
|
void game_input();
|
|
|
|
void game_update();
|
|
|
|
void game_render();
|
2021-05-06 15:30:38 +00:00
|
|
|
|
2021-05-07 14:43:54 +00:00
|
|
|
//~ NOTE(zaklaus): world view management
|
2021-05-06 15:30:38 +00:00
|
|
|
world_view *game_world_view_get_active(void);
|
2021-05-07 11:47:45 +00:00
|
|
|
world_view *game_world_view_get(uint16_t idx);
|
|
|
|
void game_world_view_set_active_by_idx(uint16_t idx);
|
|
|
|
void game_world_view_set_active(world_view *view);
|
2021-05-10 11:27:01 +00:00
|
|
|
void game_world_view_cycle_active(int8_t dir);
|
2021-05-09 22:40:25 +00:00
|
|
|
void game_world_view_active_entity_map(void (*map_proc)(uint64_t key, entity_view * value));
|
|
|
|
void game_world_cleanup_entities(void);
|
2021-05-07 14:43:54 +00:00
|
|
|
|
|
|
|
//~ NOTE(zaklaus): viewer -> host actions
|
2021-05-08 15:42:47 +00:00
|
|
|
void game_action_send_keystate(float x, float y, uint8_t use, uint8_t sprint);
|