-
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/filetovoxcore'
- Loading branch information
Showing
77 changed files
with
2,947 additions
and
2,793 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
SchematicToVox/bin/ | ||
SchematicToVox/obj/ | ||
.vs/ | ||
|
||
Build/ | ||
|
||
SchematicToVoxCore/bin/ | ||
SchematicToVoxCore/obj/ | ||
SchematicToVoxCore/Properties/launchSettings.json | ||
FileToVoxCommon/bin/ | ||
FileToVoxCommon/obj/ | ||
OldBuild/ | ||
SchematicToVox/bin/ | ||
SchematicToVox/obj/ | ||
.vs/ | ||
|
||
Build/ | ||
|
||
SchematicToVoxCore/bin/ | ||
SchematicToVoxCore/obj/ | ||
SchematicToVoxCore/Properties/launchSettings.json | ||
FileToVoxCommon/bin/ | ||
FileToVoxCommon/obj/ | ||
OldBuild/ | ||
FileToVoxCore/obj/ | ||
FileToVoxCore/bin/ |
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
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,25 @@ | ||
using System.Drawing; | ||
|
||
namespace FileToVoxCore.Extensions | ||
{ | ||
public static class FctExtensions | ||
{ | ||
public static Color UIntToColor(this uint color) | ||
{ | ||
byte a = (byte)(color >> 24); | ||
byte r = (byte)(color >> 16); | ||
byte g = (byte)(color >> 8); | ||
byte b = (byte)(color >> 0); | ||
return Color.FromArgb(a, r, g, b); | ||
} | ||
|
||
public static uint ColorToUInt(this Color color) | ||
{ | ||
return (uint)((color.A << 24) | (color.R << 16) | | ||
(color.G << 8) | (color.B << 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,25 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Library</OutputType> | ||
<TargetFramework>net5.0</TargetFramework> | ||
<AssemblyName>FileToVoxCore</AssemblyName> | ||
<RootNamespace>FileToVoxCore</RootNamespace> | ||
<Version>1.0.2</Version> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="System.Drawing.Common" Version="5.0.2" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\FileToVoxCommon\FileToVoxCommon.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Update="Schematics\config.txt"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</None> | ||
</ItemGroup> | ||
|
||
</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,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<_LastSelectedProfileId>E:\Documents\FileToVox\FileToVoxCore\Properties\PublishProfiles\FolderProfile.pubxml</_LastSelectedProfileId> | ||
</PropertyGroup> | ||
</Project> |
14 changes: 14 additions & 0 deletions
14
FileToVoxCore/Properties/PublishProfiles/FolderProfile.pubxml
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,14 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
https://go.microsoft.com/fwlink/?LinkID=208121. | ||
--> | ||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<Configuration>Release</Configuration> | ||
<Platform>Any CPU</Platform> | ||
<PublishDir>bin\Release\net5.0\publish\</PublishDir> | ||
<PublishProtocol>FileSystem</PublishProtocol> | ||
<TargetFramework>net5.0</TargetFramework> | ||
<SelfContained>false</SelfContained> | ||
</PropertyGroup> | ||
</Project> |
6 changes: 6 additions & 0 deletions
6
FileToVoxCore/Properties/PublishProfiles/FolderProfile.pubxml.user
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,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
https://go.microsoft.com/fwlink/?LinkID=208121. | ||
--> | ||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
</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
22 changes: 11 additions & 11 deletions
22
...maticToVoxCore/Schematics/RawSchematic.cs → FileToVoxCore/Schematics/RawSchematic.cs
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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
namespace FileToVox.Schematics | ||
{ | ||
public class RawSchematic | ||
{ | ||
public short Width; | ||
public short Heigth; | ||
public short Length; | ||
public byte[] Blocks; | ||
public byte[] Data; | ||
} | ||
} | ||
namespace FileToVoxCore.Schematics | ||
{ | ||
public class RawSchematic | ||
{ | ||
public short Width; | ||
public short Heigth; | ||
public short Length; | ||
public byte[] Blocks; | ||
public byte[] Data; | ||
} | ||
} |
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
5 changes: 1 addition & 4 deletions
5
...aticToVoxCore/Schematics/Tools/Vector3.cs → FileToVoxCore/Schematics/Tools/Vector3.cs
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
117 changes: 58 additions & 59 deletions
117
...cToVoxCore/Schematics/Tools/Vector3Int.cs → FileToVoxCore/Schematics/Tools/Vector3Int.cs
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 |
---|---|---|
@@ -1,59 +1,58 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace FileToVox.Schematics.Tools | ||
{ | ||
public struct Vector3Int : IEquatable<Vector3Int> | ||
{ | ||
public int X; | ||
public int Y; | ||
public int Z; | ||
|
||
// Creates a new vector with given x, y, z components. | ||
public Vector3Int(int x, int y, int z) { this.X = x; this.Y = y; this.Z = z; } | ||
// Creates a new vector with given x, y components and sets /z/ to zero. | ||
public Vector3Int(int x, int y) { this.X = x; this.Y = y; Z = 0; } | ||
|
||
public static Vector3Int zero { get; } = new Vector3Int(0, 0, 0); | ||
public int magnitude => (int)Math.Sqrt(X * X + Y * Y + Z * Z); | ||
public static int SqrMagnitude(Vector3Int vector) { return vector.X * vector.X + vector.Y * vector.Y + vector.Z * vector.Z; } | ||
|
||
// Subtracts one vector from another. | ||
public static Vector3Int operator -(Vector3Int a, Vector3Int b) { return new Vector3Int(a.X - b.X, a.Y - b.Y, a.Z - b.Z); } | ||
// Adds two vectors. | ||
public static Vector3Int operator +(Vector3Int a, Vector3Int b) { return new Vector3Int(a.X + b.X, a.Y + b.Y, a.Z + b.Z); } | ||
// Subtracts one vector from another. | ||
// Negates a vector. | ||
public static Vector3Int operator -(Vector3Int a) { return new Vector3Int(-a.X, -a.X, -a.Z); } | ||
// Multiplies a vector by a number. | ||
public static Vector3Int operator *(Vector3Int a, int d) { return new Vector3Int(a.X * d, a.Y * d, a.Z * d); } | ||
// Multiplies a vector by a number. | ||
public static Vector3Int operator *(int d, Vector3Int a) { return new Vector3Int(a.X * d, a.Y * d, a.Z * d); } | ||
// Divides a vector by a number. | ||
public static Vector3Int operator /(Vector3Int a, int d) { return new Vector3Int(a.X / d, a.Y / d, a.Z / d); } | ||
|
||
public override string ToString() | ||
{ | ||
return string.Format("({0:F1}, {1:F1}, {2:F1})", X, Y, Z); | ||
} | ||
|
||
public bool Equals(Vector3Int other) | ||
{ | ||
return X.Equals(other.X) && Y.Equals(other.Y) && Z.Equals(other.Z); | ||
} | ||
|
||
public override bool Equals(object other) | ||
{ | ||
if (!(other is Vector3Int)) return false; | ||
|
||
return Equals((Vector3Int)other); | ||
} | ||
|
||
public override int GetHashCode() | ||
{ | ||
return X.GetHashCode() ^ (Y.GetHashCode() << 2) ^ (Z.GetHashCode() >> 2); | ||
} | ||
|
||
} | ||
|
||
} | ||
using System; | ||
|
||
namespace FileToVoxCore.Schematics.Tools | ||
{ | ||
public struct Vector3Int : IEquatable<Vector3Int> | ||
{ | ||
public int X; | ||
public int Y; | ||
public int Z; | ||
|
||
// Creates a new vector with given x, y, z components. | ||
public Vector3Int(int x, int y, int z) { this.X = x; this.Y = y; this.Z = z; } | ||
// Creates a new vector with given x, y components and sets /z/ to zero. | ||
public Vector3Int(int x, int y) { this.X = x; this.Y = y; Z = 0; } | ||
|
||
public static Vector3Int zero { get; } = new Vector3Int(0, 0, 0); | ||
public int magnitude => (int)Math.Sqrt(X * X + Y * Y + Z * Z); | ||
public static int SqrMagnitude(Vector3Int vector) { return vector.X * vector.X + vector.Y * vector.Y + vector.Z * vector.Z; } | ||
|
||
// Subtracts one vector from another. | ||
public static Vector3Int operator -(Vector3Int a, Vector3Int b) { return new Vector3Int(a.X - b.X, a.Y - b.Y, a.Z - b.Z); } | ||
// Adds two vectors. | ||
public static Vector3Int operator +(Vector3Int a, Vector3Int b) { return new Vector3Int(a.X + b.X, a.Y + b.Y, a.Z + b.Z); } | ||
// Subtracts one vector from another. | ||
// Negates a vector. | ||
public static Vector3Int operator -(Vector3Int a) { return new Vector3Int(-a.X, -a.X, -a.Z); } | ||
// Multiplies a vector by a number. | ||
public static Vector3Int operator *(Vector3Int a, int d) { return new Vector3Int(a.X * d, a.Y * d, a.Z * d); } | ||
// Multiplies a vector by a number. | ||
public static Vector3Int operator *(int d, Vector3Int a) { return new Vector3Int(a.X * d, a.Y * d, a.Z * d); } | ||
// Divides a vector by a number. | ||
public static Vector3Int operator /(Vector3Int a, int d) { return new Vector3Int(a.X / d, a.Y / d, a.Z / d); } | ||
|
||
public override string ToString() | ||
{ | ||
return string.Format("({0:F1}, {1:F1}, {2:F1})", X, Y, Z); | ||
} | ||
|
||
public bool Equals(Vector3Int other) | ||
{ | ||
return X.Equals(other.X) && Y.Equals(other.Y) && Z.Equals(other.Z); | ||
} | ||
|
||
public override bool Equals(object other) | ||
{ | ||
if (!(other is Vector3Int)) return false; | ||
|
||
return Equals((Vector3Int)other); | ||
} | ||
|
||
public override int GetHashCode() | ||
{ | ||
return X.GetHashCode() ^ (Y.GetHashCode() << 2) ^ (Z.GetHashCode() >> 2); | ||
} | ||
|
||
} | ||
|
||
} |
Oops, something went wrong.