| 1365 | } |
| 1366 | } |
| 1367 | void reshade::runtime::set_current_preset_path(const char *path_in) |
| 1368 | { |
| 1369 | if (path_in == nullptr) |
| 1370 | return; |
| 1371 | |
| 1372 | std::filesystem::path preset_path = std::filesystem::u8path(path_in); |
| 1373 | |
| 1374 | // Only change preset when this is a valid preset path |
| 1375 | std::error_code ec; |
| 1376 | if (resolve_preset_path(preset_path, ec)) |
| 1377 | { |
| 1378 | if (is_loading()) |
| 1379 | { |
| 1380 | _current_preset_path = std::move(preset_path); |
| 1381 | } |
| 1382 | else |
| 1383 | { |
| 1384 | // Stop any preset transition that may still be happening |
| 1385 | _is_in_preset_transition = false; |
| 1386 | |
| 1387 | // Reload preset even if it is the same as before |
| 1388 | if (preset_path != _current_preset_path) |
| 1389 | { |
| 1390 | // First save current preset, before switching to a new one |
| 1391 | save_current_preset(); |
| 1392 | |
| 1393 | _current_preset_path = std::move(preset_path); |
| 1394 | |
| 1395 | save_config(); |
| 1396 | } |
| 1397 | |
| 1398 | load_current_preset(); |
| 1399 | } |
| 1400 | } |
| 1401 | } |
| 1402 | |
| 1403 | void reshade::runtime::reorder_techniques(size_t count, const api::effect_technique *techniques) |
| 1404 | { |
no test coverage detected