diff options
author | Eugene Sandulenko | 2010-08-06 13:13:25 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2010-10-12 22:35:55 +0000 |
commit | 47904bc7b2992189bb554833f00a79ff0fea9fb8 (patch) | |
tree | 1cec51758c6741b970bd064fafee77607b9f884f /engines/sword25/gfx/opengl/glvectorimageblit.cpp | |
parent | ca17def625154e5f758b797e4fc48c76b0566320 (diff) | |
download | scummvm-rg350-47904bc7b2992189bb554833f00a79ff0fea9fb8.tar.gz scummvm-rg350-47904bc7b2992189bb554833f00a79ff0fea9fb8.tar.bz2 scummvm-rg350-47904bc7b2992189bb554833f00a79ff0fea9fb8.zip |
SWORD25: Mass-astyle.
svn-id: r53222
Diffstat (limited to 'engines/sword25/gfx/opengl/glvectorimageblit.cpp')
-rw-r--r-- | engines/sword25/gfx/opengl/glvectorimageblit.cpp | 54 |
1 files changed, 23 insertions, 31 deletions
diff --git a/engines/sword25/gfx/opengl/glvectorimageblit.cpp b/engines/sword25/gfx/opengl/glvectorimageblit.cpp index 262153f59e..9368e921e1 100644 --- a/engines/sword25/gfx/opengl/glvectorimageblit.cpp +++ b/engines/sword25/gfx/opengl/glvectorimageblit.cpp @@ -23,7 +23,7 @@ * */ -/* +/* * This code is based on Broken Sword 2.5 engine * * Copyright (c) Malte Thiesen, Daniel Queteschiner and Michael Elsdoerfer @@ -50,64 +50,56 @@ using namespace std; // ----------------------------------------------------------------------------- -namespace -{ - const float LINE_SCALE_FACTOR = 1.0f; +namespace { +const float LINE_SCALE_FACTOR = 1.0f; } // ----------------------------------------------------------------------------- bool BS_VectorImage::Blit(int PosX, int PosY, - int Flipping, - BS_Rect* pPartRect, - unsigned int Color, - int Width, int Height) -{ + int Flipping, + BS_Rect *pPartRect, + unsigned int Color, + int Width, int Height) { static BS_VectorImageRenderer VectorImageRenderer; static vector<char> PixelData; static GLS_Sprite Sprite = 0; - static BS_VectorImage * OldThis = 0; - static int OldWidth; - static int OldHeight; - static GLS_Rect OldSubImage; + static BS_VectorImage *OldThis = 0; + static int OldWidth; + static int OldHeight; + static GLS_Rect OldSubImage; // Falls Breite oder Höhe 0 sind, muss nichts dargestellt werden. if (Width == 0 || Height == 0) return true; // Sprite erstellen, falls es noch nicht erstellt wurde - if (Sprite == 0) - { + if (Sprite == 0) { GLS_Result Result = GLS_NewSprite(512, 512, GLS_True, 0, &Sprite); - if (Result != GLS_OK) - { + if (Result != GLS_OK) { BS_LOG_ERRORLN("Could not create GLS_Sprite. Reason: %s", GLS_ResultString(Result)); return false; } } // Feststellen, ob das alte Bild im Cache nicht wiederbenutzt werden kann und neu Berechnet werden muss - if (!(OldThis == this && OldWidth == Width && OldHeight == Height && Sprite != 0)) - { + if (!(OldThis == this && OldWidth == Width && OldHeight == Height && Sprite != 0)) { float ScaleFactorX = (Width == - 1) ? 1 : static_cast<float>(Width) / static_cast<float>(GetWidth()); - float ScaleFactorY = (Height == - 1) ? 1: static_cast<float>(Height) / static_cast<float>(GetHeight()); + float ScaleFactorY = (Height == - 1) ? 1 : static_cast<float>(Height) / static_cast<float>(GetHeight()); unsigned int RenderedWidth; unsigned int RenderedHeight; - if (!VectorImageRenderer.Render(*this, ScaleFactorX, ScaleFactorY, RenderedWidth, RenderedHeight, PixelData, LINE_SCALE_FACTOR)) - { + if (!VectorImageRenderer.Render(*this, ScaleFactorX, ScaleFactorY, RenderedWidth, RenderedHeight, PixelData, LINE_SCALE_FACTOR)) { BS_LOG_ERRORLN("Call to BS_VectorImageRenderer::Render() failed."); return false; } - if (RenderedWidth > 512 || RenderedHeight > 512) - { + if (RenderedWidth > 512 || RenderedHeight > 512) { BS_LOG_WARNINGLN("Currently the maximum size for scaled vector images is 512x512."); return true; } GLS_Result Result = GLS_SetSpriteData(Sprite, RenderedWidth, RenderedHeight, &PixelData[0], 0); - if (Result != GLS_OK) - { + if (Result != GLS_OK) { BS_LOG_ERRORLN("Call to GLS_SetSpriteData() failed. Reason: %s", GLS_ResultString(Result)); return false; } @@ -140,11 +132,11 @@ bool BS_VectorImage::Blit(int PosX, int PosY, // Die Bedeutung von FLIP_V und FLIP_H ist vertauscht. Allerdings glaubt der Rest der Engine auch daran, daher war es einfacher diesen Fehler // weiterzuführen. Bei Gelegenheit ist dieses aber zu ändern. GLS_Result Result = GLS_Blit(Sprite, - PosX, PosY, - &OldSubImage, &GLSColor, - (Flipping & BS_Image::FLIP_V) ? GLS_True : GLS_False, - (Flipping & BS_Image::FLIP_H) ? GLS_True : GLS_False, - 1.0f, 1.0f); + PosX, PosY, + &OldSubImage, &GLSColor, + (Flipping & BS_Image::FLIP_V) ? GLS_True : GLS_False, + (Flipping & BS_Image::FLIP_H) ? GLS_True : GLS_False, + 1.0f, 1.0f); if (Result != GLS_OK) BS_LOG_ERRORLN("GLS_Blit() failed. Reason: %s", GLS_ResultString(Result)); return Result == GLS_OK; |