diff options
| author | Jonathan Bradley <jcb@pikum.xyz> | 2025-06-05 10:50:24 -0400 |
|---|---|---|
| committer | Jonathan Bradley <jcb@pikum.xyz> | 2025-06-05 10:50:24 -0400 |
| commit | 55c518b2922a2d8a41212a952a68c17c7c9a3f8b (patch) | |
| tree | 31cc135bc18bf11893d5ca3bca47c9ee27bf141f /editor | |
| parent | b0b1159780311c7c8ca9a9d41d11794e91e8895c (diff) | |
pk.h: update to 0.6.0 + handle breaking changes
Diffstat (limited to 'editor')
| -rw-r--r-- | editor/editor-io.cpp | 4 | ||||
| -rw-r--r-- | editor/editor-main.cpp | 5 | ||||
| -rw-r--r-- | editor/editor.cpp | 4 |
3 files changed, 9 insertions, 4 deletions
diff --git a/editor/editor-io.cpp b/editor/editor-io.cpp index 3f1ae74..ae928e1 100644 --- a/editor/editor-io.cpp +++ b/editor/editor-io.cpp @@ -8,7 +8,7 @@ #include <fstream> void pke_editor_scene_save(const char *file_path) { - srlztn_serialize_helper *helper = pke_serialize_init(pkeSettings.mem.bkt); + srlztn_serialize_helper *helper = pke_serialize_init(pkeSettings.mem_bkt.game_transient); bool failed = false; std::ostringstream o; @@ -57,7 +57,7 @@ void pke_editor_scene_load(const char *file_path) { fprintf(stderr, "Failed to load requested scene file: '%s'\n", file_path); return; } - srlztn_deserialize_helper *helper = pke_deserialize_init(pkeSettings.mem.bkt); + srlztn_deserialize_helper *helper = pke_deserialize_init(pkeSettings.mem_bkt.game_transient); // TODO scene name is in the file? helper->scene = pke_scene_get_by_name(file_path); if (helper->scene == nullptr) { diff --git a/editor/editor-main.cpp b/editor/editor-main.cpp index a037ca6..9bb6d8f 100644 --- a/editor/editor-main.cpp +++ b/editor/editor-main.cpp @@ -18,6 +18,8 @@ int main(int argc, char *argv[]) { fflush(stderr); fprintf(stdout, "\rPKE_EDITOR ENTERING\n"); fprintf(stderr, "\r"); + // HACK + struct pk_membucket *bkt_editor = pk_mem_bucket_create("pke-editor", 2048, PK_MEMBUCKET_FLAG_NONE); // setup { pkeSettings.isSimulationPaused = true; @@ -27,11 +29,14 @@ int main(int argc, char *argv[]) { itfc.OnTick = PkeEditor_Tick; itfc.OnTeardown = PkeEditor_Teardown; itfc.OnImGuiRender = PkeEditor_RecordImGui; + // HACK + LoadedPkePlugins.bkt = bkt_editor; pk_arr_append(&LoadedPkePlugins, &itfc); } // run PkeArgs_Parse(argc, argv); Game_Main({}, argv[0]); + pk_mem_bucket_destroy(bkt_editor); fprintf(stdout, "PKE_EDITOR EXITING\n"); return 0; } diff --git a/editor/editor.cpp b/editor/editor.cpp index 938f3ef..13debfe 100644 --- a/editor/editor.cpp +++ b/editor/editor.cpp @@ -768,12 +768,12 @@ int SortFontGlyphChar(const void *a, const void *b) { void GenerateMTSDF(FontTypeMSDFSettings *msdf_settings, const Asset *a) { static pk_arr *required_font_glyph_chars_arr; - required_font_glyph_chars_arr = pk_new<pk_arr>(pkeSettings.mem.bkt); + required_font_glyph_chars_arr = pk_new<pk_arr>(pkeSettings.mem_bkt.game_transient); required_font_glyph_chars_arr->next = 0; required_font_glyph_chars_arr->reserved = 0; required_font_glyph_chars_arr->stride = sizeof(FontGlyphChar); required_font_glyph_chars_arr->alignment = alignof(FontGlyphChar); - required_font_glyph_chars_arr->bkt = pkeSettings.mem.bkt; + required_font_glyph_chars_arr->bkt = pkeSettings.mem_bkt.game_transient; required_font_glyph_chars_arr->data = nullptr; pk_arr_reserve(required_font_glyph_chars_arr, 3); |
