@@ -273,15 +273,34 @@ class PlatformView {
273273 const std::string error_message,
274274 bool transient) = 0;
275275
276- // TODO(garyq): Implement a proper asset_resolver replacement instead of
277- // overwriting the entire asset manager.
278276 // --------------------------------------------------------------------------
279- // / @brief Sets the asset manager of the engine to asset_manager
280- // /
281- // / @param[in] asset_manager The asset manager to use.
282- // /
283- virtual void UpdateAssetManager (
284- std::shared_ptr<AssetManager> asset_manager) = 0;
277+ // / @brief Replaces the asset resolver handled by the engine's
278+ // / AssetManager of the specified `type` with
279+ // / `updated_asset_resolver`. The matching AssetResolver is
280+ // / removed and replaced with `updated_asset_resolvers`.
281+ // /
282+ // / AssetResolvers should be updated when the existing resolver
283+ // / becomes obsolete and a newer one becomes available that
284+ // / provides updated access to the same type of assets as the
285+ // / existing one. This update process is meant to be performed
286+ // / at runtime.
287+ // /
288+ // / If a null resolver is provided, nothing will be done. If no
289+ // / matching resolver is found, the provided resolver will be
290+ // / added to the end of the AssetManager resolvers queue. The
291+ // / replacement only occurs with the first matching resolver.
292+ // / Any additional matching resolvers are untouched.
293+ // /
294+ // / @param[in] updated_asset_resolver The asset resolver to replace the
295+ // / resolver of matching type with.
296+ // /
297+ // / @param[in] type The type of AssetResolver to update. Only resolvers of
298+ // / the specified type will be replaced by the updated
299+ // / resolver.
300+ // /
301+ virtual void UpdateAssetResolverByType (
302+ std::unique_ptr<AssetResolver> updated_asset_resolver,
303+ AssetResolver::AssetResolverType type) = 0;
285304 };
286305
287306 // ----------------------------------------------------------------------------
@@ -720,14 +739,34 @@ class PlatformView {
720739 const std::string error_message,
721740 bool transient);
722741
723- // TODO(garyq): Implement a proper asset_resolver replacement instead of
724- // overwriting the entire asset manager.
725742 // --------------------------------------------------------------------------
726- // / @brief Sets the asset manager of the engine to asset_manager
727- // /
728- // / @param[in] asset_manager The asset manager to use.
729- // /
730- virtual void UpdateAssetManager (std::shared_ptr<AssetManager> asset_manager);
743+ // / @brief Replaces the asset resolver handled by the engine's
744+ // / AssetManager of the specified `type` with
745+ // / `updated_asset_resolver`. The matching AssetResolver is
746+ // / removed and replaced with `updated_asset_resolvers`.
747+ // /
748+ // / AssetResolvers should be updated when the existing resolver
749+ // / becomes obsolete and a newer one becomes available that
750+ // / provides updated access to the same type of assets as the
751+ // / existing one. This update process is meant to be performed
752+ // / at runtime.
753+ // /
754+ // / If a null resolver is provided, nothing will be done. If no
755+ // / matching resolver is found, the provided resolver will be
756+ // / added to the end of the AssetManager resolvers queue. The
757+ // / replacement only occurs with the first matching resolver.
758+ // / Any additional matching resolvers are untouched.
759+ // /
760+ // / @param[in] updated_asset_resolver The asset resolver to replace the
761+ // / resolver of matching type with.
762+ // /
763+ // / @param[in] type The type of AssetResolver to update. Only resolvers of
764+ // / the specified type will be replaced by the updated
765+ // / resolver.
766+ // /
767+ virtual void UpdateAssetResolverByType (
768+ std::unique_ptr<AssetResolver> updated_asset_resolver,
769+ AssetResolver::AssetResolverType type);
731770
732771 protected:
733772 PlatformView::Delegate& delegate_;
0 commit comments