aboutsummaryrefslogtreecommitdiff
path: root/engines/bladerunner/ui
diff options
context:
space:
mode:
authorCameron Cawley2019-09-12 21:02:52 +0100
committerPeter Kohaut2019-09-12 22:02:52 +0200
commitc786b139dbfdff69dbd0275848157c1fddee10f9 (patch)
tree3ad6e8698b20c1b75b3459037e25d6977b8acb9e /engines/bladerunner/ui
parentdebe25907419990337ae1f631fa04c8615fb68a4 (diff)
downloadscummvm-rg350-c786b139dbfdff69dbd0275848157c1fddee10f9.tar.gz
scummvm-rg350-c786b139dbfdff69dbd0275848157c1fddee10f9.tar.bz2
scummvm-rg350-c786b139dbfdff69dbd0275848157c1fddee10f9.zip
BLADERUNNER: Remove use of unaligned memory access (#1839)
Diffstat (limited to 'engines/bladerunner/ui')
-rw-r--r--engines/bladerunner/ui/esper.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/engines/bladerunner/ui/esper.cpp b/engines/bladerunner/ui/esper.cpp
index ef72049a4c..2290cdb121 100644
--- a/engines/bladerunner/ui/esper.cpp
+++ b/engines/bladerunner/ui/esper.cpp
@@ -1149,7 +1149,7 @@ void ESPER::flashViewport() {
for (int x = 0; x < _surfaceViewport.w; ++x) {
uint8 r, g, b;
void *ptr = _surfaceViewport.getBasePtr(x, y);
- _surfaceViewport.format.colorToRGB(*(uint32*)ptr, r, g, b);
+ _surfaceViewport.format.colorToRGB(READ_UINT32(ptr), r, g, b);
b *= 2;
drawPixel(_surfaceViewport, ptr, _surfaceViewport.format.RGBToColor(r, g, b));
}
@@ -1181,7 +1181,7 @@ void ESPER::copyImageScale(Graphics::Surface &src, Common::Rect srcRect, Graphic
dstY = CLIP(dstY, 0, dst.h - 1);
uint8 r, g, b;
- src.format.colorToRGB(*(uint32*)src.getBasePtr(srcX, srcY), r, g, b);
+ src.format.colorToRGB(READ_UINT32(src.getBasePtr(srcX, srcY)), r, g, b);
if (_flash) {
// add blue-ish tint
b *= 2;
@@ -1224,7 +1224,7 @@ void ESPER::copyImageScale(Graphics::Surface &src, Common::Rect srcRect, Graphic
dstY = CLIP(dstY, 0, dst.h - 1);
uint8 r, g, b;
- src.format.colorToRGB(*(uint32*)src.getBasePtr(srcX, srcY), r, g, b);
+ src.format.colorToRGB(READ_UINT32(src.getBasePtr(srcX, srcY)), r, g, b);
if (_flash) {
// add blue-ish tint
b *= 2;
@@ -1289,7 +1289,7 @@ void ESPER::copyImageBlur(Graphics::Surface &src, Common::Rect srcRect, Graphics
dstY = CLIP(dstY, 0, dst.h - 1);
uint8 r, g, b;
- src.format.colorToRGB(*(uint32*)src.getBasePtr(srcX, srcY), r, g, b);
+ src.format.colorToRGB(READ_UINT32(src.getBasePtr(srcX, srcY)), r, g, b);
if (_flash) {
// add blue-ish tint
b *= 2;
@@ -1359,7 +1359,7 @@ void ESPER::copyImageBlur(Graphics::Surface &src, Common::Rect srcRect, Graphics
dstY = CLIP(dstY, 0, dst.h - 1);
uint8 r, g, b;
- src.format.colorToRGB(*(uint32*)src.getBasePtr(srcX, srcY), r, g, b);
+ src.format.colorToRGB(READ_UINT32(src.getBasePtr(srcX, srcY)), r, g, b);
if (_flash) {
// add blue-ish tint
b *= 2;
@@ -1389,7 +1389,7 @@ void ESPER::copyImageBlit(Graphics::Surface &src, Common::Rect srcRect, Graphics
for (int y = 0; y < dstRect.height(); ++y) {
for (int x = 0; x < dstRect.width(); ++x) {
uint8 r, g, b;
- src.format.colorToRGB(*(uint32*)src.getBasePtr(CLIP(srcRect.left + x, 0, src.w - 1), CLIP(srcRect.top + y, 0, src.h - 1)), r, g, b);
+ src.format.colorToRGB(READ_UINT32(src.getBasePtr(CLIP(srcRect.left + x, 0, src.w - 1), CLIP(srcRect.top + y, 0, src.h - 1))), r, g, b);
drawPixel(dst, dst.getBasePtr(CLIP(dstRect.left + x, 0, dst.w - 1), CLIP(dstRect.top + y, 0, dst.h - 1)), dst.format.RGBToColor(r, g, b));
}
}