diff --git a/include/Helpers/StringHelpers.cpp b/include/Helpers/StringHelpers.cpp index a6d1551..7ef6bb6 100644 --- a/include/Helpers/StringHelpers.cpp +++ b/include/Helpers/StringHelpers.cpp @@ -48,7 +48,7 @@ std::string read_file_to_string(const std::filesystem::path& filePath) { // Could also use SDL_LoadFile, but that allocates into a void* and involves a copy into std::string std::string toRet; - SDL_IOStream* file = SDL_IOFromFile(filePath.c_str(), "rb"); + SDL_IOStream* file = SDL_IOFromFile(filePath.string().c_str(), "rb"); if(!file) throw std::runtime_error("[read_file_to_string] Could not open file " + filePath.string()); Sint64 fileSize = SDL_GetIOSize(file); diff --git a/src/DrawingProgram/Tools/EditTools/ImageEditTool.cpp b/src/DrawingProgram/Tools/EditTools/ImageEditTool.cpp index f8abdd6..0cb6d6d 100644 --- a/src/DrawingProgram/Tools/EditTools/ImageEditTool.cpp +++ b/src/DrawingProgram/Tools/EditTools/ImageEditTool.cpp @@ -70,7 +70,7 @@ void ImageEditTool::edit_gui() { ); #endif t.open_file_selector("Download File", {{"Any File", "*"}}, [resourceData](const std::filesystem::path& p, const auto& e) { - SDL_SaveFile(p.c_str(), resourceData->data->c_str(), resourceData->data->size()); + SDL_SaveFile(p.string().c_str(), resourceData->data->c_str(), resourceData->data->size()); }, resourceData->name, true); } }); diff --git a/src/DrawingProgram/Tools/ScreenshotTool.cpp b/src/DrawingProgram/Tools/ScreenshotTool.cpp index 9042de8..c38d12a 100644 --- a/src/DrawingProgram/Tools/ScreenshotTool.cpp +++ b/src/DrawingProgram/Tools/ScreenshotTool.cpp @@ -352,7 +352,7 @@ void ScreenshotTool::take_screenshot(const std::filesystem::path& filePath, Scre #ifndef __EMSCRIPTEN__ try { auto skData = out.detachAsData(); - if(!SDL_SaveFile(filePath.c_str(), skData->bytes(), skData->size())) + if(!SDL_SaveFile(filePath.string().c_str(), skData->bytes(), skData->size())) throw std::runtime_error("SDL_SaveFile failed with error: " + std::string(SDL_GetError())); } catch(const std::exception& e) { @@ -382,7 +382,7 @@ void ScreenshotTool::take_screenshot(const std::filesystem::path& filePath, Scre #ifndef __EMSCRIPTEN__ try { auto skData = out.detachAsData(); - if(!SDL_SaveFile(filePath.c_str(), skData->bytes(), skData->size())) + if(!SDL_SaveFile(filePath.string().c_str(), skData->bytes(), skData->size())) throw std::runtime_error("SDL_SaveFile failed with error: " + std::string(SDL_GetError())); } catch(const std::exception& e) { diff --git a/src/GUIHolder.cpp b/src/GUIHolder.cpp index 0b1c1ba..1f31f40 100644 --- a/src/GUIHolder.cpp +++ b/src/GUIHolder.cpp @@ -28,12 +28,12 @@ GUIHolder::GUIHolder(MainProgram& m): void GUIHolder::load_icons_at(const std::filesystem::path& pathToLoad) { int globCount; - char** filesInPath = SDL_GlobDirectory(pathToLoad.c_str(), nullptr, 0, &globCount); + char** filesInPath = SDL_GlobDirectory(pathToLoad.string().c_str(), nullptr, 0, &globCount); if(filesInPath) { for(int i = 0; i < globCount; i++) { std::filesystem::path filePath = pathToLoad / std::filesystem::path(filesInPath[i]); SDL_PathInfo fileInfo; - if(SDL_GetPathInfo(filePath.c_str(), &fileInfo) && fileInfo.type == SDL_PATHTYPE_FILE) { + if(SDL_GetPathInfo(filePath.string().c_str(), &fileInfo) && fileInfo.type == SDL_PATHTYPE_FILE) { std::string iconRelativePath = filePath.relative_path().string(); std::replace(iconRelativePath.begin(), iconRelativePath.end(), '\\', '/'); std::string iconData = read_file_to_string(iconRelativePath); diff --git a/src/Toolbar.cpp b/src/Toolbar.cpp index ef1ed79..8b35e62 100644 --- a/src/Toolbar.cpp +++ b/src/Toolbar.cpp @@ -220,12 +220,12 @@ void Toolbar::load_licenses() { { int globCount; std::filesystem::path third_party_license_path("data/third_party_licenses"); - char** filesInPath = SDL_GlobDirectory(third_party_license_path.c_str(), nullptr, 0, &globCount); + char** filesInPath = SDL_GlobDirectory(third_party_license_path.string().c_str(), nullptr, 0, &globCount); if(filesInPath) { for(int i = 0; i < globCount; i++) { std::filesystem::path filePath = third_party_license_path / std::filesystem::path(filesInPath[i]); SDL_PathInfo fileInfo; - if(SDL_GetPathInfo(filePath.c_str(), &fileInfo) && fileInfo.type == SDL_PATHTYPE_FILE) { + if(SDL_GetPathInfo(filePath.string().c_str(), &fileInfo) && fileInfo.type == SDL_PATHTYPE_FILE) { thirdPartyLicenses.emplace_back(filePath.filename().string(), read_file_to_string(filePath)); } } @@ -1837,7 +1837,7 @@ void Toolbar::general_settings_inner_gui() { slider_scalar_field(gui, "tablet brush minimum size", "Brush relative minimum size", &main.conf.tabletOptions.brushMinimumSize, 0.0f, 1.0f, {.decimalPrecision = 3}); checkbox_boolean_field(gui, "tablet zoom with button method", "Zoom when pen touching tablet and pen button assigned to middle click is held", &main.conf.tabletOptions.zoomWhilePenDownAndButtonHeld); #ifdef _WIN32 - checkbox_boolean_field(gui, "mouse ignore when pen proximity", "Ignore mouse movement when pen in proximity", &tabletOptions.ignoreMouseMovementWhenPenInProximity); + checkbox_boolean_field(gui, "mouse ignore when pen proximity", "Ignore mouse movement when pen in proximity", &main.conf.tabletOptions.ignoreMouseMovementWhenPenInProximity); #endif }); break; diff --git a/src/World.cpp b/src/World.cpp index a4eb76f..8331046 100644 --- a/src/World.cpp +++ b/src/World.cpp @@ -469,7 +469,7 @@ void World::save_to_file(const std::filesystem::path& filePathToSaveAt) { f.view() ); #else - if(!SDL_SaveFile(filePath.c_str(), f.view().data(), f.view().size())) + if(!SDL_SaveFile(filePath.string().c_str(), f.view().data(), f.view().size())) throw std::runtime_error("SDL_SaveFile failed with error: " + std::string(SDL_GetError())); #endif diff --git a/src/main.cpp b/src/main.cpp index 03ca5e8..c332059 100755 --- a/src/main.cpp +++ b/src/main.cpp @@ -704,7 +704,7 @@ SDL_AppResult SDL_AppEvent(void *appstate, SDL_Event *event) { break; case SDL_EVENT_MOUSE_MOTION: #ifdef _WIN32 - if(!mS.m->toolbar.tabletOptions.ignoreMouseMovementWhenPenInProximity || !mS.m->input.pen.inProximity) + if(!mS.m->conf.tabletOptions.ignoreMouseMovementWhenPenInProximity || !mS.m->input.pen.inProximity) #endif { mS.m->input.backend_mouse_motion_update(event->motion);