From 0c6c7de3554a65a22324a0aa89b111aa7f2fa79f Mon Sep 17 00:00:00 2001 From: Sven Hesse Date: Thu, 19 Jun 2008 22:54:17 +0000 Subject: Fixed a palette issue in Lost in Time svn-id: r32738 --- engines/gob/videoplayer.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'engines/gob/videoplayer.cpp') diff --git a/engines/gob/videoplayer.cpp b/engines/gob/videoplayer.cpp index 909d39a63b..aa47e6cf84 100644 --- a/engines/gob/videoplayer.cpp +++ b/engines/gob/videoplayer.cpp @@ -588,12 +588,14 @@ bool VideoPlayer::doPlay(int16 frame, int16 breakKey, } void VideoPlayer::copyPalette(CoktelVideo &video, int16 palStart, int16 palEnd) { - if ((palStart != -1) && (palEnd != -1)) - memcpy(((char *) (_vm->_global->_pPaletteDesc->vgaPal)) + palStart * 3, - video.getPalette() + palStart * 3, - (palEnd - palStart + 1) * 3); - else - memcpy((char *) _vm->_global->_pPaletteDesc->vgaPal, video.getPalette(), 768); + if (palStart < 0) + palStart = 0; + if (palEnd < 0) + palEnd = 255; + + memcpy(((char *) (_vm->_global->_pPaletteDesc->vgaPal)) + palStart * 3, + video.getPalette() + palStart * 3, + (palEnd - palStart + 1) * 3); } void VideoPlayer::writeVideoInfo(const char *videoFile, int16 varX, int16 varY, -- cgit v1.2.3