[Scummvm-cvs-logs] SF.net SVN: scummvm:[50842] scummvm/branches/gsoc2010-opengl/backends
vgvgf at users.sourceforge.net
vgvgf at users.sourceforge.net
Tue Jul 13 07:38:10 CEST 2010
Revision: 50842
http://scummvm.svn.sourceforge.net/scummvm/?rev=50842&view=rev
Author: vgvgf
Date: 2010-07-13 05:38:10 +0000 (Tue, 13 Jul 2010)
Log Message:
-----------
Check if USE_OPENGL is defined for compiling OpenGL code.
Modified Paths:
--------------
scummvm/branches/gsoc2010-opengl/backends/graphics/opengl/glerrorcheck.cpp
scummvm/branches/gsoc2010-opengl/backends/graphics/opengl/gltexture.cpp
scummvm/branches/gsoc2010-opengl/backends/graphics/opengl/opengl-graphics.cpp
scummvm/branches/gsoc2010-opengl/backends/graphics/opengl/opengl-graphics.h
scummvm/branches/gsoc2010-opengl/backends/graphics/openglsdl/openglsdl-graphics.cpp
scummvm/branches/gsoc2010-opengl/backends/platform/sdl/sdl.cpp
Modified: scummvm/branches/gsoc2010-opengl/backends/graphics/opengl/glerrorcheck.cpp
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/graphics/opengl/glerrorcheck.cpp 2010-07-13 04:57:31 UTC (rev 50841)
+++ scummvm/branches/gsoc2010-opengl/backends/graphics/opengl/glerrorcheck.cpp 2010-07-13 05:38:10 UTC (rev 50842)
@@ -23,7 +23,7 @@
*
*/
-#if defined(DEBUG) //&& defined(USE_OPENGL)
+#if defined(DEBUG) && defined(USE_OPENGL)
#include "backends/graphics/opengl/glerrorcheck.h"
#include "common/debug.h"
Modified: scummvm/branches/gsoc2010-opengl/backends/graphics/opengl/gltexture.cpp
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/graphics/opengl/gltexture.cpp 2010-07-13 04:57:31 UTC (rev 50841)
+++ scummvm/branches/gsoc2010-opengl/backends/graphics/opengl/gltexture.cpp 2010-07-13 05:38:10 UTC (rev 50842)
@@ -23,6 +23,8 @@
*
*/
+#ifdef USE_OPENGL
+
#include "backends/graphics/opengl/gltexture.h"
#include "backends/graphics/opengl/glerrorcheck.h"
@@ -175,3 +177,5 @@
assert(ARRAYSIZE(vertices) == ARRAYSIZE(texcoords));
CHECK_GL_ERROR( glDrawArrays(GL_TRIANGLE_STRIP, 0, ARRAYSIZE(vertices) / 2) );
}
+
+#endif
Modified: scummvm/branches/gsoc2010-opengl/backends/graphics/opengl/opengl-graphics.cpp
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/graphics/opengl/opengl-graphics.cpp 2010-07-13 04:57:31 UTC (rev 50841)
+++ scummvm/branches/gsoc2010-opengl/backends/graphics/opengl/opengl-graphics.cpp 2010-07-13 05:38:10 UTC (rev 50842)
@@ -23,8 +23,11 @@
*
*/
+#ifdef USE_OPENGL
+
#include "backends/graphics/opengl/opengl-graphics.h"
#include "common/mutex.h"
+#include "common/translation.h"
OpenGLGraphicsManager::OpenGLGraphicsManager()
:
@@ -41,7 +44,7 @@
memset(&_videoMode, 0, sizeof(_videoMode));
memset(&_transactionDetails, 0, sizeof(_transactionDetails));
- _videoMode.mode = GFX_NORMAL;
+ _videoMode.mode = OpenGL::GFX_NORMAL;
_videoMode.scaleFactor = 1;
_videoMode.fullscreen = false;
}
@@ -91,7 +94,11 @@
//
static const OSystem::GraphicsMode s_supportedGraphicsModes[] = {
- {"1x", "Normal", GFX_NORMAL},
+ {"gl1x", _s("OpenGL Normal (no scaling)"), OpenGL::GFX_NORMAL},
+#ifdef USE_SCALERS
+ {"gl2x", "OpenGL 2x", OpenGL::GFX_DOUBLESIZE},
+ {"gl3x", "OpenGL 3x", OpenGL::GFX_TRIPLESIZE},
+#endif
{0, 0, 0}
};
@@ -100,7 +107,7 @@
}
int OpenGLGraphicsManager::getDefaultGraphicsMode() const {
- return GFX_NORMAL;
+ return OpenGL::GFX_NORMAL;
}
bool OpenGLGraphicsManager::setGraphicsMode(int mode) {
@@ -108,7 +115,7 @@
}
int OpenGLGraphicsManager::getGraphicsMode() const {
- return GFX_NORMAL;
+ return OpenGL::GFX_NORMAL;
}
#ifdef USE_RGB_COLOR
@@ -496,3 +503,5 @@
bool OpenGLGraphicsManager::hotswapGFXMode() {
return false;
}
+
+#endif
Modified: scummvm/branches/gsoc2010-opengl/backends/graphics/opengl/opengl-graphics.h
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/graphics/opengl/opengl-graphics.h 2010-07-13 04:57:31 UTC (rev 50841)
+++ scummvm/branches/gsoc2010-opengl/backends/graphics/opengl/opengl-graphics.h 2010-07-13 05:38:10 UTC (rev 50842)
@@ -29,10 +29,16 @@
#include "backends/graphics/opengl/gltexture.h"
#include "backends/graphics/graphics.h"
+namespace OpenGL {
+
enum {
- GFX_NORMAL = 0
+ GFX_NORMAL = 0,
+ GFX_DOUBLESIZE = 1,
+ GFX_TRIPLESIZE = 2
};
+}
+
/**
* Open GL graphics manager
*/
Modified: scummvm/branches/gsoc2010-opengl/backends/graphics/openglsdl/openglsdl-graphics.cpp
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/graphics/openglsdl/openglsdl-graphics.cpp 2010-07-13 04:57:31 UTC (rev 50841)
+++ scummvm/branches/gsoc2010-opengl/backends/graphics/openglsdl/openglsdl-graphics.cpp 2010-07-13 05:38:10 UTC (rev 50842)
@@ -23,6 +23,8 @@
*
*/
+#ifdef USE_OPENGL
+
#include "backends/graphics/openglsdl/openglsdl-graphics.h"
OpenGLSdlGraphicsManager::OpenGLSdlGraphicsManager()
@@ -186,3 +188,5 @@
void OpenGLSdlGraphicsManager::internUpdateScreen() {
}
+
+#endif
Modified: scummvm/branches/gsoc2010-opengl/backends/platform/sdl/sdl.cpp
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/platform/sdl/sdl.cpp 2010-07-13 04:57:31 UTC (rev 50841)
+++ scummvm/branches/gsoc2010-opengl/backends/platform/sdl/sdl.cpp 2010-07-13 05:38:10 UTC (rev 50842)
@@ -32,8 +32,10 @@
#include "backends/events/sdl/sdl-events.h"
#include "backends/mutex/sdl/sdl-mutex.h"
#include "backends/timer/sdl/sdl-timer.h"
-//#include "backends/graphics/sdl/sdl-graphics.h"
+#include "backends/graphics/sdl/sdl-graphics.h"
+#ifdef USE_OPENGL
#include "backends/graphics/openglsdl/openglsdl-graphics.h"
+#endif
#include "icons/scummvm.xpm"
@@ -84,11 +86,31 @@
}
if (_graphicsManager == 0) {
- // Changed to OpenGL for testing
- //_graphicsManager = new SdlGraphicsManager();
+#ifdef USE_OPENGL
+ /*if (ConfMan.hasKey("gfx_mode")) {
+ Common::String gfxMode(ConfMan.get("gfx_mode"));
+
+ _openglGraphicsMode = OpenGLSdlGraphicsManager::getSupportedGraphicsModes();
+
+ bool use_opengl = false;
+
+ while (_openglGraphicsMode->name) {
+ if (scumm_stricmp(_openglGraphicsMode->name, gfxMode.c_str()) == 0)
+ use_opengl = true;
+
+ _openglGraphicsMode++;
+ }
+
+ if (use_opengl) {
+ _graphicsManager = new OpenGLSdlGraphicsManager();
+ ((OpenGLSdlGraphicsManager *)_graphicsManager)->init();
+ }
+ }*/
_graphicsManager = new OpenGLSdlGraphicsManager();
-
((OpenGLSdlGraphicsManager *)_graphicsManager)->init();
+#endif
+ if (_graphicsManager == 0)
+ _graphicsManager = new SdlGraphicsManager();
}
if (_audiocdManager == 0)
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