[Scummvm-cvs-logs] SF.net SVN: scummvm:[51725] scummvm/trunk
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Wed Aug 4 10:25:05 CEST 2010
Revision: 51725
http://scummvm.svn.sourceforge.net/scummvm/?rev=51725&view=rev
Author: fingolfin
Date: 2010-08-04 08:25:05 +0000 (Wed, 04 Aug 2010)
Log Message:
-----------
GRAPHICS: Change signature of VideoDecoder::load()
Now takes a pointer to a stream, instead of a reference.
The rational is that in all instances, callers have a pointer
(and dereference it to call load), and all load implementations
turn the reference back into a pointer.
Modified Paths:
--------------
scummvm/trunk/engines/gob/videoplayer.cpp
scummvm/trunk/engines/mohawk/video.cpp
scummvm/trunk/engines/sci/video/seq_decoder.cpp
scummvm/trunk/engines/sci/video/seq_decoder.h
scummvm/trunk/engines/sci/video/vmd_decoder.cpp
scummvm/trunk/engines/sci/video/vmd_decoder.h
scummvm/trunk/graphics/video/avi_decoder.cpp
scummvm/trunk/graphics/video/avi_decoder.h
scummvm/trunk/graphics/video/coktelvideo/coktelvideo.cpp
scummvm/trunk/graphics/video/coktelvideo/coktelvideo.h
scummvm/trunk/graphics/video/dxa_decoder.cpp
scummvm/trunk/graphics/video/dxa_decoder.h
scummvm/trunk/graphics/video/flic_decoder.cpp
scummvm/trunk/graphics/video/flic_decoder.h
scummvm/trunk/graphics/video/qt_decoder.cpp
scummvm/trunk/graphics/video/qt_decoder.h
scummvm/trunk/graphics/video/smk_decoder.cpp
scummvm/trunk/graphics/video/smk_decoder.h
scummvm/trunk/graphics/video/video_decoder.cpp
scummvm/trunk/graphics/video/video_decoder.h
Modified: scummvm/trunk/engines/gob/videoplayer.cpp
===================================================================
--- scummvm/trunk/engines/gob/videoplayer.cpp 2010-08-04 08:23:48 UTC (rev 51724)
+++ scummvm/trunk/engines/gob/videoplayer.cpp 2010-08-04 08:25:05 UTC (rev 51725)
@@ -73,7 +73,7 @@
return false;
}
- if (!_video->load(*_stream)) {
+ if (!_video->load(_stream)) {
warning("While loading video \"%s\"", fileName);
close();
return false;
Modified: scummvm/trunk/engines/mohawk/video.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/video.cpp 2010-08-04 08:23:48 UTC (rev 51724)
+++ scummvm/trunk/engines/mohawk/video.cpp 2010-08-04 08:25:05 UTC (rev 51725)
@@ -342,7 +342,7 @@
entry.loop = loop;
entry.enabled = true;
entry->setChunkBeginOffset(_vm->getResourceOffset(ID_TMOV, id));
- entry->load(*_vm->getRawData(ID_TMOV, id));
+ entry->load(_vm->getRawData(ID_TMOV, id));
// Search for any deleted videos so we can take a formerly used slot
for (uint32 i = 0; i < _videoStreams.size(); i++)
@@ -378,7 +378,7 @@
return NULL_VID_HANDLE;
}
- entry->load(*file);
+ entry->load(file);
// Search for any deleted videos so we can take a formerly used slot
for (uint32 i = 0; i < _videoStreams.size(); i++)
Modified: scummvm/trunk/engines/sci/video/seq_decoder.cpp
===================================================================
--- scummvm/trunk/engines/sci/video/seq_decoder.cpp 2010-08-04 08:23:48 UTC (rev 51724)
+++ scummvm/trunk/engines/sci/video/seq_decoder.cpp 2010-08-04 08:25:05 UTC (rev 51725)
@@ -55,10 +55,10 @@
close();
}
-bool SeqDecoder::load(Common::SeekableReadStream &stream) {
+bool SeqDecoder::load(Common::SeekableReadStream *stream) {
close();
- _fileStream = &stream;
+ _fileStream = stream;
_surface = new Graphics::Surface();
_surface->create(SEQ_SCREEN_WIDTH, SEQ_SCREEN_HEIGHT, 1);
Modified: scummvm/trunk/engines/sci/video/seq_decoder.h
===================================================================
--- scummvm/trunk/engines/sci/video/seq_decoder.h 2010-08-04 08:23:48 UTC (rev 51724)
+++ scummvm/trunk/engines/sci/video/seq_decoder.h 2010-08-04 08:25:05 UTC (rev 51725)
@@ -38,7 +38,7 @@
SeqDecoder();
virtual ~SeqDecoder();
- bool load(Common::SeekableReadStream &stream);
+ bool load(Common::SeekableReadStream *stream);
void close();
void setFrameDelay(int frameDelay) { _frameDelay = frameDelay; }
Modified: scummvm/trunk/engines/sci/video/vmd_decoder.cpp
===================================================================
--- scummvm/trunk/engines/sci/video/vmd_decoder.cpp 2010-08-04 08:23:48 UTC (rev 51724)
+++ scummvm/trunk/engines/sci/video/vmd_decoder.cpp 2010-08-04 08:25:05 UTC (rev 51725)
@@ -50,13 +50,13 @@
close();
}
-bool VMDDecoder::load(Common::SeekableReadStream &stream) {
+bool VMDDecoder::load(Common::SeekableReadStream *stream) {
close();
if (!_vmdDecoder->load(stream))
return false;
- _fileStream = &stream;
+ _fileStream = stream;
if (_vmdDecoder->getFeatures() & Graphics::CoktelVideo::kFeaturesPalette)
loadPaletteFromVMD();
Modified: scummvm/trunk/engines/sci/video/vmd_decoder.h
===================================================================
--- scummvm/trunk/engines/sci/video/vmd_decoder.h 2010-08-04 08:23:48 UTC (rev 51724)
+++ scummvm/trunk/engines/sci/video/vmd_decoder.h 2010-08-04 08:25:05 UTC (rev 51725)
@@ -56,7 +56,7 @@
uint32 getFrameWaitTime();
- bool load(Common::SeekableReadStream &stream);
+ bool load(Common::SeekableReadStream *stream);
void close();
bool isVideoLoaded() const { return _fileStream != 0; }
Modified: scummvm/trunk/graphics/video/avi_decoder.cpp
===================================================================
--- scummvm/trunk/graphics/video/avi_decoder.cpp 2010-08-04 08:23:48 UTC (rev 51724)
+++ scummvm/trunk/graphics/video/avi_decoder.cpp 2010-08-04 08:25:05 UTC (rev 51725)
@@ -211,10 +211,10 @@
}
}
-bool AviDecoder::load(Common::SeekableReadStream &stream) {
+bool AviDecoder::load(Common::SeekableReadStream *stream) {
close();
- _fileStream = &stream;
+ _fileStream = stream;
_decodedHeader = false;
// Read chunks until we have decoded the header
Modified: scummvm/trunk/graphics/video/avi_decoder.h
===================================================================
--- scummvm/trunk/graphics/video/avi_decoder.h 2010-08-04 08:23:48 UTC (rev 51724)
+++ scummvm/trunk/graphics/video/avi_decoder.h 2010-08-04 08:25:05 UTC (rev 51725)
@@ -178,7 +178,7 @@
Audio::Mixer::SoundType soundType = Audio::Mixer::kPlainSoundType);
virtual ~AviDecoder();
- bool load(Common::SeekableReadStream &stream);
+ bool load(Common::SeekableReadStream *stream);
void close();
bool isVideoLoaded() const { return _fileStream != 0; }
Modified: scummvm/trunk/graphics/video/coktelvideo/coktelvideo.cpp
===================================================================
--- scummvm/trunk/graphics/video/coktelvideo/coktelvideo.cpp 2010-08-04 08:23:48 UTC (rev 51724)
+++ scummvm/trunk/graphics/video/coktelvideo/coktelvideo.cpp 2010-08-04 08:25:05 UTC (rev 51725)
@@ -127,14 +127,14 @@
return 0;
}
-bool PreImd::load(Common::SeekableReadStream &stream) {
+bool PreImd::load(Common::SeekableReadStream *stream) {
// Since PreIMDs don't have any width and height values stored,
// we need them to be specified in the constructor
assert((_forcedWidth > 0) && (_forcedHeight > 0));
unload();
- _stream = &stream;
+ _stream = stream;
_stream->seek(0);
@@ -564,10 +564,10 @@
return true;
}
-bool Imd::load(Common::SeekableReadStream &stream) {
+bool Imd::load(Common::SeekableReadStream *stream) {
unload();
- _stream = &stream;
+ _stream = stream;
uint16 handle;
@@ -1656,10 +1656,10 @@
}
}
-bool Vmd::load(Common::SeekableReadStream &stream) {
+bool Vmd::load(Common::SeekableReadStream *stream) {
unload();
- _stream = &stream;
+ _stream = stream;
uint16 headerLength;
uint16 handle;
Modified: scummvm/trunk/graphics/video/coktelvideo/coktelvideo.h
===================================================================
--- scummvm/trunk/graphics/video/coktelvideo/coktelvideo.h 2010-08-04 08:23:48 UTC (rev 51724)
+++ scummvm/trunk/graphics/video/coktelvideo/coktelvideo.h 2010-08-04 08:25:05 UTC (rev 51725)
@@ -23,13 +23,9 @@
*
*/
-// Currently, only GOB and SCI32 games play IMDs and VMDs, so skip compiling if GOB and SCI32 is disabled.
-#if !(defined(ENABLE_GOB) || defined(ENABLE_SCI32) || defined(DYNAMIC_MODULES))
+// Currently, only GOB and SCI32 games play IMDs and VMDs
+#if defined(ENABLE_GOB) || defined(ENABLE_SCI32) || defined(DYNAMIC_MODULES)
-// Do not compile the CoktelVideo code
-
-#else
-
#ifndef GRAPHICS_VIDEO_COKTELVIDEO_H
#define GRAPHICS_VIDEO_COKTELVIDEO_H
@@ -153,7 +149,7 @@
virtual Common::MemoryReadStream *getExtraData(const char *fileName) = 0;
/** Load a video out of a stream. */
- virtual bool load(Common::SeekableReadStream &stream) = 0;
+ virtual bool load(Common::SeekableReadStream *stream) = 0;
/** Unload the currently loaded video. */
virtual void unload() = 0;
@@ -243,7 +239,7 @@
bool hasExtraData(const char *fileName) const;
Common::MemoryReadStream *getExtraData(const char *fileName);
- bool load(Common::SeekableReadStream &stream);
+ bool load(Common::SeekableReadStream *stream);
void unload();
void setXY(int16 x, int16 y);
@@ -322,7 +318,7 @@
uint32 getSyncLag() const;
- bool load(Common::SeekableReadStream &stream);
+ bool load(Common::SeekableReadStream *stream);
void unload();
void setXY(int16 x, int16 y);
@@ -451,7 +447,7 @@
bool hasExtraData(const char *fileName) const;
Common::MemoryReadStream *getExtraData(const char *fileName);
- bool load(Common::SeekableReadStream &stream);
+ bool load(Common::SeekableReadStream *stream);
void unload();
int16 getWidth() const;
Modified: scummvm/trunk/graphics/video/dxa_decoder.cpp
===================================================================
--- scummvm/trunk/graphics/video/dxa_decoder.cpp 2010-08-04 08:23:48 UTC (rev 51724)
+++ scummvm/trunk/graphics/video/dxa_decoder.cpp 2010-08-04 08:25:05 UTC (rev 51725)
@@ -66,10 +66,10 @@
close();
}
-bool DXADecoder::load(Common::SeekableReadStream &stream) {
+bool DXADecoder::load(Common::SeekableReadStream *stream) {
close();
- _fileStream = &stream;
+ _fileStream = stream;
uint32 tag = _fileStream->readUint32BE();
assert(tag == MKID_BE('DEXA'));
Modified: scummvm/trunk/graphics/video/dxa_decoder.h
===================================================================
--- scummvm/trunk/graphics/video/dxa_decoder.h 2010-08-04 08:23:48 UTC (rev 51724)
+++ scummvm/trunk/graphics/video/dxa_decoder.h 2010-08-04 08:25:05 UTC (rev 51725)
@@ -43,7 +43,7 @@
DXADecoder();
virtual ~DXADecoder();
- bool load(Common::SeekableReadStream &stream);
+ bool load(Common::SeekableReadStream *stream);
void close();
bool isVideoLoaded() const { return _fileStream != 0; }
Modified: scummvm/trunk/graphics/video/flic_decoder.cpp
===================================================================
--- scummvm/trunk/graphics/video/flic_decoder.cpp 2010-08-04 08:23:48 UTC (rev 51724)
+++ scummvm/trunk/graphics/video/flic_decoder.cpp 2010-08-04 08:25:05 UTC (rev 51725)
@@ -41,10 +41,10 @@
close();
}
-bool FlicDecoder::load(Common::SeekableReadStream &stream) {
+bool FlicDecoder::load(Common::SeekableReadStream *stream) {
close();
- _fileStream = &stream;
+ _fileStream = stream;
/* uint32 frameSize = */ _fileStream->readUint32LE();
uint16 frameType = _fileStream->readUint16LE();
Modified: scummvm/trunk/graphics/video/flic_decoder.h
===================================================================
--- scummvm/trunk/graphics/video/flic_decoder.h 2010-08-04 08:23:48 UTC (rev 51724)
+++ scummvm/trunk/graphics/video/flic_decoder.h 2010-08-04 08:25:05 UTC (rev 51725)
@@ -51,7 +51,7 @@
* Load a video file
* @param stream the stream to load
*/
- bool load(Common::SeekableReadStream &stream);
+ bool load(Common::SeekableReadStream *stream);
void close();
/**
Modified: scummvm/trunk/graphics/video/qt_decoder.cpp
===================================================================
--- scummvm/trunk/graphics/video/qt_decoder.cpp 2010-08-04 08:23:48 UTC (rev 51724)
+++ scummvm/trunk/graphics/video/qt_decoder.cpp 2010-08-04 08:25:05 UTC (rev 51725)
@@ -308,8 +308,8 @@
return true;
}
-bool QuickTimeDecoder::load(Common::SeekableReadStream &stream) {
- _fd = &stream;
+bool QuickTimeDecoder::load(Common::SeekableReadStream *stream) {
+ _fd = stream;
_foundMOOV = _foundMDAT = false;
_numStreams = 0;
_partial = 0;
Modified: scummvm/trunk/graphics/video/qt_decoder.h
===================================================================
--- scummvm/trunk/graphics/video/qt_decoder.h 2010-08-04 08:23:48 UTC (rev 51724)
+++ scummvm/trunk/graphics/video/qt_decoder.h 2010-08-04 08:25:05 UTC (rev 51725)
@@ -89,7 +89,7 @@
* Load a QuickTime video file from a SeekableReadStream
* @param stream the stream to load
*/
- bool load(Common::SeekableReadStream &stream);
+ bool load(Common::SeekableReadStream *stream);
/**
* Close a QuickTime encoded video file
Modified: scummvm/trunk/graphics/video/smk_decoder.cpp
===================================================================
--- scummvm/trunk/graphics/video/smk_decoder.cpp 2010-08-04 08:23:48 UTC (rev 51724)
+++ scummvm/trunk/graphics/video/smk_decoder.cpp 2010-08-04 08:25:05 UTC (rev 51725)
@@ -367,10 +367,10 @@
return VideoDecoder::getElapsedTime();
}
-bool SmackerDecoder::load(Common::SeekableReadStream &stream) {
+bool SmackerDecoder::load(Common::SeekableReadStream *stream) {
close();
- _fileStream = &stream;
+ _fileStream = stream;
// Seek to the first frame
_header.signature = _fileStream->readUint32BE();
Modified: scummvm/trunk/graphics/video/smk_decoder.h
===================================================================
--- scummvm/trunk/graphics/video/smk_decoder.h 2010-08-04 08:23:48 UTC (rev 51724)
+++ scummvm/trunk/graphics/video/smk_decoder.h 2010-08-04 08:25:05 UTC (rev 51725)
@@ -57,7 +57,7 @@
Audio::Mixer::SoundType soundType = Audio::Mixer::kSFXSoundType);
virtual ~SmackerDecoder();
- bool load(Common::SeekableReadStream &stream);
+ bool load(Common::SeekableReadStream *stream);
void close();
bool isVideoLoaded() const { return _fileStream != 0; }
Modified: scummvm/trunk/graphics/video/video_decoder.cpp
===================================================================
--- scummvm/trunk/graphics/video/video_decoder.cpp 2010-08-04 08:23:48 UTC (rev 51724)
+++ scummvm/trunk/graphics/video/video_decoder.cpp 2010-08-04 08:25:05 UTC (rev 51725)
@@ -42,7 +42,7 @@
return false;
}
- return load(*file);
+ return load(file);
}
uint32 VideoDecoder::getElapsedTime() const {
Modified: scummvm/trunk/graphics/video/video_decoder.h
===================================================================
--- scummvm/trunk/graphics/video/video_decoder.h 2010-08-04 08:23:48 UTC (rev 51724)
+++ scummvm/trunk/graphics/video/video_decoder.h 2010-08-04 08:25:05 UTC (rev 51725)
@@ -93,7 +93,7 @@
* Load a video file
* @param stream the stream to load
*/
- virtual bool load(Common::SeekableReadStream &stream) = 0;
+ virtual bool load(Common::SeekableReadStream *stream) = 0;
/**
* Close a video file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list