fixed benchmark placement
This commit is contained in:
@@ -69,7 +69,7 @@ public class Level {
|
||||
GD.Print("benchmark");
|
||||
for (int x = 0; x < chunksPerX; x++) {
|
||||
for (int y = 0; y < chunksPerY; y++) {
|
||||
WritePixel<Dirt>(x * chunkResX/2, y * chunkResY/2, 100);
|
||||
WritePixel<Dirt>((x * chunkResX) + chunkResX/2, (y * chunkResY) + chunkResY/2, 100);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -148,13 +148,18 @@ public class Level {
|
||||
}
|
||||
|
||||
public Image DrawLevel() {
|
||||
// chunk
|
||||
for (int cx = 0; cx < chunksPerX; cx++) {
|
||||
for (int cy = 0; cy < chunksPerY; cy++) {
|
||||
|
||||
// pixel in chunk
|
||||
for (int x = 0; x < chunkResX; x++) {
|
||||
for (int y = 0; y < chunkResY; y++) {
|
||||
// TODO: multithreading here! use Chunk.DrawLevel() and stitch images together
|
||||
image.SetPixel(cx*chunkResX + x, cy*chunkResY + y, chunks[cx,cy].Elements[x, y].Color);
|
||||
|
||||
Element e = chunks[cx, cy].Elements[x, y];
|
||||
if (e.WasMoved())
|
||||
image.SetPixel(cx*chunkResX + x, cy*chunkResY + y, e.Color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user