diff --git a/main.cpp b/main.cpp index e77df49..acf32ec 100644 --- a/main.cpp +++ b/main.cpp @@ -374,7 +374,7 @@ int main(int, char**) for (auto themePath : Theme::availableThemes) { if (themePath.stem().string().starts_with(filter)) { const bool is_selected = themePath == theme->file_path; - if (ImGui::Selectable(themePath.stem().c_str(), is_selected)) { + if (ImGui::Selectable(themePath.stem().generic_string().c_str(), is_selected)) { delete theme; theme = new Theme(themePath); theme->Apply(accent_color); diff --git a/meson.build b/meson.build index 08d7663..bc7e8a2 100644 --- a/meson.build +++ b/meson.build @@ -6,9 +6,11 @@ cmake = import('cmake') if get_option('debug') add_global_arguments('-DDEBUG', language: 'cpp') endif -add_global_arguments('-DIMGUI_IMPL_OPENGL_ES2', language: 'cpp') +if get_option('gles') + add_global_arguments('-DIMGUI_IMPL_OPENGL_ES2', language: 'cpp') +endif smx_opts = cmake.subproject_options() -smx_opts.add_cmake_defines({'SDL_MIXER_X_STATIC': true, 'SDL_MIXER_X_SHARED': false}) +smx_opts.add_cmake_defines({'SDL_MIXER_X_STATIC': true, 'SDL_MIXER_X_SHARED': false, 'USE_MIDI_NATIVE_ALT': false, 'USE_MIDI_NATIVE': false}) smx_opts.set_override_option('c_std', 'c99') smx_subproj = cmake.subproject('SDL-Mixer-X', options: smx_opts) #raudio_lib = static_library('raudio', 'raudio/src/raudio.c', c_args: ['-DRAUDIO_STANDALONE', '-DSUPPORT_MODULE_RAUDIO', '-DSUPPORT_FILEFORMAT_WAV', '-DSUPPORT_FILEFORMAT_OGG', '-DSUPPORT_FILEFORMAT_MP3', '-DSUPPORT_FILEFORMAT_QOA', '-DSUPPORT_FILEFORMAT_FLAC', '-DSUPPORT_FILEFORMAT_XM', '-DSUPPORT_FILEFORMAT_MOD', '-w']) diff --git a/meson.options b/meson.options new file mode 100644 index 0000000..67886f5 --- /dev/null +++ b/meson.options @@ -0,0 +1 @@ +option('gles', type: 'boolean', value: false) diff --git a/theme.cpp b/theme.cpp index 628ede3..53e80ee 100644 --- a/theme.cpp +++ b/theme.cpp @@ -207,7 +207,7 @@ bool Theme::ShowEditor(bool* open, Theme* &theme) { for (auto themePath : Theme::availableThemes) { if (themePath.stem().string().starts_with(filter)) { const bool is_selected = themePath == selectedThemePath; - if (ImGui::Selectable(themePath.stem().c_str(), is_selected)) { + if (ImGui::Selectable(themePath.stem().generic_string().c_str(), is_selected)) { selectedThemePath = themePath; } if (is_selected) { @@ -249,9 +249,9 @@ bool Theme::ShowEditor(bool* open, Theme* &theme) { if (ImGui::BeginListBox("##Themes", ImVec2(ImGui::GetWindowWidth() - (ImGui::GetStyle().WindowPadding.x * 2.0f), -ImGui::GetFrameHeightWithSpacing() - ImGui::GetTextLineHeightWithSpacing() - ImGui::GetStyle().WindowPadding.y))) { for (auto themePath : Theme::availableThemes) { if (themePath.stem().string().starts_with(filter)) { - const bool is_selected = strcmp(themePath.stem().c_str(), selectedThemeName) == 0; - if (ImGui::Selectable(themePath.stem().c_str(), is_selected)) { - strncpy(selectedThemeName, themePath.stem().c_str(), 1024); + const bool is_selected = strcmp(themePath.stem().generic_string().c_str(), selectedThemeName) == 0; + if (ImGui::Selectable(themePath.stem().generic_string().c_str(), is_selected)) { + strncpy(selectedThemeName, themePath.stem().generic_string().c_str(), 1024); } if (is_selected) { ImGui::SetItemDefaultFocus(); @@ -269,7 +269,7 @@ bool Theme::ShowEditor(bool* open, Theme* &theme) { filter[0] = '\0'; saveAsOpen = false; theme->Save(Theme::themeDir / selectedThemePath.replace_extension(".json")); - theme->file_path = selectedThemePath; + theme->file_path = selectedThemePath.generic_string(); } } ImGui::SameLine(); @@ -344,6 +344,9 @@ void Theme::Save(string path) { } updateAvailableThemes(); } +void Theme::Save(path path) { + Save(path.string()); +} void Theme::updateAvailableThemes() { themeDir = path(prefPath) / path("themes"); create_directories(themeDir); @@ -424,4 +427,7 @@ Theme::Theme(string path) : Theme() { stream.close(); } file_path = path; +} +Theme::Theme(path path) : Theme(path.string()) { + } \ No newline at end of file diff --git a/theme.h b/theme.h index bc1cb51..3a7cec1 100644 --- a/theme.h +++ b/theme.h @@ -20,7 +20,9 @@ class Theme { static bool ShowEditor(bool *open, Theme* &theme); void Apply(float hue); void Save(string path); + void Save(path path); Theme(); Theme(bool dark); Theme(string path); + Theme(path path); }; \ No newline at end of file diff --git a/x86_64-w64-mingw32.txt b/x86_64-w64-mingw32.txt index 64a62bb..554f289 100644 --- a/x86_64-w64-mingw32.txt +++ b/x86_64-w64-mingw32.txt @@ -12,3 +12,10 @@ system = 'windows' cpu_family = 'x86_64' cpu = 'x86_64' endian = 'little' + +[properties] +cmake_toolchain_file = '/usr/share/mingw/toolchain-x86_64-w64-mingw32.cmake' +cmake_defaults = false + +[cmake] +