mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
No mipmaps on subtitles
This commit is contained in:
parent
df9fc8121f
commit
56def6cd68
@ -75,7 +75,7 @@ namespace NewHorizons.Handlers
|
||||
{
|
||||
Logger.Log($"Adding subtitle for {mod.ModHelper.Manifest.Name}");
|
||||
|
||||
var tex = ImageUtilities.GetTexture(mod, filepath);
|
||||
var tex = ImageUtilities.GetTexture(mod, filepath, false);
|
||||
if (tex == null) return;
|
||||
|
||||
var sprite = Sprite.Create(tex, new Rect(0.0f, 0.0f, tex.width, SUBTITLE_HEIGHT), new Vector2(0.5f, 0.5f), 100.0f);
|
||||
|
||||
@ -15,6 +15,11 @@ namespace NewHorizons.Utility
|
||||
private static List<Texture2D> _generatedTextures = new List<Texture2D>();
|
||||
|
||||
public static Texture2D GetTexture(IModBehaviour mod, string filename)
|
||||
{
|
||||
return GetTexture(mod, filename, true);
|
||||
}
|
||||
|
||||
public static Texture2D GetTexture(IModBehaviour mod, string filename, bool useMipmaps)
|
||||
{
|
||||
// Copied from OWML but without the print statement lol
|
||||
var path = mod.ModHelper.Manifest.ModFolderPath + filename;
|
||||
@ -28,7 +33,7 @@ namespace NewHorizons.Utility
|
||||
try
|
||||
{
|
||||
var data = File.ReadAllBytes(path);
|
||||
var texture = new Texture2D(2, 2);
|
||||
var texture = new Texture2D(2, 2, TextureFormat.RGBA32, useMipmaps);
|
||||
texture.name = Path.GetFileNameWithoutExtension(path);
|
||||
texture.LoadImage(data);
|
||||
_loadedTextures.Add(path, texture);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user