From 0a8e552c6d761cb37a248c573c67d9fa468ca12f Mon Sep 17 00:00:00 2001 From: Strangerke Date: Tue, 17 May 2016 22:21:27 +0200 Subject: GNAP: Fix the coding style of a couple of casts --- engines/gnap/gamesys.cpp | 22 +++++++++++----------- engines/gnap/resource.cpp | 2 +- engines/gnap/resource.h | 2 +- engines/gnap/scenes/intro.cpp | 4 ++-- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/engines/gnap/gamesys.cpp b/engines/gnap/gamesys.cpp index 4c105d989f..61ea7c26ac 100644 --- a/engines/gnap/gamesys.cpp +++ b/engines/gnap/gamesys.cpp @@ -284,7 +284,7 @@ void GameSys::drawTextToSurface(Graphics::Surface *surface, int x, int y, byte r const byte *data = _dejaVuSans9ptCharBitmaps + _dejaVuSans9ptCharDescriptors[c]._offset; for (int xc = 0; xc < w; ++xc) { for (int yc = 15; yc >= 0; --yc) { - byte *dst = (byte*)surface->getBasePtr(x + xc, y + yc); + byte *dst = (byte *)surface->getBasePtr(x + xc, y + yc); if (data[1 - (yc >> 3)] & (1 << (yc & 7))) WRITE_LE_UINT32(dst, color); } @@ -387,8 +387,8 @@ void GameSys::drawBitmap(int resourceId) { bmpSurface->w != _backgroundSurface->w || bmpSurface->h != _backgroundSurface->h) { debugC(kDebugBasic, "GameSys::drawBitmap() Different bitmap properties than current background"); } else { - byte *src = (byte*)bmpSurface->getPixels(); - byte *dst = (byte*)_backgroundSurface->getPixels(); + byte *src = (byte *)bmpSurface->getPixels(); + byte *dst = (byte *)_backgroundSurface->getPixels(); const int pitch = bmpSurface->pitch; int height = bmpSurface->h; while (height--) { @@ -606,8 +606,8 @@ void GameSys::restoreBackgroundRect(const Common::Rect &rect) { Common::Rect clipRect; if (!intersectRect(clipRect, rect, _screenRect)) return; - byte *src = (byte*)_backgroundSurface->getBasePtr(clipRect.left, clipRect.top); - byte *dst = (byte*)_frontSurface->getBasePtr(clipRect.left, clipRect.top); + byte *src = (byte *)_backgroundSurface->getBasePtr(clipRect.left, clipRect.top); + byte *dst = (byte *)_frontSurface->getBasePtr(clipRect.left, clipRect.top); const int bytes = _backgroundSurface->format.bytesPerPixel * clipRect.width(); int height = clipRect.height(); while (height--) { @@ -621,8 +621,8 @@ void GameSys::blitSurface32(Graphics::Surface *destSurface, int x, int y, Graphi Common::Rect &sourceRect, bool transparent) { const int sourcePitch = sourceSurface->pitch; - byte *dst = (byte*)destSurface->getBasePtr(x, y); - byte *src = (byte*)sourceSurface->getBasePtr(sourceRect.left, sourceRect.top); + byte *dst = (byte *)destSurface->getBasePtr(x, y); + byte *src = (byte *)sourceSurface->getBasePtr(sourceRect.left, sourceRect.top); int width = sourceRect.width(); int height = sourceRect.height(); while (height--) { @@ -644,7 +644,7 @@ void GameSys::blitSprite32(Graphics::Surface *destSurface, int x, int y, byte *s int sourceWidth, Common::Rect &sourceRect, uint32 *sourcePalette, bool transparent) { const int sourcePitch = (sourceWidth + 3) & 0xFFFFFFFC; - byte *dst = (byte*)destSurface->getBasePtr(x, y); + byte *dst = (byte *)destSurface->getBasePtr(x, y); byte *src = sourcePixels + sourceRect.left + sourcePitch * sourceRect.top; int width = sourceRect.width(); int height = sourceRect.height(); @@ -677,7 +677,7 @@ void GameSys::blitSpriteScaled32(Graphics::Surface *destSurface, Common::Rect &f const int sourcePitch = (sourceWidth + 3) & 0xFFFFFFFC; if (!frameRect.equals(destRect)) { - byte *dst = (byte*)destSurface->getBasePtr(destRect.left, destRect.top); + byte *dst = (byte *)destSurface->getBasePtr(destRect.left, destRect.top); byte *src = sourcePixels + sourcePitch * sourceRect.top + sourceRect.left; const int height = destRect.bottom - destRect.top; const int width = destRect.right - destRect.left; @@ -704,7 +704,7 @@ void GameSys::blitSpriteScaled32(Graphics::Surface *destSurface, Common::Rect &f hsrc = src + sourcePitch * ((yi + 0x8000) >> 16); } } else { - byte *dst = (byte*)destSurface->getBasePtr(frameRect.left, frameRect.top); + byte *dst = (byte *)destSurface->getBasePtr(frameRect.left, frameRect.top); byte *src = sourcePixels + sourcePitch * sourceRect.top + sourceRect.left; const int height = frameRect.bottom - frameRect.top; const int width = frameRect.right - frameRect.left; @@ -887,7 +887,7 @@ void GameSys::drawSprites() { void GameSys::updateRect(const Common::Rect &r) { debugC(kDebugBasic, "GameSys::updateRect() %d, %d, %d, %d [%d, %d]", r.left, r.top, r.right, r.bottom, r.width(), r.height()); if (r.width() > 0 && r.height() > 0) { - byte *pixels = (byte*)_frontSurface->getBasePtr(r.left, r.top); + byte *pixels = (byte *)_frontSurface->getBasePtr(r.left, r.top); _vm->_system->copyRectToScreen(pixels, _frontSurface->pitch, r.left, r.top, r.width(), r.height()); } diff --git a/engines/gnap/resource.cpp b/engines/gnap/resource.cpp index 1ed45d8164..9936324c2b 100644 --- a/engines/gnap/resource.cpp +++ b/engines/gnap/resource.cpp @@ -96,7 +96,7 @@ SpriteResource::SpriteResource(int resourceId, byte *data, uint32 size) { _unknownVal2 = READ_LE_UINT16(_data + 6); _transparent = (READ_LE_UINT16(_data + 8) != 0); _colorsCount = READ_LE_UINT16(_data + 10); - _palette = (uint32*)(_data + 12); + _palette = (uint32 *)(_data + 12); _pixels = _data + 12 + _colorsCount * 4; debugC(kDebugBasic, "SpriteResource() width: %d; height: %d; colorsCount: %d", _width, _height, _colorsCount); } diff --git a/engines/gnap/resource.h b/engines/gnap/resource.h index 00b8740ac1..35787fa48d 100644 --- a/engines/gnap/resource.h +++ b/engines/gnap/resource.h @@ -157,7 +157,7 @@ protected: ~Resource() { delete _obj; } }; - typedef Common::HashMap CacheMap; + typedef Common::HashMap CacheMap; typedef typename CacheMap::iterator CacheMapIterator; DatManager *_dat; diff --git a/engines/gnap/scenes/intro.cpp b/engines/gnap/scenes/intro.cpp index fa23d6a2b3..1679fe8306 100644 --- a/engines/gnap/scenes/intro.cpp +++ b/engines/gnap/scenes/intro.cpp @@ -90,8 +90,8 @@ void SceneIntro::run() { } else { // The intro AVI is played upside down, it's the only video played in the English version for (uint16 y = 0; y < frame->h / 2; y++) { - uint32 *ptrFrom = (uint32*)frame->getBasePtr(0, y); - uint32 *ptrTo = (uint32*)frame->getBasePtr(0, frame->h - y - 1); + uint32 *ptrFrom = (uint32 *)frame->getBasePtr(0, y); + uint32 *ptrTo = (uint32 *)frame->getBasePtr(0, frame->h - y - 1); for (uint16 x = 0; x < frame->w; x++) { uint32 t = *ptrFrom; *ptrFrom = *ptrTo; -- cgit v1.2.3