mirror of
https://github.com/celisej567/mcpe.git
synced 2026-09-11 20:11:18 +03:00
* Add clouds! (optional feature)
This commit is contained in:
@@ -430,6 +430,7 @@ void GameRenderer::renderLevel(float f)
|
||||
setupCamera(f, i);
|
||||
saveMatrices();
|
||||
|
||||
/*
|
||||
if (m_pMinecraft->m_options.m_iViewDistance <= 1)
|
||||
{
|
||||
#ifndef ORIGINAL_CODE
|
||||
@@ -440,6 +441,7 @@ void GameRenderer::renderLevel(float f)
|
||||
setupFog(-1);
|
||||
pLR->renderSky(f);
|
||||
}
|
||||
*/
|
||||
|
||||
glEnable(GL_FOG);
|
||||
setupFog(1);
|
||||
@@ -457,6 +459,9 @@ void GameRenderer::renderLevel(float f)
|
||||
pLR->cull(&frustumCuller, f);
|
||||
pLR->updateDirtyChunks(pMob, false);
|
||||
|
||||
// TODO[v0.6.1]: what is (this+4)+63 (byte)?
|
||||
prepareAndRenderClouds(pLR, f);
|
||||
|
||||
setupFog(0);
|
||||
glEnable(GL_FOG);
|
||||
|
||||
@@ -486,7 +491,6 @@ void GameRenderer::renderLevel(float f)
|
||||
|
||||
glDepthMask(true);
|
||||
|
||||
|
||||
#ifndef ORIGINAL_CODE
|
||||
glShadeModel(GL_FLAT);
|
||||
#endif
|
||||
@@ -734,6 +738,34 @@ void GameRenderer::renderItemInHand(float f, int i)
|
||||
bobView(f);
|
||||
}
|
||||
|
||||
void GameRenderer::prepareAndRenderClouds(LevelRenderer* pLR, float f)
|
||||
{
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glPushMatrix();
|
||||
glLoadIdentity();
|
||||
gluPerspective(getFov(f), float(Minecraft::width) / float(Minecraft::height), 0.05f, field_8 * 512.0f);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glPushMatrix();
|
||||
setupFog(0);
|
||||
glDepthMask(false);
|
||||
glEnable(GL_FOG);
|
||||
glFogf(GL_FOG_START, field_8 * 0.2f);
|
||||
glFogf(GL_FOG_END, field_8 * 0.75f);
|
||||
pLR->renderSky(f);
|
||||
glFogf(GL_FOG_START, field_8 * 4.2f * 0.6f);
|
||||
glFogf(GL_FOG_END, field_8 * 4.2f);
|
||||
pLR->renderClouds(f);
|
||||
glFogf(GL_FOG_START, field_8 * 0.6f);
|
||||
glFogf(GL_FOG_END, field_8);
|
||||
glDisable(GL_FOG);
|
||||
glDepthMask(true);
|
||||
setupFog(1);
|
||||
glPopMatrix();
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glPopMatrix();
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
}
|
||||
|
||||
void GameRenderer::onGraphicsReset()
|
||||
{
|
||||
|
||||
|
||||
Reference in New Issue
Block a user