From 6fce92b0ea2fce78c375ade0bc6c2ac4231b96bd Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sat, 3 Aug 2013 02:05:40 +0200 Subject: VIDEO: Prefer getBasePtr over direct Surface::pixels access. --- video/codecs/cinepak.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'video/codecs/cinepak.cpp') diff --git a/video/codecs/cinepak.cpp b/video/codecs/cinepak.cpp index bcf0cf1180..363ca43f61 100644 --- a/video/codecs/cinepak.cpp +++ b/video/codecs/cinepak.cpp @@ -41,11 +41,11 @@ namespace Video { byte b = _clipTable[lum + (u << 1)]; \ \ if (_pixelFormat.bytesPerPixel == 2) \ - *((uint16 *)_curFrame.surface->pixels + offset) = _pixelFormat.RGBToColor(r, g, b); \ + *((uint16 *)_curFrame.surface->getBasePtr(0, 0) + offset) = _pixelFormat.RGBToColor(r, g, b); \ else \ - *((uint32 *)_curFrame.surface->pixels + offset) = _pixelFormat.RGBToColor(r, g, b); \ + *((uint32 *)_curFrame.surface->getBasePtr(0, 0) + offset) = _pixelFormat.RGBToColor(r, g, b); \ } else \ - *((byte *)_curFrame.surface->pixels + offset) = lum + *((byte *)_curFrame.surface->getBasePtr(0, 0) + offset) = lum CinepakDecoder::CinepakDecoder(int bitsPerPixel) : Codec() { _curFrame.surface = NULL; -- cgit v1.2.3 From e0c9c1d261665f51a202b2446bf7ff7eff888d51 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sat, 3 Aug 2013 02:35:51 +0200 Subject: VIDEO: Take advantage of Surface::getPixels. --- video/codecs/cinepak.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'video/codecs/cinepak.cpp') diff --git a/video/codecs/cinepak.cpp b/video/codecs/cinepak.cpp index 363ca43f61..a7782f4192 100644 --- a/video/codecs/cinepak.cpp +++ b/video/codecs/cinepak.cpp @@ -41,11 +41,11 @@ namespace Video { byte b = _clipTable[lum + (u << 1)]; \ \ if (_pixelFormat.bytesPerPixel == 2) \ - *((uint16 *)_curFrame.surface->getBasePtr(0, 0) + offset) = _pixelFormat.RGBToColor(r, g, b); \ + *((uint16 *)_curFrame.surface->getPixels() + offset) = _pixelFormat.RGBToColor(r, g, b); \ else \ - *((uint32 *)_curFrame.surface->getBasePtr(0, 0) + offset) = _pixelFormat.RGBToColor(r, g, b); \ + *((uint32 *)_curFrame.surface->getPixels() + offset) = _pixelFormat.RGBToColor(r, g, b); \ } else \ - *((byte *)_curFrame.surface->getBasePtr(0, 0) + offset) = lum + *((byte *)_curFrame.surface->getPixels() + offset) = lum CinepakDecoder::CinepakDecoder(int bitsPerPixel) : Codec() { _curFrame.surface = NULL; -- cgit v1.2.3