diff --git a/src/client/gui/Gui.cpp b/src/client/gui/Gui.cpp index c6e786a..afdb7cb 100755 --- a/src/client/gui/Gui.cpp +++ b/src/client/gui/Gui.cpp @@ -606,7 +606,7 @@ void Gui::renderProgressIndicator( const bool isTouchInterface, const int screen 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) { + } else if((!bowEquipped) || (!minecraft->options.getBooleanValue(OPTIONS_IS_JOY_TOUCH_AREA))) { const float tprogress = minecraft->gameMode->destroyProgress; const float alpha = Mth::clamp(minecraft->inputHolder->alpha, 0.0f, 1.0f); //LOGI("alpha: %f\n", alpha); diff --git a/src/client/model/geom/ModelPart.cpp b/src/client/model/geom/ModelPart.cpp index 86ab82c..d0bc00d 100755 --- a/src/client/model/geom/ModelPart.cpp +++ b/src/client/model/geom/ModelPart.cpp @@ -203,7 +203,7 @@ void ModelPart::compile( float scale ) void ModelPart::draw() { #ifdef OPENGL_ES - drawArrayVTN_NoState(vboId, cubes.size() * 2 * 3 * 6, 28); + drawArrayVTN_NoState(vboId, cubes.size() * 2 * 3 * 6, 36); #else glCallList(list); #endif diff --git a/src/client/renderer/Tesselator.cpp b/src/client/renderer/Tesselator.cpp index 7feff29..e2a9fa8 100755 --- a/src/client/renderer/Tesselator.cpp +++ b/src/client/renderer/Tesselator.cpp @@ -8,7 +8,7 @@ Tesselator Tesselator::instance(sizeof(GLfloat) * MAX_FLOATS); // max size in by const int VertexSizeBytes = sizeof(VERTEX); Tesselator::Tesselator( int size ) -: size(size), + : size(size), vertices(0), u(0), v(0), _color(0), @@ -20,7 +20,7 @@ Tesselator::Tesselator( int size ) _noColor(false), mode(0), xo(0), yo(0), zo(0), - _normal(0), + _nx(0), _ny(0), _nz(0), _sx(1), _sy(1), tesselating(false), @@ -97,9 +97,9 @@ RenderChunk Tesselator::end( bool useMine, int bufferId ) int access = GL_STATIC_DRAW;//(accessMode==ACCESS_DYNAMIC) ? GL_DYNAMIC_DRAW : GL_STATIC_DRAW; glBindBuffer2(GL_ARRAY_BUFFER, bufferId); glBufferData2(GL_ARRAY_BUFFER, bytes, _varray, access); // GL_STREAM_DRAW - + totalSize += bytes; - + #ifndef USE_VBO // 0 1 2 3 4 5 6 7 // x y z u v c @@ -112,7 +112,7 @@ RenderChunk Tesselator::end( bool useMine, int bufferId ) glEnableClientState2(GL_COLOR_ARRAY); } if (hasNormal) { - glNormalPointer(GL_BYTE, VertexSizeBytes, (GLvoid*) (6 * 4)); + glNormalPointer(GL_FLOAT, VertexSizeBytes, (GLvoid*) (6 * 4)); glEnableClientState2(GL_NORMAL_ARRAY); } glVertexPointer2(3, GL_FLOAT, VertexSizeBytes, 0); @@ -279,7 +279,9 @@ void Tesselator::vertex( float x, float y, float z ) dst.color = src.color; } if (hasNormal) { - dst.normal = src.normal; + dst.nx = src.nx; + dst.ny = src.ny; + dst.nz = src.nz; } dst.x = src.x; @@ -302,7 +304,9 @@ void Tesselator::vertex( float x, float y, float z ) vertex.color = _color; } if (hasNormal) { - vertex.normal = _normal; + vertex.nx = _nx; + vertex.ny = _ny; + vertex.nz = _nz; } vertex.x = _sx * (x + xo); @@ -339,11 +343,15 @@ void Tesselator::normal( float x, float y, float z ) if (!tesselating) printf("But.."); hasNormal = true; - char xx = (char) (x * 128); - char yy = (char) (y * 127); - char zz = (char) (z * 127); + //char xx = (char) (x * 128); + //char yy = (char) (y * 127); + //char zz = (char) (z * 127); - _normal = xx | (yy << 8) | (zz << 16); + //_normal = xx | (yy << 8) | (zz << 16); + // trying a new thing hopefully works + this->_nx = x; + this->_ny = y; + this->_nz = z; } void Tesselator::offset( float xo, float yo, float zo ) { @@ -389,7 +397,7 @@ void Tesselator::draw() vboId = 0; int bufferId = vboIds[vboId]; - + int access = GL_DYNAMIC_DRAW;//(accessMode==ACCESS_DYNAMIC) ? GL_DYNAMIC_DRAW : GL_STATIC_DRAW; glBindBuffer2(GL_ARRAY_BUFFER, bufferId); glBufferData2(GL_ARRAY_BUFFER, bytes, _varray, access); // GL_STREAM_DRAW @@ -405,7 +413,7 @@ void Tesselator::draw() glEnableClientState2(GL_COLOR_ARRAY); } if (hasNormal) { - glNormalPointer(GL_BYTE, VertexSizeBytes, (GLvoid*) (6 * 4)); + glNormalPointer(GL_FLOAT, VertexSizeBytes, (GLvoid*) (6 * 4)); glEnableClientState2(GL_NORMAL_ARRAY); } //glVertexPointer2(3, GL_FLOAT, VertexSizeBytes, (GLvoid*)&_varray); diff --git a/src/client/renderer/Tesselator.h b/src/client/renderer/Tesselator.h index 3ad1a64..1f0192b 100755 --- a/src/client/renderer/Tesselator.h +++ b/src/client/renderer/Tesselator.h @@ -98,7 +98,9 @@ private: float xo, yo, zo; float u, v; unsigned int _color; - int _normal; +// int _normal; // trying a new thing + float _nx, _ny, _nz; + float _sx, _sy; bool hasColor; diff --git a/src/client/renderer/VertecDecl.h b/src/client/renderer/VertecDecl.h index 8abc1d3..cd48104 100755 --- a/src/client/renderer/VertecDecl.h +++ b/src/client/renderer/VertecDecl.h @@ -14,7 +14,8 @@ typedef struct VertexDeclPTCN GLfloat x, y, z; GLfloat u, v; GLuint color; - GLuint normal; +// GLuint normal; // trying a new thing + GLfloat nx, ny, nz; } VertexDeclPTCN; diff --git a/src/client/renderer/gles.cpp b/src/client/renderer/gles.cpp index 6b06488..df44d20 100755 --- a/src/client/renderer/gles.cpp +++ b/src/client/renderer/gles.cpp @@ -128,7 +128,7 @@ void drawArrayVTN(int bufferId, int vertices, int vertexSize /* = 24 */) { glVertexPointer2( 3, GL_FLOAT, vertexSize, 0); glTexCoordPointer2(2, GL_FLOAT, vertexSize, (GLvoid*) (3 * 4)); //glColorPointer2(4, GL_UNSIGNED_BYTE, vertexSize, (GLvoid*) (5*4)); - glNormalPointer(GL_BYTE, vertexSize, (GLvoid*) (6 * 4)); + glNormalPointer(GL_FLOAT, vertexSize, (GLvoid*) (6 * 4)); glDrawArrays2(GL_TRIANGLES, 0, vertices); @@ -145,7 +145,7 @@ void drawArrayVTCN_NoState(int bufferId, int vertices, int vertexSize /* = 24 */ glVertexPointer2( 3, GL_FLOAT, vertexSize, 0); glTexCoordPointer2(2, GL_FLOAT, vertexSize, (GLvoid*) (3 * 4)); //glColorPointer2(4, GL_UNSIGNED_BYTE, vertexSize, (GLvoid*) (5*4)); - glNormalPointer(GL_BYTE, vertexSize, (GLvoid*) (6 * 4)); + glNormalPointer(GL_FLOAT, vertexSize, (GLvoid*) (6 * 4)); glDrawArrays2(GL_TRIANGLES, 0, vertices); } diff --git a/src/client/renderer/gles.h b/src/client/renderer/gles.h index bd69eeb..a82c35c 100755 --- a/src/client/renderer/gles.h +++ b/src/client/renderer/gles.h @@ -60,17 +60,17 @@ void anGenBuffers(GLsizei n, GLuint* buffer); #define drawArrayVT_NoState drawArrayVT #define drawArrayVTC_NoState drawArrayVTC #define drawArrayVTN_NoState drawArrayVTN -void drawArrayVT(int bufferId, int vertices, int vertexSize = 28, unsigned int mode = GL_TRIANGLES); +void drawArrayVT(int bufferId, int vertices, int vertexSize = 36, unsigned int mode = GL_TRIANGLES); #ifndef drawArrayVT_NoState -//void drawArrayVT_NoState(int bufferId, int vertices, int vertexSize = 28); +//void drawArrayVT_NoState(int bufferId, int vertices, int vertexSize = 36); #endif -void drawArrayVTC(int bufferId, int vertices, int vertexSize = 28); +void drawArrayVTC(int bufferId, int vertices, int vertexSize = 36); #ifndef drawArrayVTC_NoState -void drawArrayVTC_NoState(int bufferId, int vertices, int vertexSize = 28); +void drawArrayVTC_NoState(int bufferId, int vertices, int vertexSize = 36); #endif -void drawArrayVTN(int bufferId, int vertices, int vertexSize = 28); +void drawArrayVTN(int bufferId, int vertices, int vertexSize = 36); #ifndef drawArrayVTN_NoState -void drawArrayVTCN_NoState(int bufferId, int vertices, int vertexSize = 28); +void drawArrayVTCN_NoState(int bufferId, int vertices, int vertexSize = 36); #endif #endif