forked from cafeberry/cafeberry
revert perf + fix: windows performance optimizations + x360 fixes + ps3 hdd corruption fix (#27)
revert perf + fix: windows performance optimizations + x360 fixes + ps3 hdd corruption fix (#27) windows optimizations include: - adding WPO/LTCG - fixing potential memory leaks - reducing unneeded busy waits xbox 360 fixes include: - all item names displaying as black - adding newer dlcs crashing game ps3 fix was that, when holding the ps button, it'd corrupt the hdd. NEEDS TESTING! just a guess fix since I don't have a PS3. --------- Co-authored-by: pieeebot <piebot00@gmail.com> Co-authored-by: piebot <piebot00@gmail.com> Co-authored-by: str1k3r <115313679+S1l3ntStr1ke87@users.noreply.github.com> Co-authored-by: str1k3r <1+str1k3r@noreply.localhost> Co-authored-by: pieeebot <10+pieeebot@noreply.neolegacy.dev> Co-authored-by: qloak <53+qloak@noreply.neolegacy.dev> Reviewed-on: cafeberry/cafeberry#27 Co-authored-by: qloak <realminecart@gmail.com>
This commit is contained in:
@@ -105,6 +105,8 @@ GameRenderer::GameRenderer(Minecraft *mc)
|
||||
zoom = 1;
|
||||
zoom_x = 0;
|
||||
zoom_y = 0;
|
||||
rainXa = NULL;
|
||||
rainZa = NULL;
|
||||
lastActiveTime = Minecraft::currentTimeMillis();
|
||||
lastNsTime = 0;
|
||||
random = new Random();
|
||||
@@ -179,9 +181,8 @@ GameRenderer::GameRenderer(Minecraft *mc)
|
||||
// 4J Stu Added to go with 1.8.2 change
|
||||
GameRenderer::~GameRenderer()
|
||||
{
|
||||
delete random;
|
||||
delete cameraPos;
|
||||
delete lb;
|
||||
if(rainXa != NULL) delete [] rainXa;
|
||||
if(rainZa != NULL) delete [] rainZa;
|
||||
}
|
||||
|
||||
void GameRenderer::tick(bool first) // 4J - add bFirst
|
||||
@@ -837,21 +838,19 @@ void GameRenderer::updateLightTexture(float a)
|
||||
Level *level = player->level; // 4J - was mc->level when it was just to update the one light texture
|
||||
|
||||
float skyDarken1 = level->getSkyDarken((float) 1);
|
||||
float darken = skyDarken1 * 0.95f + 0.05f;
|
||||
float rsGsMul = skyDarken1 * 0.65f + 0.35f;
|
||||
float blockMul = blr * 0.1f + 1.5f;
|
||||
for (int i = 0; i < 256; i++)
|
||||
{
|
||||
float darken = skyDarken1 * 0.95f + 0.05f;
|
||||
float sky = level->dimension->brightnessRamp[i / 16] * darken;
|
||||
float block = level->dimension->brightnessRamp[i % 16] * blockMul;
|
||||
float block = level->dimension->brightnessRamp[i % 16] * (blr * 0.1f + 1.5f);
|
||||
|
||||
if (level->skyFlashTime > 0)
|
||||
{
|
||||
sky = level->dimension->brightnessRamp[i / 16];
|
||||
}
|
||||
|
||||
float rs = sky * rsGsMul;
|
||||
float gs = sky * rsGsMul;
|
||||
float rs = sky * (skyDarken1 * 0.65f + 0.35f);
|
||||
float gs = sky * (skyDarken1 * 0.65f + 0.35f);
|
||||
float bs = sky;
|
||||
|
||||
float rb = block;
|
||||
@@ -1527,30 +1526,27 @@ void GameRenderer::tickRain()
|
||||
int x = x0 + random->nextInt(r) - random->nextInt(r);
|
||||
int z = z0 + random->nextInt(r) - random->nextInt(r);
|
||||
int y = level->getTopRainBlock(x, z);
|
||||
if (y <= y0 + r && y >= y0 - r)
|
||||
int t = level->getTile(x, y - 1, z);
|
||||
Biome *biome = level->getBiome(x,z);
|
||||
if (y <= y0 + r && y >= y0 - r && biome->hasRain() && biome->getTemperature() >= 0.2f)
|
||||
{
|
||||
int t = level->getTile(x, y - 1, z);
|
||||
Biome *biome = level->getBiome(x,z);
|
||||
if (biome->hasRain() && biome->getTemperature() >= 0.2f)
|
||||
float xa = random->nextFloat();
|
||||
float za = random->nextFloat();
|
||||
if (t > 0)
|
||||
{
|
||||
float xa = random->nextFloat();
|
||||
float za = random->nextFloat();
|
||||
if (t > 0)
|
||||
if (Tile::tiles[t]->material == Material::lava)
|
||||
{
|
||||
if (Tile::tiles[t]->material == Material::lava)
|
||||
mc->particleEngine->add( shared_ptr<SmokeParticle>( new SmokeParticle(level, x + xa, y + 0.1f - Tile::tiles[t]->getShapeY0(), z + za, 0, 0, 0) ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
if (random->nextInt(++rainPosSamples) == 0)
|
||||
{
|
||||
mc->particleEngine->add( shared_ptr<SmokeParticle>( new SmokeParticle(level, x + xa, y + 0.1f - Tile::tiles[t]->getShapeY0(), z + za, 0, 0, 0) ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
if (random->nextInt(++rainPosSamples) == 0)
|
||||
{
|
||||
rainPosX = x + xa;
|
||||
rainPosY = y + 0.1f - Tile::tiles[t]->getShapeY0();
|
||||
rainPosZ = z + za;
|
||||
}
|
||||
mc->particleEngine->add( shared_ptr<WaterDropParticle>( new WaterDropParticle(level, x + xa, y + 0.1f - Tile::tiles[t]->getShapeY0(), z + za) ) );
|
||||
rainPosX = x + xa;
|
||||
rainPosY = y + 0.1f - Tile::tiles[t]->getShapeY0();
|
||||
rainPosZ = z + za;
|
||||
}
|
||||
mc->particleEngine->add( shared_ptr<WaterDropParticle>( new WaterDropParticle(level, x + xa, y + 0.1f - Tile::tiles[t]->getShapeY0(), z + za) ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1585,12 +1581,10 @@ void GameRenderer::renderSnowAndRain(float a)
|
||||
|
||||
turnOnLightLayer(a);
|
||||
|
||||
static float rainXa[32 * 32];
|
||||
static float rainZa[32 * 32];
|
||||
static bool rainArraysInitialized = false;
|
||||
if (!rainArraysInitialized)
|
||||
if (rainXa == NULL)
|
||||
{
|
||||
rainArraysInitialized = true;
|
||||
rainXa = new float[32 * 32];
|
||||
rainZa = new float[32 * 32];
|
||||
|
||||
for (int z = 0; z < 32; z++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user