Commit Graph
54 Commits
Author SHA1 Message Date
Adrian Frühwirth 00e59a3122 ALL: Load savegame thumbnail only when necessary
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.
2018-04-07 09:26:20 +02:00
Colin Snover d087c9605f BASE: Remove bad casts between incompatible Plugin types
Previously, a C-style cast was used to convert a
Common::Array<Plugin *>, populated with pointers to StaticPlugin
and DynamicPlugin instances, to a
Common::Array<PluginSubclass<T> *>, but PluginSubclass<T> is a
*sibling* class to StaticPlugin/DynamicPlugin, so this cast was
invalid and the results undefined. The methods for retrieving
subclasses of plugins can't be easily changed to just generate an
array of temporary wrapper objects that expose an identical API
which dereferences to the preferred PluginObject subclass because
pointers to these objects are retained by other parts of ScummVM,
so the wrappers would needed to be persisted or they would need to
just re-expose the underlying Plugin object again. This indicated
that a way to solve this problem is to have the callers receive
Plugin objects and get the PluginObject from the Plugin by
explicitly stating their desired type, in a similar manner to
std::get(std::variant), so that the pattern used by this patch to
solve the problem.

Closes gh-1051.
2017-12-03 20:26:38 -06:00
Ori Avtalion 21753098e1 NEVERHOOD: Reduce audio header dependencies 2016-05-21 13:44:27 +03:00
Torbjörn Andersson 1f06e3f557 NEVERHOOD: Avoid crash in original load/delete game dialogs
The original game would display a message if you tried to load or
delete a game without actually selecting one. At least for now,
let's just avoid crashing.
2016-04-15 07:29:43 +02:00
Torbjörn Andersson fc55a8fb1a NEVERHOOD: Fix bug #7116 ("Crash upon clicking ...")
Don't crash when clicking a read-only text widget. In the original,
the load game dialog's text widget isn't read-only, but since we
allow multiple games to have the same name it's probably for the
best that we don't quite match the original behavior here.
2016-04-15 07:29:43 +02:00
Torbjörn Andersson 53e02c4770 NEVERHOOD: Tiny whitespace fix
It's bugging me, ok?
2016-04-15 07:29:43 +02:00
Ori Avtalion 923ee223d8 NEVERHOOD: Don't crash when loading savegames with a high slot ID 2015-10-05 18:51:15 +03:00
Torbjörn Andersson dfe04491c1 JANITORIAL: Remove unnecessary semicolons 2015-01-21 01:29:22 +01:00
Johannes Schickel 6563171e7b NEVERHOOD: Make GPL headers consisten in themselves. 2014-02-18 02:39:36 +01:00
Torbjörn Andersson 475ccb24b2 NEVERHOOD: Minor adjustment to original load/delete dialogs
This makes space for one additional savegame slot, giving them the
same number of slots as the original save dialog. I can't compare
to the original, but it arguably looks better this way.
2014-01-06 20:02:20 +01:00
Torbjörn Andersson bb4a6c2899 NEVERHOOD: Add mousewheel support to original save/load dialogs 2014-01-06 14:47:17 +01:00
Filippos Karapetis 90e3e812be NEVERHOOD: Stop background sounds during credits (bug #6475) 2014-01-02 01:54:36 +02:00
Filippos Karapetis 185c232b60 NEVERHOOD: Fix quitting via the menu (bug #6474) 2013-12-28 14:52:37 +02:00
Filippos Karapetis 6ed7f1dd4e NEVERHOOD: Close the game menu when pressing the Escape key 2013-12-28 14:47:35 +02:00
Filippos Karapetis 9c295171b6 NEVERHOOD: Add an option to scale the making of videos to full screen 2013-12-26 16:58:24 +02:00
Filippos Karapetis 962e2fd550 NEVERHOOD: Change more message values to enums 2013-12-25 17:10:42 +02:00
Filippos Karapetis 8d7b10f7c3 NEVERHOOD: Add names to some message IDs 2013-12-23 21:03:35 +02:00
Filippos Karapetis 20e5bf1017 NEVERHOOD: Fix bug #3615124 - "NEVERHOOD: Music from Credits continues to play" 2013-10-31 08:38:17 +02:00
Filippos Karapetis 2369f60a42 NEVERHOOD: Fix uninitialized member of the TextEditWidget class - CID 1022333 2013-09-27 01:38:17 +03:00
Filippos Karapetis cca0bbfe43 NEVERHOOD: Document two resources used in game menus 2013-09-21 14:54:09 +03:00
Filippos Karapetis 783aa9977c NEVERHOOD: Implement the music toggle menu button 2013-09-17 03:27:12 +03:00
Max Horn a993b8dc30 NEVERHOOD: Remove NRect constructor
Otherwise, every global variable of type NRect requires a constructor to be
run, which can cause portability issue.
2013-08-05 11:49:03 +02:00
Sven Hesse 989ea7cb56 JANITORIAL: Remove trailing whitespace 2013-07-14 19:01:47 +02:00
Filippos Karapetis b60b3bbecd NEVERHOOD: Fix save slot selection
My initial suggestion to fix the issue was made in 163023a, which broke
the save slot selection logic. The actual save slot selection problem
was fixed in commit 2ca36ab
2013-07-03 04:41:52 +03:00
Filippos Karapetis 9f7033120b NEVERHOOD: Use the ScummVM dialogs for saving/loading
An option has been added to use the original ones, if needed
2013-06-28 15:37:48 +03:00
Filippos Karapetis 3d373281b4 NEVERHOOD: Stop sound updates while the main menu is active 2013-06-26 12:42:10 +03:00
Filippos Karapetis 2ca36ab53a NEVERHOOD: Fix 2 off-by-one errors in the savegame slot selection box 2013-06-15 15:07:01 +03:00
Filippos Karapetis d00f5c0aa7 NEVERHOOD: Add a console command to display the current surfaces 2013-06-09 17:13:23 +03:00
johndoe123 163023a8ed NEVERHOOD: Fix issues in the save/load screens
- Add virtual keyboard support in save/load screens
2013-05-08 21:01:54 +02:00
johndoe123 583f9abaf9 NEVERHOOD: Fix some logic bugs and minor changes
- Fix video speed in the very last scene (Scene1317)
- Fix back door not opening in Scene1401
- Fix projector not moving in Scene1402
- Fix projector not appearing in Scene1403
- Fix wrong Klaymen walking in Scene2205
- Fix wrong scene change in Module2300
- Fix symbols not appearing in Scene3011
- Define out some remaining logic debug code
- Remove some obsolete comments
- Reduce debug output
- Use a List instead of an Array when building the microtiles rectangles
2013-05-08 20:47:43 +02:00
johndoe123 9ca3973e6f NEVERHOOD: Work on the save/load/delete menus
- Rename WidgetScene to GameStateMenu
- Merge common code from the save/load/delete into GameStateMenu
2013-05-08 20:47:43 +02:00
johndoe123 8749efdea8 NEVERHOOD: Add game-internal savegame delete menu
- Rename Widget::addSprite to Widget::initialize
2013-05-08 20:47:43 +02:00
johndoe123 a03879963f NEVERHOOD: Changed the save/load menu to allow gaps in saved games to simplify game deletion 2013-05-08 20:47:43 +02:00
johndoe123 dc459b5f67 NEVERHOOD: Merge some code in the save/load menus 2013-05-08 20:47:43 +02:00
johndoe123 70fdfd9d57 NEVERHOOD: Delete all sound/music items on exit
- Minor cleanup
2013-05-08 20:47:43 +02:00
johndoe123 65c6984635 NEVERHOOD: Implement game-internal savegame overwrite query screen
- Rename and reorder fields in the Klaymen class
2013-05-08 20:47:42 +02:00
johndoe123 379a8cbbe0 NEVERHOOD: Add support for loading/saving games with the game's own menu
- Add LoadGameMenu class
2013-05-08 20:47:42 +02:00
johndoe123 490d447ed1 NEVERHOOD: Implement restart functionality (from both main menu and game logic)
- Some minor cleanup
2013-05-08 20:47:42 +02:00
johndoe123 f945448c7b NEVERHOOD: Change graphic resource draw method to get a Surface instead of separate pixels/pitch
- Merge SpriteResource::load and load2
2013-05-08 20:47:40 +02:00
johndoe123 a98d9aa58a NEVERHOOD: Clean up DiskplayerScene
- Enable return to launcher
- Remove obsolete comments
- Remove braces in single-line statements
- Remove unused non-transparent drawing code in BaseSurface::copyFrom
- Clean up mouse cursor insertion code in Scene class
2013-05-08 20:47:39 +02:00
johndoe123 6ddedc955a NEVERHOOD: Merge TextSurface into FontSurface 2013-05-08 20:47:39 +02:00
johndoe123 9963ce41ea NEVERHOOD: Merge CollisionMan into Scene class 2013-05-08 20:47:39 +02:00
johndoe123 4b7ad48ca8 NEVERHOOD: Rename some CollisionMan methods/fields
- Remove fallback detector (I think it's not needed)
- Rename Scene insertMouse methods
2013-05-08 20:47:39 +02:00
johndoe123 73e0372cef NEVERHOOD: A little more work on the menu stuff 2013-05-08 20:47:37 +02:00
johndoe123 6be5c11713 NEVERHOOD: More work on the menu system:
- Add handling of ascii and system key input
- Fix TextSurface::drawChar()
- Pause audio when entering the menu, resume it again afterwards
- Add TextEditWidget
- Add SaveGameMenu (doesn't actually save anything yet and needs more work)
2013-05-08 20:47:37 +02:00
johndoe123 0022c57858 NEVERHOOD: Add SavegameListBox 2013-05-08 20:47:37 +02:00
johndoe123 eecd9b8b2a NEVERHOOD: Add TextLabelWidget (still doesn't do anything) 2013-05-08 20:47:37 +02:00
johndoe123 228d9264c8 NEVERHOOD: Start with menu widget stuff (doesn't do anything yet!) 2013-05-08 20:47:37 +02:00
johndoe123 1589e4fe7d NEVERHOOD: Add new method StaticSprite::loadSprite and use it instead of setting stuff "manually" 2013-05-08 20:47:34 +02:00
johndoe123 f24a6769c2 NEVERHOOD: Make use of NDrawRect::set 2013-05-08 20:47:33 +02:00