MYST3: Implemented selection between hardware and software rendering.

Conflicts:
	engines/myst3/gfx_opengl.cpp
This commit is contained in:
Stefano Musumeci 2014-06-21 20:07:28 +02:00
parent 79ddb89ffe
commit 7ea5229ef8
4 changed files with 16 additions and 3 deletions

View File

@ -102,6 +102,9 @@ protected:
Common::Rect getFontCharacterRect(uint8 character);
};
Renderer *CreateGfxOpenGL(OSystem *system);
Renderer *CreateGfxTinyGL(OSystem *system);
} // end of namespace Myst3
#endif /* GFX_H_ */

View File

@ -87,6 +87,10 @@ static const GLfloat faceTextureCoords[] = {
1.0f, 0.0f,
};
Renderer *CreateGfxOpenGL(OSystem *system) {
return new OpenGLRenderer(system);
}
OpenGLRenderer::OpenGLRenderer(OSystem *system) :
BaseRenderer(system),
_nonPowerOfTwoTexSupport(false) {

View File

@ -44,7 +44,7 @@
namespace Myst3 {
Renderer *Renderer::createRenderer(OSystem *system) {
Renderer *CreateGfxTinyGL(OSystem *system) {
return new TinyGLRenderer(system);
}

View File

@ -149,7 +149,13 @@ Common::Error Myst3Engine::run() {
return Common::kUserCanceled;
}
_gfx = Renderer::createRenderer(_system);
bool softRenderer = ConfMan.getBool("soft_renderer");
if (softRenderer) {
_gfx = CreateGfxTinyGL(_system);
} else {
_gfx = CreateGfxOpenGL(_system);
}
_sound = new Sound(this);
_ambient = new Ambient(this);
_rnd = new Common::RandomSource("sprint");
@ -161,7 +167,7 @@ Common::Error Myst3Engine::run() {
_menu = new Menu(this);
_archiveNode = new Archive();
Graphics::PixelBuffer screenBuffer = _system->setupScreen(w, h, false, false);
Graphics::PixelBuffer screenBuffer = _system->setupScreen(w, h, false, softRenderer == false);
_system->showMouse(false);
openArchives();