[Scummvm-cvs-logs] SF.net SVN: scummvm:[54829] scummvm/trunk/backends/graphics/opengl/ opengl-graphics.cpp

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Wed Dec 8 02:35:55 CET 2010


Revision: 54829
          http://scummvm.svn.sourceforge.net/scummvm/?rev=54829&view=rev
Author:   lordhoto
Date:     2010-12-08 01:35:54 +0000 (Wed, 08 Dec 2010)

Log Message:
-----------
OPENGL: Disable OSD support for now.

I added an comment explaining why OSD is broken currently. The basic problem is
that OpenGL is not thread safe, thus in case we try to display any message on
the OSD from the sound thread for example it will result in crashes.

Modified Paths:
--------------
    scummvm/trunk/backends/graphics/opengl/opengl-graphics.cpp

Modified: scummvm/trunk/backends/graphics/opengl/opengl-graphics.cpp
===================================================================
--- scummvm/trunk/backends/graphics/opengl/opengl-graphics.cpp	2010-12-08 01:35:34 UTC (rev 54828)
+++ scummvm/trunk/backends/graphics/opengl/opengl-graphics.cpp	2010-12-08 01:35:54 UTC (rev 54829)
@@ -596,7 +596,26 @@
 //
 
 void OpenGLGraphicsManager::displayMessageOnOSD(const char *msg) {
-	assert (_transactionMode == kTransactionNone);
+	// TODO: Fix OSD support.
+	//
+	// Actually we have nice OSD support for the OpenGL backend, but
+	// since the OpenGL context/resources are not shared between threads we
+	// can not use this here.
+	//
+	// A possible way of making the code crash hard is to use the MT-32 emu.
+	// Whenever there is some message send to the OSD from the emulator's
+	// sound thread the glBindTexture call inside _osdTexture->updateBuffer
+	// will result in a crash.
+	//
+	// To try it out just uncomment the below code and start up any game which
+	// prints some info on the MT-32 display. Whenever the message should be
+	// displayed it will crash hard.
+	//
+	// We can not even use a GUI dialog here, since that would also result in
+	// an change of the overlay surface and thus result in the same problem
+	// just in another place.
+	warning("OpenGL: OSD messsage \"%s\" suppressed", msg);
+	/*assert(_transactionMode == kTransactionNone);
 	assert(msg);
 
 	// The font we are going to use:
@@ -661,7 +680,7 @@
 
 	// Init the OSD display parameters, and the fade out
 	_osdAlpha = kOSDInitialAlpha;
-	_osdFadeStartTime = g_system->getMillis() + kOSDFadeOutDelay;
+	_osdFadeStartTime = g_system->getMillis() + kOSDFadeOutDelay;*/
 }
 
 //


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list