diff options
author | Paul Gilbert | 2010-08-21 08:20:32 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2010-10-12 23:09:12 +0000 |
commit | 1d16dfd281b30627ce0ade7c6c2de0cb7e4cc985 (patch) | |
tree | aebed8218d896782eedf28f4d9f53d6e656812dc /engines/sword25/gfx/image | |
parent | 018698467143fb2d91c4688db032a883bac8db5c (diff) | |
download | scummvm-rg350-1d16dfd281b30627ce0ade7c6c2de0cb7e4cc985.tar.gz scummvm-rg350-1d16dfd281b30627ce0ade7c6c2de0cb7e4cc985.tar.bz2 scummvm-rg350-1d16dfd281b30627ce0ade7c6c2de0cb7e4cc985.zip |
SWORD25: Refactored engine to remove BS_Rect class
svn-id: r53265
Diffstat (limited to 'engines/sword25/gfx/image')
-rw-r--r-- | engines/sword25/gfx/image/image.h | 10 | ||||
-rw-r--r-- | engines/sword25/gfx/image/vectorimage.cpp | 14 | ||||
-rw-r--r-- | engines/sword25/gfx/image/vectorimage.h | 18 |
3 files changed, 21 insertions, 21 deletions
diff --git a/engines/sword25/gfx/image/image.h b/engines/sword25/gfx/image/image.h index dbf5a7f31d..5ea4a6caa4 100644 --- a/engines/sword25/gfx/image/image.h +++ b/engines/sword25/gfx/image/image.h @@ -44,7 +44,7 @@ // Includes #include "sword25/kernel/common.h" -#include "sword25/math/rect.h" +#include "common/rect.h" #include "sword25/gfx/graphicengine.h" namespace Sword25 { @@ -102,7 +102,7 @@ public: Der Standardwert ist 0. @param Flipping gibt an, wie das Bild gespiegelt werden soll.<br> Der Standardwert ist BS_Image::FLIP_NONE (keine Spiegelung) - @param pSrcPartRect Pointer auf ein BS_Rect, welches den Ausschnitt des Quellbildes spezifiziert, der gerendert + @param pSrcPartRect Pointer auf ein Common::Rect, welches den Ausschnitt des Quellbildes spezifiziert, der gerendert werden soll oder NULL, falls das gesamte Bild gerendert werden soll.<br> Dieser Ausschnitt bezieht sich auf das ungespiegelte und unskalierte Bild.<br> Der Standardwert ist NULL. @@ -133,13 +133,13 @@ public: */ virtual bool Blit(int PosX = 0, int PosY = 0, int Flipping = FLIP_NONE, - BS_Rect *pPartRect = NULL, + Common::Rect *pPartRect = NULL, unsigned int Color = BS_ARGB(255, 255, 255, 255), int Width = -1, int Height = -1) = 0; /** @brief Füllt einen Rechteckigen Bereich des Bildes mit einer Farbe. - @param pFillRect Pointer auf ein BS_Rect, welches den Ausschnitt des Bildes spezifiziert, der gefüllt + @param pFillRect Pointer auf ein Common::Rect, welches den Ausschnitt des Bildes spezifiziert, der gefüllt werden soll oder NULL, falls das gesamte Bild gefüllt werden soll.<br> Der Standardwert ist NULL. @param Color der 32 Bit Farbwert mit dem der Bildbereich gefüllt werden soll. @@ -149,7 +149,7 @@ public: BS_RGB und BS_ARGB benutzt werden. @remark Falls das Rechteck nicht völlig innerhalb des Bildschirms ist, wird es automatisch zurechtgestutzt. */ - virtual bool Fill(const BS_Rect *pFillRect = 0, unsigned int Color = BS_RGB(0, 0, 0)) = 0; + virtual bool Fill(const Common::Rect *pFillRect = 0, unsigned int Color = BS_RGB(0, 0, 0)) = 0; /** @brief Füllt den Inhalt des Bildes mit Pixeldaten. diff --git a/engines/sword25/gfx/image/vectorimage.cpp b/engines/sword25/gfx/image/vectorimage.cpp index 4d01e825ea..b1102d38b8 100644 --- a/engines/sword25/gfx/image/vectorimage.cpp +++ b/engines/sword25/gfx/image/vectorimage.cpp @@ -168,10 +168,10 @@ const u32 MAX_ACCEPTED_FLASH_VERSION = 3; // Die höchste Flash-Dateiversion, d // ----------------------------------------------------------------------------- -// Konvertiert SWF-Rechteckdaten in einem Bitstrom in BS_Rect-Objekte +// Konvertiert SWF-Rechteckdaten in einem Bitstrom in Common::Rect-Objekte // ----------------------------------------------------------------------------- -BS_Rect FlashRectToBSRect(VectorImage::SWFBitStream &bs) { +Common::Rect FlashRectToBSRect(VectorImage::SWFBitStream &bs) { bs.FlushByte(); // Feststellen mit wie vielen Bits die einzelnen Komponenten kodiert sind @@ -183,7 +183,7 @@ BS_Rect FlashRectToBSRect(VectorImage::SWFBitStream &bs) { s32 YMin = bs.GetSignedBits(BitsPerValue); s32 YMax = bs.GetSignedBits(BitsPerValue); - return BS_Rect(XMin, YMin, XMax + 1, YMax + 1); + return Common::Rect(XMin, YMin, XMax + 1, YMax + 1); } @@ -210,7 +210,7 @@ struct CBBGetId { const VectorImageElement &vectorImageElement; }; -BS_Rect CalculateBoundingBox(const VectorImageElement &vectorImageElement) { +Common::Rect CalculateBoundingBox(const VectorImageElement &vectorImageElement) { #if 0 // TODO agg::path_storage Path = vectorImageElement.GetPaths(); CBBGetId IdSource(vectorImageElement); @@ -221,7 +221,7 @@ BS_Rect CalculateBoundingBox(const VectorImageElement &vectorImageElement) { double x1, x2, y1, y2; x1 = x2 = y1 = y2 = 0; #endif - return BS_Rect(static_cast<int>(x1), static_cast<int>(y1), static_cast<int>(x2) + 1, static_cast<int>(y2) + 1); + return Common::Rect(static_cast<int>(x1), static_cast<int>(y1), static_cast<int>(x2) + 1, static_cast<int>(y2) + 1); } } @@ -264,7 +264,7 @@ VectorImage::VectorImage(const unsigned char *pFileData, unsigned int FileSize, } // SWF-Maße auslesen - BS_Rect MovieRect = FlashRectToBSRect(bs); + Common::Rect MovieRect = FlashRectToBSRect(bs); // Framerate und Frameanzahl auslesen /* u32 FrameRate = */bs.GetU16(); @@ -513,7 +513,7 @@ bool VectorImage::ParseStyles(unsigned int ShapeType, SWFBitStream &bs, unsigned // ----------------------------------------------------------------------------- -bool VectorImage::Fill(const BS_Rect *pFillRect, unsigned int Color) { +bool VectorImage::Fill(const Common::Rect *pFillRect, unsigned int Color) { BS_LOG_ERRORLN("Fill() is not supported."); return false; } diff --git a/engines/sword25/gfx/image/vectorimage.h b/engines/sword25/gfx/image/vectorimage.h index b61db91581..c17f98a3d5 100644 --- a/engines/sword25/gfx/image/vectorimage.h +++ b/engines/sword25/gfx/image/vectorimage.h @@ -41,7 +41,7 @@ #include "sword25/kernel/common.h" #include "sword25/gfx/image/image.h" -#include "sword25/math/rect.h" +#include "common/rect.h" #if 0 #include "agg_path_storage.h" @@ -132,7 +132,7 @@ public: return m_FillStyles[FillStyle]; } - const BS_Rect &GetBoundingBox() const { + const Common::Rect &GetBoundingBox() const { return m_BoundingBox; } @@ -150,7 +150,7 @@ private: Common::Array<VectorPathInfo> m_PathInfos; Common::Array<LineStyleType> m_LineStyles; Common::Array<uint32> m_FillStyles; - BS_Rect m_BoundingBox; + Common::Rect m_BoundingBox; }; @@ -171,7 +171,7 @@ public: BS_ASSERT(ElementNr < m_Elements.size()); return m_Elements[ElementNr]; } - const BS_Rect &GetBoundingBox() const { + const Common::Rect &GetBoundingBox() const { return m_BoundingBox; } @@ -179,15 +179,15 @@ public: // Die abstrakten Methoden von BS_Image // virtual int GetWidth() const { - return m_BoundingBox.GetWidth(); + return m_BoundingBox.width(); } virtual int GetHeight() const { - return m_BoundingBox.GetHeight(); + return m_BoundingBox.height(); } virtual GraphicEngine::COLOR_FORMATS GetColorFormat() const { return GraphicEngine::CF_ARGB32; } - virtual bool Fill(const BS_Rect *pFillRect = 0, unsigned int Color = BS_RGB(0, 0, 0)); + virtual bool Fill(const Common::Rect *pFillRect = 0, unsigned int Color = BS_RGB(0, 0, 0)); virtual unsigned int GetPixel(int X, int Y); virtual bool IsBlitSource() const { return true; @@ -213,7 +213,7 @@ public: virtual bool SetContent(const byte *Pixeldata, uint size, unsigned int Offset, unsigned int Stride); virtual bool Blit(int PosX = 0, int PosY = 0, int Flipping = FLIP_NONE, - BS_Rect *pPartRect = NULL, + Common::Rect *pPartRect = NULL, unsigned int Color = BS_ARGB(255, 255, 255, 255), int Width = -1, int Height = -1); @@ -224,7 +224,7 @@ private: bool ParseStyles(unsigned int ShapeType, SWFBitStream &bs, unsigned int &NumFillBits, unsigned int &NumLineBits); Common::Array<VectorImageElement> m_Elements; - BS_Rect m_BoundingBox; + Common::Rect m_BoundingBox; }; } // End of namespace Sword25 |