diff --git a/core/pen/include/file_system.h b/core/pen/include/file_system.h index a2c2b353..6cb95157 100644 --- a/core/pen/include/file_system.h +++ b/core/pen/include/file_system.h @@ -29,6 +29,7 @@ namespace pen bool filesystem_file_exists(const c8* filename); pen_error filesystem_read_file_to_buffer(const c8* filename, void** p_buffer, u32& buffer_size); pen_error filesystem_getmtime(const c8* filename, u32& mtime_out); + size_t filesystem_getsize(const c8* filename); void filesystem_toggle_hidden_files(); pen_error filesystem_enum_volumes(fs_tree_node& results); pen_error filesystem_enum_directory(const c8* directory, fs_tree_node& results, s32 num_wildcards = 0, ...); diff --git a/core/pen/source/osx/os.mm b/core/pen/source/osx/os.mm index 5150ae56..882dd175 100644 --- a/core/pen/source/osx/os.mm +++ b/core/pen/source/osx/os.mm @@ -853,6 +853,11 @@ void os_ignore_slient() { // stub } + + f32 os_get_status_bar_portrait_height() + { + return 0.0f; + } } // diff --git a/core/pen/source/posix/file_system.cpp b/core/pen/source/posix/file_system.cpp index e6367986..8ee04436 100644 --- a/core/pen/source/posix/file_system.cpp +++ b/core/pen/source/posix/file_system.cpp @@ -222,7 +222,6 @@ namespace pen if (num_items == 0) { - return PEN_ERR_FILE_NOT_FOUND; } @@ -300,6 +299,14 @@ namespace pen return PEN_ERR_OK; } + size_t filesystem_getsize(const c8* filename) + { + struct stat stat_res; + memset(&stat_res, 0x0, sizeof(stat_res)); + stat(filename, &stat_res); + return stat_res.st_size; + } + const c8* filesystem_get_user_directory() { static c8 default_dir[1024]; diff --git a/core/put/source/dev_ui.cpp b/core/put/source/dev_ui.cpp index d66ed097..797fac6e 100644 --- a/core/put/source/dev_ui.cpp +++ b/core/put/source/dev_ui.cpp @@ -21,12 +21,6 @@ #include -#if PEN_PLATFORM_IOS -#define DEV_UI_SCALE 3 -#else -#define DEV_UI_SCALE 1 -#endif - using namespace pen; using namespace put; @@ -63,17 +57,17 @@ namespace bool s_initialised = false; bool s_enable_main_menu_bar = true; - void create_texture_atlas() + void create_texture_atlas(float pixel_size) { ImGuiIO& io = ImGui::GetIO(); const Str cousine_reg = pen::os_path_for_resource("data/fonts/cousine-regular.ttf"); - io.Fonts->AddFontFromFileTTF(cousine_reg.c_str(), 14 * DEV_UI_SCALE); + io.Fonts->AddFontFromFileTTF(cousine_reg.c_str(), pixel_size); ImFontConfig config; config.MergeMode = true; static const ImWchar icon_ranges[] = {ICON_MIN_FA, ICON_MAX_FA, 0}; const Str font_awesome = pen::os_path_for_resource("data/fonts/fontawesome-webfont.ttf"); - io.Fonts->AddFontFromFileTTF(font_awesome.c_str(), 14 * DEV_UI_SCALE, &config, icon_ranges); + io.Fonts->AddFontFromFileTTF(font_awesome.c_str(), pixel_size, &config, icon_ranges); // Build texture atlas unsigned char* pixels; @@ -313,7 +307,7 @@ namespace put } } - bool init(ImGuiStyle& style) + bool init(ImGuiStyle& style, float font_pixel_size) { create_context(); @@ -346,7 +340,7 @@ namespace put s_imgui_rs.imgui_shader = pmfx::load_shader("imgui"); s_imgui_rs.imgui_ex_shader = pmfx::load_shader("imgui_ex"); - create_texture_atlas(); + create_texture_atlas(font_pixel_size); create_render_states(); diff --git a/core/put/source/dev_ui.h b/core/put/source/dev_ui.h index b91ae14e..a40b72bb 100644 --- a/core/put/source/dev_ui.h +++ b/core/put/source/dev_ui.h @@ -14,6 +14,13 @@ #define IMG(I) (void*)(intptr_t) I +#if PEN_PLATFORM_IOS +#define DEV_UI_SCALE 3 +#else +#define DEV_UI_SCALE 1 +#endif + + namespace put { namespace dev_ui @@ -67,7 +74,7 @@ namespace put void create_context(); ImGuiStyle& default_pmtech_style(); - bool init(ImGuiStyle& style = default_pmtech_style()); + bool init(ImGuiStyle& style = default_pmtech_style(), f32 font_pixel_size = 14.0f * DEV_UI_SCALE); void shutdown(); void render(); void update();