diff --git a/assets/scenes/Level_1.symtres b/assets/scenes/Level_1.symtres index cf90d74..c9d0130 100755 --- a/assets/scenes/Level_1.symtres +++ b/assets/scenes/Level_1.symtres @@ -16,10 +16,11 @@ Player { type : 2 scale : 1.000 1.000 1.000 - rotation : 0.000 0.767 0.000 -0.642 + rotation : 0.000 -0.197 0.000 0.981 active : true - position : 10.833 4.385 -52.631 + position : 7.444 6.491 0.938 name : Player + camera_clear_color : 0.298 0.600 0.898 1.000 } Scene_Entity_Entry diff --git a/src/game/game.c b/src/game/game.c index e914803..ea421ab 100755 --- a/src/game/game.c +++ b/src/game/game.c @@ -118,7 +118,7 @@ bool game_init(struct Window* window, struct Hashmap* cvars) /* Debug scene setup */ //game_scene_setup(); - scene_load(game_state->scene, "default", DIRT_INSTALL); + scene_load(game_state->scene, "Level_1", DIRT_INSTALL); game_state->is_initialized = true; return game_state->is_initialized; } diff --git a/src/game/scene.c b/src/game/scene.c index 67e7ff8..a224804 100755 --- a/src/game/scene.c +++ b/src/game/scene.c @@ -184,6 +184,8 @@ bool scene_load(struct Scene* scene, const char* filename, int directory_type) transform_scale(player, &scale); quat_assign(&player->base.transform.rotation, &rotation); transform_update_transmat(player); + + if(hashmap_value_exists(player_data, "camera_clear_color")) player->camera_node->clear_color = hashmap_vec4_get(player_data, "camera_clear_color"); num_objects_loaded++; } break; @@ -230,6 +232,7 @@ bool scene_save(struct Scene* scene, const char* filename, int directory_type) // Player struct Parser_Object* player_object = parser_object_new(parser, PO_PLAYER); entity_write(&scene->player, player_object, true); + hashmap_vec4_set(player_object->data, "camera_clear_color", &scene->player.camera_node->clear_color); scene_write_entity_list(scene, ET_DEFAULT, parser); scene_write_entity_list(scene, ET_LIGHT, parser); diff --git a/todo.txt b/todo.txt index e0568e9..4208fa8 100644 --- a/todo.txt +++ b/todo.txt @@ -2,6 +2,7 @@ Todo: - Re-write/Overhaul bounding volumes and ray intersection - Add uv tiling parameter to materials that can be serialized along with entities - Reduce the opacity of wireframe around selected entity in editor + - Write player camera clear colour when saving scene - Allow picking and selecting other entity types in editor i.e. the ones that don't have meshes - When loading entities, show an additional optional textfield where user can enter the name they want for the entity after it is loaded - Add editor undo for transformation operations