Remove obsolete render function field
parent
251360ca3e
commit
0f09a7b2bd
|
@ -145,8 +145,7 @@ void update_sfx_list(GameEngine_t* engine)
|
|||
engine->sfx_list.played_sfx = 0;
|
||||
}
|
||||
|
||||
//void init_scene(Scene_t* scene, SceneType_t scene_type, system_func_t render_func, action_func_t action_func)
|
||||
void init_scene(Scene_t* scene, render_func_t render_func, action_func_t action_func)
|
||||
void init_scene(Scene_t* scene, action_func_t action_func)
|
||||
{
|
||||
sc_map_init_64(&scene->action_map, 32, 0);
|
||||
sc_array_init(&scene->systems);
|
||||
|
@ -154,7 +153,6 @@ void init_scene(Scene_t* scene, render_func_t render_func, action_func_t action_
|
|||
init_particle_system(&scene->part_sys);
|
||||
|
||||
//scene->scene_type = scene_type;
|
||||
scene->render_function = render_func;
|
||||
scene->layers.n_layers = 0;
|
||||
scene->bg_colour = WHITE;
|
||||
|
||||
|
|
|
@ -61,8 +61,6 @@ struct Scene {
|
|||
struct sc_array_systems systems;
|
||||
SceneRenderLayers_t layers;
|
||||
Color bg_colour;
|
||||
// TODO: Render function is obsolete and should be treated like a system
|
||||
render_func_t render_function;
|
||||
action_func_t action_function;
|
||||
EntityManager_t ent_manager;
|
||||
float delta_time;
|
||||
|
@ -90,8 +88,7 @@ extern void update_scene(Scene_t* scene, float delta_time);
|
|||
extern void render_scene(Scene_t* scene);
|
||||
extern void do_action(Scene_t* scene, ActionType_t action, bool pressed);
|
||||
|
||||
//void init_scene(Scene_t* scene, SceneType_t scene_type, system_func_t render_func, action_func_t action_func);
|
||||
void init_scene(Scene_t* scene, render_func_t render_func, action_func_t action_func);
|
||||
void init_scene(Scene_t* scene, action_func_t action_func);
|
||||
bool add_scene_layer(Scene_t* scene, int width, int height, Rectangle render_area);
|
||||
void free_scene(Scene_t* scene);
|
||||
|
||||
|
|
|
@ -979,7 +979,7 @@ static void level_do_action(Scene_t* scene, ActionType_t action, bool pressed)
|
|||
|
||||
void init_sandbox_scene(LevelScene_t* scene)
|
||||
{
|
||||
init_scene(&scene->scene, &level_scene_render_func, &level_do_action);
|
||||
init_scene(&scene->scene, &level_do_action);
|
||||
init_entity_tag_map(&scene->scene.ent_manager, PLAYER_ENT_TAG, 4);
|
||||
init_entity_tag_map(&scene->scene.ent_manager, BOULDER_ENT_TAG, MAX_COMP_POOL_SIZE);
|
||||
init_entity_tag_map(&scene->scene.ent_manager, LEVEL_END_TAG, 16);
|
||||
|
|
|
@ -348,7 +348,7 @@ static void render_regular_game_scene(Scene_t* scene)
|
|||
|
||||
void init_game_scene(LevelScene_t* scene)
|
||||
{
|
||||
init_scene(&scene->scene, &level_scene_render_func, &level_do_action);
|
||||
init_scene(&scene->scene, &level_do_action);
|
||||
init_entity_tag_map(&scene->scene.ent_manager, PLAYER_ENT_TAG, 4);
|
||||
init_entity_tag_map(&scene->scene.ent_manager, BOULDER_ENT_TAG, MAX_COMP_POOL_SIZE);
|
||||
init_entity_tag_map(&scene->scene.ent_manager, LEVEL_END_TAG, 16);
|
||||
|
|
|
@ -132,7 +132,7 @@ static void gui_loop(Scene_t* scene)
|
|||
|
||||
void init_menu_scene(MenuScene_t* scene)
|
||||
{
|
||||
init_scene(&scene->scene, &menu_scene_render_func, &menu_do_action);
|
||||
init_scene(&scene->scene, &menu_do_action);
|
||||
|
||||
sc_array_add(&scene->scene.systems, &gui_loop);
|
||||
sc_array_add(&scene->scene.systems, &menu_scene_render_func);
|
||||
|
|
|
@ -400,7 +400,7 @@ int main(void)
|
|||
|
||||
LevelScene_t scene;
|
||||
scene.scene.engine = &engine;
|
||||
init_scene(&scene.scene, &level_scene_render_func, &level_do_action);
|
||||
init_scene(&scene.scene, &level_do_action);
|
||||
init_entity_tag_map(&scene.scene.ent_manager, PLAYER_ENT_TAG, 4);
|
||||
init_entity_tag_map(&scene.scene.ent_manager, DYNMEM_ENT_TAG, 16);
|
||||
init_level_scene_data(
|
||||
|
|
Loading…
Reference in New Issue