diff --git a/platforms/windows/main.cpp b/platforms/windows/main.cpp index ea86732..03fb5b1 100644 --- a/platforms/windows/main.cpp +++ b/platforms/windows/main.cpp @@ -180,16 +180,6 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam) int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) { - Random random; - random.setSeed(123456); - - for (int i = 0; i < 256; i++) - { - LogMsg("%d: %d", i, random.nextInt(256 - i) + i); - } - - - SetInstance(hInstance); g_AppPlatform.initConsts(); diff --git a/source/Renderer/GameRenderer.cpp b/source/Renderer/GameRenderer.cpp index ea7bd47..58a3a95 100644 --- a/source/Renderer/GameRenderer.cpp +++ b/source/Renderer/GameRenderer.cpp @@ -434,6 +434,7 @@ void GameRenderer::renderLevel(float f) glEnable(GL_BLEND); glDisable(GL_CULL_FACE); + // glDepthMask(false); -- added in 0.1.1j. Introduces more issues than fixes // render the alpha layer m_pMinecraft->m_pTextures->loadAndBindTexture(C_TERRAIN_NAME); diff --git a/source/World/Renderer/LevelRenderer.cpp b/source/World/Renderer/LevelRenderer.cpp index 0a641df..0e3cb59 100644 --- a/source/World/Renderer/LevelRenderer.cpp +++ b/source/World/Renderer/LevelRenderer.cpp @@ -20,34 +20,30 @@ LevelRenderer::LevelRenderer(Minecraft* pMC, Textures* pTexs) printf("numBuffers: %d\n", m_nBuffers); xglGenBuffers(1, &field_D8); + generateSky(); // inlined in the 0.1.0 demo +} + +void LevelRenderer::generateSky() +{ Tesselator& t = Tesselator::instance; t.begin(); + field_DC = 0; - for (int v7 = -128; ; ) + float m = 16.0f; + int n = 4; + int p = 128; + + for (int i = n * -p; i <= n * p; i += p) { - int v8 = v7 + 128; - int v9 = -512; - float v10 = -512.0f; - float v11 = float(v7); - float v12 = float(v7 + 128); - - for (; v9 != 640; ) + for (int j = n * -p; j <= n * p; j += p) { - float v13 = v10; - v9 += 128; + t.vertex(float(i + 0.0f), 16.0f, float(j + 0.0f)); + t.vertex(float(i + p) , 16.0f, float(j + 0.0f)); + t.vertex(float(i + p) , 16.0f, float(j + p) ); + t.vertex(float(i + 0.0f), 16.0f, float(j + p) ); - t.vertex(v11, 16.0f, v13); - t.vertex(v12, 16.0f, v13); - v10 = float(v9); - t.vertex(v12, 16.0f, float(v9)); - t.vertex(v11, 16.0f, float(v9)); field_DC += 4; } - - if (v8 == 640) - break; - - v7 = v8; } t.end(field_D8); diff --git a/source/World/Renderer/LevelRenderer.hpp b/source/World/Renderer/LevelRenderer.hpp index 21d025b..5544e21 100644 --- a/source/World/Renderer/LevelRenderer.hpp +++ b/source/World/Renderer/LevelRenderer.hpp @@ -81,6 +81,7 @@ public: void addParticle(const std::string&, float, float, float, float, float, float) override; void playSound(const std::string& a, float b, float c, float d, float e, float f) override; void skyColorChanged() override; + void generateSky(); void cull(Culler*, float); void deleteChunks(); void resortChunks(int x, int y, int z); diff --git a/source/World/Tile/IceTile.cpp b/source/World/Tile/IceTile.cpp index b40bbba..2188439 100644 --- a/source/World/Tile/IceTile.cpp +++ b/source/World/Tile/IceTile.cpp @@ -16,7 +16,7 @@ IceTile::IceTile(int a, int b, Material* c) : HalfTransparentTile(a, b, c) int IceTile::getRenderLayer() { - return 1; + return LAYER_ALPHA; } int IceTile::getResourceCount(Random* pRandom)