66 Commits

Author SHA1 Message Date
Simon Delamarre d4f2b85229 VIDEO: Stop mixer handle before deleting audio stream in VMDDecoder::seek
Fix a crash when playing looping ambient sounds in Adi4
2026-04-01 00:07:02 +02:00
Simon Delamarre 62c1d761ba GOB: Move video doubling out of the VMD decoder, to the engine side 2026-04-01 00:07:02 +02:00
Simon Delamarre cfab7108d3 GOB: Really fix conditions for a VMD to be advanced by updateVideos()
- VMDs with with videos are not automatically advanced, unless an
"autoUpdate" flag is set when opening the video. This flag depends on the
flags passed to the playVmdOrMusic opcode.

- Sound-only VMDs are generally advanced by updateVideo()

- Some sound-only VMDs are not advanced automatically because they include
an empty "video" frame with dimensions 0x0, which triggers an early return.

- The "noWaitSound" is another condition to enter updateVideo(), but in
in Adibou2/Adi4 it seems to be always set (independently of the "no wait"
 sound flag 0x100 in the VMD file header).
2026-03-31 23:31:33 +02:00
Simon Delamarre 45cdcf63d1 VIDEO: Revert "Add support for blitting paletted VMD to high-color destinations"
Obsolete since the conversion is now done in the Gob engine.
2025-05-15 09:21:01 +03:00
Simon Delamarre f0a92e7579 GOB: Fix "no wait sound" condition in Adibou2/Sciences videos 2025-05-15 09:21:01 +03:00
Simon Delamarre fc88883e58 GOB: Allow to "play" frames beyond last frame as a no-op in video playback
Some Adibou2/Sciences scripts rely on this, by waiting for the "current frame" variable to take the value "last frame + 2"
2025-05-15 09:21:01 +03:00
Simon Delamarre aa906c0c47 GOB: Fix conditions for non-blocking videos 2025-05-15 09:21:01 +03:00
Simon Delamarre 5c4aa16eac VIDEO: int16 -> uint16 for _soundFreq in VMD decoder
Some later games VMDs use 44100 Hz frequency, which does not fit in an int16.
2025-05-15 09:21:01 +03:00
Simon Delamarre a4d4d3c27d VIDEO: Add support for blitting paletted VMD to high-color destinations
Needed for Adibou2/Sciences, which uses both paletted and high-color sources.
2025-05-15 09:21:01 +03:00
Orgad Shaneh ce744add1f JANITORIAL: Fix unused variable warnings on release build 2025-05-13 22:33:16 +03:00
Filippos Karapetis 7cb70d585f VIDEO: Use C++ 11 range-based for loops 2025-03-27 13:47:57 +08:00
Matthew Jimenez 99330f128c VIDEO: Use palette class in Coktel decoder 2025-03-10 19:03:23 +02:00
Eugene Sandulenko 847c714e68 CONFIGURE: Split indeo into indeo3 and indeo45 components
Also, add indeo3 as a dependency to bbvs and add all codect to testbed
2024-12-27 12:40:26 +01:00
Eugene Sandulenko a6e3feed61 CONFIGURE: Turned Indeo codecs into 'indeo' component
For Director engine it is marked as optional, since so far onnly
one game is using it.

This could lead to regressions since we were not tracking which
games use Indeo codecs since we added them in 2016 (Indeo 4&5) and
2010 (Indeo 3). So, there could be an AVI video which is now stops
playing and produces a warning. In this case, the 'indeo' component
must be added to the respective engine.
2024-12-26 01:10:14 +01:00
Eugene Sandulenko 3201546fb1 VIDEO: Added second license to coktel_decoder.cpp as part of gob engine dual licensing 2024-08-21 16:53:35 +02:00
Simon Delamarre e449629385 VIDEO: fix uninitialized _isDouble property in Coktel decoder 2023-04-22 00:54:52 +02:00
Simon Delamarre de85d267eb VIDEO: implement VMD doubling, used to accommodate higher resolutions
Each pixel is replaced by a 2x2 square filled with the same color.
2023-04-21 00:48:23 +02:00
Simon Delamarre 709df52d48 GOB: fix some audio/video sync issues in Adibou2
This workaround solves audio/video sync issues that used to appear frequently in many animations, e.g. when Adibou kicks the ball in the garden.

