diff options
Diffstat (limited to 'editor/editor.cpp')
| -rw-r--r-- | editor/editor.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/editor/editor.cpp b/editor/editor.cpp index c8b69df..094e555 100644 --- a/editor/editor.cpp +++ b/editor/editor.cpp @@ -180,11 +180,11 @@ void PkeEditor_Tick(double delta) { char *selectedScene = tinyfd_saveFileDialog(nullptr, editor_mstr.active_scene->file_path.val, 1, patterns, "Pke Scene Text File"); if (selectedScene != nullptr) { if (editor_mstr.active_scene->file_path.reserved > 0) { - pk_delete<char>(editor_mstr.active_scene->file_path.val, editor_mstr.active_scene->file_path.reserved); + pk_delete_arr<char>(editor_mstr.active_scene->file_path.val, editor_mstr.active_scene->file_path.reserved); } editor_mstr.active_scene->file_path.length = strlen(selectedScene); editor_mstr.active_scene->file_path.reserved = editor_mstr.active_scene->file_path.length + 1; - editor_mstr.active_scene->file_path.val = pk_new<char>(editor_mstr.active_scene->file_path.reserved); + editor_mstr.active_scene->file_path.val = pk_new_arr<char>(editor_mstr.active_scene->file_path.reserved); strcpy(editor_mstr.active_scene->file_path.val, selectedScene); editor_mstr.shouldSaveScene = true; } @@ -941,7 +941,7 @@ void GenerateMTSDF(FontTypeMSDFSettings *msdf_settings, const Asset *a) { font_title.length = strlen(a->key); font_title.reserved = font_title.length + 1; // TODO specific bucket? - font_title.val = pk_new<char>(font_title.reserved); + font_title.val = pk_new_arr<char>(font_title.reserved); snprintf((char *)font_title.val, AssetKeyLength, "%s", a->key); assert(ah_image != ah_glyphs && ah_image != AssetHandle_MAX); FontType_RegisterFont(font_title, ah_image, ah_glyphs, msdf_settings, &ft_spacing); @@ -1330,14 +1330,14 @@ void RecordImGuiUIEdit() { ImGui::Separator(); FontRender fr = *FontType_GetFontRender(selected_ui_box->type_data->text.font_render_handle); const int buffer_len = 1024; - char *text_buffer = pk_new<char>(buffer_len, pkeSettings.mem_bkt.game_transient); + char *text_buffer = pk_new_arr<char>(buffer_len, pkeSettings.mem_bkt.game_transient); size_t len = fr.text.length; sprintf(text_buffer, "%s", fr.text.val); // nocheckin test this if (ImGui::InputText("Text", text_buffer, buffer_len-1, text_flags)) { // TODO specific bucket len = strlen(text_buffer); - char *s = pk_new<char>(len + 1); + char *s = pk_new_arr<char>(len + 1); sprintf(s, "%s", text_buffer); pk_cstr cstr{}; cstr.reserved = len+1; @@ -1472,7 +1472,7 @@ void RecordImGuiModalCreateEntityType() { // TODO this needs to be an array strncpy(entityTypeToCreate.details[0].textureAssetKey, apssTexture.safeKey, AssetKeyLength); - char *sEntityTypeCode = pk_new<char>(strlen(entityTypeCode) + 1); + char *sEntityTypeCode = pk_new_arr<char>(strlen(entityTypeCode) + 1); strncpy(sEntityTypeCode, entityTypeCode, 31); entityTypeToCreate.entityTypeCode.val = sEntityTypeCode; @@ -1730,12 +1730,12 @@ void BuildDirRecursive(const std::filesystem::directory_entry &de, fsEntry *dirF auto fullPath = std::filesystem::absolute(de.path()); auto len = strlen(fullPath.c_str()); // TODO leaky - entry.path = pk_new<char>(len + 1); + entry.path = pk_new_arr<char>(len + 1); memset(entry.path, '\0', len + 1); memcpy(entry.path, fullPath.c_str(), len); len = strlen(fullPath.filename().c_str()); // TODO leaky - entry.name = pk_new<char>(len + 1); + entry.name = pk_new_arr<char>(len + 1); memset(entry.name, '\0', len + 1); memcpy(entry.name, fullPath.filename().c_str(), len); @@ -1761,7 +1761,7 @@ void BuildProjectMenuRecursive(fsEntry &entry) { assert(editor_mstr.target_scene_path.val == nullptr); editor_mstr.target_scene_path.length = strlen(entry.name); editor_mstr.target_scene_path.reserved = editor_mstr.target_scene_path.length + 1; - editor_mstr.target_scene_path.val = pk_new<char>(editor_mstr.target_scene_path.reserved); + editor_mstr.target_scene_path.val = pk_new_arr<char>(editor_mstr.target_scene_path.reserved); strncpy(editor_mstr.target_scene_path.val, entry.name, editor_mstr.target_scene_path.reserved); ActiveCamera = &NullCamera; } @@ -1956,7 +1956,7 @@ void PkeEditor_Init() { PkeInputSet debugControlsSet{}; debugControlsSet.title = "debug-editor-controls"; debugControlsSet.actionCount = 14; - debugControlsSet.actions = pk_new<PkeInputAction>(debugControlsSet.actionCount); + debugControlsSet.actions = pk_new_arr<PkeInputAction>(debugControlsSet.actionCount); debugControlsSet.flags = PKE_INPUT_ACTION_SET_FLAG_DO_NOT_SERIALIZE; debugControlsSet.actions[0].name = dbgCtrl_CameraLeft; |
