forked from riperiperi/FreeSO
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- A full rework of the neighborhoods system, introducing mayors. - Bezier Path Routing - New font renderer - Data Service modification - .NET Core support - Gamma Correction - Many other changes
- Loading branch information
1 parent
d984274
commit b90ef43
Showing
599 changed files
with
25,547 additions
and
2,651 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule FSOMina.NET
updated
3 files
+6 −6 | Mina.NET/Mina.NET.csproj | |
+11 −0 | Mina.NET/app.config | |
+3 −2 | Mina.NET/packages.config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using Microsoft.Xna.Framework.Content; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace MSDFData | ||
{ | ||
public class FieldAtlas | ||
{ | ||
[ContentSerializer] private readonly int WidthBackend; | ||
[ContentSerializer] private readonly int HeightBackend; | ||
[ContentSerializer] private readonly int GlyphSizeBackend; | ||
[ContentSerializer] private readonly byte[] PNGDataBackend; | ||
[ContentSerializer] private readonly char[] CharMapBackend; | ||
|
||
public FieldAtlas() | ||
{ | ||
} | ||
|
||
public FieldAtlas(int width, int height, int glyphSize, byte[] pngData, char[] charMap) | ||
{ | ||
WidthBackend = width; | ||
HeightBackend = height; | ||
GlyphSizeBackend = glyphSize; | ||
PNGDataBackend = pngData; | ||
File.WriteAllBytes("test.png", pngData); | ||
CharMapBackend = charMap; | ||
} | ||
|
||
public int Width => WidthBackend; | ||
public int Height => HeightBackend; | ||
public int GlyphSize => GlyphSizeBackend; | ||
public byte[] PNGData => PNGDataBackend; | ||
public char[] CharMap => CharMapBackend; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using Microsoft.Xna.Framework.Content; | ||
|
||
namespace MSDFData | ||
{ | ||
public class FieldFont | ||
{ | ||
[ContentSerializer] private readonly Dictionary<char, FieldGlyph> Glyphs; | ||
[ContentSerializer] private readonly string NameBackend; | ||
[ContentSerializer] private readonly float PxRangeBackend; | ||
[ContentSerializer] private readonly List<KerningPair> KerningPairsBackend; | ||
[ContentSerializer] private readonly FieldAtlas AtlasBackend; | ||
|
||
public FieldFont() | ||
{ | ||
} | ||
|
||
public FieldFont(string name, IReadOnlyCollection<FieldGlyph> glyphs, IReadOnlyCollection<KerningPair> kerningPairs, float pxRange, FieldAtlas atlas) | ||
{ | ||
this.NameBackend = name; | ||
this.PxRangeBackend = pxRange; | ||
this.KerningPairsBackend = kerningPairs.ToList(); | ||
this.AtlasBackend = atlas; | ||
|
||
this.Glyphs = new Dictionary<char, FieldGlyph>(glyphs.Count); | ||
foreach (var glyph in glyphs) | ||
{ | ||
this.Glyphs.Add(glyph.Character, glyph); | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Name of the font | ||
/// </summary> | ||
public string Name => this.NameBackend; | ||
|
||
/// <summary> | ||
/// Distance field effect range in pixels | ||
/// </summary> | ||
public float PxRange => this.PxRangeBackend; | ||
|
||
/// <summary> | ||
/// Kerning pairs available in this font | ||
/// </summary> | ||
public IReadOnlyList<KerningPair> KerningPairs => this.KerningPairsBackend; | ||
|
||
/// <summary> | ||
/// Characters supported by this font | ||
/// </summary> | ||
[ContentSerializerIgnore] | ||
public IEnumerable<char> SupportedCharacters => this.Glyphs.Keys; | ||
|
||
private Dictionary<string, KerningPair> StringToPairBackend; | ||
[ContentSerializerIgnore] | ||
public Dictionary<string, KerningPair> StringToPair { | ||
get { | ||
if (StringToPairBackend == null) | ||
{ | ||
StringToPairBackend = KerningPairs.ToDictionary(x => new string(new char[] { x.Left, x.Right })); | ||
} | ||
return StringToPairBackend; | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Characters supported by this font | ||
/// </summary> | ||
public FieldAtlas Atlas => AtlasBackend; | ||
|
||
/// <summary> | ||
/// Returns the glyph for the given character, or returns null when the glyph is not supported by this font | ||
/// </summary> | ||
public FieldGlyph GetGlyph(char c) | ||
{ | ||
if (this.Glyphs.TryGetValue(c, out FieldGlyph glyph)) | ||
{ | ||
return glyph; | ||
} | ||
|
||
return null; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using Microsoft.Xna.Framework.Content; | ||
|
||
namespace MSDFData | ||
{ | ||
public class FieldGlyph | ||
{ | ||
[ContentSerializer] private readonly char CharacterBackend; | ||
[ContentSerializer] private readonly int AtlasIndexBackend; | ||
[ContentSerializer] private readonly Metrics MetricsBackend; | ||
|
||
public FieldGlyph() | ||
{ | ||
|
||
} | ||
|
||
public FieldGlyph(char character, int atlasIndex, Metrics metrics) | ||
{ | ||
this.CharacterBackend = character; | ||
this.AtlasIndexBackend = atlasIndex; | ||
this.MetricsBackend = metrics; | ||
} | ||
|
||
/// <summary> | ||
/// The character this glyph represents | ||
/// </summary> | ||
public char Character => this.CharacterBackend; | ||
/// <summary> | ||
/// Index of this character in the atlas. | ||
/// </summary> | ||
public int AtlasIndex => this.AtlasIndexBackend; | ||
/// <summary> | ||
/// Metrics for this character | ||
/// </summary> | ||
public Metrics Metrics => this.MetricsBackend; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
namespace MSDFData | ||
{ | ||
public class FontDescription | ||
{ | ||
public FontDescription(string path, params char[] characters) | ||
{ | ||
this.Path = path; | ||
this.Characters = characters.ToList().AsReadOnly(); | ||
} | ||
|
||
public string Path { get; } | ||
public IReadOnlyList<char> Characters { get; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using Microsoft.Xna.Framework.Content; | ||
|
||
namespace MSDFData | ||
{ | ||
public class KerningPair | ||
{ | ||
[ContentSerializer] private readonly char LeftBackend; | ||
[ContentSerializer] private readonly char RightBackend; | ||
[ContentSerializer] private readonly float AdvanceBackend; | ||
|
||
public KerningPair() | ||
{ | ||
|
||
} | ||
|
||
public KerningPair(char left, char right, float advance) | ||
{ | ||
this.LeftBackend = left; | ||
this.RightBackend = right; | ||
this.AdvanceBackend = advance; | ||
} | ||
|
||
public char Left => this.LeftBackend; | ||
public char Right => this.RightBackend; | ||
public float Advance => this.AdvanceBackend; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProjectGuid>{EABEA510-3E53-4F19-9F0B-75C5CA9DFA3B}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>MSDFData</RootNamespace> | ||
<AssemblyName>MSDFData</AssemblyName> | ||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> | ||
<FileAlignment>512</FileAlignment> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\Debug\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Core" /> | ||
<Reference Include="System.Xml.Linq" /> | ||
<Reference Include="System.Data.DataSetExtensions" /> | ||
<Reference Include="Microsoft.CSharp" /> | ||
<Reference Include="System.Data" /> | ||
<Reference Include="System.Net.Http" /> | ||
<Reference Include="System.Xml" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="FieldAtlas.cs" /> | ||
<Compile Include="FieldFont.cs" /> | ||
<Compile Include="FieldGlyph.cs" /> | ||
<Compile Include="FontDescription.cs" /> | ||
<Compile Include="KerningPair.cs" /> | ||
<Compile Include="Metrics.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="packages.config" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\FSOMonoGame\MonoGame.Framework\MonoGame.Framework.Windows.csproj"> | ||
<Project>{7de47032-a904-4c29-bd22-2d235e8d91ba}</Project> | ||
<Name>MonoGame.Framework.Windows</Name> | ||
</ProjectReference> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using Microsoft.Xna.Framework; | ||
using Microsoft.Xna.Framework.Content; | ||
|
||
namespace MSDFData | ||
{ | ||
public class Metrics | ||
{ | ||
[ContentSerializer] private readonly float AdvanceBackend; | ||
[ContentSerializer] private readonly float ScaleBackend; | ||
[ContentSerializer] private readonly Vector2 TranslationBackend; | ||
|
||
public Metrics() | ||
{ | ||
|
||
} | ||
|
||
public Metrics(float advance, float scale, Vector2 translation) | ||
{ | ||
this.AdvanceBackend = advance; | ||
this.ScaleBackend = scale; | ||
this.TranslationBackend = translation; | ||
} | ||
|
||
public float Advance => this.AdvanceBackend; | ||
public float Scale => this.ScaleBackend; | ||
public Vector2 Translation => this.TranslationBackend; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System.Reflection; | ||
using System.Runtime.CompilerServices; | ||
using System.Runtime.InteropServices; | ||
|
||
// General Information about an assembly is controlled through the following | ||
// set of attributes. Change these attribute values to modify the information | ||
// associated with an assembly. | ||
[assembly: AssemblyTitle("MSDFData")] | ||
[assembly: AssemblyDescription("")] | ||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyCompany("")] | ||
[assembly: AssemblyProduct("MSDFData")] | ||
[assembly: AssemblyCopyright("Copyright © 2018")] | ||
[assembly: AssemblyTrademark("")] | ||
[assembly: AssemblyCulture("")] | ||
|
||
// Setting ComVisible to false makes the types in this assembly not visible | ||
// to COM components. If you need to access a type in this assembly from | ||
// COM, set the ComVisible attribute to true on that type. | ||
[assembly: ComVisible(false)] | ||
|
||
// The following GUID is for the ID of the typelib if this project is exposed to COM | ||
[assembly: Guid("eabea510-3e53-4f19-9f0b-75c5ca9dfa3b")] | ||
|
||
// Version information for an assembly consists of the following four values: | ||
// | ||
// Major Version | ||
// Minor Version | ||
// Build Number | ||
// Revision | ||
// | ||
// You can specify all the values or you can default the Build and Revision Numbers | ||
// by using the '*' as shown below: | ||
// [assembly: AssemblyVersion("1.0.*")] | ||
[assembly: AssemblyVersion("1.0.0.0")] | ||
[assembly: AssemblyFileVersion("1.0.0.0")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="MonoGame.Framework.Content.Pipeline.Portable" version="3.7.0.1708" targetFramework="net45" /> | ||
<package id="MonoGame.Framework.Portable" version="3.7.0.1708" targetFramework="net45" /> | ||
</packages> |
Oops, something went wrong.