[Scummvm-git-logs] scummvm master -> db89c680a10df26e0eef33ac4b9fb71fc8ad64d0
aquadran
aquadran at gmail.com
Thu Oct 22 14:43:25 UTC 2020
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:
db89c680a1 WINTERMUTE: Replace glInterleavedArrays calls
Commit: db89c680a10df26e0eef33ac4b9fb71fc8ad64d0
https://github.com/scummvm/scummvm/commit/db89c680a10df26e0eef33ac4b9fb71fc8ad64d0
Author: PaweÅ KoÅodziejski (aquadran at users.sourceforge.net)
Date: 2020-10-22T16:43:15+02:00
Commit Message:
WINTERMUTE: Replace glInterleavedArrays calls
Changed paths:
engines/wintermute/base/gfx/opengl/base_render_opengl3d.cpp
engines/wintermute/base/gfx/opengl/meshx_opengl.cpp
engines/wintermute/base/gfx/opengl/shadow_volume_opengl.cpp
diff --git a/engines/wintermute/base/gfx/opengl/base_render_opengl3d.cpp b/engines/wintermute/base/gfx/opengl/base_render_opengl3d.cpp
index e602fd894b..ca25aa0b04 100644
--- a/engines/wintermute/base/gfx/opengl/base_render_opengl3d.cpp
+++ b/engines/wintermute/base/gfx/opengl/base_render_opengl3d.cpp
@@ -213,10 +213,14 @@ void BaseRenderOpenGL3D::displayShadow(BaseObject *object, const Math::Vector3d
glEnable(GL_TEXTURE_2D);
static_cast<BaseSurfaceOpenGL3D *>(shadowImage)->setTexture();
- #ifndef __MORPHOS__
- glInterleavedArrays(GL_T2F_N3F_V3F, 0, _simpleShadow);
- #endif
-
+ glEnableClientState(GL_VERTEX_ARRAY);
+ glEnableClientState(GL_NORMAL_ARRAY);
+ glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+
+ glVertexPointer(3, GL_FLOAT, sizeof(SimpleShadowVertex), &_simpleShadow[0].x);
+ glNormalPointer(GL_FLOAT, sizeof(SimpleShadowVertex), &_simpleShadow[0].nx);
+ glTexCoordPointer(2, GL_FLOAT, sizeof(SimpleShadowVertex), &_simpleShadow[0].u);
+
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
glDepthMask(true);
@@ -721,11 +725,12 @@ bool BaseRenderOpenGL3D::drawSpriteEx(BaseSurfaceOpenGL3D &tex, const Wintermute
glEnableClientState(GL_COLOR_ARRAY);
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+ glDisableClientState(GL_NORMAL_ARRAY);
+
+ glVertexPointer(3, GL_FLOAT, sizeof(SpriteVertex), &vertices[0].x);
+ glTexCoordPointer(2, GL_FLOAT, sizeof(SpriteVertex), &vertices[0].u);
+ glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(SpriteVertex), &vertices[0].r);
-#ifndef __MORPHOS__
- glInterleavedArrays(GL_T2F_C4UB_V3F, 0, vertices);
-#endif
-
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
if (alphaDisable) {
diff --git a/engines/wintermute/base/gfx/opengl/meshx_opengl.cpp b/engines/wintermute/base/gfx/opengl/meshx_opengl.cpp
index 6381e52d75..3dd2bc253d 100644
--- a/engines/wintermute/base/gfx/opengl/meshx_opengl.cpp
+++ b/engines/wintermute/base/gfx/opengl/meshx_opengl.cpp
@@ -69,9 +69,15 @@ bool MeshXOpenGL::render(ModelX *model) {
glDisable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, 0);
}
-#ifndef __MORPHOS__
- glInterleavedArrays(GL_T2F_N3F_V3F, 0, _vertexData);
-#endif
+
+ glEnableClientState(GL_VERTEX_ARRAY);
+ glEnableClientState(GL_NORMAL_ARRAY);
+ glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+
+ glVertexPointer(3, GL_FLOAT, kVertexComponentCount * sizeof(float), _vertexData + kPositionOffset);
+ glNormalPointer(GL_FLOAT, kVertexComponentCount * sizeof(float), _vertexData + kNormalOffset);
+ glTexCoordPointer(2, GL_FLOAT, kVertexComponentCount * sizeof(float), _vertexData + kTextureCoordOffset);
+
glDrawElements(GL_TRIANGLES, _indexRanges[i + 1] - _indexRanges[i], GL_UNSIGNED_SHORT, _indexData.data() + _indexRanges[i]);
}
diff --git a/engines/wintermute/base/gfx/opengl/shadow_volume_opengl.cpp b/engines/wintermute/base/gfx/opengl/shadow_volume_opengl.cpp
index 6859c883de..163ac89620 100644
--- a/engines/wintermute/base/gfx/opengl/shadow_volume_opengl.cpp
+++ b/engines/wintermute/base/gfx/opengl/shadow_volume_opengl.cpp
@@ -133,11 +133,12 @@ bool ShadowVolumeOpenGL::renderToScene() {
glEnableClientState(GL_COLOR_ARRAY);
glEnableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
+ glDisableClientState(GL_NORMAL_ARRAY);
// Draw a big, gray square
-#ifndef __MORPHOS__
- glInterleavedArrays(GL_C4UB_V3F, 0, _shadowMask);
-#endif
+ glVertexPointer(3, GL_FLOAT, sizeof(ShadowVertex), &_shadowMask[0].x);
+ glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(ShadowVertex), &_shadowMask[0].r);
+
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
// Restore render states
More information about the Scummvm-git-logs
mailing list