Please disclose if your mod was created primarily using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of NomapPrinter v1.5.0
NomapPrinter.dll
Decompiled 2 days ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.IO.Compression; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Serialization; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using System.Threading; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using HarmonyLib; using JetBrains.Annotations; using Microsoft.CodeAnalysis; using ServerSync; using TMPro; using UnityEngine; using UnityEngine.UI; [assembly: AssemblyCopyright("Copyright © 2024")] [assembly: ComVisible(false)] [assembly: AssemblyTrademark("")] [assembly: AssemblyProduct("Nomap Printer")] [assembly: AssemblyCompany("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyDescription("")] [assembly: AssemblyTitle("Nomap Printer")] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: CompilationRelaxations(8)] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: Guid("ba601320-0ece-4b27-b2a4-a1fe1ba817b3")] [assembly: AssemblyFileVersion("1.5.0")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.5.0.0")] [module: UnverifiableCode] namespace NomapPrinter { internal static class CustomSyncedValuesSynchronizer { [CompilerGenerated] private sealed class <AssignAfterServerUpdate>d__6<T> : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public CustomSyncedValue<T> syncedValue; public Func<T> function; public bool assignIfChanged; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <AssignAfterServerUpdate>d__6(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = AssignAfterServerUpdate(syncedValue, function(), assignIfChanged); <>1__state = 1; return true; case 1: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <AssignAfterServerUpdate>d__7<T> : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public CustomSyncedValue<T> syncedValue; public T value; public bool assignIfChanged; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <AssignAfterServerUpdate>d__7(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; if (assignIfChanged && syncedValue.Value.Equals(value)) { return false; } <>2__current = waitForServerUpdate; <>1__state = 1; return true; case 1: <>1__state = -1; syncedValue.AssignLocalValue(value); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <CoroutineCoordinator>d__9 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <CoroutineCoordinator>d__9(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { int num = <>1__state; if (num != 0) { if (num != 1) { return false; } <>1__state = -1; coroutines.Dequeue(); goto IL_005c; } <>1__state = -1; goto IL_0081; IL_005c: if (coroutines.Count > 0) { <>2__current = ((MonoBehaviour)NomapPrinter.instance).StartCoroutine(coroutines.Peek()); <>1__state = 1; return true; } if (coroutines.Count == 0) { return false; } goto IL_0081; IL_0081: bool flag = true; goto IL_005c; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static readonly Queue<IEnumerator> coroutines = new Queue<IEnumerator>(); private static readonly WaitWhile waitForServerUpdate = new WaitWhile((Func<bool>)(() => ConfigSync.ProcessingServerUpdate)); public static void AssignValueSafe<T>(this CustomSyncedValue<T> syncedValue, T value) { AddToQueue(AssignAfterServerUpdate(syncedValue, value, assignIfChanged: false)); } public static void AssignValueSafe<T>(this CustomSyncedValue<T> syncedValue, Func<T> function) { AddToQueue(AssignAfterServerUpdate(syncedValue, function, assignIfChanged: false)); } public static void AssignValueIfChanged<T>(this CustomSyncedValue<T> syncedValue, T value) { AddToQueue(AssignAfterServerUpdate(syncedValue, value, assignIfChanged: true)); } public static void AssignValueIfChanged<T>(this CustomSyncedValue<T> syncedValue, Func<T> function) { AddToQueue(AssignAfterServerUpdate(syncedValue, function, assignIfChanged: true)); } [IteratorStateMachine(typeof(<AssignAfterServerUpdate>d__6<>))] private static IEnumerator AssignAfterServerUpdate<T>(CustomSyncedValue<T> syncedValue, Func<T> function, bool assignIfChanged) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <AssignAfterServerUpdate>d__6<T>(0) { syncedValue = syncedValue, function = function, assignIfChanged = assignIfChanged }; } [IteratorStateMachine(typeof(<AssignAfterServerUpdate>d__7<>))] private static IEnumerator AssignAfterServerUpdate<T>(CustomSyncedValue<T> syncedValue, T value, bool assignIfChanged) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <AssignAfterServerUpdate>d__7<T>(0) { syncedValue = syncedValue, value = value, assignIfChanged = assignIfChanged }; } private static void AddToQueue(IEnumerator coroutine) { coroutines.Enqueue(coroutine); if (coroutines.Count == 1) { ((MonoBehaviour)NomapPrinter.instance).StartCoroutine(CoroutineCoordinator()); } } [IteratorStateMachine(typeof(<CoroutineCoordinator>d__9))] private static IEnumerator CoroutineCoordinator() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <CoroutineCoordinator>d__9(0); } } internal static class MapGenerator { [CompilerGenerated] private sealed class <>c__DisplayClass51_0 { public Color32[] array2; public Color32[] array1; public Color32[] output; internal void <OverlayTexture>b__0() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < array1.Length; i++) { float a = Color32.op_Implicit(array2[i]).a; float a2 = Color32.op_Implicit(array1[i]).a; Color val = Color.Lerp(Color32.op_Implicit(array1[i]), Color32.op_Implicit(array2[i]), a); val.a = a + a2; if (val.a > 1f) { val.a = 1f; } output[i] = Color32.op_Implicit(val); } } } [CompilerGenerated] private sealed class <>c__DisplayClass52_0 { public Color32[] array2; public Color32[] array1; public Color32[] output; internal void <LerpTextures>b__0() { //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < TextureSize * TextureSize; i++) { int num = array2[i].a - array1[i].a; int num2 = Math.Min(array1[i].a + array2[i].a, 255); int num3 = ((array1[i].a > array2[i].a) ? array1[i].a : array2[i].a) * 2; float num4 = (float)num / (float)num3 + 0.5f; output[i] = Color32.Lerp(array1[i], array2[i], num4); output[i].a = (byte)num2; } } } [CompilerGenerated] private sealed class <>c__DisplayClass53_0 { public Color32[] array; public byte d; public Color32[] output; internal void <DarkenTextureLinear>b__0() { for (int i = 0; i < TextureSize * TextureSize; i++) { int num = array[i].r - d; if (num < 0) { num = 0; } output[i].r = (byte)num; num = array[i].g - d; if (num < 0) { num = 0; } output[i].g = (byte)num; num = array[i].b - d; if (num < 0) { num = 0; } output[i].b = (byte)num; output[i].a = array[i].a; } } } [CompilerGenerated] private sealed class <>c__DisplayClass55_0 { public Color32[] input; public Color32[] output; internal void <CreateSoftShadowMap>b__0() { //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < TextureSize; i++) { for (int j = 0; j < TextureSize; j++) { int num = i * TextureSize + j; int num2 = ((i > 0) ? (input[num].r - input[(i - 1) * TextureSize + j].r) : 0); num2 *= 8; byte b = (byte)Math.Abs(num2); byte b2 = (byte)((num2 >= 0) ? byte.MaxValue : 0); output[num] = new Color32(b2, b2, b2, b); } } } } [CompilerGenerated] private sealed class <>c__DisplayClass56_0 { public Color32[] output; public Color32[] input; public byte intensity; internal void <CreateHardShadowMap>b__0() { //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) bool[] array = new bool[TextureSize * TextureSize]; for (int i = 0; i < TextureSize * TextureSize; i++) { array[i] = false; } for (int j = 0; j < TextureSize; j++) { for (int k = 0; k < TextureSize; k++) { int num = j * TextureSize + k; if (!array[num]) { output[num] = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, (byte)0); for (int l = 1; j + l < TextureSize && input[num].r > input[(j + l) * TextureSize + k].r + l * 2; l++) { array[(j + l) * TextureSize + k] = true; } } else { output[num] = new Color32((byte)0, (byte)0, (byte)0, intensity); } } } } } [CompilerGenerated] private sealed class <>c__DisplayClass57_0 { public Color32[] input; public Color32[] output; public Color32[] biomeColor; public float oceanLerpTarget; internal void <GenerateOceanTexture>b__0() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < TextureSize * TextureSize; i++) { if (input[i].b == 0) { output[i] = Color32.op_Implicit(Color.clear); continue; } int num = i / TextureSize / 16 - 128; int num2 = i % TextureSize / 16 - 128; int num3 = num * num / 128 + num2 * num2 / 512; if (num < 0) { output[i].r = (byte)(10 + num3); output[i].g = (byte)(136 - num3 / 4); output[i].b = 193; } else { output[i].r = (byte)(10 + num3 / 2); output[i].g = 136; output[i].b = (byte)(193 - num3 / 2); } output[i].a = (byte)Math.Min(input[i].b * 16 + 128, 255); if (Color32.op_Implicit(biomeColor[i]) == Color.blue) { output[i] = Color32.Lerp(output[i], oceanColor, oceanLerpTarget); } } } } [CompilerGenerated] private sealed class <>c__DisplayClass58_0 { public int tightness; public byte damping; internal void <GetPerlin>b__0() { //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < TextureSize; i++) { for (int j = 0; j < TextureSize; j++) { float num = Mathf.PerlinNoise((float)i / (float)tightness, (float)j / (float)tightness); num = (num - 0.5f) / (float)(int)damping + 0.5f; Result[i * TextureSize + j] = Color32.op_Implicit(new Color(num, num, num, 0.2f)); } } } } [CompilerGenerated] private sealed class <>c__DisplayClass63_0 { public bool customFog; public bool haveContours; public int[] exploredIntegral; public int contourDistance; public float contourAlphaFactor; internal void <StylizeFog>b__0() { //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < TextureSize; i++) { for (int j = 0; j < TextureSize; j++) { int num = i * TextureSize + j; if (ExploredData[num]) { continue; } Color32 val = fog[i % fogRes * fogRes + j % fogRes]; if (customFog) { Result[num] = val; } else { Result[num] = new Color32((byte)(yellowMap.r + (val.r - 128)), (byte)(yellowMap.g + (val.g - 128)), (byte)(yellowMap.b + (val.b - 128)), byte.MaxValue); } if (haveContours && IsNearExplored(exploredIntegral, i, j, contourDistance * 2)) { Color32 val2 = contours[i % contoursRes * contoursRes + j % contoursRes]; if (val2.a > 0) { float contourDistanceAlpha = GetContourDistanceAlpha(exploredIntegral, i, j, contourDistance, contourAlphaFactor); float num2 = (float)(int)val2.a / 255f * contourDistanceAlpha; Result[num] = Color32.Lerp(Result[num], val2, num2); Result[num].a = byte.MaxValue; } } } } } } [CompilerGenerated] private sealed class <>c__DisplayClass64_0 { public Color32[] start; public int graduations; public Color32[] input; public Color32[] output; public byte alpha; internal void <GenerateContourMap>b__0() { //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < TextureSize * TextureSize; i++) { int num = ((start[i].b <= 0) ? Math.Min(start[i].r + graduations, 255) : 0); input[i].r = (byte)num; } for (int j = 1; j < TextureSize - 1; j++) { int num2 = j * TextureSize; for (int k = 1; k < TextureSize - 1; k++) { int num3 = num2 + k; int num4 = input[num2 + k].r / graduations; output[num3] = Color32.op_Implicit(Color.clear); for (int l = -1; l < 2; l++) { int num5 = l * TextureSize; for (int m = -1; m < 2; m++) { if (l == 0 && m == 0) { continue; } int num6 = num3 + num5 + m; int num7 = input[num6].r / graduations; if (num7 < num4) { byte b = alpha; if (num4 % 5 - 1 != 0) { b /= 2; } if (l == 0 || m == 0 || output[num3].a == b) { output[num3] = new Color32((byte)0, (byte)0, (byte)0, b); break; } output[num3] = new Color32((byte)0, (byte)0, (byte)0, (byte)(b / 2)); } } } } } } } [CompilerGenerated] private sealed class <>c__DisplayClass65_0 { public Color32[] input; public int tightness; public byte damping; internal void <AddPerlinNoise>b__0() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < TextureSize; i++) { for (int j = 0; j < TextureSize; j++) { int num = i * TextureSize + j; Color val = Color32.op_Implicit(input[num]); float num2 = Mathf.PerlinNoise((float)i / (float)tightness, (float)j / (float)tightness); num2 = (num2 - 0.5f) / (float)(int)damping; Result[num] = Color32.op_Implicit(new Color(val.r + num2, val.g + num2, val.b + num2, val.a)); } } } } [CompilerGenerated] private sealed class <>c__DisplayClass66_0 { public Color32[] array; public Color32 TexColour; internal void <GetSolidColour>b__0() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < array.Length; i++) { array[i] = TexColour; } } } [CompilerGenerated] private sealed class <>c__DisplayClass67_0 { public Color32[] input; public Color32 from; public Color32[] output; public Color32 to; internal void <ReplaceAbyssWithColor>b__0() { //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < input.Length; i++) { if (input[i].r == from.r && input[i].g == from.g && input[i].b == from.b) { output[i] = to; } else { output[i] = input[i]; } } } } [CompilerGenerated] private sealed class <>c__DisplayClass68_0 { public Color32[] input; public Color32 from; public Color32[] output; internal void <ReplaceAbyssWithSpace>b__0() { //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < TextureSize; i++) { for (int j = 0; j < TextureSize; j++) { int num = i * TextureSize + j; if (input[num].r == from.r && input[num].g == from.g && input[num].b == from.b) { output[num] = space[i % spaceRes * spaceRes + j % spaceRes]; } else { output[num] = input[num]; } } } } } [CompilerGenerated] private sealed class <>c__DisplayClass69_0 { public Color[] forestMask; public Color32[] output; public Color32[] array; public float forestColorFactor; internal void <ApplyForestMaskTexture>b__0() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_02d6: Unknown result type (might be due to invalid IL or missing references) //IL_02db: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < TextureSize * TextureSize; i++) { if (forestMask[i] == clearMask) { output[i] = array[i]; continue; } if (forestMask[i].r > 0f) { float num = 1f - (1f - forestColorFactor) * forestMask[i].r; output[i].r = (byte)((float)(int)array[i].r * num); output[i].g = (byte)((float)(int)array[i].g * num); output[i].b = (byte)((float)(int)array[i].b * num); } if (forestMask[i].g > 0f) { float wy = ((float)(i / TextureSize) / (float)TextureSize - 0.5f) * 400f; float wx = ((float)(i % TextureSize) / (float)TextureSize - 0.5f) * 400f; output[i] = Color32.Lerp(array[i], mistColor, forestMask[i].g * GetMistlandsNoise(wx, wy) * 0.9f); } if (forestMask[i].b > 0f) { output[i] = Color32.Lerp(array[i], lavaColor, forestMask[i].b); } if (forestMask[i].a != 1f) { if (forestMask[i].a >= 0.5f) { output[i] = Color32.Lerp(array[i], lavaColor, (forestMask[i].a - 0.5f) / 0.5f); } if (0f <= forestMask[i].a && forestMask[i].a < 0.5f) { output[i] = Color32.Lerp(array[i], northColor, forestMask[i].a / 0.5f); } } output[i].a = array[i].a; } } } [CompilerGenerated] private sealed class <AddPerlinNoise>d__65 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public Color32[] input; public int tightness; public byte damping; private <>c__DisplayClass65_0 <>8__1; private Thread <internalThread>5__2; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <AddPerlinNoise>d__65(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; <internalThread>5__2 = null; <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>8__1 = new <>c__DisplayClass65_0(); <>8__1.input = input; <>8__1.tightness = tightness; <>8__1.damping = damping; <internalThread>5__2 = new Thread((ThreadStart)delegate { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < TextureSize; i++) { for (int j = 0; j < TextureSize; j++) { int num = i * TextureSize + j; Color val = Color32.op_Implicit(<>8__1.input[num]); float num2 = Mathf.PerlinNoise((float)i / (float)<>8__1.tightness, (float)j / (float)<>8__1.tightness); num2 = (num2 - 0.5f) / (float)(int)<>8__1.damping; Result[num] = Color32.op_Implicit(new Color(val.r + num2, val.g + num2, val.b + num2, val.a)); } } }); <internalThread>5__2.Start(); break; case 1: <>1__state = -1; break; } if (<internalThread>5__2.IsAlive) { <>2__current = null; <>1__state = 1; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <ApplyForestMaskTexture>d__69 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public Color32[] array; public Color[] forestMask; public float forestColorFactor; private <>c__DisplayClass69_0 <>8__1; private Thread <internalThread>5__2; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <ApplyForestMaskTexture>d__69(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; <internalThread>5__2 = null; <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>8__1 = new <>c__DisplayClass69_0(); <>8__1.forestMask = forestMask; <>8__1.array = array; <>8__1.forestColorFactor = forestColorFactor; <>8__1.output = (Color32[])(object)new Color32[TextureSize * TextureSize]; <internalThread>5__2 = new Thread((ThreadStart)delegate { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_02d6: Unknown result type (might be due to invalid IL or missing references) //IL_02db: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < TextureSize * TextureSize; i++) { if (<>8__1.forestMask[i] == clearMask) { <>8__1.output[i] = <>8__1.array[i]; } else { if (<>8__1.forestMask[i].r > 0f) { float num = 1f - (1f - <>8__1.forestColorFactor) * <>8__1.forestMask[i].r; <>8__1.output[i].r = (byte)((float)(int)<>8__1.array[i].r * num); <>8__1.output[i].g = (byte)((float)(int)<>8__1.array[i].g * num); <>8__1.output[i].b = (byte)((float)(int)<>8__1.array[i].b * num); } if (<>8__1.forestMask[i].g > 0f) { float wy = ((float)(i / TextureSize) / (float)TextureSize - 0.5f) * 400f; float wx = ((float)(i % TextureSize) / (float)TextureSize - 0.5f) * 400f; <>8__1.output[i] = Color32.Lerp(<>8__1.array[i], mistColor, <>8__1.forestMask[i].g * GetMistlandsNoise(wx, wy) * 0.9f); } if (<>8__1.forestMask[i].b > 0f) { <>8__1.output[i] = Color32.Lerp(<>8__1.array[i], lavaColor, <>8__1.forestMask[i].b); } if (<>8__1.forestMask[i].a != 1f) { if (<>8__1.forestMask[i].a >= 0.5f) { <>8__1.output[i] = Color32.Lerp(<>8__1.array[i], lavaColor, (<>8__1.forestMask[i].a - 0.5f) / 0.5f); } if (0f <= <>8__1.forestMask[i].a && <>8__1.forestMask[i].a < 0.5f) { <>8__1.output[i] = Color32.Lerp(<>8__1.array[i], northColor, <>8__1.forestMask[i].a / 0.5f); } } <>8__1.output[i].a = <>8__1.array[i].a; } } }); <internalThread>5__2.Start(); break; case 1: <>1__state = -1; break; } if (<internalThread>5__2.IsAlive) { <>2__current = null; <>1__state = 1; return true; } Result = <>8__1.output; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <CreateHardShadowMap>d__56 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public Color32[] input; public byte intensity; private <>c__DisplayClass56_0 <>8__1; private Thread <internalThread>5__2; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <CreateHardShadowMap>d__56(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; <internalThread>5__2 = null; <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>8__1 = new <>c__DisplayClass56_0(); <>8__1.input = input; <>8__1.intensity = intensity; <>8__1.output = (Color32[])(object)new Color32[<>8__1.input.Length]; <internalThread>5__2 = new Thread((ThreadStart)delegate { //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) bool[] array = new bool[TextureSize * TextureSize]; for (int i = 0; i < TextureSize * TextureSize; i++) { array[i] = false; } for (int j = 0; j < TextureSize; j++) { for (int k = 0; k < TextureSize; k++) { int num = j * TextureSize + k; if (!array[num]) { <>8__1.output[num] = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, (byte)0); for (int l = 1; j + l < TextureSize && <>8__1.input[num].r > <>8__1.input[(j + l) * TextureSize + k].r + l * 2; l++) { array[(j + l) * TextureSize + k] = true; } } else { <>8__1.output[num] = new Color32((byte)0, (byte)0, (byte)0, <>8__1.intensity); } } } }); <internalThread>5__2.Start(); break; case 1: <>1__state = -1; break; } if (<internalThread>5__2.IsAlive) { <>2__current = null; <>1__state = 1; return true; } Result = <>8__1.output; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <CreateShadowMap>d__54 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public Color32[] heightmap; public byte intensity; private Color32[] <hardshadows>5__1; private Color32[] <softshadows>5__2; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <CreateShadowMap>d__54(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <hardshadows>5__1 = null; <softshadows>5__2 = null; <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = CreateHardShadowMap(heightmap, intensity); <>1__state = 1; return true; case 1: <>1__state = -1; <hardshadows>5__1 = Result; <>2__current = CreateSoftShadowMap(heightmap); <>1__state = 2; return true; case 2: <>1__state = -1; <softshadows>5__2 = Result; <>2__current = LerpTextures(<softshadows>5__2, <hardshadows>5__1); <>1__state = 3; return true; case 3: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <CreateSoftShadowMap>d__55 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public Color32[] input; private <>c__DisplayClass55_0 <>8__1; private Thread <internalThread>5__2; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <CreateSoftShadowMap>d__55(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; <internalThread>5__2 = null; <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>8__1 = new <>c__DisplayClass55_0(); <>8__1.input = input; <>8__1.output = (Color32[])(object)new Color32[<>8__1.input.Length]; <internalThread>5__2 = new Thread((ThreadStart)delegate { //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < TextureSize; i++) { for (int j = 0; j < TextureSize; j++) { int num = i * TextureSize + j; int num2 = ((i > 0) ? (<>8__1.input[num].r - <>8__1.input[(i - 1) * TextureSize + j].r) : 0); num2 *= 8; byte b = (byte)Math.Abs(num2); byte b2 = (byte)((num2 >= 0) ? byte.MaxValue : 0); <>8__1.output[num] = new Color32(b2, b2, b2, b); } } }); <internalThread>5__2.Start(); break; case 1: <>1__state = -1; break; } if (<internalThread>5__2.IsAlive) { <>2__current = null; <>1__state = 1; return true; } Result = <>8__1.output; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <DarkenTextureLinear>d__53 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public Color32[] array; public byte d; private <>c__DisplayClass53_0 <>8__1; private Thread <internalThread>5__2; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <DarkenTextureLinear>d__53(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; <internalThread>5__2 = null; <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>8__1 = new <>c__DisplayClass53_0(); <>8__1.array = array; <>8__1.d = d; <>8__1.output = (Color32[])(object)new Color32[TextureSize * TextureSize]; <internalThread>5__2 = new Thread((ThreadStart)delegate { for (int i = 0; i < TextureSize * TextureSize; i++) { int num = <>8__1.array[i].r - <>8__1.d; if (num < 0) { num = 0; } <>8__1.output[i].r = (byte)num; num = <>8__1.array[i].g - <>8__1.d; if (num < 0) { num = 0; } <>8__1.output[i].g = (byte)num; num = <>8__1.array[i].b - <>8__1.d; if (num < 0) { num = 0; } <>8__1.output[i].b = (byte)num; <>8__1.output[i].a = <>8__1.array[i].a; } }); <internalThread>5__2.Start(); break; case 1: <>1__state = -1; break; } if (<internalThread>5__2.IsAlive) { <>2__current = null; <>1__state = 1; return true; } Result = <>8__1.output; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <GenerateChartMap>d__47 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public int graduationHeight; private Color32[] <oceanTexture>5__1; private Color32[] <outtex>5__2; private Color32[] <offYellow>5__3; private Color32[] <contours>5__4; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <GenerateChartMap>d__47(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <oceanTexture>5__1 = null; <outtex>5__2 = null; <offYellow>5__3 = null; <contours>5__4 = null; <>1__state = -2; } private bool MoveNext() { //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = GenerateOceanTexture(Heightmap, MapTexture, 0.15f); <>1__state = 1; return true; case 1: <>1__state = -1; <oceanTexture>5__1 = Result; <>2__current = ReplaceAbyssWithColor(MapTexture, abyssColor, yellowMap); <>1__state = 2; return true; case 2: <>1__state = -1; <outtex>5__2 = Result; <>2__current = OverlayTexture(<outtex>5__2, <oceanTexture>5__1); <>1__state = 3; return true; case 3: <>1__state = -1; <outtex>5__2 = Result; <>2__current = GetSolidColour(yellowMap); <>1__state = 4; return true; case 4: <>1__state = -1; <offYellow>5__3 = Result; <>2__current = LerpTextures(<outtex>5__2, <offYellow>5__3); <>1__state = 5; return true; case 5: <>1__state = -1; <outtex>5__2 = Result; <>2__current = AddPerlinNoise(<outtex>5__2, 128, 16); <>1__state = 6; return true; case 6: <>1__state = -1; <outtex>5__2 = Result; <>2__current = ApplyForestMaskTexture(<outtex>5__2, ForestTexture); <>1__state = 7; return true; case 7: <>1__state = -1; <outtex>5__2 = Result; <>2__current = GenerateContourMap(Heightmap, graduationHeight, 128); <>1__state = 8; return true; case 8: <>1__state = -1; <contours>5__4 = Result; <>2__current = OverlayTexture(<outtex>5__2, <contours>5__4); <>1__state = 9; return true; case 9: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <GenerateContourMap>d__64 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public Color32[] start; public int graduations; public byte alpha; private <>c__DisplayClass64_0 <>8__1; private Thread <internalThread>5__2; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <GenerateContourMap>d__64(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; <internalThread>5__2 = null; <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>8__1 = new <>c__DisplayClass64_0(); <>8__1.start = start; <>8__1.graduations = graduations; <>8__1.alpha = alpha; <>8__1.input = (Color32[])(object)new Color32[<>8__1.start.Length]; <>8__1.output = (Color32[])(object)new Color32[<>8__1.input.Length]; <internalThread>5__2 = new Thread((ThreadStart)delegate { //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < TextureSize * TextureSize; i++) { int num = ((<>8__1.start[i].b <= 0) ? Math.Min(<>8__1.start[i].r + <>8__1.graduations, 255) : 0); <>8__1.input[i].r = (byte)num; } for (int j = 1; j < TextureSize - 1; j++) { int num2 = j * TextureSize; for (int k = 1; k < TextureSize - 1; k++) { int num3 = num2 + k; int num4 = <>8__1.input[num2 + k].r / <>8__1.graduations; <>8__1.output[num3] = Color32.op_Implicit(Color.clear); for (int l = -1; l < 2; l++) { int num5 = l * TextureSize; for (int m = -1; m < 2; m++) { if (l != 0 || m != 0) { int num6 = num3 + num5 + m; int num7 = <>8__1.input[num6].r / <>8__1.graduations; if (num7 < num4) { byte b = <>8__1.alpha; if (num4 % 5 - 1 != 0) { b /= 2; } if (l == 0 || m == 0 || <>8__1.output[num3].a == b) { <>8__1.output[num3] = new Color32((byte)0, (byte)0, (byte)0, b); break; } <>8__1.output[num3] = new Color32((byte)0, (byte)0, (byte)0, (byte)(b / 2)); } } } } } } }); <internalThread>5__2.Start(); break; case 1: <>1__state = -1; break; } if (<internalThread>5__2.IsAlive) { <>2__current = null; <>1__state = 1; return true; } Result = <>8__1.output; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <GenerateOceanTexture>d__57 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public Color32[] input; public Color32[] biomeColor; public float oceanLerpTarget; private <>c__DisplayClass57_0 <>8__1; private Thread <internalThread>5__2; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <GenerateOceanTexture>d__57(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; <internalThread>5__2 = null; <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>8__1 = new <>c__DisplayClass57_0(); <>8__1.input = input; <>8__1.biomeColor = biomeColor; <>8__1.oceanLerpTarget = oceanLerpTarget; <>8__1.output = (Color32[])(object)new Color32[<>8__1.input.Length]; <internalThread>5__2 = new Thread((ThreadStart)delegate { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < TextureSize * TextureSize; i++) { if (<>8__1.input[i].b == 0) { <>8__1.output[i] = Color32.op_Implicit(Color.clear); } else { int num = i / TextureSize / 16 - 128; int num2 = i % TextureSize / 16 - 128; int num3 = num * num / 128 + num2 * num2 / 512; if (num < 0) { <>8__1.output[i].r = (byte)(10 + num3); <>8__1.output[i].g = (byte)(136 - num3 / 4); <>8__1.output[i].b = 193; } else { <>8__1.output[i].r = (byte)(10 + num3 / 2); <>8__1.output[i].g = 136; <>8__1.output[i].b = (byte)(193 - num3 / 2); } <>8__1.output[i].a = (byte)Math.Min(<>8__1.input[i].b * 16 + 128, 255); if (Color32.op_Implicit(<>8__1.biomeColor[i]) == Color.blue) { <>8__1.output[i] = Color32.Lerp(<>8__1.output[i], oceanColor, <>8__1.oceanLerpTarget); } } } }); <internalThread>5__2.Start(); break; case 1: <>1__state = -1; break; } if (<internalThread>5__2.IsAlive) { <>2__current = null; <>1__state = 1; return true; } Result = <>8__1.output; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <GenerateOldMap>d__46 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public int graduationHeight; private Color32[] <oceanTexture>5__1; private Color32[] <outtex>5__2; private Color32[] <offYellow>5__3; private Color32[] <contours>5__4; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <GenerateOldMap>d__46(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <oceanTexture>5__1 = null; <outtex>5__2 = null; <offYellow>5__3 = null; <contours>5__4 = null; <>1__state = -2; } private bool MoveNext() { //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = GenerateOceanTexture(Heightmap, MapTexture, 0.25f); <>1__state = 1; return true; case 1: <>1__state = -1; <oceanTexture>5__1 = Result; <>2__current = ReplaceAbyssWithColor(MapTexture, abyssColor, yellowMap); <>1__state = 2; return true; case 2: <>1__state = -1; <outtex>5__2 = Result; <>2__current = OverlayTexture(<outtex>5__2, <oceanTexture>5__1); <>1__state = 3; return true; case 3: <>1__state = -1; <outtex>5__2 = Result; <>2__current = GetSolidColour(yellowMap); <>1__state = 4; return true; case 4: <>1__state = -1; <offYellow>5__3 = Result; <>2__current = LerpTextures(<outtex>5__2, <offYellow>5__3); <>1__state = 5; return true; case 5: <>1__state = -1; <outtex>5__2 = Result; <>2__current = LerpTextures(<outtex>5__2, <offYellow>5__3); <>1__state = 6; return true; case 6: <>1__state = -1; <outtex>5__2 = Result; <>2__current = LerpTextures(<outtex>5__2, <offYellow>5__3); <>1__state = 7; return true; case 7: <>1__state = -1; <outtex>5__2 = Result; <>2__current = AddPerlinNoise(<outtex>5__2, 128, 16); <>1__state = 8; return true; case 8: <>1__state = -1; <outtex>5__2 = Result; <>2__current = ApplyForestMaskTexture(<outtex>5__2, ForestTexture, 0.95f); <>1__state = 9; return true; case 9: <>1__state = -1; <outtex>5__2 = Result; <>2__current = GenerateContourMap(Heightmap, graduationHeight, 128); <>1__state = 10; return true; case 10: <>1__state = -1; <contours>5__4 = Result; <>2__current = OverlayTexture(<outtex>5__2, <contours>5__4); <>1__state = 11; return true; case 11: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <GenerateSatelliteImage>d__48 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; private Color32[] <oceanTexture>5__1; private Color32[] <outtex>5__2; private Color32[] <shadowmap>5__3; private Color32[] <contours>5__4; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <GenerateSatelliteImage>d__48(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <oceanTexture>5__1 = null; <outtex>5__2 = null; <shadowmap>5__3 = null; <contours>5__4 = null; <>1__state = -2; } private bool MoveNext() { //IL_00e0: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = GenerateOceanTexture(Heightmap, MapTexture); <>1__state = 1; return true; case 1: <>1__state = -1; <oceanTexture>5__1 = Result; <>2__current = AddPerlinNoise(<oceanTexture>5__1, 4, 64); <>1__state = 2; return true; case 2: <>1__state = -1; <oceanTexture>5__1 = Result; <>2__current = ReplaceAbyssWithSpace(MapTexture, abyssColor); <>1__state = 3; return true; case 3: <>1__state = -1; <outtex>5__2 = Result; <>2__current = OverlayTexture(<outtex>5__2, <oceanTexture>5__1); <>1__state = 4; return true; case 4: <>1__state = -1; <outtex>5__2 = Result; <>2__current = CreateShadowMap(Heightmap, 23); <>1__state = 5; return true; case 5: <>1__state = -1; <shadowmap>5__3 = Result; <>2__current = DarkenTextureLinear(<outtex>5__2, 20); <>1__state = 6; return true; case 6: <>1__state = -1; <outtex>5__2 = Result; <>2__current = ApplyForestMaskTexture(<outtex>5__2, ForestTexture); <>1__state = 7; return true; case 7: <>1__state = -1; <outtex>5__2 = Result; <>2__current = GenerateContourMap(Heightmap, 128, 64); <>1__state = 8; return true; case 8: <>1__state = -1; <contours>5__4 = Result; <>2__current = OverlayTexture(<outtex>5__2, <contours>5__4); <>1__state = 9; return true; case 9: <>1__state = -1; <outtex>5__2 = Result; <>2__current = OverlayTexture(<outtex>5__2, <shadowmap>5__3); <>1__state = 10; return true; case 10: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <GenerateTopographicalMap>d__49 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public int graduationHeight; private Color32[] <oceanTexture>5__1; private Color32[] <outtex>5__2; private Color32[] <shadowmap>5__3; private Color32[] <contours>5__4; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <GenerateTopographicalMap>d__49(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <oceanTexture>5__1 = null; <outtex>5__2 = null; <shadowmap>5__3 = null; <contours>5__4 = null; <>1__state = -2; } private bool MoveNext() { //IL_00e0: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = GenerateOceanTexture(Heightmap, MapTexture); <>1__state = 1; return true; case 1: <>1__state = -1; <oceanTexture>5__1 = Result; <>2__current = AddPerlinNoise(<oceanTexture>5__1, 4, 64); <>1__state = 2; return true; case 2: <>1__state = -1; <oceanTexture>5__1 = Result; <>2__current = ReplaceAbyssWithSpace(MapTexture, abyssColor); <>1__state = 3; return true; case 3: <>1__state = -1; <outtex>5__2 = Result; <>2__current = OverlayTexture(<outtex>5__2, <oceanTexture>5__1); <>1__state = 4; return true; case 4: <>1__state = -1; <outtex>5__2 = Result; <>2__current = CreateShadowMap(Heightmap, 23); <>1__state = 5; return true; case 5: <>1__state = -1; <shadowmap>5__3 = Result; <>2__current = DarkenTextureLinear(<outtex>5__2, 20); <>1__state = 6; return true; case 6: <>1__state = -1; <outtex>5__2 = Result; <>2__current = ApplyForestMaskTexture(<outtex>5__2, ForestTexture); <>1__state = 7; return true; case 7: <>1__state = -1; <outtex>5__2 = Result; <>2__current = GenerateContourMap(Heightmap, graduationHeight, 128); <>1__state = 8; return true; case 8: <>1__state = -1; <contours>5__4 = Result; <>2__current = OverlayTexture(<outtex>5__2, <contours>5__4); <>1__state = 9; return true; case 9: <>1__state = -1; <outtex>5__2 = Result; <>2__current = OverlayTexture(<outtex>5__2, <shadowmap>5__3); <>1__state = 10; return true; case 10: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <GetPerlin>d__58 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public int tightness; public byte damping; private <>c__DisplayClass58_0 <>8__1; private Thread <internalThread>5__2; private int <i>5__3; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <GetPerlin>d__58(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; <internalThread>5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>8__1 = new <>c__DisplayClass58_0(); <>8__1.tightness = tightness; <>8__1.damping = damping; <i>5__3 = 0; while (<i>5__3 < Result.Length) { Result[<i>5__3] = new Color32((byte)0, (byte)0, (byte)0, (byte)0); <i>5__3++; } <internalThread>5__2 = new Thread((ThreadStart)delegate { //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < TextureSize; i++) { for (int j = 0; j < TextureSize; j++) { float num = Mathf.PerlinNoise((float)i / (float)<>8__1.tightness, (float)j / (float)<>8__1.tightness); num = (num - 0.5f) / (float)(int)<>8__1.damping + 0.5f; Result[i * TextureSize + j] = Color32.op_Implicit(new Color(num, num, num, 0.2f)); } } }); <internalThread>5__2.Start(); break; case 1: <>1__state = -1; break; } if (<internalThread>5__2.IsAlive) { <>2__current = null; <>1__state = 1; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <GetSolidColour>d__66 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public Color32 TexColour; private <>c__DisplayClass66_0 <>8__1; private Thread <internalThread>5__2; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <GetSolidColour>d__66(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; <internalThread>5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>8__1 = new <>c__DisplayClass66_0(); <>8__1.TexColour = TexColour; <>8__1.array = (Color32[])(object)new Color32[TextureSize * TextureSize]; <internalThread>5__2 = new Thread((ThreadStart)delegate { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < <>8__1.array.Length; i++) { <>8__1.array[i] = <>8__1.TexColour; } }); <internalThread>5__2.Start(); break; case 1: <>1__state = -1; break; } if (<internalThread>5__2.IsAlive) { <>2__current = null; <>1__state = 1; return true; } Result = <>8__1.array; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <Initialize>d__36 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; private Texture <spaceTex>5__1; private RenderTexture <tmp>5__2; private RenderTexture <previous>5__3; private Texture2D <tex>5__4; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <Initialize>d__36(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <spaceTex>5__1 = null; <tmp>5__2 = null; <previous>5__3 = null; <tex>5__4 = null; <>1__state = -2; } private bool MoveNext() { //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Expected O, but got Unknown //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; if (spaceRes == 0 && (NomapPrinter.mapType.Value == NomapPrinter.MapType.BirdsEye || NomapPrinter.mapType.Value == NomapPrinter.MapType.Topographical)) { <>2__current = (object)new WaitUntil((Func<bool>)(() => (Object)(object)Minimap.instance != (Object)null && (Object)(object)Minimap.instance.m_mapLargeShader != (Object)null)); <>1__state = 1; return true; } break; case 1: <>1__state = -1; <spaceTex>5__1 = Minimap.instance.m_mapLargeShader.GetTexture("_SpaceTex"); spaceRes = <spaceTex>5__1.width; <tmp>5__2 = RenderTexture.GetTemporary(spaceRes, spaceRes, 24); Graphics.Blit(<spaceTex>5__1, <tmp>5__2); <previous>5__3 = RenderTexture.active; RenderTexture.active = <tmp>5__2; <tex>5__4 = new Texture2D(spaceRes, spaceRes, (TextureFormat)4, false, false); <tex>5__4.ReadPixels(new Rect(0f, 0f, (float)spaceRes, (float)spaceRes), 0, 0); <tex>5__4.Apply(); RenderTexture.active = <previous>5__3; RenderTexture.ReleaseTemporary(<tmp>5__2); space = <tex>5__4.GetPixels32(); Object.Destroy((Object)(object)<tex>5__4); <spaceTex>5__1 = null; <tmp>5__2 = null; <previous>5__3 = null; <tex>5__4 = null; break; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <LerpTextures>d__52 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public Color32[] array1; public Color32[] array2; private <>c__DisplayClass52_0 <>8__1; private Thread <internalThread>5__2; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <LerpTextures>d__52(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; <internalThread>5__2 = null; <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>8__1 = new <>c__DisplayClass52_0(); <>8__1.array2 = array2; <>8__1.array1 = array1; <>8__1.output = (Color32[])(object)new Color32[TextureSize * TextureSize]; <internalThread>5__2 = new Thread((ThreadStart)delegate { //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < TextureSize * TextureSize; i++) { int num = <>8__1.array2[i].a - <>8__1.array1[i].a; int num2 = Math.Min(<>8__1.array1[i].a + <>8__1.array2[i].a, 255); int num3 = ((<>8__1.array1[i].a > <>8__1.array2[i].a) ? <>8__1.array1[i].a : <>8__1.array2[i].a) * 2; float num4 = (float)num / (float)num3 + 0.5f; <>8__1.output[i] = Color32.Lerp(<>8__1.array1[i], <>8__1.array2[i], num4); <>8__1.output[i].a = (byte)num2; } }); <internalThread>5__2.Start(); break; case 1: <>1__state = -1; break; } if (<internalThread>5__2.IsAlive) { <>2__current = null; <>1__state = 1; return true; } Result = <>8__1.output; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <OverlayExplorationFog>d__45 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public bool[] exploration; private int <i>5__1; private int <targetSize>5__2; private int <currentSize>5__3; private int <row>5__4; private int <col>5__5; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <OverlayExplorationFog>d__45(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <i>5__1 = 0; while (<i>5__1 < ExploredData.Length) { ExploredData[<i>5__1] = false; <i>5__1++; } if (exploration.Length == ExploredData.Length) { exploration.CopyTo(ExploredData, 0); } else { <targetSize>5__2 = (int)Math.Sqrt(ExploredData.Length); <currentSize>5__3 = (int)Math.Sqrt(exploration.Length); <row>5__4 = 0; while (<row>5__4 < <currentSize>5__3) { <col>5__5 = 0; while (<col>5__5 < <currentSize>5__3) { if (exploration[<row>5__4 * <currentSize>5__3 + <col>5__5]) { <OverlayExplorationFog>g__SetExploredData|45_0(<row>5__4 * 2 * <targetSize>5__2 + <col>5__5 * 2); <OverlayExplorationFog>g__SetExploredData|45_0(<row>5__4 * 2 * <targetSize>5__2 + <col>5__5 * 2 + 1); <OverlayExplorationFog>g__SetExploredData|45_0((<row>5__4 * 2 + 1) * <targetSize>5__2 + <col>5__5 * 2); <OverlayExplorationFog>g__SetExploredData|45_0((<row>5__4 * 2 + 1) * <targetSize>5__2 + <col>5__5 * 2 + 1); } <col>5__5++; } <row>5__4++; } } <>2__current = StylizeFog(); <>1__state = 1; return true; case 1: <>1__state = -1; <>2__current = OverlayResultOnMap(); <>1__state = 2; return true; case 2: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <OverlayResultOnMap>d__50 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; private Thread <internalThread>5__1; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <OverlayResultOnMap>d__50(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <internalThread>5__1 = null; <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <internalThread>5__1 = new Thread((ThreadStart)delegate { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < MapTexture.Length; i++) { Result[i] = Color32.op_Implicit(Color.Lerp(Color32.op_Implicit(MapTexture[i]), Color32.op_Implicit(Result[i]), Color32.op_Implicit(Result[i]).a)); Result[i].a = (byte)(255f * Mathf.Clamp01(Color32.op_Implicit(Result[i]).a + Color32.op_Implicit(MapTexture[i]).a)); } }); <internalThread>5__1.Start(); break; case 1: <>1__state = -1; break; } if (<internalThread>5__1.IsAlive) { <>2__current = null; <>1__state = 1; return true; } SetMapTexture(Result); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <OverlayTexture>d__51 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public Color32[] array1; public Color32[] array2; private <>c__DisplayClass51_0 <>8__1; private Thread <internalThread>5__2; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <OverlayTexture>d__51(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; <internalThread>5__2 = null; <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>8__1 = new <>c__DisplayClass51_0(); <>8__1.array2 = array2; <>8__1.array1 = array1; <>8__1.output = (Color32[])(object)new Color32[<>8__1.array1.Length]; <internalThread>5__2 = new Thread((ThreadStart)delegate { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < <>8__1.array1.Length; i++) { float a = Color32.op_Implicit(<>8__1.array2[i]).a; float a2 = Color32.op_Implicit(<>8__1.array1[i]).a; Color val = Color.Lerp(Color32.op_Implicit(<>8__1.array1[i]), Color32.op_Implicit(<>8__1.array2[i]), a); val.a = a + a2; if (val.a > 1f) { val.a = 1f; } <>8__1.output[i] = Color32.op_Implicit(val); } }); <internalThread>5__2.Start(); break; case 1: <>1__state = -1; break; } if (<internalThread>5__2.IsAlive) { <>2__current = null; <>1__state = 1; return true; } Result = <>8__1.output; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <OverlayTextureOnMap>d__44 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public Texture2D texture; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <OverlayTextureOnMap>d__44(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; texture.GetPixels32().CopyTo(Result, 0); <>2__current = OverlayResultOnMap(); <>1__state = 1; return true; case 1: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <ReplaceAbyssWithColor>d__67 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public Color32[] input; public Color32 from; public Color32 to; private <>c__DisplayClass67_0 <>8__1; private Thread <internalThread>5__2; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <ReplaceAbyssWithColor>d__67(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; <internalThread>5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>8__1 = new <>c__DisplayClass67_0(); <>8__1.input = input; <>8__1.from = from; <>8__1.to = to; <>8__1.output = (Color32[])(object)new Color32[<>8__1.input.Length]; <internalThread>5__2 = new Thread((ThreadStart)delegate { //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < <>8__1.input.Length; i++) { if (<>8__1.input[i].r == <>8__1.from.r && <>8__1.input[i].g == <>8__1.from.g && <>8__1.input[i].b == <>8__1.from.b) { <>8__1.output[i] = <>8__1.to; } else { <>8__1.output[i] = <>8__1.input[i]; } } }); <internalThread>5__2.Start(); break; case 1: <>1__state = -1; break; } if (<internalThread>5__2.IsAlive) { <>2__current = null; <>1__state = 1; return true; } Result = <>8__1.output; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <ReplaceAbyssWithSpace>d__68 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public Color32[] input; public Color32 from; private <>c__DisplayClass68_0 <>8__1; private Thread <internalThread>5__2; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <ReplaceAbyssWithSpace>d__68(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; <internalThread>5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>8__1 = new <>c__DisplayClass68_0(); <>8__1.input = input; <>8__1.from = from; <>8__1.output = (Color32[])(object)new Color32[<>8__1.input.Length]; <internalThread>5__2 = new Thread((ThreadStart)delegate { //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < TextureSize; i++) { for (int j = 0; j < TextureSize; j++) { int num = i * TextureSize + j; if (<>8__1.input[num].r == <>8__1.from.r && <>8__1.input[num].g == <>8__1.from.g && <>8__1.input[num].b == <>8__1.from.b) { <>8__1.output[num] = space[i % spaceRes * spaceRes + j % spaceRes]; } else { <>8__1.output[num] = <>8__1.input[num]; } } } }); <internalThread>5__2.Start(); break; case 1: <>1__state = -1; break; } if (<internalThread>5__2.IsAlive) { <>2__current = null; <>1__state = 1; return true; } Result = <>8__1.output; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <StylizeFog>d__63 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; private <>c__DisplayClass63_0 <>8__1; private Thread <internalThread>5__2; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <StylizeFog>d__63(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; <internalThread>5__2 = null; <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>8__1 = new <>c__DisplayClass63_0(); <>8__1.customFog = fog != null; if (!<>8__1.customFog) { <>2__current = GetPerlin(128, 16); <>1__state = 1; return true; } goto IL_0096; case 1: <>1__state = -1; fog = Result; fogRes = TextureSize; goto IL_0096; case 2: { <>1__state = -1; break; } IL_0096: <>8__1.contourAlphaFactor = Math.Max(0f, NomapPrinter.fogContoursAlpha.Value); <>8__1.contourDistance = Math.Max(0, NomapPrinter.fogContoursDistance.Value); <>8__1.haveContours = NomapPrinter.fogContoursEnabled.Value && contours != null && <>8__1.contourDistance > 0; <>8__1.exploredIntegral = (<>8__1.haveContours ? BuildExploredIntegral() : null); <internalThread>5__2 = new Thread((ThreadStart)delegate { //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < TextureSize; i++) { for (int j = 0; j < TextureSize; j++) { int num = i * TextureSize + j; if (!ExploredData[num]) { Color32 val = fog[i % fogRes * fogRes + j % fogRes]; if (<>8__1.customFog) { Result[num] = val; } else { Result[num] = new Color32((byte)(yellowMap.r + (val.r - 128)), (byte)(yellowMap.g + (val.g - 128)), (byte)(yellowMap.b + (val.b - 128)), byte.MaxValue); } if (<>8__1.haveContours && IsNearExplored(<>8__1.exploredIntegral, i, j, <>8__1.contourDistance * 2)) { Color32 val2 = contours[i % contoursRes * contoursRes + j % contoursRes]; if (val2.a > 0) { float contourDistanceAlpha = GetContourDistanceAlpha(<>8__1.exploredIntegral, i, j, <>8__1.contourDistance, <>8__1.contourAlphaFactor); float num2 = (float)(int)val2.a / 255f * contourDistanceAlpha; Result[num] = Color32.Lerp(Result[num], val2, num2); Result[num].a = byte.MaxValue; } } } } } }); <internalThread>5__2.Start(); break; } if (<internalThread>5__2.IsAlive) { <>2__current = null; <>1__state = 2; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private const int _textureSize = 4096; private static bool[] _exploredData; private static Color32[] _mapTexture; private static Color[] _forestTexture; private static Color32[] _heightmap; private static Color32[] _result; private static Color32[] space; private static int spaceRes; private static Color32[] fog; private static int fogRes; private static Color32[] contours; private static int contoursRes; public static readonly Color32 yellowMap = new Color32((byte)203, (byte)155, (byte)87, byte.MaxValue); public static readonly Color32 oceanColor = new Color32((byte)20, (byte)100, byte.MaxValue, byte.MaxValue); public static readonly Color32 abyssColor = new Color32((byte)0, (byte)0, (byte)0, byte.MaxValue); public static readonly Color32 lavaColor = new Color32((byte)205, (byte)51, (byte)15, byte.MaxValue); public static readonly Color32 northColor = new Color32((byte)170, (byte)173, (byte)194, byte.MaxValue); public static readonly Color32 mistColor = new Color32((byte)217, (byte)140, (byte)166, byte.MaxValue); public static readonly Color clearMask = new Color(0f, 0f, 0f, 1f); public static int TextureSize => (int)(4096f * NomapPrinter.mapSizeMultiplier.Value); private static Color32[] MapTexture { get { if (_mapTexture == null) { _mapTexture = (Color32[])(object)new Color32[TextureSize * TextureSize]; } return _mapTexture; } set { _mapTexture = value; } } private static Color[] ForestTexture { get { if (_forestTexture == null) { _forestTexture = (Color[])(object)new Color[TextureSize * TextureSize]; } return _forestTexture; } set { _forestTexture = value; } } private static Color32[] Heightmap { get { if (_heightmap == null) { _heightmap = (Color32[])(object)new Color32[TextureSize * TextureSize]; } return _heightmap; } set { _heightmap = value; } } private static bool[] ExploredData { get { if (_exploredData == null) { _exploredData = new bool[TextureSize * TextureSize]; } return _exploredData; } set { _exploredData = value; } } public static Color32[] Result { get { if (_result == null) { _result = (Color32[])(object)new Color32[TextureSize * TextureSize]; } return _result; } set { _result = value; } } [IteratorStateMachine(typeof(<Initialize>d__36))] public static IEnumerator Initialize() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <Initialize>d__36(0); } public static void InitializeTextures(Texture2D biomes, Texture2D forests, Texture2D height) { MapTexture = biomes.GetPixels32(); ForestTexture = forests.GetPixels(); Heightmap = height.GetPixels32(); } public static void DeInitializeTextures() { MapTexture = null; ForestTexture = null; Heightmap = null; Result = null; fog = null; contours = null; } public static void SetFogTexture(Texture2D fog) { SetFogTexture(fog.GetPixels32()); } public static void SetContoursTexture(Color32[] newContours) { contours = (Color32[])(object)new Color32[newContours.Length]; contoursRes = (int)Math.Sqrt(newContours.Length); newContours.CopyTo(contours, 0); } public static void SetFogTexture(Color32[] newFog) { fog = (Color32[])(object)new Color32[newFog.Length]; fogRes = (int)Math.Sqrt(newFog.Length); newFog.CopyTo(fog, 0); } public static void SetMapTexture(Texture2D map) { SetMapTexture(map.GetPixels32()); } public static void SetMapTexture(Color32[] map) { map.CopyTo(MapTexture, 0); } [IteratorStateMachine(typeof(<OverlayTextureOnMap>d__44))] public static IEnumerator OverlayTextureOnMap(Texture2D texture) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <OverlayTextureOnMap>d__44(0) { texture = texture }; } [IteratorStateMachine(typeof(<OverlayExplorationFog>d__45))] public static IEnumerator OverlayExplorationFog(bool[] exploration) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <OverlayExplorationFog>d__45(0) { exploration = exploration }; } [IteratorStateMachine(typeof(<GenerateOldMap>d__46))] public static IEnumerator GenerateOldMap(int graduationHeight) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <GenerateOldMap>d__46(0) { graduationHeight = graduationHeight }; } [IteratorStateMachine(typeof(<GenerateChartMap>d__47))] public static IEnumerator GenerateChartMap(int graduationHeight) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <GenerateChartMap>d__47(0) { graduationHeight = graduationHeight }; } [IteratorStateMachine(typeof(<GenerateSatelliteImage>d__48))] public static IEnumerator GenerateSatelliteImage() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <GenerateSatelliteImage>d__48(0); } [IteratorStateMachine(typeof(<GenerateTopographicalMap>d__49))] public static IEnumerator GenerateTopographicalMap(int graduationHeight) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <GenerateTopographicalMap>d__49(0) { graduationHeight = graduationHeight }; } [IteratorStateMachine(typeof(<OverlayResultOnMap>d__50))] private static IEnumerator OverlayResultOnMap() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <OverlayResultOnMap>d__50(0); } [IteratorStateMachine(typeof(<OverlayTexture>d__51))] private static IEnumerator OverlayTexture(Color32[] array1, Color32[] array2) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <OverlayTexture>d__51(0) { array1 = array1, array2 = array2 }; } [IteratorStateMachine(typeof(<LerpTextures>d__52))] private static IEnumerator LerpTextures(Color32[] array1, Color32[] array2) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <LerpTextures>d__52(0) { array1 = array1, array2 = array2 }; } [IteratorStateMachine(typeof(<DarkenTextureLi