[Scummvm-git-logs] scummvm master -> 48c23c6495f0a1b7b4078f3e8b5f5397b8f3367e

grisenti noreply at scummvm.org
Tue Jan 24 14:11:50 UTC 2023


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:
48c23c6495 HPL1: improve opengl error log


Commit: 48c23c6495f0a1b7b4078f3e8b5f5397b8f3367e
    https://github.com/scummvm/scummvm/commit/48c23c6495f0a1b7b4078f3e8b5f5397b8f3367e
Author: grisenti (emanuele at grisenti.net)
Date: 2023-01-24T15:11:36+01:00

Commit Message:
HPL1: improve opengl error log

Changed paths:
    engines/hpl1/opengl.cpp
    engines/hpl1/opengl.h


diff --git a/engines/hpl1/opengl.cpp b/engines/hpl1/opengl.cpp
index ebb540bd54a..39b20706c48 100644
--- a/engines/hpl1/opengl.cpp
+++ b/engines/hpl1/opengl.cpp
@@ -32,19 +32,19 @@ namespace Hpl1 {
 static const char* getErrorString(const GLenum code) {
 	switch (code) {
 	case GL_INVALID_ENUM:
-		return "invalid enum";
+		return "GL_INVALID_ENUM";
 	case GL_INVALID_VALUE:
-		return "invalid value";
+		return "GL_INVALID_VALUE";
 	case GL_INVALID_OPERATION:
-		return "invalid operation";
+		return "GL_INVALID_OPERATION";
 	}
 	return "unrecognized error";
 }
 
-void checkOGLErrors(const char *function, const int line) {
+void checkOGLErrors(const char *function, const char *file, int line) {
 	GLenum code;
 	while((code = glGetError()) != GL_NO_ERROR)
-		logError(kDebugOpenGL, "Opengl error: \'%s\' in function %s - %d\n", getErrorString(code), function, line);
+		logError(kDebugOpenGL, "Opengl error: \'%s\' in function %s (%s:%d)\n", getErrorString(code), function, file, line);
 }
 
 
diff --git a/engines/hpl1/opengl.h b/engines/hpl1/opengl.h
index 1d26a105725..0971f0a1633 100644
--- a/engines/hpl1/opengl.h
+++ b/engines/hpl1/opengl.h
@@ -37,14 +37,14 @@ struct Surface;
 
 namespace Hpl1 {
 
-void checkOGLErrors(const char *function, int line);
+void checkOGLErrors(const char *function, const char *file, int line);
 
 Common::ScopedPtr<Graphics::Surface> createGLViewportScreenshot();
 
 }
 
-#define GL_CHECK(x) {x; ::Hpl1::checkOGLErrors(__func__, __LINE__);}
-#define GL_CHECK_FN() {::Hpl1::checkOGLErrors(__func__, __LINE__);}
+#define GL_CHECK(x) {x; ::Hpl1::checkOGLErrors(__func__, __FILE__, __LINE__);}
+#define GL_CHECK_FN() {::Hpl1::checkOGLErrors(__func__, __FILE__, __LINE__);}
 
 #endif // USE_OPENGL
 #endif // HPL1_OPENGL_H




More information about the Scummvm-git-logs mailing list