code optimization
This commit is contained in:
@@ -1,17 +1,15 @@
|
|||||||
using System;
|
namespace SM64Lib.LIBMIO0;
|
||||||
|
|
||||||
namespace SM64Lib.LIBMIO0
|
public struct MIO0_Header
|
||||||
{
|
{
|
||||||
public struct MIO0_Header
|
|
||||||
{
|
|
||||||
public uint dest_size;
|
public uint dest_size;
|
||||||
public uint comp_offset;
|
public uint comp_offset;
|
||||||
public uint uncomp_offset;
|
public uint uncomp_offset;
|
||||||
public bool big_endian;
|
public bool big_endian;
|
||||||
};
|
};
|
||||||
|
|
||||||
public class MIO0
|
public class MIO0
|
||||||
{
|
{
|
||||||
|
|
||||||
private const int MIO0_HEADER_LENGTH = 16;
|
private const int MIO0_HEADER_LENGTH = 16;
|
||||||
|
|
||||||
@@ -147,5 +145,4 @@ namespace SM64Lib.LIBMIO0
|
|||||||
return decoded;
|
return decoded;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
using System.Reflection;
|
using System.Runtime.InteropServices;
|
||||||
using System.Runtime.CompilerServices;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly
|
// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly
|
||||||
// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von
|
// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
|
|
||||||
namespace SM64Lib.N64Graphics
|
namespace SM64Lib.N64Graphics;
|
||||||
{
|
|
||||||
public enum N64Codec { RGBA16, RGBA32, IA16, IA8, IA4, I8, I4, CI8, CI4, ONEBPP };
|
|
||||||
public enum N64IMode { AlphaCopyIntensity, AlphaBinary, AlphaOne };
|
|
||||||
|
|
||||||
public class N64Graphics
|
public enum N64Codec { RGBA16, RGBA32, IA16, IA8, IA4, I8, I4, CI8, CI4, ONEBPP };
|
||||||
{
|
public enum N64IMode { AlphaCopyIntensity, AlphaBinary, AlphaOne };
|
||||||
|
|
||||||
|
public class N64Graphics
|
||||||
|
{
|
||||||
private static int SCALE_5_8(int val)
|
private static int SCALE_5_8(int val)
|
||||||
{
|
{
|
||||||
return (val * 0xFF) / 0x1F;
|
return (val * 0xFF) / 0x1F;
|
||||||
@@ -520,5 +520,4 @@ namespace SM64Lib.N64Graphics
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
using System.Reflection;
|
using System.Runtime.InteropServices;
|
||||||
using System.Runtime.CompilerServices;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar
|
// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar
|
||||||
// für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von
|
// für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von
|
||||||
|
|||||||
@@ -1,16 +1,12 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Drawing.Imaging;
|
using System.Drawing.Imaging;
|
||||||
using System.Linq;
|
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace SM64Lib.N64Graphics
|
namespace SM64Lib.N64Graphics;
|
||||||
|
|
||||||
|
public class TextureFormats
|
||||||
{
|
{
|
||||||
public class TextureFormats
|
|
||||||
{
|
|
||||||
public static Bitmap createColorTexture(Color color)
|
public static Bitmap createColorTexture(Color color)
|
||||||
{
|
{
|
||||||
Bitmap tex = new Bitmap(1, 1);
|
Bitmap tex = new Bitmap(1, 1);
|
||||||
@@ -594,5 +590,4 @@ namespace SM64Lib.N64Graphics
|
|||||||
"Height: " + height };
|
"Height: " + height };
|
||||||
return tex;
|
return tex;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,12 @@
|
|||||||
using OfficeOpenXml;
|
using OfficeOpenXml;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace SM64Lib.Text.Exporters
|
namespace SM64Lib.Text.Exporters;
|
||||||
|
|
||||||
|
public class ExcelExporter
|
||||||
{
|
{
|
||||||
public class ExcelExporter
|
|
||||||
{
|
|
||||||
public ExcelExporter()
|
public ExcelExporter()
|
||||||
{
|
{
|
||||||
ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
|
ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
|
||||||
@@ -98,5 +95,4 @@ namespace SM64Lib.Text.Exporters
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
using System.Reflection;
|
using System.Runtime.InteropServices;
|
||||||
using System.Runtime.CompilerServices;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly
|
// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly
|
||||||
// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von
|
// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von
|
||||||
|
|||||||
@@ -1,14 +1,10 @@
|
|||||||
using System;
|
using System.IO;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace SM64Lib.Text.Exporters
|
namespace SM64Lib.Text.Exporters;
|
||||||
|
|
||||||
|
public class TxtExporter
|
||||||
{
|
{
|
||||||
public class TxtExporter
|
|
||||||
{
|
|
||||||
public async Task Export(string destFilePath, TextGroup[] groups)
|
public async Task Export(string destFilePath, TextGroup[] groups)
|
||||||
{
|
{
|
||||||
var sw = new StreamWriter(destFilePath);
|
var sw = new StreamWriter(destFilePath);
|
||||||
@@ -44,5 +40,4 @@ namespace SM64Lib.Text.Exporters
|
|||||||
await sw.FlushAsync();
|
await sw.FlushAsync();
|
||||||
sw.Close();
|
sw.Close();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using global::System;
|
using global::System;
|
||||||
using global::System.Reflection;
|
|
||||||
using global::System.Runtime.InteropServices;
|
using global::System.Runtime.InteropServices;
|
||||||
[assembly: ComVisible(false)]
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using Microsoft.VisualBasic.CompilerServices;
|
|
||||||
|
|
||||||
namespace SM64Lib.TextValueConverter
|
namespace SM64Lib.TextValueConverter;
|
||||||
|
|
||||||
|
public static class TextValueConverter
|
||||||
{
|
{
|
||||||
public static class TextValueConverter
|
|
||||||
{
|
|
||||||
public static event WantIntegerValueModeEventHandler WantIntegerValueMode;
|
public static event WantIntegerValueModeEventHandler WantIntegerValueMode;
|
||||||
public delegate void WantIntegerValueModeEventHandler(WantIntegerValueModeEventArgs e);
|
public delegate void WantIntegerValueModeEventHandler(WantIntegerValueModeEventArgs e);
|
||||||
|
|
||||||
@@ -80,10 +79,9 @@ namespace SM64Lib.TextValueConverter
|
|||||||
WantIntegerValueMode?.Invoke(e);
|
WantIntegerValueMode?.Invoke(e);
|
||||||
return e.IntegerValueMode;
|
return e.IntegerValueMode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class WantIntegerValueModeEventArgs : EventArgs
|
public class WantIntegerValueModeEventArgs : EventArgs
|
||||||
{
|
{
|
||||||
public int IntegerValueMode { get; set; }
|
public int IntegerValueMode { get; set; }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,15 +1,10 @@
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SM64Lib.Data;
|
using SM64Lib.Data;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace SM64Lib.ASM
|
namespace SM64Lib.ASM;
|
||||||
|
|
||||||
|
public class CustomAsmArea
|
||||||
{
|
{
|
||||||
public class CustomAsmArea
|
|
||||||
{
|
|
||||||
public byte[] AreaBytes { get; set; }
|
public byte[] AreaBytes { get; set; }
|
||||||
|
|
||||||
[JsonProperty(nameof(Config))]
|
[JsonProperty(nameof(Config))]
|
||||||
@@ -79,5 +74,4 @@ namespace SM64Lib.ASM
|
|||||||
Config.RamAddress = address - bankConfig.GetRomStartAddress() + bankConfig.GetRamStartAddress();
|
Config.RamAddress = address - bankConfig.GetRomStartAddress() + bankConfig.GetRamStartAddress();
|
||||||
return Config.Length;
|
return Config.Length;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,11 @@
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Pilz.Cryptography;
|
using Pilz.Cryptography;
|
||||||
using Pilz.Json.Converters;
|
using Pilz.Json.Converters;
|
||||||
|
|
||||||
namespace SM64Lib.ASM
|
namespace SM64Lib.ASM;
|
||||||
|
|
||||||
|
public class CustomAsmAreaConfig
|
||||||
{
|
{
|
||||||
public class CustomAsmAreaConfig
|
|
||||||
{
|
|
||||||
internal delegate void RequestCustomAsmAreaEventHandler(CustomAsmAreaConfig config, RequestCustomAsmAreaEventArgs request);
|
internal delegate void RequestCustomAsmAreaEventHandler(CustomAsmAreaConfig config, RequestCustomAsmAreaEventArgs request);
|
||||||
internal static event RequestCustomAsmAreaEventHandler RequestCustomAsmArea;
|
internal static event RequestCustomAsmAreaEventHandler RequestCustomAsmArea;
|
||||||
|
|
||||||
@@ -35,5 +30,4 @@ namespace SM64Lib.ASM
|
|||||||
{
|
{
|
||||||
public CustomAsmArea CustomAsmArea { get; set; }
|
public CustomAsmArea CustomAsmArea { get; set; }
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,11 @@
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace SM64Lib.ASM
|
namespace SM64Lib.ASM;
|
||||||
|
|
||||||
|
public class CustomAsmBank
|
||||||
{
|
{
|
||||||
public class CustomAsmBank
|
|
||||||
{
|
|
||||||
public CustomAsmBankConfig Config { get; }
|
public CustomAsmBankConfig Config { get; }
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public List<CustomAsmArea> Areas { get; } = new List<CustomAsmArea>();
|
public List<CustomAsmArea> Areas { get; } = new List<CustomAsmArea>();
|
||||||
@@ -81,5 +78,4 @@ namespace SM64Lib.ASM
|
|||||||
Config.Areas.Clear();
|
Config.Areas.Clear();
|
||||||
Config.Areas.AddRange(Areas.Select(n => n.Config));
|
Config.Areas.AddRange(Areas.Select(n => n.Config));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,10 @@
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace SM64Lib.ASM
|
namespace SM64Lib.ASM;
|
||||||
|
|
||||||
|
public class CustomAsmBankConfig
|
||||||
{
|
{
|
||||||
public class CustomAsmBankConfig
|
|
||||||
{
|
|
||||||
public static int DefaultMaxLength { get; set; } = 0xA000;
|
public static int DefaultMaxLength { get; set; } = 0xA000;
|
||||||
public static int DefaultRomStartAddress { get; internal set; } = 0x1206000;
|
public static int DefaultRomStartAddress { get; internal set; } = 0x1206000;
|
||||||
public static int DefaultRamStartAddress { get; internal set; } = 0x406000;
|
public static int DefaultRamStartAddress { get; internal set; } = 0x406000;
|
||||||
@@ -46,5 +42,4 @@ namespace SM64Lib.ASM
|
|||||||
bool isDefault = RamStartAddress == -1;
|
bool isDefault = RamStartAddress == -1;
|
||||||
return (isDefault ? DefaultMaxLength : MaxLength, isDefault);
|
return (isDefault ? DefaultMaxLength : MaxLength, isDefault);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,10 @@
|
|||||||
using SM64Lib.Patching;
|
using SM64Lib.Patching;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace SM64Lib
|
namespace SM64Lib;
|
||||||
|
|
||||||
|
public class BaseTweakScriptInfo
|
||||||
{
|
{
|
||||||
public class BaseTweakScriptInfo
|
|
||||||
{
|
|
||||||
public PatchScript Script { get; private set; }
|
public PatchScript Script { get; private set; }
|
||||||
public int Priority { get; private set; }
|
public int Priority { get; private set; }
|
||||||
public bool IsReadOnly { get; private set; }
|
public bool IsReadOnly { get; private set; }
|
||||||
@@ -26,5 +22,4 @@ namespace SM64Lib
|
|||||||
Name = infos[3];
|
Name = infos[3];
|
||||||
Script = script;
|
Script = script;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,15 +5,13 @@ using SM64Lib.Data;
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Z.Collections.Extensions;
|
using Z.Collections.Extensions;
|
||||||
using static SM64Lib.Extensions.ObjectExtensions;
|
using static SM64Lib.Extensions.ObjectExtensions;
|
||||||
|
|
||||||
namespace SM64Lib.Behaviors
|
namespace SM64Lib.Behaviors;
|
||||||
|
|
||||||
|
public class Behavior
|
||||||
{
|
{
|
||||||
public class Behavior
|
|
||||||
{
|
|
||||||
private readonly Dictionary<CustomAsmAreaConfig, BehaviorscriptCommand> knownCustomAsmCommands = new Dictionary<CustomAsmAreaConfig, BehaviorscriptCommand>();
|
private readonly Dictionary<CustomAsmAreaConfig, BehaviorscriptCommand> knownCustomAsmCommands = new Dictionary<CustomAsmAreaConfig, BehaviorscriptCommand>();
|
||||||
|
|
||||||
[JsonProperty]
|
[JsonProperty]
|
||||||
@@ -237,5 +235,4 @@ namespace SM64Lib.Behaviors
|
|||||||
Config.ParamsInfo.CloneTo(dest.Config.ParamsInfo);
|
Config.ParamsInfo.CloneTo(dest.Config.ParamsInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,18 +1,15 @@
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SM64Lib.Data;
|
using SM64Lib.Data;
|
||||||
using SM64Lib.SegmentedBanking;
|
using SM64Lib.SegmentedBanking;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Z.Collections.Extensions;
|
using Z.Collections.Extensions;
|
||||||
|
|
||||||
namespace SM64Lib.Behaviors
|
namespace SM64Lib.Behaviors;
|
||||||
|
|
||||||
|
public class BehaviorBank
|
||||||
{
|
{
|
||||||
public class BehaviorBank
|
|
||||||
{
|
|
||||||
public BehaviorBankConfig Config { get; private set; }
|
public BehaviorBankConfig Config { get; private set; }
|
||||||
public List<Behavior> Behaviors { get; } = new List<Behavior>();
|
public List<Behavior> Behaviors { get; } = new List<Behavior>();
|
||||||
|
|
||||||
@@ -216,5 +213,4 @@ namespace SM64Lib.Behaviors
|
|||||||
// Update addresses
|
// Update addresses
|
||||||
UpdateBehaviorAddresses(rommgr, addressUpdates);
|
UpdateBehaviorAddresses(rommgr, addressUpdates);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,10 @@
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace SM64Lib.Behaviors
|
namespace SM64Lib.Behaviors;
|
||||||
|
|
||||||
|
public class BehaviorBankConfig
|
||||||
{
|
{
|
||||||
public class BehaviorBankConfig
|
|
||||||
{
|
|
||||||
public bool IsVanilla { get; set; } = true;
|
public bool IsVanilla { get; set; } = true;
|
||||||
public List<BehaviorConfig> BehaviorConfigs { get; } = new List<BehaviorConfig>();
|
public List<BehaviorConfig> BehaviorConfigs { get; } = new List<BehaviorConfig>();
|
||||||
|
|
||||||
@@ -32,5 +28,4 @@ namespace SM64Lib.Behaviors
|
|||||||
return enabled;
|
return enabled;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,12 @@
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Pilz.Cryptography;
|
using Pilz.Cryptography;
|
||||||
using Pilz.Json.Converters;
|
using Pilz.Json.Converters;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace SM64Lib.Behaviors
|
namespace SM64Lib.Behaviors;
|
||||||
|
|
||||||
|
public class BehaviorConfig
|
||||||
{
|
{
|
||||||
public class BehaviorConfig
|
|
||||||
{
|
|
||||||
internal delegate void RequestModelEventHandler(BehaviorConfig config, RequestBehaviorEventArgs request);
|
internal delegate void RequestModelEventHandler(BehaviorConfig config, RequestBehaviorEventArgs request);
|
||||||
internal static event RequestModelEventHandler RequestBehavior;
|
internal static event RequestModelEventHandler RequestBehavior;
|
||||||
|
|
||||||
@@ -35,5 +31,4 @@ namespace SM64Lib.Behaviors
|
|||||||
{
|
{
|
||||||
public Behavior Behavior { get; set; }
|
public Behavior Behavior { get; set; }
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,6 @@
|
|||||||
using System;
|
namespace SM64Lib.Behaviors;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace SM64Lib.Behaviors
|
public enum BehaviorCreationTypes
|
||||||
{
|
{
|
||||||
public enum BehaviorCreationTypes
|
|
||||||
{
|
|
||||||
SolidObject
|
SolidObject
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,10 @@
|
|||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace SM64Lib.Behaviors
|
namespace SM64Lib.Behaviors;
|
||||||
|
|
||||||
|
public class BehaviorParamInfo
|
||||||
{
|
{
|
||||||
public class BehaviorParamInfo
|
|
||||||
{
|
|
||||||
public string Name { get; set; } = string.Empty;
|
public string Name { get; set; } = string.Empty;
|
||||||
public string Description { get; set; } = string.Empty;
|
public string Description { get; set; } = string.Empty;
|
||||||
public List<BehaviorParamValue> Values { get; } = new List<BehaviorParamValue>();
|
public List<BehaviorParamValue> Values { get; } = new List<BehaviorParamValue>();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,7 @@
|
|||||||
using System;
|
namespace SM64Lib.Behaviors;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace SM64Lib.Behaviors
|
public class BehaviorParamValue
|
||||||
{
|
{
|
||||||
public class BehaviorParamValue
|
|
||||||
{
|
|
||||||
public string Name { get; set; } = "";
|
public string Name { get; set; } = "";
|
||||||
public byte Value { get; set; } = 0;
|
public byte Value { get; set; } = 0;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,9 @@
|
|||||||
using System;
|
namespace SM64Lib.Behaviors;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace SM64Lib.Behaviors
|
public class BehaviorParamsInfo
|
||||||
{
|
{
|
||||||
public class BehaviorParamsInfo
|
|
||||||
{
|
|
||||||
public BehaviorParamInfo Param1 { get; } = new();
|
public BehaviorParamInfo Param1 { get; } = new();
|
||||||
public BehaviorParamInfo Param2 { get; } = new();
|
public BehaviorParamInfo Param2 { get; } = new();
|
||||||
public BehaviorParamInfo Param3 { get; } = new();
|
public BehaviorParamInfo Param3 { get; } = new();
|
||||||
public BehaviorParamInfo Param4 { get; } = new();
|
public BehaviorParamInfo Param4 { get; } = new();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,10 @@
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SM64Lib.ASM;
|
using SM64Lib.ASM;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace SM64Lib.Behaviors
|
namespace SM64Lib.Behaviors;
|
||||||
|
|
||||||
|
public class CustomAsmAreaLinkOptions
|
||||||
{
|
{
|
||||||
public class CustomAsmAreaLinkOptions
|
|
||||||
{
|
|
||||||
// Temporary fix - Remove custom property code and make it auto property in v1.?
|
// Temporary fix - Remove custom property code and make it auto property in v1.?
|
||||||
private CustomAsmAreaConfig customAsmAreaConfig;
|
private CustomAsmAreaConfig customAsmAreaConfig;
|
||||||
public CustomAsmAreaConfig CustomAsmAreaConfig
|
public CustomAsmAreaConfig CustomAsmAreaConfig
|
||||||
@@ -21,5 +16,4 @@ namespace SM64Lib.Behaviors
|
|||||||
[JsonProperty]
|
[JsonProperty]
|
||||||
public CustomAsmArea CustomAsm { get; private set; }
|
public CustomAsmArea CustomAsm { get; private set; }
|
||||||
public bool Loop { get; set; }
|
public bool Loop { get; set; }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
using SM64Lib.Data;
|
using SM64Lib.Data;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
namespace SM64Lib.Behaviors.Script
|
namespace SM64Lib.Behaviors.Script;
|
||||||
|
|
||||||
|
public class Behaviorscript : BehaviorscriptCommandCollection
|
||||||
{
|
{
|
||||||
public class Behaviorscript : BehaviorscriptCommandCollection
|
|
||||||
{
|
|
||||||
public bool Read(BinaryData data, int address, bool detectJumpsAsEnd = false, bool ignoreEndCmds = false, int expectedLength = -1)
|
public bool Read(BinaryData data, int address, bool detectJumpsAsEnd = false, bool ignoreEndCmds = false, int expectedLength = -1)
|
||||||
{
|
{
|
||||||
bool ende = false;
|
bool ende = false;
|
||||||
@@ -102,5 +101,4 @@ namespace SM64Lib.Behaviors.Script
|
|||||||
return (BehaviorscriptCommand)this.FirstOrDefault(n => n.CommandType == cmdType);
|
return (BehaviorscriptCommand)this.FirstOrDefault(n => n.CommandType == cmdType);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -2,11 +2,11 @@
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SM64Lib.Json;
|
using SM64Lib.Json;
|
||||||
|
|
||||||
namespace SM64Lib.Behaviors.Script
|
namespace SM64Lib.Behaviors.Script;
|
||||||
|
|
||||||
|
[JsonConverter(typeof(BehaviorscriptCommandJsonConverter))]
|
||||||
|
public class BehaviorscriptCommand : SM64Lib.Script.BaseCommand<BehaviorscriptCommandTypes>
|
||||||
{
|
{
|
||||||
[JsonConverter(typeof(BehaviorscriptCommandJsonConverter))]
|
|
||||||
public class BehaviorscriptCommand : SM64Lib.Script.BaseCommand<BehaviorscriptCommandTypes>
|
|
||||||
{
|
|
||||||
|
|
||||||
public override BehaviorscriptCommandTypes CommandType
|
public override BehaviorscriptCommandTypes CommandType
|
||||||
{
|
{
|
||||||
@@ -116,5 +116,4 @@ namespace SM64Lib.Behaviors.Script
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
|
|
||||||
namespace SM64Lib.Behaviors.Script
|
namespace SM64Lib.Behaviors.Script;
|
||||||
|
|
||||||
|
public class BehaviorscriptCommandCollection : SM64Lib.Script.BaseCommandCollection<BehaviorscriptCommand, BehaviorscriptCommandTypes>
|
||||||
{
|
{
|
||||||
public class BehaviorscriptCommandCollection : SM64Lib.Script.BaseCommandCollection<BehaviorscriptCommand, BehaviorscriptCommandTypes>
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,13 +1,7 @@
|
|||||||
using System;
|
namespace SM64Lib.Behaviors.Script;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace SM64Lib.Behaviors.Script
|
public static class BehaviorscriptCommandFactory
|
||||||
{
|
{
|
||||||
public static class BehaviorscriptCommandFactory
|
|
||||||
{
|
|
||||||
public static BehaviorscriptCommand Build_x2A(int collisionPointer = -1)
|
public static BehaviorscriptCommand Build_x2A(int collisionPointer = -1)
|
||||||
{
|
{
|
||||||
var cmd = new BehaviorscriptCommand("2a 00 00 00 00 00 00 00");
|
var cmd = new BehaviorscriptCommand("2a 00 00 00 00 00 00 00");
|
||||||
@@ -28,5 +22,4 @@ namespace SM64Lib.Behaviors.Script
|
|||||||
BehaviorscriptCommandFunctions.X2A.SetCollisionPointer(cmd, asmPointer);
|
BehaviorscriptCommandFunctions.X2A.SetCollisionPointer(cmd, asmPointer);
|
||||||
return cmd;
|
return cmd;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,7 @@
|
|||||||
using SM64Lib.Data;
|
namespace SM64Lib.Behaviors.Script;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace SM64Lib.Behaviors.Script
|
public class BehaviorscriptCommandFunctions
|
||||||
{
|
{
|
||||||
public class BehaviorscriptCommandFunctions
|
|
||||||
{
|
|
||||||
public class X2A
|
public class X2A
|
||||||
{
|
{
|
||||||
public static int GetCollisionPointer(BehaviorscriptCommand cmd)
|
public static int GetCollisionPointer(BehaviorscriptCommand cmd)
|
||||||
@@ -35,5 +28,4 @@ namespace SM64Lib.Behaviors.Script
|
|||||||
cmd.Write(pointer);
|
cmd.Write(pointer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
namespace SM64Lib.Behaviors.Script
|
namespace SM64Lib.Behaviors.Script;
|
||||||
|
|
||||||
|
public enum BehaviorscriptCommandTypes
|
||||||
{
|
{
|
||||||
public enum BehaviorscriptCommandTypes
|
|
||||||
{
|
|
||||||
x00_Start,
|
x00_Start,
|
||||||
x01_StateLoop,
|
x01_StateLoop,
|
||||||
x02_JumpandLink,
|
x02_JumpandLink,
|
||||||
@@ -58,5 +58,4 @@
|
|||||||
x35_ClearGraphFlag,
|
x35_ClearGraphFlag,
|
||||||
x36_SetValue,
|
x36_SetValue,
|
||||||
x37_SpawnSomething
|
x37_SpawnSomething
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,14 +1,11 @@
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace SM64Lib.Configuration
|
namespace SM64Lib.Configuration;
|
||||||
|
|
||||||
|
public class CollisionBasicConfig
|
||||||
{
|
{
|
||||||
public class CollisionBasicConfig
|
|
||||||
{
|
|
||||||
private List<byte> collisionTypesWithParams = new List<byte>()
|
private List<byte> collisionTypesWithParams = new List<byte>()
|
||||||
{ 4, 14, 44, 36, 37, 39, 45 };
|
{ 4, 14, 44, 36, 37, 39, 45 };
|
||||||
|
|
||||||
@@ -18,5 +15,4 @@ namespace SM64Lib.Configuration
|
|||||||
get => collisionTypesWithParams;
|
get => collisionTypesWithParams;
|
||||||
private set => collisionTypesWithParams = value.Distinct().ToList();
|
private set => collisionTypesWithParams = value.Distinct().ToList();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SM64Lib.Objects.ModelBanks;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using Pilz.Cryptography;
|
using Pilz.Cryptography;
|
||||||
using Pilz.Json.Converters;
|
using Pilz.Json.Converters;
|
||||||
|
using SM64Lib.Objects.ModelBanks;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace SM64Lib.Configuration
|
namespace SM64Lib.Configuration;
|
||||||
|
|
||||||
|
public class CustomModelConfig
|
||||||
{
|
{
|
||||||
public class CustomModelConfig
|
|
||||||
{
|
|
||||||
internal delegate void RequestModelEventHandler(CustomModelConfig config, RequestModelEventArgs request);
|
internal delegate void RequestModelEventHandler(CustomModelConfig config, RequestModelEventArgs request);
|
||||||
internal static event RequestModelEventHandler RequestModel;
|
internal static event RequestModelEventHandler RequestModel;
|
||||||
|
|
||||||
@@ -27,5 +27,4 @@ namespace SM64Lib.Configuration
|
|||||||
{
|
{
|
||||||
public CustomModel Model { get; set; }
|
public CustomModel Model { get; set; }
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,9 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace SM64Lib.Configuration
|
namespace SM64Lib.Configuration;
|
||||||
|
|
||||||
|
public class LevelAreaConfig
|
||||||
{
|
{
|
||||||
public class LevelAreaConfig
|
|
||||||
{
|
|
||||||
public string AreaName { get; set; }
|
public string AreaName { get; set; }
|
||||||
public Dictionary<short, string> ScrollingNames { get; set; } = new Dictionary<short, string>();
|
public Dictionary<short, string> ScrollingNames { get; set; } = new Dictionary<short, string>();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace SM64Lib.Configuration
|
namespace SM64Lib.Configuration;
|
||||||
|
|
||||||
|
public class LevelConfig
|
||||||
{
|
{
|
||||||
public class LevelConfig
|
|
||||||
{
|
|
||||||
public string LevelName { get; set; }
|
public string LevelName { get; set; }
|
||||||
public bool EnableLocalObjectBank { get; set; } = false;
|
public bool EnableLocalObjectBank { get; set; } = false;
|
||||||
public ObjectModelConfig LocalObjectBank { get; set; } = new ObjectModelConfig();
|
public ObjectModelConfig LocalObjectBank { get; set; } = new ObjectModelConfig();
|
||||||
@@ -22,5 +22,4 @@ namespace SM64Lib.Configuration
|
|||||||
return conf;
|
return conf;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,8 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace SM64Lib.Configuration
|
namespace SM64Lib.Configuration;
|
||||||
|
|
||||||
|
public class MusicConfiguration
|
||||||
{
|
{
|
||||||
public class MusicConfiguration
|
|
||||||
{
|
|
||||||
public List<string> SqeuenceNames { get; private set; } = new List<string>();
|
public List<string> SqeuenceNames { get; private set; } = new List<string>();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,13 +1,6 @@
|
|||||||
using System;
|
namespace SM64Lib.Configuration;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace SM64Lib.Configuration
|
public class NPCConfig
|
||||||
{
|
{
|
||||||
public class NPCConfig
|
|
||||||
{
|
|
||||||
public bool Enabled3DCoins { get; set; } = false;
|
public bool Enabled3DCoins { get; set; } = false;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace SM64Lib.Configuration
|
namespace SM64Lib.Configuration;
|
||||||
|
|
||||||
|
public class ObjectModelConfig
|
||||||
{
|
{
|
||||||
public class ObjectModelConfig
|
|
||||||
{
|
|
||||||
public Dictionary<int, CustomModelConfig> CustomObjectConfigs { get; private set; } = new Dictionary<int, CustomModelConfig>();
|
public Dictionary<int, CustomModelConfig> CustomObjectConfigs { get; private set; } = new Dictionary<int, CustomModelConfig>();
|
||||||
|
|
||||||
public CustomModelConfig GetCustomObjectConfig(int id)
|
public CustomModelConfig GetCustomObjectConfig(int id)
|
||||||
@@ -16,5 +16,4 @@ namespace SM64Lib.Configuration
|
|||||||
|
|
||||||
return conf;
|
return conf;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,15 +1,9 @@
|
|||||||
using Pilz.IO;
|
using Pilz.IO;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace SM64Lib.Configuration
|
namespace SM64Lib.Configuration;
|
||||||
|
|
||||||
|
public class PatchingConfig
|
||||||
{
|
{
|
||||||
public class PatchingConfig
|
|
||||||
{
|
|
||||||
public EmbeddedFilesContainer TweakBackups { get; } = new EmbeddedFilesContainer();
|
public EmbeddedFilesContainer TweakBackups { get; } = new EmbeddedFilesContainer();
|
||||||
public bool Patched2DCamera { get; set; } = false;
|
public bool Patched2DCamera { get; set; } = false;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,18 +1,17 @@
|
|||||||
using System.Collections.Generic;
|
using global::Newtonsoft.Json.Linq;
|
||||||
using global::System.IO;
|
using global::System.IO;
|
||||||
using Microsoft.VisualBasic.CompilerServices;
|
|
||||||
using global::Newtonsoft.Json.Linq;
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using SM64Lib.ASM;
|
||||||
using SM64Lib.Behaviors;
|
using SM64Lib.Behaviors;
|
||||||
using SM64Lib.Objects.ObjectBanks;
|
using SM64Lib.Objects.ObjectBanks;
|
||||||
using SM64Lib.ASM;
|
|
||||||
using SM64Lib.Objects.ObjectBanks.Data;
|
using SM64Lib.Objects.ObjectBanks.Data;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace SM64Lib.Configuration
|
namespace SM64Lib.Configuration;
|
||||||
|
|
||||||
|
public class RomConfig
|
||||||
{
|
{
|
||||||
public class RomConfig
|
|
||||||
{
|
|
||||||
// Levels
|
// Levels
|
||||||
public Dictionary<byte, LevelConfig> LevelConfigs { get; } = new Dictionary<byte, LevelConfig>();
|
public Dictionary<byte, LevelConfig> LevelConfigs { get; } = new Dictionary<byte, LevelConfig>();
|
||||||
|
|
||||||
@@ -74,5 +73,4 @@ namespace SM64Lib.Configuration
|
|||||||
serializer.PreserveReferencesHandling = PreserveReferencesHandling.All;
|
serializer.PreserveReferencesHandling = PreserveReferencesHandling.All;
|
||||||
File.WriteAllText(filePath, JObject.FromObject(this, serializer).ToString());
|
File.WriteAllText(filePath, JObject.FromObject(this, serializer).ToString());
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,14 +1,7 @@
|
|||||||
using System;
|
namespace SM64Lib.Configuration;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace SM64Lib.Configuration
|
public class ScrollTexConfig
|
||||||
{
|
{
|
||||||
public class ScrollTexConfig
|
|
||||||
{
|
|
||||||
public bool UseCustomBehavior { get; set; } = false;
|
public bool UseCustomBehavior { get; set; } = false;
|
||||||
public int CustomBehaviorAddress { get; set; } = -1;
|
public int CustomBehaviorAddress { get; set; } = -1;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
using global::System.IO;
|
using global::System.IO;
|
||||||
|
|
||||||
namespace SM64Lib.Data
|
namespace SM64Lib.Data;
|
||||||
|
|
||||||
|
public class BinaryArrayData : BinaryStreamData
|
||||||
{
|
{
|
||||||
public class BinaryArrayData : BinaryStreamData
|
|
||||||
{
|
|
||||||
public FileAccess RomAccess { get; private set; } = FileAccess.Read;
|
public FileAccess RomAccess { get; private set; } = FileAccess.Read;
|
||||||
|
|
||||||
public BinaryArrayData(byte[] buffer) : base(new MemoryStream(buffer))
|
public BinaryArrayData(byte[] buffer) : base(new MemoryStream(buffer))
|
||||||
@@ -24,5 +24,4 @@ namespace SM64Lib.Data
|
|||||||
// Return myBaseStream
|
// Return myBaseStream
|
||||||
// End Function
|
// End Function
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -2,10 +2,10 @@
|
|||||||
using SM64Lib.Data.System;
|
using SM64Lib.Data.System;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace SM64Lib.Data
|
namespace SM64Lib.Data;
|
||||||
|
|
||||||
|
public abstract class BinaryData : IDisposable
|
||||||
{
|
{
|
||||||
public abstract class BinaryData : IDisposable
|
|
||||||
{
|
|
||||||
public delegate void AnyBinaryDataEventHandler(BinaryData data);
|
public delegate void AnyBinaryDataEventHandler(BinaryData data);
|
||||||
|
|
||||||
public static event AnyBinaryDataEventHandler AnyBinaryDataOpened;
|
public static event AnyBinaryDataEventHandler AnyBinaryDataOpened;
|
||||||
@@ -276,5 +276,4 @@ namespace SM64Lib.Data
|
|||||||
{
|
{
|
||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,11 +1,10 @@
|
|||||||
using global::System.IO;
|
using global::System.IO;
|
||||||
|
|
||||||
namespace SM64Lib.Data
|
namespace SM64Lib.Data;
|
||||||
|
|
||||||
|
public class BinaryFile : BinaryStreamData
|
||||||
{
|
{
|
||||||
public class BinaryFile : BinaryStreamData
|
|
||||||
{
|
|
||||||
public BinaryFile(string filePath, FileMode fileMode, FileAccess fileAccess) : base(new FileStream(filePath, fileMode, fileAccess))
|
public BinaryFile(string filePath, FileMode fileMode, FileAccess fileAccess) : base(new FileStream(filePath, fileMode, fileAccess))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
using global::System.IO;
|
using global::System.IO;
|
||||||
|
|
||||||
namespace SM64Lib.Data
|
namespace SM64Lib.Data;
|
||||||
|
|
||||||
|
public class BinaryRom : BinaryFile
|
||||||
{
|
{
|
||||||
public class BinaryRom : BinaryFile
|
|
||||||
{
|
|
||||||
public BinaryRom(RomManager rommgr, FileAccess romAccess) : base(rommgr.RomFile, FileMode.Open, romAccess)
|
public BinaryRom(RomManager rommgr, FileAccess romAccess) : base(rommgr.RomFile, FileMode.Open, romAccess)
|
||||||
{
|
{
|
||||||
SetRomManager(rommgr);
|
SetRomManager(rommgr);
|
||||||
@@ -22,5 +22,4 @@ namespace SM64Lib.Data
|
|||||||
// Return RomManager.GetStream(RomAccess)
|
// Return RomManager.GetStream(RomAccess)
|
||||||
// End Function
|
// End Function
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
using global::System.IO;
|
using global::SM64Lib.SegmentedBanking;
|
||||||
using global::SM64Lib.SegmentedBanking;
|
using global::System.IO;
|
||||||
|
|
||||||
namespace SM64Lib.Data
|
namespace SM64Lib.Data;
|
||||||
|
|
||||||
|
public class BinarySegBank : BinaryData
|
||||||
{
|
{
|
||||||
public class BinarySegBank : BinaryData
|
|
||||||
{
|
|
||||||
public SegmentedBank SegBank { get; private set; }
|
public SegmentedBank SegBank { get; private set; }
|
||||||
|
|
||||||
public BinarySegBank(SegmentedBank segBank, RomManager rommgr)
|
public BinarySegBank(SegmentedBank segBank, RomManager rommgr)
|
||||||
@@ -29,5 +29,4 @@ namespace SM64Lib.Data
|
|||||||
|
|
||||||
return SegBank.Data;
|
return SegBank.Data;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
using global::System.IO;
|
using global::System.IO;
|
||||||
|
|
||||||
namespace SM64Lib.Data
|
namespace SM64Lib.Data;
|
||||||
|
|
||||||
|
public class BinaryStreamData : BinaryData
|
||||||
{
|
{
|
||||||
public class BinaryStreamData : BinaryData
|
|
||||||
{
|
|
||||||
protected readonly Stream myBaseStream;
|
protected readonly Stream myBaseStream;
|
||||||
|
|
||||||
public BinaryStreamData(Stream stream)
|
public BinaryStreamData(Stream stream)
|
||||||
@@ -16,5 +16,4 @@ namespace SM64Lib.Data
|
|||||||
{
|
{
|
||||||
return myBaseStream;
|
return myBaseStream;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,12 +1,11 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Microsoft.VisualBasic.CompilerServices;
|
|
||||||
|
|
||||||
namespace SM64Lib.Data.System
|
namespace SM64Lib.Data.System;
|
||||||
|
|
||||||
|
public class Bits
|
||||||
{
|
{
|
||||||
public class Bits
|
|
||||||
{
|
|
||||||
public static byte[] ByteToBitArray(byte b)
|
public static byte[] ByteToBitArray(byte b)
|
||||||
{
|
{
|
||||||
var bitarray = new BitArray(new[] { b });
|
var bitarray = new BitArray(new[] { b });
|
||||||
@@ -94,5 +93,4 @@ namespace SM64Lib.Data.System
|
|||||||
{
|
{
|
||||||
return ByteToBoolArray(b)[index];
|
return ByteToBoolArray(b)[index];
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace SM64Lib.Data.System
|
namespace SM64Lib.Data.System;
|
||||||
|
|
||||||
|
internal static class SwapInts
|
||||||
{
|
{
|
||||||
internal static class SwapInts
|
|
||||||
{
|
|
||||||
public static short SwapInt16(short value)
|
public static short SwapInt16(short value)
|
||||||
{
|
{
|
||||||
var bytes = BitConverter.GetBytes(value);
|
var bytes = BitConverter.GetBytes(value);
|
||||||
@@ -58,5 +58,4 @@ namespace SM64Lib.Data.System
|
|||||||
Array.Reverse(bytes);
|
Array.Reverse(bytes);
|
||||||
return BitConverter.ToSingle(bytes, 0);
|
return BitConverter.ToSingle(bytes, 0);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
using global::System.Runtime.InteropServices;
|
using global::System.Runtime.InteropServices;
|
||||||
|
|
||||||
namespace SM64Lib
|
namespace SM64Lib;
|
||||||
|
|
||||||
|
static class Datatypecastes
|
||||||
{
|
{
|
||||||
static class Datatypecastes
|
|
||||||
{
|
|
||||||
public static short LongToInt16(long value)
|
public static short LongToInt16(long value)
|
||||||
{
|
{
|
||||||
var cast = default(CasterLongInt16);
|
var cast = default(CasterLongInt16);
|
||||||
@@ -35,5 +35,4 @@ namespace SM64Lib
|
|||||||
[FieldOffset(0)]
|
[FieldOffset(0)]
|
||||||
public byte ByteValue;
|
public byte ByteValue;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,13 +1,8 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace SM64Lib.EventArguments
|
namespace SM64Lib.EventArguments;
|
||||||
|
|
||||||
|
public class GetTextProfileInfoEventArgs : EventArgs
|
||||||
{
|
{
|
||||||
public class GetTextProfileInfoEventArgs : EventArgs
|
|
||||||
{
|
|
||||||
public Text.Profiles.TextProfileInfo ProfileInfo { get; set; }
|
public Text.Profiles.TextProfileInfo ProfileInfo { get; set; }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace SM64Lib.EventArguments
|
namespace SM64Lib.EventArguments;
|
||||||
|
|
||||||
|
public class PrepairingRomEventArgs : EventArgs
|
||||||
{
|
{
|
||||||
public class PrepairingRomEventArgs : EventArgs
|
|
||||||
{
|
|
||||||
public IEnumerable<BaseTweakScriptInfo> ScriptInfos { get; set; }
|
public IEnumerable<BaseTweakScriptInfo> ScriptInfos { get; set; }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace SM64Lib.EventArguments
|
namespace SM64Lib.EventArguments;
|
||||||
|
|
||||||
|
public class RomVersionEventArgs : EventArgs
|
||||||
{
|
{
|
||||||
public class RomVersionEventArgs : EventArgs
|
|
||||||
{
|
|
||||||
public RomVersion RomVersion { get; set; }
|
public RomVersion RomVersion { get; set; }
|
||||||
|
|
||||||
internal RomVersionEventArgs(RomVersion romVersion)
|
internal RomVersionEventArgs(RomVersion romVersion)
|
||||||
{
|
{
|
||||||
RomVersion = romVersion;
|
RomVersion = romVersion;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace SM64Lib.Exceptions
|
namespace SM64Lib.Exceptions;
|
||||||
|
|
||||||
|
public class InvalidMD5HashException : Exception
|
||||||
{
|
{
|
||||||
public class InvalidMD5HashException : Exception
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,11 +1,10 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace SM64Lib.Exceptions
|
namespace SM64Lib.Exceptions;
|
||||||
|
|
||||||
|
public class RomCompatiblityException : Exception
|
||||||
{
|
{
|
||||||
public class RomCompatiblityException : Exception
|
|
||||||
{
|
|
||||||
public RomCompatiblityException(string msg) : base(msg)
|
public RomCompatiblityException(string msg) : base(msg)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -2,32 +2,31 @@
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
|
|
||||||
namespace SM64Lib.Extensions
|
namespace SM64Lib.Extensions;
|
||||||
|
|
||||||
|
public static class Int16Extensions
|
||||||
{
|
{
|
||||||
public static class Int16Extensions
|
|
||||||
{
|
|
||||||
public static bool IsInRange(this short value, short min, short max)
|
public static bool IsInRange(this short value, short min, short max)
|
||||||
{
|
{
|
||||||
return value >= min && value <= max;
|
return value >= min && value <= max;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class ObjectExtensions
|
public static class ObjectExtensions
|
||||||
{
|
{
|
||||||
public static void CloneTo<T>(this T source, T destination) where T : class
|
public static void CloneTo<T>(this T source, T destination) where T : class
|
||||||
{
|
{
|
||||||
var json = JsonSerializer.CreateDefault();
|
var json = JsonSerializer.CreateDefault();
|
||||||
var jobj = JObject.FromObject(source);
|
var jobj = JObject.FromObject(source);
|
||||||
jobj.Populate(destination);
|
jobj.Populate(destination);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class JsonExtensions
|
public static class JsonExtensions
|
||||||
{
|
{
|
||||||
public static void Populate(this JToken value, object target)
|
public static void Populate(this JToken value, object target)
|
||||||
{
|
{
|
||||||
using (var sr = value.CreateReader())
|
using (var sr = value.CreateReader())
|
||||||
JsonSerializer.CreateDefault().Populate(sr, target);
|
JsonSerializer.CreateDefault().Populate(sr, target);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace SM64Lib
|
namespace SM64Lib;
|
||||||
|
|
||||||
|
public class FilePathsConfiguration
|
||||||
{
|
{
|
||||||
public class FilePathsConfiguration
|
|
||||||
{
|
|
||||||
|
|
||||||
// S T A T I C M E M B E R S
|
// S T A T I C M E M B E R S
|
||||||
|
|
||||||
@@ -13,7 +13,7 @@ namespace SM64Lib
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return new[] { "rn64crc.exe","ApplyPPF3.exe", "Level Tabel.json", "Update-Patches.json", "Update Patches Folder", "Text Profiles.json", "BaseTweak", "sm64extend.exe", "Original Level Pointers.bin", "armips.exe", "Flips.exe", "nconvert.exe" };
|
return new[] { "rn64crc.exe", "ApplyPPF3.exe", "Level Tabel.json", "Update-Patches.json", "Update Patches Folder", "Text Profiles.json", "BaseTweak", "sm64extend.exe", "Original Level Pointers.bin", "armips.exe", "Flips.exe", "nconvert.exe" };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,5 +45,4 @@ namespace SM64Lib
|
|||||||
{
|
{
|
||||||
dic[key] = path;
|
dic[key] = path;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -8,10 +8,10 @@ using System.IO.Compression;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Security.Cryptography;
|
using System.Security.Cryptography;
|
||||||
|
|
||||||
namespace SM64Lib
|
namespace SM64Lib;
|
||||||
|
|
||||||
|
public static class General
|
||||||
{
|
{
|
||||||
public static class General
|
|
||||||
{
|
|
||||||
public static byte[] DisplayListCommandsWithPointerList { get; private set; } = new byte[] { 0x1, 0x3, 0x4, 0x6, 0xFD };
|
public static byte[] DisplayListCommandsWithPointerList { get; private set; } = new byte[] { 0x1, 0x3, 0x4, 0x6, 0xFD };
|
||||||
public static bool[] ActSelectorDefaultValues { get; private set; } = new bool[] { false, false, false, true, true, false, true, true, true, true, true, true, true, true, true, false, false, false, false, false, false, true, true, true, false, false, false, false, false, false, false, false, false, false, false };
|
public static bool[] ActSelectorDefaultValues { get; private set; } = new bool[] { false, false, false, true, true, false, true, true, true, true, true, true, true, true, true, false, false, false, false, false, false, true, true, true, false, false, false, false, false, false, false, false, false, false, false };
|
||||||
public static PatchClass PatchClass { get; private set; } = new PatchClass();
|
public static PatchClass PatchClass { get; private set; } = new PatchClass();
|
||||||
@@ -599,5 +599,4 @@ namespace SM64Lib
|
|||||||
decompressor.CopyTo(output);
|
decompressor.CopyTo(output);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
namespace SM64Lib.Geolayout
|
namespace SM64Lib.Geolayout;
|
||||||
|
|
||||||
|
public enum BackgroundIDs : byte
|
||||||
{
|
{
|
||||||
public enum BackgroundIDs : byte
|
|
||||||
{
|
|
||||||
HauntedForest = 0x6,
|
HauntedForest = 0x6,
|
||||||
SnowyMountains = 0x4,
|
SnowyMountains = 0x4,
|
||||||
Desert = 0x5,
|
Desert = 0x5,
|
||||||
@@ -14,5 +14,4 @@ namespace SM64Lib.Geolayout
|
|||||||
FlamingSky = 0x1,
|
FlamingSky = 0x1,
|
||||||
PurpleClouds = 0x9,
|
PurpleClouds = 0x9,
|
||||||
Custom = 0xA
|
Custom = 0xA
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
namespace SM64Lib.Geolayout
|
namespace SM64Lib.Geolayout;
|
||||||
|
|
||||||
|
public enum BackgroundPointers
|
||||||
{
|
{
|
||||||
public enum BackgroundPointers
|
|
||||||
{
|
|
||||||
HauntedForestStart = 0xC3B030, // &HC3AFD5
|
HauntedForestStart = 0xC3B030, // &HC3AFD5
|
||||||
HauntedForestEnd = 0xC4F970, // &HC4F915
|
HauntedForestEnd = 0xC4F970, // &HC4F915
|
||||||
SnowyMountainsStart = 0xB5D8B0, // &HB5D855
|
SnowyMountainsStart = 0xB5D8B0, // &HB5D855
|
||||||
@@ -23,5 +23,4 @@ namespace SM64Lib.Geolayout
|
|||||||
FlamingSkyEnd = 0xBBAC70, // &HBBAC15
|
FlamingSkyEnd = 0xBBAC70, // &HBBAC15
|
||||||
PurpleCloudsStart = 0xC7FAB0, // &HC7FA55
|
PurpleCloudsStart = 0xC7FAB0, // &HC7FA55
|
||||||
PurpleCloudsEnd = 0xC9FBF0 // &HC9FB95
|
PurpleCloudsEnd = 0xC9FBF0 // &HC9FB95
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,13 +1,7 @@
|
|||||||
using System;
|
namespace SM64Lib.Geolayout;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace SM64Lib.Geolayout
|
public class CameraFrustrum
|
||||||
{
|
{
|
||||||
public class CameraFrustrum
|
|
||||||
{
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This is essentially render distance of geometry.
|
/// This is essentially render distance of geometry.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -16,5 +10,4 @@ namespace SM64Lib.Geolayout
|
|||||||
/// Defines how close to the camera geometry will render.
|
/// Defines how close to the camera geometry will render.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public short CameraNear { get; set; } = 0x64;
|
public short CameraNear { get; set; } = 0x64;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
namespace SM64Lib.Geolayout
|
namespace SM64Lib.Geolayout;
|
||||||
|
|
||||||
|
public enum CameraPresets
|
||||||
{
|
{
|
||||||
public enum CameraPresets
|
|
||||||
{
|
|
||||||
OpenCamera = 0x1,
|
OpenCamera = 0x1,
|
||||||
TickTockClock,
|
TickTockClock,
|
||||||
SecretAquarium,
|
SecretAquarium,
|
||||||
@@ -19,5 +19,4 @@ namespace SM64Lib.Geolayout
|
|||||||
PlattfromLevels,
|
PlattfromLevels,
|
||||||
Unmoving2,
|
Unmoving2,
|
||||||
FreeRoamCamera
|
FreeRoamCamera
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
namespace SM64Lib.Geolayout
|
namespace SM64Lib.Geolayout;
|
||||||
|
|
||||||
|
public enum DefaultGeolayers
|
||||||
{
|
{
|
||||||
public enum DefaultGeolayers
|
|
||||||
{
|
|
||||||
SolidNoAntiAlias,
|
SolidNoAntiAlias,
|
||||||
Solid,
|
Solid,
|
||||||
SolidDecal,
|
SolidDecal,
|
||||||
@@ -11,5 +11,4 @@ namespace SM64Lib.Geolayout
|
|||||||
Translucent,
|
Translucent,
|
||||||
TranslucentDecal2,
|
TranslucentDecal2,
|
||||||
TranslucentDecal3
|
TranslucentDecal3
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
namespace SM64Lib.Geolayout
|
namespace SM64Lib.Geolayout;
|
||||||
|
|
||||||
|
public enum EnvironmentEffects
|
||||||
{
|
{
|
||||||
public enum EnvironmentEffects
|
|
||||||
{
|
|
||||||
NoEffect = 0x0,
|
NoEffect = 0x0,
|
||||||
Snow = 0x1,
|
Snow = 0x1,
|
||||||
Bllizard = 0x3,
|
Bllizard = 0x3,
|
||||||
@@ -10,5 +10,4 @@ namespace SM64Lib.Geolayout
|
|||||||
Lava = 0xC,
|
Lava = 0xC,
|
||||||
WaterRelated1 = 0xD,
|
WaterRelated1 = 0xD,
|
||||||
WaterRelated2 = 0x2
|
WaterRelated2 = 0x2
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,9 @@
|
|||||||
|
|
||||||
namespace SM64Lib.Geolayout
|
namespace SM64Lib.Geolayout;
|
||||||
|
|
||||||
|
public enum GeoAsmPointer : uint
|
||||||
{
|
{
|
||||||
public enum GeoAsmPointer : uint
|
|
||||||
{
|
|
||||||
EnvironmentEffect = 0x802761D0,
|
EnvironmentEffect = 0x802761D0,
|
||||||
Water = 0x802D104C,
|
Water = 0x802D104C,
|
||||||
Unknown = 0x802CD1E8
|
Unknown = 0x802CD1E8
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,16 +1,15 @@
|
|||||||
using System.Collections.Generic;
|
using global::SM64Lib.Geolayout.Script;
|
||||||
|
using global::SM64Lib.Geolayout.Script.Commands;
|
||||||
using global::System.IO;
|
using global::System.IO;
|
||||||
using Microsoft.VisualBasic;
|
using Microsoft.VisualBasic;
|
||||||
using Microsoft.VisualBasic.CompilerServices;
|
|
||||||
using global::SM64Lib.Geolayout.Script;
|
|
||||||
using global::SM64Lib.Geolayout.Script.Commands;
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace SM64Lib.Geolayout
|
namespace SM64Lib.Geolayout;
|
||||||
|
|
||||||
|
public class Geolayout
|
||||||
{
|
{
|
||||||
public class Geolayout
|
|
||||||
{
|
|
||||||
[JsonProperty]
|
[JsonProperty]
|
||||||
private int IndexForGeopointers = -1;
|
private int IndexForGeopointers = -1;
|
||||||
|
|
||||||
@@ -376,5 +375,4 @@ namespace SM64Lib.Geolayout
|
|||||||
Level,
|
Level,
|
||||||
Object
|
Object
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace SM64Lib.Geolayout
|
namespace SM64Lib.Geolayout;
|
||||||
|
|
||||||
|
public class Geopointer
|
||||||
{
|
{
|
||||||
public class Geopointer
|
|
||||||
{
|
|
||||||
public byte Layer { get; set; } = default;
|
public byte Layer { get; set; } = default;
|
||||||
public int SegPointer { get; set; } = 0;
|
public int SegPointer { get; set; } = 0;
|
||||||
public int Index { get; set; } = -1;
|
public int Index { get; set; } = -1;
|
||||||
@@ -38,5 +38,4 @@ namespace SM64Lib.Geolayout
|
|||||||
ModelOffset = mdloffset;
|
ModelOffset = mdloffset;
|
||||||
Index = index;
|
Index = index;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,16 +1,9 @@
|
|||||||
using System;
|
namespace SM64Lib.Geolayout;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace SM64Lib.Geolayout
|
public class ObjectShadow
|
||||||
{
|
{
|
||||||
public class ObjectShadow
|
|
||||||
{
|
|
||||||
public bool Enabled { get; set; } = false;
|
public bool Enabled { get; set; } = false;
|
||||||
public ObjectShadowType Type { get; set; } = ObjectShadowType.Circle_9Verts;
|
public ObjectShadowType Type { get; set; } = ObjectShadowType.Circle_9Verts;
|
||||||
public short Scale { get; set; }
|
public short Scale { get; set; }
|
||||||
public byte Solidity { get; set; } = 0xFF;
|
public byte Solidity { get; set; } = 0xFF;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,7 @@
|
|||||||
using System;
|
namespace SM64Lib.Geolayout;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace SM64Lib.Geolayout
|
public enum ObjectShadowType
|
||||||
{
|
{
|
||||||
public enum ObjectShadowType
|
|
||||||
{
|
|
||||||
Circle_9Verts = 0,
|
Circle_9Verts = 0,
|
||||||
Circle_4Verts = 1,
|
Circle_4Verts = 1,
|
||||||
Circle_4Verts_Flat_Unused = 2,
|
Circle_4Verts_Flat_Unused = 2,
|
||||||
@@ -20,5 +14,4 @@ namespace SM64Lib.Geolayout
|
|||||||
*/
|
*/
|
||||||
RectangleHardcodedOffset = 50,
|
RectangleHardcodedOffset = 50,
|
||||||
CirclePlayer = 99
|
CirclePlayer = 99
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,11 +2,11 @@
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SM64Lib.Json;
|
using SM64Lib.Json;
|
||||||
|
|
||||||
namespace SM64Lib.Geolayout.Script
|
namespace SM64Lib.Geolayout.Script;
|
||||||
|
|
||||||
|
[JsonConverter(typeof(GeolayoutscriptCommandJsonConverter))]
|
||||||
|
public class GeolayoutCommand : BaseCommand<GeolayoutCommandTypes>
|
||||||
{
|
{
|
||||||
[JsonConverter(typeof(GeolayoutscriptCommandJsonConverter))]
|
|
||||||
public class GeolayoutCommand : BaseCommand<GeolayoutCommandTypes>
|
|
||||||
{
|
|
||||||
public GeolayoutCommand(byte[] bytes) : base(bytes)
|
public GeolayoutCommand(byte[] bytes) : base(bytes)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -36,5 +36,4 @@ namespace SM64Lib.Geolayout.Script
|
|||||||
Position = 0;
|
Position = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
using global::SM64Lib.Script;
|
using global::SM64Lib.Script;
|
||||||
|
|
||||||
namespace SM64Lib.Geolayout.Script
|
namespace SM64Lib.Geolayout.Script;
|
||||||
|
|
||||||
|
public class GeolayoutCommandCollection : BaseCommandCollection<GeolayoutCommand, GeolayoutCommandTypes>
|
||||||
{
|
{
|
||||||
public class GeolayoutCommandCollection : BaseCommandCollection<GeolayoutCommand, GeolayoutCommandTypes>
|
|
||||||
{
|
|
||||||
public int IndexOfFirst(GeolayoutCommandTypes cmdType)
|
public int IndexOfFirst(GeolayoutCommandTypes cmdType)
|
||||||
{
|
{
|
||||||
for (int index = 0, loopTo = Count - 1; index <= loopTo; index++)
|
for (int index = 0, loopTo = Count - 1; index <= loopTo; index++)
|
||||||
@@ -14,5 +14,4 @@ namespace SM64Lib.Geolayout.Script
|
|||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
using global::System.Numerics;
|
using global::System.Numerics;
|
||||||
using Microsoft.VisualBasic.CompilerServices;
|
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace SM64Lib.Geolayout.Script
|
namespace SM64Lib.Geolayout.Script
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
namespace SM64Lib.Geolayout.Script
|
namespace SM64Lib.Geolayout.Script;
|
||||||
|
|
||||||
|
public enum GeolayoutCommandTypes
|
||||||
{
|
{
|
||||||
public enum GeolayoutCommandTypes
|
|
||||||
{
|
|
||||||
BranchAndStore = 0x0,
|
BranchAndStore = 0x0,
|
||||||
EndOfGeolayout = 0x1,
|
EndOfGeolayout = 0x1,
|
||||||
JumpToSegAddr = 0x2,
|
JumpToSegAddr = 0x2,
|
||||||
@@ -33,5 +33,4 @@ namespace SM64Lib.Geolayout.Script
|
|||||||
x1E = 0xE,
|
x1E = 0xE,
|
||||||
x1f = 0xF,
|
x1f = 0xF,
|
||||||
DrawingDistance = 0x20
|
DrawingDistance = 0x20
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,15 +1,14 @@
|
|||||||
using System.Collections.Generic;
|
using global::SM64Lib.Data;
|
||||||
using global::System.IO;
|
using global::System.IO;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Microsoft.VisualBasic.CompilerServices;
|
|
||||||
using global::SM64Lib.Data;
|
|
||||||
using SM64Lib.SegmentedBanking;
|
using SM64Lib.SegmentedBanking;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace SM64Lib.Geolayout.Script
|
namespace SM64Lib.Geolayout.Script;
|
||||||
|
|
||||||
|
public class Geolayoutscript : GeolayoutCommandCollection
|
||||||
{
|
{
|
||||||
public class Geolayoutscript : GeolayoutCommandCollection
|
|
||||||
{
|
|
||||||
public List<int> GeopointerOffsets = new List<int>();
|
public List<int> GeopointerOffsets = new List<int>();
|
||||||
|
|
||||||
public Geolayoutscript()
|
public Geolayoutscript()
|
||||||
@@ -235,5 +234,4 @@ namespace SM64Lib.Geolayout.Script
|
|||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
namespace SM64Lib.Geolayout
|
namespace SM64Lib.Geolayout;
|
||||||
|
|
||||||
|
public enum TerrainTypes
|
||||||
{
|
{
|
||||||
public enum TerrainTypes
|
|
||||||
{
|
|
||||||
NoramlA = 0x0,
|
NoramlA = 0x0,
|
||||||
NoramlB,
|
NoramlB,
|
||||||
SnowTerrain,
|
SnowTerrain,
|
||||||
@@ -10,5 +10,4 @@ namespace SM64Lib.Geolayout
|
|||||||
BigBoosHount,
|
BigBoosHount,
|
||||||
WaterLevels,
|
WaterLevels,
|
||||||
SlipperySlide
|
SlipperySlide
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,16 +1,13 @@
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Collections;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace SM64Lib.Json
|
namespace SM64Lib.Json;
|
||||||
|
|
||||||
|
public class ArrayReferencePreservngConverter : JsonConverter
|
||||||
{
|
{
|
||||||
public class ArrayReferencePreservngConverter : JsonConverter
|
|
||||||
{
|
|
||||||
const string refProperty = "$ref";
|
const string refProperty = "$ref";
|
||||||
const string idProperty = "$id";
|
const string idProperty = "$id";
|
||||||
const string valuesProperty = "$values";
|
const string valuesProperty = "$values";
|
||||||
@@ -83,5 +80,4 @@ namespace SM64Lib.Json
|
|||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,17 +1,11 @@
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SM64Lib.Behaviors.Script;
|
|
||||||
using SM64Lib.Geolayout.Script;
|
using SM64Lib.Geolayout.Script;
|
||||||
using SM64Lib.Model.Fast3D;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace SM64Lib.Json
|
namespace SM64Lib.Json;
|
||||||
|
|
||||||
|
internal class BaseCommandJsonConverter : JsonConverter
|
||||||
{
|
{
|
||||||
internal class BaseCommandJsonConverter : JsonConverter
|
|
||||||
{
|
|
||||||
public override bool CanConvert(Type objectType)
|
public override bool CanConvert(Type objectType)
|
||||||
{
|
{
|
||||||
return typeof(GeolayoutscriptCommandJsonConverter).IsAssignableFrom(objectType);
|
return typeof(GeolayoutscriptCommandJsonConverter).IsAssignableFrom(objectType);
|
||||||
@@ -57,5 +51,4 @@ namespace SM64Lib.Json
|
|||||||
public byte[] Buffer { get; set; }
|
public byte[] Buffer { get; set; }
|
||||||
public int BankAddress { get; set; }
|
public int BankAddress { get; set; }
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,11 @@
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SM64Lib.Behaviors.Script;
|
using SM64Lib.Behaviors.Script;
|
||||||
using SM64Lib.Model.Fast3D;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace SM64Lib.Json
|
namespace SM64Lib.Json;
|
||||||
|
|
||||||
|
internal class BehaviorscriptCommandJsonConverter : JsonConverter
|
||||||
{
|
{
|
||||||
internal class BehaviorscriptCommandJsonConverter : JsonConverter
|
|
||||||
{
|
|
||||||
public override bool CanConvert(Type objectType)
|
public override bool CanConvert(Type objectType)
|
||||||
{
|
{
|
||||||
return typeof(BehaviorscriptCommand).IsAssignableFrom(objectType);
|
return typeof(BehaviorscriptCommand).IsAssignableFrom(objectType);
|
||||||
@@ -56,5 +51,4 @@ namespace SM64Lib.Json
|
|||||||
public byte[] Buffer { get; set; }
|
public byte[] Buffer { get; set; }
|
||||||
public int BankAddress { get; set; }
|
public int BankAddress { get; set; }
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,17 +1,13 @@
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SM64Lib.Model.Fast3D;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Z.Collections.Extensions;
|
using Z.Collections.Extensions;
|
||||||
|
|
||||||
namespace SM64Lib.Json
|
namespace SM64Lib.Json;
|
||||||
|
|
||||||
|
internal class ComplexDictionarJsonConverter<TKey, TValue> : JsonConverter
|
||||||
{
|
{
|
||||||
internal class ComplexDictionarJsonConverter<TKey, TValue> : JsonConverter
|
|
||||||
{
|
|
||||||
public override bool CanConvert(Type objectType)
|
public override bool CanConvert(Type objectType)
|
||||||
{
|
{
|
||||||
return typeof(List<KeyValuePair<TKey, TValue>>).IsAssignableFrom(objectType);
|
return typeof(List<KeyValuePair<TKey, TValue>>).IsAssignableFrom(objectType);
|
||||||
@@ -31,5 +27,4 @@ namespace SM64Lib.Json
|
|||||||
if (value is Dictionary<TKey, TValue>)
|
if (value is Dictionary<TKey, TValue>)
|
||||||
serializer.Serialize(writer, ((Dictionary<TKey, TValue>)value).ToArray());
|
serializer.Serialize(writer, ((Dictionary<TKey, TValue>)value).ToArray());
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,16 +2,13 @@
|
|||||||
using SM64Lib.Model.Fast3D;
|
using SM64Lib.Model.Fast3D;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
|
||||||
using System.IO.Compression;
|
using System.IO.Compression;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace SM64Lib.Json
|
namespace SM64Lib.Json;
|
||||||
|
|
||||||
|
internal class Fast3DBufferJsonConverter : JsonConverter
|
||||||
{
|
{
|
||||||
internal class Fast3DBufferJsonConverter : JsonConverter
|
|
||||||
{
|
|
||||||
public override bool CanConvert(Type objectType)
|
public override bool CanConvert(Type objectType)
|
||||||
{
|
{
|
||||||
return typeof(Fast3DBuffer).IsAssignableFrom(objectType);
|
return typeof(Fast3DBuffer).IsAssignableFrom(objectType);
|
||||||
@@ -67,5 +64,4 @@ namespace SM64Lib.Json
|
|||||||
public List<Geolayout.Geopointer> DLPointers { get; set; }
|
public List<Geolayout.Geopointer> DLPointers { get; set; }
|
||||||
public bool IsDeflateStream { get; set; } = false;
|
public bool IsDeflateStream { get; set; } = false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,17 +1,11 @@
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SM64Lib.Behaviors.Script;
|
|
||||||
using SM64Lib.Geolayout.Script;
|
using SM64Lib.Geolayout.Script;
|
||||||
using SM64Lib.Model.Fast3D;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace SM64Lib.Json
|
namespace SM64Lib.Json;
|
||||||
|
|
||||||
|
internal class GeolayoutscriptCommandJsonConverter : JsonConverter
|
||||||
{
|
{
|
||||||
internal class GeolayoutscriptCommandJsonConverter : JsonConverter
|
|
||||||
{
|
|
||||||
public override bool CanConvert(Type objectType)
|
public override bool CanConvert(Type objectType)
|
||||||
{
|
{
|
||||||
return typeof(GeolayoutCommand).IsAssignableFrom(objectType);
|
return typeof(GeolayoutCommand).IsAssignableFrom(objectType);
|
||||||
@@ -57,5 +51,4 @@ namespace SM64Lib.Json
|
|||||||
public byte[] Buffer { get; set; }
|
public byte[] Buffer { get; set; }
|
||||||
public int BankAddress { get; set; }
|
public int BankAddress { get; set; }
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,9 @@
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace SM64Lib.Json
|
namespace SM64Lib.Json;
|
||||||
|
|
||||||
|
internal class JsonHelper
|
||||||
{
|
{
|
||||||
internal class JsonHelper
|
|
||||||
{
|
|
||||||
public static JsonSerializer CreateJsonSerializer(
|
public static JsonSerializer CreateJsonSerializer(
|
||||||
bool allowReferences = false,
|
bool allowReferences = false,
|
||||||
bool rememberTypeNames = false,
|
bool rememberTypeNames = false,
|
||||||
@@ -32,5 +27,4 @@ namespace SM64Lib.Json
|
|||||||
|
|
||||||
return serializer;
|
return serializer;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,18 +1,11 @@
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SM64Lib.Behaviors.Script;
|
|
||||||
using SM64Lib.Geolayout.Script;
|
|
||||||
using SM64Lib.Levels.Script;
|
using SM64Lib.Levels.Script;
|
||||||
using SM64Lib.Model.Fast3D;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace SM64Lib.Json
|
namespace SM64Lib.Json;
|
||||||
|
|
||||||
|
internal class LevelscriptCommandJsonConverter : JsonConverter
|
||||||
{
|
{
|
||||||
internal class LevelscriptCommandJsonConverter : JsonConverter
|
|
||||||
{
|
|
||||||
public override bool CanConvert(Type objectType)
|
public override bool CanConvert(Type objectType)
|
||||||
{
|
{
|
||||||
return typeof(LevelscriptCommand).IsAssignableFrom(objectType);
|
return typeof(LevelscriptCommand).IsAssignableFrom(objectType);
|
||||||
@@ -58,5 +51,4 @@ namespace SM64Lib.Json
|
|||||||
public byte[] Buffer { get; set; }
|
public byte[] Buffer { get; set; }
|
||||||
public int BankAddress { get; set; }
|
public int BankAddress { get; set; }
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,19 +1,11 @@
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SM64Lib.Behaviors.Script;
|
|
||||||
using SM64Lib.Geolayout.Script;
|
|
||||||
using SM64Lib.Levels.Script;
|
|
||||||
using SM64Lib.Model.Fast3D;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace SM64Lib.Json
|
namespace SM64Lib.Json;
|
||||||
|
|
||||||
|
internal class MemoryStreamJsonConverter : JsonConverter
|
||||||
{
|
{
|
||||||
internal class MemoryStreamJsonConverter : JsonConverter
|
|
||||||
{
|
|
||||||
public override bool CanConvert(Type objectType)
|
public override bool CanConvert(Type objectType)
|
||||||
{
|
{
|
||||||
return typeof(MemoryStream).IsAssignableFrom(objectType);
|
return typeof(MemoryStream).IsAssignableFrom(objectType);
|
||||||
@@ -33,5 +25,4 @@ namespace SM64Lib.Json
|
|||||||
var ms = (MemoryStream)value;
|
var ms = (MemoryStream)value;
|
||||||
serializer.Serialize(writer, ms.ToArray());
|
serializer.Serialize(writer, ms.ToArray());
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,15 @@
|
|||||||
using global::System.Drawing;
|
using global::System.Drawing;
|
||||||
|
|
||||||
namespace SM64Lib.Levels
|
namespace SM64Lib.Levels;
|
||||||
|
|
||||||
|
public class AreaBG
|
||||||
{
|
{
|
||||||
public class AreaBG
|
|
||||||
{
|
|
||||||
public AreaBGs Type { get; set; } = AreaBGs.Levelbackground;
|
public AreaBGs Type { get; set; } = AreaBGs.Levelbackground;
|
||||||
public Color Color { get; set; } = Color.Black;
|
public Color Color { get; set; } = Color.Black;
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum AreaBGs
|
public enum AreaBGs
|
||||||
{
|
{
|
||||||
Levelbackground,
|
Levelbackground,
|
||||||
Color
|
Color
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,13 +1,7 @@
|
|||||||
using System;
|
namespace SM64Lib.Levels;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace SM64Lib.Levels
|
public enum AreaReverbLevel : byte
|
||||||
{
|
{
|
||||||
public enum AreaReverbLevel : byte
|
|
||||||
{
|
|
||||||
None,
|
None,
|
||||||
Level01 = 0x8,
|
Level01 = 0x8,
|
||||||
Level02 = 0xC,
|
Level02 = 0xC,
|
||||||
@@ -19,5 +13,4 @@ namespace SM64Lib.Levels
|
|||||||
Level08 = 0x38,
|
Level08 = 0x38,
|
||||||
Level09 = 0x40,
|
Level09 = 0x40,
|
||||||
Level10 = 0x70
|
Level10 = 0x70
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
namespace SM64Lib.Levels
|
namespace SM64Lib.Levels;
|
||||||
|
|
||||||
|
public enum ObjectBank0x0C
|
||||||
{
|
{
|
||||||
public enum ObjectBank0x0C
|
|
||||||
{
|
|
||||||
Disabled,
|
Disabled,
|
||||||
HauntedObjects,
|
HauntedObjects,
|
||||||
SnowObjects,
|
SnowObjects,
|
||||||
@@ -15,10 +15,10 @@ namespace SM64Lib.Levels
|
|||||||
PeachYoshi,
|
PeachYoshi,
|
||||||
Switches,
|
Switches,
|
||||||
LavaObjects
|
LavaObjects
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum ObjectBank0x0D
|
public enum ObjectBank0x0D
|
||||||
{
|
{
|
||||||
Disabled,
|
Disabled,
|
||||||
AssortedEnemies4,
|
AssortedEnemies4,
|
||||||
Moneybags,
|
Moneybags,
|
||||||
@@ -26,10 +26,10 @@ namespace SM64Lib.Levels
|
|||||||
GroundEnemies,
|
GroundEnemies,
|
||||||
WaterObjects2,
|
WaterObjects2,
|
||||||
Bowser
|
Bowser
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum ObjectBank0x0E
|
public enum ObjectBank0x0E
|
||||||
{
|
{
|
||||||
Disabled,
|
Disabled,
|
||||||
HaundetHouse,
|
HaundetHouse,
|
||||||
CoolCoolMountain,
|
CoolCoolMountain,
|
||||||
@@ -56,17 +56,17 @@ namespace SM64Lib.Levels
|
|||||||
Bowser2Battle,
|
Bowser2Battle,
|
||||||
Bowser3Battle,
|
Bowser3Battle,
|
||||||
TallTallMountain
|
TallTallMountain
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum ObjectBanks
|
public enum ObjectBanks
|
||||||
{
|
{
|
||||||
Bank0x0C,
|
Bank0x0C,
|
||||||
Bank0x0D,
|
Bank0x0D,
|
||||||
Bank0x0E
|
Bank0x0E
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum Levels : byte
|
public enum Levels : byte
|
||||||
{
|
{
|
||||||
HaundetHouse = 0x4,
|
HaundetHouse = 0x4,
|
||||||
CoolCoolMountain,
|
CoolCoolMountain,
|
||||||
InsideCastle,
|
InsideCastle,
|
||||||
@@ -98,26 +98,25 @@ namespace SM64Lib.Levels
|
|||||||
Bowser2Battle = 0x21,
|
Bowser2Battle = 0x21,
|
||||||
Bowser3Battle,
|
Bowser3Battle,
|
||||||
TallTallMountain = 0x24
|
TallTallMountain = 0x24
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum ScrollingTextureAxis
|
public enum ScrollingTextureAxis
|
||||||
{
|
{
|
||||||
X,
|
X,
|
||||||
Y
|
Y
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum SpecialBoxType
|
public enum SpecialBoxType
|
||||||
{
|
{
|
||||||
Water,
|
Water,
|
||||||
ToxicHaze,
|
ToxicHaze,
|
||||||
Mist
|
Mist
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum WaterType
|
public enum WaterType
|
||||||
{
|
{
|
||||||
Default = 0x0,
|
Default = 0x0,
|
||||||
JRBWater = 0x20000,
|
JRBWater = 0x20000,
|
||||||
GreenWater = 0x30000,
|
GreenWater = 0x30000,
|
||||||
LavaWater = 0x40000
|
LavaWater = 0x40000
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,9 @@
|
|||||||
using global::SM64Lib.Data;
|
using global::SM64Lib.Data;
|
||||||
|
|
||||||
namespace SM64Lib.Levels
|
namespace SM64Lib.Levels;
|
||||||
|
|
||||||
|
public interface ILevelManager
|
||||||
{
|
{
|
||||||
public interface ILevelManager
|
|
||||||
{
|
|
||||||
void LoadLevel(Level lvl, RomManager rommgr, ushort LevelID, uint segAddress);
|
void LoadLevel(Level lvl, RomManager rommgr, ushort LevelID, uint segAddress);
|
||||||
LevelSaveResult SaveLevel(Level lvl, RomManager rommgr, BinaryData output, ref uint curOff);
|
LevelSaveResult SaveLevel(Level lvl, RomManager rommgr, BinaryData output, ref uint curOff);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,21 +1,19 @@
|
|||||||
using System.Collections.Generic;
|
using global::SM64Lib.Levels.Script;
|
||||||
using System.Data;
|
|
||||||
using global::System.IO;
|
|
||||||
using System.Linq;
|
|
||||||
using Microsoft.VisualBasic;
|
|
||||||
using Microsoft.VisualBasic.CompilerServices;
|
|
||||||
using global::SM64Lib.Levels.Script;
|
|
||||||
using global::SM64Lib.Levels.Script.Commands;
|
using global::SM64Lib.Levels.Script.Commands;
|
||||||
using global::SM64Lib.Objects.ObjectBanks.Data;
|
using global::SM64Lib.Objects.ObjectBanks.Data;
|
||||||
using global::SM64Lib.SegmentedBanking;
|
using global::SM64Lib.SegmentedBanking;
|
||||||
using SM64Lib.Objects.ModelBanks;
|
using Microsoft.VisualBasic;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using SM64Lib.Objects.ModelBanks;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Data;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
namespace SM64Lib.Levels
|
namespace SM64Lib.Levels;
|
||||||
|
|
||||||
|
public abstract class Level
|
||||||
{
|
{
|
||||||
public abstract class Level
|
|
||||||
{
|
|
||||||
|
|
||||||
// S h a r e d M e m b e r s
|
// S h a r e d M e m b e r s
|
||||||
|
|
||||||
@@ -325,5 +323,4 @@ namespace SM64Lib.Levels
|
|||||||
|
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,17 +1,15 @@
|
|||||||
using System.Collections.Generic;
|
using global::SM64Lib.Levels.Script;
|
||||||
using System.Linq;
|
|
||||||
using Microsoft.VisualBasic.CompilerServices;
|
|
||||||
using global::SM64Lib.Levels.Script;
|
|
||||||
using global::SM64Lib.Levels.Script.Commands;
|
using global::SM64Lib.Levels.Script.Commands;
|
||||||
using global::SM64Lib.Levels.ScrolTex;
|
using global::SM64Lib.Levels.ScrolTex;
|
||||||
using global::SM64Lib.Model;
|
using global::SM64Lib.Model;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace SM64Lib.Levels
|
namespace SM64Lib.Levels;
|
||||||
|
|
||||||
|
public abstract class LevelArea
|
||||||
{
|
{
|
||||||
public abstract class LevelArea
|
|
||||||
{
|
|
||||||
|
|
||||||
// S h a r e d M e m b e r s
|
// S h a r e d M e m b e r s
|
||||||
|
|
||||||
@@ -174,5 +172,4 @@ namespace SM64Lib.Levels
|
|||||||
protected LevelArea(JsonConstructorAttribute attr)
|
protected LevelArea(JsonConstructorAttribute attr)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,15 +1,14 @@
|
|||||||
using global::System.Drawing;
|
using global::SM64Lib.Model.Fast3D;
|
||||||
|
using global::System.Drawing;
|
||||||
using global::System.IO;
|
using global::System.IO;
|
||||||
using Microsoft.VisualBasic.CompilerServices;
|
|
||||||
using SM64Lib.Data.System;
|
|
||||||
using global::SM64Lib.Model.Fast3D;
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using SM64Lib.Data.System;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace SM64Lib.Levels
|
namespace SM64Lib.Levels;
|
||||||
|
|
||||||
|
public class LevelBG
|
||||||
{
|
{
|
||||||
public class LevelBG
|
|
||||||
{
|
|
||||||
private Bitmap _Image = null;
|
private Bitmap _Image = null;
|
||||||
|
|
||||||
// A u t o P r o p e r t i e s
|
// A u t o P r o p e r t i e s
|
||||||
@@ -232,5 +231,4 @@ namespace SM64Lib.Levels
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,17 +1,13 @@
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SM64Lib.Levels.Script;
|
using SM64Lib.Levels.Script;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.IO.Compression;
|
using System.IO.Compression;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace SM64Lib.Levels
|
namespace SM64Lib.Levels;
|
||||||
|
|
||||||
|
public class LevelExport
|
||||||
{
|
{
|
||||||
public class LevelExport
|
|
||||||
{
|
|
||||||
// P r o p e r t i e s
|
// P r o p e r t i e s
|
||||||
|
|
||||||
[JsonProperty]
|
[JsonProperty]
|
||||||
@@ -75,5 +71,4 @@ namespace SM64Lib.Levels
|
|||||||
|
|
||||||
return export;
|
return export;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,17 +1,10 @@
|
|||||||
using System;
|
namespace SM64Lib.Levels;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace SM64Lib.Levels
|
public enum LevelExportContentType
|
||||||
{
|
{
|
||||||
public enum LevelExportContentType
|
|
||||||
{
|
|
||||||
Unknown,
|
Unknown,
|
||||||
Level,
|
Level,
|
||||||
Area,
|
Area,
|
||||||
Objects,
|
Objects,
|
||||||
Warps
|
Warps
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,7 @@
|
|||||||
using System;
|
namespace SM64Lib.Levels;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace SM64Lib.Levels
|
public enum LevelExportFileFormat
|
||||||
{
|
{
|
||||||
public enum LevelExportFileFormat
|
|
||||||
{
|
|
||||||
JSON,
|
JSON,
|
||||||
PlainText
|
PlainText
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,13 +2,11 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace SM64Lib.Levels
|
namespace SM64Lib.Levels;
|
||||||
|
|
||||||
|
public static class LevelExportImporter
|
||||||
{
|
{
|
||||||
public static class LevelExportImporter
|
|
||||||
{
|
|
||||||
public static void ImportLevel(LevelExport export, RomManager destRomManager, KeyValuePair<Level, short>[] levelIDs)
|
public static void ImportLevel(LevelExport export, RomManager destRomManager, KeyValuePair<Level, short>[] levelIDs)
|
||||||
{
|
{
|
||||||
var levels = export.Content as Level[];
|
var levels = export.Content as Level[];
|
||||||
@@ -71,5 +69,4 @@ namespace SM64Lib.Levels
|
|||||||
else
|
else
|
||||||
throw new NotSupportedException();
|
throw new NotSupportedException();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
using System.Collections.Generic;
|
using global::Newtonsoft.Json.Linq;
|
||||||
using global::System.IO;
|
using global::System.IO;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using global::Newtonsoft.Json.Linq;
|
|
||||||
using static SM64Lib.TextValueConverter.TextValueConverter;
|
using static SM64Lib.TextValueConverter.TextValueConverter;
|
||||||
|
|
||||||
namespace SM64Lib.Levels
|
namespace SM64Lib.Levels;
|
||||||
|
|
||||||
|
public class LevelInfoDataTabelList : List<LevelInfoDataTabelList.Level>
|
||||||
{
|
{
|
||||||
public class LevelInfoDataTabelList : List<LevelInfoDataTabelList.Level>
|
|
||||||
{
|
|
||||||
public void ReadFromFile(string FileName)
|
public void ReadFromFile(string FileName)
|
||||||
{
|
{
|
||||||
var jobj = JObject.Parse(File.ReadAllText(FileName));
|
var jobj = JObject.Parse(File.ReadAllText(FileName));
|
||||||
@@ -139,5 +139,4 @@ namespace SM64Lib.Levels
|
|||||||
Bowsercourse,
|
Bowsercourse,
|
||||||
Bowserbattle
|
Bowserbattle
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -2,10 +2,10 @@
|
|||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
namespace SM64Lib.Levels
|
namespace SM64Lib.Levels;
|
||||||
|
|
||||||
|
public class LevelList : List<Level>
|
||||||
{
|
{
|
||||||
public class LevelList : List<Level>
|
|
||||||
{
|
|
||||||
public bool NeedToSave
|
public bool NeedToSave
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@@ -18,5 +18,4 @@ namespace SM64Lib.Levels
|
|||||||
{
|
{
|
||||||
get => this.Sum(n => n.Length);
|
get => this.Sum(n => n.Length);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,4 @@
|
|||||||
using System;
|
using global::SM64Lib.Data;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Data;
|
|
||||||
using global::System.IO;
|
|
||||||
using System.Linq;
|
|
||||||
using Microsoft.VisualBasic.CompilerServices;
|
|
||||||
using global::SM64Lib.Data;
|
|
||||||
using global::SM64Lib.Data.System;
|
using global::SM64Lib.Data.System;
|
||||||
using global::SM64Lib.Geolayout.Script;
|
using global::SM64Lib.Geolayout.Script;
|
||||||
using global::SM64Lib.Geolayout.Script.Commands;
|
using global::SM64Lib.Geolayout.Script.Commands;
|
||||||
@@ -13,11 +7,16 @@ using global::SM64Lib.Levels.Script.Commands;
|
|||||||
using global::SM64Lib.Levels.ScrolTex;
|
using global::SM64Lib.Levels.ScrolTex;
|
||||||
using global::SM64Lib.Model;
|
using global::SM64Lib.Model;
|
||||||
using global::SM64Lib.SegmentedBanking;
|
using global::SM64Lib.SegmentedBanking;
|
||||||
|
using global::System.IO;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Data;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
namespace SM64Lib.Levels
|
namespace SM64Lib.Levels;
|
||||||
|
|
||||||
|
public class LevelManager : ILevelManager
|
||||||
{
|
{
|
||||||
public class LevelManager : ILevelManager
|
|
||||||
{
|
|
||||||
public bool EnableLoadingAreaReverb { get; set; } = true;
|
public bool EnableLoadingAreaReverb { get; set; } = true;
|
||||||
public bool SortSpecialBoxesByHeight { get; set; } = true;
|
public bool SortSpecialBoxesByHeight { get; set; } = true;
|
||||||
|
|
||||||
@@ -649,7 +648,7 @@ namespace SM64Lib.Levels
|
|||||||
case LevelscriptCommandTypes.JumpToSegAddr:
|
case LevelscriptCommandTypes.JumpToSegAddr:
|
||||||
{
|
{
|
||||||
int bankID = clJumpToSegAddr.GetSegJumpAddr((LevelscriptCommand)c) >> 24;
|
int bankID = clJumpToSegAddr.GetSegJumpAddr((LevelscriptCommand)c) >> 24;
|
||||||
switch(bankID)
|
switch (bankID)
|
||||||
{
|
{
|
||||||
case 0x7:
|
case 0x7:
|
||||||
cmdGobJump = (LevelscriptCommand)c;
|
cmdGobJump = (LevelscriptCommand)c;
|
||||||
@@ -890,5 +889,4 @@ namespace SM64Lib.Levels
|
|||||||
|
|
||||||
return saveres;
|
return saveres;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,12 +1,11 @@
|
|||||||
using System;
|
using global::System.IO;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using global::System.IO;
|
|
||||||
using Microsoft.VisualBasic.CompilerServices;
|
|
||||||
|
|
||||||
namespace SM64Lib.Levels
|
namespace SM64Lib.Levels;
|
||||||
|
|
||||||
|
public class LevelNumberTable : List<byte>
|
||||||
{
|
{
|
||||||
public class LevelNumberTable : List<byte>
|
|
||||||
{
|
|
||||||
public void ReadFromROM(string Romfile, int Address = 0xE8D98)
|
public void ReadFromROM(string Romfile, int Address = 0xE8D98)
|
||||||
{
|
{
|
||||||
var fs = new FileStream(Romfile, FileMode.Open, FileAccess.Read);
|
var fs = new FileStream(Romfile, FileMode.Open, FileAccess.Read);
|
||||||
@@ -23,5 +22,4 @@ namespace SM64Lib.Levels
|
|||||||
Add(Convert.ToByte(fs.ReadByte()));
|
Add(Convert.ToByte(fs.ReadByte()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,8 @@
|
|||||||
using global::SM64Lib.SegmentedBanking;
|
using global::SM64Lib.SegmentedBanking;
|
||||||
|
|
||||||
namespace SM64Lib.Levels
|
namespace SM64Lib.Levels;
|
||||||
|
|
||||||
|
public class LevelSaveResult
|
||||||
{
|
{
|
||||||
public class LevelSaveResult
|
|
||||||
{
|
|
||||||
public SegmentedBank Bank0x19 { get; set; } = null;
|
public SegmentedBank Bank0x19 { get; set; } = null;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,9 @@
|
|||||||
|
|
||||||
namespace SM64Lib.Levels
|
namespace SM64Lib.Levels;
|
||||||
|
|
||||||
|
public enum LevelType
|
||||||
{
|
{
|
||||||
public enum LevelType
|
|
||||||
{
|
|
||||||
Original,
|
Original,
|
||||||
SM64RomManager,
|
SM64RomManager,
|
||||||
SM64Editor
|
SM64Editor
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user