From 109bbcfdb1aa165fbc1cc227806178046fd36954 Mon Sep 17 00:00:00 2001 From: Shredder Date: Wed, 1 Apr 2026 14:03:38 +0500 Subject: [PATCH 01/33] Added Rendering and Dynamic texture for Fire and it's behaviour --- src/client/Minecraft.cpp | 1 + src/client/renderer/TileRenderer.cpp | 298 +++++++++++++++++- src/client/renderer/TileRenderer.h | 2 + .../renderer/ptexture/DynamicTexture.cpp | 90 ++++++ src/client/renderer/ptexture/DynamicTexture.h | 17 + src/world/level/Level.cpp | 4 +- src/world/level/tile/FireTile.h | 20 +- 7 files changed, 414 insertions(+), 18 deletions(-) diff --git a/src/client/Minecraft.cpp b/src/client/Minecraft.cpp index ccd9ba5..341bea9 100755 --- a/src/client/Minecraft.cpp +++ b/src/client/Minecraft.cpp @@ -1125,6 +1125,7 @@ void Minecraft::init() textures = new Textures(&options, platform()); textures->addDynamicTexture(new WaterTexture()); textures->addDynamicTexture(new WaterSideTexture()); + textures->addDynamicTexture(new FireTexture()); gui.texturesLoaded(textures); levelRenderer = new LevelRenderer(this); diff --git a/src/client/renderer/TileRenderer.cpp b/src/client/renderer/TileRenderer.cpp index a98e82b..cdbdc7d 100755 --- a/src/client/renderer/TileRenderer.cpp +++ b/src/client/renderer/TileRenderer.cpp @@ -13,6 +13,7 @@ #include "../../world/level/tile/BedTile.h" #include "../../world/level/tile/StemTile.h" #include "../../world/level/tile/StairTile.h" +#include "../../world/level/tile/FireTile.h" #include "../../world/Direction.h" #include "../../world/Facing.h" #include "tileentity/TileEntityRenderer.h" @@ -157,8 +158,8 @@ bool TileRenderer::tesselateInWorld( Tile* tt, int x, int y, int z ) return tesselateRowInWorld(tt, x, y, z); } else if (shape == Tile::SHAPE_TORCH) { return tesselateTorchInWorld(tt, x, y, z); - //} else if (shape == Tile::SHAPE_FIRE) { - // return tesselateFireInWorld(tt, x, y, z); + } else if (shape == Tile::SHAPE_FIRE) { + return tesselateFireInWorld(tt, x, y, z); //} else if (shape == Tile::SHAPE_RED_DUST) { // return tesselateDustInWorld(tt, x, y, z); } else if (shape == Tile::SHAPE_LADDER) { @@ -222,6 +223,299 @@ bool TileRenderer::tesselateTorchInWorld( Tile* tt, int x, int y, int z ) return true; } +bool TileRenderer::tesselateFireInWorld( Tile* tt, int x, int y, int z ) +{ + Tesselator& t = Tesselator::instance; + + //Icon *firstTex = tt->getTextureLayer(0); + //Icon *secondTex = tt->getTextureLayer(1); + //Icon *tex = firstTex; + int tex = tt->getTexture(0); + +// if (hasFixedTexture()) tex = fixedTexture; + if (fixedTexture >= 0) tex = fixedTexture; + + +// t.color( 1.0f, 1.0f, 1.0f ); +// t.tex( getLightColor(tt, level, x, y, z ) ); + + + + + + + + + float br = tt->getBrightness( level, x, y, z ); + t.color( br, br, br ); + + int xt = ((tex & 0xf) << 4); + int yt = tex & 0xf0; + + float u0 = (xt) / 256.0f; + float u1 = (xt + 15.99f) / 256.0f; + float v0 = (yt) / 256.0f; + float v1 = (yt + 15.99f) / 256.0f; + float h = 1.4f; + + if ( level->isSolidBlockingTile( x, y - 1, z ) || Tile::fire->canBurn( level, x, y - 1, z ) ) + { + float x0 = x + 0.5f + 0.2f; + float x1 = x + 0.5f - 0.2f; + float z0 = z + 0.5f + 0.2f; + float z1 = z + 0.5f - 0.2f; + + float x0_ = x + 0.5f - 0.3f; + float x1_ = x + 0.5f + 0.3f; + float z0_ = z + 0.5f - 0.3f; + float z1_ = z + 0.5f + 0.3f; + + t.vertexUV( ( float )( x0_ ), ( float )( y + h ), ( float )( z + 1 ), ( float )( u1 ), ( float )( v0 ) ); + t.vertexUV( ( float )( x0 ), ( float )( y + 0 ), ( float )( z + 1 ), ( float )( u1 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x0 ), ( float )( y + 0 ), ( float )( z + 0 ), ( float )( u0 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x0_ ), ( float )( y + h ), ( float )( z + 0 ), ( float )( u0 ), ( float )( v0 ) ); + + t.vertexUV( ( float )( x1_ ), ( float )( y + h ), ( float )( z + 0 ), ( float )( u1 ), ( float )( v0 ) ); + t.vertexUV( ( float )( x1 ), ( float )( y + 0 ), ( float )( z + 0 ), ( float )( u1 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x1 ), ( float )( y + 0 ), ( float )( z + 1 ), ( float )( u0 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x1_ ), ( float )( y + h ), ( float )( z + 1 ), ( float )( u0 ), ( float )( v0 ) ); + + // tex = secondTex; +// u0 = tex->getU0(true); +// v0 = tex->getV0(true); +// u1 = tex->getU1(true); +// v1 = tex->getV1(true); + + u0 = (xt) / 256.0f; + u1 = (xt + 15.99f) / 256.0f; + v0 = (yt) / 256.0f; + v1 = (yt + 15.99f) / 256.0f; + + t.vertexUV( ( float )( x + 1 ), ( float )( y + h ), ( float )( z1_ ), ( float )( u1 ), ( float )( v0 ) ); + t.vertexUV( ( float )( x + 1 ), ( float )( y + 0 ), ( float )( z1 ), ( float )( u1 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + 0 ), ( float )( y + 0 ), ( float )( z1 ), ( float )( u0 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + 0 ), ( float )( y + h ), ( float )( z1_ ), ( float )( u0 ), ( float )( v0 ) ); + + t.vertexUV( ( float )( x + 0 ), ( float )( y + h ), ( float )( z0_ ), ( float )( u1 ), ( float )( v0 ) ); + t.vertexUV( ( float )( x + 0 ), ( float )( y + 0 ), ( float )( z0 ), ( float )( u1 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + 1 ), ( float )( y + 0 ), ( float )( z0 ), ( float )( u0 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + 1 ), ( float )( y + h ), ( float )( z0_ ), ( float )( u0 ), ( float )( v0 ) ); + + x0 = x + 0.5f - 0.5f; + x1 = x + 0.5f + 0.5f; + z0 = z + 0.5f - 0.5f; + z1 = z + 0.5f + 0.5f; + + x0_ = x + 0.5f - 0.4f; + x1_ = x + 0.5f + 0.4f; + z0_ = z + 0.5f - 0.4f; + z1_ = z + 0.5f + 0.4f; + + t.vertexUV( ( float )( x0_ ), ( float )( y + h ), ( float )( z + 0 ), ( float )( u0 ), ( float )( v0 ) ); + t.vertexUV( ( float )( x0 ), ( float )( y + 0 ), ( float )( z + 0 ), ( float )( u0 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x0 ), ( float )( y + 0 ), ( float )( z + 1 ), ( float )( u1 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x0_ ), ( float )( y + h ), ( float )( z + 1 ), ( float )( u1 ), ( float )( v0 ) ); + + t.vertexUV( ( float )( x1_ ), ( float )( y + h ), ( float )( z + 1 ), ( float )( u0 ), ( float )( v0 ) ); + t.vertexUV( ( float )( x1 ), ( float )( y + 0 ), ( float )( z + 1 ), ( float )( u0 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x1 ), ( float )( y + 0 ), ( float )( z + 0 ), ( float )( u1 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x1_ ), ( float )( y + h ), ( float )( z + 0 ), ( float )( u1 ), ( float )( v0 ) ); + +// tex = firstTex; + u0 = (xt) / 256.0f; + u1 = (xt + 15.99f) / 256.0f; + v0 = (yt) / 256.0f; + v1 = (yt + 15.99f) / 256.0f; + + t.vertexUV( ( float )( x + 0 ), ( float )( y + h ), ( float )( z1_ ), ( float )( u0 ), ( float )( v0 ) ); + t.vertexUV( ( float )( x + 0 ), ( float )( y + 0 ), ( float )( z1 ), ( float )( u0 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + 1 ), ( float )( y + 0 ), ( float )( z1 ), ( float )( u1 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + 1 ), ( float )( y + h ), ( float )( z1_ ), ( float )( u1 ), ( float )( v0 ) ); + + t.vertexUV( ( float )( x + 1 ), ( float )( y + h ), ( float )( z0_ ), ( float )( u0 ), ( float )( v0 ) ); + t.vertexUV( ( float )( x + 1 ), ( float )( y + 0 ), ( float )( z0 ), ( float )( u0 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + 0 ), ( float )( y + 0 ), ( float )( z0 ), ( float )( u1 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + 0 ), ( float )( y + h ), ( float )( z0_ ), ( float )( u1 ), ( float )( v0 ) ); + } + else + { + float r = 0.2f; + float yo = 1 / 16.0f; + if ( ( ( x + y + z ) & 1 ) == 1 ) + { + // tex = secondTex; + u0 = (xt) / 256.0f; + u1 = (xt + 15.99f) / 256.0f; + v0 = (yt) / 256.0f; + v1 = (yt + 15.99f) / 256.0f; + } + if ( ( ( x / 2 + y / 2 + z / 2 ) & 1 ) == 1 ) + { + float tmp = u1; + u1 = u0; + u0 = tmp; + } + if ( Tile::fire->canBurn( level, x - 1, y, z ) ) + { + t.vertexUV( ( float )( x + r ), ( float )( y + h + yo ), ( float )( z + + 1.0f ), ( float )( u1 ), ( float )( v0 ) ); + t.vertexUV( ( float )( x + 0.0f ), ( float )( y + 0.0f + yo ), ( float )( z + + 1.0f ), ( float )( u1 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + 0.0f ), ( float )( y + 0.0f + yo ), ( float )( z + + 0.0f ), ( float )( u0 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + r ), ( float )( y + h + yo ), ( float )( z + + 0.0f ), ( float )( u0 ), ( float )( v0 ) ); + + t.vertexUV( ( float )( x + r ), ( float )( y + h + yo ), ( float )( z + + 0.0f ), ( float )( u0 ), ( float )( v0 ) ); + t.vertexUV( ( float )( x + 0.0f ), ( float )( y + 0.0f + yo ), ( float )( z + + 0.0f ), ( float )( u0 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + 0.0f ), ( float )( y + 0.0f + yo ), ( float )( z + + 1.0f ), ( float )( u1 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + r ), ( float )( y + h + yo ), ( float )( z + + 1.0f ), ( float )( u1 ), ( float )( v0 ) ); + } + if ( Tile::fire->canBurn( level, x + 1, y, z ) ) + { + t.vertexUV( ( float )( x + 1 - r ), ( float )( y + h + yo ), ( float )( z + + 0.0f ), ( float )( u0 ), ( float )( v0 ) ); + t.vertexUV( ( float )( x + 1 - 0 ), ( float )( y + 0 + yo ), ( float )( z + + 0.0f ), ( float )( u0 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + 1 - 0 ), ( float )( y + 0 + yo ), ( float )( z + + 1.0f ), ( float )( u1 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + 1 - r ), ( float )( y + h + yo ), ( float )( z + + 1.0f ), ( float )( u1 ), ( float )( v0 ) ); + + t.vertexUV( ( float )( x + 1.0f - r ), ( float )( y + h + yo ), ( float )( z + + 1.0f ), ( float )( u1 ), ( float )( v0 ) ); + t.vertexUV( ( float )( x + 1.0f - 0.0f ), ( float )( y + 0.0f + yo ), ( float )( z + + 1.0f ), ( float )( u1 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + 1.0f - 0 ), ( float )( y + 0.0f + yo ), ( float )( z + + 0.0f ), ( float )( u0 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + 1.0f - r ), ( float )( y + h + yo ), ( float )( z + + 0.0f ), ( float )( u0 ), ( float )( v0 ) ); + } + if ( Tile::fire->canBurn( level, x, y, z - 1 ) ) + { + t.vertexUV( ( float )( x + 0.0f ), ( float )( y + h + yo ), ( float )( z + + r ), ( float )( u1 ), ( float )( v0 ) ); + t.vertexUV( ( float )( x + 0.0f ), ( float )( y + 0.0f + yo ), ( float )( z + + 0.0f ), ( float )( u1 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + 1.0f ), ( float )( y + 0.0f + yo ), ( float )( z + + 0.0f ), ( float )( u0 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + 1.0f ), ( float )( y + h + yo ), ( float )( z + + r ), ( float )( u0 ), ( float )( v0 ) ); + + t.vertexUV( ( float )( x + 1.0f ), ( float )( y + h + yo ), ( float )( z + + r ), ( float )( u0 ), ( float )( v0 ) ); + t.vertexUV( ( float )( x + 1.0f ), ( float )( y + 0.0f + yo ), ( float )( z + + 0.0f ), ( float )( u0 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + 0.0f ), ( float )( y + 0.0f + yo ), ( float )( z + + 0.0f ), ( float )( u1 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + 0.0f ), ( float )( y + h + yo ), ( float )( z + + r ), ( float )( u1 ), ( float )( v0 ) ); + } + if ( Tile::fire->canBurn( level, x, y, z + 1 ) ) + { + t.vertexUV( ( float )( x + 1.0f ), ( float )( y + h + yo ), ( float )( z + 1.0f - + r ), ( float )( u0 ), ( float )( v0 ) ); + t.vertexUV( ( float )( x + 1.0f ), ( float )( y + 0.0f + yo ), ( float )( z + 1.0f - + 0.0f ), ( float )( u0 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + 0.0f ), ( float )( y + 0.0f + yo ), ( float )( z + 1.0f - + 0.0f ), ( float )( u1 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + 0.0f ), ( float )( y + h + yo ), ( float )( z + 1.0f - + r ), ( float )( u1 ), ( float )( v0 ) ); + + t.vertexUV( ( float )( x + 0.0f ), ( float )( y + h + yo ), ( float )( z + 1.0f - + r ), ( float )( u1 ), ( float )( v0 ) ); + t.vertexUV( ( float )( x + 0.0f ), ( float )( y + 0.0f + yo ), ( float )( z + 1.0f - + 0.0f ), ( float )( u1 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + 1.0f ), ( float )( y + 0.0f + yo ), ( float )( z + 1.0f - + 0.0f ), ( float )( u0 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + 1.0f ), ( float )( y + h + yo ), ( float )( z + 1.0f - + r ), ( float )( u0 ), ( float )( v0 ) ); + } + if ( Tile::fire->canBurn( level, x, y + 1.0f, z ) ) + { + double x0 = x + 0.5f + 0.5f; + double x1 = x + 0.5f - 0.5f; + double z0 = z + 0.5f + 0.5f; + double z1 = z + 0.5f - 0.5f; + + double x0_ = x + 0.5f - 0.5f; + double x1_ = x + 0.5f + 0.5f; + double z0_ = z + 0.5f - 0.5f; + double z1_ = z + 0.5f + 0.5f; + + // tex = firstTex; + u0 = (xt) / 256.0f; + u1 = (xt + 15.99f) / 256.0f; + v0 = (yt) / 256.0f; + v1 = (yt + 15.99f) / 256.0f; + + y += 1; + h = -0.2f; + + if ( ( ( x + y + z ) & 1 ) == 0 ) + { + t.vertexUV( ( float )( x0_ ), ( float )( y + h ), ( float )( z + + 0 ), ( float )( u1 ), ( float )( v0 ) ); + t.vertexUV( ( float )( x0 ), ( float )( y + 0 ), ( float )( z + + 0 ), ( float )( u1 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x0 ), ( float )( y + 0 ), ( float )( z + + 1 ), ( float )( u0 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x0_ ), ( float )( y + h ), ( float )( z + + 1 ), ( float )( u0 ), ( float )( v0 ) ); + +// tex = secondTex; + u0 = (xt) / 256.0f; + u1 = (xt + 15.99f) / 256.0f; + v0 = (yt) / 256.0f; + v1 = (yt + 15.99f) / 256.0f; + + t.vertexUV( ( float )( x1_ ), ( float )( y + h ), ( float )( z + + 1.0f ), ( float )( u1 ), ( float )( v0 ) ); + t.vertexUV( ( float )( x1 ), ( float )( y + 0.0f ), ( float )( z + + 1.0f ), ( float )( u1 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x1 ), ( float )( y + 0.0f ), ( float )( z + + 0 ), ( float )( u0 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x1_ ), ( float )( y + h ), ( float )( z + + 0 ), ( float )( u0 ), ( float )( v0 ) ); + } + else + { + t.vertexUV( ( float )( x + 0.0f ), ( float )( y + + h ), ( float )( z1_ ), ( float )( u1 ), ( float )( v0 ) ); + t.vertexUV( ( float )( x + 0.0f ), ( float )( y + + 0.0f ), ( float )( z1 ), ( float )( u1 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + 1.0f ), ( float )( y + + 0.0f ), ( float )( z1 ), ( float )( u0 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + 1.0f ), ( float )( y + + h ), ( float )( z1_ ), ( float )( u0 ), ( float )( v0 ) ); + +// tex = secondTex; + u0 = (xt) / 256.0f; + u1 = (xt + 15.99f) / 256.0f; + v0 = (yt) / 256.0f; + v1 = (yt + 15.99f) / 256.0f; + + t.vertexUV( ( float )( x + 1.0f ), ( float )( y + + h ), ( float )( z0_ ), ( float )( u1 ), ( float )( v0 ) ); + t.vertexUV( ( float )( x + 1.0f ), ( float )( y + + 0.0f ), ( float )( z0 ), ( float )( u1 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + 0.0f ), ( float )( y + + 0.0f ), ( float )( z0 ), ( float )( u0 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + 0.0f ), ( float )( y + + h ), ( float )( z0_ ), ( float )( u0 ), ( float )( v0 ) ); + } + } + } + + return true; + +} + + bool TileRenderer::tesselateLadderInWorld( Tile* tt, int x, int y, int z ) { Tesselator& t = Tesselator::instance; diff --git a/src/client/renderer/TileRenderer.h b/src/client/renderer/TileRenderer.h index 02420dd..83351bd 100755 --- a/src/client/renderer/TileRenderer.h +++ b/src/client/renderer/TileRenderer.h @@ -34,6 +34,8 @@ public: bool tesselateFenceGateInWorld(FenceGateTile* tt, int x, int y, int z); bool tesselateBedInWorld(Tile *tt, int x, int y, int z); bool tesselateRowInWorld(Tile* tt, int x, int y, int z); + bool tesselateFireInWorld(Tile* tt, int x, int y, int z); + void tesselateTorch(Tile* tt, float x, float y, float z, float xxa, float zza); void tesselateCrossTexture(Tile* tt, int data, float x, float y, float z); diff --git a/src/client/renderer/ptexture/DynamicTexture.cpp b/src/client/renderer/ptexture/DynamicTexture.cpp index e3b7b47..c3436e4 100755 --- a/src/client/renderer/ptexture/DynamicTexture.cpp +++ b/src/client/renderer/ptexture/DynamicTexture.cpp @@ -206,3 +206,93 @@ void WaterSideTexture::tick() { pixels[i * 4 + 3] = a; } } + +FireTexture::FireTexture() +: super(((Tile*)Tile::fire)->tex), + _tick(0), + _frame(0) +{ + current = new float[16*20]; + next = new float[16*20]; + heat = new float[16*20]; + heata = new float[16*20]; + + for (int i = 0; i < 256; ++i) { + current[i] = 0; + next[i] = 0; + heat[i] = 0; + heata[i] = 0; + } +} + +FireTexture::~FireTexture() { + delete[] current; + delete[] next; + delete[] heat; + delete[] heata; +} + + +// oh boy time to implement fire textures, i am so fucked - shredder + +void FireTexture::tick() { +// loop generates fire texture on the empty texture grid, hopefully shouldnt be too taxing on older hardware - shredder + for (int x = 0; x < 16; x++) { + for (int y = 0; y < 20; y++) { + int count = 18; + float pow = this->current[x + (y + 1) % 20 * 16] * (float)(count); + for (int xx = x - 1; xx <= x + 1; xx++) { + for (int yy = y; yy <= y + 1; yy++) { + if (xx >= 0 && yy >= 0 && xx < 16 && yy < 20) { + pow += this->current[xx + yy * 16]; + } + count++; + } + } + this->next[x + y * 16] = pow / (float(count) * 1.06f); + if (y >= 19) { + this->next[x + y * 16] = float(Mth::random() * Mth::random() * Mth::random() * 4.0 + Mth::random() * 0.1f + 0.2f); + } + } + } + + // hopefully this doesn't cause any mysterious issues - shredder + float* tmp = next; + next = current; + current = tmp; + + for (int i = 0; i < 256; i++) { + float pow = this->current[i] * 1.8f; + if (pow > 1.0f) { + pow = 1.0f; + } + if (pow < 0.0f) { + pow = 0.0f; + } + + + int r = (int) (pow * 155.0f + 100.0f); + int g = (int)(pow * pow * 255.0f); + int b = (int)(pow * pow * pow * pow * pow * pow * pow * pow * pow * pow * 255.0f); + int a = 255; + if (pow < 0.5f) { + a = 0; + } + + // @TODO: cant be arsed rn to implement the anaglyph3d check would be nice to check if it does - shredder + //if (this->anaglyph3d) { + // float rr = (r * 30 + g * 59 + b * 11) / 100; + // float gg = (r * 30 + g * 70) / 100; + // float bb = (r * 30 + b * 70) / 100; + // r = rr; + // g = gg; + // b = bb; + //} + + pixels[i * 4 + 0] = r; + pixels[i * 4 + 1] = g; + pixels[i * 4 + 2] = b; + pixels[i * 4 + 3] = a; + + } +} \ No newline at end of file diff --git a/src/client/renderer/ptexture/DynamicTexture.h b/src/client/renderer/ptexture/DynamicTexture.h index c95b3d7..a28f75a 100755 --- a/src/client/renderer/ptexture/DynamicTexture.h +++ b/src/client/renderer/ptexture/DynamicTexture.h @@ -56,4 +56,21 @@ public: void tick(); }; +class FireTexture: public DynamicTexture +{ + typedef DynamicTexture super; + int _tick; + int _frame; + + float* current; + float* next; + float* heat; + float* heata; + +public: + FireTexture(); + ~FireTexture(); + + void tick(); +}; #endif /*NET_MINECRAFT_CLIENT_RENDERER_PTEXTURE__DynamicTexture_H__*/ diff --git a/src/world/level/Level.cpp b/src/world/level/Level.cpp index 96255eb..c9132f5 100755 --- a/src/world/level/Level.cpp +++ b/src/world/level/Level.cpp @@ -1599,8 +1599,8 @@ bool Level::containsFireTile(const AABB& box) { for (int z = z0; z < z1; z++) { int t = getTile(x, y, z); - if (/*t == ((Tile*)(Tile::fire))->id - ||*/ t == Tile::lava->id + if (t == ((Tile*)(Tile::fire))->id + || t == Tile::lava->id || t == Tile::calmLava->id) { return true; } diff --git a/src/world/level/tile/FireTile.h b/src/world/level/tile/FireTile.h index fb815c4..5dab2f0 100755 --- a/src/world/level/tile/FireTile.h +++ b/src/world/level/tile/FireTile.h @@ -38,7 +38,7 @@ public: setFlammable(Tile::tnt->id, FLAME_MEDIUM, BURN_INSTANT); setFlammable(Tile::cloth->id, FLAME_EASY, BURN_EASY); - //setTicking(true); //@fire + setTicking(true); //@fire } AABB* getAABB(Level* level, int x, int y, int z) { @@ -70,9 +70,9 @@ public: } void tick(Level* level, int x, int y, int z, Random* random) { - return; //@fire + - bool infiniBurn = false;//level->getTile(x, y - 1, z) == Tile::hellRock->id; + bool infiniBurn = level->getTile(x, y - 1, z) == Tile::netherrack->id; int age = level->getData(x, y, z); if (age < 15) { @@ -148,7 +148,6 @@ public: } void neighborChanged(Level* level, int x, int y, int z, int type) { - return; //@fire if (!level->isSolidBlockingTile(x, y - 1, z) && !isValidFireLocation(level, x, y, z)) { level->setTile(x, y, z, 0); return; @@ -156,7 +155,6 @@ public: } void onPlace(Level* level, int x, int y, int z) { - return; //@fire if (!level->isSolidBlockingTile(x, y - 1, z) && !isValidFireLocation(level, x, y, z)) { level->setTile(x, y, z, 0); return; @@ -169,7 +167,6 @@ public: } void ignite(Level* level, int x, int y, int z) { - return; //@fire bool lit = false; if (!lit) lit = tryIgnite(level, x, y + 1, z); @@ -184,11 +181,10 @@ public: } void animateTick(Level* level, int x, int y, int z, Random* random) { - return; //@fire - //if (random.nextInt(24) == 0) { - // level->playSound(x + 0.5f, y + 0.5f, z + 0.5f, "fire.fire", 1 + random.nextFloat(), random.nextFloat() * 0.7f + 0.3f); - //} + if (random->nextInt(24) == 0) { + level->playSound(x + 0.5f, y + 0.5f, z + 0.5f, "fire.fire", 1 + random->nextFloat(), random->nextFloat() * 0.7f + 0.3f); + } if (level->isSolidBlockingTile(x, y - 1, z) || Tile::fire->canBurn(level, x, y - 1, z)) { for (int i = 0; i < 3; i++) { @@ -248,7 +244,6 @@ private: } void checkBurn(Level* level, int x, int y, int z, int chance, Random* random) { - return; //@fire int odds = burnOdds[level->getTile(x, y, z)]; if (random->nextInt(chance) < odds) { @@ -265,7 +260,6 @@ private: } bool isValidFireLocation(Level* level, int x, int y, int z) { - return false; //@fire if (canBurn(level, x + 1, y, z)) return true; if (canBurn(level, x - 1, y, z)) return true; @@ -278,7 +272,6 @@ private: } int getFireOdds(Level* level, int x, int y, int z) { - return 0; //@fire int odds = 0; if (!level->isEmptyTile(x, y, z)) return 0; @@ -294,7 +287,6 @@ private: } bool tryIgnite(Level* level, int x, int y, int z) { - return false; //@fire int t = level->getTile(x, y, z); if (t == Tile::fire->id) return true; From 27f0287986332175f9f19176efeb7d5fd9acb709 Mon Sep 17 00:00:00 2001 From: Shredder Date: Wed, 1 Apr 2026 23:31:15 +0500 Subject: [PATCH 02/33] Ported over Spooner Trees (Fancy Trees), Flint and Steel can be used to ignite fire now and modified Forest and Rainforest to generate spooner trees. --- src/world/level/levelgen/feature/BasicTree.h | 593 +++++++++++++++++++ 1 file changed, 593 insertions(+) create mode 100644 src/world/level/levelgen/feature/BasicTree.h diff --git a/src/world/level/levelgen/feature/BasicTree.h b/src/world/level/levelgen/feature/BasicTree.h new file mode 100644 index 0000000..7b6db51 --- /dev/null +++ b/src/world/level/levelgen/feature/BasicTree.h @@ -0,0 +1,593 @@ +#ifndef NET_MINECRAFT_WORLD_LEVEL_LEVELGEN_FEATURE__BasicTree_H__ +#define NET_MINECRAFT_WORLD_LEVEL_LEVELGEN_FEATURE__BasicTree_H__ + +//package net.minecraft.world.level.levelgen.feature; + +#include "Feature.h" + +#include "../../../../util/Random.h" +#include "../../Level.h" + +#include "../../tile/TreeTile.h" + +class Level; + +class BasicTree : public Feature +{ + typedef Feature super; +private: + + + + // The axisConversionArray, when given a primary index, allows easy + // access to the indices of the other two axies. Access the data at the + // primary index location to get the horizontal secondary axis. + // Access the data at the primary location plus three to get the + // remaining, tertiary, axis. + // All directions are specified by an index, 0, 1, or 2 which + // correspond to x, y, and z. + // The axisConversionArray is used in several places + // notably the crossection and taperedLimb methods. + // Example: + // If the primary axis is z, then the primary index is 2. + // The secondary index is axisConversionArray[2] which is 0, + // the index for the x axis. + // The remaining axis is axisConversionArray[2 + 3] which is 1, + // the index for the y axis. + // Using this method, the secondary axis will always be horizontal (x or z), + // and the tertiary always vertical (y), if possible. + unsigned char axisConversionArray[6]; + + // Set up the pseudorandom number generator + Random *rnd; + + // Make fields to hold the level data and the random seed + Level *thisLevel; + + // Field to hold the tree origin, x y and z. + int origin[3]; + // Field to hold the tree height. + int height; + // Other important tree information. + int trunkHeight; + double trunkHeightScale; + double branchDensity; + double branchSlope; + double widthScale; + double foliageDensity; + int trunkWidth; + int heightVariance; + int foliageHeight; + // The foliage coordinates are a list of [x,y,z,y of branch base] values for each cluster + int **foliageCoords; + int foliageCoordsLength; + void prepare(){ + // Initialize the instance variables. + // Populate the list of foliage cluster locations. + // Designed to be overridden in child classes to change basic + // tree properties (trunk width, branch angle, foliage density, etc..). + trunkHeight = (int) (height * trunkHeightScale); + if (trunkHeight >= height) trunkHeight = height - 1; + int clustersPerY = (int) (1.382 + pow(foliageDensity * height / 13.0, 2)); + if (clustersPerY < 1) clustersPerY = 1; + // The foliage coordinates are a list of [x,y,z,y of branch base] values for each cluster + int **tempFoliageCoords = new int *[clustersPerY * height]; + for( int i = 0; i < clustersPerY * height; i++ ) + { + tempFoliageCoords[i] = new int[4]; + } + int y = origin[1] + height - foliageHeight; + int clusterCount = 1; + int trunkTop = origin[1] + trunkHeight; + int relativeY = y - origin[1]; + + tempFoliageCoords[0][0] = origin[0]; + tempFoliageCoords[0][1] = y; + tempFoliageCoords[0][2] = origin[2]; + tempFoliageCoords[0][3] = trunkTop; + y--; + + while (relativeY >= 0) + { + int num = 0; + + float shapefac = treeShape(relativeY); + if (shapefac < 0) + { + y--; + relativeY--; + continue; + } + + // The originOffset is to put the value in the middle of the block. + double originOffset = 0.5; + while (num < clustersPerY) + { + double radius = widthScale * (shapefac * (rnd->nextFloat() + 0.328)); + double angle = rnd->nextFloat() * 2.0 * 3.14159; + int x = Mth::floor(radius * sin(angle) + origin[0] + originOffset); + int z = Mth::floor(radius * cos(angle) + origin[2] + originOffset); + int checkStart[] = { x, y, z }; + int checkEnd[] = { x, y + foliageHeight, z }; + // check the center column of the cluster for obstructions. + if (checkLine(checkStart, checkEnd) == -1) { + // If the cluster can be created, check the branch path + // for obstructions. + int checkBranchBase[] = { origin[0], origin[1], origin[2] }; + double distance = sqrt(pow(abs(origin[0] - checkStart[0]), 2.0) + pow(abs(origin[2] - checkStart[2]), 2.0)); + double branchHeight = distance * branchSlope; + if ((checkStart[1] - branchHeight) > trunkTop) + { + checkBranchBase[1] = trunkTop; + } + else + { + checkBranchBase[1] = (int) (checkStart[1] - branchHeight); + } + // Now check the branch path + if (checkLine(checkBranchBase, checkStart) == -1) + { + // If the branch path is clear, add the position to the list + // of foliage positions + tempFoliageCoords[clusterCount][0] = x; + tempFoliageCoords[clusterCount][1] = y; + tempFoliageCoords[clusterCount][2] = z; + tempFoliageCoords[clusterCount][3] = checkBranchBase[1]; + clusterCount++; + } + } + num++; + } + y--; + relativeY--; + } + // 4J Stu - Rather than copying the array, we are storing the number of valid elements in the array + foliageCoordsLength = clusterCount; + foliageCoords = tempFoliageCoords; + // Delete the rest of the array whilst we still know how big it was + for( int i = clusterCount; i < clustersPerY * height; i++ ) + { + delete [] tempFoliageCoords[i]; + tempFoliageCoords[i] = NULL; + } + // 4J - original code for above is the following, it isn't obvious to me why it is doing a copy of the array, so let's not for now + // foliageCoords = new int[clusterCount][4]; + // System.arraycopy(tempFoliageCoords, 0, foliageCoords, 0, clusterCount); + + } + + void crossection(int x, int y, int z, float radius, byte direction, int material) + { + + // Create a circular cross section. + // + // Used to nearly everything in the foliage, branches, and trunk. + // This is a good target for performance optimization. + + // Passed values: + // x,y,z is the center location of the cross section + // radius is the radius of the section from the center + // direction is the direction the cross section is pointed, 0 for x, 1 for y, 2 for z + // material is the index number for the material to use + int rad = (int) (radius + 0.618); + byte secidx1 = axisConversionArray[direction]; + byte secidx2 = axisConversionArray[direction + 3]; + int center[] = { x, y, z }; + int position[] = { 0, 0, 0 }; + int offset1 = -rad; + int offset2 = -rad; + int thismat; + position[direction] = center[direction]; + while (offset1 <= rad) + { + position[secidx1] = center[secidx1] + offset1; + offset2 = -rad; + while (offset2 <= rad) + { + double thisdistance = pow(abs(offset1) + 0.5, 2) + pow(abs(offset2) + 0.5, 2); + if (thisdistance > radius * radius) + { + offset2++; + continue; + } + position[secidx2] = center[secidx2] + offset2; + + thismat = thisLevel->getTile(position[0], position[1], position[2]); + + if (!((thismat == 0) || (thismat == Tile::leaves->id))) + { + // If the material of the checked block is anything other than + // air or foliage, skip this tile. + offset2++; + continue; + } + + placeBlock(thisLevel, position[0], position[1], position[2], material, 0); + + offset2++; + } + offset1++; + } + + } + float treeShape(int y){ + // Take the y position relative to the base of the tree. + // Return the distance the foliage should be from the trunk axis. + // Return a negative number if foliage should not be created at this height. + // This method is intended for overriding in child classes, allowing + // different shaped trees. + // This method should return a consistent value for each y (don't randomize). + if (y < (((float) height) * 0.3)) return (float) -1.618; + float radius = ((float) height) / ((float) 2.0); + float adjacent = (((float) height) / ((float) 2.0)) - y; + float distance; + if (adjacent == 0) distance = radius; + else if (abs(adjacent) >= radius) distance = (float) 0.0; + else distance = (float) sqrt(pow(abs(radius), 2) - pow(abs(adjacent), 2)); + // Alter this factor to change the overall width of the tree. + distance *= (float) 0.5; + return distance; + } + float foliageShape(int y){ + // Take the y position relative to the base of the foliage cluster. + // Return the radius of the cluster at this y + // Return a negative number if no foliage should be created at this level + // this method is intended for overriding in child classes, allowing + // foliage of different sizes and shapes. + if ((y < 0) || (y >= foliageHeight)) return (float) -1; + else if ((y == 0) || (y == (foliageHeight - 1))) return (float) 2; + else return (float) 3; + } + void foliageCluster(int x, int y, int z){ + + // Generate a cluster of foliage, with the base at x, y, z. + // The shape of the cluster is derived from foliageShape + // crossection is called to make each level. + int topy = y + foliageHeight; + int cury = topy - 1; + float radius; + // 4J Stu - Generate foliage from the top down so that we don't keep recalculating heightmaps + while (cury >= y) + { + radius = foliageShape(cury - y); + crossection(x, cury, z, radius, (byte) 1, Tile::leaves->id); + cury--; + } + + } + void limb(int *start, int *end, int material) + { + // Create a limb from the start position to the end position. + // Used for creating the branches and trunk. + + // Populate delta, the difference between start and end for all three axies. + // Set primidx to the index with the largest overall distance traveled. + int delta[] = { 0, 0, 0 }; + byte idx = 0; + byte primidx = 0; + while (idx < 3) + { + delta[idx] = end[idx] - start[idx]; + if (abs(delta[idx]) > abs(delta[primidx])) + { + primidx = idx; + } + idx++; + } + // If the largest distance is zero, don't bother to do anything else. + if (delta[primidx] == 0) return; + // set up the other two axis indices. + byte secidx1 = axisConversionArray[primidx]; + byte secidx2 = axisConversionArray[primidx + 3]; + // primsign is digit 1 or -1 depending on whether the limb is headed + // along the positive or negative primidx axis. + char primsign; + if (delta[primidx] > 0) primsign = 1; + else primsign = -1; + // Initilize the per-step movement for the non-primary axies. + double secfac1 = ((double) delta[secidx1]) / ((double) delta[primidx]); + double secfac2 = ((double) delta[secidx2]) / ((double) delta[primidx]); + // Initialize the coordinates. + int coordinate[] = { 0, 0, 0 }; + // Loop through each crossection along the primary axis, from start to end + int primoffset = 0; + int endoffset = delta[primidx] + primsign; + while (primoffset != endoffset) + { + coordinate[primidx] = Mth::floor(start[primidx] + primoffset + 0.5); + coordinate[secidx1] = Mth::floor(start[secidx1] + (primoffset * secfac1) + 0.5); + coordinate[secidx2] = Mth::floor(start[secidx2] + (primoffset * secfac2) + 0.5); + + int dir = 0; + int xdiff = abs(coordinate[0] - start[0]); + int zdiff = abs(coordinate[2] - start[2]); + int maxdiff = max(xdiff, zdiff); + + if (maxdiff > 0) + { + if (xdiff == maxdiff) + { + dir = 0; + } + else if (zdiff == maxdiff) + { + dir = 0; + } + } + placeBlock(thisLevel, coordinate[0], coordinate[1], coordinate[2], material, dir); + primoffset += primsign; + } + } + void makeFoliage(){ + // Create the tree foliage. + // Call foliageCluster at the correct locations + int idx = 0; + int finish = foliageCoordsLength; + while (idx < finish) + { + int x = foliageCoords[idx][0]; + int y = foliageCoords[idx][1]; + int z = foliageCoords[idx][2]; + foliageCluster(x, y, z); + idx++; + } + } + bool trimBranches(int localY){ + // For larger trees, randomly "prune" the branches so there + // aren't too many. + // Return true if the branch should be created. + // This method is intended for overriding in child classes, allowing + // decent amounts of branches on very large trees. + // Can also be used to disable branches on some tree types, or + // make branches more sparse. + if (localY < (height * 0.2)) return false; + else return true; + } + void makeTrunk(){ + // Create the trunk of the tree. + int x = origin[0]; + int startY = origin[1]; + int topY = origin[1] + trunkHeight; + int z = origin[2]; + int startCoord[] = { x, startY, z }; + int endCoord[] = { x, topY, z }; + limb(startCoord, endCoord, Tile::treeTrunk->id); + if (trunkWidth == 2) + { + startCoord[0] += 1; + endCoord[0] += 1; + limb(startCoord, endCoord, Tile::treeTrunk->id); + startCoord[2] += 1; + endCoord[2] += 1; + limb(startCoord, endCoord, Tile::treeTrunk->id); + startCoord[0] += -1; + endCoord[0] += -1; + limb(startCoord, endCoord, Tile::treeTrunk->id); + } + } + void makeBranches(){ + // Create the tree branches. + // Call trimBranches for each branch to see if you should create it. + // Call taperedLimb to the correct locations + int idx = 0; + int finish = foliageCoordsLength; + int baseCoord[] = { origin[0], origin[1], origin[2] }; + while (idx < finish) + { + int *coordValues = foliageCoords[idx]; + int endCoord[] = { coordValues[0], coordValues[1], coordValues[2] }; + baseCoord[1] = coordValues[3]; + int localY = baseCoord[1] - origin[1]; + if (trimBranches(localY)) + { + limb(baseCoord, endCoord, Tile::treeTrunk->id); + } + idx++; + } + } + int checkLine(int *start, int *end){ + // Check from coordinates start to end (both inclusive) for blocks other than air and foliage + // If a block other than air and foliage is found, return the number of steps taken. + // If no block other than air and foliage is found, return -1. + // Examples: + // If the third block searched is stone, return 2 + // If the first block searched is lava, return 0 + + int delta[] = { 0, 0, 0 }; + byte idx = 0; + byte primidx = 0; + while (idx < 3) + { + delta[idx] = end[idx] - start[idx]; + if (abs(delta[idx]) > abs(delta[primidx])) + { + primidx = idx; + } + idx++; + } + // If the largest distance is zero, don't bother to do anything else. + if (delta[primidx] == 0) return -1; + // set up the other two axis indices. + byte secidx1 = axisConversionArray[primidx]; + byte secidx2 = axisConversionArray[primidx + 3]; + // primsign is digit 1 or -1 depending on whether the limb is headed + // along the positive or negative primidx axis. + char primsign; // 4J Stu - Was byte, but we use in a sum below and byte=unsigned char so we were setting endoffset incorrectly + if (delta[primidx] > 0) primsign = 1; + else primsign = -1; + // Initilize the per-step movement for the non-primary axies. + double secfac1 = ((double) delta[secidx1]) / ((double) delta[primidx]); + double secfac2 = ((double) delta[secidx2]) / ((double) delta[primidx]); + // Initialize the coordinates. + int coordinate[] = { 0, 0, 0 }; + // Loop through each crossection along the primary axis, from start to end + int primoffset = 0; + int endoffset = delta[primidx] + primsign; + int thismat; + while (primoffset != endoffset) + { + coordinate[primidx] = start[primidx] + primoffset; + coordinate[secidx1] = Mth::floor(start[secidx1] + (primoffset * secfac1)); + coordinate[secidx2] = Mth::floor(start[secidx2] + (primoffset * secfac2)); + thismat = thisLevel->getTile(coordinate[0], coordinate[1], coordinate[2]); + if (!((thismat == 0) || (thismat == Tile::leaves->id))) + { + // If the material of the checked block is anything other than + // air or foliage, stop looking. + break; + } + primoffset += primsign; + } + // If you reached the end without finding anything, return -1. + if (primoffset == endoffset) + { + return -1; + } + // Otherwise, return the number of steps you took. + else + { + return abs(primoffset); + } + } + bool checkLocation(){ + // Return true if the tree can be placed here. + // Return false if the tree can not be placed here. + + // Examine the square under the trunk. Is it grass or dirt? + // If not, return false + // Examine center column for how tall the tree can be. + // If the checked height is shorter than height, but taller + // than 4, set the tree to the maximum height allowed. + // If the space is too short, return false. + int startPosition[] = { origin[0], origin[1], origin[2] }; + int endPosition[] = { origin[0], origin[1] + height - 1, origin[2] }; + + + // Check the location it is resting on + int baseMaterial = thisLevel->getTile(origin[0], origin[1] - 1, origin[2]); + if (!((baseMaterial == 2) || (baseMaterial == 3))) + { + return false; + } + int allowedHeight = checkLine(startPosition, endPosition); + // If the set height is good, go with that + if (allowedHeight == -1) + { + return true; + } + // If the space is too short, tell the build to abort + else if (allowedHeight < 6) + { + return false; + } + // If the space is shorter than the set height, but not too short + // shorten the height, and tell the build to continue + else + { + height = allowedHeight; + //System.out.println("Shortened the tree"); + return true; + } + } + +public: + BasicTree(bool doUpdate){ + axisConversionArray[0] = 2; + axisConversionArray[1] = 0; + axisConversionArray[2] = 0; + axisConversionArray[3] = 1; + axisConversionArray[4] = 2; + axisConversionArray[5] = 1; + rnd = new Random(); + origin[0] = 0; + origin[1] = 0; + origin[2] = 0; + // Field to hold the tree height. + height = 0; + // Other important tree information. + trunkHeight = 0; + trunkHeightScale = 0.618; + branchDensity = 1.0; + branchSlope = 0.381; + widthScale = 1.0; + foliageDensity = 1.0; + trunkWidth = 1; + heightVariance = 12; + foliageHeight = 4; + foliageCoords = NULL; + foliageCoordsLength = 0; + } + virtual ~BasicTree(){ + delete rnd; + + for( int i = 0; i < foliageCoordsLength; i++ ) + { + delete [] foliageCoords[i]; + } + delete [] foliageCoords; + } + + virtual void init(double heightInit, double widthInit, double foliageDensityInit){ + // all of the parameters should be from 0.0 to 1.0 + // heightInit scales the maximum overall height of the tree (still randomizes height within the possible range) + // widthInit scales the maximum overall width of the tree (keep this above 0.3 or so) + // foliageDensityInit scales how many foliage clusters are created. + // + // Note, you can call "place" without calling "init". + // This is the same as calling init(1.0,1.0,1.0) and then calling place. + heightVariance = (int) (heightInit * 12); + if (heightInit > 0.5) foliageHeight = 5; + widthScale = widthInit; + foliageDensity = foliageDensityInit; + } + virtual bool place(Level *level, Random *random, int x, int y, int z){ + // Note to Markus. + // currently the following fields are set randomly. If you like, make them + // parameters passed into "place". + // + // height: so the map generator can intelligently set the height of the tree, + // and make forests with large trees in the middle and smaller ones on the edges. + + // Initialize the instance fields for the level and the seed. + thisLevel = level; + __int64 seed = random->nextLong(); + rnd->setSeed(seed); + // Initialize the origin of the tree trunk + origin[0] = x; + origin[1] = y; + origin[2] = z; + // Sets the height. Take out this line if height is passed as a parameter + if (height == 0) + { + height = 5 + rnd->nextInt(heightVariance); + } + if (!(checkLocation())) + { + //System.out.println("Tree location failed"); + return false; + } + + //System.out.println("The height is"); + //System.out.println(height); + //System.out.println("Trunk Height check done"); + + prepare(); + + //System.out.println("Prepare done"); + + makeFoliage(); + + //System.out.println("Foliage done"); + + makeTrunk(); + + //System.out.println("Trunk done"); + + makeBranches(); + + //System.out.println("Branches done"); + + return true; + } +}; +#endif /*NET_MINECRAFT_WORLD_LEVEL_LEVELGEN_FEATURE__BasicTree_H__*/ \ No newline at end of file From 84e874438777bc762eb7522e902d77c73fc04896 Mon Sep 17 00:00:00 2001 From: Shredder Date: Wed, 1 Apr 2026 23:37:37 +0500 Subject: [PATCH 03/33] oops forgot to include the other files. --- src/client/renderer/TileRenderer.cpp | 35 +--- src/world/item/FlintAndSteelItem.h | 8 +- src/world/level/biome/Biome.cpp | 12 +- src/world/level/biome/Biome.h | 1 + src/world/level/biome/ForestBiome.h | 3 +- src/world/level/biome/RainforestBiome.h | 3 +- .../level/levelgen/RandomLevelSource.cpp | 12 ++ src/world/level/levelgen/feature/BasicTree.h | 171 ++---------------- 8 files changed, 51 insertions(+), 194 deletions(-) diff --git a/src/client/renderer/TileRenderer.cpp b/src/client/renderer/TileRenderer.cpp index cdbdc7d..0e53915 100755 --- a/src/client/renderer/TileRenderer.cpp +++ b/src/client/renderer/TileRenderer.cpp @@ -225,29 +225,16 @@ bool TileRenderer::tesselateTorchInWorld( Tile* tt, int x, int y, int z ) bool TileRenderer::tesselateFireInWorld( Tile* tt, int x, int y, int z ) { + // @todo: fire alpha transparency seems to be scuffed, also it seems i might have messed up the second layer while porting from lce/java , need to look into it - shredder + Tesselator& t = Tesselator::instance; - //Icon *firstTex = tt->getTextureLayer(0); - //Icon *secondTex = tt->getTextureLayer(1); - //Icon *tex = firstTex; int tex = tt->getTexture(0); -// if (hasFixedTexture()) tex = fixedTexture; if (fixedTexture >= 0) tex = fixedTexture; - -// t.color( 1.0f, 1.0f, 1.0f ); -// t.tex( getLightColor(tt, level, x, y, z ) ); - - - - - - - - - float br = tt->getBrightness( level, x, y, z ); - t.color( br, br, br ); + float br = tt->getBrightness( level, x, y, z ); + t.color( br, br, br ); int xt = ((tex & 0xf) << 4); int yt = tex & 0xf0; @@ -256,7 +243,7 @@ bool TileRenderer::tesselateFireInWorld( Tile* tt, int x, int y, int z ) float u1 = (xt + 15.99f) / 256.0f; float v0 = (yt) / 256.0f; float v1 = (yt + 15.99f) / 256.0f; - float h = 1.4f; + float h = 1.4f; if ( level->isSolidBlockingTile( x, y - 1, z ) || Tile::fire->canBurn( level, x, y - 1, z ) ) { @@ -280,11 +267,7 @@ bool TileRenderer::tesselateFireInWorld( Tile* tt, int x, int y, int z ) t.vertexUV( ( float )( x1 ), ( float )( y + 0 ), ( float )( z + 1 ), ( float )( u0 ), ( float )( v1 ) ); t.vertexUV( ( float )( x1_ ), ( float )( y + h ), ( float )( z + 1 ), ( float )( u0 ), ( float )( v0 ) ); - // tex = secondTex; -// u0 = tex->getU0(true); -// v0 = tex->getV0(true); -// u1 = tex->getU1(true); -// v1 = tex->getV1(true); + u0 = (xt) / 256.0f; u1 = (xt + 15.99f) / 256.0f; @@ -321,7 +304,7 @@ bool TileRenderer::tesselateFireInWorld( Tile* tt, int x, int y, int z ) t.vertexUV( ( float )( x1 ), ( float )( y + 0 ), ( float )( z + 0 ), ( float )( u1 ), ( float )( v1 ) ); t.vertexUV( ( float )( x1_ ), ( float )( y + h ), ( float )( z + 0 ), ( float )( u1 ), ( float )( v0 ) ); -// tex = firstTex; + u0 = (xt) / 256.0f; u1 = (xt + 15.99f) / 256.0f; v0 = (yt) / 256.0f; @@ -343,7 +326,6 @@ bool TileRenderer::tesselateFireInWorld( Tile* tt, int x, int y, int z ) float yo = 1 / 16.0f; if ( ( ( x + y + z ) & 1 ) == 1 ) { - // tex = secondTex; u0 = (xt) / 256.0f; u1 = (xt + 15.99f) / 256.0f; v0 = (yt) / 256.0f; @@ -447,7 +429,6 @@ bool TileRenderer::tesselateFireInWorld( Tile* tt, int x, int y, int z ) double z0_ = z + 0.5f - 0.5f; double z1_ = z + 0.5f + 0.5f; - // tex = firstTex; u0 = (xt) / 256.0f; u1 = (xt + 15.99f) / 256.0f; v0 = (yt) / 256.0f; @@ -467,7 +448,6 @@ bool TileRenderer::tesselateFireInWorld( Tile* tt, int x, int y, int z ) t.vertexUV( ( float )( x0_ ), ( float )( y + h ), ( float )( z + 1 ), ( float )( u0 ), ( float )( v0 ) ); -// tex = secondTex; u0 = (xt) / 256.0f; u1 = (xt + 15.99f) / 256.0f; v0 = (yt) / 256.0f; @@ -493,7 +473,6 @@ bool TileRenderer::tesselateFireInWorld( Tile* tt, int x, int y, int z ) t.vertexUV( ( float )( x + 1.0f ), ( float )( y + h ), ( float )( z1_ ), ( float )( u0 ), ( float )( v0 ) ); -// tex = secondTex; u0 = (xt) / 256.0f; u1 = (xt + 15.99f) / 256.0f; v0 = (yt) / 256.0f; diff --git a/src/world/item/FlintAndSteelItem.h b/src/world/item/FlintAndSteelItem.h index 45458e7..701fc96 100755 --- a/src/world/item/FlintAndSteelItem.h +++ b/src/world/item/FlintAndSteelItem.h @@ -19,7 +19,7 @@ public: setMaxDamage(64); } - /* + bool useOn(ItemInstance* instance, Player* player, Level* level, int x, int y, int z, int face, float clickX, float clickY, float clickZ) { if (face == 0) y--; if (face == 1) y++; @@ -30,14 +30,14 @@ public: int targetType = level->getTile(x, y, z); if (targetType == 0) { - level->playSound(x + 0.5, y + 0.5, z + 0.5, "fire.ignite", 1, sharedRandom.nextFloat() * 0.4f + 0.8f); - level->setTile(x, y, z, Tile::fire->id); + level->playSound(x + 0.5, y + 0.5, z + 0.5, "fire.ignite", 1, random.nextFloat() * 0.4f + 0.8f); + level->setTile(x, y, z, ((Tile*)Tile::fire)->id); } instance->hurt(1); return true; } - */ + }; #endif /*NET_MINECRAFT_WORLD_ITEM__FlintAndSteelItem_H__*/ diff --git a/src/world/level/biome/Biome.cpp b/src/world/level/biome/Biome.cpp index d0a842a..7ccbdfe 100755 --- a/src/world/level/biome/Biome.cpp +++ b/src/world/level/biome/Biome.cpp @@ -2,6 +2,7 @@ #include "../levelgen/feature/TreeFeature.h" #include "../levelgen/feature/TallgrassFeature.h" +#include "../levelgen/feature/BasicTree.h" #include "../../entity/EntityTypes.h" #include "../../entity/MobCategory.h" @@ -140,7 +141,7 @@ void Biome::teardownBiomes() { Feature* Biome::getTreeFeature( Random* random ) { if (random->nextInt(10) == 0) { - //return /*new*/ BasicTree(); + return new BasicTree(false); } return new TreeFeature(false); } @@ -148,6 +149,15 @@ Feature* Biome::getGrassFeature( Random* random ) { return new TallgrassFeature(Tile::tallgrass->id, TallGrass::TALL_GRASS); } +Feature* Biome::getBasicTreeFeature( Random* random ) +{ + if (random->nextInt(10) == 0) { + return new BasicTree(false); + } + +} + + Biome* Biome::getBiome( float temperature, float downfall ) { int a = (int) (temperature * 63); diff --git a/src/world/level/biome/Biome.h b/src/world/level/biome/Biome.h index 48a49d5..23fd495 100755 --- a/src/world/level/biome/Biome.h +++ b/src/world/level/biome/Biome.h @@ -71,6 +71,7 @@ public: virtual Feature* getTreeFeature(Random* random); virtual Feature* getGrassFeature(Random* random); + virtual Feature* getBasicTreeFeature(Random* random); static Biome* getBiome(float temperature, float downfall); static Biome* _getBiome(float temperature, float downfall); diff --git a/src/world/level/biome/ForestBiome.h b/src/world/level/biome/ForestBiome.h index dbc38e5..fa47dc0 100755 --- a/src/world/level/biome/ForestBiome.h +++ b/src/world/level/biome/ForestBiome.h @@ -6,6 +6,7 @@ #include "Biome.h" #include "../levelgen/feature/TreeFeature.h" #include "../levelgen/feature/BirchFeature.h" +#include "../levelgen/feature/BasicTree.h" class ForestBiome: public Biome { @@ -15,7 +16,7 @@ public: return new BirchFeature(); } if (random->nextInt(3) == 0) { - //return new BasicTree(); + return new BasicTree(false); } return new TreeFeature(false); } diff --git a/src/world/level/biome/RainforestBiome.h b/src/world/level/biome/RainforestBiome.h index 153ed61..cc80e84 100755 --- a/src/world/level/biome/RainforestBiome.h +++ b/src/world/level/biome/RainforestBiome.h @@ -6,13 +6,14 @@ #include "Biome.h" #include "../../../util/Random.h" #include "../levelgen/feature/TreeFeature.h" +#include "../levelgen/feature/BasicTree.h" class RainforestBiome: public Biome { public: Feature* getTreeFeature(Random* random) { if (random->nextInt(3) == 0) { - //return new BasicTree(); + return new BasicTree(false); } return new TreeFeature(false); } diff --git a/src/world/level/levelgen/RandomLevelSource.cpp b/src/world/level/levelgen/RandomLevelSource.cpp index 7ef40e3..56f5b8b 100755 --- a/src/world/level/levelgen/RandomLevelSource.cpp +++ b/src/world/level/levelgen/RandomLevelSource.cpp @@ -370,6 +370,18 @@ void RandomLevelSource::postProcess(ChunkSource* parent, int xt, int zt) { } //printf("placing tree at %d, %d, %d\n", x, y, z); } + // for (int i = 0; i < forests; i++) { + // int x = xo + random.nextInt(16) + 8; + // int z = zo + random.nextInt(16) + 8; + //int y = level->getHeightmap(x, z); + // Feature* tree = biome->getBasicTreeFeature(&random); + //if (tree) { + // tree->init(1, 1, 1); + // tree->place(level, &random, x, y, z); + // delete tree; + //} + ////printf("placing tree at %d, %d, %d\n", x, y, z); + // } for (int i = 0; i < 2; i++) { int x = xo + random.nextInt(16) + 8; diff --git a/src/world/level/levelgen/feature/BasicTree.h b/src/world/level/levelgen/feature/BasicTree.h index 7b6db51..48f80e7 100644 --- a/src/world/level/levelgen/feature/BasicTree.h +++ b/src/world/level/levelgen/feature/BasicTree.h @@ -19,36 +19,11 @@ private: - // The axisConversionArray, when given a primary index, allows easy - // access to the indices of the other two axies. Access the data at the - // primary index location to get the horizontal secondary axis. - // Access the data at the primary location plus three to get the - // remaining, tertiary, axis. - // All directions are specified by an index, 0, 1, or 2 which - // correspond to x, y, and z. - // The axisConversionArray is used in several places - // notably the crossection and taperedLimb methods. - // Example: - // If the primary axis is z, then the primary index is 2. - // The secondary index is axisConversionArray[2] which is 0, - // the index for the x axis. - // The remaining axis is axisConversionArray[2 + 3] which is 1, - // the index for the y axis. - // Using this method, the secondary axis will always be horizontal (x or z), - // and the tertiary always vertical (y), if possible. unsigned char axisConversionArray[6]; - - // Set up the pseudorandom number generator Random *rnd; - - // Make fields to hold the level data and the random seed Level *thisLevel; - - // Field to hold the tree origin, x y and z. int origin[3]; - // Field to hold the tree height. int height; - // Other important tree information. int trunkHeight; double trunkHeightScale; double branchDensity; @@ -58,19 +33,13 @@ private: int trunkWidth; int heightVariance; int foliageHeight; - // The foliage coordinates are a list of [x,y,z,y of branch base] values for each cluster int **foliageCoords; int foliageCoordsLength; void prepare(){ - // Initialize the instance variables. - // Populate the list of foliage cluster locations. - // Designed to be overridden in child classes to change basic - // tree properties (trunk width, branch angle, foliage density, etc..). trunkHeight = (int) (height * trunkHeightScale); if (trunkHeight >= height) trunkHeight = height - 1; int clustersPerY = (int) (1.382 + pow(foliageDensity * height / 13.0, 2)); if (clustersPerY < 1) clustersPerY = 1; - // The foliage coordinates are a list of [x,y,z,y of branch base] values for each cluster int **tempFoliageCoords = new int *[clustersPerY * height]; for( int i = 0; i < clustersPerY * height; i++ ) { @@ -99,7 +68,6 @@ private: continue; } - // The originOffset is to put the value in the middle of the block. double originOffset = 0.5; while (num < clustersPerY) { @@ -109,10 +77,7 @@ private: int z = Mth::floor(radius * cos(angle) + origin[2] + originOffset); int checkStart[] = { x, y, z }; int checkEnd[] = { x, y + foliageHeight, z }; - // check the center column of the cluster for obstructions. if (checkLine(checkStart, checkEnd) == -1) { - // If the cluster can be created, check the branch path - // for obstructions. int checkBranchBase[] = { origin[0], origin[1], origin[2] }; double distance = sqrt(pow(abs(origin[0] - checkStart[0]), 2.0) + pow(abs(origin[2] - checkStart[2]), 2.0)); double branchHeight = distance * branchSlope; @@ -124,11 +89,8 @@ private: { checkBranchBase[1] = (int) (checkStart[1] - branchHeight); } - // Now check the branch path if (checkLine(checkBranchBase, checkStart) == -1) { - // If the branch path is clear, add the position to the list - // of foliage positions tempFoliageCoords[clusterCount][0] = x; tempFoliageCoords[clusterCount][1] = y; tempFoliageCoords[clusterCount][2] = z; @@ -141,34 +103,22 @@ private: y--; relativeY--; } - // 4J Stu - Rather than copying the array, we are storing the number of valid elements in the array + foliageCoordsLength = clusterCount; foliageCoords = tempFoliageCoords; - // Delete the rest of the array whilst we still know how big it was + for( int i = clusterCount; i < clustersPerY * height; i++ ) { delete [] tempFoliageCoords[i]; tempFoliageCoords[i] = NULL; } - // 4J - original code for above is the following, it isn't obvious to me why it is doing a copy of the array, so let's not for now - // foliageCoords = new int[clusterCount][4]; - // System.arraycopy(tempFoliageCoords, 0, foliageCoords, 0, clusterCount); + } void crossection(int x, int y, int z, float radius, byte direction, int material) { - // Create a circular cross section. - // - // Used to nearly everything in the foliage, branches, and trunk. - // This is a good target for performance optimization. - - // Passed values: - // x,y,z is the center location of the cross section - // radius is the radius of the section from the center - // direction is the direction the cross section is pointed, 0 for x, 1 for y, 2 for z - // material is the index number for the material to use int rad = (int) (radius + 0.618); byte secidx1 = axisConversionArray[direction]; byte secidx2 = axisConversionArray[direction + 3]; @@ -196,8 +146,6 @@ private: if (!((thismat == 0) || (thismat == Tile::leaves->id))) { - // If the material of the checked block is anything other than - // air or foliage, skip this tile. offset2++; continue; } @@ -211,12 +159,6 @@ private: } float treeShape(int y){ - // Take the y position relative to the base of the tree. - // Return the distance the foliage should be from the trunk axis. - // Return a negative number if foliage should not be created at this height. - // This method is intended for overriding in child classes, allowing - // different shaped trees. - // This method should return a consistent value for each y (don't randomize). if (y < (((float) height) * 0.3)) return (float) -1.618; float radius = ((float) height) / ((float) 2.0); float adjacent = (((float) height) / ((float) 2.0)) - y; @@ -224,29 +166,19 @@ private: if (adjacent == 0) distance = radius; else if (abs(adjacent) >= radius) distance = (float) 0.0; else distance = (float) sqrt(pow(abs(radius), 2) - pow(abs(adjacent), 2)); - // Alter this factor to change the overall width of the tree. distance *= (float) 0.5; return distance; } float foliageShape(int y){ - // Take the y position relative to the base of the foliage cluster. - // Return the radius of the cluster at this y - // Return a negative number if no foliage should be created at this level - // this method is intended for overriding in child classes, allowing - // foliage of different sizes and shapes. if ((y < 0) || (y >= foliageHeight)) return (float) -1; else if ((y == 0) || (y == (foliageHeight - 1))) return (float) 2; else return (float) 3; } void foliageCluster(int x, int y, int z){ - // Generate a cluster of foliage, with the base at x, y, z. - // The shape of the cluster is derived from foliageShape - // crossection is called to make each level. int topy = y + foliageHeight; int cury = topy - 1; float radius; - // 4J Stu - Generate foliage from the top down so that we don't keep recalculating heightmaps while (cury >= y) { radius = foliageShape(cury - y); @@ -257,11 +189,6 @@ private: } void limb(int *start, int *end, int material) { - // Create a limb from the start position to the end position. - // Used for creating the branches and trunk. - - // Populate delta, the difference between start and end for all three axies. - // Set primidx to the index with the largest overall distance traveled. int delta[] = { 0, 0, 0 }; byte idx = 0; byte primidx = 0; @@ -274,22 +201,15 @@ private: } idx++; } - // If the largest distance is zero, don't bother to do anything else. if (delta[primidx] == 0) return; - // set up the other two axis indices. byte secidx1 = axisConversionArray[primidx]; byte secidx2 = axisConversionArray[primidx + 3]; - // primsign is digit 1 or -1 depending on whether the limb is headed - // along the positive or negative primidx axis. char primsign; if (delta[primidx] > 0) primsign = 1; else primsign = -1; - // Initilize the per-step movement for the non-primary axies. double secfac1 = ((double) delta[secidx1]) / ((double) delta[primidx]); double secfac2 = ((double) delta[secidx2]) / ((double) delta[primidx]); - // Initialize the coordinates. int coordinate[] = { 0, 0, 0 }; - // Loop through each crossection along the primary axis, from start to end int primoffset = 0; int endoffset = delta[primidx] + primsign; while (primoffset != endoffset) @@ -319,8 +239,6 @@ private: } } void makeFoliage(){ - // Create the tree foliage. - // Call foliageCluster at the correct locations int idx = 0; int finish = foliageCoordsLength; while (idx < finish) @@ -333,18 +251,10 @@ private: } } bool trimBranches(int localY){ - // For larger trees, randomly "prune" the branches so there - // aren't too many. - // Return true if the branch should be created. - // This method is intended for overriding in child classes, allowing - // decent amounts of branches on very large trees. - // Can also be used to disable branches on some tree types, or - // make branches more sparse. if (localY < (height * 0.2)) return false; else return true; } void makeTrunk(){ - // Create the trunk of the tree. int x = origin[0]; int startY = origin[1]; int topY = origin[1] + trunkHeight; @@ -366,9 +276,6 @@ private: } } void makeBranches(){ - // Create the tree branches. - // Call trimBranches for each branch to see if you should create it. - // Call taperedLimb to the correct locations int idx = 0; int finish = foliageCoordsLength; int baseCoord[] = { origin[0], origin[1], origin[2] }; @@ -386,12 +293,6 @@ private: } } int checkLine(int *start, int *end){ - // Check from coordinates start to end (both inclusive) for blocks other than air and foliage - // If a block other than air and foliage is found, return the number of steps taken. - // If no block other than air and foliage is found, return -1. - // Examples: - // If the third block searched is stone, return 2 - // If the first block searched is lava, return 0 int delta[] = { 0, 0, 0 }; byte idx = 0; @@ -405,22 +306,15 @@ private: } idx++; } - // If the largest distance is zero, don't bother to do anything else. if (delta[primidx] == 0) return -1; - // set up the other two axis indices. byte secidx1 = axisConversionArray[primidx]; byte secidx2 = axisConversionArray[primidx + 3]; - // primsign is digit 1 or -1 depending on whether the limb is headed - // along the positive or negative primidx axis. - char primsign; // 4J Stu - Was byte, but we use in a sum below and byte=unsigned char so we were setting endoffset incorrectly + char primsign; if (delta[primidx] > 0) primsign = 1; else primsign = -1; - // Initilize the per-step movement for the non-primary axies. double secfac1 = ((double) delta[secidx1]) / ((double) delta[primidx]); double secfac2 = ((double) delta[secidx2]) / ((double) delta[primidx]); - // Initialize the coordinates. int coordinate[] = { 0, 0, 0 }; - // Loop through each crossection along the primary axis, from start to end int primoffset = 0; int endoffset = delta[primidx] + primsign; int thismat; @@ -432,60 +326,46 @@ private: thismat = thisLevel->getTile(coordinate[0], coordinate[1], coordinate[2]); if (!((thismat == 0) || (thismat == Tile::leaves->id))) { - // If the material of the checked block is anything other than - // air or foliage, stop looking. + break; } primoffset += primsign; } - // If you reached the end without finding anything, return -1. + if (primoffset == endoffset) { return -1; } - // Otherwise, return the number of steps you took. + else { return abs(primoffset); } } bool checkLocation(){ - // Return true if the tree can be placed here. - // Return false if the tree can not be placed here. - - // Examine the square under the trunk. Is it grass or dirt? - // If not, return false - // Examine center column for how tall the tree can be. - // If the checked height is shorter than height, but taller - // than 4, set the tree to the maximum height allowed. - // If the space is too short, return false. + int startPosition[] = { origin[0], origin[1], origin[2] }; int endPosition[] = { origin[0], origin[1] + height - 1, origin[2] }; - // Check the location it is resting on int baseMaterial = thisLevel->getTile(origin[0], origin[1] - 1, origin[2]); if (!((baseMaterial == 2) || (baseMaterial == 3))) { return false; } int allowedHeight = checkLine(startPosition, endPosition); - // If the set height is good, go with that if (allowedHeight == -1) { return true; } - // If the space is too short, tell the build to abort + else if (allowedHeight < 6) { return false; } - // If the space is shorter than the set height, but not too short - // shorten the height, and tell the build to continue else { height = allowedHeight; - //System.out.println("Shortened the tree"); return true; } } @@ -502,9 +382,7 @@ public: origin[0] = 0; origin[1] = 0; origin[2] = 0; - // Field to hold the tree height. height = 0; - // Other important tree information. trunkHeight = 0; trunkHeightScale = 0.618; branchDensity = 1.0; @@ -528,65 +406,40 @@ public: } virtual void init(double heightInit, double widthInit, double foliageDensityInit){ - // all of the parameters should be from 0.0 to 1.0 - // heightInit scales the maximum overall height of the tree (still randomizes height within the possible range) - // widthInit scales the maximum overall width of the tree (keep this above 0.3 or so) - // foliageDensityInit scales how many foliage clusters are created. - // - // Note, you can call "place" without calling "init". - // This is the same as calling init(1.0,1.0,1.0) and then calling place. + heightVariance = (int) (heightInit * 12); if (heightInit > 0.5) foliageHeight = 5; widthScale = widthInit; foliageDensity = foliageDensityInit; } virtual bool place(Level *level, Random *random, int x, int y, int z){ - // Note to Markus. - // currently the following fields are set randomly. If you like, make them - // parameters passed into "place". - // - // height: so the map generator can intelligently set the height of the tree, - // and make forests with large trees in the middle and smaller ones on the edges. - // Initialize the instance fields for the level and the seed. thisLevel = level; __int64 seed = random->nextLong(); rnd->setSeed(seed); - // Initialize the origin of the tree trunk origin[0] = x; origin[1] = y; origin[2] = z; - // Sets the height. Take out this line if height is passed as a parameter if (height == 0) { height = 5 + rnd->nextInt(heightVariance); } if (!(checkLocation())) { - //System.out.println("Tree location failed"); + return false; } - //System.out.println("The height is"); - //System.out.println(height); - //System.out.println("Trunk Height check done"); + prepare(); - //System.out.println("Prepare done"); - makeFoliage(); - //System.out.println("Foliage done"); - makeTrunk(); - //System.out.println("Trunk done"); - makeBranches(); - //System.out.println("Branches done"); - return true; } }; From fa249728e515d1db1a6ce1cb324f2f099bd26237 Mon Sep 17 00:00:00 2001 From: Shredder Date: Thu, 2 Apr 2026 01:19:47 +0500 Subject: [PATCH 04/33] hopefully fixes broken build --- src/world/level/levelgen/feature/BasicTree.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/world/level/levelgen/feature/BasicTree.h b/src/world/level/levelgen/feature/BasicTree.h index 48f80e7..4985811 100644 --- a/src/world/level/levelgen/feature/BasicTree.h +++ b/src/world/level/levelgen/feature/BasicTree.h @@ -221,7 +221,7 @@ private: int dir = 0; int xdiff = abs(coordinate[0] - start[0]); int zdiff = abs(coordinate[2] - start[2]); - int maxdiff = max(xdiff, zdiff); + int maxdiff = (std::max)(xdiff, zdiff); if (maxdiff > 0) { From eac71a93d14b6a8f66067649a9edf397acc4affc Mon Sep 17 00:00:00 2001 From: Shredder Date: Thu, 2 Apr 2026 01:35:06 +0500 Subject: [PATCH 05/33] ok this should finally work now --- src/world/level/levelgen/feature/BasicTree.h | 26 ++++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/world/level/levelgen/feature/BasicTree.h b/src/world/level/levelgen/feature/BasicTree.h index 4985811..46f3f7e 100644 --- a/src/world/level/levelgen/feature/BasicTree.h +++ b/src/world/level/levelgen/feature/BasicTree.h @@ -116,12 +116,12 @@ private: } - void crossection(int x, int y, int z, float radius, byte direction, int material) + void crossection(int x, int y, int z, float radius, unsigned char direction, int material) { int rad = (int) (radius + 0.618); - byte secidx1 = axisConversionArray[direction]; - byte secidx2 = axisConversionArray[direction + 3]; + unsigned char secidx1 = axisConversionArray[direction]; + unsigned char secidx2 = axisConversionArray[direction + 3]; int center[] = { x, y, z }; int position[] = { 0, 0, 0 }; int offset1 = -rad; @@ -182,7 +182,7 @@ private: while (cury >= y) { radius = foliageShape(cury - y); - crossection(x, cury, z, radius, (byte) 1, Tile::leaves->id); + crossection(x, cury, z, radius, (unsigned char) 1, Tile::leaves->id); cury--; } @@ -190,8 +190,8 @@ private: void limb(int *start, int *end, int material) { int delta[] = { 0, 0, 0 }; - byte idx = 0; - byte primidx = 0; + unsigned char idx = 0; + unsigned char primidx = 0; while (idx < 3) { delta[idx] = end[idx] - start[idx]; @@ -202,8 +202,8 @@ private: idx++; } if (delta[primidx] == 0) return; - byte secidx1 = axisConversionArray[primidx]; - byte secidx2 = axisConversionArray[primidx + 3]; + unsigned char secidx1 = axisConversionArray[primidx]; + unsigned char secidx2 = axisConversionArray[primidx + 3]; char primsign; if (delta[primidx] > 0) primsign = 1; else primsign = -1; @@ -295,8 +295,8 @@ private: int checkLine(int *start, int *end){ int delta[] = { 0, 0, 0 }; - byte idx = 0; - byte primidx = 0; + unsigned char idx = 0; + unsigned char primidx = 0; while (idx < 3) { delta[idx] = end[idx] - start[idx]; @@ -307,8 +307,8 @@ private: idx++; } if (delta[primidx] == 0) return -1; - byte secidx1 = axisConversionArray[primidx]; - byte secidx2 = axisConversionArray[primidx + 3]; + unsigned char secidx1 = axisConversionArray[primidx]; + unsigned char secidx2 = axisConversionArray[primidx + 3]; char primsign; if (delta[primidx] > 0) primsign = 1; else primsign = -1; @@ -415,7 +415,7 @@ public: virtual bool place(Level *level, Random *random, int x, int y, int z){ thisLevel = level; - __int64 seed = random->nextLong(); + int seed = random->nextLong(); rnd->setSeed(seed); origin[0] = x; origin[1] = y; From ff5c57f6ba1bd450d76a692c9ca1f8e452a4b3c7 Mon Sep 17 00:00:00 2001 From: Shredder Date: Fri, 3 Apr 2026 14:55:33 +0500 Subject: [PATCH 06/33] Added Foliage and Grass Color tinting, Started Basic Work on restoring ravines, New Option to Toggle Tinting. --- data/images/environment/foliagecolor.png | Bin 0 -> 17693 bytes data/images/environment/grasscolor.png | Bin 0 -> 25237 bytes data/lang/en_US.lang | 1 + src/client/Minecraft.cpp | 19 ++++++ src/client/Options.cpp | 5 ++ src/client/Options.h | 1 + src/client/gui/screens/OptionsScreen.cpp | 3 +- src/client/renderer/Chunk.cpp | 7 +++ src/client/renderer/LevelRenderer.cpp | 11 ++++ src/client/renderer/Textures.cpp | 31 ++++++++++ src/client/renderer/Textures.h | 2 + src/world/level/FoliageColor.cpp | 13 ++++ src/world/level/FoliageColor.h | 58 ++++++++++++------ src/world/level/GrassColor.cpp | 13 ++++ src/world/level/GrassColor.h | 42 +++++++++++++ src/world/level/LevelSource.h | 5 +- src/world/level/Region.h | 2 + src/world/level/biome/Biome.cpp | 8 +-- src/world/level/biome/Biome.h | 1 - src/world/level/biome/BiomeSource.cpp | 22 +++---- src/world/level/biome/BiomeSource.h | 6 +- src/world/level/levelgen/CanyonFeature.cpp | 7 ++- src/world/level/levelgen/CanyonFeature.h | 6 +- .../level/levelgen/RandomLevelSource.cpp | 2 +- src/world/level/tile/GrassTile.cpp | 20 ++++-- src/world/level/tile/GrassTile.h | 1 + src/world/level/tile/LeafTile.h | 12 +++- 27 files changed, 241 insertions(+), 57 deletions(-) create mode 100644 data/images/environment/foliagecolor.png create mode 100644 data/images/environment/grasscolor.png create mode 100644 src/world/level/FoliageColor.cpp create mode 100644 src/world/level/GrassColor.cpp create mode 100644 src/world/level/GrassColor.h diff --git a/data/images/environment/foliagecolor.png b/data/images/environment/foliagecolor.png new file mode 100644 index 0000000000000000000000000000000000000000..81673caee3a2d26227d88215e08d7df8d9ccfe0b GIT binary patch literal 17693 zcmXtA1ymK!+uj>+=@RK~q?OJ~g9wsJr%1O*!v&;7LRzGe?rykrhqQonNO#wt-*?V; zcK6KA?3~%1cjA5LeV*AcRTX(`3^EJ=0I(GmWYhrw^mGdX&`_TOedqj-|HWL?<)whq z5sK}n2&$=)ybSR8-;vRh7yFcg?x>*S0suIj|6QP7hx`vuiLg(K%CfL|5IP|(^h44O z4FJ#piZYU#?sNM-yJer{U6*uEDVDfqQEj>Tp=M?@(EvKjx>SZ$j^_P%;f|kbfx1Ms zb@FTFxW$}&Ev+1_tQRc>T3W1H+3%F4)M?PasP?7ep~L`T=mNwr?jC;BpQl4RAzOdE zM$Jop)O`FXvDJLov}L)QQgyj-nZ{>x|Iy%R@e+I=FLC1(8bc2N@RQ$mU26`>2YAb$ zp0V6SDCOpeUeizynSamMCI%1?ymS!Ye)QW900__0kH%2d^drZl)Bb4>id!+Wr`NXO z&M8`lZ}M2BUpPsyq)>zTDNl`G`VyX0prhj%Q$>Y)CX9wb0P5-9bGt&!37*aS)Z3mB zVw6L#9~0$e8bT+MEsCwxk0yF1>A5%Gw_P-08sa<5?k1HjS7eo+qbplSF0GePVgJijxkhD>5WzP@C2xR^TRyNOOVcPC08oYj4CiVO1pbxXjqJXrL_`(gJgwEhEcmP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Vxeky>l z28>zp3TwYcfrBlYd0+qsE#!412GFWG*`wSu0+<`Ap8ySHDdPkRL?H7AK!a#fny8^J zO&Lw>0nr};mFpnT+wqs|>_N!G)lq9-;}3uob)e#%OK|}-zViX! zN0C-%o>mY~J7x<9pcPWAz#b^a-n%QW!C9DrLI3)k0BlgnmbP>a0fYVxQ7Cbzap@_$ z_SCxalp@*yK+)-^9N(uDM~I8|!n*+lvDdmtMpC>VzTc3!-UQRA%FZl#XQNUiA_!(b z%>@ND>Uz|pQbZzPdcnubkzxX&;F^@*QTfO~z`l*NJc@lqv9we#?*O&T5!69bJqHq( z|33f5x(LvsxHAIOYY_`HpjiukuW=os>6@lLt=6DrtXiO~^}T4$9JJ>Xqs|2^=LK5P zVr>zk)uo74R0z|b-yev;86{u=6~GJ4J+3@e@=EtCbx@^VZC+B=p_#K0eWHP5wZ0$i zSg4^M%bZceci1w&(D3e|BQGiIYMomR5jbl__&J2W#rrP+@0nH`(YJ=KYe5@QqPPh9 z(+Q1NUj+LpfOf1_q}}>nq>}*)0$%fk+;ZZencvcT(ID$J1b@_tfhDiybYV*WAG>gD U)zFOe5dZ)H07*qoM6N<$f@-qCsQ>@~ literal 0 HcmV?d00001 diff --git a/data/images/environment/grasscolor.png b/data/images/environment/grasscolor.png new file mode 100644 index 0000000000000000000000000000000000000000..a6d9c2090c4d5723c3f01ffc3559ab248e9fcbc1 GIT binary patch literal 25237 zcmZ_02{=^k9|ruKGm9AvgY0^3rLu=CZH6M1N}Hu*NTMiP@0&{Ij3o-Gw-hy@SD{iA zl@?|!sVJ06i_A#2>SctCF*E0TruYAC*LQu_HC;7lX3lxe^Zb7I@4oNncRKE~eicno zPZ0n>TkW-S695SOCjuyB_*Y3r}_)V+a!L2rfVfcm^?zYYifZI7rk`NMnPmS>k zhzCHWQT_*c8eO&v9@IVH;eTLr^zH)(L*l}KPspDA2dvk7Y%%)F-g=SsqSYrP0swZB zRctWNRB!d2ON@xE`9vrnKmYHrP34|x06{YPIPJhfNU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2?+%Qq}oILC%|yrYi;jjgRZXt^{F!o5%!=p6P@F1-0!FQlZF6%$TtO+g}OIs<}!K ziS!J3E#!q_A*Of7QtB&DLuD*5WIuC!lY0;N6-W+nx!MMr$$Ysx8Dy5Jie^!eBKBJ% zs8&XS!DKZGM4r*X-~~vT0~yU$0CNeKY^Y`id;<6|Fdu9Mt{mku=PzkOXskHC7`wFv zU?bAtsNTlUG?j6Lhw1+wDUv}iDQ>JAzRFP+OZ3r9UL_X4j0NOtwrsVgW4hAI&R{XJ z7k3zUBYaD^NDJ6X*fF}09z#9$10ETYwjI46GsZLr7L9gm#?W@)OX#SP96Uu>e2G5j Y(5}(#`*R6n1pa&zGJoEsIpVDU10aElA^-pY literal 0 HcmV?d00001 diff --git a/data/lang/en_US.lang b/data/lang/en_US.lang index 4bb15e2..97ceaa2 100755 --- a/data/lang/en_US.lang +++ b/data/lang/en_US.lang @@ -153,6 +153,7 @@ options.group.tweaks=Tweaks options.allowSprint=Allow sprint options.barOnTop=HUD above inventory options.rpiCursor=Show Raspberry PI cursor +options.foliageTint=Tint Grass and Leaves options.autoJump=Auto Jump options.thirdperson=Third Person options.servervisible=Server Visible diff --git a/src/client/Minecraft.cpp b/src/client/Minecraft.cpp index 341bea9..1127246 100755 --- a/src/client/Minecraft.cpp +++ b/src/client/Minecraft.cpp @@ -90,6 +90,7 @@ #include "../network/command/CommandServer.h" #include "gamemode/CreatorMode.h" +#include "../world/level/GrassColor.h" static void checkGlError(const char* tag) { #ifdef GLDEBUG while (1) { @@ -1132,6 +1133,24 @@ void Minecraft::init() gameRenderer = new GameRenderer(this); particleEngine = new ParticleEngine(level, textures); + // 4j's code for reference +// FoliageColor::init(textures->loadTexturePixels(L"misc/foliagecolor.png")); + + + // my code + TextureId foliageId = (textures->loadTexture("environment/foliagecolor.png")); // loading the uh png for foliage color + int* foliagePixels = textures->loadTexturePixels(foliageId, "environment/foliagecolor.png"); + // now i can finally initialize foliage color, probably not the best way to handle this but i cant be arsed rn + FoliageColor::init(foliagePixels); + + TextureId grassId = (textures->loadTexture("environment/grasscolor.png")); // loading the uh png for foliage color + int* grassPixels = textures->loadTexturePixels(grassId, "environment/grasscolor.png"); + GrassColor::init(grassPixels); + + bool tint = options.getBooleanValue(OPTIONS_FOLIAGE_TINT); // finally, toggleable foliage color + FoliageColor::setUseTint(tint); + GrassColor::setUseTint(tint); + // Platform specific initialization here font = new Font(&options, "font/default8.png", textures); diff --git a/src/client/Options.cpp b/src/client/Options.cpp index 2cacca0..68d6bae 100755 --- a/src/client/Options.cpp +++ b/src/client/Options.cpp @@ -60,6 +60,8 @@ OptionBool useTouchscreen("useTouchscreen", true); OptionBool serverVisible("servervisible", true); +OptionBool foliageTint("foliagetint", false); + OptionInt keyForward("key.forward", Keyboard::KEY_W); OptionInt keyLeft("key.left", Keyboard::KEY_A); OptionInt keyBack("key.back", Keyboard::KEY_S); @@ -136,6 +138,8 @@ void Options::initTable() { m_options[OPTIONS_USE_TOUCHSCREEN] = &useTouchscreen; + + m_options[OPTIONS_SERVER_VISIBLE] = &serverVisible; m_options[OPTIONS_KEY_FORWARD] = &keyForward; @@ -160,6 +164,7 @@ void Options::initTable() { m_options[OPTIONS_BAR_ON_TOP] = &barOnTop; m_options[OPTIONS_ALLOW_SPRINT] = &allowSprint; m_options[OPTIONS_RPI_CURSOR] = &rpiCursor; + m_options[OPTIONS_FOLIAGE_TINT] = &foliageTint; m_options[OPTIONS_AUTOJUMP] = &autoJump; m_options[OPTIONS_LAST_IP] = &lastIp; diff --git a/src/client/Options.h b/src/client/Options.h index f5a4393..96d6f3b 100755 --- a/src/client/Options.h +++ b/src/client/Options.h @@ -84,6 +84,7 @@ enum OptionId { OPTIONS_LAST_IP, OPTIONS_RPI_CURSOR, + OPTIONS_FOLIAGE_TINT, // Should be last! OPTIONS_COUNT }; diff --git a/src/client/gui/screens/OptionsScreen.cpp b/src/client/gui/screens/OptionsScreen.cpp index 11b87c1..02a7a62 100755 --- a/src/client/gui/screens/OptionsScreen.cpp +++ b/src/client/gui/screens/OptionsScreen.cpp @@ -225,7 +225,8 @@ void OptionsScreen::generateOptionScreens() { optionPanes[4]->addOptionItem(OPTIONS_ALLOW_SPRINT, minecraft) .addOptionItem(OPTIONS_BAR_ON_TOP, minecraft) - .addOptionItem(OPTIONS_RPI_CURSOR, minecraft); + .addOptionItem(OPTIONS_RPI_CURSOR, minecraft) + .addOptionItem(OPTIONS_FOLIAGE_TINT, minecraft); } void OptionsScreen::mouseClicked(int x, int y, int buttonNum) { diff --git a/src/client/renderer/Chunk.cpp b/src/client/renderer/Chunk.cpp index 13ac27c..2d28324 100755 --- a/src/client/renderer/Chunk.cpp +++ b/src/client/renderer/Chunk.cpp @@ -7,6 +7,10 @@ #include "../../world/level/Region.h" #include "../../world/level/chunk/LevelChunk.h" #include "../../util/Mth.h" + +#include "../../world/level/biome/BiomeSource.h" + +#include "../../world/level/Level.h" //#include "../../platform/time.h" /*static*/ int Chunk::updates = 0; @@ -260,3 +264,6 @@ void Chunk::resetUpdates() updates = 0; //swRebuild.reset(); } +BiomeSource* Region::getBiomeSource() { + return level->getBiomeSource(); +} \ No newline at end of file diff --git a/src/client/renderer/LevelRenderer.cpp b/src/client/renderer/LevelRenderer.cpp index 3520732..73670cd 100755 --- a/src/client/renderer/LevelRenderer.cpp +++ b/src/client/renderer/LevelRenderer.cpp @@ -25,6 +25,8 @@ #include "../../client/player/LocalPlayer.h" +#include "../../world/level/GrassColor.h" + #ifdef GFX_SMALLER_CHUNKS /* static */ const int LevelRenderer::CHUNK_SIZE = 8; #else @@ -143,6 +145,10 @@ void LevelRenderer::setLevel( Level* level ) level->addListener(this); allChanged(); } + if (mc->options.getBooleanValue(OPTIONS_AMBIENT_OCCLUSION)) { + mc->useAmbientOcclusion = !mc->useAmbientOcclusion; + allChanged(); + } } void LevelRenderer::allChanged() @@ -155,6 +161,11 @@ void LevelRenderer::allChanged() Tile::leaves_carried->setFancy(fancy); lastViewDistance = mc->options.getIntValue(OPTIONS_VIEW_DISTANCE); + bool tint = mc->options.getBooleanValue(OPTIONS_FOLIAGE_TINT); + FoliageColor::setUseTint(tint); + GrassColor::setUseTint(tint); + + int dist = (512 >> 3) << (3 - lastViewDistance); if (lastViewDistance <= 2 && mc->isPowerVR()) dist = (int)((float)dist * 0.8f); diff --git a/src/client/renderer/Textures.cpp b/src/client/renderer/Textures.cpp index 9fce411..b4b1676 100755 --- a/src/client/renderer/Textures.cpp +++ b/src/client/renderer/Textures.cpp @@ -249,6 +249,37 @@ int Textures::crispBlend( int c0, int c1 ) return (a << 24) | (r << 16) | (g << 8) | b; } +// shredder here, moved the code from minecraft.cpp bcus that isnt the right place +// had to implement this because i couldn't find a similar function in the code to do this +int* Textures::loadTexturePixels(TextureId texId, const std::string& resourceName){ + + const TextureData* texture = getTemporaryTextureData(texId); // storing raw pixels + + int size = texture->w * texture->h; // gets the size of our funny lil guy + int* pixels = new int[size]; // memory leaks be galore + unsigned char* raw = texture->data; // storing raw data into our beloved variable + for (int i = 0; i < (texture->w * texture->h); i++){ + // my head hurts i hate working with this + + + // uh since each pixel stores r g b a, aka the color channels which are each one byte, we multiply them by 4 to move from one pixel to another + + int r = raw[i * 4 + 0]; // gets us the first channel aka red + int g = raw[i * 4 + 1]; // gets us the second channel green + int b = raw[i * 4 + 2]; // gets us the third channel blue + int a = raw[i * 4 + 3]; // gets us the alpha channel + + // woohoo pixels uh should have been seperated into their colors now hopefully + + // r g b a + // ugh we now got to turn it into the AA RR GGBB format aak 0xAARRGGBB + // b gets 0 - 7 (8 bits), g gets 7 - 15 (8 bits), r gets 16 - 23 (8 bits), alpha gets the last ones 24 - 31 (8 bits), + pixels[i] = (a << 24) | (r << 16) | (g << 8) | (b); // shuld combine them into one 32 bit int unless i did something dumb + } + return pixels; // your meal has been prepared john colors +} + + ///*public*/ int loadHttpTexture(std::string url, std::string backup) { // HttpTexture texture = httpTextures.get(url); // if (texture != NULL) { diff --git a/src/client/renderer/Textures.h b/src/client/renderer/Textures.h index f5e2113..f4ab36e 100755 --- a/src/client/renderer/Textures.h +++ b/src/client/renderer/Textures.h @@ -44,6 +44,8 @@ public: TextureId assignTexture(const std::string& resourceName, const TextureData& img); const TextureData* getTemporaryTextureData(TextureId id); + int* loadTexturePixels(TextureId texId, const std::string& resourceName); + void tick(bool uploadToGraphicsCard); void clear(); diff --git a/src/world/level/FoliageColor.cpp b/src/world/level/FoliageColor.cpp new file mode 100644 index 0000000..018cd1f --- /dev/null +++ b/src/world/level/FoliageColor.cpp @@ -0,0 +1,13 @@ +#include "FoliageColor.h" + +// TODO: Probably move all the stuff from the header into here so it's a bit cleaner +bool FoliageColor::useTint = true; + +int FoliageColor::get(float temp, float rain) { + rain *= temp; + int x = (int) ((1 - temp) * 255); + int y = (int) ((1 - rain) * 255); + return pixels[y << 8 | x]; +} + +int* FoliageColor::pixels = nullptr; \ No newline at end of file diff --git a/src/world/level/FoliageColor.h b/src/world/level/FoliageColor.h index 6d7d024..98d77b7 100755 --- a/src/world/level/FoliageColor.h +++ b/src/world/level/FoliageColor.h @@ -6,31 +6,49 @@ class FoliageColor { public: -// static void init(int[] pixels) { -// FoliageColor::pixels = pixels; -// } -// -// static int get(float temp, float rain) { -// rain *= temp; -// int x = (int) ((1 - temp) * 255); -// int y = (int) ((1 - rain) * 255); -// return pixels[y << 8 | x]; -// } + static bool useTint; - static int getEvergreenColor() { - return 0x619961; - } + static void setUseTint(bool value) { + useTint = value; + } + /* + Shredder here, Ive converted the unused commented out code into their correct syntax, though if i did something incorrectly feel free to take reference from the + commented out code + */ - static int getBirchColor() { - return 0x80a755; - } + // static void init(int[] pixels) { + // FoliageColor::pixels = pixels; + // } + // + // static int get(float temp, float rain) { + // rain *= temp; + // int x = (int) ((1 - temp) * 255); + // int y = (int) ((1 - rain) * 255); + // return pixels[y << 8 | x]; + // } - static int getDefaultColor() { - return 0x48b518; - } + + static void init(int* p) { + pixels = p; + } + + static int get(float temp, float rain); + + static int getEvergreenColor() { + return 0x619961; + } + + static int getBirchColor() { + return 0x80a755; + } + + static int getDefaultColor() { + return 0xFFFFFF; + } private: - //static int pixels[256*256]; + // static int pixels[256*256]; + static int* pixels; }; #endif /*NET_MINECRAFT_WORLD_LEVEL__FoliageColor_H__*/ diff --git a/src/world/level/GrassColor.cpp b/src/world/level/GrassColor.cpp new file mode 100644 index 0000000..eb05bd4 --- /dev/null +++ b/src/world/level/GrassColor.cpp @@ -0,0 +1,13 @@ +#include "GrassColor.h" + +// TODO: Probably move all the stuff from the header into here so it's a bit cleaner +bool GrassColor::useTint = true; + +int GrassColor::get(float temp, float rain) { + rain *= temp; + int x = (int) ((1 - temp) * 255); + int y = (int) ((1 - rain) * 255); + return pixels[y << 8 | x]; +} + +int* GrassColor::pixels = nullptr; \ No newline at end of file diff --git a/src/world/level/GrassColor.h b/src/world/level/GrassColor.h new file mode 100644 index 0000000..08903c7 --- /dev/null +++ b/src/world/level/GrassColor.h @@ -0,0 +1,42 @@ +#ifndef NET_MINECRAFT_WORLD_LEVEL__GrassColor_H__ +#define NET_MINECRAFT_WORLD_LEVEL__GrassColor_H__ + +//package net.minecraft.world.level; + +class GrassColor +{ +public: + static bool useTint; + + static void setUseTint(bool value) { + useTint = value; + } +/* +Shredder here, Ive converted the unused commented out code into their correct syntax, though if i did something incorrectly feel free to take reference from the +commented out code +*/ + +// static void init(int[] pixels) { +// GrassColor::pixels = pixels; +// } +// +// static int get(float temp, float rain) { +// rain *= temp; +// int x = (int) ((1 - temp) * 255); +// int y = (int) ((1 - rain) * 255); +// return pixels[y << 8 | x]; +// } + + + static void init(int* p) { + pixels = p; + } + + static int get(float temp, float rain); + +private: + // static int pixels[256*256]; + static int* pixels; +}; + +#endif /*NET_MINECRAFT_WORLD_LEVEL__GrassColor_H__*/ diff --git a/src/world/level/LevelSource.h b/src/world/level/LevelSource.h index 5dc5896..a130ec1 100755 --- a/src/world/level/LevelSource.h +++ b/src/world/level/LevelSource.h @@ -3,8 +3,9 @@ //package net.minecraft.world.level; -/* + class BiomeSource; +/* class TileEntity; */ class Material; @@ -29,7 +30,7 @@ public: virtual bool isSolidRenderTile(int x, int i, int z) = 0; virtual bool isSolidBlockingTile(int x, int i, int z) = 0; - //virtual BiomeSource* getBiomeSource() = 0; + virtual BiomeSource* getBiomeSource() = 0; virtual Biome* getBiome(int x, int z) = 0; }; diff --git a/src/world/level/Region.h b/src/world/level/Region.h index b4c3e58..d699099 100755 --- a/src/world/level/Region.h +++ b/src/world/level/Region.h @@ -5,6 +5,7 @@ #include "LevelSource.h" + class Level; class Material; class LevelChunk; @@ -27,6 +28,7 @@ public: int getData(int x, int y, int z); const Material* getMaterial(int x, int y, int z); Biome* getBiome(int x, int z); + BiomeSource* getBiomeSource() override; private: int xc1, zc1; LevelChunk*** chunks; diff --git a/src/world/level/biome/Biome.cpp b/src/world/level/biome/Biome.cpp index 7ccbdfe..609ed52 100755 --- a/src/world/level/biome/Biome.cpp +++ b/src/world/level/biome/Biome.cpp @@ -149,13 +149,7 @@ Feature* Biome::getGrassFeature( Random* random ) { return new TallgrassFeature(Tile::tallgrass->id, TallGrass::TALL_GRASS); } -Feature* Biome::getBasicTreeFeature( Random* random ) -{ - if (random->nextInt(10) == 0) { - return new BasicTree(false); - } - -} + Biome* Biome::getBiome( float temperature, float downfall ) diff --git a/src/world/level/biome/Biome.h b/src/world/level/biome/Biome.h index 23fd495..48a49d5 100755 --- a/src/world/level/biome/Biome.h +++ b/src/world/level/biome/Biome.h @@ -71,7 +71,6 @@ public: virtual Feature* getTreeFeature(Random* random); virtual Feature* getGrassFeature(Random* random); - virtual Feature* getBasicTreeFeature(Random* random); static Biome* getBiome(float temperature, float downfall); static Biome* _getBiome(float temperature, float downfall); diff --git a/src/world/level/biome/BiomeSource.cpp b/src/world/level/biome/BiomeSource.cpp index ab7c3a4..395b5a9 100755 --- a/src/world/level/biome/BiomeSource.cpp +++ b/src/world/level/biome/BiomeSource.cpp @@ -69,11 +69,11 @@ Biome* BiomeSource::getBiome( int x, int z ) return getBiomeBlock(x, z, 1, 1)[0]; } -//float BiomeSource::getTemperature( int x, int z ) -//{ -// temperatures = temperatureMap->getRegion(temperatures, x, z, 1, 1, tempScale, tempScale, 0.5f); -// return temperatures[0]; -//} +float BiomeSource::getTemperature( int x, int z ) +{ + temperatures = temperatureMap->getRegion(temperatures, x, z, 1, 1, tempScale, tempScale, 0.5f); + return temperatures[0]; +} Biome** BiomeSource::getBiomeBlock( int x, int z, int w, int h ) { @@ -123,7 +123,7 @@ Biome** BiomeSource::getBiomeBlock( Biome** biomes__, int x, int z, int w, int h return biomes; } -float* BiomeSource::getTemperatureBlock( /*float* temperatures__, */int x, int z, int w, int h ) +float* BiomeSource::getTemperatureBlock( float* temperatures__, int x, int z, int w, int h ) { //LOGI("gTempBlock: 1\n"); //const int size = w * h; @@ -164,8 +164,8 @@ float* BiomeSource::getTemperatureBlock( /*float* temperatures__, */int x, int z return temperatures; } -//float* BiomeSource::getDownfallBlock( /*float* downfalls__,*/ int x, int z, int w, int h ) -//{ +float* BiomeSource::getDownfallBlock( float* downfalls__, int x, int z, int w, int h ) +{ // //const int size = w * h; // //if (lenDownfalls < size) { // // delete[] downfalls; @@ -173,6 +173,6 @@ float* BiomeSource::getTemperatureBlock( /*float* temperatures__, */int x, int z // // lenDownfalls = size; // //} // -// downfalls = downfallMap->getRegion(downfalls, x, z, w, w, downfallScale, downfallScale, 0.5f); -// return downfalls; -//} + downfalls = downfallMap->getRegion(downfalls, x, z, w, w, downfallScale, downfallScale, 0.5f); + return downfalls; +} diff --git a/src/world/level/biome/BiomeSource.h b/src/world/level/biome/BiomeSource.h index fb540c1..25a3e5f 100755 --- a/src/world/level/biome/BiomeSource.h +++ b/src/world/level/biome/BiomeSource.h @@ -31,13 +31,13 @@ public: virtual Biome* getBiome(const ChunkPos& chunk); virtual Biome* getBiome(int x, int z); - //virtual float getTemperature(int x, int z); + virtual float getTemperature(int x, int z); // Note: The arrays returned here are temporary in the meaning that their // contents might change in the future. If you need to SAVE the // values, do a shallow copy to an array of your own. - virtual float* getTemperatureBlock(/*float* temperatures, */ int x, int z, int w, int h); - //virtual float* getDownfallBlock(/*float* downfalls, */int x, int z, int w, int h); + virtual float* getTemperatureBlock(float* temperatures, int x, int z, int w, int h); + virtual float* getDownfallBlock(float* downfalls, int x, int z, int w, int h); virtual Biome** getBiomeBlock(int x, int z, int w, int h); private: diff --git a/src/world/level/levelgen/CanyonFeature.cpp b/src/world/level/levelgen/CanyonFeature.cpp index f7d9ca3..095cd30 100755 --- a/src/world/level/levelgen/CanyonFeature.cpp +++ b/src/world/level/levelgen/CanyonFeature.cpp @@ -1,4 +1,4 @@ -#if 0 + #include "CanyonFeature.h" @@ -138,7 +138,7 @@ void CanyonFeature::addTunnel( int xOffs, int zOffs, unsigned char* blocks, floa } } -void CanyonFeature::addFeature( Level level, int x, int z, int xOffs, int zOffs, char* blocks ) +void CanyonFeature::addFeature(Level* level, int x, int z, int xOffs, int zOffs,unsigned char* blocks) { if (random.nextInt(15) != 0) return; @@ -151,6 +151,7 @@ void CanyonFeature::addFeature( Level level, int x, int z, int xOffs, int zOffs, float thickness = (random.nextFloat() * 2 + random.nextFloat()) + 1; addTunnel(xOffs, zOffs, blocks, xCave, yCave, zCave, thickness, yRot, xRot, 0, 0, 5.0); + } /* //private @@ -165,4 +166,4 @@ void CanyonFeature::addFeature( Level level, int x, int z, int xOffs, int zOffs, for (int z = zOffs - r; z <= zOffs + r; z++) { random.setSeed((x * xScale + z * zScale) ^ level.seed);*/ -#endif + diff --git a/src/world/level/levelgen/CanyonFeature.h b/src/world/level/levelgen/CanyonFeature.h index bd60c71..a187681 100755 --- a/src/world/level/levelgen/CanyonFeature.h +++ b/src/world/level/levelgen/CanyonFeature.h @@ -1,7 +1,7 @@ #ifndef NET_MINECRAFT_WORLD_LEVEL_LEVELGEN__CanyonFeature_H__ #define NET_MINECRAFT_WORLD_LEVEL_LEVELGEN__CanyonFeature_H__ -#if 0 + //package net.minecraft.world.level.levelgen; @@ -12,8 +12,8 @@ class CanyonFeature: public LargeFeature { /*protected*/ void addTunnel(int xOffs, int zOffs, unsigned char* blocks, float xCave, float yCave, float zCave, float thickness, float yRot, float xRot, int step, int dist, float yScale); /*protected*/ - void addFeature(Level level, int x, int z, int xOffs, int zOffs, char* blocks); + void addFeature(Level* level, int x, int z, int xOffs, int zOffs,unsigned char* blocks); }; -#endif + #endif /*NET_MINECRAFT_WORLD_LEVEL_LEVELGEN__CanyonFeature_H__*/ diff --git a/src/world/level/levelgen/RandomLevelSource.cpp b/src/world/level/levelgen/RandomLevelSource.cpp index 56f5b8b..99f8ce7 100755 --- a/src/world/level/levelgen/RandomLevelSource.cpp +++ b/src/world/level/levelgen/RandomLevelSource.cpp @@ -473,7 +473,7 @@ void RandomLevelSource::postProcess(ChunkSource* parent, int xt, int zt) { MobSpawner::postProcessSpawnMobs(level, biome, xo + 8, zo + 8, 16, 16, &random); //LOGI("Reading temp: 1\n"); - float* temperatures = level->getBiomeSource()->getTemperatureBlock(/*NULL,*/ xo + 8, zo + 8, 16, 16); + float* temperatures = level->getBiomeSource()->getTemperatureBlock(NULL, xo + 8, zo + 8, 16, 16); for (int x = xo + 8; x < xo + 8 + 16; x++) for (int z = zo + 8; z < zo + 8 + 16; z++) { int xp = x - (xo + 8); diff --git a/src/world/level/tile/GrassTile.cpp b/src/world/level/tile/GrassTile.cpp index 7a293ea..1828966 100755 --- a/src/world/level/tile/GrassTile.cpp +++ b/src/world/level/tile/GrassTile.cpp @@ -1,6 +1,11 @@ #include "GrassTile.h" #include "../material/Material.h" #include "../../entity/item/ItemEntity.h" +#include "../GrassColor.h" +#include "../Level.h" +#include "../LevelSource.h" +#include "../biome/BiomeSource.h" +#include "../../../client/Minecraft.h" GrassTile::GrassTile(int id) : super(id, Material::dirt) @@ -24,11 +29,18 @@ int GrassTile::getTexture( int face, int data ) { } int GrassTile::getColor( LevelSource* level, int x, int y, int z ) { - //level.getBiomeSource().getBiomeBlock(x, z, 1, 1); - //float temp = level.getBiomeSource().temperatures[0]; - //float rain = level.getBiomeSource().downfalls[0]; - return 0x339933;//GrassColor.get(temp, rain); + if(!GrassColor::useTint){ + return 0x339933; + } + + level->getBiomeSource()->getBiomeBlock(x, z, 1, 1); + float temp = level->getBiomeSource()->temperatures[0]; + float rain = level->getBiomeSource()->downfalls[0]; + +// return 0x339933;//GrassColor.get(temp, rain); // we need to hook this up with OPTION_FOLIAGE_TINT + + return GrassColor::get(temp, rain); } void GrassTile::tick( Level* level, int x, int y, int z, Random* random ) { diff --git a/src/world/level/tile/GrassTile.h b/src/world/level/tile/GrassTile.h index bc62825..c97db84 100755 --- a/src/world/level/tile/GrassTile.h +++ b/src/world/level/tile/GrassTile.h @@ -14,6 +14,7 @@ class GrassTile: public Tile { typedef Tile super; public: + static const int MIN_BRIGHTNESS = 4; GrassTile(int id); diff --git a/src/world/level/tile/LeafTile.h b/src/world/level/tile/LeafTile.h index e1102ca..53d9884 100755 --- a/src/world/level/tile/LeafTile.h +++ b/src/world/level/tile/LeafTile.h @@ -9,6 +9,8 @@ #include "../../item/Item.h" #include "../../item/ItemInstance.h" #include "../FoliageColor.h" +#include "../LevelSource.h" +#include "../biome/BiomeSource.h" class Entity; @@ -54,8 +56,16 @@ public: if (data == BIRCH_LEAF) { return FoliageColor::getBirchColor(); } + if (!FoliageColor::useTint){ + return FoliageColor::getDefaultColor(); + } - return FoliageColor::getDefaultColor(); + // return FoliageColor::getDefaultColor(); we need to hook this up with OPTION_FOLIAGE_TINT + level->getBiomeSource()->getBiomeBlock(x, z, 1, 1); + float temperature = level->getBiomeSource()->temperatures[0]; + float rainfall = level->getBiomeSource()->downfalls[0]; + return FoliageColor::get(temperature, rainfall); + } void onRemove(Level* level, int x, int y, int z) { From 61f0124beb52a77da67fa345b9d577d93f0841d0 Mon Sep 17 00:00:00 2001 From: Shredder Date: Fri, 3 Apr 2026 15:37:15 +0500 Subject: [PATCH 07/33] oops forgot to define some things --- project/android/jni/Android.mk | 2 ++ project/android_java/jni/Android.mk | 2 ++ src/world/level/Region.cpp | 7 ++++--- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/project/android/jni/Android.mk b/project/android/jni/Android.mk index 9bff609..596be52 100755 --- a/project/android/jni/Android.mk +++ b/project/android/jni/Android.mk @@ -209,6 +209,8 @@ LOCAL_SRC_FILES := ../../../src/main.cpp \ ../../../src/world/level/MobSpawner.cpp \ ../../../src/world/level/Region.cpp \ ../../../src/world/level/TickNextTickData.cpp \ +../../../src/world/level/FoliageColor.cpp \ +../../../src/world/level/GrassColor.cpp \ ../../../src/world/level/biome/Biome.cpp \ ../../../src/world/level/biome/BiomeSource.cpp \ ../../../src/world/level/chunk/LevelChunk.cpp \ diff --git a/project/android_java/jni/Android.mk b/project/android_java/jni/Android.mk index 04720a6..86856d7 100755 --- a/project/android_java/jni/Android.mk +++ b/project/android_java/jni/Android.mk @@ -183,6 +183,8 @@ LOCAL_SRC_FILES := ../../../src/main.cpp \ ../../../src/world/level/MobSpawner.cpp \ ../../../src/world/level/Region.cpp \ ../../../src/world/level/TickNextTickData.cpp \ +../../../src/world/level/FoliageColor.cpp \ +../../../src/world/level/GrassColor.cpp \ ../../../src/world/level/biome/Biome.cpp \ ../../../src/world/level/biome/BiomeSource.cpp \ ../../../src/world/level/chunk/LevelChunk.cpp \ diff --git a/src/world/level/Region.cpp b/src/world/level/Region.cpp index c501912..c2104b3 100755 --- a/src/world/level/Region.cpp +++ b/src/world/level/Region.cpp @@ -4,6 +4,7 @@ #include "tile/Tile.h" #include "Level.h" + Region::Region(Level* level, int x1, int y1, int z1, int x2, int y2, int z2) { this->level = level; @@ -135,6 +136,6 @@ Biome* Region::getBiome( int x, int z ) { return level->getBiome(x, z); } -//BiomeSource getBiomeSource() { -// return level.getBiomeSource(); -//} +BiomeSource* Region::getBiomeSource() { + return level->getBiomeSource(); +} From 378dfe8e22b9e66edb970318d588a3d9705e4ec8 Mon Sep 17 00:00:00 2001 From: Shredder Date: Fri, 3 Apr 2026 15:54:48 +0500 Subject: [PATCH 08/33] award for brain of a goldfish goes to me --- src/client/renderer/Chunk.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/client/renderer/Chunk.cpp b/src/client/renderer/Chunk.cpp index 2d28324..527508a 100755 --- a/src/client/renderer/Chunk.cpp +++ b/src/client/renderer/Chunk.cpp @@ -263,7 +263,4 @@ void Chunk::resetUpdates() { updates = 0; //swRebuild.reset(); -} -BiomeSource* Region::getBiomeSource() { - return level->getBiomeSource(); } \ No newline at end of file From 055f00be499a61f42be973706ea376258b892fbe Mon Sep 17 00:00:00 2001 From: Shredder Date: Mon, 6 Apr 2026 01:52:27 +0500 Subject: [PATCH 09/33] A bit big of a commit but Added 3 Fog Choices (Pocket) (Java) (Unknown that was unused) Restored Java Beta Sky Color code that was unused that depends on biome temperature (choosable using Java fog) Tile Shadows and Entity Shadows that appear beneath them have been restored and fixed from the unused code, toggleable by turning fancy graphics on or off Entities will now render flames on themselves when on fire, including the player Added option to use Java Style Item Count text and position in tweaks - fileshredder --- .../{environment => misc}/foliagecolor.png | Bin .../{environment => misc}/grasscolor.png | Bin data/images/misc/shadow.png | Bin 0 -> 868 bytes data/images/misc/vignette.png | Bin 0 -> 24157 bytes src/client/Minecraft.cpp | 14 +- src/client/Options.cpp | 9 + src/client/Options.h | 2 + src/client/gui/Gui.cpp | 262 +-- src/client/gui/screens/OptionsScreen.cpp | 11 +- src/client/renderer/LevelRenderer.cpp | 290 +-- src/client/renderer/LevelRenderer.h | 3 + .../entity/EntityRenderDispatcher.cpp | 14 +- src/client/renderer/entity/EntityRenderer.cpp | 241 +-- src/client/renderer/entity/EntityRenderer.h | 7 + src/client/renderer/entity/ItemRenderer.cpp | 35 +- src/client/renderer/entity/ItemRenderer.h | 2 +- src/client/renderer/entity/MobRenderer.cpp | 2 +- src/util/Color.cpp | 98 + src/util/Color.h | 15 + src/world/entity/player/Inventory.cpp | 1 + src/world/level/Level.cpp | 1804 +++++++++-------- src/world/level/biome/Biome.cpp | 12 +- src/world/level/chunk/LevelChunk.cpp | 14 +- src/world/level/dimension/Dimension.cpp | 18 +- src/world/level/dimension/Dimension.h | 5 +- .../level/dimension/NormalDayCycleDimension.h | 15 +- 26 files changed, 1574 insertions(+), 1300 deletions(-) rename data/images/{environment => misc}/foliagecolor.png (100%) rename data/images/{environment => misc}/grasscolor.png (100%) create mode 100644 data/images/misc/shadow.png create mode 100644 data/images/misc/vignette.png create mode 100644 src/util/Color.cpp create mode 100644 src/util/Color.h diff --git a/data/images/environment/foliagecolor.png b/data/images/misc/foliagecolor.png similarity index 100% rename from data/images/environment/foliagecolor.png rename to data/images/misc/foliagecolor.png diff --git a/data/images/environment/grasscolor.png b/data/images/misc/grasscolor.png similarity index 100% rename from data/images/environment/grasscolor.png rename to data/images/misc/grasscolor.png diff --git a/data/images/misc/shadow.png b/data/images/misc/shadow.png new file mode 100644 index 0000000000000000000000000000000000000000..06d999b20896dcc2ee077cb94f6afa3c8162895a GIT binary patch literal 868 zcmV-q1DpJbP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D02y>eSaefwW^{L9 za%BKeVQFr3E>1;MAa*k@H7+qu=Q#NQ00PuWL_t(|UhSK&SHmz6$0w1K$Vp@+vJyFo ztVB*C=a5L`{)9>7Boc|7L?V%JAJM(FOP4fhvs}7+FJiCxb>I8m<#O$2v#Uf$U?D4( z9qlgqZbn`ZWh-eLX`j;m9NU-l+e%wWD@NYq;M31##;2YN+kn~2e9zJVG+AMDSlXsc z=yRBn6f15cDc%NdC+l83W(_$1^Dp0-#c0Du#8Z6&t)nFjt^QqIm%cZJNCUC~581P(U z2!^{40fA)0b+J_Ykw$ZD_m))#%GXAD>#IG~*Xs9OOzhyO7-HT*rW62cqc!S>tH zpuqs%@MsQbK6}5qz;O&9HS|GI^Oyz$C>Lo~#%J%i{Xymv1mL7b$TiUiNv&frdP8;- z0$|@(p5Fuot=80DoJt&^_-hm@C4K3ntv{dkbV@M+0F3lMMuc*a zHmkbsm#UZbi?U_L062d?lp_mx+ua%b+Cd@5BXM;u_?e!OEV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d00001 diff --git a/src/client/Minecraft.cpp b/src/client/Minecraft.cpp index 1127246..1bd68de 100755 --- a/src/client/Minecraft.cpp +++ b/src/client/Minecraft.cpp @@ -1138,13 +1138,13 @@ void Minecraft::init() // my code - TextureId foliageId = (textures->loadTexture("environment/foliagecolor.png")); // loading the uh png for foliage color - int* foliagePixels = textures->loadTexturePixels(foliageId, "environment/foliagecolor.png"); + TextureId foliageId = (textures->loadTexture("misc/foliagecolor.png")); // loading the uh png for foliage color + int* foliagePixels = textures->loadTexturePixels(foliageId, "misc/foliagecolor.png"); // now i can finally initialize foliage color, probably not the best way to handle this but i cant be arsed rn FoliageColor::init(foliagePixels); - TextureId grassId = (textures->loadTexture("environment/grasscolor.png")); // loading the uh png for foliage color - int* grassPixels = textures->loadTexturePixels(grassId, "environment/grasscolor.png"); + TextureId grassId = (textures->loadTexture("misc/foliagecolor.png")); // loading the uh png for foliage color + int* grassPixels = textures->loadTexturePixels(grassId, "misc/foliagecolor.png"); GrassColor::init(grassPixels); bool tint = options.getBooleanValue(OPTIONS_FOLIAGE_TINT); // finally, toggleable foliage color @@ -1401,6 +1401,12 @@ void Minecraft::_levelGenerated() player->resetPos(false); } + if (level && level->dimension) { + // For example, if you want FogType or any other option + level->dimension->FogType = options.getBooleanValue(OPTIONS_FOG_TYPE); + } + + this->cameraTargetPlayer = player; std::string serverName = options.getStringValue(OPTIONS_USERNAME) + " - " + level->getLevelData()->levelName; diff --git a/src/client/Options.cpp b/src/client/Options.cpp index 68d6bae..cf719b0 100755 --- a/src/client/Options.cpp +++ b/src/client/Options.cpp @@ -62,6 +62,10 @@ OptionBool serverVisible("servervisible", true); OptionBool foliageTint("foliagetint", false); +OptionInt fogType("fogType", 0, 0, 2); + +OptionBool javaHud("javaHud", false); + OptionInt keyForward("key.forward", Keyboard::KEY_W); OptionInt keyLeft("key.left", Keyboard::KEY_A); OptionInt keyBack("key.back", Keyboard::KEY_S); @@ -166,6 +170,11 @@ void Options::initTable() { m_options[OPTIONS_RPI_CURSOR] = &rpiCursor; m_options[OPTIONS_FOLIAGE_TINT] = &foliageTint; + // more options yay + m_options[OPTIONS_FOG_TYPE] = &fogType; + + m_options[OPTIONS_JAVA_HUD] = &javaHud; + m_options[OPTIONS_AUTOJUMP] = &autoJump; m_options[OPTIONS_LAST_IP] = &lastIp; } diff --git a/src/client/Options.h b/src/client/Options.h index 96d6f3b..9852d48 100755 --- a/src/client/Options.h +++ b/src/client/Options.h @@ -85,6 +85,8 @@ enum OptionId { OPTIONS_RPI_CURSOR, OPTIONS_FOLIAGE_TINT, + OPTIONS_FOG_TYPE, + OPTIONS_JAVA_HUD, // Should be last! OPTIONS_COUNT }; diff --git a/src/client/gui/Gui.cpp b/src/client/gui/Gui.cpp index ccc9c26..8df59f0 100755 --- a/src/client/gui/Gui.cpp +++ b/src/client/gui/Gui.cpp @@ -36,7 +36,7 @@ const float Gui::DropTicks = 40.0f; //#include Gui::Gui(Minecraft* minecraft) -: minecraft(minecraft), + : minecraft(minecraft), tickCount(0), progress(0), overlayMessageTime(0), @@ -77,7 +77,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) { Font* font = minecraft->font; const bool isTouchInterface = minecraft->useTouchscreen(); - + const int screenWidth = (int)(minecraft->width * InvGuiScale); const int screenHeight = (int)(minecraft->height * InvGuiScale); blitOffset = -90; @@ -86,9 +86,9 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) { glColor4f2(1, 1, 1, 1); // H: 4 - // T: 7 - // L: 6 - // F: 3 + // T: 7 + // L: 6 + // F: 3 int ySlot = screenHeight - 16 - 3; if (!minecraft->options.getBooleanValue(OPTIONS_HIDEGUI)) { @@ -103,6 +103,12 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) { } } + // @todo - Shredder: I added this here but currently viginette is broken so i cant do much about it. + // if (minecraft->options.getBooleanValue(OPTIONS_FANCY_GRAPHICS)){ + // this->renderVignette(this->minecraft->player->getBrightness(a), screenWidth, screenHeight); + // } + // shredder end + if(minecraft->player->getSleepTimer() > 0) { glDisable(GL_DEPTH_TEST); glDisable(GL_ALPHA_TEST); @@ -113,38 +119,38 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) { glEnable(GL_DEPTH_TEST); } if (!minecraft->options.getBooleanValue(OPTIONS_HIDEGUI)) { - renderToolBar(a, ySlot, screenWidth); + renderToolBar(a, ySlot, screenWidth); - glEnable(GL_BLEND); - bool isChatting = (minecraft->screen && (dynamic_cast(minecraft->screen) || dynamic_cast(minecraft->screen))); - unsigned int max = 10; - if (isChatting) { - int lineHeight = 9; - max = (screenHeight - 48) / lineHeight; - if (max < 1) max = 1; - int maxScroll = (int)guiMessages.size() - (int)max; - if (maxScroll < 0) maxScroll = 0; - if (chatScrollOffset > maxScroll) chatScrollOffset = maxScroll; - } else { - chatScrollOffset = 0; - } - renderChatMessages(screenHeight, max, isChatting, font); + glEnable(GL_BLEND); + bool isChatting = (minecraft->screen && (dynamic_cast(minecraft->screen) || dynamic_cast(minecraft->screen))); + unsigned int max = 10; + if (isChatting) { + int lineHeight = 9; + max = (screenHeight - 48) / lineHeight; + if (max < 1) max = 1; + int maxScroll = (int)guiMessages.size() - (int)max; + if (maxScroll < 0) maxScroll = 0; + if (chatScrollOffset > maxScroll) chatScrollOffset = maxScroll; + } else { + chatScrollOffset = 0; + } + renderChatMessages(screenHeight, max, isChatting, font); #if !defined(RPI) - renderOnSelectItemNameText(screenWidth, font, ySlot); + renderOnSelectItemNameText(screenWidth, font, ySlot); #endif #if defined(RPI) - renderDebugInfo(); + renderDebugInfo(); #endif - if (Keyboard::isKeyDown(Keyboard::KEY_TAB)) { - renderPlayerList(font, screenWidth, screenHeight); + if (Keyboard::isKeyDown(Keyboard::KEY_TAB)) { + renderPlayerList(font, screenWidth, screenHeight); + } + + if (minecraft->options.getBooleanValue(OPTIONS_RENDER_DEBUG)) + renderDebugInfo(); } - if (minecraft->options.getBooleanValue(OPTIONS_RENDER_DEBUG)) - renderDebugInfo(); - } - - glDisable(GL_BLEND); + glDisable(GL_BLEND); glEnable2(GL_ALPHA_TEST); } @@ -183,7 +189,7 @@ void Gui::getSlotPos(int slot, int& posX, int& posY) { int screenWidth = (int)(minecraft->width * InvGuiScale); int screenHeight = (int)(minecraft->height * InvGuiScale); posX = screenWidth / 2 - getNumSlots() * 10 + slot * 20, - posY = screenHeight - 22; + posY = screenHeight - 22; } RectangleArea Gui::getRectangleArea(int extendSide) { @@ -196,7 +202,7 @@ RectangleArea Gui::getRectangleArea(int extendSide) { return RectangleArea(0, (float)minecraft->height-pHeight, pCenterX+pHalfWidth+2, (float)minecraft->height); if (extendSide > 0) return RectangleArea(pCenterX-pHalfWidth, (float)minecraft->height-pHeight, (float)minecraft->width, (float)minecraft->height); - + return RectangleArea(pCenterX-pHalfWidth, (float)minecraft->height-pHeight, pCenterX+pHalfWidth+2, (float)minecraft->height); } @@ -242,7 +248,7 @@ void Gui::handleKeyPressed(int key) if (key == Keyboard::KEY_F1) { minecraft->options.toggle(OPTIONS_HIDEGUI); } - + if (key == 99) { if (minecraft->player->inventory->selected > 0) @@ -290,11 +296,11 @@ void Gui::tick() { if(itemNameOverlayTime < 2) itemNameOverlayTime += 1.0f / SharedConstants::TicksPerSecond; for (unsigned int i = 0; i < guiMessages.size(); i++) { - guiMessages.at(i).ticks++; + guiMessages.at(i).ticks++; } - if (!minecraft->isCreativeMode()) - tickItemDrop(); + if (!minecraft->isCreativeMode()) + tickItemDrop(); } void Gui::addMessage(const std::string& _string) { @@ -344,6 +350,8 @@ void Gui::displayClientMessage(const std::string& messageId) { addMessage(messageId); } + +// @todo - shredder: Function seems to be completely fine and ported over from java beta, but renders opaque??? need to investigate void Gui::renderVignette(float br, int w, int h) { br = 1 - br; if (br < 0) br = 0; @@ -354,7 +362,10 @@ void Gui::renderVignette(float br, int w, int h) { glDepthMask(false); glBlendFunc2(GL_ZERO, GL_ONE_MINUS_SRC_COLOR); glColor4f2(tbr, tbr, tbr, 1); + minecraft->textures->loadAndBindTexture("misc/vignette.png"); + glTexParameteri2(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri2(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); Tesselator& t = Tesselator::instance; t.begin(); @@ -407,7 +418,7 @@ void Gui::inventoryUpdated() { } void Gui::onGraphicsReset() { - inventoryUpdated(); + inventoryUpdated(); } void Gui::texturesLoaded( Textures* textures ) { @@ -585,12 +596,12 @@ void Gui::renderProgressIndicator( const bool isTouchInterface, const int screen bool bowEquipped = currentItem != NULL ? currentItem->getItem() == Item::bow : false; bool itemInUse = currentItem != NULL ? currentItem->getItem() == minecraft->player->getUseItem()->getItem() : false; if ((!isTouchInterface || minecraft->options.getBooleanValue(OPTIONS_IS_JOY_TOUCH_AREA) - || (bowEquipped && itemInUse)) && !minecraft->options.getBooleanValue(OPTIONS_HIDEGUI)) { - minecraft->textures->loadAndBindTexture("gui/icons.png"); - glEnable(GL_BLEND); - glBlendFunc2(GL_ONE_MINUS_DST_COLOR, GL_ONE_MINUS_SRC_COLOR); - blit(screenWidth/2 - 8, screenHeight/2 - 8, 0, 0, 16, 16); - glDisable(GL_BLEND); + || (bowEquipped && itemInUse)) && !minecraft->options.getBooleanValue(OPTIONS_HIDEGUI)) { + minecraft->textures->loadAndBindTexture("gui/icons.png"); + glEnable(GL_BLEND); + glBlendFunc2(GL_ONE_MINUS_DST_COLOR, GL_ONE_MINUS_SRC_COLOR); + blit(screenWidth/2 - 8, screenHeight/2 - 8, 0, 0, 16, 16); + glDisable(GL_BLEND); } else if(!bowEquipped) { const float tprogress = minecraft->gameMode->destroyProgress; const float alpha = Mth::clamp(minecraft->inputHolder->alpha, 0.0f, 1.0f); @@ -665,10 +676,10 @@ void Gui::renderHearts() { int ip2 = i + i + 1; if (armor > 0) { - int xo = xx + 80 + i * 8 + 4; - if (ip2 < armor) blit(xo, yo, 16 + 2 * 9, 9 * 1, 9, 9); - else if (ip2 == armor) blit(xo, yo, 16 + 4 * 9, 9 * 1, 9, 9); - else if (ip2 > armor) blit(xo, yo, 16 + 0 * 9, 9 * 1, 9, 9); + int xo = xx + 80 + i * 8 + 4; + if (ip2 < armor) blit(xo, yo, 16 + 2 * 9, 9 * 1, 9, 9); + else if (ip2 == armor) blit(xo, yo, 16 + 4 * 9, 9 * 1, 9, 9); + else if (ip2 > armor) blit(xo, yo, 16 + 0 * 9, 9 * 1, 9, 9); } int bg = 0; @@ -691,7 +702,7 @@ void Gui::renderBubbles() { if (minecraft->player->isUnderLiquid(Material::water)) { int screenWidth = (int)(minecraft->width * InvGuiScale); int screenHeight = (int)(minecraft->height * InvGuiScale); - + int xx = (minecraft->options.getBooleanValue(OPTIONS_BAR_ON_TOP)) ? screenWidth / 2 - getNumSlots() * 10 - 1 : 2; int yo = (minecraft->options.getBooleanValue(OPTIONS_BAR_ON_TOP)) ? screenHeight - 42 : 12; int count = (int) std::ceil((minecraft->player->airSupply - 2) * 10.0f / Player::TOTAL_AIR_SUPPLY); @@ -910,64 +921,64 @@ void Gui::renderOnSelectItemNameText( const int screenWidth, Font* font, int ySl // helper structure used by drawColoredString struct ColorSegment { - std::string text; - uint32_t color; + std::string text; + uint32_t color; }; // parse [tag] and [/tag] markers; tags may contain a color name (gold, green, etc.) static void parseColorTags(const std::string& in, std::vector& out) { - uint32_t curColor = 0xffffff; - size_t pos = 0; - while (pos < in.size()) { - size_t open = in.find('[', pos); - if (open == std::string::npos) { - out.push_back({in.substr(pos), curColor}); - break; - } - if (open > pos) { - out.push_back({in.substr(pos, open - pos), curColor}); - } - size_t close = in.find(']', open); - if (close == std::string::npos) { - out.push_back({in.substr(open), curColor}); - break; - } - std::string tag = in.substr(open + 1, close - open - 1); - if (!tag.empty() && tag[0] == '/') { - curColor = 0xffffff; - } else { - std::string lower; - lower.resize(tag.size()); - std::transform(tag.begin(), tag.end(), lower.begin(), ::tolower); - if (lower.find("gold") != std::string::npos) curColor = 0xffd700; - else if (lower.find("green") != std::string::npos) curColor = 0x00ff00; - else if (lower.find("yellow") != std::string::npos) curColor = 0xffff00; - else if (lower.find("red") != std::string::npos) curColor = 0xff0000; - else if (lower.find("blue") != std::string::npos) curColor = 0x0000ff; - } - pos = close + 1; - } + uint32_t curColor = 0xffffff; + size_t pos = 0; + while (pos < in.size()) { + size_t open = in.find('[', pos); + if (open == std::string::npos) { + out.push_back({in.substr(pos), curColor}); + break; + } + if (open > pos) { + out.push_back({in.substr(pos, open - pos), curColor}); + } + size_t close = in.find(']', open); + if (close == std::string::npos) { + out.push_back({in.substr(open), curColor}); + break; + } + std::string tag = in.substr(open + 1, close - open - 1); + if (!tag.empty() && tag[0] == '/') { + curColor = 0xffffff; + } else { + std::string lower; + lower.resize(tag.size()); + std::transform(tag.begin(), tag.end(), lower.begin(), ::tolower); + if (lower.find("gold") != std::string::npos) curColor = 0xffd700; + else if (lower.find("green") != std::string::npos) curColor = 0x00ff00; + else if (lower.find("yellow") != std::string::npos) curColor = 0xffff00; + else if (lower.find("red") != std::string::npos) curColor = 0xff0000; + else if (lower.find("blue") != std::string::npos) curColor = 0x0000ff; + } + pos = close + 1; + } } void Gui::drawColoredString(Font* font, const std::string& text, float x, float y, int alpha) { - std::vector segs; - parseColorTags(text, segs); - float cx = x; - for (auto &s : segs) { - int color = s.color + (alpha << 24); - font->drawShadow(s.text, cx, y, color); - cx += font->width(s.text); - } + std::vector segs; + parseColorTags(text, segs); + float cx = x; + for (auto &s : segs) { + int color = s.color + (alpha << 24); + font->drawShadow(s.text, cx, y, color); + cx += font->width(s.text); + } } float Gui::getColoredWidth(Font* font, const std::string& text) { - std::vector segs; - parseColorTags(text, segs); - float w = 0; - for (auto &s : segs) { - w += font->width(s.text); - } - return w; + std::vector segs; + parseColorTags(text, segs); + float w = 0; + for (auto &s : segs) { + w += font->width(s.text); + } + return w; } void Gui::renderChatMessages( const int screenHeight, unsigned int max, bool isChatting, Font* font ) { @@ -1011,13 +1022,13 @@ void Gui::renderChatMessages( const int screenHeight, unsigned int max, bool isC glEnable(GL_BLEND); // special-case join/leave announcements - int baseColor = 0xffffff; - if (msg.find(" joined the game") != std::string::npos || - msg.find(" left the game") != std::string::npos) { - baseColor = 0xffff00; // yellow - } - // replace previous logic; allow full colour tags now - Gui::drawColoredString(font, msg, x, y, alpha); + int baseColor = 0xffffff; + if (msg.find(" joined the game") != std::string::npos || + msg.find(" left the game") != std::string::npos) { + baseColor = 0xffff00; // yellow + } + // replace previous logic; allow full colour tags now + Gui::drawColoredString(font, msg, x, y, alpha); } } } @@ -1105,22 +1116,41 @@ void Gui::renderToolBar( float a, int ySlot, const int screenWidth ) { // Draw count //Tesselator& t = Tesselator::instance; - glPushMatrix2(); - glScalef2(InvGuiScale + InvGuiScale, InvGuiScale + InvGuiScale, 1); + const float k = 0.5f * GuiScale; - - t.beginOverride(); - if (minecraft->gameMode->isSurvivalType()) { - x = baseItemX; - for (int i = 0; i < slots; i++) { - ItemInstance* item = minecraft->player->inventory->getItem(i); - if (item && item->count >= 0) - renderSlotText(item, k*x, k*ySlot + 1, true, true); - x += 20; + if (minecraft->options.getBooleanValue(OPTIONS_JAVA_HUD)) // if true enables the java beta item count size and color and calls the java items decorations + { + t.beginOverride(); + if (minecraft->gameMode->isSurvivalType()) { + x = baseItemX; + for (int i = 0; i < slots; i++) { + ItemInstance* item = minecraft->player->inventory->getItem(i); + if (item && item->count >= 0) + ItemRenderer::renderGuiItemDecorations(minecraft->font, minecraft->textures, minecraft->player->inventory->getItem(i), x, (float)ySlot); + x += 20; + } } + minecraft->textures->loadAndBindTexture("font/default8.png"); + t.endOverrideAndDraw(); + } + else { // otherwise uses the normal pocket edition one + glPushMatrix2(); + glScalef2(InvGuiScale + InvGuiScale, InvGuiScale + InvGuiScale, 1); + t.beginOverride(); + if (minecraft->gameMode->isSurvivalType()) { + x = baseItemX; + for (int i = 0; i < slots; i++) { + ItemInstance* item = minecraft->player->inventory->getItem(i); + if (item && item->count >= 0) + renderSlotText(item, k*x, k*ySlot, true, true); + x += 20; + } + } + + minecraft->textures->loadAndBindTexture("font/default8.png"); + t.endOverrideAndDraw(); + + glPopMatrix2(); } - minecraft->textures->loadAndBindTexture("font/default8.png"); - t.endOverrideAndDraw(); - glPopMatrix2(); } diff --git a/src/client/gui/screens/OptionsScreen.cpp b/src/client/gui/screens/OptionsScreen.cpp index 02a7a62..328a207 100755 --- a/src/client/gui/screens/OptionsScreen.cpp +++ b/src/client/gui/screens/OptionsScreen.cpp @@ -138,7 +138,7 @@ void OptionsScreen::render(int xm, int ym, float a) { if (currentOptionsGroup != NULL) currentOptionsGroup->render(minecraft, xmm, ymm); - + super::render(xm, ym, a); } @@ -222,11 +222,14 @@ void OptionsScreen::generateOptionScreens() { .addOptionItem(OPTIONS_ANAGLYPH_3D, minecraft) .addOptionItem(OPTIONS_VIEW_BOBBING, minecraft) .addOptionItem(OPTIONS_AMBIENT_OCCLUSION, minecraft); - + optionPanes[4]->addOptionItem(OPTIONS_ALLOW_SPRINT, minecraft) .addOptionItem(OPTIONS_BAR_ON_TOP, minecraft) .addOptionItem(OPTIONS_RPI_CURSOR, minecraft) - .addOptionItem(OPTIONS_FOLIAGE_TINT, minecraft); + .addOptionItem(OPTIONS_FOLIAGE_TINT, minecraft) + .addOptionItem(OPTIONS_JAVA_HUD, minecraft) + .addOptionItem(OPTIONS_FOG_TYPE, minecraft); + } void OptionsScreen::mouseClicked(int x, int y, int buttonNum) { @@ -248,7 +251,7 @@ void OptionsScreen::keyPressed(int eventKey) { currentOptionsGroup->keyPressed(minecraft, eventKey); if (eventKey == Keyboard::KEY_ESCAPE) minecraft->options.save(); - + super::keyPressed(eventKey); } diff --git a/src/client/renderer/LevelRenderer.cpp b/src/client/renderer/LevelRenderer.cpp index 73670cd..439a443 100755 --- a/src/client/renderer/LevelRenderer.cpp +++ b/src/client/renderer/LevelRenderer.cpp @@ -34,7 +34,7 @@ #endif LevelRenderer::LevelRenderer( Minecraft* mc) -: mc(mc), + : mc(mc), textures(mc->textures), level(NULL), cullStep(0), @@ -49,6 +49,7 @@ LevelRenderer::LevelRenderer( Minecraft* mc) xMaxChunk(0), yMaxChunk(0), zMaxChunk(0), lastViewDistance(-1), + lastFogType(-1), noEntityRenderFrames(2), totalEntities(0), @@ -145,10 +146,10 @@ void LevelRenderer::setLevel( Level* level ) level->addListener(this); allChanged(); } - if (mc->options.getBooleanValue(OPTIONS_AMBIENT_OCCLUSION)) { - mc->useAmbientOcclusion = !mc->useAmbientOcclusion; - allChanged(); - } + if (mc->options.getBooleanValue(OPTIONS_AMBIENT_OCCLUSION)) { + mc->useAmbientOcclusion = !mc->useAmbientOcclusion; + allChanged(); + } } void LevelRenderer::allChanged() @@ -161,6 +162,8 @@ void LevelRenderer::allChanged() Tile::leaves_carried->setFancy(fancy); lastViewDistance = mc->options.getIntValue(OPTIONS_VIEW_DISTANCE); + lastFogType = mc->options.getIntValue(OPTIONS_FOG_TYPE); + bool tint = mc->options.getBooleanValue(OPTIONS_FOLIAGE_TINT); FoliageColor::setUseTint(tint); GrassColor::setUseTint(tint); @@ -171,9 +174,9 @@ void LevelRenderer::allChanged() dist = (int)((float)dist * 0.8f); LOGI("last: %d, power: %d\n", lastViewDistance, mc->isPowerVR()); - #if defined(RPI) - dist *= 0.6f; - #endif +#if defined(RPI) + dist *= 0.6f; +#endif if (dist > 400) dist = 400; /* @@ -238,17 +241,17 @@ void LevelRenderer::allChanged() void LevelRenderer::deleteChunks() { for (int z = 0; z < zChunks; ++z) - for (int y = 0; y < yChunks; ++y) - for (int x = 0; x < xChunks; ++x) { - int c = getLinearCoord(x, y, z); - delete chunks[c]; - } + for (int y = 0; y < yChunks; ++y) + for (int x = 0; x < xChunks; ++x) { + int c = getLinearCoord(x, y, z); + delete chunks[c]; + } - delete[] chunks; - chunks = NULL; + delete[] chunks; + chunks = NULL; - delete[] sortedChunks; - sortedChunks = NULL; + delete[] sortedChunks; + sortedChunks = NULL; } void LevelRenderer::resortChunks( int xc, int yc, int zc ) @@ -312,6 +315,17 @@ int LevelRenderer::render( Mob* player, int layer, float alpha ) allChanged(); } + int currentFogType = mc->options.getIntValue(OPTIONS_FOG_TYPE); + if (currentFogType != lastFogType) { + lastFogType = currentFogType; + + if (level && level->dimension) { + level->dimension->FogType = currentFogType; // use new fog stuff + } + + allChanged(); + } + TIMER_PUSH("sortchunks"); for (int i = 0; i < 10; i++) { chunkFixOffs = (chunkFixOffs + 1) % chunksLength; @@ -580,11 +594,11 @@ int LevelRenderer::renderChunks( int from, int to, int layer, float alpha ) for (unsigned int i = 0; i < _renderChunks.size(); ++i) { Chunk* chunk = _renderChunks[i]; - #ifdef USE_VBO - renderList.addR(chunk->getRenderChunk(layer)); - #else - renderList.add(chunk->getList(layer)); - #endif +#ifdef USE_VBO + renderList.addR(chunk->getRenderChunk(layer)); +#else + renderList.add(chunk->getList(layer)); +#endif renderList.next(); } @@ -735,20 +749,20 @@ bool LevelRenderer::updateDirtyChunks( Mob* player, bool force ) Chunk* chunk = dirtyChunks[cursor]; if (chunk != NULL) { bool remove = false; - for (int i = 0; i < count && !remove; i++) - if (chunk == toAdd[i]) { - remove = true; - } - - if (!remove) { - //if (chunk == toAdd[0] || chunk == toAdd[1] || chunk == toAdd[2]) { - // ; // this chunk was rendered and should be removed - //} else { - if (target != cursor) { - dirtyChunks[target] = chunk; + for (int i = 0; i < count && !remove; i++) + if (chunk == toAdd[i]) { + remove = true; + } + + if (!remove) { + //if (chunk == toAdd[0] || chunk == toAdd[1] || chunk == toAdd[2]) { + // ; // this chunk was rendered and should be removed + //} else { + if (target != cursor) { + dirtyChunks[target] = chunk; + } + target++; } - target++; - } } cursor++; } @@ -922,23 +936,23 @@ bool entityRenderPredicate(const Entity* a, const Entity* b) { } void LevelRenderer::renderEntities(Vec3 cam, Culler* culler, float a) { - if (noEntityRenderFrames > 0) { - noEntityRenderFrames--; - return; - } + if (noEntityRenderFrames > 0) { + noEntityRenderFrames--; + return; + } TIMER_PUSH("prepare"); - TileEntityRenderDispatcher::getInstance()->prepare(level, textures, mc->font, mc->cameraTargetPlayer, a); - EntityRenderDispatcher::getInstance()->prepare(level, mc->font, mc->cameraTargetPlayer, &mc->options, a); + TileEntityRenderDispatcher::getInstance()->prepare(level, textures, mc->font, mc->cameraTargetPlayer, a); + EntityRenderDispatcher::getInstance()->prepare(level, mc->font, mc->cameraTargetPlayer, &mc->options, a); - totalEntities = 0; - renderedEntities = 0; - culledEntities = 0; + totalEntities = 0; + renderedEntities = 0; + culledEntities = 0; Entity* player = mc->cameraTargetPlayer; - EntityRenderDispatcher::xOff = TileEntityRenderDispatcher::xOff = (player->xOld + (player->x - player->xOld) * a); - EntityRenderDispatcher::yOff = TileEntityRenderDispatcher::yOff = (player->yOld + (player->y - player->yOld) * a); - EntityRenderDispatcher::zOff = TileEntityRenderDispatcher::zOff = (player->zOld + (player->z - player->zOld) * a); + EntityRenderDispatcher::xOff = TileEntityRenderDispatcher::xOff = (player->xOld + (player->x - player->xOld) * a); + EntityRenderDispatcher::yOff = TileEntityRenderDispatcher::yOff = (player->yOld + (player->y - player->yOld) * a); + EntityRenderDispatcher::zOff = TileEntityRenderDispatcher::zOff = (player->zOld + (player->z - player->zOld) * a); glEnableClientState2(GL_VERTEX_ARRAY); glEnableClientState2(GL_TEXTURE_COORD_ARRAY); @@ -977,10 +991,10 @@ void LevelRenderer::renderEntities(Vec3 cam, Culler* culler, float a) { delete[] toRender; } - TIMER_POP_PUSH("tileentities"); - for (unsigned int i = 0; i < level->tileEntities.size(); i++) { - TileEntityRenderDispatcher::getInstance()->render(level->tileEntities[i], a); - } + TIMER_POP_PUSH("tileentities"); + for (unsigned int i = 0; i < level->tileEntities.size(); i++) { + TileEntityRenderDispatcher::getInstance()->render(level->tileEntities[i], a); + } glDisableClientState2(GL_VERTEX_ARRAY); glDisableClientState2(GL_TEXTURE_COORD_ARRAY); @@ -991,7 +1005,7 @@ void LevelRenderer::renderEntities(Vec3 cam, Culler* culler, float a) { std::string LevelRenderer::gatherStats1() { std::stringstream ss; ss << "C: " << renderedChunks << "/" << totalChunks << ". F: " << offscreenChunks << ", O: " << occludedChunks << ", E: " << emptyChunks << "\n"; - return ss.str(); + return ss.str(); } // @@ -1003,34 +1017,34 @@ std::string LevelRenderer::gatherStats1() { // IntBuffer resultBuffer = MemoryTracker.createIntBuffer(64); void LevelRenderer::renderSky(float alpha) { - if (mc->level->dimension->foggy) return; + if (mc->level->dimension->foggy) return; - glDisable2(GL_TEXTURE_2D); - Vec3 sc = level->getSkyColor(mc->cameraTargetPlayer, alpha); - float sr = (float) sc.x; - float sg = (float) sc.y; - float sb = (float) sc.z;// + 0.5f; + glDisable2(GL_TEXTURE_2D); + Vec3 sc = level->getSkyColor(mc->cameraTargetPlayer, alpha); + float sr = (float) sc.x; + float sg = (float) sc.y; + float sb = (float) sc.z;// + 0.5f; - if (mc->options.getBooleanValue(OPTIONS_ANAGLYPH_3D)) { - float srr = (sr * 30.0f + sg * 59.0f + sb * 11.0f) / 100.0f; - float sgg = (sr * 30.0f + sg * 70.0f) / (100.0f); - float sbb = (sr * 30.0f + sb * 70.0f) / (100.0f); + if (mc->options.getBooleanValue(OPTIONS_ANAGLYPH_3D)) { + float srr = (sr * 30.0f + sg * 59.0f + sb * 11.0f) / 100.0f; + float sgg = (sr * 30.0f + sg * 70.0f) / (100.0f); + float sbb = (sr * 30.0f + sb * 70.0f) / (100.0f); - sr = srr; - sg = sgg; - sb = sbb; - } - glColor4f2(sr, sg, Mth::Min(1.0f, sb), 1); + sr = srr; + sg = sgg; + sb = sbb; + } + glColor4f2(sr, sg, Mth::Min(1.0f, sb), 1); - //Tesselator& t = Tesselator::instance; + //Tesselator& t = Tesselator::instance; - glEnable2(GL_FOG); - glColor4f2(sr, sg, sb, 1.0f); + glEnable2(GL_FOG); + glColor4f2(sr, sg, sb, 1.0f); #ifdef OPENGL_ES drawArrayVT(skyBuffer, skyVertexCount); #endif - glEnable2(GL_TEXTURE_2D); + glEnable2(GL_TEXTURE_2D); } void LevelRenderer::renderClouds( float alpha ) { @@ -1044,7 +1058,7 @@ void LevelRenderer::renderClouds( float alpha ) { //glBindTexture(GL_TEXTURE_2D, texturesloadTexture("/environment/clouds.png")); textures->loadAndBindTexture("environment/clouds.png"); - + glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); @@ -1087,17 +1101,17 @@ void LevelRenderer::playSound(const std::string& name, float x, float y, float z // @todo: deny sounds here if sound is off (rather than waiting 'til SoundEngine) float dd = 16; - if (volume > 1) dd *= volume; - if (mc->cameraTargetPlayer->distanceToSqr(x, y, z) < dd * dd) { - mc->soundEngine->play(name, x, y, z, volume, pitch); - } + if (volume > 1) dd *= volume; + if (mc->cameraTargetPlayer->distanceToSqr(x, y, z) < dd * dd) { + mc->soundEngine->play(name, x, y, z, volume, pitch); + } } void LevelRenderer::addParticle(const std::string& name, float x, float y, float z, float xa, float ya, float za, int data) { float xd = mc->cameraTargetPlayer->x - x; - float yd = mc->cameraTargetPlayer->y - y; - float zd = mc->cameraTargetPlayer->z - z; + float yd = mc->cameraTargetPlayer->y - y; + float zd = mc->cameraTargetPlayer->z - z; float distanceSquared = xd * xd + yd * yd + zd * zd; //Particle* p = NULL; @@ -1111,27 +1125,27 @@ void LevelRenderer::addParticle(const std::string& name, float x, float y, float // return; //} - const float particleDistance = 16; - if (distanceSquared > particleDistance * particleDistance) return; + const float particleDistance = 16; + if (distanceSquared > particleDistance * particleDistance) return; //static Stopwatch sw; //sw.start(); - if (name == "bubble") mc->particleEngine->add(new BubbleParticle(level, x, y, z, xa, ya, za)); + if (name == "bubble") mc->particleEngine->add(new BubbleParticle(level, x, y, z, xa, ya, za)); else if (name == "crit") mc->particleEngine->add(new CritParticle2(level, x, y, z, xa, ya, za)); else if (name == "smoke") mc->particleEngine->add(new SmokeParticle(level, x, y, z, xa, ya, za)); - //else if (name == "note") mc->particleEngine->add(new NoteParticle(level, x, y, z, xa, ya, za)); - else if (name == "explode") mc->particleEngine->add(new ExplodeParticle(level, x, y, z, xa, ya, za)); - else if (name == "flame") mc->particleEngine->add(new FlameParticle(level, x, y, z, xa, ya, za)); - else if (name == "lava") mc->particleEngine->add(new LavaParticle(level, x, y, z)); - //else if (name == "splash") mc->particleEngine->add(new SplashParticle(level, x, y, z, xa, ya, za)); + //else if (name == "note") mc->particleEngine->add(new NoteParticle(level, x, y, z, xa, ya, za)); + else if (name == "explode") mc->particleEngine->add(new ExplodeParticle(level, x, y, z, xa, ya, za)); + else if (name == "flame") mc->particleEngine->add(new FlameParticle(level, x, y, z, xa, ya, za)); + else if (name == "lava") mc->particleEngine->add(new LavaParticle(level, x, y, z)); + //else if (name == "splash") mc->particleEngine->add(new SplashParticle(level, x, y, z, xa, ya, za)); else if (name == "largesmoke") mc->particleEngine->add(new SmokeParticle(level, x, y, z, xa, ya, za, 2.5f)); - else if (name == "reddust") mc->particleEngine->add(new RedDustParticle(level, x, y, z, xa, ya, za)); + else if (name == "reddust") mc->particleEngine->add(new RedDustParticle(level, x, y, z, xa, ya, za)); else if (name == "iconcrack") mc->particleEngine->add(new BreakingItemParticle(level, x, y, z, xa, ya, za, Item::items[data])); else if (name == "snowballpoof") mc->particleEngine->add(new BreakingItemParticle(level, x, y, z, Item::snowBall)); - //else if (name == "snowballpoof") mc->particleEngine->add(new BreakingItemParticle(level, x, y, z, Item::snowBall)); - //else if (name == "slime") mc->particleEngine->add(new BreakingItemParticle(level, x, y, z, Item::slimeBall)); - //else if (name == "heart") mc->particleEngine->add(new HeartParticle(level, x, y, z, xa, ya, za)); + //else if (name == "snowballpoof") mc->particleEngine->add(new BreakingItemParticle(level, x, y, z, Item::snowBall)); + //else if (name == "slime") mc->particleEngine->add(new BreakingItemParticle(level, x, y, z, Item::slimeBall)); + //else if (name == "heart") mc->particleEngine->add(new HeartParticle(level, x, y, z, xa, ya, za)); //sw.stop(); //sw.printEvery(50, "add-particle-string"); @@ -1139,53 +1153,53 @@ void LevelRenderer::addParticle(const std::string& name, float x, float y, float /* void LevelRenderer::addParticle(ParticleType::Id name, float x, float y, float z, float xa, float ya, float za, int data) { - float xd = mc->cameraTargetPlayer->x - x; - float yd = mc->cameraTargetPlayer->y - y; - float zd = mc->cameraTargetPlayer->z - z; +float xd = mc->cameraTargetPlayer->x - x; +float yd = mc->cameraTargetPlayer->y - y; +float zd = mc->cameraTargetPlayer->z - z; - const float particleDistance = 16; - if (xd * xd + yd * yd + zd * zd > particleDistance * particleDistance) return; +const float particleDistance = 16; +if (xd * xd + yd * yd + zd * zd > particleDistance * particleDistance) return; - //static Stopwatch sw; - //sw.start(); +//static Stopwatch sw; +//sw.start(); - //Particle* p = NULL; +//Particle* p = NULL; - if (name == ParticleType::bubble) mc->particleEngine->add( new BubbleParticle(level, x, y, z, xa, ya, za) ); - else if (name == ParticleType::crit) mc->particleEngine->add(new CritParticle2(level, x, y, z, xa, ya, za) ); - else if (name == ParticleType::smoke) mc->particleEngine->add(new SmokeParticle(level, x, y, z, xa, ya, za) ); - else if (name == ParticleType::explode) mc->particleEngine->add( new ExplodeParticle(level, x, y, z, xa, ya, za) ); - else if (name == ParticleType::flame) mc->particleEngine->add( new FlameParticle(level, x, y, z, xa, ya, za) ); - else if (name == ParticleType::lava) mc->particleEngine->add( new LavaParticle(level, x, y, z) ); - else if (name == ParticleType::largesmoke) mc->particleEngine->add( new SmokeParticle(level, x, y, z, xa, ya, za, 2.5f) ); - else if (name == ParticleType::reddust) mc->particleEngine->add( new RedDustParticle(level, x, y, z, xa, ya, za) ); - else if (name == ParticleType::iconcrack) mc->particleEngine->add( new BreakingItemParticle(level, x, y, z, xa, ya, za, Item::items[data]) ); +if (name == ParticleType::bubble) mc->particleEngine->add( new BubbleParticle(level, x, y, z, xa, ya, za) ); +else if (name == ParticleType::crit) mc->particleEngine->add(new CritParticle2(level, x, y, z, xa, ya, za) ); +else if (name == ParticleType::smoke) mc->particleEngine->add(new SmokeParticle(level, x, y, z, xa, ya, za) ); +else if (name == ParticleType::explode) mc->particleEngine->add( new ExplodeParticle(level, x, y, z, xa, ya, za) ); +else if (name == ParticleType::flame) mc->particleEngine->add( new FlameParticle(level, x, y, z, xa, ya, za) ); +else if (name == ParticleType::lava) mc->particleEngine->add( new LavaParticle(level, x, y, z) ); +else if (name == ParticleType::largesmoke) mc->particleEngine->add( new SmokeParticle(level, x, y, z, xa, ya, za, 2.5f) ); +else if (name == ParticleType::reddust) mc->particleEngine->add( new RedDustParticle(level, x, y, z, xa, ya, za) ); +else if (name == ParticleType::iconcrack) mc->particleEngine->add( new BreakingItemParticle(level, x, y, z, xa, ya, za, Item::items[data]) ); - //switch (name) { - // case ParticleType::bubble: p = new BubbleParticle(level, x, y, z, xa, ya, za); break; - // case ParticleType::crit: p = new CritParticle2(level, x, y, z, xa, ya, za); break; - // case ParticleType::smoke: p = new SmokeParticle(level, x, y, z, xa, ya, za); break; - // //case ParticleType::note: p = new NoteParticle(level, x, y, z, xa, ya, za); break; - // case ParticleType::explode: p = new ExplodeParticle(level, x, y, z, xa, ya, za); break; - // case ParticleType::flame: p = new FlameParticle(level, x, y, z, xa, ya, za); break; - // case ParticleType::lava: p = new LavaParticle(level, x, y, z); break; - // //case ParticleType::splash: p = new SplashParticle(level, x, y, z, xa, ya, za); break; - // case ParticleType::largesmoke: p = new SmokeParticle(level, x, y, z, xa, ya, za, 2.5f); break; - // case ParticleType::reddust: p = new RedDustParticle(level, x, y, z, xa, ya, za); break; - // case ParticleType::iconcrack: p = new BreakingItemParticle(level, x, y, z, xa, ya, za, Item::items[data]); break; - // //case ParticleType::snowballpoof: p = new BreakingItemParticle(level, x, y, z, Item::snowBall); break; - // //case ParticleType::slime: p = new BreakingItemParticle(level, x, y, z, Item::slimeBall); break; - // //case ParticleType::heart: p = new HeartParticle(level, x, y, z, xa, ya, za); break; - // default: - // LOGW("Couldn't find particle of type: %d\n", name); - // break; - //} - //if (p) { - // mc->particleEngine->add(p); - //} +//switch (name) { +// case ParticleType::bubble: p = new BubbleParticle(level, x, y, z, xa, ya, za); break; +// case ParticleType::crit: p = new CritParticle2(level, x, y, z, xa, ya, za); break; +// case ParticleType::smoke: p = new SmokeParticle(level, x, y, z, xa, ya, za); break; +// //case ParticleType::note: p = new NoteParticle(level, x, y, z, xa, ya, za); break; +// case ParticleType::explode: p = new ExplodeParticle(level, x, y, z, xa, ya, za); break; +// case ParticleType::flame: p = new FlameParticle(level, x, y, z, xa, ya, za); break; +// case ParticleType::lava: p = new LavaParticle(level, x, y, z); break; +// //case ParticleType::splash: p = new SplashParticle(level, x, y, z, xa, ya, za); break; +// case ParticleType::largesmoke: p = new SmokeParticle(level, x, y, z, xa, ya, za, 2.5f); break; +// case ParticleType::reddust: p = new RedDustParticle(level, x, y, z, xa, ya, za); break; +// case ParticleType::iconcrack: p = new BreakingItemParticle(level, x, y, z, xa, ya, za, Item::items[data]); break; +// //case ParticleType::snowballpoof: p = new BreakingItemParticle(level, x, y, z, Item::snowBall); break; +// //case ParticleType::slime: p = new BreakingItemParticle(level, x, y, z, Item::slimeBall); break; +// //case ParticleType::heart: p = new HeartParticle(level, x, y, z, xa, ya, za); break; +// default: +// LOGW("Couldn't find particle of type: %d\n", name); +// break; +//} +//if (p) { +// mc->particleEngine->add(p); +//} - //sw.stop(); - //sw.printEvery(50, "add-particle-enum"); +//sw.stop(); +//sw.printEvery(50, "add-particle-enum"); } */ @@ -1203,7 +1217,7 @@ void LevelRenderer::renderHitSelect( Player* player, const HitResult& h, int mod glEnable2(GL_DEPTH_TEST); textures->loadAndBindTexture("terrain.png"); - + int tileId = level->getTile(h.x, h.y, h.z); Tile* tile = tileId > 0 ? Tile::tiles[tileId] : NULL; glDisable2(GL_ALPHA_TEST); @@ -1300,11 +1314,11 @@ void LevelRenderer::takePicture( TripodCamera* cam, Entity* entity ) void LevelRenderer::levelEvent(Player* player, int type, int x, int y, int z, int data) { switch (type) { case LevelEvent::SOUND_OPEN_DOOR: - if (Mth::random() < 0.5f) { - level->playSound(x + 0.5f, y + 0.5f, z + 0.5f, "random.door_open", 1, level->random.nextFloat() * 0.1f + 0.9f); - } else { - level->playSound(x + 0.5f, y + 0.5f, z + 0.5f, "random.door_close", 1, level->random.nextFloat() * 0.1f + 0.9f); - } - break; + if (Mth::random() < 0.5f) { + level->playSound(x + 0.5f, y + 0.5f, z + 0.5f, "random.door_open", 1, level->random.nextFloat() * 0.1f + 0.9f); + } else { + level->playSound(x + 0.5f, y + 0.5f, z + 0.5f, "random.door_close", 1, level->random.nextFloat() * 0.1f + 0.9f); + } + break; } } diff --git a/src/client/renderer/LevelRenderer.h b/src/client/renderer/LevelRenderer.h index df43de1..2a9c7e2 100755 --- a/src/client/renderer/LevelRenderer.h +++ b/src/client/renderer/LevelRenderer.h @@ -113,6 +113,9 @@ private: bool occlusionCheck; int lastViewDistance; + // shredder added again... + int lastFogType; + int ticks; int starList, skyList, darkList; diff --git a/src/client/renderer/entity/EntityRenderDispatcher.cpp b/src/client/renderer/entity/EntityRenderDispatcher.cpp index a3148fc..b0edea7 100755 --- a/src/client/renderer/entity/EntityRenderDispatcher.cpp +++ b/src/client/renderer/entity/EntityRenderDispatcher.cpp @@ -40,18 +40,18 @@ EntityRenderDispatcher::EntityRenderDispatcher() { //@note: The Models (model/armor) will be deleted by resp. MobRenderer assign( ER_ITEM_RENDERER, new ItemRenderer()); - assign( ER_HUMANOID_RENDERER, new HumanoidMobRenderer(new HumanoidModel(), 0)); - assign( ER_PIG_RENDERER, new PigRenderer(new PigModel(), NULL/*new PigModel(0.5f)*/, 0)); - assign( ER_COW_RENDERER, new MobRenderer(new CowModel(), 0)); - assign( ER_CHICKEN_RENDERER, new ChickenRenderer( new ChickenModel(), 0)); - assign( ER_SHEEP_RENDERER, new SheepRenderer(new SheepModel(), new SheepFurModel(), 0)); + assign( ER_HUMANOID_RENDERER, new HumanoidMobRenderer(new HumanoidModel(), 0.5)); + assign( ER_PIG_RENDERER, new PigRenderer(new PigModel(0.5), NULL/*new PigModel(0.5f)*/, 0.7)); + assign( ER_COW_RENDERER, new MobRenderer(new CowModel(), 0.7)); + assign( ER_CHICKEN_RENDERER, new ChickenRenderer( new ChickenModel(), 0.3)); + assign( ER_SHEEP_RENDERER, new SheepRenderer(new SheepModel(), new SheepFurModel(), 0.7)); assign( ER_SKELETON_RENDERER, new HumanoidMobRenderer(new SkeletonModel(), 0.5f)); assign( ER_ZOMBIE_RENDERER, new HumanoidMobRenderer(new ZombieModel(), 0.5f)); assign( ER_CREEPER_RENDERER, new CreeperRenderer()); assign( ER_SPIDER_RENDERER, new SpiderRenderer()); assign( ER_TNT_RENDERER, new TntRenderer()); assign( ER_ARROW_RENDERER, new ArrowRenderer()); - assign( ER_PLAYER_RENDERER, new PlayerRenderer(new HumanoidModel(0, 0, 64, 64), 0)); + assign( ER_PLAYER_RENDERER, new PlayerRenderer(new HumanoidModel(0, 0, 64, 64), 0.5)); assign( ER_THROWNEGG_RENDERER, new ItemSpriteRenderer(Item::egg->getIcon(0))); assign( ER_SNOWBALL_RENDERER, new ItemSpriteRenderer(Item::snowBall->getIcon(0))); assign( ER_PAINTING_RENDERER, new PaintingRenderer()); @@ -133,7 +133,7 @@ void EntityRenderDispatcher::render( Entity* entity, float x, float y, float z, EntityRenderer* renderer = getRenderer(entity); if (renderer != NULL) { renderer->render(entity, x, y, z, rot, a); - //renderer->postRender(entity, x, y, z, rot, a); + renderer->postRender(entity, x, y, z, rot, a); } } diff --git a/src/client/renderer/entity/EntityRenderer.cpp b/src/client/renderer/entity/EntityRenderer.cpp index 641581b..ad500b2 100755 --- a/src/client/renderer/entity/EntityRenderer.cpp +++ b/src/client/renderer/entity/EntityRenderer.cpp @@ -5,11 +5,17 @@ #include "../gles.h" #include "../../../world/phys/AABB.h" #include "EntityRenderDispatcher.h" +#include "../../../util/Mth.h" +#include "../../../world/level/Level.h" +#include "../../../world/level/tile/Tile.h" + +#include "../../Minecraft.h" +#include "../../Option.h" EntityRenderDispatcher* EntityRenderer::entityRenderDispatcher = NULL; EntityRenderer::EntityRenderer() -: shadowRadius(0), + : shadowRadius(0), shadowStrength(1.0f) {} @@ -36,37 +42,37 @@ void EntityRenderer::render(const AABB& bb, float xo, float yo, float zo) { glColor4f2(1, 1, 1, 1); t.begin(); t.offset(xo, yo, zo); - //t.normal(0, 0, -1); + t.normal(0, 0, -1); t.vertex(bb.x0, bb.y1, bb.z0); t.vertex(bb.x1, bb.y1, bb.z0); t.vertex(bb.x1, bb.y0, bb.z0); t.vertex(bb.x0, bb.y0, bb.z0); - //t.normal(0, 0, 1); + t.normal(0, 0, 1); t.vertex(bb.x0, bb.y0, bb.z1); t.vertex(bb.x1, bb.y0, bb.z1); t.vertex(bb.x1, bb.y1, bb.z1); t.vertex(bb.x0, bb.y1, bb.z1); - //t.normal(0, -1, 0); + t.normal(0, -1, 0); t.vertex(bb.x0, bb.y0, bb.z0); t.vertex(bb.x1, bb.y0, bb.z0); t.vertex(bb.x1, bb.y0, bb.z1); t.vertex(bb.x0, bb.y0, bb.z1); - //t.normal(0, 1, 0); + t.normal(0, 1, 0); t.vertex(bb.x0, bb.y1, bb.z1); t.vertex(bb.x1, bb.y1, bb.z1); t.vertex(bb.x1, bb.y1, bb.z0); t.vertex(bb.x0, bb.y1, bb.z0); - //t.normal(-1, 0, 0); + t.normal(-1, 0, 0); t.vertex(bb.x0, bb.y0, bb.z1); t.vertex(bb.x0, bb.y1, bb.z1); t.vertex(bb.x0, bb.y1, bb.z0); t.vertex(bb.x0, bb.y0, bb.z0); - //t.normal(1, 0, 0); + t.normal(1, 0, 0); t.vertex(bb.x1, bb.y0, bb.z0); t.vertex(bb.x1, bb.y1, bb.z0); t.vertex(bb.x1, bb.y1, bb.z1); @@ -116,134 +122,139 @@ Font* EntityRenderer::getFont() { return entityRenderDispatcher->getFont(); } -//void postRender(Entity entity, float x, float y, float z, float rot, float a) { -// if (entityRenderDispatcher.options.fancyGraphics && shadowRadius > 0) { -// float dist = entityRenderDispatcher.distanceToSqr(entity.x, entity.y, entity.z); -// float pow = (float) ((1 - dist / (16.0f * 16.0f)) * shadowStrength); -// if (pow > 0) { -// renderShadow(entity, x, y, z, pow, a); -// } -// } -// if (entity.isOnFire()) renderFlame(entity, x, y, z, a); -//} +void EntityRenderer::postRender(Entity* entity, float x, float y, float z, float rot, float a) { + if (/*entityRenderDispatcher.options.fancyGraphics &&*/entityRenderDispatcher->minecraft->options.getBooleanValue(OPTIONS_FANCY_GRAPHICS) && shadowRadius > 0) { + float dist = entityRenderDispatcher->distanceToSqr(entity->x, entity->y, entity->z); + float pow = (float) ((1 - dist / (16.0f * 16.0f)) * shadowStrength); + if (pow > 0) { + renderShadow(entity, x, y, z, pow, a); + } + //} + if (entity->isOnFire()) renderFlame(entity, x, y, z, a); + } +} +void EntityRenderer::renderFlame(Entity* e, float x, float y, float z, float a) { -//void renderFlame(Entity e, float x, float y, float z, float a) { -// glDisable2(GL_LIGHTING); -// int tex = Tile.fire.tex; + int tex = ((Tile*)Tile::fire)->tex; -// int xt = (tex & 0xf) << 4; -// int yt = tex & 0xf0; + int xt = (tex & 0xf) << 4; + int yt = tex & 0xf0; -// float u0 = (xt) / 256.0f; -// float u1 = (xt + 15.99f) / 256.0f; -// float v0 = (yt) / 256.0f; -// float v1 = (yt + 15.99f) / 256.0f; + float u0 = (xt) / 256.0f; + float u1 = (xt + 15.99f) / 256.0f; + float v0 = (yt) / 256.0f; + float v1 = (yt + 15.99f) / 256.0f; -// glPushMatrix2(); -// glTranslatef2((float) x, (float) y, (float) z); + glPushMatrix2(); + glTranslatef2((float) x, (float) y, (float) z); -// float s = e.bbWidth * 1.4f; -// glScalef2(s, s, s); -// bindTexture("terrain.png"); -// Tesselator t = Tesselator.instance; + float s = e->bbWidth * 1.4f; + glScalef2(s, s, s); + bindTexture("terrain.png"); + Tesselator& t = Tesselator::instance; -// float r = 1.0f; -// float xo = 0.5f; -// float yo = 0.0f; + float r = 1.0f; + float xo = 0.5f; + float yo = 0.0f; -// float h = e.bbHeight / e.bbWidth; + float h = e->bbHeight / e->bbWidth; -// glRotatef2(-entityRenderDispatcher.playerRotY, 0, 1, 0); -// glTranslatef2(0, 0, -0.4f + ((int) h) * 0.02f); -// glColor4f2(1, 1, 1, 1); -// // glRotatef2(-playerRotX, 1, 0, 0); -// t.begin(); -// while (h > 0) { -// t.vertexUV(r - xo, 0 - yo, 0, u1, v1); -// t.vertexUV(0 - xo, 0 - yo, 0, u0, v1); -// t.vertexUV(0 - xo, 1.4f - yo, 0, u0, v0); -// t.vertexUV(r - xo, 1.4f - yo, 0, u1, v0); -// h -= 1; -// yo -= 1; -// r *= 0.9f; -// glTranslatef2(0, 0, -0.04f); -// } -// t.end(); -// glPopMatrix2(); -// glEnable2(GL_LIGHTING); -//} + glRotatef2(-entityRenderDispatcher->playerRotY, 0, 1, 0); + glTranslatef2(0, 0, -0.4f + ((int) h) * 0.02f); + glColor4f2(1, 1, 1, 1); + // glRotatef2(-playerRotX, 1, 0, 0); + t.begin(); + while (h > 0) { + t.vertexUV(r - xo, 0 - yo, 0, u1, v1); + t.vertexUV(0 - xo, 0 - yo, 0, u0, v1); + t.vertexUV(0 - xo, 1.4f - yo, 0, u0, v0); + t.vertexUV(r - xo, 1.4f - yo, 0, u1, v0); + h -= 1; + yo -= 1; + r *= 0.9f; + glTranslatef2(0, 0, -0.04f); + } + t.draw(); + glPopMatrix2(); + // glEnable2(GL_LIGHTING); +} -//void renderShadow(Entity e, float x, float y, float z, float pow, float a) { -// glEnable2(GL_BLEND); -// glBlendFunc2(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); +void EntityRenderer::renderShadow(Entity* e, float x, float y, float z, float pow, float a) { // + glEnable2(GL_BLEND); + glBlendFunc2(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); -// Textures textures = entityRenderDispatcher.textures; -// textures.bind(textures.loadTexture("%clamp%/misc/shadow.png")); + //Textures* textures = entityRenderDispatcher->textures; + //textures->bind(textures->loadTexture("%clamp%/environment/shadow.png")); + Textures* textures = entityRenderDispatcher->textures; + textures->bind(textures->loadTexture("/misc/shadow.png")); -// Level level = getLevel(); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); -// glDepthMask(false); -// float r = shadowRadius; + Level* level = getLevel(); -// float ex = e.xOld + (e.x - e.xOld) * a; -// float ey = e.yOld + (e.y - e.yOld) * a + e.getShadowHeightOffs(); -// float ez = e.zOld + (e.z - e.zOld) * a; + glDepthMask(false); + float r = shadowRadius; -// int x0 = Mth.floor(ex - r); -// int x1 = Mth.floor(ex + r); -// int y0 = Mth.floor(ey - r); -// int y1 = Mth.floor(ey); -// int z0 = Mth.floor(ez - r); -// int z1 = Mth.floor(ez + r); + float ex = e->xOld + (e->x - e->xOld) * a; + float ey = e->yOld + (e->y - e->yOld) * a + e->getShadowHeightOffs(); + float ez = e->zOld + (e->z - e->zOld) * a; -// float xo = x - ex; -// float yo = y - ey; -// float zo = z - ez; + int x0 = Mth::floor(ex - r); + int x1 = Mth::floor(ex + r); + int y0 = Mth::floor(ey - r); + int y1 = Mth::floor(ey); + int z0 = Mth::floor(ez - r); + int z1 = Mth::floor(ez + r); -// Tesselator tt = Tesselator.instance; -// tt.begin(); -// for (int xt = x0; xt <= x1; xt++) -// for (int yt = y0; yt <= y1; yt++) -// for (int zt = z0; zt <= z1; zt++) { -// int t = level.getTile(xt, yt - 1, zt); -// if (t > 0 && level.getRawBrightness(xt, yt, zt) > 3) { -// renderTileShadow(Tile.tiles[t], x, y + e.getShadowHeightOffs(), z, xt, yt, zt, pow, r, xo, yo + e.getShadowHeightOffs(), zo); -// } -// } -// tt.end(); + float xo = x - ex; + float yo = y - ey; + float zo = z - ez; -// glColor4f2(1, 1, 1, 1); -// glDisable2(GL_BLEND); -// glDepthMask(true); -//} + Tesselator& tt = Tesselator::instance; + tt.begin(); + for (int xt = x0; xt <= x1; xt++) + for (int yt = y0; yt <= y1; yt++) + for (int zt = z0; zt <= z1; zt++) { + int t = level->getTile(xt, yt - 1, zt); + if (t > 0 && level->getRawBrightness(xt, yt, zt) > 3) { + renderTileShadow(Tile::tiles[t], x, y + e->getShadowHeightOffs(), z, xt, yt, zt, pow, r, xo, yo + e->getShadowHeightOffs(), zo); + } + } + tt.draw(); -//Level* getLevel() { -// return entityRenderDispatcher.level; -//} + glColor4f2(1, 1, 1, 1); + glDisable2(GL_BLEND); + glDepthMask(true); +} -//void renderTileShadow(Tile tt, float x, float y, float z, int xt, int yt, int zt, float pow, float r, float xo, float yo, float zo) { -// Tesselator t = Tesselator.instance; -// if (!tt.isCubeShaped()) return; +Level* EntityRenderer::getLevel() { + return entityRenderDispatcher->level; +} -// float a = ((pow - (y - (yt + yo)) / 2) * 0.5f) * getLevel().getBrightness(xt, yt, zt); -// if (a < 0) return; -// if (a > 1) a = 1; -// t.color(1, 1, 1, (float) a); -// // glColor4f2(1, 1, 1, (float) a); +void EntityRenderer::renderTileShadow(Tile* tt, float x, float y, float z, int xt, int yt, int zt, float pow, float r, float xo, float yo, float zo) { + Tesselator& t = Tesselator::instance; + if (!tt->isCubeShaped()) return; -// float x0 = xt + tt.xx0 + xo; -// float x1 = xt + tt.xx1 + xo; -// float y0 = yt + tt.yy0 + yo + 1.0 / 64.0f; -// float z0 = zt + tt.zz0 + zo; -// float z1 = zt + tt.zz1 + zo; + float a = ((pow - (y - (yt + yo)) / 2) * 0.5f) * getLevel()->getBrightness(xt, yt, zt); + if (a < 0) return; + if (a > 1) a = 1; + // t.color(1, 1, 1, (float) a); + glColor4f2(1, 1, 1, (float) a); -// float u0 = (float) ((x - (x0)) / 2 / r + 0.5f); -// float u1 = (float) ((x - (x1)) / 2 / r + 0.5f); -// float v0 = (float) ((z - (z0)) / 2 / r + 0.5f); -// float v1 = (float) ((z - (z1)) / 2 / r + 0.5f); + float x0 = xt + tt->xx0 + xo; + float x1 = xt + tt->xx1 + xo; + float y0 = yt + tt->yy0 + yo + 1.0 / 64.0f; + float z0 = zt + tt->zz0 + zo; + float z1 = zt + tt->zz1 + zo; -// t.vertexUV(x0, y0, z0, u0, v0); -// t.vertexUV(x0, y0, z1, u0, v1); -// t.vertexUV(x1, y0, z1, u1, v1); -// t.vertexUV(x1, y0, z0, u1, v0); -//} + float u0 = (float) ((x - (x0)) / 2 / r + 0.5f); + float u1 = (float) ((x - (x1)) / 2 / r + 0.5f); + float v0 = (float) ((z - (z0)) / 2 / r + 0.5f); + float v1 = (float) ((z - (z1)) / 2 / r + 0.5f); + + t.vertexUV(x0, y0, z0, u0, v0); + t.vertexUV(x0, y0, z1, u0, v1); + t.vertexUV(x1, y0, z1, u1, v1); + t.vertexUV(x1, y0, z0, u1, v0); +} diff --git a/src/client/renderer/entity/EntityRenderer.h b/src/client/renderer/entity/EntityRenderer.h index 318f7f2..699c82d 100755 --- a/src/client/renderer/entity/EntityRenderer.h +++ b/src/client/renderer/entity/EntityRenderer.h @@ -12,6 +12,8 @@ class EntityRenderDispatcher; class Entity; class AABB; class Font; +class Tile; +class Level; class EntityRenderer { @@ -24,6 +26,11 @@ public: virtual void render(Entity* entity, float x, float y, float z, float rot, float a) = 0; static void render(const AABB& bb, float xo, float yo, float zo); static void renderFlat(const AABB& bb); + void renderShadow(Entity* e, float x, float y, float z, float pow, float a); + void renderTileShadow(Tile* tt, float x, float y, float z, int xt, int yt, int zt, float pow, float r, float xo, float yo, float zo); + void renderFlame(Entity* e, float x, float y, float z, float a); + void postRender(Entity* entity, float x, float y, float z, float rot, float a); + Level* getLevel(); Font* getFont(); diff --git a/src/client/renderer/entity/ItemRenderer.cpp b/src/client/renderer/entity/ItemRenderer.cpp index 15e63d1..eaf29b4 100755 --- a/src/client/renderer/entity/ItemRenderer.cpp +++ b/src/client/renderer/entity/ItemRenderer.cpp @@ -226,7 +226,40 @@ void ItemRenderer::renderGuiItem(Font* font, Textures* textures, const ItemInsta t.draw(); } -void ItemRenderer::renderGuiItemDecorations(const ItemInstance* item, float x, float y) { + +void ItemRenderer::renderGuiItemDecorations(Font* font, Textures* textures, ItemInstance* item, int x, int y){ // this is normally unused in the header but i ported it from java beta - shredder + if (item != NULL) { + if (item->count > 1) { + std::string countStr = std::to_string(item->count); + // glDisable(GL_LIGHTING); + // glDisable(GL_DEPTH_TEST); + font->drawShadow(countStr, x + 19 - 2 - font->width(countStr), + y + 6 + 3, 0xFFFFFF); + // glEnable(GL_LIGHTING); + // glEnable(GL_DEPTH_TEST); + } + if (item->isDamaged()) { + float p = std::floor(13.5f - (float) item->getDamageValue() * 13.0f / (float) item->getMaxDamage() + 0.5); + int cc = (int) std::floor(255.5f - (float) item->getDamageValue() * 255.0f / (float) item->getMaxDamage() + 0.5); + // glDisable(GL_LIGHTING); + // glDisable(GL_DEPTH_TEST); + // glDisable(GL_TEXTURE_2D); + // auto var8 = ::net::minecraft::client::renderer::Tesselator::instance(); + Tesselator& t = Tesselator::instance; + int ca = 255 - cc << 16 | cc << 8; + int cb = (255 - cc) / 4 << 16 | 16128; + fillRect(t, x + 2, y + 13, 13, 2, 0); + fillRect(t, x + 2, y + 13, 12, 1, cb); + fillRect(t, x + 2, y + 13, p, 1, ca); + // glEnable(GL_TEXTURE_2D); + // glEnable(GL_LIGHTING); + // glEnable(GL_DEPTH_TEST); + glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + } + } +} + +void ItemRenderer::renderGuiItemDecorations(const ItemInstance* item, float x, float y) { // nothing changed here this is the normal pocket edition one. if (!item) return; if (item->count > 0 && item->isDamaged()) { float p = std::floor(13.5f - (float) item->getDamageValue() * 13.0f / (float) item->getMaxDamage()); diff --git a/src/client/renderer/entity/ItemRenderer.h b/src/client/renderer/entity/ItemRenderer.h index 9fb88f6..a104dc7 100755 --- a/src/client/renderer/entity/ItemRenderer.h +++ b/src/client/renderer/entity/ItemRenderer.h @@ -22,7 +22,7 @@ public: static void renderGuiItem(Font* font, Textures* textures, const ItemInstance* item, float x, float y, bool fancy); static void renderGuiItem(Font* font, Textures* textures, const ItemInstance* item, float x, float y, float w, float h, bool fancy); static void renderGuiItemCorrect(Font* font, Textures* textures, const ItemInstance* item, int x, int y); - //void renderGuiItemDecorations(Font* font, Textures* textures, ItemInstance* item, int x, int y); + static void renderGuiItemDecorations(Font* font, Textures* textures, ItemInstance* item, int x, int y); static void renderGuiItemDecorations(const ItemInstance* item, float x, float y); static void blit(float x, float y, float sx, float sy, float w, float h); diff --git a/src/client/renderer/entity/MobRenderer.cpp b/src/client/renderer/entity/MobRenderer.cpp index 51ccee9..3d6b3d9 100755 --- a/src/client/renderer/entity/MobRenderer.cpp +++ b/src/client/renderer/entity/MobRenderer.cpp @@ -135,7 +135,7 @@ void MobRenderer::render(Entity* e, float x, float y, float z, float rot, float //glEnable2(GL_DEPTH_TEST); glPopMatrix2(); - + postRender(mob, x, y, z, rot, a); renderName(mob, x, y, z); } diff --git a/src/util/Color.cpp b/src/util/Color.cpp new file mode 100644 index 0000000..9afaa5c --- /dev/null +++ b/src/util/Color.cpp @@ -0,0 +1,98 @@ +#include "Mth.h" + +#include "Color.h" +#include + +//Creates an opaque sRGB color with the specified red, green, and blue values in the range (0.0 - 1.0). +//Alpha is defaulted to 1.0. The actual color used in rendering depends on finding the best match given the color space +//available for a particular output device. +//Parameters: +//r - the red component +//g - the green component +//b - the blue component +//Throws: +//IllegalArgumentException - if r, g or b are outside of the range 0.0 to 1.0, inclusive +Color::Color( float r, float g, float b) +{ + assert( r >= 0.0f && r <= 1.0f ); + assert( g >= 0.0f && g <= 1.0f ); + assert( b >= 0.0f && b <= 1.0f ); + + //argb + colour = ( (0xFF<<24) | ( (int)(r*255)<<16 ) | ( (int)(g*255)<<8 ) | ( (int)(b*255) ) ); +} + +Color::Color( int r, int g, int b) +{ + colour = ( (0xFF<<24) | ( (r&0xff)<<16 ) | ( (g&0xff)<<8 ) | ( (b&0xff) ) ); +} + + +//Creates a Color object based on the specified values for the HSB color model. +//The s and b components should be floating-point values between zero and one (numbers in the range 0.0-1.0). +//The h component can be any floating-point number. The floor of this number is subtracted from it to create a fraction between 0 and 1. +//This fractional number is then multiplied by 360 to produce the hue angle in the HSB color model. +// +//Parameters: +//h - the hue component +//s - the saturation of the color +//b - the brightness of the color +//Returns: +//a Color object with the specified hue, saturation, and brightness. +Color Color::getHSBColor(float hue, float saturation, float brightness) +{ + int r = 0, g = 0, b = 0; + if (saturation == 0) + { + r = g = b = (int) (brightness * 255.0f + 0.5f); + } + else + { + float h = (hue - (float)floor(hue)) * 6.0f; + float f = h - (float)floor(h); + float p = brightness * (1.0f - saturation); + float q = brightness * (1.0f - saturation * f); + float t = brightness * (1.0f - (saturation * (1.0f - f))); + switch ((int) h) + { + case 0: + r = (int) (brightness * 255.0f + 0.5f); + g = (int) (t * 255.0f + 0.5f); + b = (int) (p * 255.0f + 0.5f); + break; + case 1: + r = (int) (q * 255.0f + 0.5f); + g = (int) (brightness * 255.0f + 0.5f); + b = (int) (p * 255.0f + 0.5f); + break; + case 2: + r = (int) (p * 255.0f + 0.5f); + g = (int) (brightness * 255.0f + 0.5f); + b = (int) (t * 255.0f + 0.5f); + break; + case 3: + r = (int) (p * 255.0f + 0.5f); + g = (int) (q * 255.0f + 0.5f); + b = (int) (brightness * 255.0f + 0.5f); + break; + case 4: + r = (int) (t * 255.0f + 0.5f); + g = (int) (p * 255.0f + 0.5f); + b = (int) (brightness * 255.0f + 0.5f); + break; + case 5: + r = (int) (brightness * 255.0f + 0.5f); + g = (int) (p * 255.0f + 0.5f); + b = (int) (q * 255.0f + 0.5f); + break; + } + } + + + return Color( r, g, b ); +} + +int Color::getRGB() +{ + return colour; +} \ No newline at end of file diff --git a/src/util/Color.h b/src/util/Color.h new file mode 100644 index 0000000..a9d31ec --- /dev/null +++ b/src/util/Color.h @@ -0,0 +1,15 @@ +#pragma once + +class Color +{ +private: + int colour; + +public: + //Creates an opaque sRGB color with the specified red, green, and blue values in the range (0.0 - 1.0). + Color( float r, float g, float b); + Color( int r, int g, int b); + + static Color getHSBColor(float h, float s, float b); + int getRGB(); +}; \ No newline at end of file diff --git a/src/world/entity/player/Inventory.cpp b/src/world/entity/player/Inventory.cpp index 5a46535..480627b 100755 --- a/src/world/entity/player/Inventory.cpp +++ b/src/world/entity/player/Inventory.cpp @@ -245,6 +245,7 @@ void Inventory::setupDefault() { addItem(new ItemInstance(Item::seeds_melon)); addItem(new ItemInstance(Item::dye_powder, 1, DyePowderItem::WHITE)); addItem(new ItemInstance(Item::hoe_iron)); + addItem(new ItemInstance(Item::flintAndSteel)); #ifdef RPI Sel[0] = addItem(new ItemInstance(Item::sword_iron)); #else diff --git a/src/world/level/Level.cpp b/src/world/level/Level.cpp index c9132f5..bb5ac0e 100755 --- a/src/world/level/Level.cpp +++ b/src/world/level/Level.cpp @@ -30,7 +30,7 @@ #include "../../network/packet/ExplodePacket.h" Level::Level(LevelStorage* levelStorage, const std::string& levelName, const LevelSettings& settings, int generatorVersion, Dimension* fixedDimension /* = NULL */) -: levelStorage(levelStorage), + : levelStorage(levelStorage), isClientSide(false), isFindingSpawn(false), noNeighborUpdate(false), @@ -52,7 +52,7 @@ Level::Level(LevelStorage* levelStorage, const std::string& levelName, const Lev allPlayersAreSleeping(false), _nightMode(false) { - _init(levelName, settings, generatorVersion, fixedDimension); + _init(levelName, settings, generatorVersion, fixedDimension); } Level::~Level() { @@ -85,14 +85,14 @@ void Level::_init(const std::string& levelName, const LevelSettings& settings, i isGeneratingTerrain = false; LevelData* preparedData = levelStorage->prepareLevel(this); - _isNew = (preparedData == NULL); + _isNew = (preparedData == NULL); - if (preparedData == NULL) { - levelData = LevelData(settings, levelName, generatorVersion); - } else { + if (preparedData == NULL) { + levelData = LevelData(settings, levelName, generatorVersion); + } else { levelData = *preparedData; - levelData.setLevelName(levelName); - } + levelData.setLevelName(levelName); + } if (fixedDimension != NULL) { dimension = fixedDimension; @@ -100,12 +100,12 @@ void Level::_init(const std::string& levelName, const LevelSettings& settings, i dimension = DimensionFactory::createDefaultDimension( &levelData ); } - dimension->init(this); - _chunkSource = createChunkSource(); + dimension->init(this); + _chunkSource = createChunkSource(); _pathFinder = new PathFinder(); _nightMode = false; - updateSkyBrightness(); + updateSkyBrightness(); } /*protected*/ @@ -121,63 +121,63 @@ ChunkSource* Level::createChunkSource() { /*public*/ bool Level::checkAndHandleWater(const AABB& box, const Material* material, Entity* e) { - int x0 = Mth::floor(box.x0); - int x1 = Mth::floor(box.x1 + 1); + int x0 = Mth::floor(box.x0); + int x1 = Mth::floor(box.x1 + 1); - int y0 = Mth::floor(box.y0); - int y1 = Mth::floor(box.y1 + 1); + int y0 = Mth::floor(box.y0); + int y1 = Mth::floor(box.y1 + 1); - int z0 = Mth::floor(box.z0); - int z1 = Mth::floor(box.z1 + 1); + int z0 = Mth::floor(box.z0); + int z1 = Mth::floor(box.z1 + 1); - if (!hasChunksAt(x0, y0, z0, x1, y1, z1)) { - return false; - } + if (!hasChunksAt(x0, y0, z0, x1, y1, z1)) { + return false; + } - bool ok = false; - Vec3 current(0,0,0); - for (int x = x0; x < x1; x++) - for (int y = y0; y < y1; y++) - for (int z = z0; z < z1; z++) { - Tile* tile = Tile::tiles[getTile(x, y, z)]; - if (tile != NULL && tile->material == material) { - float yt0 = y + 1 - LiquidTile::getHeight(getData(x, y, z)); - if (y1 >= yt0) { - ok = true; - tile->handleEntityInside(this, x, y, z, e, current); - } - } - } - float len = current.length(); - if (len > 0) { - const float pow = 0.004f / len; - e->xd += current.x * pow; - e->yd += current.y * pow; - e->zd += current.z * pow; - } - return ok; + bool ok = false; + Vec3 current(0,0,0); + for (int x = x0; x < x1; x++) + for (int y = y0; y < y1; y++) + for (int z = z0; z < z1; z++) { + Tile* tile = Tile::tiles[getTile(x, y, z)]; + if (tile != NULL && tile->material == material) { + float yt0 = y + 1 - LiquidTile::getHeight(getData(x, y, z)); + if (y1 >= yt0) { + ok = true; + tile->handleEntityInside(this, x, y, z, e, current); + } + } + } + float len = current.length(); + if (len > 0) { + const float pow = 0.004f / len; + e->xd += current.x * pow; + e->yd += current.y * pow; + e->zd += current.z * pow; + } + return ok; } /*public*/ Player* Level::getNearestPlayer(Entity* source, float maxDist) { - return getNearestPlayer(source->x, source->y, source->z, maxDist); + return getNearestPlayer(source->x, source->y, source->z, maxDist); } /*public*/ Player* Level::getNearestPlayer(float x, float y, float z, float maxDist) { - float maxDistSqr = maxDist * maxDist; + float maxDistSqr = maxDist * maxDist; float best = -1; - Player* result = NULL; - for (unsigned int i = 0; i < players.size(); i++) { - Player* p = players[i]; + Player* result = NULL; + for (unsigned int i = 0; i < players.size(); i++) { + Player* p = players[i]; if (p->removed) continue; float dist = p->distanceToSqr(x, y, z); - if ((maxDist < 0 || dist < maxDistSqr) && (best == -1 || dist < best)) { - best = dist; - result = p; - } - } - return result; + if ((maxDist < 0 || dist < maxDistSqr) && (best == -1 || dist < best)) { + best = dist; + result = p; + } + } + return result; } /*public*/ @@ -189,7 +189,7 @@ void Level::tick() { _mobSpawnTick = 0; TIMER_PUSH("mobSpawner"); MobSpawner::tick(this, _spawnEnemies && difficulty > Difficulty::PEACEFUL, - _spawnFriendlies && (levelData.getTime() % 400) < MobSpawnInterval); + _spawnFriendlies && (levelData.getTime() % 400) < MobSpawnInterval); TIMER_POP(); } } @@ -231,7 +231,7 @@ void Level::tick() { tickPendingTicks(false); TIMER_POP_PUSH("tickTiles"); - tickTiles(); + tickTiles(); TIMER_POP_PUSH("sendEntityData"); for (unsigned int i = 0; i < entities.size(); ++i) { @@ -255,7 +255,7 @@ void Level::tick() { /*protected*/ void Level::tickTiles() { - _chunksToPoll.clear(); + _chunksToPoll.clear(); static const int pollChunkOffsets[] = { -1,-4, 0,-4, 1,-4, -2,-3, -1,-3, 0,-3, 1,-3, 2,-3, -3,-2, @@ -270,10 +270,10 @@ void Level::tickTiles() { TIMER_PUSH("buildList"); //static Stopwatch w; //w.start(); - for (size_t i = 0; i < players.size(); i++) { - Player* player = players[i]; - int xx = Mth::floor(player->x / 16); - int zz = Mth::floor(player->z / 16); + for (size_t i = 0; i < players.size(); i++) { + Player* player = players[i]; + int xx = Mth::floor(player->x / 16); + int zz = Mth::floor(player->z / 16); for (int i = 0; i < pollChunkOffsetsSize; i += 2) { const int xp = xx + pollChunkOffsets[i]; @@ -282,114 +282,114 @@ void Level::tickTiles() { zp >= 0 && zp < CHUNK_CACHE_WIDTH) _chunksToPoll.insert(ChunkPos(xp, zp)); } - } + } TIMER_POP(); - //if (delayUntilNextMoodSound > 0) delayUntilNextMoodSound--; + //if (delayUntilNextMoodSound > 0) delayUntilNextMoodSound--; TIMER_PUSH("loop"); - for (ChunkPosSet::iterator it = _chunksToPoll.begin(); it != _chunksToPoll.end(); ++it) { + for (ChunkPosSet::iterator it = _chunksToPoll.begin(); it != _chunksToPoll.end(); ++it) { const ChunkPos& cp = *it; - int xo = cp.x * 16; - int zo = cp.z * 16; - // LevelSource region = new Region(this, xo, 0, zo, xo + 16, 128, zo + 16); + int xo = cp.x * 16; + int zo = cp.z * 16; + // LevelSource region = new Region(this, xo, 0, zo, xo + 16, 128, zo + 16); TIMER_PUSH("getChunk"); - LevelChunk* lc = this->getChunk(cp.x, cp.z); + LevelChunk* lc = this->getChunk(cp.x, cp.z); TIMER_POP_PUSH("tickChunk"); //lc->tick(); - //if (delayUntilNextMoodSound == 0) { - // randValue = randValue * 3 + addend; - // int val = (randValue >> 2); - // int x = (val & 15); - // int z = ((val >> 8) & 15); - // int y = ((val >> 16) & 127); + //if (delayUntilNextMoodSound == 0) { + // randValue = randValue * 3 + addend; + // int val = (randValue >> 2); + // int x = (val & 15); + // int z = ((val >> 8) & 15); + // int y = ((val >> 16) & 127); - // int id = lc->getTile(x, y, z); - // x += xo; - // z += zo; - // if (id == 0 && getRawBrightness(x, y, z) <= random.nextInt(8) && getBrightness(LightLayer::Sky, x, y, z) <= 0) { - // Player* player = getNearestPlayer(x + 0.5, y + 0.5, z + 0.5, 8); - // if (player != NULL && player.distanceToSqr(x + 0.5, y + 0.5, z + 0.5) > 2 * 2) { - // //this.playSound(x + 0.5, y + 0.5, z + 0.5, "ambient.cave.cave", 0.7f, 0.8f + random.nextFloat() * 0.2f); - // delayUntilNextMoodSound = random.nextInt(20 * 60 * 10) + 20 * 60 * 5; - // } - // } - //} + // int id = lc->getTile(x, y, z); + // x += xo; + // z += zo; + // if (id == 0 && getRawBrightness(x, y, z) <= random.nextInt(8) && getBrightness(LightLayer::Sky, x, y, z) <= 0) { + // Player* player = getNearestPlayer(x + 0.5, y + 0.5, z + 0.5, 8); + // if (player != NULL && player.distanceToSqr(x + 0.5, y + 0.5, z + 0.5) > 2 * 2) { + // //this.playSound(x + 0.5, y + 0.5, z + 0.5, "ambient.cave.cave", 0.7f, 0.8f + random.nextFloat() * 0.2f); + // delayUntilNextMoodSound = random.nextInt(20 * 60 * 10) + 20 * 60 * 5; + // } + // } + //} TIMER_POP_PUSH("tickTiles"); - for (int i = 0; i < 20; i++) { //@todo: CHUNK_TILE_TICK_COUNT - _randValue = _randValue * 3 + _addend; - int val = (_randValue >> 2); - int x = (val & 15); - int z = ((val >> 8) & 15); - int y = ((val >> 16) & 127); + for (int i = 0; i < 20; i++) { //@todo: CHUNK_TILE_TICK_COUNT + _randValue = _randValue * 3 + _addend; + int val = (_randValue >> 2); + int x = (val & 15); + int z = ((val >> 8) & 15); + int y = ((val >> 16) & 127); - int id = lc->getTile(x, y, z); - if (Tile::shouldTick[id]) { - Tile::tiles[id]->tick(this, x + xo, y, z + zo, &random); - } - } + int id = lc->getTile(x, y, z); + if (Tile::shouldTick[id]) { + Tile::tiles[id]->tick(this, x + xo, y, z + zo, &random); + } + } TIMER_POP(); - } + } TIMER_POP(); //w.stop(); //w.printEvery(30, "ticktiles"); } bool Level::tickPendingTicks(bool force) { - int count = _tickNextTickSet.size(); - if (count > MAX_TICK_TILES_PER_TICK) count = MAX_TICK_TILES_PER_TICK; - for (int i = 0; i < count; i++) { + int count = _tickNextTickSet.size(); + if (count > MAX_TICK_TILES_PER_TICK) count = MAX_TICK_TILES_PER_TICK; + for (int i = 0; i < count; i++) { TickDataSet::iterator td = _tickNextTickSet.begin(); - if (!force && td->delay > levelData.getTime()) { - break; - } + if (!force && td->delay > levelData.getTime()) { + break; + } int r = 8; - if (hasChunksAt(td->x - r, td->y - r, td->z - r, td->x + r, td->y + r, td->z + r)) { - int id = getTile(td->x, td->y, td->z); - if (id == td->tileId && id > 0) { - Tile::tiles[id]->tick(this, td->x, td->y, td->z, &random); - } - } - _tickNextTickSet.erase(td); - } - return _tickNextTickSet.size() != 0; + if (hasChunksAt(td->x - r, td->y - r, td->z - r, td->x + r, td->y + r, td->z + r)) { + int id = getTile(td->x, td->y, td->z); + if (id == td->tileId && id > 0) { + Tile::tiles[id]->tick(this, td->x, td->y, td->z, &random); + } + } + _tickNextTickSet.erase(td); + } + return _tickNextTickSet.size() != 0; } /*public*/ void Level::loadPlayer(Player* player, bool doAddPlayer /*= true*/) { if (player) { CompoundTag* loadedPlayerTag = levelData.getLoadedPlayerTag(); - if (loadedPlayerTag != NULL) { - player->load(loadedPlayerTag); - levelData.setLoadedPlayerTag(NULL); - } else { + if (loadedPlayerTag != NULL) { + player->load(loadedPlayerTag); + levelData.setLoadedPlayerTag(NULL); + } else { levelData.setLoadedPlayerTo(player); } if (doAddPlayer) addEntity(player); } - //} catch (Exception e) { - // e.printStackTrace(); - //} + //} catch (Exception e) { + // e.printStackTrace(); + //} } bool Level::findPath(Path* path, Entity* from, Entity* to, float maxDist, bool canOpenDoors, bool avoidWater) { - TIMER_PUSH("pathfind"); + TIMER_PUSH("pathfind"); int x = Mth::floor(from->x); - int y = Mth::floor(from->y); - int z = Mth::floor(from->z); + int y = Mth::floor(from->y); + int z = Mth::floor(from->z); - int r = (int) (maxDist + 16); - int x1 = x - r; - int y1 = y - r; - int z1 = z - r; - int x2 = x + r; - int y2 = y + r; - int z2 = z + r; + int r = (int) (maxDist + 16); + int x1 = x - r; + int y1 = y - r; + int z1 = z - r; + int x2 = x + r; + int y2 = y + r; + int z2 = z + r; //LOGI("trying to move! 1: %ld\n", levelData.getTime()); - Region region(this, x1, y1, z1, x2, y2, z2); + Region region(this, x1, y1, z1, x2, y2, z2); _pathFinder->setLevelSource(®ion); _pathFinder->canOpenDoors = canOpenDoors; _pathFinder->avoidWater = avoidWater; @@ -399,24 +399,24 @@ bool Level::findPath(Path* path, Entity* from, Entity* to, float maxDist, bool c } bool Level::findPath(Path* path, Entity* from, int xBest, int yBest, int zBest, float maxDist, bool canOpenDoors, bool avoidWater) { - TIMER_PUSH("pathfind"); + TIMER_PUSH("pathfind"); int x = Mth::floor(from->x); - int y = Mth::floor(from->y); - int z = Mth::floor(from->z); + int y = Mth::floor(from->y); + int z = Mth::floor(from->z); - int r = (int) (maxDist + 8); - int x1 = x - r; - int y1 = y - r; - int z1 = z - r; - int x2 = x + r; - int y2 = y + r; - int z2 = z + r; - Region region(this, x1, y1, z1, x2, y2, z2); + int r = (int) (maxDist + 8); + int x1 = x - r; + int y1 = y - r; + int z1 = z - r; + int x2 = x + r; + int y2 = y + r; + int z2 = z + r; + Region region(this, x1, y1, z1, x2, y2, z2); //LOGI("trying to move! 2: %ld\n", levelData.getTime()); _pathFinder->setLevelSource(®ion); _pathFinder->canOpenDoors = canOpenDoors; _pathFinder->avoidWater = avoidWater; - _pathFinder->findPath(path, from, xBest, yBest, zBest, maxDist); + _pathFinder->findPath(path, from, xBest, yBest, zBest, maxDist); TIMER_POP(); return true; } @@ -427,57 +427,57 @@ bool Level::findPath(Path* path, Entity* from, int xBest, int yBest, int zBest, */ /*protected*/ void Level::setInitialSpawn() { - isFindingSpawn = true; - int xSpawn = CHUNK_CACHE_WIDTH * CHUNK_WIDTH / 2; // (Level.MAX_LEVEL_SIZE - 100) * 0; - int ySpawn = 64; - int zSpawn = CHUNK_CACHE_WIDTH * CHUNK_DEPTH / 2; // (Level.MAX_LEVEL_SIZE - 100) * 0; - while (!dimension->isValidSpawn(xSpawn, zSpawn)) { - xSpawn += random.nextInt(32) - random.nextInt(32); - zSpawn += random.nextInt(32) - random.nextInt(32); + isFindingSpawn = true; + int xSpawn = CHUNK_CACHE_WIDTH * CHUNK_WIDTH / 2; // (Level.MAX_LEVEL_SIZE - 100) * 0; + int ySpawn = 64; + int zSpawn = CHUNK_CACHE_WIDTH * CHUNK_DEPTH / 2; // (Level.MAX_LEVEL_SIZE - 100) * 0; + while (!dimension->isValidSpawn(xSpawn, zSpawn)) { + xSpawn += random.nextInt(32) - random.nextInt(32); + zSpawn += random.nextInt(32) - random.nextInt(32); if (xSpawn < 4) xSpawn += 32; if (xSpawn >= LEVEL_WIDTH-4) xSpawn -= 32; if (zSpawn < 4) zSpawn += 32; if (zSpawn >= LEVEL_DEPTH-4) zSpawn -= 32; - } - levelData.setSpawn(xSpawn, ySpawn, zSpawn); - isFindingSpawn = false; + } + levelData.setSpawn(xSpawn, ySpawn, zSpawn); + isFindingSpawn = false; } /*public*/ void Level::validateSpawn() { - if (levelData.getYSpawn() <= 0) { - levelData.setYSpawn(64); - } - int xSpawn = levelData.getXSpawn(); - int zSpawn = levelData.getZSpawn(); - while (getTopTile(xSpawn, zSpawn) == 0 || getTopTile(xSpawn, zSpawn) == Tile::invisible_bedrock->id) { - xSpawn += random.nextInt(8) - random.nextInt(8); - zSpawn += random.nextInt(8) - random.nextInt(8); + if (levelData.getYSpawn() <= 0) { + levelData.setYSpawn(64); + } + int xSpawn = levelData.getXSpawn(); + int zSpawn = levelData.getZSpawn(); + while (getTopTile(xSpawn, zSpawn) == 0 || getTopTile(xSpawn, zSpawn) == Tile::invisible_bedrock->id) { + xSpawn += random.nextInt(8) - random.nextInt(8); + zSpawn += random.nextInt(8) - random.nextInt(8); if (xSpawn < 4) xSpawn += 8; if (xSpawn >= LEVEL_WIDTH-4) xSpawn -= 8; if (zSpawn < 4) zSpawn += 8; if (zSpawn >= LEVEL_DEPTH-4) zSpawn -= 8; - } - levelData.setXSpawn(xSpawn); - levelData.setZSpawn(zSpawn); + } + levelData.setXSpawn(xSpawn); + levelData.setZSpawn(zSpawn); } int Level::getTopTile(int x, int z) { - int y = 63; - while (!isEmptyTile(x, y + 1, z)) { - y++; - } - return getTile(x, y, z); + int y = 63; + while (!isEmptyTile(x, y + 1, z)) { + y++; + } + return getTile(x, y, z); } int Level::getTopTileY(int x, int z) { - int y = 63; - while (!isEmptyTile(x, y + 1, z)) { - y++; - } - return y; + int y = 63; + while (!isEmptyTile(x, y + 1, z)) { + y++; + } + return y; } // // void clearLoadedPlayerData() { @@ -513,101 +513,101 @@ void Level::saveLevelData() { //} int Level::getTile(int x, int y, int z) { - //if (x < -MAX_LEVEL_SIZE || z < -MAX_LEVEL_SIZE || x >= MAX_LEVEL_SIZE || z > MAX_LEVEL_SIZE) { - // return 0; - //} - if (y < 0) return 0; - if (y >= DEPTH) return 0; + //if (x < -MAX_LEVEL_SIZE || z < -MAX_LEVEL_SIZE || x >= MAX_LEVEL_SIZE || z > MAX_LEVEL_SIZE) { + // return 0; + //} + if (y < 0) return 0; + if (y >= DEPTH) return 0; //if (z == 128) { // int a = 0; //} //LOGI("%d ", z); - return getChunk(x >> 4, z >> 4)->getTile(x & 15, y, z & 15); + return getChunk(x >> 4, z >> 4)->getTile(x & 15, y, z & 15); } bool Level::isEmptyTile(int x, int y, int z) { - return getTile(x, y, z) == 0; + return getTile(x, y, z) == 0; } bool Level::hasChunkAt(int x, int y, int z) { - if (y < 0 || y >= Level::DEPTH) return false; - return hasChunk(x >> 4, z >> 4); + if (y < 0 || y >= Level::DEPTH) return false; + return hasChunk(x >> 4, z >> 4); } bool Level::hasChunksAt(int x, int y, int z, int r) { - return hasChunksAt(x - r, y - r, z - r, x + r, y + r, z + r); + return hasChunksAt(x - r, y - r, z - r, x + r, y + r, z + r); } bool Level::hasChunksAt(int x0, int y0, int z0, int x1, int y1, int z1) { - if (y1 < 0 || y0 >= Level::DEPTH) return false; + if (y1 < 0 || y0 >= Level::DEPTH) return false; - x0 >>= 4; - z0 >>= 4; - x1 >>= 4; - z1 >>= 4; + x0 >>= 4; + z0 >>= 4; + x1 >>= 4; + z1 >>= 4; - for (int x = x0; x <= x1; x++) - for (int z = z0; z <= z1; z++) - if (!hasChunk(x, z)) return false; + for (int x = x0; x <= x1; x++) + for (int z = z0; z <= z1; z++) + if (!hasChunk(x, z)) return false; - return true; + return true; } bool Level::hasChunk(int x, int z) { - return _chunkSource->hasChunk(x, z); + return _chunkSource->hasChunk(x, z); } LevelChunk* Level::getChunkAt(int x, int z) { - return getChunk(x >> 4, z >> 4); + return getChunk(x >> 4, z >> 4); } LevelChunk* Level::getChunk(int x, int z) { - return _chunkSource->getChunk(x, z); + return _chunkSource->getChunk(x, z); } bool Level::setTileAndDataNoUpdate(int x, int y, int z, int tile, int data) { - //if (x < -MAX_LEVEL_SIZE || z < -MAX_LEVEL_SIZE || x >= MAX_LEVEL_SIZE || z > MAX_LEVEL_SIZE) { - // return false; - //} - if (y < 0) return false; - if (y >= DEPTH) return false; - LevelChunk* c = getChunk(x >> 4, z >> 4); - return c->setTileAndData(x & 15, y, z & 15, tile, data); + //if (x < -MAX_LEVEL_SIZE || z < -MAX_LEVEL_SIZE || x >= MAX_LEVEL_SIZE || z > MAX_LEVEL_SIZE) { + // return false; + //} + if (y < 0) return false; + if (y >= DEPTH) return false; + LevelChunk* c = getChunk(x >> 4, z >> 4); + return c->setTileAndData(x & 15, y, z & 15, tile, data); } bool Level::setTileNoUpdate(int x, int y, int z, int tile) { - //if (x < -MAX_LEVEL_SIZE || z < -MAX_LEVEL_SIZE || x >= MAX_LEVEL_SIZE || z > MAX_LEVEL_SIZE) { - // return false; - //} - if (y < 0) return false; - if (y >= DEPTH) return false; - LevelChunk* c = getChunk(x >> 4, z >> 4); - return c->setTile(x & 15, y, z & 15, tile); + //if (x < -MAX_LEVEL_SIZE || z < -MAX_LEVEL_SIZE || x >= MAX_LEVEL_SIZE || z > MAX_LEVEL_SIZE) { + // return false; + //} + if (y < 0) return false; + if (y >= DEPTH) return false; + LevelChunk* c = getChunk(x >> 4, z >> 4); + return c->setTile(x & 15, y, z & 15, tile); } const Material* Level::getMaterial(int x, int y, int z) { - int t = getTile(x, y, z); - if (t == 0) return Material::air; - return Tile::tiles[t]->material; + int t = getTile(x, y, z); + if (t == 0) return Material::air; + return Tile::tiles[t]->material; } int Level::getData(int x, int y, int z) { - //if (x < -MAX_LEVEL_SIZE || z < -MAX_LEVEL_SIZE || x >= MAX_LEVEL_SIZE || z > MAX_LEVEL_SIZE) { - // return 0; - //} - if (y < 0) return 0; - if (y >= DEPTH) return 0; - LevelChunk* c = getChunk(x >> 4, z >> 4); - x &= 15; - z &= 15; - return c->getData(x, y, z); + //if (x < -MAX_LEVEL_SIZE || z < -MAX_LEVEL_SIZE || x >= MAX_LEVEL_SIZE || z > MAX_LEVEL_SIZE) { + // return 0; + //} + if (y < 0) return 0; + if (y >= DEPTH) return 0; + LevelChunk* c = getChunk(x >> 4, z >> 4); + x &= 15; + z &= 15; + return c->getData(x, y, z); } void Level::setData(int x, int y, int z, int data) { //// @newway //if (setDataNoUpdate(x, y, z, data)) { - // int t = getTile(x, y, z); + // int t = getTile(x, y, z); // if (Tile::sendTileData[t]) { // tileUpdated(x, y, z, t); // } else { @@ -616,20 +616,20 @@ void Level::setData(int x, int y, int z, int data) { //} // @oldway - if (setDataNoUpdate(x, y, z, data)) { - tileUpdated(x, y, z, getTile(x, y, z)); - } + if (setDataNoUpdate(x, y, z, data)) { + tileUpdated(x, y, z, getTile(x, y, z)); + } } bool Level::setDataNoUpdate(int x, int y, int z, int data) { - //if (x < -MAX_LEVEL_SIZE || z < -MAX_LEVEL_SIZE || x >= MAX_LEVEL_SIZE || z > MAX_LEVEL_SIZE) { - // return false; - //} - if (y < 0) return false; - if (y >= DEPTH) return false; - LevelChunk* c = getChunk(x >> 4, z >> 4); - x &= 15; - z &= 15; + //if (x < -MAX_LEVEL_SIZE || z < -MAX_LEVEL_SIZE || x >= MAX_LEVEL_SIZE || z > MAX_LEVEL_SIZE) { + // return false; + //} + if (y < 0) return false; + if (y >= DEPTH) return false; + LevelChunk* c = getChunk(x >> 4, z >> 4); + x &= 15; + z &= 15; //return c->setData(x, y, z, data); @@ -641,148 +641,148 @@ bool Level::setDataNoUpdate(int x, int y, int z, int data) { } bool Level::setTile(int x, int y, int z, int tile) { - if (setTileNoUpdate(x, y, z, tile)) { + if (setTileNoUpdate(x, y, z, tile)) { //printf("TILE UPDATED %d, %d, %d\n", x, y, z); - tileUpdated(x, y, z, tile); - return true; - } - return false; + tileUpdated(x, y, z, tile); + return true; + } + return false; } bool Level::setTileAndData(int x, int y, int z, int tile, int data) { - if (setTileAndDataNoUpdate(x, y, z, tile, data)) { - tileUpdated(x, y, z, tile); - return true; - } - return false; + if (setTileAndDataNoUpdate(x, y, z, tile, data)) { + tileUpdated(x, y, z, tile); + return true; + } + return false; } void Level::sendTileUpdated(int x, int y, int z) { - for (unsigned int i = 0; i < _listeners.size(); i++) { - _listeners[i]->tileChanged(x, y, z); - } + for (unsigned int i = 0; i < _listeners.size(); i++) { + _listeners[i]->tileChanged(x, y, z); + } } /*protected*/ void Level::tileUpdated(int x, int y, int z, int tile) { - sendTileUpdated(x, y, z); - this->updateNeighborsAt(x, y, z, tile); + sendTileUpdated(x, y, z); + this->updateNeighborsAt(x, y, z, tile); } void Level::lightColumnChanged(int x, int z, int y0, int y1) { - if (y0 > y1) { - int tmp = y1; - y1 = y0; - y0 = tmp; - } - setTilesDirty(x, y0, z, x, y1, z); + if (y0 > y1) { + int tmp = y1; + y1 = y0; + y0 = tmp; + } + setTilesDirty(x, y0, z, x, y1, z); } void Level::setTileDirty(int x, int y, int z) { - for (unsigned int i = 0; i < _listeners.size(); i++) { - _listeners[i]->setTilesDirty(x, y, z, x, y, z); - } + for (unsigned int i = 0; i < _listeners.size(); i++) { + _listeners[i]->setTilesDirty(x, y, z, x, y, z); + } } void Level::setTilesDirty(int x0, int y0, int z0, int x1, int y1, int z1) { - for (unsigned int i = 0; i < _listeners.size(); i++) { - _listeners[i]->setTilesDirty(x0, y0, z0, x1, y1, z1); - } + for (unsigned int i = 0; i < _listeners.size(); i++) { + _listeners[i]->setTilesDirty(x0, y0, z0, x1, y1, z1); + } } void Level::swap(int x1, int y1, int z1, int x2, int y2, int z2) { - int t1 = getTile(x1, y1, z1); - int d1 = getData(x1, y1, z1); - int t2 = getTile(x2, y2, z2); - int d2 = getData(x2, y2, z2); + int t1 = getTile(x1, y1, z1); + int d1 = getData(x1, y1, z1); + int t2 = getTile(x2, y2, z2); + int d2 = getData(x2, y2, z2); - setTileAndDataNoUpdate(x1, y1, z1, t2, d2); - setTileAndDataNoUpdate(x2, y2, z2, t1, d1); + setTileAndDataNoUpdate(x1, y1, z1, t2, d2); + setTileAndDataNoUpdate(x2, y2, z2, t1, d1); - updateNeighborsAt(x1, y1, z1, t2); - updateNeighborsAt(x2, y2, z2, t1); + updateNeighborsAt(x1, y1, z1, t2); + updateNeighborsAt(x2, y2, z2, t1); } void Level::updateNeighborsAt(int x, int y, int z, int tile) { - neighborChanged(x - 1, y, z, tile); - neighborChanged(x + 1, y, z, tile); - neighborChanged(x, y - 1, z, tile); - neighborChanged(x, y + 1, z, tile); - neighborChanged(x, y, z - 1, tile); - neighborChanged(x, y, z + 1, tile); + neighborChanged(x - 1, y, z, tile); + neighborChanged(x + 1, y, z, tile); + neighborChanged(x, y - 1, z, tile); + neighborChanged(x, y + 1, z, tile); + neighborChanged(x, y, z - 1, tile); + neighborChanged(x, y, z + 1, tile); } /*private*/ void Level::neighborChanged(int x, int y, int z, int type) { - if (noNeighborUpdate || isClientSide) return; - Tile* tile = Tile::tiles[getTile(x, y, z)]; - if (tile != NULL) tile->neighborChanged(this, x, y, z, type); + if (noNeighborUpdate || isClientSide) return; + Tile* tile = Tile::tiles[getTile(x, y, z)]; + if (tile != NULL) tile->neighborChanged(this, x, y, z, type); } bool Level::canSeeSky(int x, int y, int z) { - return getChunk(x >> 4, z >> 4)->isSkyLit(x & 15, y, z & 15); + return getChunk(x >> 4, z >> 4)->isSkyLit(x & 15, y, z & 15); } int Level::getRawBrightness(int x, int y, int z) { - return getRawBrightness(x, y, z, true); + return getRawBrightness(x, y, z, true); } int Level::getRawBrightness(int x, int y, int z, bool propagate) { - //if (x < -MAX_LEVEL_SIZE || z < -MAX_LEVEL_SIZE || x >= MAX_LEVEL_SIZE || z > MAX_LEVEL_SIZE) { - // return MAX_BRIGHTNESS; - //} + //if (x < -MAX_LEVEL_SIZE || z < -MAX_LEVEL_SIZE || x >= MAX_LEVEL_SIZE || z > MAX_LEVEL_SIZE) { + // return MAX_BRIGHTNESS; + //} - if (propagate) { - int id = getTile(x, y, z); - if (id == Tile::stoneSlabHalf->id || id == Tile::farmland->id) { - int br = getRawBrightness(x, y + 1, z, false); - int br1 = getRawBrightness(x + 1, y, z, false); - int br2 = getRawBrightness(x - 1, y, z, false); - int br3 = getRawBrightness(x, y, z + 1, false); - int br4 = getRawBrightness(x, y, z - 1, false); - if (br1 > br) br = br1; - if (br2 > br) br = br2; - if (br3 > br) br = br3; - if (br4 > br) br = br4; - return br; - } - } + if (propagate) { + int id = getTile(x, y, z); + if (id == Tile::stoneSlabHalf->id || id == Tile::farmland->id) { + int br = getRawBrightness(x, y + 1, z, false); + int br1 = getRawBrightness(x + 1, y, z, false); + int br2 = getRawBrightness(x - 1, y, z, false); + int br3 = getRawBrightness(x, y, z + 1, false); + int br4 = getRawBrightness(x, y, z - 1, false); + if (br1 > br) br = br1; + if (br2 > br) br = br2; + if (br3 > br) br = br3; + if (br4 > br) br = br4; + return br; + } + } - if (y < 0) return 0; - if (y >= DEPTH) { - int br = MAX_BRIGHTNESS - skyDarken; - if (br < 0) br = 0; - return br; - } + if (y < 0) return 0; + if (y >= DEPTH) { + int br = MAX_BRIGHTNESS - skyDarken; + if (br < 0) br = 0; + return br; + } - LevelChunk* c = getChunk(x >> 4, z >> 4); - x &= 15; - z &= 15; - return c->getRawBrightness(x, y, z, skyDarken); + LevelChunk* c = getChunk(x >> 4, z >> 4); + x &= 15; + z &= 15; + return c->getRawBrightness(x, y, z, skyDarken); } bool Level::isSkyLit(int x, int y, int z) { - //if (x < -MAX_LEVEL_SIZE || z < -MAX_LEVEL_SIZE || x >= MAX_LEVEL_SIZE || z > MAX_LEVEL_SIZE) { - // return false; - //} - if (y < 0) return false; - if (y >= DEPTH) return true; - if (!hasChunk(x >> 4, z >> 4)) return false; + //if (x < -MAX_LEVEL_SIZE || z < -MAX_LEVEL_SIZE || x >= MAX_LEVEL_SIZE || z > MAX_LEVEL_SIZE) { + // return false; + //} + if (y < 0) return false; + if (y >= DEPTH) return true; + if (!hasChunk(x >> 4, z >> 4)) return false; - LevelChunk* c = getChunk(x >> 4, z >> 4); - x &= 15; - z &= 15; + LevelChunk* c = getChunk(x >> 4, z >> 4); + x &= 15; + z &= 15; return c->isSkyLit(x, y, z); } int Level::getHeightmap(int x, int z) { - //if (x < -MAX_LEVEL_SIZE || z < -MAX_LEVEL_SIZE || x >= MAX_LEVEL_SIZE || z > MAX_LEVEL_SIZE) { - // return 0; - //} - if (!hasChunk(x >> 4, z >> 4)) return 0; + //if (x < -MAX_LEVEL_SIZE || z < -MAX_LEVEL_SIZE || x >= MAX_LEVEL_SIZE || z > MAX_LEVEL_SIZE) { + // return 0; + //} + if (!hasChunk(x >> 4, z >> 4)) return 0; - LevelChunk* c = getChunk(x >> 4, z >> 4); - return c->getHeightmap(x & 15, z & 15); + LevelChunk* c = getChunk(x >> 4, z >> 4); + return c->getHeightmap(x & 15, z & 15); } BiomeSource* Level::getBiomeSource() { @@ -793,45 +793,45 @@ Biome* Level::getBiome( int x, int z ) { } void Level::updateLightIfOtherThan(const LightLayer& layer, int x, int y, int z, int expected) { - if (dimension->hasCeiling && (&layer) == &LightLayer::Sky) return; + if (dimension->hasCeiling && (&layer) == &LightLayer::Sky) return; - if (!hasChunkAt(x, y, z)) return; + if (!hasChunkAt(x, y, z)) return; - if (&layer == &LightLayer::Sky) { - if (isSkyLit(x, y, z)) expected = 15; - } else if (&layer == &LightLayer::Block) { - int t = getTile(x, y, z); - if (Tile::lightEmission[t] > expected) expected = Tile::lightEmission[t]; - } + if (&layer == &LightLayer::Sky) { + if (isSkyLit(x, y, z)) expected = 15; + } else if (&layer == &LightLayer::Block) { + int t = getTile(x, y, z); + if (Tile::lightEmission[t] > expected) expected = Tile::lightEmission[t]; + } - if (getBrightness(layer, x, y, z) != expected) { - updateLight(layer, x, y, z, x, y, z); - } + if (getBrightness(layer, x, y, z) != expected) { + updateLight(layer, x, y, z, x, y, z); + } } int Level::getBrightness(const LightLayer& layer, int x, int y, int z) { - if (y < 0 || y >= DEPTH/* || x < -MAX_LEVEL_SIZE || z < -MAX_LEVEL_SIZE || x >= MAX_LEVEL_SIZE || z > MAX_LEVEL_SIZE*/) { - return layer.surrounding; - } - int xc = x >> 4; - int zc = z >> 4; - if (!hasChunk(xc, zc)) return 0; - LevelChunk* c = getChunk(xc, zc); - return c->getBrightness(layer, x & 15, y, z & 15); + if (y < 0 || y >= DEPTH/* || x < -MAX_LEVEL_SIZE || z < -MAX_LEVEL_SIZE || x >= MAX_LEVEL_SIZE || z > MAX_LEVEL_SIZE*/) { + return layer.surrounding; + } + int xc = x >> 4; + int zc = z >> 4; + if (!hasChunk(xc, zc)) return 0; + LevelChunk* c = getChunk(xc, zc); + return c->getBrightness(layer, x & 15, y, z & 15); } void Level::setBrightness(const LightLayer& layer, int x, int y, int z, int brightness) { - //if (x < -MAX_LEVEL_SIZE || z < -MAX_LEVEL_SIZE || x >= MAX_LEVEL_SIZE || z > MAX_LEVEL_SIZE) { - // return; - //} - if (y < 0) return; - if (y >= DEPTH) return; - if (!hasChunk(x >> 4, z >> 4)) return; - LevelChunk* c = getChunk(x >> 4, z >> 4); - c->setBrightness(layer, x & 15, y, z & 15, brightness); - for (unsigned int i = 0; i < _listeners.size(); i++) { - _listeners[i]->tileBrightnessChanged(x, y, z); - } + //if (x < -MAX_LEVEL_SIZE || z < -MAX_LEVEL_SIZE || x >= MAX_LEVEL_SIZE || z > MAX_LEVEL_SIZE) { + // return; + //} + if (y < 0) return; + if (y >= DEPTH) return; + if (!hasChunk(x >> 4, z >> 4)) return; + LevelChunk* c = getChunk(x >> 4, z >> 4); + c->setBrightness(layer, x & 15, y, z & 15, brightness); + for (unsigned int i = 0; i < _listeners.size(); i++) { + _listeners[i]->tileBrightnessChanged(x, y, z); + } } float Level::getBrightness(int x, int y, int z) { @@ -839,7 +839,7 @@ float Level::getBrightness(int x, int y, int z) { } bool Level::isDay() { - return this->skyDarken < 4; + return this->skyDarken < 4; } //HitResult Level::clip(const Vec3& a, const Vec3& b) { @@ -847,99 +847,99 @@ bool Level::isDay() { //} HitResult Level::clip(const Vec3& A, const Vec3& b, bool liquid /*= false*/, bool solidOnly /*= false*/) { - static Stopwatch sw; - //sw.printEvery(1000, "clip"); - SwStartStopper w(sw); + static Stopwatch sw; + //sw.printEvery(1000, "clip"); + SwStartStopper w(sw); - if (A.x != A.x || A.y != A.y || A.z != A.z) return HitResult(); //@kludge This is actually a way to do it + if (A.x != A.x || A.y != A.y || A.z != A.z) return HitResult(); //@kludge This is actually a way to do it if (b.x != b.x || b.y != b.y || b.z != b.z) return HitResult(); Vec3 a(A); - int xTile1 = Mth::floor(b.x); - int yTile1 = Mth::floor(b.y); - int zTile1 = Mth::floor(b.z); + int xTile1 = Mth::floor(b.x); + int yTile1 = Mth::floor(b.y); + int zTile1 = Mth::floor(b.z); - int xTile0 = Mth::floor(a.x); - int yTile0 = Mth::floor(a.y); - int zTile0 = Mth::floor(a.z); + int xTile0 = Mth::floor(a.x); + int yTile0 = Mth::floor(a.y); + int zTile0 = Mth::floor(a.z); - int maxIterations = 200; - while (maxIterations-- >= 0) { + int maxIterations = 200; + while (maxIterations-- >= 0) { if (a.x != a.x || a.y != a.y || a.z != a.z) return HitResult(); - if (xTile0 == xTile1 && yTile0 == yTile1 && zTile0 == zTile1) + if (xTile0 == xTile1 && yTile0 == yTile1 && zTile0 == zTile1) return HitResult(); - float xClip = 999; - float yClip = 999; - float zClip = 999; + float xClip = 999; + float yClip = 999; + float zClip = 999; - if (xTile1 > xTile0) xClip = xTile0 + 1.000f; - if (xTile1 < xTile0) xClip = xTile0 + 0.000f; + if (xTile1 > xTile0) xClip = xTile0 + 1.000f; + if (xTile1 < xTile0) xClip = xTile0 + 0.000f; - if (yTile1 > yTile0) yClip = yTile0 + 1.000f; - if (yTile1 < yTile0) yClip = yTile0 + 0.000f; + if (yTile1 > yTile0) yClip = yTile0 + 1.000f; + if (yTile1 < yTile0) yClip = yTile0 + 0.000f; - if (zTile1 > zTile0) zClip = zTile0 + 1.000f; - if (zTile1 < zTile0) zClip = zTile0 + 0.000f; + if (zTile1 > zTile0) zClip = zTile0 + 1.000f; + if (zTile1 < zTile0) zClip = zTile0 + 0.000f; - float xDist = 999; - float yDist = 999; - float zDist = 999; + float xDist = 999; + float yDist = 999; + float zDist = 999; - float xd = b.x - a.x; - float yd = b.y - a.y; - float zd = b.z - a.z; + float xd = b.x - a.x; + float yd = b.y - a.y; + float zd = b.z - a.z; - if (xClip != 999) xDist = (xClip - a.x) / xd; - if (yClip != 999) yDist = (yClip - a.y) / yd; - if (zClip != 999) zDist = (zClip - a.z) / zd; + if (xClip != 999) xDist = (xClip - a.x) / xd; + if (yClip != 999) yDist = (yClip - a.y) / yd; + if (zClip != 999) zDist = (zClip - a.z) / zd; - int face = 0; - if (xDist < yDist && xDist < zDist) { - if (xTile1 > xTile0) face = 4; - else face = 5; + int face = 0; + if (xDist < yDist && xDist < zDist) { + if (xTile1 > xTile0) face = 4; + else face = 5; - a.x = xClip; - a.y += yd * xDist; - a.z += zd * xDist; - } else if (yDist < zDist) { - if (yTile1 > yTile0) face = 0; - else face = 1; + a.x = xClip; + a.y += yd * xDist; + a.z += zd * xDist; + } else if (yDist < zDist) { + if (yTile1 > yTile0) face = 0; + else face = 1; - a.x += xd * yDist; - a.y = yClip; - a.z += zd * yDist; - } else { - if (zTile1 > zTile0) face = 2; - else face = 3; + a.x += xd * yDist; + a.y = yClip; + a.z += zd * yDist; + } else { + if (zTile1 > zTile0) face = 2; + else face = 3; - a.x += xd * zDist; - a.y += yd * zDist; - a.z = zClip; - } + a.x += xd * zDist; + a.y += yd * zDist; + a.z = zClip; + } - Vec3 tPos(a.x, a.y, a.z); - xTile0 = (int) (tPos.x = (float)Mth::floor(a.x)); - if (face == 5) { - xTile0--; - tPos.x++; - } - yTile0 = (int) (tPos.y = (float)Mth::floor(a.y)); - if (face == 1) { - yTile0--; - tPos.y++; - } - zTile0 = (int) (tPos.z = (float)Mth::floor(a.z)); - if (face == 3) { - zTile0--; - tPos.z++; - } + Vec3 tPos(a.x, a.y, a.z); + xTile0 = (int) (tPos.x = (float)Mth::floor(a.x)); + if (face == 5) { + xTile0--; + tPos.x++; + } + yTile0 = (int) (tPos.y = (float)Mth::floor(a.y)); + if (face == 1) { + yTile0--; + tPos.y++; + } + zTile0 = (int) (tPos.z = (float)Mth::floor(a.z)); + if (face == 3) { + zTile0--; + tPos.z++; + } - int t = getTile(xTile0, yTile0, zTile0); - int data = getData(xTile0, yTile0, zTile0); - Tile* tile = Tile::tiles[t]; + int t = getTile(xTile0, yTile0, zTile0); + int data = getData(xTile0, yTile0, zTile0); + Tile* tile = Tile::tiles[t]; if (solidOnly && tile != NULL && tile->getAABB(this, xTile0, yTile0, zTile0) == NULL) { // No collision @@ -948,27 +948,27 @@ HitResult Level::clip(const Vec3& A, const Vec3& b, bool liquid /*= false*/, boo HitResult r = tile->clip(this, xTile0, yTile0, zTile0, a, b); if (r.isHit()) return r; } - } - } - return HitResult(); + } + } + return HitResult(); } void Level::playSound(Entity* entity, const std::string& name, float volume, float pitch) { - for (unsigned int i = 0; i < _listeners.size(); i++) { - _listeners[i]->playSound(name, entity->x, entity->y - entity->heightOffset, entity->z, volume, pitch); - } + for (unsigned int i = 0; i < _listeners.size(); i++) { + _listeners[i]->playSound(name, entity->x, entity->y - entity->heightOffset, entity->z, volume, pitch); + } } void Level::playSound(float x, float y, float z, const std::string& name, float volume, float pitch) { - for (unsigned int i = 0; i < _listeners.size(); i++) { - _listeners[i]->playSound(name, x, y, z, volume, pitch); - } + for (unsigned int i = 0; i < _listeners.size(); i++) { + _listeners[i]->playSound(name, x, y, z, volume, pitch); + } } void Level::levelEvent(Player* source, int type, int x, int y, int z, int data) { - for (unsigned int i = 0; i < _listeners.size(); i++) { - _listeners[i]->levelEvent(source, type, x, y, z, data); - } + for (unsigned int i = 0; i < _listeners.size(); i++) { + _listeners[i]->levelEvent(source, type, x, y, z, data); + } } void Level::tileEvent(int x, int y, int z, int b0, int b1) { @@ -993,7 +993,7 @@ void Level::tileEvent(int x, int y, int z, int b0, int b1) { void Level::addParticle(const std::string& id, float x, float y, float z, float xd, float yd, float zd, int data /* = 0 */) { for (unsigned int i = 0; i < _listeners.size(); i++) - _listeners[i]->addParticle(id, x, y, z, xd, yd, zd, data); + _listeners[i]->addParticle(id, x, y, z, xd, yd, zd, data); } void Level::addParticle(ParticleType::Id id, float x, float y, float z, float xd, float yd, float zd, int data /* = 0 */) { @@ -1006,13 +1006,13 @@ bool Level::addEntity(Entity* e) { if (prev) removeEntity(prev); - int xc = Mth::floor(e->x / 16.f); - int zc = Mth::floor(e->z / 16.f); + int xc = Mth::floor(e->x / 16.f); + int zc = Mth::floor(e->z / 16.f); - //bool forced = false; - //if (e->isPlayer()) { - // forced = true; - //} + //bool forced = false; + //if (e->isPlayer()) { + // forced = true; + //} bool forced = true; if (forced/* || hasChunk(xc, zc)*/) { @@ -1034,10 +1034,10 @@ Entity* Level::getEntity(int entityId) // TODO: Lookup map /*for (unsigned int i = 0; i < entities.size(); i++) { - if (entities[i]->entityId == entityId) - { - return entities[i]; - } + if (entities[i]->entityId == entityId) + { + return entities[i]; + } } return NULL;*/ EntityMap::const_iterator cit = entityIdLookup.find(entityId); @@ -1046,16 +1046,16 @@ Entity* Level::getEntity(int entityId) /*protected*/ void Level::entityAdded(Entity* e) { - for (unsigned int i = 0; i < _listeners.size(); i++) { - _listeners[i]->entityAdded(e); - } + for (unsigned int i = 0; i < _listeners.size(); i++) { + _listeners[i]->entityAdded(e); + } } /*protected*/ void Level::entityRemoved(Entity* e) { - for (unsigned int j = 0; j < _listeners.size(); j++) { - _listeners[j]->entityRemoved(e); - } + for (unsigned int j = 0; j < _listeners.size(); j++) { + _listeners[j]->entityRemoved(e); + } } Mob* Level::getMob(int entityId) @@ -1065,10 +1065,10 @@ Mob* Level::getMob(int entityId) } void Level::removeEntity(Entity* e) { - e->remove(); + e->remove(); if (e->isPlayer() && e->reallyRemoveIfPlayer) { Util::remove(players, (Player*) e); - } + } } void Level::tileEntityChanged(int x, int y, int z, TileEntity* te) { @@ -1099,16 +1099,16 @@ void Level::tileEntityChanged(int x, int y, int z, TileEntity* te) { Biome::MobSpawnerData Level::getRandomMobSpawnAt(const MobCategory& mobCategory, int x, int y, int z) { Biome::MobList mobList = _chunkSource->getMobsAt(mobCategory, x, y, z); - if (mobList.empty()) return Biome::MobSpawnerData(); + if (mobList.empty()) return Biome::MobSpawnerData(); Biome::MobSpawnerData* data = (Biome::MobSpawnerData*) WeighedRandom::getRandomItem(&random, mobList); if (!data) return Biome::MobSpawnerData(); - return *data; + return *data; } void Level::addListener(LevelListener* listener) { - _listeners.push_back(listener); + _listeners.push_back(listener); } void Level::removeListener(LevelListener* listener) { @@ -1119,76 +1119,86 @@ void Level::removeListener(LevelListener* listener) { std::vector& Level::getCubes(const Entity* source, const AABB& box_) { //@attn: check the AABB* new/delete stuff boxes.clear(); const AABB* box = &box_; - int x0 = Mth::floor(box->x0); - int x1 = Mth::floor(box->x1 + 1); - int y0 = Mth::floor(box->y0); - int y1 = Mth::floor(box->y1 + 1); - int z0 = Mth::floor(box->z0); - int z1 = Mth::floor(box->z1 + 1); + int x0 = Mth::floor(box->x0); + int x1 = Mth::floor(box->x1 + 1); + int y0 = Mth::floor(box->y0); + int y1 = Mth::floor(box->y1 + 1); + int z0 = Mth::floor(box->z0); + int z1 = Mth::floor(box->z1 + 1); - for (int x = x0; x < x1; x++) - for (int z = z0; z < z1; z++) { - if (hasChunkAt(x, Level::DEPTH / 2, z)) { - for (int y = y0 - 1; y < y1; y++) { - Tile* tile = Tile::tiles[getTile(x, y, z)]; - if (tile != NULL) { - tile->addAABBs(this, x, y, z, box, boxes); - } - } - } + for (int x = x0; x < x1; x++) + for (int z = z0; z < z1; z++) { + if (hasChunkAt(x, Level::DEPTH / 2, z)) { + for (int y = y0 - 1; y < y1; y++) { + Tile* tile = Tile::tiles[getTile(x, y, z)]; + if (tile != NULL) { + tile->addAABBs(this, x, y, z, box, boxes); + } + } + } else { //int breakPoint = 0; } - } - /* - float r = 0.25; - List ee = getEntities(source, box.grow(r, r, r)); - for (int i = 0; i < ee.size(); i++) { - AABB collideBox = ee.get(i).getCollideBox(); - if (collideBox != NULL && collideBox.intersects(box)) { - boxes.add(collideBox); - } + } + /* + float r = 0.25; + List ee = getEntities(source, box.grow(r, r, r)); + for (int i = 0; i < ee.size(); i++) { + AABB collideBox = ee.get(i).getCollideBox(); + if (collideBox != NULL && collideBox.intersects(box)) { + boxes.add(collideBox); + } - collideBox = source.getCollideAgainstBox(ee.get(i)); - if (collideBox != NULL && collideBox.intersects(box)) { - boxes.add(collideBox); - } - } - */ + collideBox = source.getCollideAgainstBox(ee.get(i)); + if (collideBox != NULL && collideBox.intersects(box)) { + boxes.add(collideBox); + } + } + */ - return boxes; + return boxes; } int Level::getSkyDarken(float a) { - float td = getTimeOfDay(a); + float td = getTimeOfDay(a); - float br = 1 - (Mth::cos(td * Mth::PI * 2) * 2 + 0.5f); - if (br < 0.0f) br = 0.0f; - if (br > 0.80f) br = 0.80f; //@note; was 1.0f - return ((int) (br * 11)); + float br = 1 - (Mth::cos(td * Mth::PI * 2) * 2 + 0.5f); + if (br < 0.0f) br = 0.0f; + if (br > 0.80f) br = 0.80f; //@note; was 1.0f + return ((int) (br * 11)); } Vec3 Level::getSkyColor(Entity* source, float a) { - float td = getTimeOfDay(a); + float td = getTimeOfDay(a); float br = Mth::cos(td * Mth::PI * 2) * 2 + 0.5f; - if (br < 0.0f) br = 0.0f; - if (br > 0.75f) br = 0.75f; //@note; was 1.0f + if (br < 0.0f) br = 0.0f; + if (br > 0.75f) br = 0.75f; //@note; was 1.0f -// int xx = Mth::floor(source->x); -// int zz = Mth::floor(source->z); -// float temp = 0.5;//(float) getBiomeSource().getTemperature(xx, zz); - int skyColor = 0x3070ff;//getBiomeSource().getBiome(xx, zz).getSkyColor(temp); + int xx = Mth::floor(source->x); + int zz = Mth::floor(source->z); + // float temp = 0.5;//(float) getBiomeSource().getTemperature(xx, zz); // unused in normal pe too, just hardcoded temp values for some reason. + float temp = (float) getBiomeSource()->getTemperature(xx, zz); + int skyColor; + if (dimension->FogType == 1){ // 1 is java styled fog which should use temperatures! + skyColor = getBiomeSource()->getBiome(xx, zz)->getSkyColor(temp); + } + else { // otherwise default to the normal pocket edition skycolor - float r = ((skyColor >> 16) & 0xff) / 255.0f; - float g = ((skyColor >> 8) & 0xff) / 255.0f; - float b = ((skyColor) & 0xff) / 255.0f; - r *= br; - g *= br; - b *= br; + skyColor = 0x3070ff; + } - return Vec3(r, g, b); + // int skyColor = 0x3070ff;//getBiomeSource().getBiome(xx, zz).getSkyColor(temp); // This is the vanilla way, add it as OPTION_SKY - shredder + + float r = ((skyColor >> 16) & 0xff) / 255.0f; + float g = ((skyColor >> 8) & 0xff) / 255.0f; + float b = ((skyColor) & 0xff) / 255.0f; + r *= br; + g *= br; + b *= br; + + return Vec3(r, g, b); } Vec3 Level::getCloudColor( float a ) { @@ -1238,8 +1248,8 @@ float Level::getTimeOfDay(float a) { } float Level::getSunAngle(float a) { - float td = getTimeOfDay(a); - return td * Mth::PI * 2; + float td = getTimeOfDay(a); + return td * Mth::PI * 2; } //Vec3 Level::getCloudColor(float a) { @@ -1261,70 +1271,70 @@ float Level::getSunAngle(float a) { //} Vec3 Level::getFogColor(float a) { - float td = getTimeOfDay(a); - return dimension->getFogColor(td, a); + float td = getTimeOfDay(a); + return dimension->getFogColor(td, a); } int Level::getTopSolidBlock(int x, int z) { - LevelChunk* levelChunk = getChunkAt(x, z); + LevelChunk* levelChunk = getChunkAt(x, z); - int y = Level::DEPTH - 1; + int y = Level::DEPTH - 1; - while (getMaterial(x, y, z)->blocksMotion() && y > 0) { - y--; - } + while (getMaterial(x, y, z)->blocksMotion() && y > 0) { + y--; + } - x &= 15; - z &= 15; + x &= 15; + z &= 15; - while (y > 0) { - int t = levelChunk->getTile(x, y, z); - if (t == 0 /*|| !(Tile::tiles[t]->material->blocksMotion() || Tile::tiles[t]->material->isLiquid())*/ + while (y > 0) { + int t = levelChunk->getTile(x, y, z); + if (t == 0 /*|| !(Tile::tiles[t]->material->blocksMotion() || Tile::tiles[t]->material->isLiquid())*/ || !(Tile::tiles[t]->material->blocksMotion()) || Tile::tiles[t]->material == Material::leaves) { - y--; - } else { - return y + 1; - } - } - return -1; + y--; + } else { + return y + 1; + } + } + return -1; } int Level::getLightDepth(int x, int z) { - return getChunkAt(x, z)->getHeightmap(x & 15, z & 15); + return getChunkAt(x, z)->getHeightmap(x & 15, z & 15); } float Level::getStarBrightness(float a) { - float td = getTimeOfDay(a); + float td = getTimeOfDay(a); - float br = 1 - (Mth::cos(td * Mth::PI * 2) * 2 + 0.75f); - if (br < 0.f) br = 0; - if (br > 1.f) br = 1; + float br = 1 - (Mth::cos(td * Mth::PI * 2) * 2 + 0.75f); + if (br < 0.f) br = 0; + if (br > 1.f) br = 1; - return br * br * 0.5f; + return br * br * 0.5f; } void Level::addToTickNextTick(int x, int y, int z, int tileId, int tickDelay) { TickNextTickData td(x, y, z, tileId); - int r = 8; - if (instaTick) { - if (hasChunksAt(td.x - r, td.y - r, td.z - r, td.x + r, td.y + r, td.z + r)) { - int id = getTile(td.x, td.y, td.z); - if (id == td.tileId && id > 0) { - Tile::tiles[id]->tick(this, td.x, td.y, td.z, &random); - } - } - return; - } + int r = 8; + if (instaTick) { + if (hasChunksAt(td.x - r, td.y - r, td.z - r, td.x + r, td.y + r, td.z + r)) { + int id = getTile(td.x, td.y, td.z); + if (id == td.tileId && id > 0) { + Tile::tiles[id]->tick(this, td.x, td.y, td.z, &random); + } + } + return; + } - if (hasChunksAt(x - r, y - r, z - r, x + r, y + r, z + r)) { - if (tileId > 0) { - td.setDelay(tickDelay + levelData.getTime()); - } + if (hasChunksAt(x - r, y - r, z - r, x + r, y + r, z + r)) { + if (tileId > 0) { + td.setDelay(tickDelay + levelData.getTime()); + } if (_tickNextTickSet.find(td) == _tickNextTickSet.end()) { _tickNextTickSet.insert(td); - } - } + } + } } void Level::tickEntities() { @@ -1332,52 +1342,52 @@ void Level::tickEntities() { TIMER_PUSH("remove"); //Util::removeAll(entities, _entitiesToRemove); - // for (int j = 0; j < (int)_entitiesToRemove.size(); j++) { - // Entity* e = _entitiesToRemove[j]; - // int xc = e->xChunk; - // int zc = e->zChunk; - // if (e->inChunk && hasChunk(xc, zc)) { - // getChunk(xc, zc)->removeEntity(e); - // } - // } - // for (int j = 0; j < (int)_entitiesToRemove.size(); j++) { - // entityRemoved(_entitiesToRemove[j]); + // for (int j = 0; j < (int)_entitiesToRemove.size(); j++) { + // Entity* e = _entitiesToRemove[j]; + // int xc = e->xChunk; + // int zc = e->zChunk; + // if (e->inChunk && hasChunk(xc, zc)) { + // getChunk(xc, zc)->removeEntity(e); + // } + // } + // for (int j = 0; j < (int)_entitiesToRemove.size(); j++) { + // entityRemoved(_entitiesToRemove[j]); // //LOGI("a1 &e@delt: %p", _entitiesToRemove[j]); // delete _entitiesToRemove[j]; // //LOGI("a2"); - // } - // _entitiesToRemove.clear(); + // } + // _entitiesToRemove.clear(); EntityList pendingRemovedEntities; std::vector zombies; TIMER_POP_PUSH("regular"); - for (unsigned int i = 0; i < entities.size(); i++) { - Entity* e = entities[i]; + for (unsigned int i = 0; i < entities.size(); i++) { + Entity* e = entities[i]; - if (!e->removed) { - tick(e); + if (!e->removed) { + tick(e); if (e->getEntityTypeId() == MobTypes::Zombie) { zombies.push_back((Zombie*)e); ((Zombie*)e)->setUseNewAi(false); // @note: this is set under } - } + } TIMER_PUSH("remove"); - if (e->removed && (!e->isPlayer() || e->reallyRemoveIfPlayer)) { - int xc = e->xChunk; - int zc = e->zChunk; - if (e->inChunk && hasChunk(xc, zc)) { - getChunk(xc, zc)->removeEntity(e); - } + if (e->removed && (!e->isPlayer() || e->reallyRemoveIfPlayer)) { + int xc = e->xChunk; + int zc = e->zChunk; + if (e->inChunk && hasChunk(xc, zc)) { + getChunk(xc, zc)->removeEntity(e); + } entityIdLookup.erase(e->entityId); entities.erase(entities.begin() + (i--)); - entityRemoved(e); + entityRemoved(e); pendingRemovedEntities.push_back(e); - } + } TIMER_POP(); - } - + } + TIMER_POP_PUSH("remove"); for (unsigned int i = 0; i < pendingRemovedEntities.size(); ++i) { Entity* e = pendingRemovedEntities[i]; @@ -1498,51 +1508,51 @@ void Level::setZombieAi(std::vector& zombies) { } void Level::tick(Entity* e) { - tick(e, true); + tick(e, true); } void Level::tick(Entity* e, bool actual) { - int xc = Mth::floor(e->x); - int zc = Mth::floor(e->z); - int r = 32; - if (actual && !hasChunksAt(xc - r, 0, zc - r, xc + r, 128, zc + r)) { - return; - } + int xc = Mth::floor(e->x); + int zc = Mth::floor(e->z); + int r = 32; + if (actual && !hasChunksAt(xc - r, 0, zc - r, xc + r, 128, zc + r)) { + return; + } - e->xOld = e->x; - e->yOld = e->y; - e->zOld = e->z; - e->yRotO = e->yRot; - e->xRotO = e->xRot; + e->xOld = e->x; + e->yOld = e->y; + e->zOld = e->z; + e->yRotO = e->yRot; + e->xRotO = e->xRot; - if (actual && e->inChunk) { - e->tick(); - } + if (actual && e->inChunk) { + e->tick(); + } TIMER_PUSH("chunkCheck"); - // SANITY!! + // SANITY!! if (e->x != e->x) e->x = e->xOld; // @note: checking for NaN, not sure about Infinite if (e->y != e->y) e->y = e->yOld; if (e->z != e->z) e->z = e->zOld; if (e->xRot != e->xRot) e->xRot = e->xRotO; if (e->yRot != e->yRot) e->yRot = e->yRotO; - int xcn = Mth::floor(e->x / 16.0f); - int ycn = Mth::floor(e->y / 16.0f); - int zcn = Mth::floor(e->z / 16.0f); + int xcn = Mth::floor(e->x / 16.0f); + int ycn = Mth::floor(e->y / 16.0f); + int zcn = Mth::floor(e->z / 16.0f); - if (!e->inChunk || (e->xChunk != xcn || e->yChunk != ycn || e->zChunk != zcn)) { - if (e->inChunk && hasChunk(e->xChunk, e->zChunk)) { - getChunk(e->xChunk, e->zChunk)->removeEntity(e, e->yChunk); - } + if (!e->inChunk || (e->xChunk != xcn || e->yChunk != ycn || e->zChunk != zcn)) { + if (e->inChunk && hasChunk(e->xChunk, e->zChunk)) { + getChunk(e->xChunk, e->zChunk)->removeEntity(e, e->yChunk); + } - if (hasChunk(xcn, zcn)) { - e->inChunk = true; - getChunk(xcn, zcn)->addEntity(e); - } else { - e->inChunk = false; - } - } + if (hasChunk(xcn, zcn)) { + e->inChunk = true; + getChunk(xcn, zcn)->addEntity(e); + } else { + e->inChunk = false; + } + } TIMER_POP(); // Save player info every n:th second @@ -1554,109 +1564,109 @@ void Level::tick(Entity* e, bool actual) { } bool Level::isUnobstructed(const AABB& aabb) { - EntityList& entities = getEntities(NULL, aabb); - for (unsigned int i = 0; i < entities.size(); i++) { - Entity* e = entities[i]; - if (!e->removed && e->blocksBuilding) return false; - } - return true; + EntityList& entities = getEntities(NULL, aabb); + for (unsigned int i = 0; i < entities.size(); i++) { + Entity* e = entities[i]; + if (!e->removed && e->blocksBuilding) return false; + } + return true; } bool Level::containsAnyLiquid(const AABB& box) { - int x0 = Mth::floor(box.x0); - int x1 = Mth::floor(box.x1 + 1); - int y0 = Mth::floor(box.y0); - int y1 = Mth::floor(box.y1 + 1); - int z0 = Mth::floor(box.z0); - int z1 = Mth::floor(box.z1 + 1); + int x0 = Mth::floor(box.x0); + int x1 = Mth::floor(box.x1 + 1); + int y0 = Mth::floor(box.y0); + int y1 = Mth::floor(box.y1 + 1); + int z0 = Mth::floor(box.z0); + int z1 = Mth::floor(box.z1 + 1); - if (box.x0 < 0) x0--; - if (box.y0 < 0) y0--; - if (box.z0 < 0) z0--; + if (box.x0 < 0) x0--; + if (box.y0 < 0) y0--; + if (box.z0 < 0) z0--; - for (int x = x0; x < x1; x++) - for (int y = y0; y < y1; y++) - for (int z = z0; z < z1; z++) { - Tile* tile = Tile::tiles[getTile(x, y, z)]; - if (tile != NULL && tile->material->isLiquid()) { - return true; - } - } - return false; + for (int x = x0; x < x1; x++) + for (int y = y0; y < y1; y++) + for (int z = z0; z < z1; z++) { + Tile* tile = Tile::tiles[getTile(x, y, z)]; + if (tile != NULL && tile->material->isLiquid()) { + return true; + } + } + return false; } bool Level::containsFireTile(const AABB& box) { - int x0 = Mth::floor(box.x0); - int x1 = Mth::floor(box.x1 + 1); - int y0 = Mth::floor(box.y0); - int y1 = Mth::floor(box.y1 + 1); - int z0 = Mth::floor(box.z0); - int z1 = Mth::floor(box.z1 + 1); + int x0 = Mth::floor(box.x0); + int x1 = Mth::floor(box.x1 + 1); + int y0 = Mth::floor(box.y0); + int y1 = Mth::floor(box.y1 + 1); + int z0 = Mth::floor(box.z0); + int z1 = Mth::floor(box.z1 + 1); - if (hasChunksAt(x0, y0, z0, x1, y1, z1)) { - for (int x = x0; x < x1; x++) - for (int y = y0; y < y1; y++) - for (int z = z0; z < z1; z++) { - int t = getTile(x, y, z); + if (hasChunksAt(x0, y0, z0, x1, y1, z1)) { + for (int x = x0; x < x1; x++) + for (int y = y0; y < y1; y++) + for (int z = z0; z < z1; z++) { + int t = getTile(x, y, z); - if (t == ((Tile*)(Tile::fire))->id - || t == Tile::lava->id - || t == Tile::calmLava->id) { - return true; + if (t == ((Tile*)(Tile::fire))->id + || t == Tile::lava->id + || t == Tile::calmLava->id) { + return true; } - } - } - return false; + } + } + return false; } bool Level::containsMaterial(const AABB& box, const Material* material) { - int x0 = Mth::floor(box.x0); - int x1 = Mth::floor(box.x1 + 1); - int y0 = Mth::floor(box.y0); - int y1 = Mth::floor(box.y1 + 1); - int z0 = Mth::floor(box.z0); - int z1 = Mth::floor(box.z1 + 1); + int x0 = Mth::floor(box.x0); + int x1 = Mth::floor(box.x1 + 1); + int y0 = Mth::floor(box.y0); + int y1 = Mth::floor(box.y1 + 1); + int z0 = Mth::floor(box.z0); + int z1 = Mth::floor(box.z1 + 1); - for (int x = x0; x < x1; x++) - for (int y = y0; y < y1; y++) - for (int z = z0; z < z1; z++) { - Tile* tile = Tile::tiles[getTile(x, y, z)]; - if (tile != NULL && tile->material == material) { - return true; - } - } - return false; + for (int x = x0; x < x1; x++) + for (int y = y0; y < y1; y++) + for (int z = z0; z < z1; z++) { + Tile* tile = Tile::tiles[getTile(x, y, z)]; + if (tile != NULL && tile->material == material) { + return true; + } + } + return false; } bool Level::containsLiquid(const AABB& box, const Material* material) { - int x0 = Mth::floor(box.x0); - int x1 = Mth::floor(box.x1 + 1); - int y0 = Mth::floor(box.y0); - int y1 = Mth::floor(box.y1 + 1); - int z0 = Mth::floor(box.z0); - int z1 = Mth::floor(box.z1 + 1); + int x0 = Mth::floor(box.x0); + int x1 = Mth::floor(box.x1 + 1); + int y0 = Mth::floor(box.y0); + int y1 = Mth::floor(box.y1 + 1); + int z0 = Mth::floor(box.z0); + int z1 = Mth::floor(box.z1 + 1); - for (int x = x0; x < x1; x++) - for (int y = y0; y < y1; y++) - for (int z = z0; z < z1; z++) { - Tile* tile = Tile::tiles[getTile(x, y, z)]; - if (tile != NULL && tile->material == material) { - int data = getData(x, y, z); - float yh1 = (float)(y + 1); - if (data < 8) { - yh1 = (float)y + 1.0f - (float)data / 8.0f; - } - if (yh1 >= box.y0) { - return true; - } - } - } - return false; + for (int x = x0; x < x1; x++) + for (int y = y0; y < y1; y++) + for (int z = z0; z < z1; z++) { + Tile* tile = Tile::tiles[getTile(x, y, z)]; + if (tile != NULL && tile->material == material) { + int data = getData(x, y, z); + float yh1 = (float)(y + 1); + if (data < 8) { + yh1 = (float)y + 1.0f - (float)data / 8.0f; + } + if (yh1 >= box.y0) { + return true; + } + } + } + return false; } /* in java, this returns an Explosion */ void Level::explode(Entity* source, float x, float y, float z, float r) { - explode(source, x, y, z, r, false); + explode(source, x, y, z, r, false); } /* in java, this returns an Explosion */ @@ -1672,29 +1682,29 @@ void Level::explode(Entity* source, float x, float y, float z, float r, bool fir } float Level::getSeenPercent(const Vec3& center, const AABB& bb) { - float xs = 1.0f / ((bb.x1 - bb.x0) * 2 + 1); - float ys = 1.0f / ((bb.y1 - bb.y0) * 2 + 1); - float zs = 1.0f / ((bb.z1 - bb.z0) * 2 + 1); - int hits = 0; - int count = 0; - for (float xx = 0; xx <= 1; xx += xs) - for (float yy = 0; yy <= 1; yy += ys) - for (float zz = 0; zz <= 1; zz += zs) { - float x = bb.x0 + (bb.x1 - bb.x0) * xx; - float y = bb.y0 + (bb.y1 - bb.y0) * yy; - float z = bb.z0 + (bb.z1 - bb.z0) * zz; + float xs = 1.0f / ((bb.x1 - bb.x0) * 2 + 1); + float ys = 1.0f / ((bb.y1 - bb.y0) * 2 + 1); + float zs = 1.0f / ((bb.z1 - bb.z0) * 2 + 1); + int hits = 0; + int count = 0; + for (float xx = 0; xx <= 1; xx += xs) + for (float yy = 0; yy <= 1; yy += ys) + for (float zz = 0; zz <= 1; zz += zs) { + float x = bb.x0 + (bb.x1 - bb.x0) * xx; + float y = bb.y0 + (bb.y1 - bb.y0) * yy; + float z = bb.z0 + (bb.z1 - bb.z0) * zz; if (!clip(Vec3(x, y, z), center).isHit()) hits++; - count++; - } + count++; + } - return hits / (float) count; + return hits / (float) count; } bool Level::isSolidBlockingTile(int x, int y, int z) { - Tile* tile = Tile::tiles[getTile(x, y, z)]; - if (tile == NULL) return false; - return tile->material->isSolidBlocking() && tile->isCubeShaped(); + Tile* tile = Tile::tiles[getTile(x, y, z)]; + if (tile == NULL) return false; + return tile->material->isSolidBlocking() && tile->isCubeShaped(); } bool Level::isSolidRenderTile(int x, int y, int z) { @@ -1705,18 +1715,18 @@ bool Level::isSolidRenderTile(int x, int y, int z) { void Level::extinguishFire(int x, int y, int z, int face) { switch (face) { - case Facing::DOWN : y--; break; - case Facing::UP : y++; break; - case Facing::NORTH: z--; break; - case Facing::SOUTH: z++; break; - case Facing::WEST : x--; break; - case Facing::EAST : x++; break; + case Facing::DOWN : y--; break; + case Facing::UP : y++; break; + case Facing::NORTH: z--; break; + case Facing::SOUTH: z++; break; + case Facing::WEST : x--; break; + case Facing::EAST : x++; break; } - if (getTile(x, y, z) == ((Tile*)Tile::fire)->id) { - //playSound(x + 0.5f, y + 0.5f, z + 0.5f, "random.fizz", 0.5f, 2.6f + (random.nextFloat() - random.nextFloat()) * 0.8f); - setTile(x, y, z, 0); - } + if (getTile(x, y, z) == ((Tile*)Tile::fire)->id) { + //playSound(x + 0.5f, y + 0.5f, z + 0.5f, "random.fizz", 0.5f, 2.6f + (random.nextFloat() - random.nextFloat()) * 0.8f); + setTile(x, y, z, 0); + } } // String gatherStats() { // return "All: " + this.entities.size(); @@ -1783,37 +1793,37 @@ void Level::removeTileEntity(int x, int y, int z) { // int Level::getLightsToUpdate() { - return _lightUpdates.size(); + return _lightUpdates.size(); } bool Level::updateLights() { - if (_maxRecurse >= 50) { - return false; - } + if (_maxRecurse >= 50) { + return false; + } //static int _MaxSize = 0; - _maxRecurse++; - //try { - int max = 500; - while ((int)_lightUpdates.size() > 0) { - if (--max <= 0) - { - _maxRecurse--; - return true; - } - LightUpdate l = _lightUpdates.back(); - _lightUpdates.pop_back(); - l.update(this); - //if ((int)_lightUpdates.size() > _MaxSize) - //{ - // LOGI("MAX_updsize_light: %d (%d)\n", _lightUpdates.size(), _MaxSize); - // _MaxSize = _lightUpdates.size(); - //} - } - _maxRecurse--; - return false; - //} finally { - //maxRecurse--; - //} + _maxRecurse++; + //try { + int max = 500; + while ((int)_lightUpdates.size() > 0) { + if (--max <= 0) + { + _maxRecurse--; + return true; + } + LightUpdate l = _lightUpdates.back(); + _lightUpdates.pop_back(); + l.update(this); + //if ((int)_lightUpdates.size() > _MaxSize) + //{ + // LOGI("MAX_updsize_light: %d (%d)\n", _lightUpdates.size(), _MaxSize); + // _MaxSize = _lightUpdates.size(); + //} + } + _maxRecurse--; + return false; + //} finally { + //maxRecurse--; + //} } void Level::setUpdateLights(bool doUpdate) { @@ -1821,96 +1831,96 @@ void Level::setUpdateLights(bool doUpdate) { } void Level::updateLight(const LightLayer& layer, int x0, int y0, int z0, int x1, int y1, int z1) { - updateLight(layer, x0, y0, z0, x1, y1, z1, true); + updateLight(layer, x0, y0, z0, x1, y1, z1, true); } static int maxLoop = 0; void Level::updateLight(const LightLayer& layer, int x0, int y0, int z0, int x1, int y1, int z1, bool join) { - if ((dimension->hasCeiling && &layer == &LightLayer::Sky) || !_updateLights) return; + if ((dimension->hasCeiling && &layer == &LightLayer::Sky) || !_updateLights) return; - maxLoop++; + maxLoop++; //if (x0 < -5 || z0 < -5) LOGI("x, z: %d, %d\n", x0, z0); - if (maxLoop == 50) { - maxLoop--; - return; - } - int xm = (x1 + x0) / 2; - int zm = (z1 + z0) / 2; - if (!hasChunkAt(xm, Level::DEPTH / 2, zm)) { - maxLoop--; - return; - } - if (getChunkAt(xm, zm)->isEmpty()) + if (maxLoop == 50) { + maxLoop--; + return; + } + int xm = (x1 + x0) / 2; + int zm = (z1 + z0) / 2; + if (!hasChunkAt(xm, Level::DEPTH / 2, zm)) { + maxLoop--; + return; + } + if (getChunkAt(xm, zm)->isEmpty()) { maxLoop--; return; } - int count = _lightUpdates.size(); - if (join) { - int toCheck = 5; - if (toCheck > count) toCheck = count; - for (int i = 0; i < toCheck; i++) { - LightUpdate& last = _lightUpdates[_lightUpdates.size() - i - 1]; - if (last.layer == &layer && last.expandToContain(x0, y0, z0, x1, y1, z1)) { - maxLoop--; - return; - } - } - } - _lightUpdates.push_back(LightUpdate(layer, x0, y0, z0, x1, y1, z1)); - int max = 1000000; - if ((int)_lightUpdates.size() > max) { - LOGI("More than %d updates, aborting lighting updates\n", max); - _lightUpdates.clear(); - } - maxLoop--; + int count = _lightUpdates.size(); + if (join) { + int toCheck = 5; + if (toCheck > count) toCheck = count; + for (int i = 0; i < toCheck; i++) { + LightUpdate& last = _lightUpdates[_lightUpdates.size() - i - 1]; + if (last.layer == &layer && last.expandToContain(x0, y0, z0, x1, y1, z1)) { + maxLoop--; + return; + } + } + } + _lightUpdates.push_back(LightUpdate(layer, x0, y0, z0, x1, y1, z1)); + int max = 1000000; + if ((int)_lightUpdates.size() > max) { + LOGI("More than %d updates, aborting lighting updates\n", max); + _lightUpdates.clear(); + } + maxLoop--; } // // // int xxo, yyo, zzo; // bool Level::updateSkyBrightness() { - int newDark = this->getSkyDarken(1); - if (newDark != skyDarken) { - skyDarken = newDark; + int newDark = this->getSkyDarken(1); + if (newDark != skyDarken) { + skyDarken = newDark; return true; - } + } return false; } void Level::setSpawnSettings(bool spawnEnemies, bool spawnFriendlies) { - //this->spawnEnemies = spawnEnemies; - //this->spawnFriendlies = spawnFriendlies; + //this->spawnEnemies = spawnEnemies; + //this->spawnFriendlies = spawnFriendlies; } void Level::animateTick(int xt, int yt, int zt) { - int r = 16; - Random animateRandom; + int r = 16; + Random animateRandom; - for (int i = 0; i < 100; i++) { - int x = xt + random.nextInt(r) - random.nextInt(r); - int y = yt + random.nextInt(r) - random.nextInt(r); - int z = zt + random.nextInt(r) - random.nextInt(r); - int t = getTile(x, y, z); - if (t > 0) { - Tile::tiles[t]->animateTick(this, x, y, z, &animateRandom); - } - } + for (int i = 0; i < 100; i++) { + int x = xt + random.nextInt(r) - random.nextInt(r); + int y = yt + random.nextInt(r) - random.nextInt(r); + int z = zt + random.nextInt(r) - random.nextInt(r); + int t = getTile(x, y, z); + if (t > 0) { + Tile::tiles[t]->animateTick(this, x, y, z, &animateRandom); + } + } } EntityList& Level::getEntities(Entity* except, const AABB& bb) { - _es.clear(); - int xc0 = Mth::floor((bb.x0 - 2) / 16); - int xc1 = Mth::floor((bb.x1 + 2) / 16); - int zc0 = Mth::floor((bb.z0 - 2) / 16); - int zc1 = Mth::floor((bb.z1 + 2) / 16); - for (int xc = xc0; xc <= xc1; xc++) - for (int zc = zc0; zc <= zc1; zc++) { - if (hasChunk(xc, zc)) { - getChunk(xc, zc)->getEntities(except, bb, _es); - } - } - return _es; + _es.clear(); + int xc0 = Mth::floor((bb.x0 - 2) / 16); + int xc1 = Mth::floor((bb.x1 + 2) / 16); + int zc0 = Mth::floor((bb.z0 - 2) / 16); + int zc1 = Mth::floor((bb.z1 + 2) / 16); + for (int xc = xc0; xc <= xc1; xc++) + for (int zc = zc0; zc <= zc1; zc++) { + if (hasChunk(xc, zc)) { + getChunk(xc, zc)->getEntities(except, bb, _es); + } + } + return _es; } // List getEntitiesOfClass(Class baseClass, AABB bb) { @@ -1929,7 +1939,7 @@ EntityList& Level::getEntities(Entity* except, const AABB& bb) { // } const EntityList& Level::getAllEntities() { - return entities; + return entities; } // int countInstanceOf(Class clas) { @@ -1943,10 +1953,10 @@ const EntityList& Level::getAllEntities() { // /* void Level::addEntities(const EntityList& list) { - entities.insert(entities.end(), list.begin(), list.end()); - for (int j = 0; j < (int)list.size(); j++) { - entityAdded(list[j]); - } +entities.insert(entities.end(), list.begin(), list.end()); +for (int j = 0; j < (int)list.size(); j++) { +entityAdded(list[j]); +} } */ @@ -1955,65 +1965,65 @@ void Level::addEntities(const EntityList& list) { //} void Level::prepare() { - while (_chunkSource->tick()) - ; + while (_chunkSource->tick()) + ; } bool Level::mayPlace(int tileId, int x, int y, int z, bool ignoreEntities,unsigned char face) { - int targetType = getTile(x, y, z); - const Tile* targetTile = Tile::tiles[targetType]; - Tile* tile = Tile::tiles[tileId]; + int targetType = getTile(x, y, z); + const Tile* targetTile = Tile::tiles[targetType]; + Tile* tile = Tile::tiles[tileId]; - AABB* aabb = tile->getAABB(this, x, y, z); - if (ignoreEntities) aabb = NULL; - if (aabb != NULL && !isUnobstructed(*aabb)) return false; - if (targetTile == Tile::water || targetTile == Tile::calmWater || targetTile == Tile::lava || targetTile == Tile::calmLava || targetTile == (Tile*)(Tile::fire) || targetTile == Tile::topSnow) targetTile = NULL; - if (tileId > 0 && targetTile == NULL) { - if (tile->mayPlace(this, x, y, z, face)) { - return true; - } - } + AABB* aabb = tile->getAABB(this, x, y, z); + if (ignoreEntities) aabb = NULL; + if (aabb != NULL && !isUnobstructed(*aabb)) return false; + if (targetTile == Tile::water || targetTile == Tile::calmWater || targetTile == Tile::lava || targetTile == Tile::calmLava || targetTile == (Tile*)(Tile::fire) || targetTile == Tile::topSnow) targetTile = NULL; + if (tileId > 0 && targetTile == NULL) { + if (tile->mayPlace(this, x, y, z, face)) { + return true; + } + } - return false; + return false; } int Level::getSeaLevel() { - return SEA_LEVEL; + return SEA_LEVEL; } bool Level::getDirectSignal(int x, int y, int z, int dir) { - int t = getTile(x, y, z); - if (t == 0) return false; - return Tile::tiles[t]->getDirectSignal(this, x, y, z, dir); + int t = getTile(x, y, z); + if (t == 0) return false; + return Tile::tiles[t]->getDirectSignal(this, x, y, z, dir); } bool Level::hasDirectSignal(int x, int y, int z) { - if (getDirectSignal(x, y - 1, z, 0)) return true; - if (getDirectSignal(x, y + 1, z, 1)) return true; - if (getDirectSignal(x, y, z - 1, 2)) return true; - if (getDirectSignal(x, y, z + 1, 3)) return true; - if (getDirectSignal(x - 1, y, z, 4)) return true; - if (getDirectSignal(x + 1, y, z, 5)) return true; - return false; + if (getDirectSignal(x, y - 1, z, 0)) return true; + if (getDirectSignal(x, y + 1, z, 1)) return true; + if (getDirectSignal(x, y, z - 1, 2)) return true; + if (getDirectSignal(x, y, z + 1, 3)) return true; + if (getDirectSignal(x - 1, y, z, 4)) return true; + if (getDirectSignal(x + 1, y, z, 5)) return true; + return false; } bool Level::getSignal(int x, int y, int z, int dir) { - if (isSolidBlockingTile(x, y, z)) { - return hasDirectSignal(x, y, z); - } - int t = getTile(x, y, z); - if (t == 0) return false; - return Tile::tiles[t]->getSignal(this, x, y, z, dir); + if (isSolidBlockingTile(x, y, z)) { + return hasDirectSignal(x, y, z); + } + int t = getTile(x, y, z); + if (t == 0) return false; + return Tile::tiles[t]->getSignal(this, x, y, z, dir); } bool Level::hasNeighborSignal(int x, int y, int z) { - if (getSignal(x, y - 1, z, 0)) return true; - if (getSignal(x, y + 1, z, 1)) return true; - if (getSignal(x, y, z - 1, 2)) return true; - if (getSignal(x, y, z + 1, 3)) return true; - if (getSignal(x - 1, y, z, 4)) return true; - if (getSignal(x + 1, y, z, 5)) return true; - return false; + if (getSignal(x, y - 1, z, 0)) return true; + if (getSignal(x, y + 1, z, 1)) return true; + if (getSignal(x, y, z - 1, 2)) return true; + if (getSignal(x, y, z + 1, 3)) return true; + if (getSignal(x - 1, y, z, 4)) return true; + if (getSignal(x + 1, y, z, 5)) return true; + return false; } // void checkSession() { @@ -2021,44 +2031,44 @@ bool Level::hasNeighborSignal(int x, int y, int z) { // } // void Level::setTime(long time) { - this->levelData.setTime(time); + this->levelData.setTime(time); } long Level::getSeed() { - return levelData.getSeed(); + return levelData.getSeed(); } long Level::getTime() { - return levelData.getTime(); + return levelData.getTime(); } Pos Level::getSharedSpawnPos() { - return Pos(levelData.getXSpawn(), levelData.getYSpawn(), levelData.getZSpawn()); + return Pos(levelData.getXSpawn(), levelData.getYSpawn(), levelData.getZSpawn()); } void Level::setSpawnPos(Pos spawnPos) { - levelData.setSpawn(spawnPos.x, spawnPos.y, spawnPos.z); + levelData.setSpawn(spawnPos.x, spawnPos.y, spawnPos.z); } /* void Level::ensureAdded(Entity* entity) { - int xc = Mth::floor(entity->x / 16); - int zc = Mth::floor(entity->z / 16); - int r = 2; - for (int x = xc - r; x <= xc + r; x++) { - for (int z = zc - r; z <= zc + r; z++) { - this->getChunk(x, z); - } - } +int xc = Mth::floor(entity->x / 16); +int zc = Mth::floor(entity->z / 16); +int r = 2; +for (int x = xc - r; x <= xc + r; x++) { +for (int z = zc - r; z <= zc + r; z++) { +this->getChunk(x, z); +} +} - if (std::find(entities.begin(), entities.end(), entity) == entities.end()) { - entities.push_back(entity); - } +if (std::find(entities.begin(), entities.end(), entity) == entities.end()) { +entities.push_back(entity); +} } */ bool Level::mayInteract(Player* player, int xt, int yt, int zt) { - return true; + return true; } void Level::broadcastEntityEvent(Entity* e, char eventId) { @@ -2070,40 +2080,40 @@ void Level::broadcastEntityEvent(Entity* e, char eventId) { /* void Level::removeAllPendingEntityRemovals() { - //Util::removeAll(entities, _entitiesToRemove); - // //entities.removeAll(entitiesToRemove); - // for (int j = 0; j < (int)_entitiesToRemove.size(); j++) { - // Entity* e = _entitiesToRemove[j]; - // int xc = e->xChunk; - // int zc = e->zChunk; - // if (e->inChunk && hasChunk(xc, zc)) { - // getChunk(xc, zc)->removeEntity(e); - // } - // } +//Util::removeAll(entities, _entitiesToRemove); +// //entities.removeAll(entitiesToRemove); +// for (int j = 0; j < (int)_entitiesToRemove.size(); j++) { +// Entity* e = _entitiesToRemove[j]; +// int xc = e->xChunk; +// int zc = e->zChunk; +// if (e->inChunk && hasChunk(xc, zc)) { +// getChunk(xc, zc)->removeEntity(e); +// } +// } - // for (unsigned int j = 0; j < _entitiesToRemove.size(); j++) { - // entityRemoved(_entitiesToRemove[j]); - // } - // _entitiesToRemove.clear(); +// for (unsigned int j = 0; j < _entitiesToRemove.size(); j++) { +// entityRemoved(_entitiesToRemove[j]); +// } +// _entitiesToRemove.clear(); - for (unsigned int i = 0; i < entities.size(); i++) { - Entity* e = entities[i]; +for (unsigned int i = 0; i < entities.size(); i++) { +Entity* e = entities[i]; - if (e->removed) { - int xc = e->xChunk; - int zc = e->zChunk; - if (e->inChunk && hasChunk(xc, zc)) { - getChunk(xc, zc)->removeEntity(e); - } - entities.erase( entities.begin() + (i--) ); - entityRemoved(e); - } - } +if (e->removed) { +int xc = e->xChunk; +int zc = e->zChunk; +if (e->inChunk && hasChunk(xc, zc)) { +getChunk(xc, zc)->removeEntity(e); +} +entities.erase( entities.begin() + (i--) ); +entityRemoved(e); +} +} } */ ChunkSource* Level::getChunkSource() { - return _chunkSource; + return _chunkSource; } // void tileEvent(int x, int y, int z, int b0, int b1) { @@ -2112,11 +2122,11 @@ ChunkSource* Level::getChunkSource() { // } LevelStorage* Level::getLevelStorage() { - return levelStorage; + return levelStorage; } LevelData* Level::getLevelData() { - return &levelData; + return &levelData; } void Level::takePicture( TripodCamera* cam, Entity* e ) @@ -2138,7 +2148,7 @@ int Level::getEntitiesOfType( int entityType, const AABB& bb, EntityList& list ) getChunk(xc, zc)->getEntitiesOfType(entityType, bb, list); } } - return list.size() - count; + return list.size() - count; } int Level::getEntitiesOfClass( int type, const AABB& bb, EntityList& list ) { @@ -2208,9 +2218,9 @@ void Level::updateSkyDarken() void Level::removePlayer( Player* player ) { for (unsigned int i = 0; i < players.size(); ++i) - if (players[i] == player) { - players.erase( players.begin() + i ); - } + if (players[i] == player) { + players.erase( players.begin() + i ); + } } int Level::isNightMode() { @@ -2231,7 +2241,7 @@ bool Level::inRange( int x, int y, int z ) { // AdventureSettings // AdventureSettings::AdventureSettings() -: doTickTime(true), + : doTickTime(true), noPvP(false), noPvM(false), noMvP(false), diff --git a/src/world/level/biome/Biome.cpp b/src/world/level/biome/Biome.cpp index 609ed52..f97cab8 100755 --- a/src/world/level/biome/Biome.cpp +++ b/src/world/level/biome/Biome.cpp @@ -8,6 +8,8 @@ #include "../../entity/MobCategory.h" #include "../../level/tile/TallGrass.h" +#include "../../../util/Color.h" + Biome* Biome::rainForest = NULL; Biome* Biome::swampland = NULL; Biome* Biome::seasonalForest = NULL; @@ -208,11 +210,11 @@ float Biome::adjustDepth( float depth ) int Biome::getSkyColor( float temp ) { -// temp /= 3.f; -// if (temp < -1) temp = -1; -// if (temp > 1) temp = 1; - return 0x80808080; - //return Color.getHSBColor(224 / 360.0f - temp * 0.05f, 0.50f + temp * 0.1f, 1.0f).getRGB(); + temp /= 3.f; + if (temp < -1) temp = -1; + if (temp > 1) temp = 1; +// return 0x80808080;This is the vanilla way, add it as OPTION_SKY or leave it like this bcus this function literally never gets used anyways if level has vanilla sky color - shredder + return Color::getHSBColor(224 / 360.0f - temp * 0.05f, 0.50f + temp * 0.1f, 1.0f).getRGB(); } Biome::MobList& Biome::getMobs(const MobCategory& category) diff --git a/src/world/level/chunk/LevelChunk.cpp b/src/world/level/chunk/LevelChunk.cpp index bb373fb..ef13d1b 100755 --- a/src/world/level/chunk/LevelChunk.cpp +++ b/src/world/level/chunk/LevelChunk.cpp @@ -262,14 +262,14 @@ void LevelChunk::recalcHeight(int x, int yStart, int z) { /*public*/ void LevelChunk::skyBrightnessChanged() { -// int x0 = xt; -// int y0 = this->minHeight - 16; -// int z0 = zt; -// int x1 = xt + 16; -// int y1 = Level::DEPTH - 1; -// int z1 = zt + 16; + int x0 = xt; + int y0 = this->minHeight - 16; + int z0 = zt; + int x1 = xt + 16; + int y1 = Level::DEPTH - 1; + int z1 = zt + 16; - //level->setTilesDirty(x0, y0, z0, x1, y1, z1); + level->setTilesDirty(x0, y0, z0, x1, y1, z1); } /*public*/ diff --git a/src/world/level/dimension/Dimension.cpp b/src/world/level/dimension/Dimension.cpp index 1345c07..c565409 100755 --- a/src/world/level/dimension/Dimension.cpp +++ b/src/world/level/dimension/Dimension.cpp @@ -15,7 +15,8 @@ Dimension::Dimension() ultraWarm(false), hasCeiling(false), biomeSource(NULL), - id(0) + id(0), + fogColor(0x80daff) { } @@ -93,6 +94,18 @@ float* Dimension::getSunriseColor( float td, float a ) Vec3 Dimension::getFogColor( float td, float a ) { + if (FogType == 1) + { + fogColor = 0xc0d8ff; // 1 returns java beta styled fog color. + } + else if (FogType == 2) + { + fogColor = 0x406fe5; // 2 returns some type of unused fog color IDK what this one was used for possibly early pe?? + } + else // otherwise as default we return the mcpe fog color + { + fogColor = 0x80daff; + } float br = Mth::cos(td * Mth::PI * 2) * 2 + 0.5f; if (br < 0.0f) br = 0.0f; if (br > 1.0f) br = 1.0f; @@ -104,7 +117,8 @@ Vec3 Dimension::getFogColor( float td, float a ) g *= br * 0.94f + 0.06f; b *= br * 0.91f + 0.09f; return Vec3(r, g, b); - //return Vec3(0.752941f, 0.847059f, 1); + + // } bool Dimension::mayRespawn() diff --git a/src/world/level/dimension/Dimension.h b/src/world/level/dimension/Dimension.h index e77dbe3..b33861c 100755 --- a/src/world/level/dimension/Dimension.h +++ b/src/world/level/dimension/Dimension.h @@ -49,8 +49,11 @@ public: bool hasCeiling; float brightnessRamp[16];//Level::MAX_BRIGHTNESS + 1]; int id; + + // shredder added + int FogType; // lets us choose between what fog we want ig protected: - static const long fogColor = 0x80daff;//0x406fe5;//0xc0d8ff; + long fogColor; //= 0x80daff;//0x406fe5;//0xc0d8ff; float sunriseCol[4]; }; diff --git a/src/world/level/dimension/NormalDayCycleDimension.h b/src/world/level/dimension/NormalDayCycleDimension.h index 8e44a1a..321b10a 100755 --- a/src/world/level/dimension/NormalDayCycleDimension.h +++ b/src/world/level/dimension/NormalDayCycleDimension.h @@ -9,6 +9,7 @@ class NormalDayCycleDimension: public Dimension { public: + float getTimeOfDay(long time, float a) { int dayStep = (int) (time % Level::TICKS_PER_DAY); float td = (dayStep + a) / Level::TICKS_PER_DAY - 0.25f; @@ -20,6 +21,18 @@ public: } Vec3 getFogColor( float td, float a ) { + if (FogType == 1) + { + fogColor = 0xc0d8ff; // 1 returns java beta styled fog color. + } + else if (FogType == 2) + { + fogColor = 0x406fe5; // 2 returns some type of unused fog color IDK what this one was used for possibly early pe?? + } + else // otherwise as default we return the mcpe fog color + { + fogColor = 0x80daff; + } float br = cos(td * Mth::PI * 2) * 2 + 0.5f; if (br < 0) br = 0; if (br > 1.f) br = 1.f; @@ -35,7 +48,7 @@ public: return Vec3(r, g, b); } - + }; #endif /*NET_MINECRAFT_WORLD_LEVEL_DIMENSION__NormalDayCycleDimension_H__*/ From e272991159e231e71ec2ce8906433d604ce05ca5 Mon Sep 17 00:00:00 2001 From: Shredder Date: Mon, 6 Apr 2026 02:05:23 +0500 Subject: [PATCH 10/33] fileshredder - minor goof up --- project/android/jni/Android.mk | 1 + project/android_java/jni/Android.mk | 1 + src/client/renderer/entity/ItemRenderer.cpp | 8 +++++--- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/project/android/jni/Android.mk b/project/android/jni/Android.mk index 596be52..07772aa 100755 --- a/project/android/jni/Android.mk +++ b/project/android/jni/Android.mk @@ -146,6 +146,7 @@ LOCAL_SRC_FILES := ../../../src/main.cpp \ ../../../src/util/StringUtils.cpp \ ../../../src/util/PerfTimer.cpp \ ../../../src/util/PerfRenderer.cpp \ +../../../src/util/Color.cpp \ ../../../src/world/Direction.cpp \ ../../../src/world/entity/AgableMob.cpp \ ../../../src/world/entity/Entity.cpp \ diff --git a/project/android_java/jni/Android.mk b/project/android_java/jni/Android.mk index 86856d7..d472e34 100755 --- a/project/android_java/jni/Android.mk +++ b/project/android_java/jni/Android.mk @@ -122,6 +122,7 @@ LOCAL_SRC_FILES := ../../../src/main.cpp \ ../../../src/util/StringUtils.cpp \ ../../../src/util/PerfTimer.cpp \ ../../../src/util/PerfRenderer.cpp \ +../../../src/util/Color.cpp \ ../../../src/world/Direction.cpp \ ../../../src/world/entity/AgableMob.cpp \ ../../../src/world/entity/Entity.cpp \ diff --git a/src/client/renderer/entity/ItemRenderer.cpp b/src/client/renderer/entity/ItemRenderer.cpp index eaf29b4..72ace60 100755 --- a/src/client/renderer/entity/ItemRenderer.cpp +++ b/src/client/renderer/entity/ItemRenderer.cpp @@ -230,7 +230,9 @@ void ItemRenderer::renderGuiItem(Font* font, Textures* textures, const ItemInsta void ItemRenderer::renderGuiItemDecorations(Font* font, Textures* textures, ItemInstance* item, int x, int y){ // this is normally unused in the header but i ported it from java beta - shredder if (item != NULL) { if (item->count > 1) { - std::string countStr = std::to_string(item->count); + char buf[16]; + sprintf(buf, "%d", item->count); + std::string countStr = buf; // glDisable(GL_LIGHTING); // glDisable(GL_DEPTH_TEST); font->drawShadow(countStr, x + 19 - 2 - font->width(countStr), @@ -246,8 +248,8 @@ void ItemRenderer::renderGuiItemDecorations(Font* font, Textures* textures, Item // glDisable(GL_TEXTURE_2D); // auto var8 = ::net::minecraft::client::renderer::Tesselator::instance(); Tesselator& t = Tesselator::instance; - int ca = 255 - cc << 16 | cc << 8; - int cb = (255 - cc) / 4 << 16 | 16128; + int ca = ((255 - cc)<< 16 | (cc << 8)); + int cb = (((255 - cc) / 4) << 16 | 16128); fillRect(t, x + 2, y + 13, 13, 2, 0); fillRect(t, x + 2, y + 13, 12, 1, cb); fillRect(t, x + 2, y + 13, p, 1, ca); From 22375157933ac2d76f36451d43ed6922165fc126 Mon Sep 17 00:00:00 2001 From: Shredder Date: Mon, 6 Apr 2026 02:15:35 +0500 Subject: [PATCH 11/33] fileshredder - linux compile fix --- src/util/Color.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/Color.cpp b/src/util/Color.cpp index 9afaa5c..4cc9fba 100644 --- a/src/util/Color.cpp +++ b/src/util/Color.cpp @@ -48,8 +48,8 @@ Color Color::getHSBColor(float hue, float saturation, float brightness) } else { - float h = (hue - (float)floor(hue)) * 6.0f; - float f = h - (float)floor(h); + float h = (hue - (float)Mth::floor(hue)) * 6.0f; + float f = h - (float)Mth::floor(h); float p = brightness * (1.0f - saturation); float q = brightness * (1.0f - saturation * f); float t = brightness * (1.0f - (saturation * (1.0f - f))); From ef32fcfe088636a30aaffe66c208101d72866624 Mon Sep 17 00:00:00 2001 From: Shredder Date: Mon, 6 Apr 2026 02:26:46 +0500 Subject: [PATCH 12/33] attempt again --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1711d1c..08bb158 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -199,6 +199,9 @@ file(GLOB SERVER_SOURCES "src/world/level/dimension/Dimension.cpp" + "src/world/level/dimension/FoliageColor.cpp" + "src/world/level/GrassColor.cpp" + "src/world/level/levelgen/*.cpp" "src/world/level/levelgen/feature/Feature.cpp" "src/world/level/levelgen/synth/*.cpp" @@ -258,6 +261,8 @@ file(GLOB CLIENT_SOURCES "src/util/**.cpp" + "src/util/Color.cpp" + "src/world/*.cpp" "src/world/phys/*.cpp" "src/world/entity/*.cpp" From 59ba8bfb7cc324d09e4a756f56c76581157f6b6c Mon Sep 17 00:00:00 2001 From: Shredder Date: Mon, 6 Apr 2026 10:00:12 +0500 Subject: [PATCH 13/33] my bad should be fixed now --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 08bb158..cdd27f0 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -166,6 +166,7 @@ file(GLOB SERVER_SOURCES "src/util/Mth.cpp" "src/util/PerfTimer.cpp" "src/util/StringUtils.cpp" + "src/util/Color.cpp" "src/world/Direction.cpp" From 72b68389b2e8906d00c34e42e4fff3f175a8a87a Mon Sep 17 00:00:00 2001 From: deepfriedwaffles Date: Tue, 17 Mar 2026 02:22:17 -0400 Subject: [PATCH 14/33] Started to port to iOS; fixing compiler errors here and there --- .../minecraftpe.xcodeproj/project.pbxproj | 96 ++++++++++++------- .../minecraftpe/minecraftpe-Info.plist | 2 +- src/AppPlatform_iOS.h | 3 +- src/client/Option.h | 4 +- src/client/renderer/gles.h | 8 +- src/platform/audio/SoundSystemAL.h | 10 +- 6 files changed, 79 insertions(+), 44 deletions(-) diff --git a/project/iosproj/minecraftpe.xcodeproj/project.pbxproj b/project/iosproj/minecraftpe.xcodeproj/project.pbxproj index b4f42b6..29b0f86 100755 --- a/project/iosproj/minecraftpe.xcodeproj/project.pbxproj +++ b/project/iosproj/minecraftpe.xcodeproj/project.pbxproj @@ -4527,10 +4527,16 @@ isa = PBXProject; attributes = { LastUpgradeCheck = 0420; + TargetAttributes = { + D5CF9C41144C225000E4244F = { + DevelopmentTeam = PZUVNW8F2U; + ProvisioningStyle = Automatic; + }; + }; }; buildConfigurationList = D5CF9C3C144C225000E4244F /* Build configuration list for PBXProject "minecraftpe" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, @@ -5736,24 +5742,26 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)"; + ARCHS = "$(ARCHS_STANDARD)"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution: Mojang AB"; COPY_PHASE_STRIP = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_PREPROCESSOR_DEFINITIONS = PUBLISH; - GCC_VERSION = com.apple.compilers.llvmgcc42; + GCC_VERSION = ""; GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = NO; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 4.3; + IPHONEOS_DEPLOYMENT_TARGET = 14; + ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; "PROVISIONING_PROFILE[sdk=iphoneos*]" = "C93D3524-5C6F-466E-B12B-833663B7EAE0"; RUN_CLANG_STATIC_ANALYZER = NO; - SDKROOT = iphoneos6.0; + SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)\\..\\..\\src/**"; VALIDATE_PRODUCT = YES; }; name = "Ad-Hoc"; @@ -5765,15 +5773,17 @@ GCC_PREFIX_HEADER = "minecraftpe/minecraftpe-Prefix.pch"; GCC_PREPROCESSOR_DEFINITIONS = ""; "GCC_THUMB_SUPPORT[arch=armv7]" = NO; - GCC_VERSION = com.apple.compilers.llvmgcc42; + GCC_VERSION = ""; GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = "minecraftpe/minecraftpe-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 4.3; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; + IPHONEOS_DEPLOYMENT_TARGET = 14; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_BUNDLE_IDENTIFIER = "com.mojang.mcpe-arm64"; PRODUCT_NAME = "$(TARGET_NAME)"; RUN_CLANG_STATIC_ANALYZER = NO; - SDKROOT = iphoneos6.0; - VALID_ARCHS = "i386 armv6 armv7"; + SDKROOT = iphoneos; WRAPPER_EXTENSION = app; }; name = "Ad-Hoc"; @@ -5847,23 +5857,25 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)"; + ARCHS = "$(ARCHS_STANDARD)"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution: Mojang AB"; COPY_PHASE_STRIP = YES; GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_VERSION = com.apple.compilers.llvmgcc42; + GCC_VERSION = ""; GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = NO; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 4.3; + IPHONEOS_DEPLOYMENT_TARGET = 14; + ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; "PROVISIONING_PROFILE[sdk=iphoneos*]" = "64BA8967-1A9A-4980-972C-42E75AD5E023"; RUN_CLANG_STATIC_ANALYZER = NO; - SDKROOT = iphoneos6.0; + SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)\\..\\..\\src/**"; VALIDATE_PRODUCT = YES; }; name = AppStore; @@ -5876,11 +5888,13 @@ GCC_PREFIX_HEADER = "minecraftpe/minecraftpe-Prefix.pch"; GCC_PREPROCESSOR_DEFINITIONS = PUBLISH; "GCC_THUMB_SUPPORT[arch=armv7]" = NO; - GCC_VERSION = com.apple.compilers.llvmgcc42; + GCC_VERSION = ""; GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = "minecraftpe/minecraftpe-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 4.3; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; + IPHONEOS_DEPLOYMENT_TARGET = 14; + ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = ( "-DNS_BLOCK_ASSERTIONS=1", "-DANDROID_PUBLISH", @@ -5888,8 +5902,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; "PROVISIONING_PROFILE[sdk=iphoneos*]" = "1B194957-98CF-49B7-A0E7-76692B4B722D"; RUN_CLANG_STATIC_ANALYZER = NO; - SDKROOT = iphoneos6.0; - VALID_ARCHS = "i386 armv6 armv7"; + SDKROOT = iphoneos; WRAPPER_EXTENSION = app; }; name = AppStore; @@ -5923,7 +5936,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)"; + ARCHS = "$(ARCHS_STANDARD)"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; GCC_C_LANGUAGE_STANDARD = gnu99; @@ -5935,17 +5948,20 @@ "$(inherited)", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_VERSION = com.apple.compilers.llvmgcc42; + GCC_VERSION = ""; GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = NO; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 4.3; + IPHONEOS_DEPLOYMENT_TARGET = 14; + ONLY_ACTIVE_ARCH = YES; RUN_CLANG_STATIC_ANALYZER = NO; - SDKROOT = iphoneos6.0; + SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)\\..\\..\\src/**"; + VALIDATE_PRODUCT = YES; }; name = Debug; }; @@ -5953,23 +5969,25 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)"; + ARCHS = "$(ARCHS_STANDARD)"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_PREPROCESSOR_DEFINITIONS = PUBLISH; - GCC_VERSION = com.apple.compilers.llvmgcc42; + GCC_VERSION = ""; GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = NO; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 4.3; + IPHONEOS_DEPLOYMENT_TARGET = 14; + ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; RUN_CLANG_STATIC_ANALYZER = NO; - SDKROOT = iphoneos6.0; + SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)\\..\\..\\src/**"; VALIDATE_PRODUCT = YES; }; name = Release; @@ -5977,19 +5995,25 @@ D5CF9C6F144C225000E4244F /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = PZUVNW8F2U; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "minecraftpe/minecraftpe-Prefix.pch"; GCC_PREPROCESSOR_DEFINITIONS = "DEBUG=1"; "GCC_THUMB_SUPPORT[arch=armv7]" = NO; - GCC_VERSION = com.apple.compilers.llvmgcc42; + GCC_VERSION = ""; GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = "minecraftpe/minecraftpe-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 4.3; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; + IPHONEOS_DEPLOYMENT_TARGET = 14; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_BUNDLE_IDENTIFIER = "com.mojang.mcpe-arm64"; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; RUN_CLANG_STATIC_ANALYZER = NO; - SDKROOT = iphoneos6.0; - VALID_ARCHS = "i386 armv6 armv7"; + SDKROOT = iphoneos; WRAPPER_EXTENSION = app; }; name = Debug; @@ -5997,19 +6021,25 @@ D5CF9C70144C225000E4244F /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = PZUVNW8F2U; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "minecraftpe/minecraftpe-Prefix.pch"; GCC_PREPROCESSOR_DEFINITIONS = ""; "GCC_THUMB_SUPPORT[arch=armv7]" = NO; - GCC_VERSION = com.apple.compilers.llvmgcc42; + GCC_VERSION = ""; GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = "minecraftpe/minecraftpe-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 4.3; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; + IPHONEOS_DEPLOYMENT_TARGET = 14; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_BUNDLE_IDENTIFIER = "com.mojang.mcpe-arm64"; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; RUN_CLANG_STATIC_ANALYZER = NO; - SDKROOT = iphoneos6.0; - VALID_ARCHS = "i386 armv6 armv7"; + SDKROOT = iphoneos; WRAPPER_EXTENSION = app; }; name = Release; diff --git a/project/iosproj/minecraftpe/minecraftpe-Info.plist b/project/iosproj/minecraftpe/minecraftpe-Info.plist index 30bd23f..3f1a803 100755 --- a/project/iosproj/minecraftpe/minecraftpe-Info.plist +++ b/project/iosproj/minecraftpe/minecraftpe-Info.plist @@ -37,7 +37,7 @@ CFBundleIdentifier - com.mojang.${PRODUCT_NAME:rfc1034identifier} + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/src/AppPlatform_iOS.h b/src/AppPlatform_iOS.h index 55a786d..a2206b6 100755 --- a/src/AppPlatform_iOS.h +++ b/src/AppPlatform_iOS.h @@ -52,11 +52,10 @@ public: virtual StringVector getOptionStrings(); - virtual bool isPowerVR() { return false; } + virtual bool isPowerVR(); virtual bool isSuperFast(); virtual void showKeyboard(); virtual void hideKeyboard(); - virtual void isPowerVR(); private: std::string _basePath; diff --git a/src/client/Option.h b/src/client/Option.h index cc6547a..0b9aed1 100644 --- a/src/client/Option.h +++ b/src/client/Option.h @@ -1,7 +1,7 @@ #pragma once #include #include -#include +#include "Mth.h" /* template struct is_option_type : std::false_type {}; @@ -104,4 +104,4 @@ public: private: std::string m_value; -}; \ No newline at end of file +}; diff --git a/src/client/renderer/gles.h b/src/client/renderer/gles.h index 7b7e4fd..9a74c07 100755 --- a/src/client/renderer/gles.h +++ b/src/client/renderer/gles.h @@ -14,11 +14,11 @@ #define USE_VBO #define GL_QUADS 0x0007 #if defined(__APPLE__) - #import - #import + #import + #import #elif defined(ANDROID) || defined(__EMSCRIPTEN__) - #include - #include + #import + #import #else #include diff --git a/src/platform/audio/SoundSystemAL.h b/src/platform/audio/SoundSystemAL.h index ca0ac7f..a7c225f 100755 --- a/src/platform/audio/SoundSystemAL.h +++ b/src/platform/audio/SoundSystemAL.h @@ -3,8 +3,14 @@ #include "SoundSystem.h" -#include -#include +// If audio breaks for other platforms, this is probably why. Here, I'm just calling where Apple's OpenAL headers live (they arent in just "AL" +#if defined(__APPLE__) + #include + #include +#else + #include + #include +#endif #include #include From ab5f1772082c94950a8c6e14cf2c7c9216c01b16 Mon Sep 17 00:00:00 2001 From: deepfriedwaffles Date: Tue, 17 Mar 2026 02:31:41 -0400 Subject: [PATCH 15/33] added needed missing files --- src/client/KeyMapping.h | 21 ++++ src/client/gui/components/OptionsPane.cpp | 63 +++++++++++ src/client/gui/components/OptionsPane.h | 30 +++++ src/client/gui/components/SmallButton.cpp | 24 ++++ src/client/gui/components/SmallButton.h | 23 ++++ src/client/gui/screens/BuyGameScreen.h | 26 +++++ src/client/gui/screens/InvalidLicenseScreen.h | 107 ++++++++++++++++++ 7 files changed, 294 insertions(+) create mode 100644 src/client/KeyMapping.h create mode 100644 src/client/gui/components/OptionsPane.cpp create mode 100644 src/client/gui/components/OptionsPane.h create mode 100644 src/client/gui/components/SmallButton.cpp create mode 100644 src/client/gui/components/SmallButton.h create mode 100644 src/client/gui/screens/BuyGameScreen.h create mode 100644 src/client/gui/screens/InvalidLicenseScreen.h diff --git a/src/client/KeyMapping.h b/src/client/KeyMapping.h new file mode 100644 index 0000000..06740c8 --- /dev/null +++ b/src/client/KeyMapping.h @@ -0,0 +1,21 @@ +#ifndef NET_MINECRAFT_CLIENT__KeyMapping_H__ +#define NET_MINECRAFT_CLIENT__KeyMapping_H__ + +//package net.minecraft.client; +#include + +class KeyMapping +{ +public: + std::string name; + int key; + + KeyMapping() {} + + KeyMapping(const std::string& name_, int key_) + : name(name_), + key(key_) + {} +}; + +#endif /*NET_MINECRAFT_CLIENT__KeyMapping_H__*/ diff --git a/src/client/gui/components/OptionsPane.cpp b/src/client/gui/components/OptionsPane.cpp new file mode 100644 index 0000000..8cc5d70 --- /dev/null +++ b/src/client/gui/components/OptionsPane.cpp @@ -0,0 +1,63 @@ +#include "OptionsPane.h" +#include "OptionsGroup.h" +#include "OptionsItem.h" +#include "ImageButton.h" +#include "Slider.h" +#include "../../Minecraft.h" + +OptionsPane::OptionsPane() { + +} + +void OptionsPane::setupPositions() { + int currentHeight = y + 1; + for(std::vector::iterator it = children.begin(); it != children.end(); ++it ) { + (*it)->width = width; + (*it)->y = currentHeight; + (*it)->x = x; + currentHeight += (*it)->height + 1; + } + height = currentHeight; + super::setupPositions(); +} + +OptionsGroup& OptionsPane::createOptionsGroup( std::string label ) { + OptionsGroup* newGroup = new OptionsGroup(label); + children.push_back(newGroup); + // create and return a new group index + return *newGroup; +} + +void OptionsPane::createToggle( unsigned int group, std::string label, const Options::Option* option ) { + if(group > children.size()) return; + ImageDef def; + def.setSrc(IntRectangle(160, 206, 39, 20)); + def.name = "gui/touchgui.png"; + def.width = 39 * 0.7f; + def.height = 20 * 0.7f; + OptionButton* element = new OptionButton(option); + element->setImageDef(def, true); + OptionsItem* item = new OptionsItem(label, element); + ((OptionsGroup*)children[group])->addChild(item); + setupPositions(); +} + +void OptionsPane::createProgressSlider( Minecraft* minecraft, unsigned int group, std::string label, const Options::Option* option, float progressMin/*=1.0f*/, float progressMax/*=1.0f */ ) { + if(group > children.size()) return; + Slider* element = new Slider(minecraft, option, progressMin, progressMax); + element->width = 100; + element->height = 20; + OptionsItem* item = new OptionsItem(label, element); + ((OptionsGroup*)children[group])->addChild(item); + setupPositions(); +} + +void OptionsPane::createStepSlider( Minecraft* minecraft, unsigned int group, std::string label, const Options::Option* option, const std::vector& stepVec ) { + if(group > children.size()) return; + Slider* element = new Slider(minecraft, option, stepVec); + element->width = 100; + element->height = 20; + OptionsItem* item = new OptionsItem(label, element); + ((OptionsGroup*)children[group])->addChild(item); + setupPositions(); +} \ No newline at end of file diff --git a/src/client/gui/components/OptionsPane.h b/src/client/gui/components/OptionsPane.h new file mode 100644 index 0000000..5eb9652 --- /dev/null +++ b/src/client/gui/components/OptionsPane.h @@ -0,0 +1,30 @@ +#ifndef ITEMPANE_H__ +#define ITEMPANE_H__ + +#include +#include +#include "GuiElementContainer.h" +#include "../../../world/item/ItemInstance.h" +#include "../../../client/Options.h" +class Font; +class Textures; +class NinePatchLayer; +class ItemPane; +class OptionButton; +class Button; +class OptionsGroup; +class Slider; +class Minecraft; +class OptionsPane: public GuiElementContainer +{ + typedef GuiElementContainer super; +public: + OptionsPane(); + OptionsGroup& createOptionsGroup( std::string label ); + void createToggle( unsigned int group, std::string label, const Options::Option* option ); + void createProgressSlider(Minecraft* minecraft, unsigned int group, std::string label, const Options::Option* option, float progressMin=1.0f, float progressMax=1.0f ); + void createStepSlider(Minecraft* minecraft, unsigned int group, std::string label, const Options::Option* option, const std::vector& stepVec ); + void setupPositions(); +}; + +#endif /*ITEMPANE_H__*/ diff --git a/src/client/gui/components/SmallButton.cpp b/src/client/gui/components/SmallButton.cpp new file mode 100644 index 0000000..e2ebfaa --- /dev/null +++ b/src/client/gui/components/SmallButton.cpp @@ -0,0 +1,24 @@ +#include "SmallButton.h" + +SmallButton::SmallButton( int id, int x, int y, const std::string& msg ) +: super(id, x, y, 150, 20, msg), + option(NULL) +{ +} + +SmallButton::SmallButton( int id, int x, int y, int width, int height, const std::string& msg ) +: super(id, x, y, width, height, msg), + option(NULL) +{ +} + +SmallButton::SmallButton( int id, int x, int y, Options::Option* item, const std::string& msg ) +: super(id, x, y, 150, 20, msg), + option(item) +{ +} + +Options::Option* SmallButton::getOption() +{ + return option; +} diff --git a/src/client/gui/components/SmallButton.h b/src/client/gui/components/SmallButton.h new file mode 100644 index 0000000..05ae378 --- /dev/null +++ b/src/client/gui/components/SmallButton.h @@ -0,0 +1,23 @@ +#ifndef NET_MINECRAFT_CLIENT_GUI_COMPONENTS__SmallButton_H__ +#define NET_MINECRAFT_CLIENT_GUI_COMPONENTS__SmallButton_H__ + +//package net.minecraft.client.gui; + +#include +#include "Button.h" +#include "../../Options.h" + +class SmallButton: public Button +{ + typedef Button super; +public: + SmallButton(int id, int x, int y, const std::string& msg); + SmallButton(int id, int x, int y, int width, int height, const std::string& msg); + SmallButton(int id, int x, int y, Options::Option* item, const std::string& msg); + + Options::Option* getOption(); +private: + Options::Option* option; +}; + +#endif /*NET_MINECRAFT_CLIENT_GUI_COMPONENTS__SmallButton_H__*/ diff --git a/src/client/gui/screens/BuyGameScreen.h b/src/client/gui/screens/BuyGameScreen.h new file mode 100644 index 0000000..228cdba --- /dev/null +++ b/src/client/gui/screens/BuyGameScreen.h @@ -0,0 +1,26 @@ +#ifndef NET_MINECRAFT_CLIENT_GUI_SCREENS__BuyGameScreen_H__ +#define NET_MINECRAFT_CLIENT_GUI_SCREENS__BuyGameScreen_H__ + +#include "../Screen.h" +#include "../components/Button.h" + +class BuyGameScreen: public Screen +{ +public: + BuyGameScreen() {} + virtual ~BuyGameScreen() {} + + void init(); + + void render(int xm, int ym, float a); + + void buttonClicked(Button* button) { + //if (button->id == bQuit.id) + } + +private: + //Button bQuit; + //Button bBuyGame; +}; + +#endif /*NET_MINECRAFT_CLIENT_GUI_SCREENS__BuyGameScreen_H__*/ diff --git a/src/client/gui/screens/InvalidLicenseScreen.h b/src/client/gui/screens/InvalidLicenseScreen.h new file mode 100644 index 0000000..2801521 --- /dev/null +++ b/src/client/gui/screens/InvalidLicenseScreen.h @@ -0,0 +1,107 @@ +#ifndef NET_MINECRAFT_CLIENT_GUI_SCREENS__InvalidLicenseScreen_H__ +#define NET_MINECRAFT_CLIENT_GUI_SCREENS__InvalidLicenseScreen_H__ + +#include "../Screen.h" +#include "../components/Button.h" +#include "../../Minecraft.h" +#include "../../../LicenseCodes.h" + +class InvalidLicenseScreen: public Screen +{ +public: + InvalidLicenseScreen(int id, bool hasBuyButton) + : _id(id), + _hasBuyButton(hasBuyButton), + _baseY(0), + bOk(0), + bBuy(0) + { + } + + virtual ~InvalidLicenseScreen() { + delete bOk; + delete bBuy; + } + + void init() { + if (minecraft->useTouchscreen()) { + bOk = new Touch::TButton(1, "Ok"); + bBuy = new Touch::TButton(2, "Buy"); + } else { + bOk = new Button(1, "Ok"); + bBuy = new Button(2, "Buy"); + } + + if (_hasBuyButton) + bOk->msg = "Quit"; + + if (!LicenseCodes::isOk(_id)) { + char buf[20] = {0}; + sprintf(buf, "%d", _id); + + desc1 = "License verification failed (error "; + desc1 += buf; + desc1 += ")"; + desc2 = "Try again later."; + hint = "You need to be connected to the internet\n"; + hint += "once while you start the game."; + } + + buttons.push_back(bOk); + tabButtons.push_back(bOk); + + if (_hasBuyButton) { + buttons.push_back(bBuy); + tabButtons.push_back(bBuy); + } + } + + void setupPositions() { + _baseY = height/5 + 6; + //if (_hasBuyButton) + _baseY -= 24; + + bOk->width = bBuy->width = 200; + bOk->x = bBuy->x = (width - bOk->width) / 2; + bBuy->y = _baseY + 84; + bOk->y = bBuy->y + bBuy->height + 4; + + if (!_hasBuyButton) + bOk->y -= 24; + } + + void tick() {} + + //void keyPressed(int eventKey) {} + + void render(int xm, int ym, float a) { + renderDirtBackground(0); + drawCenteredString(minecraft->font, desc1, width/2, _baseY, 0xffffff); + drawCenteredString(minecraft->font, desc2, width/2, _baseY + 24, 0xffffff); + + drawCenteredString(minecraft->font, hint, width/2, _baseY + 60, 0xffffff); + + Screen::render(xm, ym, a); + } + + void buttonClicked(Button* button) { + if (button->id == bOk->id) { + minecraft->quit(); + } + if (button->id == bBuy->id) { + minecraft->platform()->buyGame(); + } + }; +private: + int _id; + std::string desc1; + std::string desc2; + std::string hint; + + Button* bOk; + Button* bBuy; + bool _hasBuyButton; + int _baseY; +}; + +#endif /*NET_MINECRAFT_CLIENT_GUI_SCREENS__InvalidLicenseScreen_H__*/ From b658132dac9d7e228f86eb89010180abe9b362cd Mon Sep 17 00:00:00 2001 From: deepfriedwaffles Date: Tue, 17 Mar 2026 02:48:31 -0400 Subject: [PATCH 16/33] fix missing file, commiting now because what im about to do might break Option class --- .../iosproj/minecraftpe.xcodeproj/project.pbxproj | 14 +++++++++----- src/client/gui/screens/UsernameScreen.h | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/project/iosproj/minecraftpe.xcodeproj/project.pbxproj b/project/iosproj/minecraftpe.xcodeproj/project.pbxproj index 29b0f86..64c2c75 100755 --- a/project/iosproj/minecraftpe.xcodeproj/project.pbxproj +++ b/project/iosproj/minecraftpe.xcodeproj/project.pbxproj @@ -1211,7 +1211,7 @@ 042A91A916B17517007ABBC6 /* OptionsPane.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OptionsPane.cpp; sourceTree = ""; }; 042A91AA16B17517007ABBC6 /* OptionsPane.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OptionsPane.h; sourceTree = ""; }; 042A91AB16B17517007ABBC6 /* TextBox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextBox.cpp; sourceTree = ""; }; - 042A91AC16B17517007ABBC6 /* TextBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextBox.h; sourceTree = ""; }; + 042A91AC16B17517007ABBC6 /* TextBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TextBox.h; path = ../../src/client/gui/components/TextBox.h; sourceTree = SOURCE_ROOT; }; 044129061682FF9600B70EE6 /* MouseHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MouseHandler.cpp; sourceTree = ""; }; 9D293CE616071C08000305C8 /* CreateNewWorld_iphone.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = CreateNewWorld_iphone.xib; path = minecraftpe/dialogs/CreateNewWorld_iphone.xib; sourceTree = ""; }; 9D293CEA160720D6000305C8 /* worldname_iphone5_3.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = worldname_iphone5_3.png; sourceTree = ""; }; @@ -5754,6 +5754,7 @@ GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = NO; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = "$(SRCROOT)\\src/**"; IPHONEOS_DEPLOYMENT_TARGET = 14; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; @@ -5761,7 +5762,7 @@ RUN_CLANG_STATIC_ANALYZER = NO; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)\\..\\..\\src/**"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)\\src/**"; VALIDATE_PRODUCT = YES; }; name = "Ad-Hoc"; @@ -5868,6 +5869,7 @@ GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = NO; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = "$(SRCROOT)\\src/**"; IPHONEOS_DEPLOYMENT_TARGET = 14; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; @@ -5875,7 +5877,7 @@ RUN_CLANG_STATIC_ANALYZER = NO; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)\\..\\..\\src/**"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)\\src/**"; VALIDATE_PRODUCT = YES; }; name = AppStore; @@ -5955,12 +5957,13 @@ GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = NO; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = "$(SRCROOT)\\src/**"; IPHONEOS_DEPLOYMENT_TARGET = 14; ONLY_ACTIVE_ARCH = YES; RUN_CLANG_STATIC_ANALYZER = NO; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)\\..\\..\\src/**"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)\\src/**"; VALIDATE_PRODUCT = YES; }; name = Debug; @@ -5981,13 +5984,14 @@ GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = NO; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = "$(SRCROOT)\\src/**"; IPHONEOS_DEPLOYMENT_TARGET = 14; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; RUN_CLANG_STATIC_ANALYZER = NO; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)\\..\\..\\src/**"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)\\src/**"; VALIDATE_PRODUCT = YES; }; name = Release; diff --git a/src/client/gui/screens/UsernameScreen.h b/src/client/gui/screens/UsernameScreen.h index c1d750e..38db252 100644 --- a/src/client/gui/screens/UsernameScreen.h +++ b/src/client/gui/screens/UsernameScreen.h @@ -3,7 +3,7 @@ #include "../Screen.h" #include "../components/Button.h" -#include "client/gui/components/TextBox.h" +#include "/client/gui/components/TextBox.h" #include class UsernameScreen : public Screen From 59898ca504f5ef3cd5a6e51ca1cef22eea56fda4 Mon Sep 17 00:00:00 2001 From: deepfriedwaffles Date: Thu, 19 Mar 2026 11:06:55 -0400 Subject: [PATCH 17/33] more header fixes --- .../minecraftpe.xcodeproj/project.pbxproj | 50 ++++++++++++++++--- src/client/Options.h | 4 ++ src/client/gui/components/Slider.h | 2 +- src/client/gui/components/SmallButton.cpp | 4 +- src/client/gui/components/SmallButton.h | 6 +-- src/client/gui/screens/JoinByIPScreen.h | 6 +-- src/client/gui/screens/ScreenChooser.cpp | 2 +- src/client/gui/screens/UsernameScreen.h | 3 +- .../screens/crafting/PaneCraftingScreen.cpp | 2 +- 9 files changed, 59 insertions(+), 20 deletions(-) diff --git a/project/iosproj/minecraftpe.xcodeproj/project.pbxproj b/project/iosproj/minecraftpe.xcodeproj/project.pbxproj index 64c2c75..6cdc467 100755 --- a/project/iosproj/minecraftpe.xcodeproj/project.pbxproj +++ b/project/iosproj/minecraftpe.xcodeproj/project.pbxproj @@ -1147,6 +1147,7 @@ D5F3B7DD14548E7900D25470 /* IASKPSToggleSwitchSpecifierViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = D5F3B7C814548E7900D25470 /* IASKPSToggleSwitchSpecifierViewCell.xib */; }; D5F3B7DE14548E7900D25470 /* IASKSpecifierValuesView.xib in Resources */ = {isa = PBXBuildFile; fileRef = D5F3B7C914548E7900D25470 /* IASKSpecifierValuesView.xib */; }; D5F3B7E51454930400D25470 /* InAppSettings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = D5F3B7E41454930400D25470 /* InAppSettings.bundle */; }; + F912B8CF2F6C3D5200BC60DF /* TextBox.h in Sources */ = {isa = PBXBuildFile; fileRef = 042A91AC16B17517007ABBC6 /* TextBox.h */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -5345,6 +5346,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + F912B8CF2F6C3D5200BC60DF /* TextBox.h in Sources */, D5CF9C57144C225000E4244F /* main.mm in Sources */, D5CF9C5B144C225000E4244F /* minecraftpeAppDelegate.mm in Sources */, D5CF9C65144C225000E4244F /* EAGLView.m in Sources */, @@ -5754,7 +5756,11 @@ GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = NO; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = "$(SRCROOT)\\src/**"; + HEADER_SEARCH_PATHS = ( + "$(SRCROOT)/src/**", + "$(SRCROOT)/src/client/gui/components/**", + "$(SRCROOT)/src/client/gui/**", + ); IPHONEOS_DEPLOYMENT_TARGET = 14; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; @@ -5776,7 +5782,11 @@ "GCC_THUMB_SUPPORT[arch=armv7]" = NO; GCC_VERSION = ""; GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; - HEADER_SEARCH_PATHS = ""; + HEADER_SEARCH_PATHS = ( + "$(SRCROOT)/src/client/gui/components/**", + "$(SRCROOT)/src/client/gui/**", + "$(SRCROOT)/src/**", + ); INFOPLIST_FILE = "minecraftpe/minecraftpe-Info.plist"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; IPHONEOS_DEPLOYMENT_TARGET = 14; @@ -5869,7 +5879,11 @@ GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = NO; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = "$(SRCROOT)\\src/**"; + HEADER_SEARCH_PATHS = ( + "$(SRCROOT)/src/**", + "$(SRCROOT)/src/client/gui/components/**", + "$(SRCROOT)/src/client/gui/**", + ); IPHONEOS_DEPLOYMENT_TARGET = 14; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; @@ -5892,7 +5906,11 @@ "GCC_THUMB_SUPPORT[arch=armv7]" = NO; GCC_VERSION = ""; GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; - HEADER_SEARCH_PATHS = ""; + HEADER_SEARCH_PATHS = ( + "$(SRCROOT)/src/client/gui/components/**", + "$(SRCROOT)/src/client/gui/**", + "$(SRCROOT)/src/**", + ); INFOPLIST_FILE = "minecraftpe/minecraftpe-Info.plist"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; IPHONEOS_DEPLOYMENT_TARGET = 14; @@ -5957,7 +5975,11 @@ GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = NO; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = "$(SRCROOT)\\src/**"; + HEADER_SEARCH_PATHS = ( + "$(SRCROOT)/src/**", + "$(SRCROOT)/src/client/gui/components/**", + "$(SRCROOT)/src/client/gui/**", + ); IPHONEOS_DEPLOYMENT_TARGET = 14; ONLY_ACTIVE_ARCH = YES; RUN_CLANG_STATIC_ANALYZER = NO; @@ -5984,7 +6006,11 @@ GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = NO; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = "$(SRCROOT)\\src/**"; + HEADER_SEARCH_PATHS = ( + "$(SRCROOT)/src/**", + "$(SRCROOT)/src/client/gui/components/**", + "$(SRCROOT)/src/client/gui/**", + ); IPHONEOS_DEPLOYMENT_TARGET = 14; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; @@ -6008,7 +6034,11 @@ "GCC_THUMB_SUPPORT[arch=armv7]" = NO; GCC_VERSION = ""; GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; - HEADER_SEARCH_PATHS = ""; + HEADER_SEARCH_PATHS = ( + "$(SRCROOT)/src/client/gui/components/**", + "$(SRCROOT)/src/client/gui/**", + "$(SRCROOT)/src/**", + ); INFOPLIST_FILE = "minecraftpe/minecraftpe-Info.plist"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; IPHONEOS_DEPLOYMENT_TARGET = 14; @@ -6034,7 +6064,11 @@ "GCC_THUMB_SUPPORT[arch=armv7]" = NO; GCC_VERSION = ""; GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; - HEADER_SEARCH_PATHS = ""; + HEADER_SEARCH_PATHS = ( + "$(SRCROOT)/src/client/gui/components/**", + "$(SRCROOT)/src/client/gui/**", + "$(SRCROOT)/src/**", + ); INFOPLIST_FILE = "minecraftpe/minecraftpe-Info.plist"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; IPHONEOS_DEPLOYMENT_TARGET = 14; diff --git a/src/client/Options.h b/src/client/Options.h index 9852d48..f81734d 100755 --- a/src/client/Options.h +++ b/src/client/Options.h @@ -97,6 +97,10 @@ typedef std::vector StringVector; class Options { public: + // deepfriedwaffles: for iOS, was getting compile errors saying: No member named 'sound' in 'Options' and No member named 'music' in 'Options' so I floated them here. 1.0f means full volume out of the box, but if everything is too loud, you might want to try adjusting this + float sound = 1.0f; + float music = 1.0f; + static bool debugGl; Options(Minecraft* minecraft, const std::string& workingDirectory = "") diff --git a/src/client/gui/components/Slider.h b/src/client/gui/components/Slider.h index 73c009a..107ec98 100755 --- a/src/client/gui/components/Slider.h +++ b/src/client/gui/components/Slider.h @@ -3,7 +3,7 @@ #include "GuiElement.h" #include "../../../client/Options.h" -#include +#include "OptionsPane.h" // was originally Option.h, shouldn't it be this? class Slider : public GuiElement { typedef GuiElement super; diff --git a/src/client/gui/components/SmallButton.cpp b/src/client/gui/components/SmallButton.cpp index e2ebfaa..e154736 100644 --- a/src/client/gui/components/SmallButton.cpp +++ b/src/client/gui/components/SmallButton.cpp @@ -12,13 +12,13 @@ SmallButton::SmallButton( int id, int x, int y, int width, int height, const std { } -SmallButton::SmallButton( int id, int x, int y, Options::Option* item, const std::string& msg ) +SmallButton::SmallButton( int id, int x, int y, Option* item, const std::string& msg ) : super(id, x, y, 150, 20, msg), option(item) { } -Options::Option* SmallButton::getOption() +Option* SmallButton::getOption() { return option; } diff --git a/src/client/gui/components/SmallButton.h b/src/client/gui/components/SmallButton.h index 05ae378..2fd6372 100644 --- a/src/client/gui/components/SmallButton.h +++ b/src/client/gui/components/SmallButton.h @@ -13,11 +13,11 @@ class SmallButton: public Button public: SmallButton(int id, int x, int y, const std::string& msg); SmallButton(int id, int x, int y, int width, int height, const std::string& msg); - SmallButton(int id, int x, int y, Options::Option* item, const std::string& msg); + SmallButton(int id, int x, int y, Option* item, const std::string& msg); - Options::Option* getOption(); + Option* getOption(); private: - Options::Option* option; + Option* option; }; #endif /*NET_MINECRAFT_CLIENT_GUI_COMPONENTS__SmallButton_H__*/ diff --git a/src/client/gui/screens/JoinByIPScreen.h b/src/client/gui/screens/JoinByIPScreen.h index 5ee2b16..4b17543 100644 --- a/src/client/gui/screens/JoinByIPScreen.h +++ b/src/client/gui/screens/JoinByIPScreen.h @@ -2,8 +2,8 @@ #include "../Screen.h" #include "../components/Button.h" #include "../../Minecraft.h" -#include "client/gui/components/ImageButton.h" -#include "client/gui/components/TextBox.h" +#include "ImageButton.h" +#include "TextBox.h" class JoinByIPScreen: public Screen { @@ -25,4 +25,4 @@ private: Touch::THeader bHeader; Touch::TButton bJoin; ImageButton bBack; -}; \ No newline at end of file +}; diff --git a/src/client/gui/screens/ScreenChooser.cpp b/src/client/gui/screens/ScreenChooser.cpp index b423524..610a209 100755 --- a/src/client/gui/screens/ScreenChooser.cpp +++ b/src/client/gui/screens/ScreenChooser.cpp @@ -14,7 +14,7 @@ #include "../../Minecraft.h" -#include +#include "UsernameScreen.h" Screen* ScreenChooser::createScreen( ScreenId id ) { diff --git a/src/client/gui/screens/UsernameScreen.h b/src/client/gui/screens/UsernameScreen.h index 38db252..592998f 100644 --- a/src/client/gui/screens/UsernameScreen.h +++ b/src/client/gui/screens/UsernameScreen.h @@ -3,7 +3,8 @@ #include "../Screen.h" #include "../components/Button.h" -#include "/client/gui/components/TextBox.h" +// this is cursed lol +#include "../../../client/gui/components/TextBox.h" #include class UsernameScreen : public Screen diff --git a/src/client/gui/screens/crafting/PaneCraftingScreen.cpp b/src/client/gui/screens/crafting/PaneCraftingScreen.cpp index 4e3d025..c0ec6a9 100755 --- a/src/client/gui/screens/crafting/PaneCraftingScreen.cpp +++ b/src/client/gui/screens/crafting/PaneCraftingScreen.cpp @@ -16,7 +16,7 @@ #include "../../../../world/level/Level.h" #include "../../../../world/item/DyePowderItem.h" #include "../../../../world/item/crafting/Recipe.h" -#include "platform/input/Keyboard.h" +#include "Keyboard.h" static NinePatchLayer* guiPaneFrame = NULL; From 705c4154ee7c0675af2a93a5270977786f03533d Mon Sep 17 00:00:00 2001 From: deepfriedwaffles Date: Thu, 19 Mar 2026 11:10:19 -0400 Subject: [PATCH 18/33] gonna try changing all Options::Option* in the whole project to just Option* not sure if this works but it gets the compiler to shut up. if this breaks everything change all 'Option*' to 'Options::Option*' as it once was. --- src/client/Minecraft.cpp | 2 +- src/client/gui/components/OptionsPane.cpp | 8 ++++---- src/client/gui/components/OptionsPane.h | 6 +++--- src/client/gui/screens/OptionsScreen.cpp | 5 ++++- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/client/Minecraft.cpp b/src/client/Minecraft.cpp index 1bd68de..97f1bc8 100755 --- a/src/client/Minecraft.cpp +++ b/src/client/Minecraft.cpp @@ -1212,7 +1212,7 @@ void Minecraft::setSize(int w, int h) { int screenHeight = (int)(height * Gui::InvGuiScale); // if (platform()) { - // float pixelsPerMillimeter = options.getProgressValue(&Options::Option::PIXELS_PER_MILLIMETER); + // float pixelsPerMillimeter = options.getProgressValue(&Option::PIXELS_PER_MILLIMETER); // pixelCalc.setPixelsPerMillimeter(pixelsPerMillimeter); // pixelCalcUi.setPixelsPerMillimeter(pixelsPerMillimeter * Gui::InvGuiScale); // } diff --git a/src/client/gui/components/OptionsPane.cpp b/src/client/gui/components/OptionsPane.cpp index 8cc5d70..e7e6aa2 100644 --- a/src/client/gui/components/OptionsPane.cpp +++ b/src/client/gui/components/OptionsPane.cpp @@ -28,7 +28,7 @@ OptionsGroup& OptionsPane::createOptionsGroup( std::string label ) { return *newGroup; } -void OptionsPane::createToggle( unsigned int group, std::string label, const Options::Option* option ) { +void OptionsPane::createToggle( unsigned int group, std::string label, const Option* option ) { if(group > children.size()) return; ImageDef def; def.setSrc(IntRectangle(160, 206, 39, 20)); @@ -42,7 +42,7 @@ void OptionsPane::createToggle( unsigned int group, std::string label, const Opt setupPositions(); } -void OptionsPane::createProgressSlider( Minecraft* minecraft, unsigned int group, std::string label, const Options::Option* option, float progressMin/*=1.0f*/, float progressMax/*=1.0f */ ) { +void OptionsPane::createProgressSlider( Minecraft* minecraft, unsigned int group, std::string label, const Option* option, float progressMin/*=1.0f*/, float progressMax/*=1.0f */ ) { if(group > children.size()) return; Slider* element = new Slider(minecraft, option, progressMin, progressMax); element->width = 100; @@ -52,7 +52,7 @@ void OptionsPane::createProgressSlider( Minecraft* minecraft, unsigned int group setupPositions(); } -void OptionsPane::createStepSlider( Minecraft* minecraft, unsigned int group, std::string label, const Options::Option* option, const std::vector& stepVec ) { +void OptionsPane::createStepSlider( Minecraft* minecraft, unsigned int group, std::string label, const Option* option, const std::vector& stepVec ) { if(group > children.size()) return; Slider* element = new Slider(minecraft, option, stepVec); element->width = 100; @@ -60,4 +60,4 @@ void OptionsPane::createStepSlider( Minecraft* minecraft, unsigned int group, st OptionsItem* item = new OptionsItem(label, element); ((OptionsGroup*)children[group])->addChild(item); setupPositions(); -} \ No newline at end of file +} diff --git a/src/client/gui/components/OptionsPane.h b/src/client/gui/components/OptionsPane.h index 5eb9652..cf16b26 100644 --- a/src/client/gui/components/OptionsPane.h +++ b/src/client/gui/components/OptionsPane.h @@ -21,9 +21,9 @@ class OptionsPane: public GuiElementContainer public: OptionsPane(); OptionsGroup& createOptionsGroup( std::string label ); - void createToggle( unsigned int group, std::string label, const Options::Option* option ); - void createProgressSlider(Minecraft* minecraft, unsigned int group, std::string label, const Options::Option* option, float progressMin=1.0f, float progressMax=1.0f ); - void createStepSlider(Minecraft* minecraft, unsigned int group, std::string label, const Options::Option* option, const std::vector& stepVec ); + void createToggle( unsigned int group, std::string label, const Option* option ); + void createProgressSlider(Minecraft* minecraft, unsigned int group, std::string label, const Option* option, float progressMin=1.0f, float progressMax=1.0f ); + void createStepSlider(Minecraft* minecraft, unsigned int group, std::string label, const Option* option, const std::vector& stepVec ); void setupPositions(); }; diff --git a/src/client/gui/screens/OptionsScreen.cpp b/src/client/gui/screens/OptionsScreen.cpp index 328a207..afa5a8e 100755 --- a/src/client/gui/screens/OptionsScreen.cpp +++ b/src/client/gui/screens/OptionsScreen.cpp @@ -216,6 +216,9 @@ void OptionsScreen::generateOptionScreens() { // // Graphics Pane optionPanes[3]->addOptionItem(OPTIONS_FANCY_GRAPHICS, minecraft) + // .addOptionItem(&Option::VIEW_BOBBING, minecraft) + // .addOptionItem(&Option::AMBIENT_OCCLUSION, minecraft) + // .addOptionItem(&Option::ANAGLYPH, minecraft) .addOptionItem(OPTIONS_LIMIT_FRAMERATE, minecraft) .addOptionItem(OPTIONS_VSYNC, minecraft) .addOptionItem(OPTIONS_RENDER_DEBUG, minecraft) @@ -268,4 +271,4 @@ void OptionsScreen::tick() { currentOptionsGroup->tick(minecraft); super::tick(); -} \ No newline at end of file +} From 22b59bd2cc9ff19e2db31e82430c6a03ace6230a Mon Sep 17 00:00:00 2001 From: deepfriedwaffles Date: Mon, 23 Mar 2026 15:05:47 -0400 Subject: [PATCH 19/33] Synced options UI files from main branch --- src/client/gui/components/Slider.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/gui/components/Slider.h b/src/client/gui/components/Slider.h index 107ec98..77c8894 100755 --- a/src/client/gui/components/Slider.h +++ b/src/client/gui/components/Slider.h @@ -3,7 +3,7 @@ #include "GuiElement.h" #include "../../../client/Options.h" -#include "OptionsPane.h" // was originally Option.h, shouldn't it be this? +#include "Option.h" class Slider : public GuiElement { typedef GuiElement super; From 44ece561e81f86b3745e764464f0c05643d722cd Mon Sep 17 00:00:00 2001 From: deepfriedwaffles Date: Mon, 23 Mar 2026 16:07:02 -0400 Subject: [PATCH 20/33] fixed slider for hopefully the final fucking time. Nether Reactor fix: Need to make the array for building it all unsigned integers as now Xcode is strict about the new C++ Standards as they have changed since 2011 --- src/client/gui/components/Slider.h | 1 - src/world/level/tile/NetherReactorPattern.cpp | 21 ++++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/client/gui/components/Slider.h b/src/client/gui/components/Slider.h index 77c8894..8168741 100755 --- a/src/client/gui/components/Slider.h +++ b/src/client/gui/components/Slider.h @@ -3,7 +3,6 @@ #include "GuiElement.h" #include "../../../client/Options.h" -#include "Option.h" class Slider : public GuiElement { typedef GuiElement super; diff --git a/src/world/level/tile/NetherReactorPattern.cpp b/src/world/level/tile/NetherReactorPattern.cpp index 8181e41..51958f4 100755 --- a/src/world/level/tile/NetherReactorPattern.cpp +++ b/src/world/level/tile/NetherReactorPattern.cpp @@ -6,23 +6,24 @@ NetherReactorPattern::NetherReactorPattern( ) { const int netherCoreId = Tile::netherReactor->id; const unsigned int types[3][3][3] = { - // Level 0 + // Changing all of these values to be unsigned is needed to get the nether reactor pattern to compile. In the past having them be normal ints was fine but the c++ convention has changed + // Level 0 { - {goldId, stoneId, goldId}, - {stoneId, stoneId, stoneId}, - {goldId, stoneId, goldId} + {static_cast(goldId), static_cast(stoneId), static_cast(goldId)}, + {static_cast(stoneId), static_cast(stoneId), static_cast(stoneId)}, + {static_cast(goldId), static_cast(stoneId), static_cast(goldId)} }, // Level 1 { - {stoneId, 0, stoneId}, - {0, netherCoreId, 0}, - {stoneId, 0, stoneId} + {static_cast(stoneId), 0, static_cast(stoneId)}, + {0, static_cast(netherCoreId), 0}, + {static_cast(stoneId), 0, static_cast(stoneId)} }, // Level 2 { - {0, stoneId, 0}, - {stoneId, stoneId, stoneId}, - {0, stoneId, 0} + {0, static_cast(stoneId), 0}, + {static_cast(stoneId), static_cast(stoneId), static_cast(stoneId)}, + {0, static_cast(stoneId), 0} } }; for(int setLevel = 0; setLevel <= 2; ++setLevel) { From 8867878ccfa95fb50816390cf248871597889fb5 Mon Sep 17 00:00:00 2001 From: deepfriedwaffles Date: Mon, 23 Mar 2026 17:53:17 -0400 Subject: [PATCH 21/33] more refactoring for iOS --- .../iosproj/minecraftpe.xcodeproj/project.pbxproj | 6 ------ src/client/Minecraft.cpp | 15 ++++++++++----- src/client/Minecraft.h | 1 + src/client/Options.h | 7 +++---- src/client/gui/Gui.cpp | 4 ++-- src/client/gui/components/ImageButton.cpp | 2 +- src/client/gui/components/KeyOption.h | 4 ++-- src/client/gui/components/TextOption.h | 4 ++-- src/client/player/input/XperiaPlayInput.h | 2 ++ 9 files changed, 23 insertions(+), 22 deletions(-) diff --git a/project/iosproj/minecraftpe.xcodeproj/project.pbxproj b/project/iosproj/minecraftpe.xcodeproj/project.pbxproj index 6cdc467..c8f656c 100755 --- a/project/iosproj/minecraftpe.xcodeproj/project.pbxproj +++ b/project/iosproj/minecraftpe.xcodeproj/project.pbxproj @@ -41,7 +41,6 @@ 042A91AE16B17517007ABBC6 /* GuiElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 042A91A316B17517007ABBC6 /* GuiElement.cpp */; }; 042A91AF16B17517007ABBC6 /* NinePatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 042A91A516B17517007ABBC6 /* NinePatch.cpp */; }; 042A91B016B17517007ABBC6 /* OptionsGroup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 042A91A716B17517007ABBC6 /* OptionsGroup.cpp */; }; - 042A91B116B17517007ABBC6 /* OptionsPane.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 042A91A916B17517007ABBC6 /* OptionsPane.cpp */; }; 042A91B216B17517007ABBC6 /* TextBox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 042A91AB16B17517007ABBC6 /* TextBox.cpp */; }; 044129071682FF9600B70EE6 /* MouseHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 044129061682FF9600B70EE6 /* MouseHandler.cpp */; }; 9D293CE716071C08000305C8 /* CreateNewWorld_iphone.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9D293CE616071C08000305C8 /* CreateNewWorld_iphone.xib */; }; @@ -1209,8 +1208,6 @@ 042A91A616B17517007ABBC6 /* NinePatch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NinePatch.h; sourceTree = ""; }; 042A91A716B17517007ABBC6 /* OptionsGroup.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OptionsGroup.cpp; sourceTree = ""; }; 042A91A816B17517007ABBC6 /* OptionsGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OptionsGroup.h; sourceTree = ""; }; - 042A91A916B17517007ABBC6 /* OptionsPane.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OptionsPane.cpp; sourceTree = ""; }; - 042A91AA16B17517007ABBC6 /* OptionsPane.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OptionsPane.h; sourceTree = ""; }; 042A91AB16B17517007ABBC6 /* TextBox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextBox.cpp; sourceTree = ""; }; 042A91AC16B17517007ABBC6 /* TextBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TextBox.h; path = ../../src/client/gui/components/TextBox.h; sourceTree = SOURCE_ROOT; }; 044129061682FF9600B70EE6 /* MouseHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MouseHandler.cpp; sourceTree = ""; }; @@ -3227,8 +3224,6 @@ 042A91A616B17517007ABBC6 /* NinePatch.h */, 042A91A716B17517007ABBC6 /* OptionsGroup.cpp */, 042A91A816B17517007ABBC6 /* OptionsGroup.h */, - 042A91A916B17517007ABBC6 /* OptionsPane.cpp */, - 042A91AA16B17517007ABBC6 /* OptionsPane.h */, 042A91AB16B17517007ABBC6 /* TextBox.cpp */, 042A91AC16B17517007ABBC6 /* TextBox.h */, D5B50C2814CFF66F005F7284 /* Button.cpp */, @@ -5705,7 +5700,6 @@ 042A91AE16B17517007ABBC6 /* GuiElement.cpp in Sources */, 042A91AF16B17517007ABBC6 /* NinePatch.cpp in Sources */, 042A91B016B17517007ABBC6 /* OptionsGroup.cpp in Sources */, - 042A91B116B17517007ABBC6 /* OptionsPane.cpp in Sources */, 042A91B216B17517007ABBC6 /* TextBox.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/src/client/Minecraft.cpp b/src/client/Minecraft.cpp index 97f1bc8..3170504 100755 --- a/src/client/Minecraft.cpp +++ b/src/client/Minecraft.cpp @@ -1,10 +1,11 @@ #include "Minecraft.h" #include "Options.h" -#include "client/Options.h" -#include "client/player/input/IBuildInput.h" -#include "platform/input/Keyboard.h" -#include "world/item/Item.h" -#include "world/item/ItemInstance.h" +#include "IBuildInput.h" +#include "Keyboard.h" +#include "Item.h" +#include "ItemInstance.h" +#include "XperiaPlayInput.h" +#include "ControllerTurnInput.h" #include #include @@ -24,9 +25,13 @@ #include "../world/level/storage/LevelStorageSource.h" #include "../world/level/storage/LevelStorage.h" #include "player/input/KeyboardInput.h" +<<<<<<< HEAD #include "player/input/ControllerTurnInput.h" #include "player/input/XperiaPlayInput.h" #include "world/level/chunk/ChunkSource.h" +======= +#include "ChunkSource.h" +>>>>>>> abfb9e0 (more refactoring for iOS) #ifndef STANDALONE_SERVER #include "player/input/touchscreen/TouchInputHolder.h" diff --git a/src/client/Minecraft.h b/src/client/Minecraft.h index 1a90b12..22b7ec7 100755 --- a/src/client/Minecraft.h +++ b/src/client/Minecraft.h @@ -221,6 +221,7 @@ private: bool _isCreativeMode; //int _respawnPlayerTicks; Player* _pendingRemovePlayer; // @attn @todo @fix: remove this shait and fix the respawn behaviour + // shit* lmao PerfRenderer* _perfRenderer; CommandServer* _commandServer; diff --git a/src/client/Options.h b/src/client/Options.h index f81734d..c2b0b1f 100755 --- a/src/client/Options.h +++ b/src/client/Options.h @@ -97,9 +97,6 @@ typedef std::vector StringVector; class Options { public: - // deepfriedwaffles: for iOS, was getting compile errors saying: No member named 'sound' in 'Options' and No member named 'music' in 'Options' so I floated them here. 1.0f means full volume out of the box, but if everything is too loud, you might want to try adjusting this - float sound = 1.0f; - float music = 1.0f; static bool debugGl; @@ -164,7 +161,9 @@ private: if (m_options[key] == nullptr) return nullptr; return dynamic_cast(m_options[key]); } - +// apple stuff + float sound; + float music; std::array m_options; OptionsFile optionsFile; diff --git a/src/client/gui/Gui.cpp b/src/client/gui/Gui.cpp index 8df59f0..c54cce5 100755 --- a/src/client/gui/Gui.cpp +++ b/src/client/gui/Gui.cpp @@ -1,7 +1,7 @@ #include "Gui.h" #include "Font.h" -#include "client/Options.h" -#include "platform/input/Keyboard.h" +#include "Options.h" +#include "Keyboard.h" #include "screens/IngameBlockSelectionScreen.h" #include "screens/ChatScreen.h" #include "screens/ConsoleScreen.h" diff --git a/src/client/gui/components/ImageButton.cpp b/src/client/gui/components/ImageButton.cpp index 3d95acc..f686dcd 100755 --- a/src/client/gui/components/ImageButton.cpp +++ b/src/client/gui/components/ImageButton.cpp @@ -4,7 +4,7 @@ #include "../../../platform/log.h" #include "../../../util/Mth.h" #include "../../renderer/Textures.h" -#include +#include "../../Option.h" ImageButton::ImageButton(int id, const std::string& msg) diff --git a/src/client/gui/components/KeyOption.h b/src/client/gui/components/KeyOption.h index fabdc7a..cc86958 100644 --- a/src/client/gui/components/KeyOption.h +++ b/src/client/gui/components/KeyOption.h @@ -1,6 +1,6 @@ #pragma once #include "Button.h" -#include +#include "Options.h" class KeyOption : public Touch::TButton { public: @@ -11,4 +11,4 @@ public: virtual void keyPressed(Minecraft* minecraft, int key); protected: bool m_captureMode; -}; \ No newline at end of file +}; diff --git a/src/client/gui/components/TextOption.h b/src/client/gui/components/TextOption.h index 89c545c..b93a79c 100644 --- a/src/client/gui/components/TextOption.h +++ b/src/client/gui/components/TextOption.h @@ -1,10 +1,10 @@ #pragma once #include "TextBox.h" -#include +#include "Options.h" class TextOption : public TextBox { public: TextOption(Minecraft* minecraft, OptionId optId); virtual bool loseFocus(Minecraft* minecraft); -}; \ No newline at end of file +}; diff --git a/src/client/player/input/XperiaPlayInput.h b/src/client/player/input/XperiaPlayInput.h index 0b3afc5..bbebab5 100755 --- a/src/client/player/input/XperiaPlayInput.h +++ b/src/client/player/input/XperiaPlayInput.h @@ -1,5 +1,7 @@ #ifndef NET_MINECRAFT_CLIENT_PLAYER__XperiaPlayInput_H__ #define NET_MINECRAFT_CLIENT_PLAYER__XperiaPlayInput_H__ +#include "Player.h" +#include "Controller.h" //package net.minecraft.client.player; From aec534d948af3b37970b7f90336d2cb108979c12 Mon Sep 17 00:00:00 2001 From: deepfriedwaffles Date: Tue, 24 Mar 2026 19:51:01 -0400 Subject: [PATCH 22/33] restore include paths for cross-platform builds because i messed absolutely every #include up. --- src/client/Minecraft.cpp | 15 +++++---------- src/client/Options.h | 7 ++++--- src/client/gui/Gui.cpp | 4 ++-- src/client/gui/components/ImageButton.cpp | 2 +- src/client/gui/components/KeyOption.h | 4 ++-- src/client/gui/components/TextOption.h | 4 ++-- src/client/gui/screens/OptionsScreen.cpp | 2 +- src/client/player/input/XperiaPlayInput.h | 2 -- 8 files changed, 17 insertions(+), 23 deletions(-) diff --git a/src/client/Minecraft.cpp b/src/client/Minecraft.cpp index 3170504..97f1bc8 100755 --- a/src/client/Minecraft.cpp +++ b/src/client/Minecraft.cpp @@ -1,11 +1,10 @@ #include "Minecraft.h" #include "Options.h" -#include "IBuildInput.h" -#include "Keyboard.h" -#include "Item.h" -#include "ItemInstance.h" -#include "XperiaPlayInput.h" -#include "ControllerTurnInput.h" +#include "client/Options.h" +#include "client/player/input/IBuildInput.h" +#include "platform/input/Keyboard.h" +#include "world/item/Item.h" +#include "world/item/ItemInstance.h" #include #include @@ -25,13 +24,9 @@ #include "../world/level/storage/LevelStorageSource.h" #include "../world/level/storage/LevelStorage.h" #include "player/input/KeyboardInput.h" -<<<<<<< HEAD #include "player/input/ControllerTurnInput.h" #include "player/input/XperiaPlayInput.h" #include "world/level/chunk/ChunkSource.h" -======= -#include "ChunkSource.h" ->>>>>>> abfb9e0 (more refactoring for iOS) #ifndef STANDALONE_SERVER #include "player/input/touchscreen/TouchInputHolder.h" diff --git a/src/client/Options.h b/src/client/Options.h index c2b0b1f..f81734d 100755 --- a/src/client/Options.h +++ b/src/client/Options.h @@ -97,6 +97,9 @@ typedef std::vector StringVector; class Options { public: + // deepfriedwaffles: for iOS, was getting compile errors saying: No member named 'sound' in 'Options' and No member named 'music' in 'Options' so I floated them here. 1.0f means full volume out of the box, but if everything is too loud, you might want to try adjusting this + float sound = 1.0f; + float music = 1.0f; static bool debugGl; @@ -161,9 +164,7 @@ private: if (m_options[key] == nullptr) return nullptr; return dynamic_cast(m_options[key]); } -// apple stuff - float sound; - float music; + std::array m_options; OptionsFile optionsFile; diff --git a/src/client/gui/Gui.cpp b/src/client/gui/Gui.cpp index c54cce5..8df59f0 100755 --- a/src/client/gui/Gui.cpp +++ b/src/client/gui/Gui.cpp @@ -1,7 +1,7 @@ #include "Gui.h" #include "Font.h" -#include "Options.h" -#include "Keyboard.h" +#include "client/Options.h" +#include "platform/input/Keyboard.h" #include "screens/IngameBlockSelectionScreen.h" #include "screens/ChatScreen.h" #include "screens/ConsoleScreen.h" diff --git a/src/client/gui/components/ImageButton.cpp b/src/client/gui/components/ImageButton.cpp index f686dcd..3d95acc 100755 --- a/src/client/gui/components/ImageButton.cpp +++ b/src/client/gui/components/ImageButton.cpp @@ -4,7 +4,7 @@ #include "../../../platform/log.h" #include "../../../util/Mth.h" #include "../../renderer/Textures.h" -#include "../../Option.h" +#include ImageButton::ImageButton(int id, const std::string& msg) diff --git a/src/client/gui/components/KeyOption.h b/src/client/gui/components/KeyOption.h index cc86958..fabdc7a 100644 --- a/src/client/gui/components/KeyOption.h +++ b/src/client/gui/components/KeyOption.h @@ -1,6 +1,6 @@ #pragma once #include "Button.h" -#include "Options.h" +#include class KeyOption : public Touch::TButton { public: @@ -11,4 +11,4 @@ public: virtual void keyPressed(Minecraft* minecraft, int key); protected: bool m_captureMode; -}; +}; \ No newline at end of file diff --git a/src/client/gui/components/TextOption.h b/src/client/gui/components/TextOption.h index b93a79c..89c545c 100644 --- a/src/client/gui/components/TextOption.h +++ b/src/client/gui/components/TextOption.h @@ -1,10 +1,10 @@ #pragma once #include "TextBox.h" -#include "Options.h" +#include class TextOption : public TextBox { public: TextOption(Minecraft* minecraft, OptionId optId); virtual bool loseFocus(Minecraft* minecraft); -}; +}; \ No newline at end of file diff --git a/src/client/gui/screens/OptionsScreen.cpp b/src/client/gui/screens/OptionsScreen.cpp index afa5a8e..ce5db38 100755 --- a/src/client/gui/screens/OptionsScreen.cpp +++ b/src/client/gui/screens/OptionsScreen.cpp @@ -271,4 +271,4 @@ void OptionsScreen::tick() { currentOptionsGroup->tick(minecraft); super::tick(); -} +} \ No newline at end of file diff --git a/src/client/player/input/XperiaPlayInput.h b/src/client/player/input/XperiaPlayInput.h index bbebab5..0b3afc5 100755 --- a/src/client/player/input/XperiaPlayInput.h +++ b/src/client/player/input/XperiaPlayInput.h @@ -1,7 +1,5 @@ #ifndef NET_MINECRAFT_CLIENT_PLAYER__XperiaPlayInput_H__ #define NET_MINECRAFT_CLIENT_PLAYER__XperiaPlayInput_H__ -#include "Player.h" -#include "Controller.h" //package net.minecraft.client.player; From d5547673098ceabbee8df49b2223883149018698 Mon Sep 17 00:00:00 2001 From: deepfriedwaffles Date: Tue, 24 Mar 2026 21:38:31 -0400 Subject: [PATCH 23/33] IT COMPILESgit add .! also added full screen support. see issues. --- project/iosproj/Launch Screen.storyboard | 48 +++++ .../minecraftpe.xcodeproj/project.pbxproj | 192 ++++++++++++++---- .../minecraftpe/minecraftpe-Info.plist | 2 + src/AppPlatform_iOS.mm | 6 +- src/client/Option.h | 2 +- 5 files changed, 206 insertions(+), 44 deletions(-) create mode 100644 project/iosproj/Launch Screen.storyboard diff --git a/project/iosproj/Launch Screen.storyboard b/project/iosproj/Launch Screen.storyboard new file mode 100644 index 0000000..4ee7abe --- /dev/null +++ b/project/iosproj/Launch Screen.storyboard @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/project/iosproj/minecraftpe.xcodeproj/project.pbxproj b/project/iosproj/minecraftpe.xcodeproj/project.pbxproj index c8f656c..6fcf382 100755 --- a/project/iosproj/minecraftpe.xcodeproj/project.pbxproj +++ b/project/iosproj/minecraftpe.xcodeproj/project.pbxproj @@ -1147,6 +1147,32 @@ D5F3B7DE14548E7900D25470 /* IASKSpecifierValuesView.xib in Resources */ = {isa = PBXBuildFile; fileRef = D5F3B7C914548E7900D25470 /* IASKSpecifierValuesView.xib */; }; D5F3B7E51454930400D25470 /* InAppSettings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = D5F3B7E41454930400D25470 /* InAppSettings.bundle */; }; F912B8CF2F6C3D5200BC60DF /* TextBox.h in Sources */ = {isa = PBXBuildFile; fileRef = 042A91AC16B17517007ABBC6 /* TextBox.h */; }; + F99D341F2F736AA100DC153E /* HttpClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99D341E2F736AA100DC153E /* HttpClient.cpp */; }; + F99D34202F736AA100DC153E /* HttpClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99D341E2F736AA100DC153E /* HttpClient.cpp */; }; + F99D34232F736AD400DC153E /* TextOption.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99D34222F736AD400DC153E /* TextOption.cpp */; }; + F99D34242F736AD400DC153E /* TextOption.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99D34222F736AD400DC153E /* TextOption.cpp */; }; + F99D34272F736AFB00DC153E /* OptionsFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99D34262F736AFB00DC153E /* OptionsFile.cpp */; }; + F99D34282F736AFB00DC153E /* OptionsFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99D34262F736AFB00DC153E /* OptionsFile.cpp */; }; + F99D342B2F736B6F00DC153E /* OptionsItem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99D342A2F736B6F00DC153E /* OptionsItem.cpp */; }; + F99D342C2F736B6F00DC153E /* OptionsItem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99D342A2F736B6F00DC153E /* OptionsItem.cpp */; }; + F99D342F2F736BAD00DC153E /* ConsoleScreen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99D342E2F736BAD00DC153E /* ConsoleScreen.cpp */; }; + F99D34302F736BAD00DC153E /* ConsoleScreen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99D342E2F736BAD00DC153E /* ConsoleScreen.cpp */; }; + F99D34332F736BDA00DC153E /* CreditsScreen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99D34322F736BDA00DC153E /* CreditsScreen.cpp */; }; + F99D34342F736BDA00DC153E /* CreditsScreen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99D34322F736BDA00DC153E /* CreditsScreen.cpp */; }; + F99D34372F736C1000DC153E /* JoinByIPScreen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99D34362F736C1000DC153E /* JoinByIPScreen.cpp */; }; + F99D34382F736C1000DC153E /* JoinByIPScreen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99D34362F736C1000DC153E /* JoinByIPScreen.cpp */; }; + F99D343B2F736C3B00DC153E /* UsernameScreen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99D343A2F736C3B00DC153E /* UsernameScreen.cpp */; }; + F99D343C2F736C3B00DC153E /* UsernameScreen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99D343A2F736C3B00DC153E /* UsernameScreen.cpp */; }; + F99D343F2F736C8400DC153E /* GuiElementContainer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99D343E2F736C8400DC153E /* GuiElementContainer.cpp */; }; + F99D34402F736C8400DC153E /* GuiElementContainer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99D343E2F736C8400DC153E /* GuiElementContainer.cpp */; }; + F99D34432F736F9400DC153E /* Option.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99D34422F736F9400DC153E /* Option.cpp */; }; + F99D34442F736F9400DC153E /* Option.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99D34422F736F9400DC153E /* Option.cpp */; }; + F99D34472F736FE800DC153E /* KeyOption.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99D34462F736FE800DC153E /* KeyOption.cpp */; }; + F99D34482F736FE800DC153E /* KeyOption.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99D34462F736FE800DC153E /* KeyOption.cpp */; }; + F99D344B2F7370CF00DC153E /* Slider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99D344A2F7370CF00DC153E /* Slider.cpp */; }; + F99D344C2F7370CF00DC153E /* Slider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99D344A2F7370CF00DC153E /* Slider.cpp */; }; + F99D344E2F7372A100DC153E /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F99D344D2F7372A100DC153E /* Launch Screen.storyboard */; }; + F99D344F2F7372A100DC153E /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F99D344D2F7372A100DC153E /* Launch Screen.storyboard */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -2015,7 +2041,7 @@ D5B50D6914CFF66F005F7284 /* Multitouch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Multitouch.h; sourceTree = ""; }; D5B50D6A14CFF66F005F7284 /* log.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = log.h; sourceTree = ""; }; D5B50D6B14CFF66F005F7284 /* time.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = time.cpp; sourceTree = ""; }; - D5B50D6C14CFF66F005F7284 /* time.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = time.h; sourceTree = ""; }; + D5B50D6C14CFF66F005F7284 /* time.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = time.h; sourceTree = ""; }; D5B50E5614CFF66F005F7284 /* SharedConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SharedConstants.h; sourceTree = ""; }; D5B50E5714CFF66F005F7284 /* terrain_4444.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = terrain_4444.h; sourceTree = ""; }; D5B50E5814CFF66F005F7284 /* terrain_5551.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = terrain_5551.h; sourceTree = ""; }; @@ -2406,6 +2432,31 @@ D5F3B7C814548E7900D25470 /* IASKPSToggleSwitchSpecifierViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = IASKPSToggleSwitchSpecifierViewCell.xib; sourceTree = ""; }; D5F3B7C914548E7900D25470 /* IASKSpecifierValuesView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = IASKSpecifierValuesView.xib; sourceTree = ""; }; D5F3B7E41454930400D25470 /* InAppSettings.bundle */ = {isa = PBXFileReference; explicitFileType = "wrapper.installer-pkg"; path = InAppSettings.bundle; sourceTree = ""; }; + F99D341D2F736AA100DC153E /* HttpClient.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HttpClient.h; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/platform/HttpClient.h"; sourceTree = ""; }; + F99D341E2F736AA100DC153E /* HttpClient.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = HttpClient.cpp; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/platform/HttpClient.cpp"; sourceTree = ""; }; + F99D34212F736AD400DC153E /* TextOption.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TextOption.h; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/components/TextOption.h"; sourceTree = ""; }; + F99D34222F736AD400DC153E /* TextOption.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = TextOption.cpp; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/components/TextOption.cpp"; sourceTree = ""; }; + F99D34252F736AFB00DC153E /* OptionsFile.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionsFile.h; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/OptionsFile.h"; sourceTree = ""; }; + F99D34262F736AFB00DC153E /* OptionsFile.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = OptionsFile.cpp; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/OptionsFile.cpp"; sourceTree = ""; }; + F99D34292F736B6F00DC153E /* OptionsItem.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionsItem.h; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/components/OptionsItem.h"; sourceTree = ""; }; + F99D342A2F736B6F00DC153E /* OptionsItem.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = OptionsItem.cpp; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/components/OptionsItem.cpp"; sourceTree = ""; }; + F99D342D2F736BAD00DC153E /* ConsoleScreen.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ConsoleScreen.h; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/screens/ConsoleScreen.h"; sourceTree = ""; }; + F99D342E2F736BAD00DC153E /* ConsoleScreen.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = ConsoleScreen.cpp; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/screens/ConsoleScreen.cpp"; sourceTree = ""; }; + F99D34312F736BDA00DC153E /* CreditsScreen.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CreditsScreen.h; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/screens/CreditsScreen.h"; sourceTree = ""; }; + F99D34322F736BDA00DC153E /* CreditsScreen.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = CreditsScreen.cpp; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/screens/CreditsScreen.cpp"; sourceTree = ""; }; + F99D34352F736C1000DC153E /* JoinByIPScreen.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = JoinByIPScreen.h; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/screens/JoinByIPScreen.h"; sourceTree = ""; }; + F99D34362F736C1000DC153E /* JoinByIPScreen.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = JoinByIPScreen.cpp; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/screens/JoinByIPScreen.cpp"; sourceTree = ""; }; + F99D34392F736C3B00DC153E /* UsernameScreen.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = UsernameScreen.h; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/screens/UsernameScreen.h"; sourceTree = ""; }; + F99D343A2F736C3B00DC153E /* UsernameScreen.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = UsernameScreen.cpp; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/screens/UsernameScreen.cpp"; sourceTree = ""; }; + F99D343D2F736C8400DC153E /* GuiElementContainer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = GuiElementContainer.h; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/components/GuiElementContainer.h"; sourceTree = ""; }; + F99D343E2F736C8400DC153E /* GuiElementContainer.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = GuiElementContainer.cpp; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/components/GuiElementContainer.cpp"; sourceTree = ""; }; + F99D34412F736F9400DC153E /* Option.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Option.h; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/Option.h"; sourceTree = ""; }; + F99D34422F736F9400DC153E /* Option.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = Option.cpp; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/Option.cpp"; sourceTree = ""; }; + F99D34452F736FE800DC153E /* KeyOption.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = KeyOption.h; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/components/KeyOption.h"; sourceTree = ""; }; + F99D34462F736FE800DC153E /* KeyOption.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = KeyOption.cpp; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/components/KeyOption.cpp"; sourceTree = ""; }; + F99D34492F7370CF00DC153E /* Slider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Slider.h; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/components/Slider.h"; sourceTree = ""; }; + F99D344A2F7370CF00DC153E /* Slider.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = Slider.cpp; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/components/Slider.cpp"; sourceTree = ""; }; + F99D344D2F7372A100DC153E /* Launch Screen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = "Launch Screen.storyboard"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -4252,6 +4303,7 @@ D5CF9C37144C225000E4244F = { isa = PBXGroup; children = ( + F99D344D2F7372A100DC153E /* Launch Screen.storyboard */, D5E1BA9A1451C8A0007DCC4F /* Default@2x.png */, 9D959AFF16036BEE00E23A6F /* Default-568h@2x.png */, D5F07744145EF79B00EC30FB /* Default-Landscape~ipad.png */, @@ -4263,6 +4315,30 @@ D5CF9C45144C225000E4244F /* Frameworks */, D5CF9C43144C225000E4244F /* Products */, D5B50C1614CFF66F005F7284 /* src */, + F99D341D2F736AA100DC153E /* HttpClient.h */, + F99D341E2F736AA100DC153E /* HttpClient.cpp */, + F99D34212F736AD400DC153E /* TextOption.h */, + F99D34222F736AD400DC153E /* TextOption.cpp */, + F99D34252F736AFB00DC153E /* OptionsFile.h */, + F99D34262F736AFB00DC153E /* OptionsFile.cpp */, + F99D34292F736B6F00DC153E /* OptionsItem.h */, + F99D342A2F736B6F00DC153E /* OptionsItem.cpp */, + F99D342D2F736BAD00DC153E /* ConsoleScreen.h */, + F99D342E2F736BAD00DC153E /* ConsoleScreen.cpp */, + F99D34312F736BDA00DC153E /* CreditsScreen.h */, + F99D34322F736BDA00DC153E /* CreditsScreen.cpp */, + F99D34352F736C1000DC153E /* JoinByIPScreen.h */, + F99D34362F736C1000DC153E /* JoinByIPScreen.cpp */, + F99D34392F736C3B00DC153E /* UsernameScreen.h */, + F99D343A2F736C3B00DC153E /* UsernameScreen.cpp */, + F99D343D2F736C8400DC153E /* GuiElementContainer.h */, + F99D343E2F736C8400DC153E /* GuiElementContainer.cpp */, + F99D34412F736F9400DC153E /* Option.h */, + F99D34422F736F9400DC153E /* Option.cpp */, + F99D34452F736FE800DC153E /* KeyOption.h */, + F99D34462F736FE800DC153E /* KeyOption.cpp */, + F99D34492F7370CF00DC153E /* Slider.h */, + F99D344A2F7370CF00DC153E /* Slider.cpp */, ); sourceTree = ""; }; @@ -4601,6 +4677,7 @@ D5B50A5614CFF492005F7284 /* pig.png in Resources */, D5B50A5814CFF492005F7284 /* sheep_fur.png in Resources */, D5B50A5A14CFF492005F7284 /* sheep.png in Resources */, + F99D344F2F7372A100DC153E /* Launch Screen.storyboard in Resources */, D5B50A5C14CFF492005F7284 /* skeleton.png in Resources */, D5B50A5E14CFF492005F7284 /* spider.png in Resources */, D5B50A6014CFF492005F7284 /* zombie.png in Resources */, @@ -4937,6 +5014,7 @@ D5ACF26F15C03DBF00E21C22 /* sand2.m4a in Resources */, D5ACF27115C03DBF00E21C22 /* sand3.m4a in Resources */, D5ACF27315C03DBF00E21C22 /* sand4.m4a in Resources */, + F99D344E2F7372A100DC153E /* Launch Screen.storyboard in Resources */, D5ACF27515C03DBF00E21C22 /* snow1.m4a in Resources */, D5ACF27715C03DBF00E21C22 /* snow2.m4a in Resources */, D5ACF27915C03DBF00E21C22 /* snow3.m4a in Resources */, @@ -5013,18 +5091,22 @@ D58BB544146A0B910002C9F5 /* IASKSettingsStore.m in Sources */, D58BB545146A0B910002C9F5 /* IASKSettingsStoreFile.m in Sources */, D58BB546146A0B910002C9F5 /* IASKSettingsStoreUserDefaults.m in Sources */, + F99D34232F736AD400DC153E /* TextOption.cpp in Sources */, D58BB547146A0B910002C9F5 /* IASKSpecifier.m in Sources */, D58BB548146A0B910002C9F5 /* IASKPSSliderSpecifierViewCell.m in Sources */, D58BB549146A0B910002C9F5 /* IASKPSTextFieldSpecifierViewCell.m in Sources */, D58BB54A146A0B910002C9F5 /* IASKPSTitleValueSpecifierViewCell.m in Sources */, D58BB54B146A0B910002C9F5 /* IASKPSToggleSwitchSpecifierViewCell.m in Sources */, + F99D343B2F736C3B00DC153E /* UsernameScreen.cpp in Sources */, D58BB54C146A0B910002C9F5 /* IASKSlider.m in Sources */, D58BB54D146A0B910002C9F5 /* IASKSwitch.m in Sources */, + F99D34302F736BAD00DC153E /* ConsoleScreen.cpp in Sources */, D58BB54E146A0B910002C9F5 /* IASKTextField.m in Sources */, D58BB550146A0B910002C9F5 /* PVRTexture.m in Sources */, D5D43CC9146AF4B4002ED842 /* RenameMPWorldViewController.mm in Sources */, D5B50F7014CFF670005F7284 /* AppPlatform_iOS.mm in Sources */, D5B50F7414CFF670005F7284 /* CreativeMode.cpp in Sources */, + F99D34432F736F9400DC153E /* Option.cpp in Sources */, D5B50F7614CFF670005F7284 /* GameMode.cpp in Sources */, D5B50F7814CFF670005F7284 /* Button.cpp in Sources */, D5B50F7A14CFF670005F7284 /* ImageButton.cpp in Sources */, @@ -5069,6 +5151,7 @@ D5B50FC814CFF670005F7284 /* KeyboardInput.cpp in Sources */, D5B50FCA14CFF670005F7284 /* TouchscreenInput.cpp in Sources */, D5B50FCC14CFF670005F7284 /* LocalPlayer.cpp in Sources */, + F99D34482F736FE800DC153E /* KeyOption.cpp in Sources */, D5B50FCE14CFF670005F7284 /* Chunk.cpp in Sources */, D5B50FD014CFF670005F7284 /* Frustum.cpp in Sources */, D5B50FD214CFF670005F7284 /* ChickenRenderer.cpp in Sources */, @@ -5127,6 +5210,7 @@ D5B5113014CFF670005F7284 /* TripodCamera.cpp in Sources */, D5B5113214CFF670005F7284 /* Mob.cpp in Sources */, D5B5113414CFF670005F7284 /* MobCategory.cpp in Sources */, + F99D34282F736AFB00DC153E /* OptionsFile.cpp in Sources */, D5B5113814CFF670005F7284 /* PathFinderMob.cpp in Sources */, D5B5113A14CFF670005F7284 /* Inventory.cpp in Sources */, D5B5113C14CFF670005F7284 /* Player.cpp in Sources */, @@ -5138,6 +5222,7 @@ D5B5114814CFF670005F7284 /* Item.cpp in Sources */, D5B5114A14CFF670005F7284 /* ItemInstance.cpp in Sources */, D5B5114C14CFF670005F7284 /* PickaxeItem.cpp in Sources */, + F99D344B2F7370CF00DC153E /* Slider.cpp in Sources */, D5B5114E14CFF670005F7284 /* ShovelItem.cpp in Sources */, D5B5115014CFF670005F7284 /* Biome.cpp in Sources */, D5B5115214CFF670005F7284 /* BiomeSource.cpp in Sources */, @@ -5188,6 +5273,7 @@ D5251DBA1538192700FC82C8 /* CloudServer.cpp in Sources */, D5251DBE1538192700FC82C8 /* CommandParserInterface.cpp in Sources */, D5251DC01538192700FC82C8 /* ConnectionGraph2.cpp in Sources */, + F99D34402F736C8400DC153E /* GuiElementContainer.cpp in Sources */, D5251DC21538192700FC82C8 /* ConsoleServer.cpp in Sources */, D5251DC41538192700FC82C8 /* DataCompressor.cpp in Sources */, D5251DC61538192700FC82C8 /* DirectoryDeltaTransfer.cpp in Sources */, @@ -5212,6 +5298,8 @@ D5251DEC1538192700FC82C8 /* HTTPConnection.cpp in Sources */, D5251DEE1538192700FC82C8 /* IncrementalReadInterface.cpp in Sources */, D5251DF01538192700FC82C8 /* Itoa.cpp in Sources */, + F99D34202F736AA100DC153E /* HttpClient.cpp in Sources */, + F99D34382F736C1000DC153E /* JoinByIPScreen.cpp in Sources */, D5251DF21538192700FC82C8 /* LinuxStrings.cpp in Sources */, D5251DF41538192700FC82C8 /* LocklessTypes.cpp in Sources */, D5251DF61538192700FC82C8 /* LogCommandParser.cpp in Sources */, @@ -5240,6 +5328,7 @@ D5251E2A1538192700FC82C8 /* RakSleep.cpp in Sources */, D5251E2C1538192700FC82C8 /* RakString.cpp in Sources */, D5251E2E1538192700FC82C8 /* RakThread.cpp in Sources */, + F99D34332F736BDA00DC153E /* CreditsScreen.cpp in Sources */, D5251E301538192700FC82C8 /* RakWString.cpp in Sources */, D5251E321538192700FC82C8 /* Rand.cpp in Sources */, D5251E341538192700FC82C8 /* rdlmalloc.cpp in Sources */, @@ -5282,6 +5371,7 @@ D5951EEB159349100043A12A /* TileEntity.cpp in Sources */, D5951EEF159349680043A12A /* FurnaceScreen.cpp in Sources */, D5951EF215934A2D0043A12A /* Feature.cpp in Sources */, + F99D342C2F736B6F00DC153E /* OptionsItem.cpp in Sources */, D5951EF815934AC50043A12A /* BaseContainerMenu.cpp in Sources */, D5951EFA15934AC50043A12A /* FurnaceMenu.cpp in Sources */, D5D381F315A1A1CF00B6C50E /* FillingContainer.cpp in Sources */, @@ -5344,6 +5434,7 @@ F912B8CF2F6C3D5200BC60DF /* TextBox.h in Sources */, D5CF9C57144C225000E4244F /* main.mm in Sources */, D5CF9C5B144C225000E4244F /* minecraftpeAppDelegate.mm in Sources */, + F99D343C2F736C3B00DC153E /* UsernameScreen.cpp in Sources */, D5CF9C65144C225000E4244F /* EAGLView.m in Sources */, D5CFA01D144C453900E4244F /* minecraftpeViewController.mm in Sources */, D5A55E4914500EDE00A7571B /* CreateNewWorldViewController.mm in Sources */, @@ -5357,6 +5448,7 @@ D5F3B7D014548E7900D25470 /* IASKSettingsStoreUserDefaults.m in Sources */, D5F3B7D114548E7900D25470 /* IASKSpecifier.m in Sources */, D5F3B7D214548E7900D25470 /* IASKPSSliderSpecifierViewCell.m in Sources */, + F99D34472F736FE800DC153E /* KeyOption.cpp in Sources */, D5F3B7D314548E7900D25470 /* IASKPSTextFieldSpecifierViewCell.m in Sources */, D5F3B7D414548E7900D25470 /* IASKPSTitleValueSpecifierViewCell.m in Sources */, D5F3B7D514548E7900D25470 /* IASKPSToggleSwitchSpecifierViewCell.m in Sources */, @@ -5468,11 +5560,13 @@ D5B5112D14CFF670005F7284 /* PrimedTnt.cpp in Sources */, D5B5112F14CFF670005F7284 /* TripodCamera.cpp in Sources */, D5B5113114CFF670005F7284 /* Mob.cpp in Sources */, + F99D34442F736F9400DC153E /* Option.cpp in Sources */, D5B5113314CFF670005F7284 /* MobCategory.cpp in Sources */, D5B5113714CFF670005F7284 /* PathFinderMob.cpp in Sources */, D5B5113914CFF670005F7284 /* Inventory.cpp in Sources */, D5B5113B14CFF670005F7284 /* Player.cpp in Sources */, D5B5113D14CFF670005F7284 /* Arrow.cpp in Sources */, + F99D343F2F736C8400DC153E /* GuiElementContainer.cpp in Sources */, D5B5113F14CFF670005F7284 /* Recipes.cpp in Sources */, D5B5114114CFF670005F7284 /* ToolRecipes.cpp in Sources */, D5B5114314CFF670005F7284 /* WeaponRecipes.cpp in Sources */, @@ -5510,10 +5604,12 @@ D5B5118514CFF670005F7284 /* HitResult.cpp in Sources */, D5B5118B14D03342005F7284 /* SynchedEntityData.cpp in Sources */, D5B5118E14DEA27F005F7284 /* DeathScreen.cpp in Sources */, + F99D34242F736AD400DC153E /* TextOption.cpp in Sources */, D5B5119114DEA2B7005F7284 /* LevelData.cpp in Sources */, D5B5119414DEA2EF005F7284 /* DyePowderItem.cpp in Sources */, D584926D14FD234400741128 /* SharedConstants.cpp in Sources */, D584927314FD236700741128 /* MoveControl.cpp in Sources */, + F99D344C2F7370CF00DC153E /* Slider.cpp in Sources */, D584928614FD240D00741128 /* IConfigListener.cpp in Sources */, D584928914FD2FAF00741128 /* Path.cpp in Sources */, D5B86281153810BD00F3238A /* I18n.cpp in Sources */, @@ -5565,6 +5661,7 @@ D5251E011538192700FC82C8 /* NatTypeDetectionServer.cpp in Sources */, D5251E031538192700FC82C8 /* NetworkIDManager.cpp in Sources */, D5251E051538192700FC82C8 /* NetworkIDObject.cpp in Sources */, + F99D34372F736C1000DC153E /* JoinByIPScreen.cpp in Sources */, D5251E071538192700FC82C8 /* PacketConsoleLogger.cpp in Sources */, D5251E091538192700FC82C8 /* PacketFileLogger.cpp in Sources */, D5251E0B1538192700FC82C8 /* PacketizedTCP.cpp in Sources */, @@ -5594,11 +5691,13 @@ D5251E411538192700FC82C8 /* SendToThread.cpp in Sources */, D5251E431538192700FC82C8 /* SHA1.cpp in Sources */, D5251E451538192700FC82C8 /* SignaledEvent.cpp in Sources */, + F99D34342F736BDA00DC153E /* CreditsScreen.cpp in Sources */, D5251E471538192700FC82C8 /* SimpleMutex.cpp in Sources */, D5251E491538192700FC82C8 /* SocketLayer.cpp in Sources */, D5251E4B1538192700FC82C8 /* StringCompressor.cpp in Sources */, D5251E4D1538192700FC82C8 /* StringTable.cpp in Sources */, D5251E4F1538192700FC82C8 /* SuperFastHash.cpp in Sources */, + F99D342B2F736B6F00DC153E /* OptionsItem.cpp in Sources */, D5251E511538192700FC82C8 /* TableSerializer.cpp in Sources */, D5251E531538192700FC82C8 /* TCPInterface.cpp in Sources */, D5251E551538192700FC82C8 /* TeamBalancer.cpp in Sources */, @@ -5621,6 +5720,7 @@ D5951EDD159348C50043A12A /* ItemPane.cpp in Sources */, D5951EE3159349000043A12A /* FurnaceTile.cpp in Sources */, D5951EE8159349100043A12A /* FurnaceTileEntity.cpp in Sources */, + F99D342F2F736BAD00DC153E /* ConsoleScreen.cpp in Sources */, D5951EEA159349100043A12A /* TileEntity.cpp in Sources */, D5951EEE159349680043A12A /* FurnaceScreen.cpp in Sources */, D5951EF115934A2D0043A12A /* Feature.cpp in Sources */, @@ -5657,6 +5757,7 @@ D544941E15D13F45005FA9B0 /* PlayerRenderer.cpp in Sources */, D544942215D13F5E005FA9B0 /* RemotePlayer.cpp in Sources */, D5B17ED515E226F50056E751 /* Throwable.cpp in Sources */, + F99D341F2F736AA100DC153E /* HttpClient.cpp in Sources */, D5B17ED915E2273F0056E751 /* SurvivalMode.cpp in Sources */, D5B17EDD15E227670056E751 /* TrapDoorTile.cpp in Sources */, D5B17EE115E260910056E751 /* MoveFolder.mm in Sources */, @@ -5692,6 +5793,7 @@ 0400453A16A4125C003EB6FA /* FallingTileRenderer.cpp in Sources */, 0413970716A82E1E008A9F1A /* ArmorItem.cpp in Sources */, 0413970D16A82E6B008A9F1A /* CraftingFilters.cpp in Sources */, + F99D34272F736AFB00DC153E /* OptionsFile.cpp in Sources */, 0413970E16A82E6B008A9F1A /* StonecutterScreen.cpp in Sources */, 0413971116A82E7B008A9F1A /* ArmorScreen.cpp in Sources */, 0413971516A82EB9008A9F1A /* ArmorRecipes.cpp in Sources */, @@ -5737,7 +5839,7 @@ D50BE20815EE05B8008AA75E /* Ad-Hoc */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; + ALWAYS_SEARCH_USER_PATHS = YES; ARCHS = "$(ARCHS_STANDARD)"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution: Mojang AB"; COPY_PHASE_STRIP = YES; @@ -5750,11 +5852,7 @@ GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = NO; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ( - "$(SRCROOT)/src/**", - "$(SRCROOT)/src/client/gui/components/**", - "$(SRCROOT)/src/client/gui/**", - ); + HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src"; IPHONEOS_DEPLOYMENT_TARGET = 14; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; @@ -5762,7 +5860,8 @@ RUN_CLANG_STATIC_ANALYZER = NO; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)\\src/**"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src"; + USE_HEADERMAP = NO; VALIDATE_PRODUCT = YES; }; name = "Ad-Hoc"; @@ -5777,9 +5876,11 @@ GCC_VERSION = ""; GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; HEADER_SEARCH_PATHS = ( - "$(SRCROOT)/src/client/gui/components/**", - "$(SRCROOT)/src/client/gui/**", - "$(SRCROOT)/src/**", + "$(SRCROOT)/../../src", + "$(SRCROOT)/../../src/client/gui/components", + "$(SRCROOT)/../../src/world", + "$(SRCROOT)/../../src/platform/input", + "$(SRCROOT)/../../project/lib_projects/InAppSettingsKit/Views", ); INFOPLIST_FILE = "minecraftpe/minecraftpe-Info.plist"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; @@ -5789,6 +5890,9 @@ PRODUCT_NAME = "$(TARGET_NAME)"; RUN_CLANG_STATIC_ANALYZER = NO; SDKROOT = iphoneos; + SYSTEM_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src $(SRCROOT)/../../src/client/gui/components $(SRCROOT)/../../src/world $(SRCROOT)/../../src/platform/input $(SRCROOT)/../../project/lib_projects/InAppSettingsKit/Views"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src $(SRCROOT)/../lib_projects/InAppSettingsKit/Models $(SRCROOT)/../../src/client/gui/components $(SRCROOT)/../../src/world $(SRCROOT)/../../src/platform/input $(SRCROOT)/../../project/lib_projects/InAppSettingsKit/Views"; + USE_HEADERMAP = NO; WRAPPER_EXTENSION = app; }; name = "Ad-Hoc"; @@ -5861,7 +5965,7 @@ D5A20ADB146AAD9C00A52FEC /* AppStore */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; + ALWAYS_SEARCH_USER_PATHS = YES; ARCHS = "$(ARCHS_STANDARD)"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution: Mojang AB"; COPY_PHASE_STRIP = YES; @@ -5873,11 +5977,7 @@ GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = NO; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ( - "$(SRCROOT)/src/**", - "$(SRCROOT)/src/client/gui/components/**", - "$(SRCROOT)/src/client/gui/**", - ); + HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src"; IPHONEOS_DEPLOYMENT_TARGET = 14; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; @@ -5885,7 +5985,8 @@ RUN_CLANG_STATIC_ANALYZER = NO; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)\\src/**"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src"; + USE_HEADERMAP = NO; VALIDATE_PRODUCT = YES; }; name = AppStore; @@ -5901,9 +6002,11 @@ GCC_VERSION = ""; GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; HEADER_SEARCH_PATHS = ( - "$(SRCROOT)/src/client/gui/components/**", - "$(SRCROOT)/src/client/gui/**", - "$(SRCROOT)/src/**", + "$(SRCROOT)/../../src", + "$(SRCROOT)/../../src/client/gui/components", + "$(SRCROOT)/../../src/world", + "$(SRCROOT)/../../src/platform/input", + "$(SRCROOT)/../../project/lib_projects/InAppSettingsKit/Views", ); INFOPLIST_FILE = "minecraftpe/minecraftpe-Info.plist"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; @@ -5917,6 +6020,9 @@ "PROVISIONING_PROFILE[sdk=iphoneos*]" = "1B194957-98CF-49B7-A0E7-76692B4B722D"; RUN_CLANG_STATIC_ANALYZER = NO; SDKROOT = iphoneos; + SYSTEM_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src $(SRCROOT)/../../src/client/gui/components $(SRCROOT)/../../src/world $(SRCROOT)/../../src/platform/input $(SRCROOT)/../../project/lib_projects/InAppSettingsKit/Views"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src $(SRCROOT)/../lib_projects/InAppSettingsKit/Models $(SRCROOT)/../../src/client/gui/components $(SRCROOT)/../../src/world $(SRCROOT)/../../src/platform/input $(SRCROOT)/../../project/lib_projects/InAppSettingsKit/Views"; + USE_HEADERMAP = NO; WRAPPER_EXTENSION = app; }; name = AppStore; @@ -5949,7 +6055,7 @@ D5CF9C6C144C225000E4244F /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; + ALWAYS_SEARCH_USER_PATHS = YES; ARCHS = "$(ARCHS_STANDARD)"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; @@ -5969,17 +6075,14 @@ GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = NO; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ( - "$(SRCROOT)/src/**", - "$(SRCROOT)/src/client/gui/components/**", - "$(SRCROOT)/src/client/gui/**", - ); + HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src"; IPHONEOS_DEPLOYMENT_TARGET = 14; ONLY_ACTIVE_ARCH = YES; RUN_CLANG_STATIC_ANALYZER = NO; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)\\src/**"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src"; + USE_HEADERMAP = NO; VALIDATE_PRODUCT = YES; }; name = Debug; @@ -5987,7 +6090,7 @@ D5CF9C6D144C225000E4244F /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; + ALWAYS_SEARCH_USER_PATHS = YES; ARCHS = "$(ARCHS_STANDARD)"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; @@ -6000,18 +6103,15 @@ GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = NO; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ( - "$(SRCROOT)/src/**", - "$(SRCROOT)/src/client/gui/components/**", - "$(SRCROOT)/src/client/gui/**", - ); + HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src"; IPHONEOS_DEPLOYMENT_TARGET = 14; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; RUN_CLANG_STATIC_ANALYZER = NO; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)\\src/**"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src"; + USE_HEADERMAP = NO; VALIDATE_PRODUCT = YES; }; name = Release; @@ -6029,9 +6129,11 @@ GCC_VERSION = ""; GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; HEADER_SEARCH_PATHS = ( - "$(SRCROOT)/src/client/gui/components/**", - "$(SRCROOT)/src/client/gui/**", - "$(SRCROOT)/src/**", + "$(SRCROOT)/../../src", + "$(SRCROOT)/../../src/client/gui/components", + "$(SRCROOT)/../../src/world", + "$(SRCROOT)/../../src/platform/input", + "$(SRCROOT)/../../project/lib_projects/InAppSettingsKit/Views", ); INFOPLIST_FILE = "minecraftpe/minecraftpe-Info.plist"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; @@ -6042,6 +6144,9 @@ PROVISIONING_PROFILE_SPECIFIER = ""; RUN_CLANG_STATIC_ANALYZER = NO; SDKROOT = iphoneos; + SYSTEM_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src $(SRCROOT)/../../src/client/gui/components $(SRCROOT)/../../src/world $(SRCROOT)/../../src/platform/input $(SRCROOT)/../../project/lib_projects/InAppSettingsKit/Views"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src $(SRCROOT)/../lib_projects/InAppSettingsKit/Models $(SRCROOT)/../../src/client/gui/components $(SRCROOT)/../../src/world $(SRCROOT)/../../src/platform/input $(SRCROOT)/../../project/lib_projects/InAppSettingsKit/Views"; + USE_HEADERMAP = NO; WRAPPER_EXTENSION = app; }; name = Debug; @@ -6059,9 +6164,11 @@ GCC_VERSION = ""; GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; HEADER_SEARCH_PATHS = ( - "$(SRCROOT)/src/client/gui/components/**", - "$(SRCROOT)/src/client/gui/**", - "$(SRCROOT)/src/**", + "$(SRCROOT)/../../src", + "$(SRCROOT)/../../src/client/gui/components", + "$(SRCROOT)/../../src/world", + "$(SRCROOT)/../../src/platform/input", + "$(SRCROOT)/../../project/lib_projects/InAppSettingsKit/Views", ); INFOPLIST_FILE = "minecraftpe/minecraftpe-Info.plist"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; @@ -6072,6 +6179,9 @@ PROVISIONING_PROFILE_SPECIFIER = ""; RUN_CLANG_STATIC_ANALYZER = NO; SDKROOT = iphoneos; + SYSTEM_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src $(SRCROOT)/../../src/client/gui/components $(SRCROOT)/../../src/world $(SRCROOT)/../../src/platform/input $(SRCROOT)/../../project/lib_projects/InAppSettingsKit/Views"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src $(SRCROOT)/../lib_projects/InAppSettingsKit/Models $(SRCROOT)/../../src/client/gui/components $(SRCROOT)/../../src/world $(SRCROOT)/../../src/platform/input $(SRCROOT)/../../project/lib_projects/InAppSettingsKit/Views"; + USE_HEADERMAP = NO; WRAPPER_EXTENSION = app; }; name = Release; diff --git a/project/iosproj/minecraftpe/minecraftpe-Info.plist b/project/iosproj/minecraftpe/minecraftpe-Info.plist index 3f1a803..b0ae914 100755 --- a/project/iosproj/minecraftpe/minecraftpe-Info.plist +++ b/project/iosproj/minecraftpe/minecraftpe-Info.plist @@ -58,6 +58,8 @@ minecraft.ttf + UILaunchStoryboardName + Launch Screen UIPrerenderedIcon UIRequiresPersistentWiFi diff --git a/src/AppPlatform_iOS.mm b/src/AppPlatform_iOS.mm index 68f0d12..a98fc76 100755 --- a/src/AppPlatform_iOS.mm +++ b/src/AppPlatform_iOS.mm @@ -275,8 +275,10 @@ void AppPlatform_iOS::hideKeyboard() { [_viewController hideKeyboard]; super::hideKeyboard(); } -void AppPlatform_iOS::isPowerVR() { + +// this was originally void but i changed it to bool because void cant return values +bool AppPlatform_iOS::isPowerVR() { const char* s = (const char*)glGetString(GL_RENDERER); if (!s) return false; return strstr(s, "SGX") != NULL; -} \ No newline at end of file +} diff --git a/src/client/Option.h b/src/client/Option.h index 0b9aed1..7c813c1 100644 --- a/src/client/Option.h +++ b/src/client/Option.h @@ -1,7 +1,7 @@ #pragma once #include #include -#include "Mth.h" +#include /* template struct is_option_type : std::false_type {}; From aeb8e45879ea3c09cf8598742c8b80bafdf12c8b Mon Sep 17 00:00:00 2001 From: deepfriedwaffles Date: Tue, 24 Mar 2026 23:53:26 -0400 Subject: [PATCH 24/33] fixed button not pressable on ios --- src/client/gui/screens/UsernameScreen.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/gui/screens/UsernameScreen.cpp b/src/client/gui/screens/UsernameScreen.cpp index 82f4bca..cb05cf6 100644 --- a/src/client/gui/screens/UsernameScreen.cpp +++ b/src/client/gui/screens/UsernameScreen.cpp @@ -35,8 +35,8 @@ void UsernameScreen::setupPositions() // Make the done button match the touch-style option tabs _btnDone.width = 66; _btnDone.height = 26; - _btnDone.x = (width - _btnDone.width) / 2; - _btnDone.y = height / 2 + 52; + _btnDone.x = cx - (_btnDone.width / 2); + _btnDone.y = cy + 52; tUsername.width = 120; tUsername.height = 20; From 7cc33b011d19b44bca6df37cd3ecbefc59721c4f Mon Sep 17 00:00:00 2001 From: deepfriedwaffles Date: Wed, 25 Mar 2026 17:54:01 -0400 Subject: [PATCH 25/33] Fixed bugs in starting the game. ALso added build job for iOS ipa unsigned --- .github/workflows/build.yml | 28 ++++++++++- .../minecraftpe.xcodeproj/project.pbxproj | 48 +++++++++---------- src/client/Minecraft.cpp | 4 +- 3 files changed, 53 insertions(+), 27 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eba5db7..419cca1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -72,6 +72,30 @@ jobs: ${{github.workspace}}/build/OpenAL32.dll ${{github.workspace}}/build/libz.dll + build-ios: + # credit to pengubow from deepfriedwaffles repo + name: Build iOS + runs-on: macos-latest + + steps: + - name: Checkout + uses: actions/checkout@main + + - name: Build + run: | + cd project/iosproj + xcodebuild -scheme minecraftpe -derivedDataPath build -destination 'generic/platform=iOS' CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO + mkdir -p Payload + cp -R build/Build/Products/Debug-iphoneos/minecraftpe.app Payload/ + zip -r minecraftpe.ipa Payload + rm -rf Payload + + - name: Upload artifact + uses: actions/upload-artifact@main + with: + name: minecraftpe-ios + path: project/iosproj/minecraftpe.ipa + build-linux: name: Build Linux runs-on: ubuntu-latest @@ -266,7 +290,7 @@ jobs: publish: name: Publish runs-on: ubuntu-latest - needs: [ build-windows, build-linux, build-android, build-web ] + needs: [ build-windows, build-linux, build-android, build-web, build-ios ] if: github.ref == 'refs/heads/main' steps: - name: Checkout @@ -340,4 +364,4 @@ jobs: ./minecraftpe-server-${{ steps.ref.outputs.hash }}.zip ./minecraftpe-${{ steps.ref.outputs.hash }}-android-arm64-v8a.zip ./minecraftpe-${{ steps.ref.outputs.hash }}-android-armeabi-v7a.zip - ./minecraftpe-${{ steps.ref.outputs.hash }}-web.zip \ No newline at end of file + ./minecraftpe-${{ steps.ref.outputs.hash }}-web.zip diff --git a/project/iosproj/minecraftpe.xcodeproj/project.pbxproj b/project/iosproj/minecraftpe.xcodeproj/project.pbxproj index 6fcf382..795e57f 100755 --- a/project/iosproj/minecraftpe.xcodeproj/project.pbxproj +++ b/project/iosproj/minecraftpe.xcodeproj/project.pbxproj @@ -2432,30 +2432,30 @@ D5F3B7C814548E7900D25470 /* IASKPSToggleSwitchSpecifierViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = IASKPSToggleSwitchSpecifierViewCell.xib; sourceTree = ""; }; D5F3B7C914548E7900D25470 /* IASKSpecifierValuesView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = IASKSpecifierValuesView.xib; sourceTree = ""; }; D5F3B7E41454930400D25470 /* InAppSettings.bundle */ = {isa = PBXFileReference; explicitFileType = "wrapper.installer-pkg"; path = InAppSettings.bundle; sourceTree = ""; }; - F99D341D2F736AA100DC153E /* HttpClient.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HttpClient.h; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/platform/HttpClient.h"; sourceTree = ""; }; - F99D341E2F736AA100DC153E /* HttpClient.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = HttpClient.cpp; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/platform/HttpClient.cpp"; sourceTree = ""; }; - F99D34212F736AD400DC153E /* TextOption.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TextOption.h; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/components/TextOption.h"; sourceTree = ""; }; - F99D34222F736AD400DC153E /* TextOption.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = TextOption.cpp; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/components/TextOption.cpp"; sourceTree = ""; }; - F99D34252F736AFB00DC153E /* OptionsFile.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionsFile.h; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/OptionsFile.h"; sourceTree = ""; }; - F99D34262F736AFB00DC153E /* OptionsFile.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = OptionsFile.cpp; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/OptionsFile.cpp"; sourceTree = ""; }; - F99D34292F736B6F00DC153E /* OptionsItem.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionsItem.h; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/components/OptionsItem.h"; sourceTree = ""; }; - F99D342A2F736B6F00DC153E /* OptionsItem.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = OptionsItem.cpp; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/components/OptionsItem.cpp"; sourceTree = ""; }; - F99D342D2F736BAD00DC153E /* ConsoleScreen.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ConsoleScreen.h; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/screens/ConsoleScreen.h"; sourceTree = ""; }; - F99D342E2F736BAD00DC153E /* ConsoleScreen.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = ConsoleScreen.cpp; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/screens/ConsoleScreen.cpp"; sourceTree = ""; }; - F99D34312F736BDA00DC153E /* CreditsScreen.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CreditsScreen.h; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/screens/CreditsScreen.h"; sourceTree = ""; }; - F99D34322F736BDA00DC153E /* CreditsScreen.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = CreditsScreen.cpp; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/screens/CreditsScreen.cpp"; sourceTree = ""; }; - F99D34352F736C1000DC153E /* JoinByIPScreen.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = JoinByIPScreen.h; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/screens/JoinByIPScreen.h"; sourceTree = ""; }; - F99D34362F736C1000DC153E /* JoinByIPScreen.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = JoinByIPScreen.cpp; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/screens/JoinByIPScreen.cpp"; sourceTree = ""; }; - F99D34392F736C3B00DC153E /* UsernameScreen.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = UsernameScreen.h; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/screens/UsernameScreen.h"; sourceTree = ""; }; - F99D343A2F736C3B00DC153E /* UsernameScreen.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = UsernameScreen.cpp; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/screens/UsernameScreen.cpp"; sourceTree = ""; }; - F99D343D2F736C8400DC153E /* GuiElementContainer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = GuiElementContainer.h; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/components/GuiElementContainer.h"; sourceTree = ""; }; - F99D343E2F736C8400DC153E /* GuiElementContainer.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = GuiElementContainer.cpp; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/components/GuiElementContainer.cpp"; sourceTree = ""; }; - F99D34412F736F9400DC153E /* Option.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Option.h; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/Option.h"; sourceTree = ""; }; - F99D34422F736F9400DC153E /* Option.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = Option.cpp; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/Option.cpp"; sourceTree = ""; }; - F99D34452F736FE800DC153E /* KeyOption.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = KeyOption.h; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/components/KeyOption.h"; sourceTree = ""; }; - F99D34462F736FE800DC153E /* KeyOption.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = KeyOption.cpp; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/components/KeyOption.cpp"; sourceTree = ""; }; - F99D34492F7370CF00DC153E /* Slider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Slider.h; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/components/Slider.h"; sourceTree = ""; }; - F99D344A2F7370CF00DC153E /* Slider.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = Slider.cpp; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/components/Slider.cpp"; sourceTree = ""; }; + F99D341D2F736AA100DC153E /* HttpClient.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HttpClient.h; path = ../../src/platform/HttpClient.h; sourceTree = ""; }; + F99D341E2F736AA100DC153E /* HttpClient.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = HttpClient.cpp; path = ../../src/platform/HttpClient.cpp; sourceTree = ""; }; + F99D34212F736AD400DC153E /* TextOption.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TextOption.h; path = ../../src/client/gui/components/TextOption.h; sourceTree = ""; }; + F99D34222F736AD400DC153E /* TextOption.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = TextOption.cpp; path = ../../src/client/gui/components/TextOption.cpp; }; + F99D34252F736AFB00DC153E /* OptionsFile.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionsFile.h; path = ../../src/client/OptionsFile.h; sourceTree = ""; sourceTree = ""; }; + F99D34262F736AFB00DC153E /* OptionsFile.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = OptionsFile.cpp; path = ../../src/client/OptionsFile.cpp; sourceTree = ""; }; + F99D34292F736B6F00DC153E /* OptionsItem.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionsItem.h; path = ../../src/client/gui/components/OptionsItem.h; sourceTree = ""; }; + F99D342A2F736B6F00DC153E /* OptionsItem.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = OptionsItem.cpp; path = ../../src/client/gui/components/OptionsItem.cpp; sourceTree = ""; }; + F99D342D2F736BAD00DC153E /* ConsoleScreen.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ConsoleScreen.h; path = ../../src/client/gui/screens/ConsoleScreen.h; sourceTree = ""; }; + F99D342E2F736BAD00DC153E /* ConsoleScreen.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = ConsoleScreen.cpp; path = ../../src/client/gui/screens/ConsoleScreen.cpp; sourceTree = ""; }; + F99D34312F736BDA00DC153E /* CreditsScreen.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CreditsScreen.h; path = ../../src/client/gui/screens/CreditsScreen.h; sourceTree = ""; }; + F99D34322F736BDA00DC153E /* CreditsScreen.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = CreditsScreen.cpp; path = ../../src/client/gui/screens/CreditsScreen.cpp; sourceTree = ""; }; + F99D34352F736C1000DC153E /* JoinByIPScreen.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = JoinByIPScreen.h; path = ../../src/client/gui/screens/JoinByIPScreen.h; sourceTree = ""; }; + F99D34362F736C1000DC153E /* JoinByIPScreen.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = JoinByIPScreen.cpp; path = ../../src/client/gui/screens/JoinByIPScreen.cpp; sourceTree = ""; }; + F99D34392F736C3B00DC153E /* UsernameScreen.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = UsernameScreen.h; path = ../../src/client/gui/screens/UsernameScreen.h; sourceTree = ""; }; + F99D343A2F736C3B00DC153E /* UsernameScreen.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = UsernameScreen.cpp; path = ../../src/client/gui/screens/UsernameScreen.cpp; sourceTree = ""; }; + F99D343D2F736C8400DC153E /* GuiElementContainer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = GuiElementContainer.h; path = ../../src/client/gui/components/GuiElementContainer.h; sourceTree = ""; }; + F99D343E2F736C8400DC153E /* GuiElementContainer.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = GuiElementContainer.cpp; path = ../../src/client/gui/components/GuiElementContainer.cpp; sourceTree = ""; }; + F99D34412F736F9400DC153E /* Option.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Option.h; path = ../../src/client/Option.h; sourceTree = ""; }; + F99D34422F736F9400DC153E /* Option.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = Option.cpp; path = ../../src/client/Option.cpp; sourceTree = ""; }; + F99D34452F736FE800DC153E /* KeyOption.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = KeyOption.h; path = ../../src/client/gui/components/KeyOption.h; sourceTree = ""; }; + F99D34462F736FE800DC153E /* KeyOption.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = KeyOption.cpp; path = ../../src/client/gui/components/KeyOption.cpp; sourceTree = ""; }; + F99D34492F7370CF00DC153E /* Slider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Slider.h; path = ../../src/client/gui/components/Slider.h; sourceTree = ""; }; + F99D344A2F7370CF00DC153E /* Slider.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = Slider.cpp; path = ../../src/client/gui/components/Slider.cpp; sourceTree = ""; }; F99D344D2F7372A100DC153E /* Launch Screen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = "Launch Screen.storyboard"; sourceTree = ""; }; /* End PBXFileReference section */ diff --git a/src/client/Minecraft.cpp b/src/client/Minecraft.cpp index 97f1bc8..ae8ba6b 100755 --- a/src/client/Minecraft.cpp +++ b/src/client/Minecraft.cpp @@ -1106,7 +1106,9 @@ void Minecraft::releaseMouse() } bool Minecraft::useTouchscreen() { -#ifdef RPI +#if TARGET_OS_IPHONE + return true; +#elif RPI return false; #endif return options.getBooleanValue(OPTIONS_USE_TOUCHSCREEN) && !_supportsNonTouchscreen; From 6f0c485a9f0fb22ca70268d4704db1e84d5fb82d Mon Sep 17 00:00:00 2001 From: deepfriedwaffles Date: Wed, 25 Mar 2026 19:39:24 -0400 Subject: [PATCH 26/33] removed if line from publish to always run it. can we not skip publish thanks --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 419cca1..43827e3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -291,7 +291,6 @@ jobs: name: Publish runs-on: ubuntu-latest needs: [ build-windows, build-linux, build-android, build-web, build-ios ] - if: github.ref == 'refs/heads/main' steps: - name: Checkout uses: actions/checkout@v4 From 98dd53e2f5c75f2140dad3cdac9cbb99eb4a5457 Mon Sep 17 00:00:00 2001 From: deepfriedwaffles Date: Thu, 26 Mar 2026 01:59:43 +0200 Subject: [PATCH 27/33] Update .github/workflows/build.yml I keep messing this up. For now I am removing all the needs for publish except iOS --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 43827e3..901b0a3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -290,7 +290,7 @@ jobs: publish: name: Publish runs-on: ubuntu-latest - needs: [ build-windows, build-linux, build-android, build-web, build-ios ] + needs: [ build-ios ] steps: - name: Checkout uses: actions/checkout@v4 From 412a34562fa03fc241a98beb15477ea6ae23c3aa Mon Sep 17 00:00:00 2001 From: deepfriedwaffles Date: Mon, 30 Mar 2026 10:54:25 -0400 Subject: [PATCH 28/33] Lowered minimum deployment to iOS 12, rather than iOS 14 --- .../minecraftpe.xcodeproj/project.pbxproj | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/project/iosproj/minecraftpe.xcodeproj/project.pbxproj b/project/iosproj/minecraftpe.xcodeproj/project.pbxproj index 795e57f..ea9ef74 100755 --- a/project/iosproj/minecraftpe.xcodeproj/project.pbxproj +++ b/project/iosproj/minecraftpe.xcodeproj/project.pbxproj @@ -2435,8 +2435,8 @@ F99D341D2F736AA100DC153E /* HttpClient.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HttpClient.h; path = ../../src/platform/HttpClient.h; sourceTree = ""; }; F99D341E2F736AA100DC153E /* HttpClient.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = HttpClient.cpp; path = ../../src/platform/HttpClient.cpp; sourceTree = ""; }; F99D34212F736AD400DC153E /* TextOption.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TextOption.h; path = ../../src/client/gui/components/TextOption.h; sourceTree = ""; }; - F99D34222F736AD400DC153E /* TextOption.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = TextOption.cpp; path = ../../src/client/gui/components/TextOption.cpp; }; - F99D34252F736AFB00DC153E /* OptionsFile.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionsFile.h; path = ../../src/client/OptionsFile.h; sourceTree = ""; sourceTree = ""; }; + F99D34222F736AD400DC153E /* TextOption.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = TextOption.cpp; path = ../../src/client/gui/components/TextOption.cpp; sourceTree = ""; }; + F99D34252F736AFB00DC153E /* OptionsFile.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionsFile.h; path = ../../src/client/OptionsFile.h; sourceTree = ""; }; F99D34262F736AFB00DC153E /* OptionsFile.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = OptionsFile.cpp; path = ../../src/client/OptionsFile.cpp; sourceTree = ""; }; F99D34292F736B6F00DC153E /* OptionsItem.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionsItem.h; path = ../../src/client/gui/components/OptionsItem.h; sourceTree = ""; }; F99D342A2F736B6F00DC153E /* OptionsItem.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = OptionsItem.cpp; path = ../../src/client/gui/components/OptionsItem.cpp; sourceTree = ""; }; @@ -5853,7 +5853,7 @@ GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src"; - IPHONEOS_DEPLOYMENT_TARGET = 14; + IPHONEOS_DEPLOYMENT_TARGET = 12; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; "PROVISIONING_PROFILE[sdk=iphoneos*]" = "C93D3524-5C6F-466E-B12B-833663B7EAE0"; @@ -5884,7 +5884,7 @@ ); INFOPLIST_FILE = "minecraftpe/minecraftpe-Info.plist"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; - IPHONEOS_DEPLOYMENT_TARGET = 14; + IPHONEOS_DEPLOYMENT_TARGET = 12; ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = "com.mojang.mcpe-arm64"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -5978,7 +5978,7 @@ GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src"; - IPHONEOS_DEPLOYMENT_TARGET = 14; + IPHONEOS_DEPLOYMENT_TARGET = 12; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; "PROVISIONING_PROFILE[sdk=iphoneos*]" = "64BA8967-1A9A-4980-972C-42E75AD5E023"; @@ -6010,7 +6010,7 @@ ); INFOPLIST_FILE = "minecraftpe/minecraftpe-Info.plist"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; - IPHONEOS_DEPLOYMENT_TARGET = 14; + IPHONEOS_DEPLOYMENT_TARGET = 12; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = ( "-DNS_BLOCK_ASSERTIONS=1", @@ -6076,7 +6076,7 @@ GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src"; - IPHONEOS_DEPLOYMENT_TARGET = 14; + IPHONEOS_DEPLOYMENT_TARGET = 12; ONLY_ACTIVE_ARCH = YES; RUN_CLANG_STATIC_ANALYZER = NO; SDKROOT = iphoneos; @@ -6104,7 +6104,7 @@ GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src"; - IPHONEOS_DEPLOYMENT_TARGET = 14; + IPHONEOS_DEPLOYMENT_TARGET = 12; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; RUN_CLANG_STATIC_ANALYZER = NO; @@ -6137,7 +6137,7 @@ ); INFOPLIST_FILE = "minecraftpe/minecraftpe-Info.plist"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; - IPHONEOS_DEPLOYMENT_TARGET = 14; + IPHONEOS_DEPLOYMENT_TARGET = 12; ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = "com.mojang.mcpe-arm64"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -6172,7 +6172,7 @@ ); INFOPLIST_FILE = "minecraftpe/minecraftpe-Info.plist"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; - IPHONEOS_DEPLOYMENT_TARGET = 14; + IPHONEOS_DEPLOYMENT_TARGET = 12; ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = "com.mojang.mcpe-arm64"; PRODUCT_NAME = "$(TARGET_NAME)"; From c476153231f31134c29256a44d0a0260cd910367 Mon Sep 17 00:00:00 2001 From: Kolyah35 Date: Sat, 4 Apr 2026 12:11:33 +0300 Subject: [PATCH 29/33] FIX: other platforms compilation --- src/client/gui/components/OptionsPane.cpp | 17 +++++++++-------- src/client/gui/components/OptionsPane.h | 6 +++--- src/client/gui/screens/JoinByIPScreen.h | 4 ++-- .../gui/screens/crafting/PaneCraftingScreen.cpp | 2 +- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/client/gui/components/OptionsPane.cpp b/src/client/gui/components/OptionsPane.cpp index e7e6aa2..217a8b2 100644 --- a/src/client/gui/components/OptionsPane.cpp +++ b/src/client/gui/components/OptionsPane.cpp @@ -4,6 +4,7 @@ #include "ImageButton.h" #include "Slider.h" #include "../../Minecraft.h" +#include "client/Options.h" OptionsPane::OptionsPane() { @@ -28,7 +29,7 @@ OptionsGroup& OptionsPane::createOptionsGroup( std::string label ) { return *newGroup; } -void OptionsPane::createToggle( unsigned int group, std::string label, const Option* option ) { +void OptionsPane::createToggle( unsigned int group, std::string label, OptionId option ) { if(group > children.size()) return; ImageDef def; def.setSrc(IntRectangle(160, 206, 39, 20)); @@ -37,27 +38,27 @@ void OptionsPane::createToggle( unsigned int group, std::string label, const Opt def.height = 20 * 0.7f; OptionButton* element = new OptionButton(option); element->setImageDef(def, true); - OptionsItem* item = new OptionsItem(label, element); + OptionsItem* item = new OptionsItem(option, label, element); ((OptionsGroup*)children[group])->addChild(item); setupPositions(); } -void OptionsPane::createProgressSlider( Minecraft* minecraft, unsigned int group, std::string label, const Option* option, float progressMin/*=1.0f*/, float progressMax/*=1.0f */ ) { +void OptionsPane::createProgressSlider( Minecraft* minecraft, unsigned int group, std::string label, OptionId option, float progressMin/*=1.0f*/, float progressMax/*=1.0f */ ) { if(group > children.size()) return; - Slider* element = new Slider(minecraft, option, progressMin, progressMax); + Slider* element = new SliderFloat(minecraft, option); element->width = 100; element->height = 20; - OptionsItem* item = new OptionsItem(label, element); + OptionsItem* item = new OptionsItem(option, label, element); ((OptionsGroup*)children[group])->addChild(item); setupPositions(); } -void OptionsPane::createStepSlider( Minecraft* minecraft, unsigned int group, std::string label, const Option* option, const std::vector& stepVec ) { +void OptionsPane::createStepSlider( Minecraft* minecraft, unsigned int group, std::string label, OptionId option, const std::vector& stepVec ) { if(group > children.size()) return; - Slider* element = new Slider(minecraft, option, stepVec); + Slider* element = new SliderInt(minecraft, option); element->width = 100; element->height = 20; - OptionsItem* item = new OptionsItem(label, element); + OptionsItem* item = new OptionsItem(option, label, element); ((OptionsGroup*)children[group])->addChild(item); setupPositions(); } diff --git a/src/client/gui/components/OptionsPane.h b/src/client/gui/components/OptionsPane.h index cf16b26..e6f7607 100644 --- a/src/client/gui/components/OptionsPane.h +++ b/src/client/gui/components/OptionsPane.h @@ -21,9 +21,9 @@ class OptionsPane: public GuiElementContainer public: OptionsPane(); OptionsGroup& createOptionsGroup( std::string label ); - void createToggle( unsigned int group, std::string label, const Option* option ); - void createProgressSlider(Minecraft* minecraft, unsigned int group, std::string label, const Option* option, float progressMin=1.0f, float progressMax=1.0f ); - void createStepSlider(Minecraft* minecraft, unsigned int group, std::string label, const Option* option, const std::vector& stepVec ); + void createToggle( unsigned int group, std::string label, OptionId option ); + void createProgressSlider(Minecraft* minecraft, unsigned int group, std::string label, OptionId option, float progressMin=1.0f, float progressMax=1.0f ); + void createStepSlider(Minecraft* minecraft, unsigned int group, std::string label, OptionId option, const std::vector& stepVec ); void setupPositions(); }; diff --git a/src/client/gui/screens/JoinByIPScreen.h b/src/client/gui/screens/JoinByIPScreen.h index 4b17543..7333b39 100644 --- a/src/client/gui/screens/JoinByIPScreen.h +++ b/src/client/gui/screens/JoinByIPScreen.h @@ -2,8 +2,8 @@ #include "../Screen.h" #include "../components/Button.h" #include "../../Minecraft.h" -#include "ImageButton.h" -#include "TextBox.h" +#include "../components/ImageButton.h" +#include "../components/TextBox.h" class JoinByIPScreen: public Screen { diff --git a/src/client/gui/screens/crafting/PaneCraftingScreen.cpp b/src/client/gui/screens/crafting/PaneCraftingScreen.cpp index c0ec6a9..4e3d025 100755 --- a/src/client/gui/screens/crafting/PaneCraftingScreen.cpp +++ b/src/client/gui/screens/crafting/PaneCraftingScreen.cpp @@ -16,7 +16,7 @@ #include "../../../../world/level/Level.h" #include "../../../../world/item/DyePowderItem.h" #include "../../../../world/item/crafting/Recipe.h" -#include "Keyboard.h" +#include "platform/input/Keyboard.h" static NinePatchLayer* guiPaneFrame = NULL; From a96b942c17098047391416e8f36bf9ea0273c834 Mon Sep 17 00:00:00 2001 From: Kolyah35 Date: Sat, 4 Apr 2026 14:26:57 +0300 Subject: [PATCH 30/33] FIX: web and android compilation --- src/client/renderer/gles.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/renderer/gles.h b/src/client/renderer/gles.h index 9a74c07..c6d4bec 100755 --- a/src/client/renderer/gles.h +++ b/src/client/renderer/gles.h @@ -17,8 +17,8 @@ #import #import #elif defined(ANDROID) || defined(__EMSCRIPTEN__) - #import - #import + #import + #import #else #include From 13fd8303615a6314a9e96ce60697d01707a94a27 Mon Sep 17 00:00:00 2001 From: deepfriedwaffles Date: Sat, 4 Apr 2026 20:44:22 -0400 Subject: [PATCH 31/33] fixed the possible broken header search and added all jobs including ios to publish --- .github/workflows/build.yml | 2 +- .../minecraftpe.xcodeproj/project.pbxproj | 20 +++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 901b0a3..7506661 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -290,7 +290,7 @@ jobs: publish: name: Publish runs-on: ubuntu-latest - needs: [ build-ios ] + needs: [ build-windows, build-ios, build-linux, build-android, build-web ] steps: - name: Checkout uses: actions/checkout@v4 diff --git a/project/iosproj/minecraftpe.xcodeproj/project.pbxproj b/project/iosproj/minecraftpe.xcodeproj/project.pbxproj index ea9ef74..795e57f 100755 --- a/project/iosproj/minecraftpe.xcodeproj/project.pbxproj +++ b/project/iosproj/minecraftpe.xcodeproj/project.pbxproj @@ -2435,8 +2435,8 @@ F99D341D2F736AA100DC153E /* HttpClient.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HttpClient.h; path = ../../src/platform/HttpClient.h; sourceTree = ""; }; F99D341E2F736AA100DC153E /* HttpClient.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = HttpClient.cpp; path = ../../src/platform/HttpClient.cpp; sourceTree = ""; }; F99D34212F736AD400DC153E /* TextOption.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TextOption.h; path = ../../src/client/gui/components/TextOption.h; sourceTree = ""; }; - F99D34222F736AD400DC153E /* TextOption.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = TextOption.cpp; path = ../../src/client/gui/components/TextOption.cpp; sourceTree = ""; }; - F99D34252F736AFB00DC153E /* OptionsFile.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionsFile.h; path = ../../src/client/OptionsFile.h; sourceTree = ""; }; + F99D34222F736AD400DC153E /* TextOption.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = TextOption.cpp; path = ../../src/client/gui/components/TextOption.cpp; }; + F99D34252F736AFB00DC153E /* OptionsFile.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionsFile.h; path = ../../src/client/OptionsFile.h; sourceTree = ""; sourceTree = ""; }; F99D34262F736AFB00DC153E /* OptionsFile.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = OptionsFile.cpp; path = ../../src/client/OptionsFile.cpp; sourceTree = ""; }; F99D34292F736B6F00DC153E /* OptionsItem.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionsItem.h; path = ../../src/client/gui/components/OptionsItem.h; sourceTree = ""; }; F99D342A2F736B6F00DC153E /* OptionsItem.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = OptionsItem.cpp; path = ../../src/client/gui/components/OptionsItem.cpp; sourceTree = ""; }; @@ -5853,7 +5853,7 @@ GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src"; - IPHONEOS_DEPLOYMENT_TARGET = 12; + IPHONEOS_DEPLOYMENT_TARGET = 14; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; "PROVISIONING_PROFILE[sdk=iphoneos*]" = "C93D3524-5C6F-466E-B12B-833663B7EAE0"; @@ -5884,7 +5884,7 @@ ); INFOPLIST_FILE = "minecraftpe/minecraftpe-Info.plist"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; - IPHONEOS_DEPLOYMENT_TARGET = 12; + IPHONEOS_DEPLOYMENT_TARGET = 14; ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = "com.mojang.mcpe-arm64"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -5978,7 +5978,7 @@ GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src"; - IPHONEOS_DEPLOYMENT_TARGET = 12; + IPHONEOS_DEPLOYMENT_TARGET = 14; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; "PROVISIONING_PROFILE[sdk=iphoneos*]" = "64BA8967-1A9A-4980-972C-42E75AD5E023"; @@ -6010,7 +6010,7 @@ ); INFOPLIST_FILE = "minecraftpe/minecraftpe-Info.plist"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; - IPHONEOS_DEPLOYMENT_TARGET = 12; + IPHONEOS_DEPLOYMENT_TARGET = 14; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = ( "-DNS_BLOCK_ASSERTIONS=1", @@ -6076,7 +6076,7 @@ GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src"; - IPHONEOS_DEPLOYMENT_TARGET = 12; + IPHONEOS_DEPLOYMENT_TARGET = 14; ONLY_ACTIVE_ARCH = YES; RUN_CLANG_STATIC_ANALYZER = NO; SDKROOT = iphoneos; @@ -6104,7 +6104,7 @@ GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src"; - IPHONEOS_DEPLOYMENT_TARGET = 12; + IPHONEOS_DEPLOYMENT_TARGET = 14; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; RUN_CLANG_STATIC_ANALYZER = NO; @@ -6137,7 +6137,7 @@ ); INFOPLIST_FILE = "minecraftpe/minecraftpe-Info.plist"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; - IPHONEOS_DEPLOYMENT_TARGET = 12; + IPHONEOS_DEPLOYMENT_TARGET = 14; ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = "com.mojang.mcpe-arm64"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -6172,7 +6172,7 @@ ); INFOPLIST_FILE = "minecraftpe/minecraftpe-Info.plist"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; - IPHONEOS_DEPLOYMENT_TARGET = 12; + IPHONEOS_DEPLOYMENT_TARGET = 14; ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = "com.mojang.mcpe-arm64"; PRODUCT_NAME = "$(TARGET_NAME)"; From d7a02bfc9060509dd67c3b4ac8379fae87b14539 Mon Sep 17 00:00:00 2001 From: deepfriedwaffles Date: Sun, 5 Apr 2026 14:22:14 -0400 Subject: [PATCH 32/33] Added iOS comppiling instructions to README --- README.md | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ec0b870..ebdc8cb 100644 --- a/README.md +++ b/README.md @@ -197,4 +197,39 @@ cmake --build . 3. Run game: ``` emrun --port 8080 . - ``` \ No newline at end of file + ``` +## iOS +### Xcode +> [Note!] +> There's a precompiled IPA artifact in the GitHub mirror under Actions for those who either don't have Macs or don't want to build themself. But if you want to build youself, you'll need a Mac with Xcode. Download Xcode from the Mac App Store. + +### 1. Clone +Open your terminal and clone the repository +```bash +git clone https://gitea.sffempire.ru/Kolyah35/minecraft-pe-0.6.1.git +cd minecraft-pe-0.6.1 +``` +You can also build from the ios-support branch by checking out to it +``` +git checkout ios-support +``` + +### 2. Open in Xcode + +The project file is in `minecraft-pe-0.6.1/project/iosproj/minecraftpe.xcodeproj`. Open it. + +### 3. Configure Code Signing + +Before you can deploy to an iPhone, you must sign the app with your own Apple Developer account: + +1. Select the **minecraftpe** project in the left sidebar. +2. Go to **Signing & Capabilities**. +3. Change the **Bundle Identifier** to something unique (e.g., `com.yourname.mcpe`). +4. Select your **Team** from the dropdown menu. + +### 4. Build and Run + +1. Connect your iPhone via USB or LAN. +2. Select your device from the run destination menu at the top of Xcode. +3. Press **Cmd + R** (or the Play button). +4. **Note:** If you encounter a "Developer Mode" or "Untrusted Developer" error on your phone, go to **Settings > General > VPN & Device Management** to trust your certificate. From 845d721b1eac6007a05e9e6f79e5fe4cfa854bbd Mon Sep 17 00:00:00 2001 From: deepfriedwaffles Date: Mon, 6 Apr 2026 14:48:46 -0400 Subject: [PATCH 33/33] fixed compile issues from main rebase and lowered ios minimum deployment back to 12 --- .../minecraftpe.xcodeproj/project.pbxproj | 38 ++++++++++++++----- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/project/iosproj/minecraftpe.xcodeproj/project.pbxproj b/project/iosproj/minecraftpe.xcodeproj/project.pbxproj index 795e57f..aa8a96c 100755 --- a/project/iosproj/minecraftpe.xcodeproj/project.pbxproj +++ b/project/iosproj/minecraftpe.xcodeproj/project.pbxproj @@ -1173,6 +1173,12 @@ F99D344C2F7370CF00DC153E /* Slider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99D344A2F7370CF00DC153E /* Slider.cpp */; }; F99D344E2F7372A100DC153E /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F99D344D2F7372A100DC153E /* Launch Screen.storyboard */; }; F99D344F2F7372A100DC153E /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F99D344D2F7372A100DC153E /* Launch Screen.storyboard */; }; + F99F0FA92F84369F00F2B29A /* GrassColor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99F0FA82F84369F00F2B29A /* GrassColor.cpp */; }; + F99F0FAA2F84369F00F2B29A /* GrassColor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99F0FA82F84369F00F2B29A /* GrassColor.cpp */; }; + F99F0FAC2F8436CE00F2B29A /* FoliageColor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99F0FAB2F8436CE00F2B29A /* FoliageColor.cpp */; }; + F99F0FAD2F8436CE00F2B29A /* FoliageColor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99F0FAB2F8436CE00F2B29A /* FoliageColor.cpp */; }; + F99F0FAF2F8436EB00F2B29A /* Color.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99F0FAE2F8436EB00F2B29A /* Color.cpp */; }; + F99F0FB02F8436EB00F2B29A /* Color.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99F0FAE2F8436EB00F2B29A /* Color.cpp */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -2435,8 +2441,8 @@ F99D341D2F736AA100DC153E /* HttpClient.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HttpClient.h; path = ../../src/platform/HttpClient.h; sourceTree = ""; }; F99D341E2F736AA100DC153E /* HttpClient.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = HttpClient.cpp; path = ../../src/platform/HttpClient.cpp; sourceTree = ""; }; F99D34212F736AD400DC153E /* TextOption.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TextOption.h; path = ../../src/client/gui/components/TextOption.h; sourceTree = ""; }; - F99D34222F736AD400DC153E /* TextOption.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = TextOption.cpp; path = ../../src/client/gui/components/TextOption.cpp; }; - F99D34252F736AFB00DC153E /* OptionsFile.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionsFile.h; path = ../../src/client/OptionsFile.h; sourceTree = ""; sourceTree = ""; }; + F99D34222F736AD400DC153E /* TextOption.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = TextOption.cpp; path = ../../src/client/gui/components/TextOption.cpp; sourceTree = ""; }; + F99D34252F736AFB00DC153E /* OptionsFile.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionsFile.h; path = ../../src/client/OptionsFile.h; sourceTree = ""; }; F99D34262F736AFB00DC153E /* OptionsFile.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = OptionsFile.cpp; path = ../../src/client/OptionsFile.cpp; sourceTree = ""; }; F99D34292F736B6F00DC153E /* OptionsItem.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionsItem.h; path = ../../src/client/gui/components/OptionsItem.h; sourceTree = ""; }; F99D342A2F736B6F00DC153E /* OptionsItem.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = OptionsItem.cpp; path = ../../src/client/gui/components/OptionsItem.cpp; sourceTree = ""; }; @@ -2457,6 +2463,9 @@ F99D34492F7370CF00DC153E /* Slider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Slider.h; path = ../../src/client/gui/components/Slider.h; sourceTree = ""; }; F99D344A2F7370CF00DC153E /* Slider.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = Slider.cpp; path = ../../src/client/gui/components/Slider.cpp; sourceTree = ""; }; F99D344D2F7372A100DC153E /* Launch Screen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = "Launch Screen.storyboard"; sourceTree = ""; }; + F99F0FA82F84369F00F2B29A /* GrassColor.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = GrassColor.cpp; sourceTree = ""; }; + F99F0FAB2F8436CE00F2B29A /* FoliageColor.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FoliageColor.cpp; sourceTree = ""; }; + F99F0FAE2F8436EB00F2B29A /* Color.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Color.cpp; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -3761,6 +3770,7 @@ D5B50E6914CFF66F005F7284 /* StringUtils.cpp */, D5B50E6A14CFF66F005F7284 /* StringUtils.h */, D5B50E6B14CFF66F005F7284 /* WeighedRandom.h */, + F99F0FAE2F8436EB00F2B29A /* Color.cpp */, ); path = util; sourceTree = ""; @@ -4025,6 +4035,8 @@ D5B50F3714CFF66F005F7284 /* TickNextTickData.h */, D5B50F3814CFF66F005F7284 /* tile */, D5B50F6814CFF66F005F7284 /* TilePos.h */, + F99F0FA82F84369F00F2B29A /* GrassColor.cpp */, + F99F0FAB2F8436CE00F2B29A /* FoliageColor.cpp */, ); path = level; sourceTree = ""; @@ -5194,6 +5206,7 @@ D5B5111014CFF670005F7284 /* Mth.cpp in Sources */, D5B5111214CFF670005F7284 /* PerfRenderer.cpp in Sources */, D5B5111414CFF670005F7284 /* PerfTimer.cpp in Sources */, + F99F0FA92F84369F00F2B29A /* GrassColor.cpp in Sources */, D5B5111614CFF670005F7284 /* StringUtils.cpp in Sources */, D5B5111814CFF670005F7284 /* Direction.cpp in Sources */, D5B5111A14CFF670005F7284 /* Animal.cpp in Sources */, @@ -5214,12 +5227,14 @@ D5B5113814CFF670005F7284 /* PathFinderMob.cpp in Sources */, D5B5113A14CFF670005F7284 /* Inventory.cpp in Sources */, D5B5113C14CFF670005F7284 /* Player.cpp in Sources */, + F99F0FB02F8436EB00F2B29A /* Color.cpp in Sources */, D5B5113E14CFF670005F7284 /* Arrow.cpp in Sources */, D5B5114014CFF670005F7284 /* Recipes.cpp in Sources */, D5B5114214CFF670005F7284 /* ToolRecipes.cpp in Sources */, D5B5114414CFF670005F7284 /* WeaponRecipes.cpp in Sources */, D5B5114614CFF670005F7284 /* HatchetItem.cpp in Sources */, D5B5114814CFF670005F7284 /* Item.cpp in Sources */, + F99F0FAC2F8436CE00F2B29A /* FoliageColor.cpp in Sources */, D5B5114A14CFF670005F7284 /* ItemInstance.cpp in Sources */, D5B5114C14CFF670005F7284 /* PickaxeItem.cpp in Sources */, F99D344B2F7370CF00DC153E /* Slider.cpp in Sources */, @@ -5528,6 +5543,7 @@ D5B5102F14CFF670005F7284 /* main.cpp in Sources */, D5B5103514CFF670005F7284 /* Tag.cpp in Sources */, D5B5103714CFF670005F7284 /* ClientSideNetworkHandler.cpp in Sources */, + F99F0FAF2F8436EB00F2B29A /* Color.cpp in Sources */, D5B5103914CFF670005F7284 /* NetEventCallback.cpp in Sources */, D5B5103B14CFF670005F7284 /* Packet.cpp in Sources */, D5B5103D14CFF670005F7284 /* RakNetInstance.cpp in Sources */, @@ -5548,6 +5564,7 @@ D5B5111514CFF670005F7284 /* StringUtils.cpp in Sources */, D5B5111714CFF670005F7284 /* Direction.cpp in Sources */, D5B5111914CFF670005F7284 /* Animal.cpp in Sources */, + F99F0FAD2F8436CE00F2B29A /* FoliageColor.cpp in Sources */, D5B5111B14CFF670005F7284 /* Chicken.cpp in Sources */, D5B5111D14CFF670005F7284 /* Cow.cpp in Sources */, D5B5111F14CFF670005F7284 /* Pig.cpp in Sources */, @@ -5598,6 +5615,7 @@ D5B5117714CFF670005F7284 /* ExternalFileLevelStorageSource.cpp in Sources */, D5B5117914CFF670005F7284 /* RegionFile.cpp in Sources */, D5B5117B14CFF670005F7284 /* TickNextTickData.cpp in Sources */, + F99F0FAA2F84369F00F2B29A /* GrassColor.cpp in Sources */, D5B5117D14CFF670005F7284 /* DoorTile.cpp in Sources */, D5B5118114CFF670005F7284 /* StoneSlabTile.cpp in Sources */, D5B5118314CFF670005F7284 /* Tile.cpp in Sources */, @@ -5853,7 +5871,7 @@ GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src"; - IPHONEOS_DEPLOYMENT_TARGET = 14; + IPHONEOS_DEPLOYMENT_TARGET = 12; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; "PROVISIONING_PROFILE[sdk=iphoneos*]" = "C93D3524-5C6F-466E-B12B-833663B7EAE0"; @@ -5884,7 +5902,7 @@ ); INFOPLIST_FILE = "minecraftpe/minecraftpe-Info.plist"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; - IPHONEOS_DEPLOYMENT_TARGET = 14; + IPHONEOS_DEPLOYMENT_TARGET = 12; ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = "com.mojang.mcpe-arm64"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -5978,7 +5996,7 @@ GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src"; - IPHONEOS_DEPLOYMENT_TARGET = 14; + IPHONEOS_DEPLOYMENT_TARGET = 12; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; "PROVISIONING_PROFILE[sdk=iphoneos*]" = "64BA8967-1A9A-4980-972C-42E75AD5E023"; @@ -6010,7 +6028,7 @@ ); INFOPLIST_FILE = "minecraftpe/minecraftpe-Info.plist"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; - IPHONEOS_DEPLOYMENT_TARGET = 14; + IPHONEOS_DEPLOYMENT_TARGET = 12; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = ( "-DNS_BLOCK_ASSERTIONS=1", @@ -6076,7 +6094,7 @@ GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src"; - IPHONEOS_DEPLOYMENT_TARGET = 14; + IPHONEOS_DEPLOYMENT_TARGET = 12; ONLY_ACTIVE_ARCH = YES; RUN_CLANG_STATIC_ANALYZER = NO; SDKROOT = iphoneos; @@ -6104,7 +6122,7 @@ GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src"; - IPHONEOS_DEPLOYMENT_TARGET = 14; + IPHONEOS_DEPLOYMENT_TARGET = 12; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; RUN_CLANG_STATIC_ANALYZER = NO; @@ -6137,7 +6155,7 @@ ); INFOPLIST_FILE = "minecraftpe/minecraftpe-Info.plist"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; - IPHONEOS_DEPLOYMENT_TARGET = 14; + IPHONEOS_DEPLOYMENT_TARGET = 12; ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = "com.mojang.mcpe-arm64"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -6172,7 +6190,7 @@ ); INFOPLIST_FILE = "minecraftpe/minecraftpe-Info.plist"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; - IPHONEOS_DEPLOYMENT_TARGET = 14; + IPHONEOS_DEPLOYMENT_TARGET = 12; ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = "com.mojang.mcpe-arm64"; PRODUCT_NAME = "$(TARGET_NAME)";