[Scummvm-git-logs] scummvm master -> 44de995bb6eb57633aec4bd558973163ecaaa780
rsn8887
rsn8887 at users.noreply.github.com
Mon Mar 6 15:57:26 CET 2017
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:
44de995bb6 SDL: Fix trying to init non-supported shaders (#917)
Commit: 44de995bb6eb57633aec4bd558973163ecaaa780
https://github.com/scummvm/scummvm/commit/44de995bb6eb57633aec4bd558973163ecaaa780
Author: rsn8887 (rsn8887 at users.noreply.github.com)
Date: 2017-03-06T08:57:21-06:00
Commit Message:
SDL: Fix trying to init non-supported shaders (#917)
Changed paths:
backends/graphics/psp2sdl/psp2sdl-graphics.cpp
backends/graphics/surfacesdl/surfacesdl-graphics.cpp
diff --git a/backends/graphics/psp2sdl/psp2sdl-graphics.cpp b/backends/graphics/psp2sdl/psp2sdl-graphics.cpp
index fa2adc8..b56f13e 100644
--- a/backends/graphics/psp2sdl/psp2sdl-graphics.cpp
+++ b/backends/graphics/psp2sdl/psp2sdl-graphics.cpp
@@ -87,20 +87,15 @@ PSP2SdlGraphicsManager::PSP2SdlGraphicsManager(SdlEventSource *sdlEventSource, S
}
_videoMode.aspectRatioCorrection = false;
- if (g_system->hasFeature(OSystem::kFeatureShader)) {
- // shader number 0 is the entry NONE (no shader)
- const OSystem::GraphicsMode *p = s_supportedShadersPSP2;
- _numShaders = 0;
- while (p->name) {
- _numShaders++;
- p++;
- }
- _currentShader = ConfMan.getInt("shader");
- if (_currentShader < 0 || _currentShader >= _numShaders) {
- _currentShader = 0;
- }
- } else {
- _numShaders = 1;
+ // shader number 0 is the entry NONE (no shader)
+ const OSystem::GraphicsMode *p = s_supportedShadersPSP2;
+ _numShaders = 0;
+ while (p->name) {
+ _numShaders++;
+ p++;
+ }
+ _currentShader = ConfMan.getInt("shader");
+ if (_currentShader < 0 || _currentShader >= _numShaders) {
_currentShader = 0;
}
diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
index 692602b..690e9a3 100644
--- a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
+++ b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
@@ -200,24 +200,12 @@ SurfaceSdlGraphicsManager::SurfaceSdlGraphicsManager(SdlEventSource *sdlEventSou
_videoMode.filtering = ConfMan.getBool("filtering");
#endif
- // Default backend does not have shaders. Disable check.
- // TODO: Implement more elegant way.
- if (0 && g_system->hasFeature(OSystem::kFeatureShader)) {
- // shader number 0 is the entry NONE (no shader)
- const OSystem::GraphicsMode *p = s_supportedShaders;
- _numShaders = 0;
- while (p->name) {
- _numShaders++;
- p++;
- }
- _currentShader = ConfMan.getInt("shader");
- if (_currentShader < 0 || _currentShader >= _numShaders) {
- _currentShader = 0;
- }
- } else {
- _numShaders = 1;
- _currentShader = 0;
- }
+ // the default backend has no shaders
+ // shader number 0 is the entry NONE (no shader)
+ // for an example on shader support,
+ // consult the psp2sdl backend which inherits from this class
+ _currentShader = 0;
+ _numShaders = 1;
}
SurfaceSdlGraphicsManager::~SurfaceSdlGraphicsManager() {
More information about the Scummvm-git-logs
mailing list