aboutsummaryrefslogtreecommitdiff
path: root/graphics/thumbnail.cpp
AgeCommit message (Collapse)Author
2018-04-07ALL: Load savegame thumbnail only when necessaryAdrian Frühwirth
This commit introduces the following changes: 1. Graphics::loadThumbnail() Now returns a boolean and takes a new argument skipThumbnail which defaults to false. In case of true, loadThumbnail() reads past the thumbnail data in the input stream instead of actually loading the thumbnail. This simplifies savegame handling where, up until now, many engines always read the whole savegame metadata (including the thumbnail) and then threw away the thumbnail when not needed (which is in almost all cases, the most common exception being MetaEngine::querySaveMetaInfos() which is responsible for loading savegame metadata for displaying it in the GUI launcher. 2. readSavegameHeader() Engines which already implement such a method (name varies) now take a new argument skipThumbnail (default: true) which is passed through to loadThumbnail(). This means that the default case for readSavegameHeader() is now _not_ loading the thumbnail from a savegame and just reading past it. In those cases, e.g. querySaveMetaInfos(), where we actually are interested in loading the thumbnail readSavegameHeader() needs to explicitely be called with skipThumbnail == false. Engines whose readSavegameHeader() (name varies) already takes an argument loadThumbnail have been adapted to have a similar prototype and semantics. I.e. readSaveHeader(in, loadThumbnail, header) now is readSaveHeader(in, header, skipThumbnail). 3. Error handling Engines which previously did not check the return value of readSavegameHeader() (name varies) now do so ensuring that possibly broken savegames (be it a broken thumbnail or something else) don't make it into the GUI launcher list in the first place.
2016-02-15JANITORIAL: Typos detected with lintian & grepAlexandre Detiste
2014-02-18GRAPHICS: Make GPL headers consistent in themselves.Johannes Schickel
2013-07-12GRAPHICS: Be more robust with broken/unsupported thumbnail headers.Johannes Schickel
This fixes future issues like bug #3614654: "ALL: ScummVM 1.5.0 can't read newer saved games". There are a few behavior changes introduced with this commit: - checkThumbnailHeader will now also report the presence of unsupported/broken (but skippable) headers. - skipThumbnail will also try to skip the data for broken/unsupported thumbnail data. - loadThumbnail will skip over broken/unsupported thumbnail data but still return 0 in this case.
2013-05-17RECORDER: Implement Events RecorderEugene Sandulenko
2012-07-14GRAPHICS: Serialize PixelFormat for thumbnails and allow 4Bpp surfaces.Johannes Schickel
This allows any 2Bpp/4Bpp Surfaces to be written via saveThumbnail and loadThumbnail now. It furthermore will preserve the loaded Surface in loadThumbnail.
2011-08-07GRAPHICS: Slight formatting fix.Johannes Schickel
2011-08-07GRAPHICS: Simplify the interface of Graphics::loadThumbnail().Christoph Mallon
Now it returns the Surface, so the caller does not need to create one and pass it.
2011-08-07JANITORIAL: Remove trailing empty lines.Christoph Mallon
2011-05-12GIT: Clean up: Suppress SVN tags, now uselessstrangerke
2011-05-01Merge pull request #16 "Add a PixelFormat to Graphics::Surface.".Johannes Schickel
For further discussion check here: https://github.com/scummvm/scummvm/pull/16 Conflicts: graphics/png.cpp
2011-04-28JANITORIAL: Reduce header dependencies in shared codeOri Avtalion
Some backends may break as I only compiled SDL
2011-04-17GRPAHICS: Do not access Surface::bytesPerPixel anymore.Johannes Schickel
2011-04-17GRAPHICS: Prefer Surface::create taking a PixelFormat over the one taking a ↵Johannes Schickel
byte depth.
2011-04-12COMMON: Replace MKID_BE by MKTAGMax Horn
MKID_BE relied on unspecified behavior of the C++ compiler, and as such was always a bit unsafe. The new MKTAG macro is slightly less elegant, but does no longer depend on the behavior of the compiler. Inspired by FFmpeg, which has an almost identical macro.
2010-11-19ALL: Push down deps on stream.h from .h to .cpp filesMax Horn
svn-id: r54358
2010-08-02GRAPHICS: Renamed skipThumbnailHeader to skipThumbnail.Johannes Schickel
svn-id: r51668
2009-10-04Change a couple places from 'end of namespace' to 'End of namespace', for ↵Max Horn
consistency svn-id: r44634
2009-01-22Moved Graphics::PixelFormat into its own header file; turned RGBToColor etc. ↵Max Horn
into methods, and added an operator== svn-id: r35993
2008-12-22Fixed indentation and removed whitespaces at the end of lineJordi Vilalta Prat
svn-id: r35481
2008-11-06Got rid of OSystem::colorToRGB and RGBToColor; added implementations for ↵Max Horn
OSystem::getOverlayFormat to several ports (pending testing by the porters) svn-id: r34912
2008-08-20- Committed Max' compressed save backseeking support from patch #2050337 ↵Johannes Schickel
"KYRA/SCUMM: Thumbnail support/improvement" - Extended SCUMM engine to support savegames without thumbnail header. (Increased savegame version to prevent saves to be loaded from older ScummVM versions) - Fixed KYRA to properly support savegames without thumbnail header. svn-id: r34054
2008-08-20Committed patch #2050337 "KYRA/SCUMM: Thumbnail support/improvement". ↵Johannes Schickel
(Without Max' compressed backward seeking support for now) svn-id: r34053