This commit is contained in:
MarcEricMartel 2021-12-06 11:26:06 -05:00
parent ad9bcac7d2
commit 5860408378
2 changed files with 8 additions and 2 deletions

View File

@ -111,7 +111,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<IncludePath>$(ProjectDir)\external\irrKlang-1.6.0\include$(MSBuildProjectDirectory)$(MSBuildProjectDirectory);external\glew170\include;external\devil178\include;external\sfml23\include;$(IncludePath)</IncludePath>
<LibraryPath>external\glew170\lib;external\devil178\lib;external\sfml23\lib;$(LibraryPath);D:\Repos\SQCSim2021\SQCSim2021\external\irrKlang-1.6.0\lib\Win32-visualStudio</LibraryPath>
<LibraryPath>external\glew170\lib;external\devil178\lib;external\sfml23\lib;$(LibraryPath);external\irrKlang-1.6.0\lib\Win32-visualStudio</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>

View File

@ -101,13 +101,19 @@ void Chunk::Update(BlockInfo* blockinfo[BTYPE_LAST], World* world) {
void Chunk::AddBlockToMesh(VertexBuffer::VertexData* vd, int& count, BlockType bt,
int x, int y, int z, float u, float v, float s, World* world) {
static Perlin perlin = Perlin(2, 4.f, 1.f, 362436);
int cex, cey;
world->GetScope(cex, cey);
int cx = x + (m_posX - cex) * CHUNK_SIZE_X, cy = z + (m_posY - cey) * CHUNK_SIZE_Z;
if (perlin.Get(x, y, z) + .1f > 1.5f) {
}
if (y == CHUNK_SIZE_Y - 1 || GetBlock(x, y + 1, z) == BTYPE_AIR) { // y
vd[count++] = VertexBuffer::VertexData(x, y + 1.f, z, .8f, .8f, .8f, u, v);
vd[count++] = VertexBuffer::VertexData(x, y + 1.f, z + 1.f, .8f, .8f, .8f, u, v + s);