Untitled
Loading...
Searching...
No Matches
editor.c File Reference
#include "SDL2/SDL_video.h"
#include "core/camera.h"
#include "core/engine_types.h"
#include "ui/fonts.h"
#include "load/gltf.h"
#include "load/load.h"
#include "editor/editor.h"
#include "utilities/engine_utilities.h"
#include "ECS/entity.h"
#include "load/init.h"
#include "light/lightmap.h"
#include "utilities/mathf.h"
#include "render/render.h"
#include "utilities/types.h"
#include "ui/ui.h"
#include "core/acceleration.h"
#include "core/nk_config.h"
#include "physics/physics.h"
#include "nuklear/nuklear.h"
#include "nuklear/nuklear_sdl_gl3.h"
#include "Windows.h"
#include "audio/audio.h"
#include "ui/ui_callbacks.h"
#include "utilities/utilities.h"
#include <rpcndr.h>
#include <stddef.h>
#include <stdint.h>

Go to the source code of this file.

Macros

#define MAX_GLTF_NAMES   256
#define MAX_RPROBE_NAMES   256

Functions

void change_fullscreen_option (FullscreenOptions option)
void change_render_resolution ()
void change_ssao_res (int w, int h)
void change_dof_res (int w, int h)
void change_bloom_res (int w, int h)
void UNDO_INIT ()
 Initializes Undos inside of UNDOS to free state.
void clear_special_undo_bytes (Undo *undo)
void clear_undo (Undo *undo)
void destroy_undo (Undo *undo)
Undo * find_last_undo ()
Undo * find_empty_undo ()
void link_undo (Undo *undo)
void check_stack_size ()
void perform_newest_undo ()
 Performs top-most Undo and moves the top-most pointer to the previous.
void perform_newest_redo ()
 Performs top-most Redo (Undo->next) and moves pointers upward.
void destroy_redo_history ()
void push_nk_slider_undo (NKSlider *s, UndoStructure structure, size_t byte_offset)
void push_raw_bytes_undo (void *bytes, size_t byte_size, UndoStructure structure, size_t byte_offset)
void push_special_undo (UndoStructure structure, uint8_t **bytes, size_t total_byte_size, size_t bytes_count, size_t byte_offset)
void push_special_undo_normal_bytes (UndoStructure structure, void *bytes, size_t byte_size, size_t byte_offset)
UndoStructure create_undo_structure (UndoStructureType type, int id[8], UndoSpecial special)
UndoStructure create_singular_id_undo_structure (UndoStructureType type, int id, UndoSpecial special)
UndoStructure create_light_undo_structure (int id, UndoSpecial special)
void copy_special_undo (Undo *undo, uint8_t ***special_bytes, int ids[8])
void execute_non_special_undo (Undo *undo, uint8_t *p)
void execute_light_undo (Undo *undo)
void execute_globals_undo (Undo *undo)
UndoStructure create_editor_settings_undo_structure (UndoSpecial special)
void execute_editor_settings_undo (Undo *undo)
UndoStructure create_rprobe_undo_structure (int id, UndoSpecial special)
void execute_rprobe_undo (Undo *undo)
void execute_lprobe_undo (Undo *undo)
void execute_aprobe_undo (Undo *undo)
void execute_aemitter_undo (Undo *undo)
void execute_aportal_undo (Undo *undo)
void execute_ui_menu_undo (Undo *undo)
void execute_ui_element_undo (Undo *undo)
void execute_ui_container_undo (Undo *undo)
void execute_text_box_undo (Undo *undo)
void execute_asset_instance_undo (Undo *undo)
void execute_mesh_node_undo (Undo *undo)
void execute_undo (Undo *undo)
 Performs an Undo (switch-case into each UndoStructureType).
void store_into_nkslider (NKSlider *s, void *bytes, size_t byte_size)
void toggle_performance_overlay ()
 Toggles the performance overlay menu: PERFORMANCE_OVERLAY_MENU.
void update_performance_overlay (GLuint64 query_s[PQUERY_MAX])
 Fills performance overlay with text based on current GPU profiling information.
void create_performance_overlay ()
 Allocates and initializes position of the TextBoxes for the performance overlay.
bool nk_check_equivalency (void *a, void *b, size_t byte_size, NKSlider *s, bool *dirty)
bool check_equivalencyv3 (vec3 *a, vec3 b, NKSlider *s, bool *dirty)
bool check_equivalencyv4 (vec4 *a, vec4 b, NKSlider *s, bool *dirty)
bool check_equivalencyf (float *a, float b, NKSlider *s, bool *dirty)
bool check_equivalencyi (int *a, int b, NKSlider *s, bool *dirty)
void FILE_DIR_REGISTRY_INIT ()
 Initializes each FileDirectoryRegistry based on initial paths.
