GOB: Allow true-color VMD cursors
svn-id: r55264
This commit is contained in:
parent
32b94cc236
commit
518e858d85
3 changed files with 12 additions and 7 deletions
|
@ -234,14 +234,15 @@ bool Inter_v6::o6_loadCursor(OpFuncParams ¶ms) {
|
|||
int16 framesCount = _vm->_vidPlayer->getFrameCount(vmdSlot);
|
||||
|
||||
for (int i = 0; i < framesCount; i++) {
|
||||
props.startFrame = i;
|
||||
props.lastFrame = i;
|
||||
props.startFrame = i;
|
||||
props.lastFrame = i;
|
||||
props.waitEndFrame = false;
|
||||
|
||||
_vm->_vidPlayer->play(vmdSlot, props);
|
||||
_vm->_vidPlayer->copyFrame(vmdSlot, _vm->_draw->_cursorSprites->getData(),
|
||||
0, 0, _vm->_draw->_cursorWidth, _vm->_draw->_cursorWidth,
|
||||
(start + i) * _vm->_draw->_cursorWidth, 0,
|
||||
_vm->_draw->_cursorSprites->getWidth());
|
||||
_vm->_draw->_cursorSprites->getWidth() * 2, 2);
|
||||
}
|
||||
|
||||
_vm->_vidPlayer->closeVideo(vmdSlot);
|
||||
|
|
|
@ -563,7 +563,7 @@ void VideoPlayer::writeVideoInfo(const Common::String &file, int16 varX, int16 v
|
|||
|
||||
bool VideoPlayer::copyFrame(int slot, byte *dest,
|
||||
uint16 left, uint16 top, uint16 width, uint16 height,
|
||||
uint16 x, uint16 y, uint16 pitch, int16 transp) const {
|
||||
uint16 x, uint16 y, uint16 pitch, uint8 bpp, int16 transp) const {
|
||||
|
||||
const Video *video = getVideoBySlot(slot);
|
||||
if (!video)
|
||||
|
@ -573,6 +573,8 @@ bool VideoPlayer::copyFrame(int slot, byte *dest,
|
|||
if (!surface)
|
||||
return false;
|
||||
|
||||
assert(surface->bytesPerPixel == bpp);
|
||||
|
||||
int32 w = MIN<int32>(width , surface->w);
|
||||
int32 h = MIN<int32>(height, surface->h);
|
||||
|
||||
|
@ -585,7 +587,7 @@ bool VideoPlayer::copyFrame(int slot, byte *dest,
|
|||
if ((x == 0) && (left == 0) && (pitch == surface->pitch) && (width == surface->w)) {
|
||||
// Dimensions fit, we can copy everything at once
|
||||
|
||||
memcpy(dst, src, w * h);
|
||||
memcpy(dst, src, w * h * bpp);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -595,7 +597,7 @@ bool VideoPlayer::copyFrame(int slot, byte *dest,
|
|||
const byte *srcRow = src;
|
||||
byte *dstRow = dst;
|
||||
|
||||
memcpy(dstRow, srcRow, w);
|
||||
memcpy(dstRow, srcRow, w * bpp);
|
||||
|
||||
src += surface->pitch;
|
||||
dst += pitch;
|
||||
|
@ -606,6 +608,8 @@ bool VideoPlayer::copyFrame(int slot, byte *dest,
|
|||
|
||||
// Copy pixel-by-pixel
|
||||
|
||||
assert(bpp == 1);
|
||||
|
||||
while (h-- > 0) {
|
||||
const byte *srcRow = src;
|
||||
byte *dstRow = dst;
|
||||
|
|
|
@ -132,7 +132,7 @@ public:
|
|||
|
||||
bool copyFrame(int slot, byte *dest,
|
||||
uint16 left, uint16 top, uint16 width, uint16 height,
|
||||
uint16 x, uint16 y, uint16 pitch, int16 transp = -1) const;
|
||||
uint16 x, uint16 y, uint16 pitch, uint8 bpp = 1, int16 transp = -1) const;
|
||||
|
||||
private:
|
||||
struct Video {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue