Updated readme and made minor changes to editor

dev
Shariq Shah 9 years ago
parent f8a88791f1
commit 563705fb71
  1. 7
      orgfile.org
  2. 1
      src/camera.c
  3. 9
      src/editor.c
  4. 10
      src/geometry.c

@ -112,7 +112,8 @@ x Font atlas proper cleanup
** TODO Array-based Hashmaps ** TODO Array-based Hashmaps
** TODO Sprite sheet animations ** TODO Sprite sheet animations
** TODO Replace orgfile with simple text readme and reduce duplication? ** 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 ** DONE Camera resize on window reisze
- State "DONE" from "TODO" [2017-03-20 Mon 15:22] - State "DONE" from "TODO" [2017-03-20 Mon 15:22]
** DONE Resizable framebuffers and textures ** 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 ** DONE Better way to store and manage textures attached to framebuffers
- State "DONE" from "TODO" [2017-03-16 Thu 22:51] - State "DONE" from "TODO" [2017-03-16 Thu 22:51]
** TODO Validate necessary assets at game launch ** 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 Log and debug/stats output in gui
** TODO Editor ** TODO Editor
** TODO Event Subsystem ** TODO Event Subsystem
@ -131,6 +133,7 @@ x Font atlas proper cleanup
** TODO Textual/Binary format for data serialization and persistance ** TODO Textual/Binary format for data serialization and persistance
** TODO Better logging ** TODO Better logging
** TODO Hatching/Ink rendering style ** TODO Hatching/Ink rendering style
** TODO Fix frustum culling sometimes not working
** DONE Compile and test on windows ** DONE Compile and test on windows
- State "DONE" from "TODO" [2017-03-14 Tue 00:32] - State "DONE" from "TODO" [2017-03-14 Tue 00:32]
** TODO Array based string type comptible with cstring(char*) ** TODO Array based string type comptible with cstring(char*)

@ -94,6 +94,7 @@ int camera_create(int node, int width, int height)
void camera_update_view_proj(struct Camera* camera) 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); mat4_mul(&camera->view_proj_mat, &camera->proj_mat, &camera->view_mat);
update_frustum(camera); update_frustum(camera);
} }

@ -46,7 +46,7 @@ void editor_init(void)
{ {
editor_state.enabled = 1; editor_state.enabled = 1;
editor_state.renderer_settings_window = 0; editor_state.renderer_settings_window = 0;
editor_state.debug_vars_window = 0; editor_state.debug_vars_window = 1;
editor_state.top_panel_height = 30; editor_state.top_panel_height = 30;
debug_vars_list = array_new_cap(struct Debug_Variable, 20); debug_vars_list = array_new_cap(struct Debug_Variable, 20);
empty_indices = array_new(int); empty_indices = array_new(int);
@ -140,8 +140,7 @@ void editor_update(float dt)
NK_WINDOW_CLOSABLE | NK_WINDOW_CLOSABLE |
NK_WINDOW_MOVABLE | NK_WINDOW_MOVABLE |
NK_WINDOW_SCROLL_AUTO_HIDE | NK_WINDOW_SCROLL_AUTO_HIDE |
NK_WINDOW_SCALABLE | NK_WINDOW_SCALABLE;
NK_WINDOW_MINIMIZABLE;
/* Top Panel */ /* Top Panel */
if(nk_begin(context, "Top_Panel", nk_recti(0, 0, win_width, win_height - (win_height - editor_state.top_panel_height)), 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)) 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); nk_layout_row_static(context, 250, 250, 2);
if(nk_group_begin(context, "Name", NK_WINDOW_BORDER | NK_WINDOW_TITLE | NK_WINDOW_SCROLL_AUTO_HIDE)) 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++) for(int i = 0; i < array_len(debug_vars_list); i++)
{ {

@ -366,13 +366,15 @@ int geom_render_in_frustum(int index,
struct Geometry* geometry = &geometry_list[index]; struct Geometry* geometry = &geometry_list[index];
int intersection = bv_intersect_frustum_sphere(frustum, &geometry->bounding_sphere, transform); int intersection = bv_intersect_frustum_sphere(frustum, &geometry->bounding_sphere, transform);
if(intersection == IT_INTERSECT || intersection == IT_INSIDE) 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); geom_render(index, draw_mode);
rendered = array_len(geometry->indices); 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; return rendered;
} }

Loading…
Cancel
Save