Skip to content

Commit 3349264

Browse files
committed
2 parents 5ffe97f + ae1950b commit 3349264

File tree

8 files changed

+23
-23
lines changed

8 files changed

+23
-23
lines changed

.github/workflows/publish.yml

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
name: Publish
22

3-
# on: [push, pull_request]
4-
5-
on:
6-
push:
7-
branches: [ master ]
8-
pull_request:
9-
branches: [ master ]
3+
on: [push, pull_request]
104

115
env:
126
DOTNET_VERSION: "3.1.x" # The .NET SDK version to use

MapLoader.NUnitTests/OtherTests.cs

+13-8
Original file line numberDiff line numberDiff line change
@@ -166,12 +166,11 @@ public void BenchmarkRender()
166166
{
167167
var dut = new Maploader.World.World();
168168
dut.Open(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "benchmark", "world", "db"));
169-
int chunkRadius = 1;
170-
int centerOffsetX = 1; //65;
171-
int centerOffsetZ = 1; //65;
169+
int XMin = -1, XMax = 3;
170+
int ZMin = -1, ZMax = 4;
172171
string filename = "benchmark.png";
173172

174-
RenderMap(chunkRadius, dut, centerOffsetX, centerOffsetZ, filename);
173+
RenderMap(dut, filename, XMin, XMax, ZMin, ZMax);
175174
}
176175

177176
private static void RenderMap(int chunkRadius, Maploader.World.World dut, int centerOffsetX,
@@ -180,6 +179,12 @@ private static void RenderMap(int chunkRadius, Maploader.World.World dut, int ce
180179
int XMin = centerOffsetX - chunkRadius, XMax = centerOffsetX + chunkRadius;
181180
int ZMin = centerOffsetZ - chunkRadius, ZMax = centerOffsetZ + chunkRadius;
182181

182+
RenderMap(dut, filename, XMin, XMax, ZMin, ZMax);
183+
}
184+
185+
private static void RenderMap(Maploader.World.World dut, string filename,
186+
int XMin, int XMax, int ZMin, int ZMax)
187+
{
183188
var json = File.ReadAllText(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"textures",
184189
"terrain_texture.json"));
185190
var ts = new TerrainTextureJsonParser(json, "");
@@ -189,7 +194,7 @@ private static void RenderMap(int chunkRadius, Maploader.World.World dut, int ce
189194
Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "textures"), g);
190195
finder.Debug = false;
191196

192-
var b = g.CreateEmptyImage(16 * 16 * (2 * chunkRadius + 1), 16 * 16 * (2 * chunkRadius + 1));
197+
var b = g.CreateEmptyImage(16 * 16 * (XMax - XMin + 1), 16 * 16 * (ZMax - ZMin + 1));
193198

194199
var render = new ChunkRenderer<Bitmap>(finder, g, new RenderSettings() { YMax = 40 });
195200

@@ -205,9 +210,9 @@ private static void RenderMap(int chunkRadius, Maploader.World.World dut, int ce
205210
var c = dut.GetChunk(chunkData.X, chunkData.Z, chunkData);
206211
if (c != null)
207212
{
208-
int dx = chunkData.X - centerOffsetX;
209-
int dz = chunkData.Z - centerOffsetZ;
210-
render.RenderChunk(b, c, (chunkRadius + dx) * 256, (chunkRadius + dz) * 256);
213+
int dx = chunkData.X - XMin;
214+
int dz = chunkData.Z - ZMin;
215+
render.RenderChunk(b, c, dx * 256, dz * 256);
211216
}
212217
}
213218

MapLoader.NUnitTests/textures/terrain_texture.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1665,7 +1665,7 @@
16651665
"textures" : "textures/blocks/mangrove_roots_top"
16661666
},
16671667
"mangrove_sign" : {
1668-
"textures" : "textures/entity/mangrove_sign"
1668+
"textures" : "textures/blocks/mangrove_planks"
16691669
},
16701670
"mangrove_trapdoor" : {
16711671
"textures" : "textures/blocks/mangrove_trapdoor"

PapyrusCs/PapyrusCs.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
<TargetFramework>netcoreapp3.1</TargetFramework>
66
<Authors>Markus Jungnickel</Authors>
77
<Company />
8-
<AssemblyVersion>0.5.0.0</AssemblyVersion>
8+
<AssemblyVersion>0.5.2.0</AssemblyVersion>
99
<FileVersion>0.5.0.0</FileVersion>
10-
<Version>0.5.0</Version>
10+
<Version>0.5.2</Version>
1111
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
1212
<PackageProjectUrl>https://github.com/mjungnickel18</PackageProjectUrl>
1313
</PropertyGroup>

PapyrusCs/Properties/launchSettings.json

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"profiles": {
33
"PapyrusCs": {
44
"commandName": "Project",
5-
"commandLineArgs": "-w \"C:\\papyruscs\\world_bedrock_04082019\" -o \"C:\\papyrus\\mergetest3\" chunksperdimension 2 -f png --dim 0 --htmlfile index.html --threads 1 --maxqueue 1",
65
"workingDirectory": "c:\\temp"
76
}
87
}

PapyrusCs/map.thtml

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5+
46
<link
57
rel="stylesheet"
68
href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
@@ -45,9 +47,10 @@
4547
}
4648
</style>
4749
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
50+
<title>Map</title>
4851
</head>
4952

50-
<body margin="0" padding="0">
53+
<body>
5154
<script src="https://openlayers.org/en/v6.1.1/build/ol.js"></script>
5255
<script
5356
src="https://code.jquery.com/jquery-3.3.1.slim.min.js"

PapyrusCs/textures/terrain_texture.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1665,7 +1665,7 @@
16651665
"textures" : "textures/blocks/mangrove_roots_top"
16661666
},
16671667
"mangrove_sign" : {
1668-
"textures" : "textures/entity/mangrove_sign"
1668+
"textures" : "textures/blocks/mangrove_planks"
16691669
},
16701670
"mangrove_trapdoor" : {
16711671
"textures" : "textures/blocks/mangrove_trapdoor"

readme.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
Chat: [![Discord](https://img.shields.io/discord/569841820092203011.svg?logo=discord&logoColor=white)](https://discord.gg/J2sBaXa) <br>
2-
Windows: [![Build status](https://ci.appveyor.com/api/projects/status/tfspbbi72bx73qg8?svg=true)](https://ci.appveyor.com/project/mjungnickel18/papyruscs) <br>
3-
Linux: [![Build status](https://ci.appveyor.com/api/projects/status/xo9ew31l49hayjcm?svg=true)](https://ci.appveyor.com/project/mjungnickel18/papyruscs-ytqjm) <br>
2+
Build: [![GitHub Workflow Status](https://img.shields.io/github/workflow/status/hrmorley34/papyruscs/publish?logo=github)](https://github.com/hrmorley34/papyruscs/actions/workflows/publish.yml?query=branch%3Amain) <br>
43

54
# Papyrus
65

0 commit comments

Comments
 (0)