Gamua / Starling-Framework

The Cross Platform Game Engine
http://www.starling-framework.org
Other
2.82k stars 821 forks source link

Asset Manager: Added detection of extension & mime type for embed assets #1090

Closed Adolio closed 2 years ago

Adolio commented 2 years ago

Hi Daniel,

Here is a proposal to enable the asset factories for embed assets. No API should be broken, I managed to add extra optional parameters to enforce URL and/or mime type.

👉 In order to enable this feature, an extra compiler option is required to keep the "Embed" metadata to access it from the AssetManager.

Thanks in advance for your review.

Best, Aurélien

PrimaryFeather commented 2 years ago

Hey Aurélien, thanks a lot for the pull request! This is looking really useful!

I'll review it in detail soon, and then merge and/or add some comments. 😄

Adolio commented 2 years ago

Thanks Daniel, I'm looking forward to have your feedback 🙂

PrimaryFeather commented 2 years ago

Great work, Aurélien! That's a great addition and simplifies usage of embedded assets greatly. Thanks again!!

In a follow-up commit, I moved the child processing logic into a local method to remove code duplication; but that's just me being overly pedantic. 😜 (See https://github.com/Gamua/Starling-Framework/commit/8dab458414c20b85015e1f126ebd8de3ec66c3ea.)

Adolio commented 2 years ago

Thanks Daniel!

Yep, your extra commit does completely make sense to me as well 😄 Well done 👍