git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
| // WASM BUG: https://github.com/mono/mono/issues/20258 | |
| // We need to find the types manually as per: https://gist.github.com/TheSpydog/e94c8c23c01615a5a3b2cc1a0857415c | |
| // Following types needed for loading SpriteFonts | |
| if (l_readerType == null) | |
| { | |
| if (readerTypeString == "Microsoft.Xna.Framework.Content.SpriteFontReader, FNA") | |
| { | |
| l_readerType = typeof(SpriteFontReader); | |
| } |
| // in Program.cs | |
| DllMap.Initialise(false); | |
| // in DllMap.cs (contains some XAGE-specific optimisations that can be removed for general use) | |
| using Clarvalon.XAGE.Global; | |
| using System; | |
| using System.Collections; | |
| using System.Collections.Generic; |
| // Use in script as follows to trigger screenshots being saved | |
| SetScreenshotMode("EVERYFRAME"); | |
| // ---------------------------------- | |
| // ScreenShot.ash | |
| import void SetScreenshotMode(String mode); | |
| // ---------------------------------- | |
| // ScreenShot.asc | |
| String previousValue; |
| // in Program.cs | |
| // Get FNA Assembly | |
| var fnaAssembly = Assembly.GetAssembly(typeof(Microsoft.Xna.Framework.Graphics.ColorWriteChannels)); | |
| // Register mechanism for determining native libraries based on NativeLibrary instead of DllImport | |
| DllMap.Register(fnaAssembly); | |
| // in DllMap.cs | |
| using System; |
| // in Program.cs | |
| // Get FNA Assembly | |
| var fnaAssembly = Assembly.GetAssembly(typeof(Microsoft.Xna.Framework.Graphics.ColorWriteChannels)); | |
| // Register mechanism for determining native libraries based on NativeLibrary instead of DllImport | |
| DllMap.Register(fnaAssembly); | |
| // in DllMap.cs | |
| using System; |
| // Not profiled and undoubtedly could be improved ... | |
| public SoundEffect LoadOgg(Stream stream) | |
| { | |
| // Turn .ogg stream into byte buffer | |
| byte[] rawData = new byte[stream.Length]; | |
| stream.Read(rawData, 0, (int)stream.Length); | |
| // Access byte buffer as a pointer | |
| GCHandle rawDataHandle = GCHandle.Alloc(rawData, GCHandleType.Pinned); | |
| IntPtr address = rawDataHandle.AddrOfPinnedObject(); |
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| namespace Clarvalon.XAGE.Global | |
| { | |
| /// <summary> | |
| /// Can operate as both an integer and a bool (as a workaround for lax AGS typing). | |
| /// </summary> |
| <Project Sdk="Microsoft.NET.Sdk"> | |
| <PropertyGroup> | |
| <TargetFramework>netstandard2.0</TargetFramework> | |
| <Platforms>AnyCPU;x86;x64</Platforms> | |
| </PropertyGroup> | |
| <PropertyGroup> | |
| <EnableDefaultItems>false</EnableDefaultItems> | |
| </PropertyGroup> |
git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream