feat: Random Seed toggle & removed unused atlas.png
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 910 KiB |
12
Core/Game.cs
12
Core/Game.cs
@@ -15,6 +15,7 @@ public sealed class Game : GameWindow
|
||||
private const float MoveSpeed = 8f; // units per second
|
||||
private const float Sensitivity = 0.15f; // degrees per pixel
|
||||
private const int Seed = 1337;
|
||||
private const bool UseSeed = false;
|
||||
|
||||
private readonly BlockRegistry _registry = new();
|
||||
private Shader _shader = null!;
|
||||
@@ -40,10 +41,13 @@ public sealed class Game : GameWindow
|
||||
this._texture = new Texture("Assets/textures/VoxelShadeAtlas.png");
|
||||
|
||||
this._world = new World.World(this._registry);
|
||||
this._generator = new WorldGenerator(Game.Seed, this._registry);
|
||||
|
||||
for (int cx = -2; cx < 2; cx++)
|
||||
for (int cz = -2; cz < 2; cz++)
|
||||
int seed = Game.UseSeed ? Game.Seed : new Random().Next();
|
||||
|
||||
this._generator = new WorldGenerator(seed, this._registry);
|
||||
|
||||
for (int cx = -4; cx < 4; cx++)
|
||||
for (int cz = -4; cz < 4; cz++)
|
||||
for (int cy = 0; cy < WorldConstants.WorldHeightChunks; cy++)
|
||||
{
|
||||
Vector3i pos = new(cx, cy, cz);
|
||||
@@ -107,7 +111,7 @@ public sealed class Game : GameWindow
|
||||
this._shader.SetMatrix4("view", this._camera.GetViewMatrix());
|
||||
this._shader.SetMatrix4("projection", this._camera.GetProjectionMatrix());
|
||||
this._shader.SetInt("atlas", 0);
|
||||
this._texture.Use(TextureUnit.Texture0);
|
||||
this._texture.Use();
|
||||
|
||||
foreach ((Vector3i pos, ChunkRenderer renderer) in this._renderer)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user