Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix stripes issues + Quick fix on ocean elevation #73

Merged
merged 1 commit into from
Aug 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions GameRealisticMap.Arma3.Test/Arma3MapConfigMock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,24 @@ internal class Arma3MapConfigMock : IArma3MapConfig, IElevationGridConfig
TileSize = 1024
};

internal static Arma3MapConfigMock Island512 = new Arma3MapConfigMock()
{
CellSize = new Vector2(4.5f),
Resolution = 1,
Size = 2048,
PboPrefix = "prefix",
TileSize = 512
};

internal static Arma3MapConfigMock Island1024 = new Arma3MapConfigMock()
{
CellSize = new Vector2(4.5f),
Resolution = 1,
Size = 2048,
PboPrefix = "prefix",
TileSize = 1024
};

public float SizeInMeters => Size * CellSize.X;

public int TileSize { get; set; }
Expand Down
18 changes: 18 additions & 0 deletions GameRealisticMap.Arma3.Test/GameEngine/WrpBuilderTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,24 @@ public void Materials_Belfort()
Assert.Equal(wrp.MaterialIndex.Select(x => wrp.MatNames[x]).ToList(), Read("layers2.txt").ToList());
}

[Fact]
public void Materials_Island512()
{
var builder = new WrpCompiler(new NoProgressSystem(), new GameFileSystemMock());
var wrp = WrpCompiler.InitWrp(Arma3MapConfigMock.Island512, WrpCompiler.LandRange(Arma3MapConfigMock.Island512.SizeInMeters));
builder.SetMaterialAndIndexes(new ImageryTiler(Arma3MapConfigMock.Island512), wrp, "prefix");
Assert.Equal(wrp.MaterialIndex.Select(x => wrp.MatNames[x]).ToList(), Read("layers3.txt").ToList());
}

[Fact]
public void Materials_Island1024()
{
var builder = new WrpCompiler(new NoProgressSystem(), new GameFileSystemMock());
var wrp = WrpCompiler.InitWrp(Arma3MapConfigMock.Island1024, WrpCompiler.LandRange(Arma3MapConfigMock.Island1024.SizeInMeters));
builder.SetMaterialAndIndexes(new ImageryTiler(Arma3MapConfigMock.Island1024), wrp, "prefix");
Assert.Equal(wrp.MaterialIndex.Select(x => wrp.MatNames[x]).ToList(), Read("layers4.txt").ToList());
}

private IEnumerable<string> Read(string v)
{
using (var reader = new StreamReader(typeof(WrpCompilerTest).Assembly.GetManifestResourceStream("GameRealisticMap.Arma3.Test.GameEngine." + v)!))
Expand Down
Loading