SDL: Improve debug and warning messages when saving screenshots
In particular this adds a warning when failing to save a screenshot in OpenGL mode (there was already one in SurfaceSDL mode).
This commit is contained in:
parent
e96c057c3d
commit
a9ae691513
4 changed files with 30 additions and 9 deletions
|
@ -1302,7 +1302,7 @@ const Graphics::Font *OpenGLGraphicsManager::getFontOSD() {
|
|||
}
|
||||
#endif
|
||||
|
||||
void OpenGLGraphicsManager::saveScreenshot(const Common::String &filename) const {
|
||||
bool OpenGLGraphicsManager::saveScreenshot(const Common::String &filename) const {
|
||||
const uint width = _outputScreenWidth;
|
||||
const uint height = _outputScreenHeight;
|
||||
|
||||
|
@ -1332,7 +1332,10 @@ void OpenGLGraphicsManager::saveScreenshot(const Common::String &filename) const
|
|||
|
||||
// Open file
|
||||
Common::DumpFile out;
|
||||
out.open(filename);
|
||||
if (!out.open(filename)) {
|
||||
delete[] pixels;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Write BMP header
|
||||
out.writeByte('B');
|
||||
|
@ -1357,6 +1360,7 @@ void OpenGLGraphicsManager::saveScreenshot(const Common::String &filename) const
|
|||
|
||||
// Free allocated memory
|
||||
delete[] pixels;
|
||||
return true;
|
||||
}
|
||||
|
||||
} // End of namespace OpenGL
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue