From 1ead0d8436cdea9fd6a54af6bf749297afa75a17 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Thu, 16 Dec 2010 01:41:11 +0000 Subject: VIDEO: Make VideoDecoder::getPalette() return a const byte pointer svn-id: r54928 --- engines/mohawk/video.cpp | 2 +- engines/sci/video/seq_decoder.h | 2 +- engines/sword1/animation.cpp | 2 +- engines/sword2/animation.cpp | 2 +- graphics/video/avi_decoder.h | 2 +- graphics/video/coktel_decoder.cpp | 2 +- graphics/video/coktel_decoder.h | 2 +- graphics/video/dxa_decoder.h | 2 +- graphics/video/flic_decoder.h | 2 +- graphics/video/qt_decoder.h | 2 +- graphics/video/smk_decoder.h | 2 +- graphics/video/video_decoder.cpp | 2 +- graphics/video/video_decoder.h | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/engines/mohawk/video.cpp b/engines/mohawk/video.cpp index e54aa67df3..11929c2852 100644 --- a/engines/mohawk/video.cpp +++ b/engines/mohawk/video.cpp @@ -187,7 +187,7 @@ bool VideoManager::updateBackgroundMovies() { if (frame->bytesPerPixel == 1 && pixelFormat.bytesPerPixel != 1) { convertedFrame = new Graphics::Surface(); - byte *palette = _videoStreams[i]->getPalette(); + const byte *palette = _videoStreams[i]->getPalette(); assert(palette); convertedFrame->create(frame->w, frame->h, pixelFormat.bytesPerPixel); diff --git a/engines/sci/video/seq_decoder.h b/engines/sci/video/seq_decoder.h index 4d94d145ce..4150137223 100644 --- a/engines/sci/video/seq_decoder.h +++ b/engines/sci/video/seq_decoder.h @@ -49,7 +49,7 @@ public: uint32 getFrameCount() const { return _frameCount; } const Graphics::Surface *decodeNextFrame(); Graphics::PixelFormat getPixelFormat() const { return Graphics::PixelFormat::createFormatCLUT8(); } - byte *getPalette() { _dirtyPalette = false; return _palette; } + const byte *getPalette() { _dirtyPalette = false; return _palette; } bool hasDirtyPalette() const { return _dirtyPalette; } protected: diff --git a/engines/sword1/animation.cpp b/engines/sword1/animation.cpp index 8df1812098..e0b601d547 100644 --- a/engines/sword1/animation.cpp +++ b/engines/sword1/animation.cpp @@ -264,7 +264,7 @@ bool MoviePlayer::playVideo() { uint32 weight; byte r, g, b; - byte *palette = _decoder->getPalette(); + const byte *palette = _decoder->getPalette(); for (int i = 0; i < 256; i++) { r = *palette++; diff --git a/engines/sword2/animation.cpp b/engines/sword2/animation.cpp index 617c254ec4..50548486f0 100644 --- a/engines/sword2/animation.cpp +++ b/engines/sword2/animation.cpp @@ -291,7 +291,7 @@ bool MoviePlayer::playVideo() { uint32 weight; byte r, g, b; - byte *palette = _decoder->getPalette(); + const byte *palette = _decoder->getPalette(); for (int i = 0; i < 256; i++) { r = *palette++; diff --git a/graphics/video/avi_decoder.h b/graphics/video/avi_decoder.h index 306b32a076..6eebb241f2 100644 --- a/graphics/video/avi_decoder.h +++ b/graphics/video/avi_decoder.h @@ -178,7 +178,7 @@ public: uint32 getElapsedTime() const; const Surface *decodeNextFrame(); PixelFormat getPixelFormat() const; - byte *getPalette() { _dirtyPalette = false; return _palette; } + const byte *getPalette() { _dirtyPalette = false; return _palette; } bool hasDirtyPalette() const { return _dirtyPalette; } protected: diff --git a/graphics/video/coktel_decoder.cpp b/graphics/video/coktel_decoder.cpp index bcde7ff51e..e26ec33048 100644 --- a/graphics/video/coktel_decoder.cpp +++ b/graphics/video/coktel_decoder.cpp @@ -257,7 +257,7 @@ uint32 CoktelDecoder::getFrameCount() const { return _frameCount; } -byte *CoktelDecoder::getPalette() { +const byte *CoktelDecoder::getPalette() { return _palette; } diff --git a/graphics/video/coktel_decoder.h b/graphics/video/coktel_decoder.h index 7b54c80304..4660443a30 100644 --- a/graphics/video/coktel_decoder.h +++ b/graphics/video/coktel_decoder.h @@ -123,7 +123,7 @@ public: uint32 getFrameCount() const; - byte *getPalette(); + const byte *getPalette(); bool hasDirtyPalette() const; diff --git a/graphics/video/dxa_decoder.h b/graphics/video/dxa_decoder.h index e4688e36cd..a9a656e46d 100644 --- a/graphics/video/dxa_decoder.h +++ b/graphics/video/dxa_decoder.h @@ -52,7 +52,7 @@ public: uint32 getFrameCount() const { return _frameCount; } const Surface *decodeNextFrame(); PixelFormat getPixelFormat() const { return PixelFormat::createFormatCLUT8(); } - byte *getPalette() { _dirtyPalette = false; return _palette; } + const byte *getPalette() { _dirtyPalette = false; return _palette; } bool hasDirtyPalette() const { return _dirtyPalette; } /** diff --git a/graphics/video/flic_decoder.h b/graphics/video/flic_decoder.h index b716a87b62..21d5f22ccb 100644 --- a/graphics/video/flic_decoder.h +++ b/graphics/video/flic_decoder.h @@ -71,7 +71,7 @@ public: void clearDirtyRects() { _dirtyRects.clear(); } void copyDirtyRectsToBuffer(uint8 *dst, uint pitch); - byte *getPalette() { _paletteChanged = false; return _palette; } + const byte *getPalette() { _paletteChanged = false; return _palette; } bool hasDirtyPalette() const { return _paletteChanged; } void reset(); diff --git a/graphics/video/qt_decoder.h b/graphics/video/qt_decoder.h index e409ebb55d..8c1ab0b27b 100644 --- a/graphics/video/qt_decoder.h +++ b/graphics/video/qt_decoder.h @@ -96,7 +96,7 @@ public: * Returns the palette of the video * @return the palette of the video */ - byte *getPalette() { _dirtyPalette = false; return _palette; } + const byte *getPalette() { _dirtyPalette = false; return _palette; } bool hasDirtyPalette() const { return _dirtyPalette; } /** diff --git a/graphics/video/smk_decoder.h b/graphics/video/smk_decoder.h index da64927b49..1f9c5a1d3e 100644 --- a/graphics/video/smk_decoder.h +++ b/graphics/video/smk_decoder.h @@ -67,7 +67,7 @@ public: uint32 getElapsedTime() const; const Surface *decodeNextFrame(); PixelFormat getPixelFormat() const { return PixelFormat::createFormatCLUT8(); } - byte *getPalette() { _dirtyPalette = false; return _palette; } + const byte *getPalette() { _dirtyPalette = false; return _palette; } bool hasDirtyPalette() const { return _dirtyPalette; } virtual void handleAudioTrack(byte track, uint32 chunkSize, uint32 unpackedSize); diff --git a/graphics/video/video_decoder.cpp b/graphics/video/video_decoder.cpp index 081f47bf78..da3aae2821 100644 --- a/graphics/video/video_decoder.cpp +++ b/graphics/video/video_decoder.cpp @@ -50,7 +50,7 @@ uint32 VideoDecoder::getElapsedTime() const { } void VideoDecoder::setSystemPalette() { - byte *vidPalette = getPalette(); + const byte *vidPalette = getPalette(); byte *sysPalette = new byte[256 * 4]; for (uint16 i = 0; i < 256; i++) { diff --git a/graphics/video/video_decoder.h b/graphics/video/video_decoder.h index a84253ac2b..437d7a41d6 100644 --- a/graphics/video/video_decoder.h +++ b/graphics/video/video_decoder.h @@ -119,7 +119,7 @@ public: /** * Get the palette for the video in RGB format (if 8bpp or less) */ - virtual byte *getPalette() { return 0; } + virtual const byte *getPalette() { return 0; } /** * Returns if the palette is dirty or not -- cgit v1.2.3