This commit is contained in:
Nick 2022-07-25 21:26:06 -04:00
commit 2e49a1df23
2 changed files with 4 additions and 3 deletions

View File

@ -150,7 +150,8 @@ namespace NewHorizons.Builder.Atmosphere
try try
{ {
image = ImageUtilities.GetTexture(mod, atmo.clouds.texturePath); // qm cloud type = should wrap, otherwise clamp like normal
image = ImageUtilities.GetTexture(mod, atmo.clouds.texturePath, wrap: atmo.clouds.cloudsPrefab == CloudPrefabType.QuantumMoon);
if (atmo.clouds.capPath == null) cap = ImageUtilities.ClearTexture(128, 128); if (atmo.clouds.capPath == null) cap = ImageUtilities.ClearTexture(128, 128);
else cap = ImageUtilities.GetTexture(mod, atmo.clouds.capPath); else cap = ImageUtilities.GetTexture(mod, atmo.clouds.capPath);

View File

@ -20,7 +20,7 @@ namespace NewHorizons.Utility
return _loadedTextures.ContainsKey(path); return _loadedTextures.ContainsKey(path);
} }
public static Texture2D GetTexture(IModBehaviour mod, string filename, bool useMipmaps = true) public static Texture2D GetTexture(IModBehaviour mod, string filename, bool useMipmaps = true, bool wrap = false)
{ {
// Copied from OWML but without the print statement lol // Copied from OWML but without the print statement lol
var path = mod.ModHelper.Manifest.ModFolderPath + filename; var path = mod.ModHelper.Manifest.ModFolderPath + filename;
@ -36,7 +36,7 @@ namespace NewHorizons.Utility
var data = File.ReadAllBytes(path); var data = File.ReadAllBytes(path);
var texture = new Texture2D(2, 2, TextureFormat.RGBA32, useMipmaps); var texture = new Texture2D(2, 2, TextureFormat.RGBA32, useMipmaps);
texture.name = Path.GetFileNameWithoutExtension(path); texture.name = Path.GetFileNameWithoutExtension(path);
texture.wrapMode = TextureWrapMode.Clamp; // this is apparently repeat by default texture.wrapMode = wrap ? TextureWrapMode.Repeat : TextureWrapMode.Clamp;
texture.LoadImage(data); texture.LoadImage(data);
_loadedTextures.Add(path, texture); _loadedTextures.Add(path, texture);