Those animations easily get out of sync when the timing is done by hotspots::evaluate, which sometimes does not call animate() as often as needed for good sync (mouse events processing, in particular, can delay the call).
The original game seems to use also some kind of frame skipping to address this problem.
2022-12-02 11:44:33 +01:00
Simon Delamarre 0f811dcd6a GOB: vertical offset bugfix when deflating VMD directly onto a video surface
This fixes a frame offset error in the puzzle game of Adibou2, where the vertical offset was added twice.
2022-12-02 11:44:32 +01:00
Simon Delamarre 4c551956c5 GOB: fix disappearing objects in Adibou2 after video play
The video slot was sometimes not closed, preventing the mult object to be reused with a static image.
2022-12-02 11:44:25 +01:00
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Orgad Shaneh 7a4e5612de JANITORIAL: Replace new[]/memset with new[]()
Mostly done using the following Ruby script:

(Dir.glob('**/*.cpp') + Dir.glob('**/*.h')).each do |file|
  s = File.read(file, encoding: 'iso8859-1')
  t = s.gsub(/(([\w_.\[\]]+)\s*=\s*new\s+\S+?\[[^\]]+?\](?!\())([^\{\}]*?)\n\s+memset\(\s*\2\s*,\s*0\s*,[^;]*;/m, '\1()\3')
  if t != s
    File.open(file, 'w') { |io| io.write(t) }
  end
end
2021-11-10 19:53:15 +01:00
Le Philousophe d77074490f VIDEO: Fix int/int32 build failures
All of this is because Rect and Surface have moved to int32
2021-07-05 23:19:47 +02:00
Dmitry Blau cf179868c8 VIDEO: Fix embedded subtitles in VMD videos
This fixes the subtitles in Woodruff - bug 10960
2019-09-13 11:27:24 +03:00
Colin Snover 4ba87013a9 VIDEO: Support old-style stereo in VMDs
This format is used by the stereo audio VMDs in Lighthouse.
2017-08-20 11:36:26 -05:00
Bastien Bouclet ec49730711 VIDEO: Allow setting the mixer sound type used to play audio tracks 2017-07-27 06:40:07 +02:00
Colin Snover 0d63d2a7ad VIDEO: Wrap out-of-range VMD audio samples instead of clipping
The 16-bit DPCM decompressors in SSCI and Urban Runner use a 16-bit
register to store sample data, without any special handling of
overflow. As such, out-of-range samples simply wrap around, rather
than getting clipped.

It is not totally clear if the wrapping behaviour was intentionally
exploited to handle extreme transients, but in any case, videos
like GK2 5280.VMD that generate samples outside the signed 16-bit
range cause a loud pop when using clipping, but play back correctly
when wrapping.
2017-06-17 13:09:27 -05:00
Colin Snover 53fb26550d VIDEO: Unexpose audio sync API in AdvancedVMDDecoder
This change was inadvertently added in commit
44dd029cb1 but is not actually used.
2017-04-29 14:30:09 -05:00
Colin Snover 7b90f0693a IMAGE: Return correct pixel format for Indeo3
This gives Indeo3 the same behavior as other codecs when
encapsulated in a container that provides bit depth information
(e.g. AVI).

Closes #888.
2017-01-11 10:59:55 -06:00
Colin Snover 44dd029cb1 SCI32: Implement kSetHotRectangles
Used only by chapter 7 of Phant1.
2016-09-29 19:39:16 -05:00
Colin Snover 28d4f5b0e4 VIDEO: Expose API for providing a memory location to draw VMDs
In SSCI, VMD is drawn by a standard CelObjMem wrapped by a
ScreenItem, giving the location of the bitmap memory to the
decoder. The decoder already supports this, but the API was
previously hidden behind the AdvancedVMDDecoder wrapper
(which is more convenient to use than the VMDDecoder class).
2016-07-10 09:35:24 -05:00
Matthew Hoops 08ea14a8d0 IMAGE: Make Codec take a stream reference; change function name to decodeFrame 2014-02-28 00:27:37 -05:00
Matthew Hoops b568ac73b9 IMAGE: Move video codecs to image/ 2014-02-28 00:27:36 -05:00
Johannes Schickel 8f3a923686 VIDEO: Make GPL headers consistent in themselves. 2014-02-18 02:39:39 +01:00
Johannes Schickel 8fc54d6d77 VIDEO: Fix regression in Urban Runner videos.
This is a regression from 6fce92b0ea. Thanks to
DrMcCoy for tracking this down.
2013-08-04 01:07:34 +02:00
Johannes Schickel 0cb1504a5b VIDEO: Do not set Surface::pixels directly anymore. 2013-08-03 04:14:08 +02:00
Johannes Schickel e0c9c1d261 VIDEO: Take advantage of Surface::getPixels. 2013-08-03 04:02:49 +02:00
Johannes Schickel 6fce92b0ea VIDEO: Prefer getBasePtr over direct Surface::pixels access. 2013-08-03 04:02:49 +02:00
Sven Hesse 4b3f5149b5 VIDEO: Add hypothetical 32bpp support 2013-06-30 19:07:04 +02:00
Sven Hesse fad5cf7243 VIDEO: Fix a typo (minus vs. plus) in the VMD decoder 2013-04-13 15:22:06 +02:00
Johannes Schickel 89abab97e3 JANITORIAL: Remove trailing whitespaces.
Powered by:
git ls-files "*.cpp" "*.h" "*.m" "*.mm" | xargs sed -i -e 's/[ \t]*$//'
2012-09-26 04:17:55 +02:00
Matthew Hoops 3e2ff0a443 VIDEO: Fix compilation with some compilers 2012-08-26 20:30:32 -04:00
Matthew Hoops 18823198ad VIDEO: Merge AdvancedVideoDecoder into VideoDecoder 2012-08-16 14:00:14 -04:00
Matthew Hoops 7294a1cbcf VIDEO: Remove the Coktel video code from using the VideoDecoder API
After discussing with DrMcCoy, we felt this the best way to proceed. A wrapper class that implements AdvancedVideoDecoder is still around for use in SCI.
2012-08-16 12:17:23 -04:00
Sven Hesse 8c3d2fc741 GOB: Add a way to reopen currently opened IMD/VMD videos
This is a workaround for how Lost in Time behaves in combination
with changes I made to the DataIO code for running Urban Runner
on low-memory devices.

Urban Runner's intro are far to big to have them copied into
memory for these devices, so I made the DataIO code return a
SafeSeekableSubReadStream into the opened archive stream instead.
Unfortunately, Lost in Time might not close a video file when it
closes the data file which it was originally in, especially when
loading a saved game. Since the video player needs to be able to
gaplessly continue a video and there does not, by itself, close
the video if not requested by the scripts, this leads to reading
out of an already closed stream in certain cases.

So, to worka round this issues, the video player tries to reopen
each currently opened video after a data archive was closed, to
make sure that that video is still available. If not, the video
is closed.
2012-06-07 00:29:46 +02:00
Matthew Hoops 10f7e805c2 VIDEO: Add volume/balance control to VideoDecoder 2012-05-28 14:00:16 -04:00
Matthew Hoops 6bbff58314 VIDEO: Rewrite VMD audio streaming
Audio is now decoded in AudioStream classes instead of being decoded ahead of time and then queued.
2011-11-27 15:52:05 +01:00
Max Horn 717a7accf5 BUILD: Always enable indeo3 codec 2011-05-25 13:24:37 +02:00
strangerke 69b1485a22 GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00
Johannes Schickel 71bdb86e02 Merge pull request #16 "Add a PixelFormat to Graphics::Surface.".
For further discussion check here:
https://github.com/scummvm/scummvm/pull/16

Conflicts:
	graphics/png.cpp
2011-05-01 16:54:45 +02:00