Skip to content

Commit

Permalink
Merge pull request #73 from jetelain/fix-stripes
Browse files Browse the repository at this point in the history
Fix stripes issues + Quick fix on ocean elevation
  • Loading branch information
jetelain authored Aug 5, 2023
2 parents e4d8a1c + a5a8ef9 commit d2d5c17
Show file tree
Hide file tree
Showing 7 changed files with 131,119 additions and 13 deletions.
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

0 comments on commit d2d5c17

Please sign in to comment.