27 Commits

Author SHA1 Message Date
antoniou79
07c1e5cc2a GUI: Fix thumbnails for event recorder dialogue
Also prevent segmentation fault cases related to low-res or switching from low-res to hi-res

And fix memory leak related to loading and scaling of the thumbnail image

A lot of the updated logic is borrowed from the saveload-dialog.cpp for the simple list view (with the thumbnail to the right of the list).
2022-06-12 15:08:01 +02:00
Eugene Sandulenko
abea37c9bb
ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Scott Percival
666f241d29 EVENTRECORDER: Remove backwards compatibility 2021-09-09 19:32:02 +02:00
Scott Percival
fb421a0ca7 EVENTRECORDER: Change file format to big-endian
Previously the file format had all chunks, offsets and values stored in
little-endian format. The one exception was screenshots, which used the
existing THMB code in graphics/thumbnail.cpp, that is entirely
big-endian. Any tooling which attempts to parse the Event Recorder file
format must make a special exception for THMB chunks, and read the chunk
size and contents as big-endian.

In the interests of making the file format more consistant
to parse, and given that backwards compatibility is not required for
this iteration of Event Recorder, this patch changes everything to
big-endian.
2021-09-09 19:32:02 +02:00
Scott Percival
84707ec828 EVENTRECORDER: Prevent recursive call to warpMouse 2021-09-09 19:32:02 +02:00
Scott Percival
5cbcd98963 EVENTRECORDER: Add screen update tracking
Screen update boundaries are now used as sync points.
Screenshots are now processed on a screen update boundary.

This change increments the version of the Event Recorder
file format to 2; version 1 files will still play back as
before, without synchronising to screen updates.
2021-09-09 19:32:02 +02:00
Martin Gerhardy
7a172206d5 EVENTRECORDER: don't execute getMillis while resolving the random seed in playback mode 2021-07-12 22:56:02 +02:00
Martin Gerhardy
a0c237f7b9 EVENTRECORDER: added new event for OSystem::getTimeAndDate 2021-07-09 19:23:21 +02:00
Martin Gerhardy
2a658b9d65 EVENTRECORDER: quit scummvm after end of recorder file was reached.
This might also become a return to launcher, but I've somehere read the hint that
the event recorder was only meant to play back one game per session. We'll see.
2021-07-08 15:05:35 +02:00
Martin Gerhardy
70167d8423 EVENTRECORDER: debug logging 2021-07-08 15:05:35 +02:00
Martin Gerhardy
5ae72dc190 EVENTRECORDER: removed unused variable 2021-07-08 15:05:35 +02:00
Martin Gerhardy
375d8dc4a4 EVENTRECORDER: changed event recorder format and added more events
the custom engine events were missing and the default event manager transforms the backend events
. Which means that the event recorder is not persisting the low level key press/release events
but the already transformed custom engine events of the keymapper
2021-07-08 15:05:35 +02:00
Orgad Shaneh
c9a19011bf EVENTRECORDER: Use a dynamic array for buffer in PlaybackFile
It is allocated on the stack.
2021-07-08 10:59:09 +02:00
Martin Gerhardy
adc2671449 COMMON: fixed endless loop in recordings with only one screenshot
the stream was read after its end and the err() state wasn't checked properly
2021-06-19 14:34:52 +02:00
Eugene Sandulenko
045df72426 EVENTRECORDER: Fix crash on attempt to save. Fixed #10045
Since we have two event managers during recording, we invalidate
cache in order to avoid cache miss
2020-08-29 17:22:38 +02:00
Cameron Cawley
1605b72ee8 BACKENDS: Add events for additional mouse buttons 2020-02-26 21:34:24 +01:00
D G Turner
8a96a1854d RECORDER: Add Missing Default Switch Cases
These are flagged by GCC if -Wswitch-default is enabled.
2019-10-04 02:30:19 +01:00
Adrian Frühwirth
3747d852ee JANITORIAL: Fix whitespace 2018-04-15 16:31:31 +02:00
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
Bastien Bouclet
8beb519c5e EVENTS: Rename synthetic to kbdRepeat 2017-11-19 16:12:50 +01:00
Bastien Bouclet
8d34d5190d Revert "BUILD: Fix test compilation with event recorder enabled"
This reverts commit 1f8667c5d949070035390531e4f10c0f945d7352.
2016-07-28 18:23:50 +02:00
Eugene Sandulenko
1f8667c5d9 BUILD: Fix test compilation with event recorder enabled 2016-05-23 16:36:26 +02:00
Johannes Schickel
854e22b38b COMMON: Make GPL headers consistent in themselves. 2014-02-18 02:39:33 +01:00
Eugene Sandulenko
5d6c7fbcd1 RECORDER: Initialize variable. CID 1047258 2013-11-03 01:28:03 +02:00
Eugene Sandulenko
9572bc6e30 RECORDER: Fix wrong argument order 2013-07-15 14:31:34 +03:00
Eugene Sandulenko
aaaf466c71 RECORDER: Fix CID 1046886. Uninit class variables. 2013-07-14 19:03:29 +03:00
Eugene Sandulenko
f59512c47e RECORDER: Implement Events Recorder 2013-05-17 00:18:09 +03:00