Changed potentially buggy usage of bools being implicitly converted to int* when used with nuklear

dev
Shariq Shah 6 years ago
parent 1d86626840
commit cba6a7e24a
  1. 7
      src/game/editor.c
  2. 2
      todo.txt

@ -277,7 +277,6 @@ void editor_update(struct Editor* editor, float dt)
} }
nk_end(context); nk_end(context);
if(editor->window_scene_heirarchy) editor_window_scene_heirarchy(context, editor, game_state); if(editor->window_scene_heirarchy) editor_window_scene_heirarchy(context, editor, game_state);
if(editor->window_debug_variables) editor_window_debug_variables(context, editor); if(editor->window_debug_variables) editor_window_debug_variables(context, editor);
if(editor->window_property_inspector) editor_window_property_inspector(context, editor, game_state); if(editor->window_property_inspector) editor_window_property_inspector(context, editor, game_state);
@ -294,7 +293,7 @@ void editor_update(struct Editor* editor, float dt)
static const char* draw_modes[] = { "Triangles", "Lines", "Points" }; static const char* draw_modes[] = { "Triangles", "Lines", "Points" };
nk_layout_row_dynamic(context, row_height, 2); nk_layout_row_dynamic(context, row_height, 2);
nk_label(context, "Debug Draw", NK_TEXT_ALIGN_LEFT | NK_TEXT_ALIGN_MIDDLE); nk_label(context, "Debug Draw", NK_TEXT_ALIGN_LEFT | NK_TEXT_ALIGN_MIDDLE);
nk_checkbox_label(context, "", &render_settings->debug_draw_enabled); render_settings->debug_draw_enabled = nk_check_label(context, "", render_settings->debug_draw_enabled);
nk_layout_row_dynamic(context, row_height, 2); nk_layout_row_dynamic(context, row_height, 2);
nk_label(context, "Debug Draw Mode", NK_TEXT_ALIGN_LEFT | NK_TEXT_ALIGN_MIDDLE); nk_label(context, "Debug Draw Mode", NK_TEXT_ALIGN_LEFT | NK_TEXT_ALIGN_MIDDLE);
@ -795,13 +794,13 @@ void editor_window_property_inspector(struct nk_context* context, struct Editor*
nk_layout_row_dynamic(context, row_height, 2); nk_layout_row_dynamic(context, row_height, 2);
nk_label(context, "Orthographic", NK_TEXT_ALIGN_LEFT | NK_TEXT_ALIGN_MIDDLE); nk_label(context, "Orthographic", NK_TEXT_ALIGN_LEFT | NK_TEXT_ALIGN_MIDDLE);
bool ortho = nk_checkbox_label(context, "", &camera->ortho); bool ortho = nk_check_label(context, "", camera->ortho);
if(ortho != camera->ortho) if(ortho != camera->ortho)
{ {
camera->ortho = ortho;
update = true; update = true;
} }
if(!camera->ortho) if(!camera->ortho)
{ {
nk_layout_row_dynamic(context, row_height, 1); nk_layout_row_dynamic(context, row_height, 1);

@ -1,5 +1,4 @@
Todo: Todo:
- Change all usages of bool types and nuklear causing buggy behaviour in editor code
- Specific rendering mode for editor related rendering - Specific rendering mode for editor related rendering
- Basic Editor gizmo for transformation i.e. translate/rotate/scale in world and local coordinates - Basic Editor gizmo for transformation i.e. translate/rotate/scale in world and local coordinates
- Add warning to genie build script when running on windows and WindowsSdkVersion cannot be found. This happens when the script is not run from vcvarsall command prompt - Add warning to genie build script when running on windows and WindowsSdkVersion cannot be found. This happens when the script is not run from vcvarsall command prompt
@ -209,4 +208,5 @@ Done:
* Implemented handling drawing other entity types that can be selected in the editor but are not static meshes * Implemented handling drawing other entity types that can be selected in the editor but are not static meshes
* Implemented proper topbar * Implemented proper topbar
* Changed config vars are used. * Changed config vars are used.
* Changed all usages of bool types and nuklear causing buggy behaviour in editor code by using int instead of bool or by using variants of the functions that do take int as parameter instead of int*

Loading…
Cancel
Save