SMAPI - Stardew Modding API

SMAPI - Stardew Modding API

971k Downloads

Mechanic to premultiply textures that are not loaded from disk directly

Entoarox opened this issue ยท 1 comments

commented

Currently, if someone is for some reason using textures that are not loaded directly from disk into the content manager, they need to premultiply them manually.
Not only is this inefficient, it greatly increases the risk of issues being caused by mods not handling the premultiply properly.

Thus, I ask for a method to either load streams into the content manager IContentHelper.LoadFromStream<T>(Stream stream) or to offload premultiplying a texture to SMAPI, IContentHelper.Premultiply(Texture2D texture)

Personally I would recommend the first, as it can act as a wrapper for more then just premultiplying textures.

commented

This is a pretty niche task, and nobody else has requested it in the last year, so I'll close this as won't fix. The easiest option is to just read the file from disk (possibly writing the stream to a temporary file if needed), though you could premultiply yourself or use reflection to access SMAPI's internal method (not recommended).