wrap with qm cloud type

This commit is contained in:
JohnCorby 2022-07-25 16:45:06 -07:00
parent bef2a32cef
commit 92743667a0
2 changed files with 4 additions and 3 deletions

View File

@ -150,7 +150,8 @@ namespace NewHorizons.Builder.Atmosphere
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);
else cap = ImageUtilities.GetTexture(mod, atmo.clouds.capPath);

View File

@ -20,7 +20,7 @@ namespace NewHorizons.Utility
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
var path = mod.ModHelper.Manifest.ModFolderPath + filename;
@ -36,7 +36,7 @@ namespace NewHorizons.Utility
var data = File.ReadAllBytes(path);
var texture = new Texture2D(2, 2, TextureFormat.RGBA32, useMipmaps);
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);
_loadedTextures.Add(path, texture);