mirror of
https://github.com/neoStudiosLCE/neoLegacy.git
synced 2026-06-08 22:12:56 +00:00
Fix Commit "Implement LCERenewed Changes"
This fixes commit cf0472117c.
This commit is contained in:
parent
cf0472117c
commit
d73ae8fd5c
|
|
@ -214,7 +214,7 @@ void Chunk::rebuild()
|
|||
|
||||
int r = 1;
|
||||
|
||||
int lists = levelRenderer->getGlobalIndexForChunk(this->x,this->y,this->z,level) * 3;
|
||||
int lists = levelRenderer->getGlobalIndexForChunk(this->x,this->y,this->z,level) * 2;
|
||||
lists += levelRenderer->chunkLists;
|
||||
|
||||
PIXEndNamedEvent();
|
||||
|
|
@ -324,7 +324,7 @@ void Chunk::rebuild()
|
|||
if( empty )
|
||||
{
|
||||
// 4J - added - clear any renderer data associated with this
|
||||
for (int currentLayer = 0; currentLayer < 3; currentLayer++)
|
||||
for (int currentLayer = 0; currentLayer < 2; currentLayer++)
|
||||
{
|
||||
levelRenderer->setGlobalChunkFlag(this->x, this->y, this->z, level, LevelRenderer::CHUNK_FLAG_EMPTY0, currentLayer);
|
||||
RenderManager.CBuffClear(lists + currentLayer);
|
||||
|
|
@ -349,7 +349,7 @@ void Chunk::rebuild()
|
|||
bounds.boundingBox[4] = SIZE+g;
|
||||
bounds.boundingBox[5] = XZSIZE+g;
|
||||
}
|
||||
for (int currentLayer = 0; currentLayer < 3; currentLayer++)
|
||||
for (int currentLayer = 0; currentLayer < 2; currentLayer++)
|
||||
{
|
||||
bool renderNextLayer = false;
|
||||
bool rendered = false;
|
||||
|
|
@ -466,15 +466,10 @@ void Chunk::rebuild()
|
|||
}
|
||||
if((currentLayer==0)&&(!renderNextLayer))
|
||||
{
|
||||
levelRenderer->setGlobalChunkFlag(this->x, this->y, this->z, level, LevelRenderer::CHUNK_FLAG_EMPTY1 | LevelRenderer::CHUNK_FLAG_NOTSKYLIT);
|
||||
RenderManager.CBuffClear(lists + 2);
|
||||
levelRenderer->setGlobalChunkFlag(this->x, this->y, this->z, level, LevelRenderer::CHUNK_FLAG_EMPTY1);
|
||||
RenderManager.CBuffClear(lists + 1);
|
||||
break;
|
||||
}
|
||||
if ((currentLayer == 2) && (!renderNextLayer))
|
||||
{
|
||||
levelRenderer->setGlobalChunkFlag(this->x, this->y, this->z, level, LevelRenderer::CHUNK_FLAG_NOTSKYLIT);
|
||||
RenderManager.CBuffClear(lists + 2);
|
||||
}
|
||||
}
|
||||
|
||||
// 4J MGH - added this to take the bound from the value calc'd in the tesselator
|
||||
|
|
@ -604,15 +599,14 @@ void Chunk::rebuild()
|
|||
|
||||
// 4J - These removed items are now also removed from globalRenderableTileEntities
|
||||
|
||||
// @Patoke: this is now unused in favour of the new render layer
|
||||
//if( LevelChunk::touchedSky )
|
||||
//{
|
||||
// levelRenderer->clearGlobalChunkFlag(x, y, z, level, LevelRenderer::CHUNK_FLAG_NOTSKYLIT);
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// levelRenderer->setGlobalChunkFlag(x, y, z, level, LevelRenderer::CHUNK_FLAG_NOTSKYLIT);
|
||||
//}
|
||||
if( LevelChunk::touchedSky )
|
||||
{
|
||||
levelRenderer->clearGlobalChunkFlag(x, y, z, level, LevelRenderer::CHUNK_FLAG_NOTSKYLIT);
|
||||
}
|
||||
else
|
||||
{
|
||||
levelRenderer->setGlobalChunkFlag(x, y, z, level, LevelRenderer::CHUNK_FLAG_NOTSKYLIT);
|
||||
}
|
||||
levelRenderer->setGlobalChunkFlag(x, y, z, level, LevelRenderer::CHUNK_FLAG_COMPILED);
|
||||
PIXEndNamedEvent();
|
||||
return;
|
||||
|
|
@ -967,11 +961,11 @@ void Chunk::reset()
|
|||
// printf("\t\t [dec] refcount %d at %d, %d, %d\n",refCount,x,y,z);
|
||||
if( refCount == 0 )
|
||||
{
|
||||
int lists = levelRenderer->getGlobalIndexForChunk(x, y, z, level) * 3;
|
||||
int lists = levelRenderer->getGlobalIndexForChunk(x, y, z, level) * 2;
|
||||
if(lists >= 0)
|
||||
{
|
||||
lists += levelRenderer->chunkLists;
|
||||
for (int i = 0; i < 3; i++)
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
// 4J - added - clear any renderer data associated with this unused list
|
||||
RenderManager.CBuffClear(lists + i);
|
||||
|
|
@ -995,7 +989,7 @@ int Chunk::getList(int layer)
|
|||
{
|
||||
if (!clipChunk->visible) return -1;
|
||||
|
||||
int lists = levelRenderer->getGlobalIndexForChunk(x, y, z, level) * 3;
|
||||
int lists = levelRenderer->getGlobalIndexForChunk(x, y, z,level) * 2;
|
||||
lists += levelRenderer->chunkLists;
|
||||
|
||||
bool empty = levelRenderer->getGlobalChunkFlag(x, y, z, level, LevelRenderer::CHUNK_FLAG_EMPTY0, layer);
|
||||
|
|
|
|||
|
|
@ -1538,21 +1538,22 @@ void GameRenderer::renderLevel(float a, int64_t until)
|
|||
|
||||
glBlendFunc(GL_ZERO, GL_ONE);
|
||||
PIXBeginNamedEvent(0,"Fancy second pass - writing z");
|
||||
glBlendFunc(GL_ZERO, GL_ONE);
|
||||
glEnable(GL_CULL_FACE);
|
||||
|
||||
levelRenderer->render(cameraEntity, 2, a, updateChunks);
|
||||
int visibleWaterChunks = levelRenderer->render(cameraEntity, 1, a, updateChunks);
|
||||
PIXEndNamedEvent();
|
||||
|
||||
PIXBeginNamedEvent(0, "Fancy second pass - actual render");
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
levelRenderer->render(cameraEntity, 2, a, updateChunks); // 4J - chanaged, used to be renderSameAsLast but we don't support that anymore
|
||||
PIXEndNamedEvent();
|
||||
|
||||
// @Patoke todo: implement, this is really important for rendering of order independent alpha objects
|
||||
// RenderManager.BeginOrderIndependentAlpha();
|
||||
if (visibleWaterChunks > 0)
|
||||
{
|
||||
PIXBeginNamedEvent(0,"Fancy second pass - actual rendering");
|
||||
levelRenderer->render(cameraEntity, 1, a, updateChunks); // 4J - chanaged, used to be renderSameAsLast but we don't support that anymore
|
||||
PIXEndNamedEvent();
|
||||
}
|
||||
|
||||
PIXBeginNamedEvent(0, "Fancy second pass - actual rendering");
|
||||
GL11::glShadeModel(GL11::GL_FLAT);
|
||||
}
|
||||
else
|
||||
{
|
||||
PIXBeginNamedEvent(0,"Second pass level render");
|
||||
levelRenderer->render(cameraEntity, 1, a, updateChunks);
|
||||
PIXEndNamedEvent();
|
||||
}
|
||||
|
|
@ -1567,8 +1568,6 @@ void GameRenderer::renderLevel(float a, int64_t until)
|
|||
particleEngine->render(cameraEntity, a, ParticleEngine::TRANSLUCENT_LIST);
|
||||
PIXEndNamedEvent();
|
||||
turnOffLightLayer(a); // 4J - brought forward from 1.8.2
|
||||
// @Patoke todo: implement
|
||||
// RenderManager.EndOrderIndependentAlpha();
|
||||
////////////////////////// End of 4J added section
|
||||
|
||||
glDepthMask(true);
|
||||
|
|
|
|||
|
|
@ -243,10 +243,7 @@ void ItemInHandRenderer::renderItem(shared_ptr<LivingEntity> mob, shared_ptr<Ite
|
|||
MemSect(31);
|
||||
minecraft->textures->bindTexture(minecraft->textures->getTextureLocation(Icon::TYPE_TERRAIN));
|
||||
MemSect(0);
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
tileRenderer->renderTile(Tile::tiles[item->id], item->getAuxValue(), SharedConstants::TEXTURE_LIGHTING ? 1.0f : mob->getBrightness(1)); // 4J - change brought forward from 1.8.2
|
||||
glDisable(GL_BLEND);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -828,7 +828,7 @@ int LevelRenderer::renderChunks(int from, int to, int layer, double alpha)
|
|||
if( ( globalChunkFlags[pClipChunk->globalIdx] & emptyFlag ) == emptyFlag ) continue; // Check that this particular layer isn't empty
|
||||
|
||||
// List can be calculated directly from the chunk's global idex
|
||||
int list = pClipChunk->globalIdx * 3 + layer;
|
||||
int list = pClipChunk->globalIdx * 2 + layer;
|
||||
list += chunkLists;
|
||||
|
||||
if(RenderManager.CBuffCall(list, first))
|
||||
|
|
|
|||
|
|
@ -8505,44 +8505,6 @@ void TileRenderer::renderTile( Tile* tile, int data, float brightness, float fAl
|
|||
tesselateHopperInWorld(tile, 0, 0, 0, 0, true);
|
||||
glTranslatef(0.5f, 0.5f, 0.5f);
|
||||
}
|
||||
else if (shape == Tile::SHAPE_THIN_PANE)
|
||||
{
|
||||
setShape(7.0f / 16.0f, 0, 0, 9.0f / 16.0f, 1.0f, 1.0f);
|
||||
|
||||
glTranslatef(-0.5f, -0.5f, -0.5f);
|
||||
t->begin();
|
||||
t->normal(0, -1, 0);
|
||||
renderFaceDown(tile, 0, 0, 0, getTexture(tile, 0, data));
|
||||
t->end();
|
||||
|
||||
t->begin();
|
||||
t->normal(0, 1, 0);
|
||||
renderFaceUp(tile, 0, 0, 0, getTexture(tile, 1, data));
|
||||
t->end();
|
||||
|
||||
t->begin();
|
||||
t->normal(0, 0, -1);
|
||||
renderNorth(tile, 0, 0, 0, getTexture(tile, 2, data));
|
||||
t->end();
|
||||
|
||||
t->begin();
|
||||
t->normal(0, 0, 1);
|
||||
renderSouth(tile, 0, 0, 0, getTexture(tile, 3, data));
|
||||
t->end();
|
||||
|
||||
t->begin();
|
||||
t->normal(-1, 0, 0);
|
||||
renderWest(tile, 0, 0, 0, getTexture(tile, 4, data));
|
||||
t->end();
|
||||
|
||||
t->begin();
|
||||
t->normal(1, 0, 0);
|
||||
renderEast(tile, 0, 0, 0, getTexture(tile, 5, data));
|
||||
t->end();
|
||||
|
||||
glTranslatef(0.5f, 0.5f, 0.5f);
|
||||
setShape(0, 0, 0, 1, 1, 1);
|
||||
}
|
||||
|
||||
t->setMipmapEnable( true ); // 4J added
|
||||
}
|
||||
|
|
@ -8563,8 +8525,6 @@ bool TileRenderer::canRender( int renderShape )
|
|||
if ( renderShape == Tile::SHAPE_WALL) return true;
|
||||
if ( renderShape == Tile::SHAPE_BEACON) return true;
|
||||
if ( renderShape == Tile::SHAPE_ANVIL) return true;
|
||||
if (renderShape == Tile::SHAPE_THIN_PANE) return true;
|
||||
if (renderShape == Tile::SHAPE_WATER) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -5,7 +5,7 @@
|
|||
#include "TallGrass2.h"
|
||||
|
||||
DoublePlantFeature::DoublePlantFeature(bool doUpdate)
|
||||
: Feature(doUpdate), m_plantType(1)
|
||||
: Feature(doUpdate), m_plantType(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,19 +17,6 @@ bool HalfTransparentTile::isSolidRender(bool isServerLevel)
|
|||
bool HalfTransparentTile::shouldRenderFace(LevelSource *level, int x, int y, int z, int face)
|
||||
{
|
||||
int id = level->getTile(x, y, z);
|
||||
|
||||
if (this->id == 95) // Tile::stained_glass
|
||||
{
|
||||
bool isBlocking = level->isTopSolidBlocking(x, y, z);
|
||||
if (face == 0 && level->isSolidBlockingTile(x, y + 1, z) != isBlocking) return true; // Facing::DOWN
|
||||
else if (face == 1 && level->isTopSolidBlocking(x, y - 1, z) != isBlocking) return true; // Facing::UP
|
||||
else if (face == 2 && level->isSolidBlockingTile(x, y, z + 1) != isBlocking) return true; // Facing::NORTH
|
||||
else if (face == 3 && level->isSolidBlockingTile(x, y, z - 1) != isBlocking) return true; // Facing::SOUTH
|
||||
else if (face == 4 && level->isSolidBlockingTile(x + 1, y, z) != isBlocking) return true; // Facing::WEST
|
||||
else if (face == 5 && level->isSolidBlockingTile(x - 1, y, z) != isBlocking) return true; // Facing::EAST
|
||||
else if (face == 6 && level->isSolidBlockingTile(x, y, z) != isBlocking) return true; // not really a direction? is this supposed to be here?
|
||||
}
|
||||
|
||||
if (!allowSame && id == this->id) return false;
|
||||
return Tile::shouldRenderFace(level, x, y, z, face);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ public:
|
|||
|
||||
public:
|
||||
static const int MAX_XBOX_BOATS = 60; // Max number of boats
|
||||
static const int MAX_CONSOLE_MINECARTS = 250;
|
||||
static const int MAX_CONSOLE_MINECARTS = 60;
|
||||
static const int MAX_DISPENSABLE_FIREBALLS = 300;
|
||||
static const int MAX_DISPENSABLE_PROJECTILES = 400;
|
||||
|
||||
|
|
|
|||
|
|
@ -253,7 +253,7 @@ float LiquidTile::getBrightness(LevelSource *level, int x, int y, int z)
|
|||
|
||||
int LiquidTile::getRenderLayer()
|
||||
{
|
||||
return material == Material::water ? 2 : 0;
|
||||
return material == Material::water ? 1 : 0;
|
||||
}
|
||||
|
||||
void LiquidTile::animateTick(Level *level, int x, int y, int z, Random *random)
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ bool NoteBlockTile::triggerEvent(Level *level, int x, int y, int z, int i, int n
|
|||
break;
|
||||
}
|
||||
app.DebugPrintf("NoteBlockTile::triggerEvent - playSound - pitch = %f\n",pitch);
|
||||
level->playSound(x + 0.5, y + 0.5, z + 0.5, iSound, 3, pitch, 64.0f);
|
||||
level->playSound(x + 0.5, y + 0.5, z + 0.5, iSound, 3, pitch);
|
||||
level->addParticle(eParticleType_note, x + 0.5, y + 1.2, z + 0.5, note / 24.0, 0, 0);
|
||||
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Reference in a new issue