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

aquadran aquadran at gmail.com
Sun Oct 11 16:24:39 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:
cab7cd49c4 MORPHOS : Fixed for int vs int32 types for AmigaOS/MorphOS  (#2510)


Commit: cab7cd49c4e28d32fce77892303a0acd150b3c73
    https://github.com/scummvm/scummvm/commit/cab7cd49c4e28d32fce77892303a0acd150b3c73
Author: BeWorld (36823759+BeWorld2018 at users.noreply.github.com)
Date: 2020-10-11T18:24:36+02:00

Commit Message:
MORPHOS : Fixed for int vs int32 types for AmigaOS/MorphOS  (#2510)

MORPHOS : Fixed int to int32 and some functions not available on AmigaOS/MorphOS

Changed paths:
    backends/graphics3d/openglsdl/openglsdl-graphics3d.cpp
    engines/grim/gfx_opengl.cpp
    engines/myst3/gfx_opengl_texture.cpp
    engines/wintermute/ad/ad_actor_3dx.cpp
    engines/wintermute/base/gfx/base_renderer3d.h
    engines/wintermute/base/gfx/opengl/base_render_opengl3d.cpp
    engines/wintermute/base/gfx/opengl/base_surface_opengl3d.cpp
    engines/wintermute/base/gfx/opengl/meshx_opengl.cpp
    engines/wintermute/base/gfx/opengl/shadow_volume_opengl.cpp
    engines/wintermute/base/gfx/x/modelx.cpp
    engines/wintermute/base/gfx/x/modelx.h
    graphics/opengl/framebuffer.cpp
    graphics/opengl/framebuffer.h
    graphics/opengl/texture.cpp


diff --git a/backends/graphics3d/openglsdl/openglsdl-graphics3d.cpp b/backends/graphics3d/openglsdl/openglsdl-graphics3d.cpp
index b863dea9d8..c21f94e6ec 100644
--- a/backends/graphics3d/openglsdl/openglsdl-graphics3d.cpp
+++ b/backends/graphics3d/openglsdl/openglsdl-graphics3d.cpp
@@ -294,7 +294,7 @@ void OpenGLSdlGraphics3dManager::createOrUpdateScreen() {
 
 	_screenChangeCount++;
 
-#if !defined(AMIGAOS)
+#if !defined(AMIGAOS) && !defined(__MORPHOS__)
 	if (renderToFrameBuffer) {
 		glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
 		_frameBuffer = createFramebuffer(_engineRequestedWidth, _engineRequestedHeight);
@@ -537,7 +537,7 @@ void OpenGLSdlGraphics3dManager::drawOverlay() {
 	_surfaceRenderer->restorePreviousState();
 }
 
-#ifndef AMIGAOS
+#if !defined(AMIGAOS) && !defined(__MORPHOS__)
 OpenGL::FrameBuffer *OpenGLSdlGraphics3dManager::createFramebuffer(uint width, uint height) {
 #if !defined(USE_GLES2)
 	if (_antialiasing && OpenGLContext.framebufferObjectMultisampleSupported) {
diff --git a/engines/grim/gfx_opengl.cpp b/engines/grim/gfx_opengl.cpp
index 59438d7d5d..3ede494b83 100644
--- a/engines/grim/gfx_opengl.cpp
+++ b/engines/grim/gfx_opengl.cpp
@@ -1900,7 +1900,9 @@ void GfxOpenGL::drawEmergString(int x, int y, const char *text, const Color &fgC
 	glColor3f(1.0f, 1.0f, 1.0f);
 
 	glListBase(_emergFont);
-	glCallLists(strlen(text), GL_UNSIGNED_BYTE, (const GLubyte *)text);
+	
+	char *list = const_cast<char *>(text);
+	glCallLists(strlen(text), GL_UNSIGNED_BYTE, (void *)text);
 
 	glEnable(GL_LIGHTING);
 
diff --git a/engines/myst3/gfx_opengl_texture.cpp b/engines/myst3/gfx_opengl_texture.cpp
index e33c37f483..9be83e2866 100644
--- a/engines/myst3/gfx_opengl_texture.cpp
+++ b/engines/myst3/gfx_opengl_texture.cpp
@@ -109,11 +109,12 @@ void OpenGLTexture::updateTexture(const Graphics::Surface *surface, const Common
 		const Graphics::Surface subArea = surface->getSubArea(rect);
 
 		glPixelStorei(GL_UNPACK_ROW_LENGTH, surface->pitch / surface->format.bytesPerPixel);
-		glTexSubImage2D(GL_TEXTURE_2D, 0, rect.left, rect.top, subArea.w, subArea.h, internalFormat, sourceFormat, subArea.getPixels());
+		
+		glTexSubImage2D(GL_TEXTURE_2D, 0, rect.left, rect.top, subArea.w, subArea.h, internalFormat, sourceFormat, const_cast<void *>(subArea.getPixels()));
 		glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
 	} else {
 		// GL_UNPACK_ROW_LENGTH is not supported, don't bother and do a full texture update
-		glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, surface->w, surface->h, internalFormat, sourceFormat, surface->getPixels());
+		glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, surface->w, surface->h, internalFormat, sourceFormat, const_cast<void *>(surface->getPixels()));
 	}
 }
 
diff --git a/engines/wintermute/ad/ad_actor_3dx.cpp b/engines/wintermute/ad/ad_actor_3dx.cpp
index ba4f01e426..b167e4b2ad 100644
--- a/engines/wintermute/ad/ad_actor_3dx.cpp
+++ b/engines/wintermute/ad/ad_actor_3dx.cpp
@@ -191,7 +191,7 @@ bool AdActor3DX::update() {
 					Math::Matrix4 newWorldMat;
 					getMatrix(&newWorldMat, &newPos);
 
-					int newX, newY;
+					int32 newX, newY;
 					convert3DTo2D(&newWorldMat, &newX, &newY);
 					canWalk = !scene->isBlockedAt(newX, newY, false, this);
 				} else {
@@ -2441,7 +2441,7 @@ bool AdActor3DX::updatePartEmitter() {
 
 	Math::Vector3d bonePos;
 	getBonePosition3D(_partBone.c_str(), &bonePos, &_partOffset);
-	int x = 0, y = 0;
+	int32 x = 0, y = 0;
 	static_cast<AdGame *>(_gameRef)->_scene->_sceneGeometry->convert3Dto2D(&bonePos, &x, &y);
 
 	_partEmitter->_posX = x - _gameRef->_renderer->_drawOffsetX;
diff --git a/engines/wintermute/base/gfx/base_renderer3d.h b/engines/wintermute/base/gfx/base_renderer3d.h
index 6a7a761219..c3d8d7c950 100644
--- a/engines/wintermute/base/gfx/base_renderer3d.h
+++ b/engines/wintermute/base/gfx/base_renderer3d.h
@@ -88,7 +88,7 @@ public:
 	virtual void resetModelViewTransform() = 0;
 	virtual void setWorldTransform(const Math::Matrix4 &transform) = 0;
 
-	void project(const Math::Matrix4 &worldMatrix, const Math::Vector3d &point, int &x, int &y);
+	void project(const Math::Matrix4 &worldMatrix, const Math::Vector3d &point, int32 &x, int32 &y);
 	Math::Ray rayIntoScene(int x, int y);
 
 	Math::Matrix4 lastProjectionMatrix() {
diff --git a/engines/wintermute/base/gfx/opengl/base_render_opengl3d.cpp b/engines/wintermute/base/gfx/opengl/base_render_opengl3d.cpp
index 2e5dbb540c..a7ba20dcb3 100644
--- a/engines/wintermute/base/gfx/opengl/base_render_opengl3d.cpp
+++ b/engines/wintermute/base/gfx/opengl/base_render_opengl3d.cpp
@@ -213,8 +213,10 @@ 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
+	
 	glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
 
 	glDepthMask(true);
@@ -476,7 +478,7 @@ bool BaseRenderOpenGL3D::setup2D(bool force) {
 #if defined(__MINGW32__) && defined (SDL_BACKEND) && !defined(USE_GLEW)
 		glActiveTexturePtr(GL_TEXTURE0);
 #else
-		glActiveTexture(GL_TEXTURE0);
+		glActiveTextureARB(GL_TEXTURE0);
 #endif
 		glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE);
 		glTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_MODULATE);
@@ -489,16 +491,16 @@ bool BaseRenderOpenGL3D::setup2D(bool force) {
 #if defined(__MINGW32__) && defined (SDL_BACKEND) && !defined(USE_GLEW)
 		glActiveTexturePtr(GL_TEXTURE1);
 #else
-		glActiveTexture(GL_TEXTURE1);
+		glActiveTextureARB(GL_TEXTURE1);
 #endif
 		glDisable(GL_TEXTURE_2D);
 
 #if defined(__MINGW32__) && defined (SDL_BACKEND) && !defined(USE_GLEW)
 		glActiveTexturePtr(GL_TEXTURE0);
 #else
-		glActiveTexture(GL_TEXTURE0);
-
+		glActiveTextureARB(GL_TEXTURE0);
 #endif
+		
 		glViewport(0, 0, _width, _height);
 		setProjection2D();
 	}
@@ -722,7 +724,10 @@ bool BaseRenderOpenGL3D::drawSpriteEx(BaseSurfaceOpenGL3D &tex, const Wintermute
 	glEnableClientState(GL_VERTEX_ARRAY);
 	glEnableClientState(GL_TEXTURE_COORD_ARRAY);
 
+#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/base_surface_opengl3d.cpp b/engines/wintermute/base/gfx/opengl/base_surface_opengl3d.cpp
index d768627821..867110b88a 100644
--- a/engines/wintermute/base/gfx/opengl/base_surface_opengl3d.cpp
+++ b/engines/wintermute/base/gfx/opengl/base_surface_opengl3d.cpp
@@ -243,7 +243,7 @@ bool BaseSurfaceOpenGL3D::putSurface(const Graphics::Surface &surface, bool hasA
 	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
 	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
 	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, _texWidth, _texHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);
-	glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, _width, _height, GL_RGBA, GL_UNSIGNED_BYTE, surface.getPixels());
+	glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, _width, _height, GL_RGBA, GL_UNSIGNED_BYTE, const_cast<void *>(surface.getPixels()));
 	glBindTexture(GL_TEXTURE_2D, 0);
 	_valid = true;
 
diff --git a/engines/wintermute/base/gfx/opengl/meshx_opengl.cpp b/engines/wintermute/base/gfx/opengl/meshx_opengl.cpp
index af7368ad49..3acc8dd65d 100644
--- a/engines/wintermute/base/gfx/opengl/meshx_opengl.cpp
+++ b/engines/wintermute/base/gfx/opengl/meshx_opengl.cpp
@@ -69,8 +69,9 @@ bool MeshXOpenGL::render(ModelX *model) {
 			glDisable(GL_TEXTURE_2D);
 			glBindTexture(GL_TEXTURE_2D, 0);
 		}
-
+#ifndef __MORPHOS__
 		glInterleavedArrays(GL_T2F_N3F_V3F, 0, _vertexData);
+#endif
 		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 250ec868b8..26a72eeaa4 100644
--- a/engines/wintermute/base/gfx/opengl/shadow_volume_opengl.cpp
+++ b/engines/wintermute/base/gfx/opengl/shadow_volume_opengl.cpp
@@ -135,7 +135,9 @@ bool ShadowVolumeOpenGL::renderToScene() {
 	glDisableClientState(GL_TEXTURE_COORD_ARRAY);
 
 	// Draw a big, gray square
+#ifndef __MORPHOS__	
 	glInterleavedArrays(GL_C4UB_V3F, 0, _shadowMask);
+#endif
 	glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
 
 	// Restore render states
diff --git a/engines/wintermute/base/gfx/x/modelx.cpp b/engines/wintermute/base/gfx/x/modelx.cpp
index b77fd0b3c3..b2aaccc900 100644
--- a/engines/wintermute/base/gfx/x/modelx.cpp
+++ b/engines/wintermute/base/gfx/x/modelx.cpp
@@ -588,7 +588,7 @@ void ModelX::updateBoundingRect() {
 }
 
 //////////////////////////////////////////////////////////////////////////
-void ModelX::updateRect(Rect32 *rc, int x, int y) {
+void ModelX::updateRect(Rect32 *rc, int32 x, int32 y) {
 	rc->left   = MIN(rc->left, x);
 	rc->right  = MAX(rc->right, x);
 	rc->top    = MIN(rc->top, y);
diff --git a/engines/wintermute/base/gfx/x/modelx.h b/engines/wintermute/base/gfx/x/modelx.h
index ea1db982ad..674ad8a4ea 100644
--- a/engines/wintermute/base/gfx/x/modelx.h
+++ b/engines/wintermute/base/gfx/x/modelx.h
@@ -193,7 +193,7 @@ private:
 	void parseFrameDuringMerge(XFileLexer &lexer, const Common::String &filename);
 
 	void updateBoundingRect();
-	void static inline updateRect(Rect32 *rc, int x, int y);
+	void static inline updateRect(Rect32 *rc, int32 x, int32 y);
 	Rect32 _drawingViewport;
 	Math::Matrix4 _lastViewMat;
 	Math::Matrix4 _lastProjMat;
diff --git a/graphics/opengl/framebuffer.cpp b/graphics/opengl/framebuffer.cpp
index 5cbd8b6f7b..939fc2a21f 100644
--- a/graphics/opengl/framebuffer.cpp
+++ b/graphics/opengl/framebuffer.cpp
@@ -23,7 +23,7 @@
 #include "common/textconsole.h"
 #include "common/util.h"
 
-#if defined(USE_OPENGL_GAME) && !defined(AMIGAOS)
+#if defined(USE_OPENGL_GAME) && !defined(AMIGAOS) && !defined(__MORPHOS__)
 
 #if defined(SDL_BACKEND) && !defined(USE_GLEW) && !defined(USE_GLES2)
 #define GL_GLEXT_PROTOTYPES // For the GL_EXT_framebuffer_object extension
@@ -188,7 +188,7 @@ void FrameBuffer::detach() {
 	glBindFramebuffer(GL_FRAMEBUFFER, 0);
 }
 
-#if !defined(USE_GLES2) && !defined(AMIGAOS)
+#if !defined(USE_GLES2) && !defined(AMIGAOS) && !defined(__MORPHOS__)
 MultiSampleFrameBuffer::MultiSampleFrameBuffer(uint width, uint height, int samples)
 		: FrameBuffer(width,height) {
 	if (!OpenGLContext.framebufferObjectMultisampleSupported) {
@@ -251,7 +251,7 @@ void MultiSampleFrameBuffer::detach() {
 	glBindFramebuffer(GL_FRAMEBUFFER, 0);
 }
 
-#endif // !defined(USE_GLES2) && !defined(AMIGAOS)
+#endif // !defined(USE_GLES2) && !defined(AMIGAOS) && !defined(__MORPHOS__)
 
 } // End of namespace OpenGL
 
diff --git a/graphics/opengl/framebuffer.h b/graphics/opengl/framebuffer.h
index 8f516d438f..0f8383b1c7 100644
--- a/graphics/opengl/framebuffer.h
+++ b/graphics/opengl/framebuffer.h
@@ -32,7 +32,7 @@ class FrameBuffer : public TextureGL {
 public:
 	FrameBuffer(uint width, uint height);
 	FrameBuffer(GLuint texture_name, uint width, uint height, uint texture_width, uint texture_height);
-#ifdef AMIGAOS
+#if defined(AMIGAOS) || defined(__MORPHOS__)
 	virtual ~FrameBuffer() {}
 
 	void attach() {}
@@ -53,7 +53,7 @@ private:
 	GLuint _frameBuffer;
 };
 
-#if !defined(USE_GLES2) && !defined(AMIGAOS)
+#if !defined(USE_GLES2) && !defined(AMIGAOS) && !defined(__MORPHOS__)
 class MultiSampleFrameBuffer : public FrameBuffer {
 public:
 	MultiSampleFrameBuffer(uint width, uint height, int samples);
diff --git a/graphics/opengl/texture.cpp b/graphics/opengl/texture.cpp
index 89cac50a20..0ea8d17cbe 100644
--- a/graphics/opengl/texture.cpp
+++ b/graphics/opengl/texture.cpp
@@ -103,7 +103,7 @@ TextureGL::TextureGL(const Graphics::Surface &srf) :
 	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
 	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
 	glTexImage2D(GL_TEXTURE_2D, 0, format, _texWidth, _texHeight, 0, format, type, 0);
-	glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, _width, _height, format, type, surfaceToUpload->getPixels());
+	glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, _width, _height, format, type, const_cast<void *>(surfaceToUpload->getPixels()));
 
 	if (OpenGLContext.unpackSubImageSupported) {
 		glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);




More information about the Scummvm-git-logs mailing list