diff --git a/src/application/setups/debugger/commands/asset_commands.cpp b/src/application/setups/debugger/commands/asset_commands.cpp index 9e3c7b436..a0d472691 100644 --- a/src/application/setups/debugger/commands/asset_commands.cpp +++ b/src/application/setups/debugger/commands/asset_commands.cpp @@ -66,7 +66,7 @@ void create_unpathed_asset_id_command::undo(const debugger_command_input in) template std::string create_pathed_asset_id_command::describe() const { - return typesafe_sprintf("Started tracking asset file: %x", construct_from.get_source_path().filename_first()); + return typesafe_sprintf("Started tracking asset file: %x", construct_from.get_loadable_path().filename_first()); } template diff --git a/src/application/setups/debugger/detail/get_id_or_import.h b/src/application/setups/debugger/detail/get_id_or_import.h index f8c61599c..ad3e4a673 100644 --- a/src/application/setups/debugger/detail/get_id_or_import.h +++ b/src/application/setups/debugger/detail/get_id_or_import.h @@ -27,7 +27,7 @@ I get_id_or_import( def_type def; def.set_source_path(source_path); - const auto resolved = def.get_source_path().resolve(project_path); + const auto resolved = def.get_loadable_path().resolve(project_path); ::load_meta_lua_if_exists(in.lua, def.meta, resolved); diff --git a/src/application/setups/debugger/detail/update_official_content.h b/src/application/setups/debugger/detail/update_official_content.h index d388d3ab6..7a1889943 100644 --- a/src/application/setups/debugger/detail/update_official_content.h +++ b/src/application/setups/debugger/detail/update_official_content.h @@ -82,7 +82,7 @@ inline void update_official_content(const debugger_command_input cmd_in, update_ auto find_and_remap_by_path = [&](const auto& reference_pool, const auto& target_pool, auto& field) { if (const auto found = mapped_or_nullptr(reference_pool, field)) { - const auto source_path = found->get_source_path(); + const auto source_path = found->get_loadable_path(); if (const auto found_in_new = ::find_asset_id_by_path(source_path, target_pool)) { field = *found_in_new; @@ -147,7 +147,7 @@ inline void update_official_content(const debugger_command_input cmd_in, update_ auto add_pathed_assets = [&](auto& custom, const auto& official, const std::string& type_name) { for (const auto& o : official) { - const auto source_path = o.get_source_path(); + const auto source_path = o.get_loadable_path(); const auto existing_custom_asset = find_asset_id_by_path(source_path, custom); if (existing_custom_asset.has_value()) { diff --git a/src/application/setups/debugger/gui/debugger_pathed_asset_gui.cpp b/src/application/setups/debugger/gui/debugger_pathed_asset_gui.cpp index 1cb4ac376..f8218c957 100644 --- a/src/application/setups/debugger/gui/debugger_pathed_asset_gui.cpp +++ b/src/application/setups/debugger/gui/debugger_pathed_asset_gui.cpp @@ -129,7 +129,7 @@ void debugger_pathed_asset_gui::perform( for_each_id_and_object(definitions, [&](const asset_id_type id, const def_type& object) mutable { - const auto path = object.get_source_path(); + const auto path = object.get_loadable_path(); auto new_entry = asset_entry_type(path, id); #if BUILD_LOCATION_FINDERS diff --git a/src/application/setups/debugger/property_debugger/widgets/frames_prologue_widget.cpp b/src/application/setups/debugger/property_debugger/widgets/frames_prologue_widget.cpp index b08c9f5f4..a565a7799 100644 --- a/src/application/setups/debugger/property_debugger/widgets/frames_prologue_widget.cpp +++ b/src/application/setups/debugger/property_debugger/widgets/frames_prologue_widget.cpp @@ -89,7 +89,7 @@ bool frames_prologue_widget::handle_prologue(const std::string&, plain_animation const auto& frames = source_animation.frames; const auto& first_image_def = image_defs[frames[0].image_id]; - const auto& first_source_path = first_image_def.get_source_path(); + const auto& first_source_path = first_image_def.get_loadable_path(); const auto first_path_no_ext = augs::path_type(first_source_path.path).replace_extension(""); frames_type new_frames; diff --git a/src/application/setups/debugger/property_debugger/widgets/image_color_picker_widget.h b/src/application/setups/debugger/property_debugger/widgets/image_color_picker_widget.h index f3d8e59d8..174b94a5a 100644 --- a/src/application/setups/debugger/property_debugger/widgets/image_color_picker_widget.h +++ b/src/application/setups/debugger/property_debugger/widgets/image_color_picker_widget.h @@ -33,7 +33,7 @@ struct image_color_picker_widget { } void update_preview() const { - const auto& p = defs[id].get_source_path(); + const auto& p = defs[id].get_loadable_path(); if (current_preview.path != p) { current_preview.image.from_file(p.resolve(project_path)); diff --git a/src/application/setups/debugger/property_debugger/widgets/pathed_asset_widget.h b/src/application/setups/debugger/property_debugger/widgets/pathed_asset_widget.h index a138b9bf6..9a967b936 100644 --- a/src/application/setups/debugger/property_debugger/widgets/pathed_asset_widget.h +++ b/src/application/setups/debugger/property_debugger/widgets/pathed_asset_widget.h @@ -31,7 +31,7 @@ struct pathed_asset_widget { ) const { static_assert(handles); - return typesafe_sprintf("Set %x to %x", formatted_label, augs::filename_first(get_viewable_pool(defs)[to].get_source_path().path)); + return typesafe_sprintf("Set %x to %x", formatted_label, augs::filename_first(get_viewable_pool(defs)[to].get_loadable_path().path)); } template @@ -52,9 +52,9 @@ struct pathed_asset_widget { /* Definitions might get altered so we need to keep a copy */ const auto found_def = mapped_or_nullptr(definitions, object); - using P = remove_crefget_source_path())>; + using P = remove_crefget_loadable_path())>; - const auto current_source = found_def ? P(found_def->get_source_path()) : P(); + const auto current_source = found_def ? P(found_def->get_loadable_path()) : P(); chooser.perform(identity_label, current_source, project_path, on_choice, true_returner()); diff --git a/src/application/setups/editor/gui/editor_filesystem_gui.cpp b/src/application/setups/editor/gui/editor_filesystem_gui.cpp index f44c85b53..ecf06227b 100644 --- a/src/application/setups/editor/gui/editor_filesystem_gui.cpp +++ b/src/application/setups/editor/gui/editor_filesystem_gui.cpp @@ -739,7 +739,7 @@ void editor_filesystem_gui::rebuild_special_filesystem(editor_filesystem_node& r auto result = new_node.custom_thumbnail_path; if (auto sprite = flavour.template find()) { - result = built_officials.viewables.image_definitions[sprite->image_id].get_source_path().resolve({}); + result = built_officials.viewables.image_definitions[sprite->image_id].get_loadable_path().resolve({}); } if (auto animation = flavour.template find()) { diff --git a/src/application/setups/editor/official/create_official_resources.cpp b/src/application/setups/editor/official/create_official_resources.cpp index 04416575d..15ead2c34 100644 --- a/src/application/setups/editor/official/create_official_resources.cpp +++ b/src/application/setups/editor/official/create_official_resources.cpp @@ -299,7 +299,7 @@ void create_official_filesystem_from( new_node.name = typed_resource.cached_official_name; if (auto sprite = flavour.template find()) { - new_node.custom_thumbnail_path = initial_intercosm.viewables.image_definitions[sprite->image_id].get_source_path().resolve({}); + new_node.custom_thumbnail_path = initial_intercosm.viewables.image_definitions[sprite->image_id].get_loadable_path().resolve({}); } if (auto animation = flavour.template find()) { diff --git a/src/test_scenes/test_scene_images.cpp b/src/test_scenes/test_scene_images.cpp index d56151233..320efe808 100644 --- a/src/test_scenes/test_scene_images.cpp +++ b/src/test_scenes/test_scene_images.cpp @@ -57,7 +57,7 @@ void load_test_scene_images( image_definition definition; definition.set_source_path({ at_stem.string(), true }); - const auto resolved_no_ext = definition.get_source_path().resolve({}); + const auto resolved_no_ext = definition.get_loadable_path().resolve({}); const auto with_existent_ext = augs::first_existing_extension(resolved_no_ext, augs::IMAGE_EXTENSIONS); if (with_existent_ext.empty()) { diff --git a/src/test_scenes/test_scene_sounds.cpp b/src/test_scenes/test_scene_sounds.cpp index 797bddd1f..ac8c1c03d 100644 --- a/src/test_scenes/test_scene_sounds.cpp +++ b/src/test_scenes/test_scene_sounds.cpp @@ -51,7 +51,7 @@ void load_test_scene_sounds(sound_definitions_map& all_definitions) { try_with(stem); try_with(path(stem) += "_1"); - if (!definition.get_source_path().path.empty()) { + if (!definition.get_loadable_path().path.empty()) { const auto new_allocation = all_definitions.allocate(std::move(definition)); (void)new_allocation; (void)id; diff --git a/src/view/get_asset_pool.h b/src/view/get_asset_pool.h index 31eb3e7f9..cc216a7d0 100644 --- a/src/view/get_asset_pool.h +++ b/src/view/get_asset_pool.h @@ -48,10 +48,10 @@ auto& access_asset_pool(E&& cmd_in, cosmos_common_significant_access access) { template decltype(auto) get_displayed_name(const T& object) { if constexpr(std::is_same_v) { - return cut_trailing_number_and_spaces(object.get_source_path().get_prettified_filename()); + return cut_trailing_number_and_spaces(object.get_loadable_path().get_prettified_filename()); } else { - return object.get_source_path().get_prettified_filename(); + return object.get_loadable_path().get_prettified_filename(); } } diff --git a/src/view/viewables/all_viewables_defs.cpp b/src/view/viewables/all_viewables_defs.cpp index c7db49f01..9c8b86213 100644 --- a/src/view/viewables/all_viewables_defs.cpp +++ b/src/view/viewables/all_viewables_defs.cpp @@ -23,7 +23,7 @@ std::optional find_asset_id_by_path( for_each_id_and_object(definitions, [&result_id, &searched_path](const auto id, const auto& l) { - if (searched_path == l.get_source_path()) { + if (searched_path == l.get_loadable_path()) { result_id = id; } } diff --git a/src/view/viewables/asset_definition_view.h b/src/view/viewables/asset_definition_view.h index a9bfb4d8e..da5fd50fa 100644 --- a/src/view/viewables/asset_definition_view.h +++ b/src/view/viewables/asset_definition_view.h @@ -23,7 +23,7 @@ class asset_definition_view { T& d ) : def(d), - resolved_source_path(d.get_source_path().resolve(project_dir)), + resolved_source_path(d.get_loadable_path().resolve(project_dir)), project_dir(project_dir) { } diff --git a/src/view/viewables/image_definition.h b/src/view/viewables/image_definition.h index 3314a2b3f..bdc0c4938 100644 --- a/src/view/viewables/image_definition.h +++ b/src/view/viewables/image_definition.h @@ -55,7 +55,7 @@ struct image_definition { return source_image; } - auto get_source_path() const { + auto get_loadable_path() const { const bool is_generated_in_cache = get_source_gif_path() != std::nullopt; if (is_generated_in_cache) { diff --git a/src/view/viewables/sound_definition.h b/src/view/viewables/sound_definition.h index 9025ea778..93c3c5c86 100644 --- a/src/view/viewables/sound_definition.h +++ b/src/view/viewables/sound_definition.h @@ -23,7 +23,7 @@ struct sound_definition { source_sound = p; } - const auto& get_source_path() const { + const auto& get_loadable_path() const { return source_sound; } }; diff --git a/src/view/viewables/standard_atlas_distribution.cpp b/src/view/viewables/standard_atlas_distribution.cpp index bfc6260a5..8b9092d3c 100644 --- a/src/view/viewables/standard_atlas_distribution.cpp +++ b/src/view/viewables/standard_atlas_distribution.cpp @@ -113,7 +113,7 @@ void regenerate_and_gather_subjects( output.clear(); for (auto&& r : in.necessary_image_definitions) { - output.images.emplace_back(r.second.get_source_path().path); + output.images.emplace_back(r.second.get_loadable_path().path); } int total_to_regenerate = 0; @@ -245,7 +245,7 @@ general_atlas_output create_general_atlas( { for (auto&& r : subjects.necessary_image_definitions) { - out.necessary_atlas_entries[r.first] = baked.images.at(r.second.get_source_path().path); + out.necessary_atlas_entries[r.first] = baked.images.at(r.second.get_loadable_path().path); } auto make_view = [&subjects](const auto& def) {