[Scummvm-cvs-logs] scummvm master -> 422922fec206b768de8e2a9333851b366bd13fd4
clone2727
clone2727 at gmail.com
Sun Aug 17 18:26:18 CEST 2014
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
9a5b3bfdda IMAGE: Make Cinepak decode to 32bpp when in 8bpp screen mode
422922fec2 VIDEO: Add wrapper around setEndTime() to specify an end frame
Commit: 9a5b3bfddabd86205eefacc459a7887b4e735122
https://github.com/scummvm/scummvm/commit/9a5b3bfddabd86205eefacc459a7887b4e735122
Author: Matthew Hoops (clone2727 at gmail.com)
Date: 2014-08-17T12:24:23-04:00
Commit Message:
IMAGE: Make Cinepak decode to 32bpp when in 8bpp screen mode
Changed paths:
image/codecs/cinepak.cpp
diff --git a/image/codecs/cinepak.cpp b/image/codecs/cinepak.cpp
index 8d5dbce..8464aa3 100644
--- a/image/codecs/cinepak.cpp
+++ b/image/codecs/cinepak.cpp
@@ -52,11 +52,16 @@ CinepakDecoder::CinepakDecoder(int bitsPerPixel) : Codec() {
_curFrame.strips = NULL;
_y = 0;
- if (bitsPerPixel == 8)
+ if (bitsPerPixel == 8) {
_pixelFormat = Graphics::PixelFormat::createFormatCLUT8();
- else
+ } else {
_pixelFormat = g_system->getScreenFormat();
+ // Default to a 32bpp format, if in 8bpp mode
+ if (_pixelFormat.bytesPerPixel == 1)
+ _pixelFormat = Graphics::PixelFormat(4, 8, 8, 8, 8, 8, 16, 24, 0);
+ }
+
// Create a lookup for the clip function
// This dramatically improves the performance of the color conversion
_clipTableBuf = new byte[1024];
Commit: 422922fec206b768de8e2a9333851b366bd13fd4
https://github.com/scummvm/scummvm/commit/422922fec206b768de8e2a9333851b366bd13fd4
Author: Matthew Hoops (clone2727 at gmail.com)
Date: 2014-08-17T12:24:28-04:00
Commit Message:
VIDEO: Add wrapper around setEndTime() to specify an end frame
Changed paths:
video/video_decoder.cpp
video/video_decoder.h
diff --git a/video/video_decoder.cpp b/video/video_decoder.cpp
index c6171c4..dce96aa 100644
--- a/video/video_decoder.cpp
+++ b/video/video_decoder.cpp
@@ -778,6 +778,31 @@ void VideoDecoder::setEndTime(const Audio::Timestamp &endTime) {
}
}
+void VideoDecoder::setEndFrame(uint frame) {
+ VideoTrack *track = 0;
+
+ for (TrackList::iterator it = _tracks.begin(); it != _tracks.end(); it++) {
+ if ((*it)->getTrackType() == Track::kTrackTypeVideo) {
+ // We only allow this when one video track is present
+ if (track)
+ return;
+
+ track = (VideoTrack *)*it;
+ }
+ }
+
+ // If we didn't find a video track, we can't set the final frame (of course)
+ if (!track)
+ return;
+
+ Audio::Timestamp time = track->getFrameTime(frame + 1);
+
+ if (time < 0)
+ return;
+
+ setEndTime(time);
+}
+
VideoDecoder::Track *VideoDecoder::getTrack(uint track) {
if (track > _internalTracks.size())
return 0;
diff --git a/video/video_decoder.h b/video/video_decoder.h
index 2faec0f..c3879e9 100644
--- a/video/video_decoder.h
+++ b/video/video_decoder.h
@@ -214,6 +214,17 @@ public:
void setEndTime(const Audio::Timestamp &endTime);
/**
+ * Set the end frame.
+ *
+ * The passed frame will be the last frame to show.
+ *
+ * Like seekToFrame(), this only works when one video track is present,
+ * and that track supports getFrameTime(). This calls setEndTime()
+ * internally.
+ */
+ void setEndFrame(uint frame);
+
+ /**
* Get the stop time of the video (if not set, zero)
*/
Audio::Timestamp getEndTime() const { return _endTime; }
More information about the Scummvm-git-logs
mailing list