aboutsummaryrefslogtreecommitdiff
path: root/graphics/video/coktel_decoder.cpp
diff options
context:
space:
mode:
authorSven Hesse2010-08-08 01:02:19 +0000
committerSven Hesse2010-08-08 01:02:19 +0000
commit945103a43c9a15a4a9a07765197b0551593b4236 (patch)
treef92e247c8f44b15e642e5f03bb10c257759e3482 /graphics/video/coktel_decoder.cpp
parenteed41aa22337571c18e08abfdf00d19fd2a5121d (diff)
downloadscummvm-rg350-945103a43c9a15a4a9a07765197b0551593b4236.tar.gz
scummvm-rg350-945103a43c9a15a4a9a07765197b0551593b4236.tar.bz2
scummvm-rg350-945103a43c9a15a4a9a07765197b0551593b4236.zip
VIDEO/GOB: Implement and use CoktelDecoder::getFrameCoords()
svn-id: r51909
Diffstat (limited to 'graphics/video/coktel_decoder.cpp')
-rw-r--r--graphics/video/coktel_decoder.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/graphics/video/coktel_decoder.cpp b/graphics/video/coktel_decoder.cpp
index 4af11c3f1a..9d056da48d 100644
--- a/graphics/video/coktel_decoder.cpp
+++ b/graphics/video/coktel_decoder.cpp
@@ -205,6 +205,10 @@ void CoktelDecoder::disableSound() {
_audioStream = 0;
}
+bool CoktelDecoder::getFrameCoords(int16 frame, int16 &x, int16 &y, int16 &width, int16 &height) {
+ return false;
+}
+
bool CoktelDecoder::hasEmbeddedFiles() const {
return false;
}
@@ -2332,6 +2336,38 @@ PixelFormat VMDDecoder::getPixelFormat() const {
return PixelFormat::createFormatCLUT8();
}
+bool VMDDecoder::getPartCoords(int16 frame, PartType type, int16 &x, int16 &y, int16 &width, int16 &height) {
+ if (frame >= ((int32) _frameCount))
+ return false;
+
+ Frame &f = _frames[frame];
+
+ // Look for a part matching the requested type, stopping at a separator
+ Part *part = 0;
+ for (int i = 0; i < _partsPerFrame; i++) {
+ Part &p = f.parts[i];
+
+ if ((p.type == kPartTypeSeparator) || (p.type == type)) {
+ part = &p;
+ break;
+ }
+ }
+
+ if (!part)
+ return false;
+
+ x = part->left;
+ y = part->top;
+ width = part->right - part->left + 1;
+ height = part->bottom - part->top + 1;
+
+ return true;
+}
+
+bool VMDDecoder::getFrameCoords(int16 frame, int16 &x, int16 &y, int16 &width, int16 &height) {
+ return getPartCoords(frame, kPartTypeVideo, x, y, width, height);
+}
+
bool VMDDecoder::hasEmbeddedFiles() const {
return !_files.empty();
}