From af96a0fa3bfe0509efbdf99d15b1dd0d146f8968 Mon Sep 17 00:00:00 2001 From: Sven Hesse Date: Sun, 8 Aug 2010 01:03:50 +0000 Subject: VIDEO: Implement VMDDecoder::setXY() svn-id: r51912 --- graphics/video/coktel_decoder.cpp | 26 ++++++++++++++++++++++++++ graphics/video/coktel_decoder.h | 2 ++ 2 files changed, 28 insertions(+) (limited to 'graphics') diff --git a/graphics/video/coktel_decoder.cpp b/graphics/video/coktel_decoder.cpp index 9d056da48d..3caf7f2e7f 100644 --- a/graphics/video/coktel_decoder.cpp +++ b/graphics/video/coktel_decoder.cpp @@ -1502,6 +1502,30 @@ bool VMDDecoder::seek(int32 frame, int whence, bool restart) { return true; } +void VMDDecoder::setXY(uint16 x, uint16 y) { + for (uint32 i = 0; i < _frameCount; i++) { + for (int j = 0; j < _partsPerFrame; j++) { + + if (_frames[i].parts[j].type == kPartTypeVideo) { + if (x != 0xFFFF) { + _frames[i].parts[j].left = _frames[i].parts[j].left - _x + x; + _frames[i].parts[j].right = _frames[i].parts[j].right - _x + x; + } + if (y != 0xFFFF) { + _frames[i].parts[j].top = _frames[i].parts[j].top - _y + y; + _frames[i].parts[j].bottom = _frames[i].parts[j].bottom - _y + y; + } + } + + } + } + + if (x != 0xFFFF) + _x = x; + if (y != 0xFFFF) + _y = y; +} + bool VMDDecoder::load(Common::SeekableReadStream *stream) { close(); @@ -2047,11 +2071,13 @@ bool VMDDecoder::renderFrame(Common::Rect &rect) { if (_externalCodec) { // TODO + warning("_external codec"); return false; } if (_blitMode > 0) { // TODO + warning("_blitMode == %d", _blitMode); return false; } diff --git a/graphics/video/coktel_decoder.h b/graphics/video/coktel_decoder.h index 60fdb57123..755406b491 100644 --- a/graphics/video/coktel_decoder.h +++ b/graphics/video/coktel_decoder.h @@ -343,6 +343,8 @@ public: bool seek(int32 frame, int whence = SEEK_SET, bool restart = false); + void setXY(uint16 x, uint16 y); + bool getFrameCoords(int16 frame, int16 &x, int16 &y, int16 &width, int16 &height); bool hasEmbeddedFiles() const; -- cgit v1.2.3