void load_filenames (FileDirectoryRegistry *registry)
void load_rprobe_filenames (const char *folder_path)
void load_gltf_filenames (const char *folder_path)
void render_entity_menu ()
void render_file_directory_dropdown (FileDirectoryRegistry *registry)
void render_dropdown_labels (int *selected, char **options, int option_count)
void render_dropdown (const char *dropdown_name, int *selected, char **options, int option_count, int x, int y)
mat3 mat3_rotation_x (float angle_radians)
mat3 mat3_rotation_y (float angle_radians)
mat3 mat3_rotation_z (float angle_radians)
void obb_orthonormalize (OBB *obb)
void render_ivec3_widget (const char *name, UndoStructureType undo_type, int id, ivec3 *vec, NKSlider *sliders)
void render_pos_widget (const char *name, UndoStructureType undo_type, int id, vec3 *pos, NKSlider *sliders)
void render_aabb_widget (const char *name, AABB *aabb)
void render_mat4_widget (const char *name, UndoStructureType undo_type, int id, mat4 *mat, vec3 *tr, vec4 *rot, vec3 *sc, NKSlider *sliders)
void render_obb_widget (const char *name, UndoStructureType undo_type, int id, OBB *obb, NKSlider *sliders)
void render_selection_menu ()
void render_text_menu ()
void render_ui_menu ()
void render_audio_menu ()
void render_lprobe_menu ()
void render_main_menu ()
void render_mn_menu ()
void render_material_menu ()
void render_light_menu ()
void render_asset_instance_menu ()
void render_editor_menu ()
 Renders the editor menus.

Variables

LightEditorMenu LIGHT_MENU = {0}
MainEditorMenu MAIN_MENU = {0}
LProbeEditorMenu LPROBE_MENU = {0}
AProbeEditorMenu APROBE_MENU = {0}
UIElementEditorMenu UIELEMENT_MENU = {0}
TextBoxEditorMenu TEXTBOX_MENU = {0}
AssetInstanceEditorMenu AI_MENU = {0}
MeshNodeEditorMenu MN_MENU = {0}
char gltf_names [256][256]
int gltf_names_count = 0
char rprobe_names [256][256]
int rprobe_names_count = 0
FileDirectoryRegistry scene_registry = {0}
FileDirectoryRegistry lightmap_registry = {0}
FileDirectoryRegistry light_registry = {0}
FileDirectoryRegistry sound_registry = {0}
FileDirectoryRegistry aportal_registry = {0}
FileDirectoryRegistry rprobe_registry = {0}
FileDirectoryRegistry lprobe_registry = {0}
FileDirectoryRegistry aprobe_registry = {0}
FileDirectoryRegistry scene_apv_registry = {0}
FileDirectoryRegistry scene_lpv_registry = {0}
FileDirectoryRegistry ui_registry = {0}
Undo UNDOS [MAX_UNDOS] = {0}
int undo_stack_idx = 0
size_t undo_stack_size = 0
Undo * top_undo = NULL
Undo * next_redo = NULL
const char QUERY_NAMES [PQUERY_MAX][256]
nk_bool gltf_file_names_open = nk_false
nk_bool rprobe_file_names_open = nk_false
const char target_types [4][256]
const char menu_names [][256]
 The array for all editor menu names (to avoid Nuklear hashing problems).
int tb_id_flags = NK_EDIT_INACTIVE
int tb_text_flags = NK_EDIT_INACTIVE
int tb_cont_flags = NK_EDIT_INACTIVE
int ui_menu_id_flags = NK_EDIT_INACTIVE
int ui_id_flags = NK_EDIT_INACTIVE
int ui_parent_cont_flags = NK_EDIT_INACTIVE
int ui_cont_flags = NK_EDIT_INACTIVE
int ui_scrollbar_flags = NK_EDIT_INACTIVE
int ui_label_id_flags = NK_EDIT_INACTIVE
int aportal_flags = NK_EDIT_INACTIVE
int apv_flags = NK_EDIT_INACTIVE
int scene_apv_flags = NK_EDIT_INACTIVE
int lpv_flags = NK_EDIT_INACTIVE
int scene_lpv_flags = NK_EDIT_INACTIVE
int scene_name_flags = NK_EDIT_INACTIVE
int scene_file_name_flags = NK_EDIT_INACTIVE
int ui_name_flags = NK_EDIT_INACTIVE
int rprobe_name_flags = NK_EDIT_INACTIVE
int light_name_flags = NK_EDIT_INACTIVE
int lm_name_flags = NK_EDIT_INACTIVE
char aportal_name_buffer [256]
char light_name_buffer [256]
char aprobe_name_buffer [256]
char lprobe_name_buffer [256]
char scene_apv_name_buffer [256]
char scene_lpv_name_buffer [256]
char text_container_buffer [256]
char text_id_buffer [256]
char menu_id_buffer [256]
char element_id_buffer [256]
char element_parent_container_buffer [256]
char element_cid_buffer [256]
char scrollbar_buffer [256]
char label_id_buffer [256]
const char * MSAA_OPTIONS []