[Scummvm-git-logs] scummvm master -> f407852260cd2fe27ebe7f5f91209d5530fe3aae

aquadran aquadran at gmail.com
Tue Oct 19 20:40:05 UTC 2021


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
f407852260 STARK: Avoid changing texture coords in loop


Commit: f407852260cd2fe27ebe7f5f91209d5530fe3aae
    https://github.com/scummvm/scummvm/commit/f407852260cd2fe27ebe7f5f91209d5530fe3aae
Author: Paweł Kołodziejski (aquadran at gmail.com)
Date: 2021-10-19T22:40:00+02:00

Commit Message:
STARK: Avoid changing texture coords in loop

Changed paths:
    engines/stark/gfx/openglprop.cpp
    engines/stark/gfx/openglprop.h


diff --git a/engines/stark/gfx/openglprop.cpp b/engines/stark/gfx/openglprop.cpp
index 45f5d31f97..05d14a2ced 100644
--- a/engines/stark/gfx/openglprop.cpp
+++ b/engines/stark/gfx/openglprop.cpp
@@ -104,11 +104,11 @@ void OpenGLPropRenderer::render(const Math::Vector3d &position, float direction,
 				else
 					glColor3f(1.0f, 1.0f, 1.0f);
 				if (material.doubleSided) {
-					vertex.texS = vertex.texS;
-					vertex.texT = 1.0f - vertex.texT;
+					vertex.texS = vertex.stexS;
+					vertex.texT = 1.0f - vertex.stexT;
 				} else {
-					vertex.texS = 1.0f - vertex.texS;
-					vertex.texT = 1.0f - vertex.texT;
+					vertex.texS = 1.0f - vertex.stexS;
+					vertex.texT = 1.0f - vertex.stexT;
 				}
 			} else {
 				glBindTexture(GL_TEXTURE_2D, 0);
@@ -241,8 +241,8 @@ PropVertex *OpenGLPropRenderer::createFaceVBO() {
 		vertices[i].nx = modelVertices[i].normal.x();
 		vertices[i].ny = modelVertices[i].normal.y();
 		vertices[i].nz = modelVertices[i].normal.z();
-		vertices[i].texS = modelVertices[i].texturePosition.x();
-		vertices[i].texT = modelVertices[i].texturePosition.y();
+		vertices[i].stexS = modelVertices[i].texturePosition.x();
+		vertices[i].stexT = modelVertices[i].texturePosition.y();
 	}
 
 	return vertices;
diff --git a/engines/stark/gfx/openglprop.h b/engines/stark/gfx/openglprop.h
index 142e57528c..0ebf32081c 100644
--- a/engines/stark/gfx/openglprop.h
+++ b/engines/stark/gfx/openglprop.h
@@ -49,6 +49,8 @@ struct _PropVertex {
 	float nx;
 	float ny;
 	float nz;
+	float stexS;
+	float stexT;
 	float texS;
 	float texT;
 	float r;




More information about the Scummvm-git-logs mailing list