Fix Windows support on MinGW-w64 on Arch Linux
This commit is contained in:
parent
0a85c36a7d
commit
fc21f91c21
6 changed files with 26 additions and 8 deletions
2
main.cpp
2
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);
|
||||
|
|
|
@ -6,9 +6,11 @@ cmake = import('cmake')
|
|||
if get_option('debug')
|
||||
add_global_arguments('-DDEBUG', language: 'cpp')
|
||||
endif
|
||||
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'])
|
||||
|
|
1
meson.options
Normal file
1
meson.options
Normal file
|
@ -0,0 +1 @@
|
|||
option('gles', type: 'boolean', value: false)
|
16
theme.cpp
16
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);
|
||||
|
@ -425,3 +428,6 @@ Theme::Theme(string path) : Theme() {
|
|||
}
|
||||
file_path = path;
|
||||
}
|
||||
Theme::Theme(path path) : Theme(path.string()) {
|
||||
|
||||
}
|
2
theme.h
2
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);
|
||||
};
|
|
@ -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]
|
||||
|
||||
|
|
Loading…
Reference in a new issue