eco2d/code/common/game.h

24 lines
885 B
C
Raw Normal View History

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-08 06:55:12 +00:00
void game_init(int8_t play_mode, uint32_t num_viewers, int32_t seed, uint16_t block_size, 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-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-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-07 20:48:15 +00:00
void game_world_view_cycle_active(uint8_t dir);
void game_world_view_active_entity_map(void (*map_proc)(uint64_t key, entity_view value));
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);