From 563705fb71cec135f87e0746ad1c1ae2ba651779 Mon Sep 17 00:00:00 2001 From: Shariq Shah Date: Wed, 22 Mar 2017 02:25:17 +0500 Subject: [PATCH] Updated readme and made minor changes to editor --- orgfile.org | 7 +++++-- src/camera.c | 3 ++- src/editor.c | 9 ++++----- src/geometry.c | 14 ++++++++------ 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/orgfile.org b/orgfile.org index c72ad07..cd477ec 100644 --- a/orgfile.org +++ b/orgfile.org @@ -112,7 +112,8 @@ x Font atlas proper cleanup ** TODO Array-based Hashmaps ** TODO Sprite sheet animations ** TODO Replace orgfile with simple text readme and reduce duplication? -** TODO Live data views in editor +** DONE Live data views in editor +- State "DONE" from "TODO" [2017-03-22 Wed 02:14] ** DONE Camera resize on window reisze - State "DONE" from "TODO" [2017-03-20 Mon 15:22] ** DONE Resizable framebuffers and textures @@ -123,7 +124,8 @@ x Font atlas proper cleanup ** DONE Better way to store and manage textures attached to framebuffers - State "DONE" from "TODO" [2017-03-16 Thu 22:51] ** TODO Validate necessary assets at game launch -** TODO Variant type +** DONE Variant type +- State "DONE" from "TODO" [2017-03-22 Wed 02:14] ** TODO Log and debug/stats output in gui ** TODO Editor ** TODO Event Subsystem @@ -131,6 +133,7 @@ x Font atlas proper cleanup ** TODO Textual/Binary format for data serialization and persistance ** TODO Better logging ** TODO Hatching/Ink rendering style +** TODO Fix frustum culling sometimes not working ** DONE Compile and test on windows - State "DONE" from "TODO" [2017-03-14 Tue 00:32] ** TODO Array based string type comptible with cstring(char*) diff --git a/src/camera.c b/src/camera.c index 984ca21..ec94892 100644 --- a/src/camera.c +++ b/src/camera.c @@ -94,13 +94,14 @@ int camera_create(int node, int width, int height) void camera_update_view_proj(struct Camera* camera) { + mat4_identity(&camera->view_proj_mat); mat4_mul(&camera->view_proj_mat, &camera->proj_mat, &camera->view_mat); update_frustum(camera); } void camera_update_view(struct Camera* camera) { - struct Entity* entity = entity_get(camera->node); + struct Entity* entity = entity_get(camera->node); struct Transform* transform = entity_component_get(entity, C_TRANSFORM); vec3 lookat = {0.f, 0.f, 0.f}; vec3 up = {0.f, 0.f, 0.f}; diff --git a/src/editor.c b/src/editor.c index 56cbc2c..a1f94c4 100644 --- a/src/editor.c +++ b/src/editor.c @@ -46,7 +46,7 @@ void editor_init(void) { editor_state.enabled = 1; editor_state.renderer_settings_window = 0; - editor_state.debug_vars_window = 0; + editor_state.debug_vars_window = 1; editor_state.top_panel_height = 30; debug_vars_list = array_new_cap(struct Debug_Variable, 20); empty_indices = array_new(int); @@ -140,8 +140,7 @@ void editor_update(float dt) NK_WINDOW_CLOSABLE | NK_WINDOW_MOVABLE | NK_WINDOW_SCROLL_AUTO_HIDE | - NK_WINDOW_SCALABLE | - NK_WINDOW_MINIMIZABLE; + NK_WINDOW_SCALABLE; /* Top Panel */ if(nk_begin(context, "Top_Panel", nk_recti(0, 0, win_width, win_height - (win_height - editor_state.top_panel_height)), @@ -253,8 +252,8 @@ void editor_update(float dt) { if(nk_begin_titled(context, "Debug_Variables_Window", "Debug Variables", nk_rect(20, 20, 300, 300), default_window_flags)) { - nk_layout_row_static(context, 200, 200, 2); - if(nk_group_begin(context, "Name", NK_WINDOW_BORDER | NK_WINDOW_TITLE | NK_WINDOW_SCROLL_AUTO_HIDE)) + nk_layout_row_static(context, 250, 250, 2); + if(nk_group_begin(context, "Name", NK_WINDOW_BORDER | NK_WINDOW_SCROLL_AUTO_HIDE)) { for(int i = 0; i < array_len(debug_vars_list); i++) { diff --git a/src/geometry.c b/src/geometry.c index 5a44eaf..1831e7a 100644 --- a/src/geometry.c +++ b/src/geometry.c @@ -367,12 +367,14 @@ int geom_render_in_frustum(int index, int intersection = bv_intersect_frustum_sphere(frustum, &geometry->bounding_sphere, transform); if(intersection == IT_INTERSECT || intersection == IT_INSIDE) { - intersection = bv_intersect_frustum_box(frustum, &geometry->bounding_box, transform); - if(intersection == IT_INTERSECT || intersection == IT_INSIDE) - { - geom_render(index, draw_mode); - rendered = array_len(geometry->indices); - } + geom_render(index, draw_mode); + rendered = array_len(geometry->indices); + /* intersection = bv_intersect_frustum_box(frustum, &geometry->bounding_box, transform); */ + /* if(intersection == IT_INTERSECT || intersection == IT_INSIDE) */ + /* { */ + /* geom_render(index, draw_mode); */ + /* rendered = array_len(geometry->indices); */ + /* } */ } return rendered; }