aboutsummaryrefslogtreecommitdiff
path: root/engines/sword25/gfx/image
diff options
context:
space:
mode:
authorEugene Sandulenko2010-09-02 12:14:04 +0000
committerEugene Sandulenko2010-10-12 23:30:00 +0000
commit086f5961b6575c50bb386750b6e9a3ed1efdd8cd (patch)
tree75c532790d67ccd3b8fdc5c371a3ce3bf0705dca /engines/sword25/gfx/image
parent0cdb2ded85d17150cb108a5d63dd8957c29af2a5 (diff)
downloadscummvm-rg350-086f5961b6575c50bb386750b6e9a3ed1efdd8cd.tar.gz
scummvm-rg350-086f5961b6575c50bb386750b6e9a3ed1efdd8cd.tar.bz2
scummvm-rg350-086f5961b6575c50bb386750b6e9a3ed1efdd8cd.zip
SWORD25: unsigned int -> uint
svn-id: r53309
Diffstat (limited to 'engines/sword25/gfx/image')
-rw-r--r--engines/sword25/gfx/image/b25sloader.cpp20
-rw-r--r--engines/sword25/gfx/image/b25sloader.h6
-rw-r--r--engines/sword25/gfx/image/image.h8
-rw-r--r--engines/sword25/gfx/image/imageloader.cpp6
-rw-r--r--engines/sword25/gfx/image/imageloader.h44
-rw-r--r--engines/sword25/gfx/image/pngloader.cpp12
-rw-r--r--engines/sword25/gfx/image/pngloader.h12
-rw-r--r--engines/sword25/gfx/image/vectorimage.cpp42
-rw-r--r--engines/sword25/gfx/image/vectorimage.h50
-rw-r--r--engines/sword25/gfx/image/vectorimagerenderer.cpp22
-rw-r--r--engines/sword25/gfx/image/vectorimagerenderer.h2
11 files changed, 112 insertions, 112 deletions
diff --git a/engines/sword25/gfx/image/b25sloader.cpp b/engines/sword25/gfx/image/b25sloader.cpp
index 74c311990c..6d548a0d32 100644
--- a/engines/sword25/gfx/image/b25sloader.cpp
+++ b/engines/sword25/gfx/image/b25sloader.cpp
@@ -46,24 +46,24 @@ namespace Sword25 {
// -----------------------------------------------------------------------------
namespace {
-unsigned int FindEmbeddedPNG(const byte *FileDataPtr, unsigned int FileSize) {
+uint FindEmbeddedPNG(const byte *FileDataPtr, uint FileSize) {
if (memcmp(FileDataPtr, "BS25SAVEGAME", 12))
return 0;
#if 0
// Einen Stringstream mit dem Anfang der Datei intialisieren. 512 Byte sollten hierfür genügen.
- istringstream StringStream(string(FileDataPtr, FileDataPtr + min(static_cast<unsigned int>(512), FileSize)));
+ istringstream StringStream(string(FileDataPtr, FileDataPtr + min(static_cast<uint>(512), FileSize)));
// Headerinformationen der Spielstandes einlesen.
string Marker, VersionID;
- unsigned int CompressedGamedataSize, UncompressedGamedataSize;
+ uint CompressedGamedataSize, UncompressedGamedataSize;
StringStream >> Marker >> VersionID >> CompressedGamedataSize >> UncompressedGamedataSize;
if (!StringStream.good()) return 0;
// Testen, ob wir tatsächlich einen Spielstand haben.
if (Marker == "BS25SAVEGAME") {
// Offset zum PNG innerhalb des Spielstandes berechnen und zurückgeben.
- return static_cast<unsigned int>(StringStream.tellg()) + CompressedGamedataSize + 1;
+ return static_cast<uint>(StringStream.tellg()) + CompressedGamedataSize + 1;
}
#else
warning("STUB:FindEmbeddedPNG()");
@@ -75,9 +75,9 @@ unsigned int FindEmbeddedPNG(const byte *FileDataPtr, unsigned int FileSize) {
// -----------------------------------------------------------------------------
-bool B25SLoader::IsCorrectImageFormat(const byte *FileDataPtr, unsigned int FileSize) {
+bool B25SLoader::IsCorrectImageFormat(const byte *FileDataPtr, uint FileSize) {
// PNG innerhalb des Spielstandes finden und den Methodenaufruf zu BS_PNGLoader weiterreichen.
- unsigned int PNGOffset = FindEmbeddedPNG(FileDataPtr, FileSize);
+ uint PNGOffset = FindEmbeddedPNG(FileDataPtr, FileSize);
if (PNGOffset > 0) {
return PNGLoader::DoIsCorrectImageFormat(FileDataPtr + PNGOffset, FileSize - PNGOffset);
}
@@ -87,10 +87,10 @@ bool B25SLoader::IsCorrectImageFormat(const byte *FileDataPtr, unsigned int File
// -----------------------------------------------------------------------------
-bool B25SLoader::DecodeImage(const byte *FileDataPtr, unsigned int FileSize, GraphicEngine::COLOR_FORMATS ColorFormat, byte *&UncompressedDataPtr,
+bool B25SLoader::DecodeImage(const byte *FileDataPtr, uint FileSize, GraphicEngine::COLOR_FORMATS ColorFormat, byte *&UncompressedDataPtr,
int &Width, int &Height, int &Pitch) {
// PNG innerhalb des Spielstandes finden und den Methodenaufruf zu BS_PNGLoader weiterreichen.
- unsigned int PNGOffset = FindEmbeddedPNG(FileDataPtr, FileSize);
+ uint PNGOffset = FindEmbeddedPNG(FileDataPtr, FileSize);
if (PNGOffset > 0) {
return PNGLoader::DoDecodeImage(FileDataPtr + PNGOffset, FileSize - PNGOffset, ColorFormat, UncompressedDataPtr, Width, Height, Pitch);
}
@@ -100,9 +100,9 @@ bool B25SLoader::DecodeImage(const byte *FileDataPtr, unsigned int FileSize, Gra
// -----------------------------------------------------------------------------
-bool B25SLoader::ImageProperties(const byte *FileDataPtr, unsigned int FileSize, GraphicEngine::COLOR_FORMATS &ColorFormat, int &Width, int &Height) {
+bool B25SLoader::ImageProperties(const byte *FileDataPtr, uint FileSize, GraphicEngine::COLOR_FORMATS &ColorFormat, int &Width, int &Height) {
// PNG innerhalb des Spielstandes finden und den Methodenaufruf zu BS_PNGLoader weiterreichen.
- unsigned int PNGOffset = FindEmbeddedPNG(FileDataPtr, FileSize);
+ uint PNGOffset = FindEmbeddedPNG(FileDataPtr, FileSize);
if (PNGOffset > 0) {
return PNGLoader::DoImageProperties(FileDataPtr + PNGOffset, FileSize - PNGOffset, ColorFormat, Width, Height);
}
diff --git a/engines/sword25/gfx/image/b25sloader.h b/engines/sword25/gfx/image/b25sloader.h
index 922b348021..8ca8da0f97 100644
--- a/engines/sword25/gfx/image/b25sloader.h
+++ b/engines/sword25/gfx/image/b25sloader.h
@@ -57,10 +57,10 @@ public:
}
protected:
- virtual bool IsCorrectImageFormat(const byte *FileDataPtr, unsigned int FileSize);
- virtual bool DecodeImage(const byte *FileDataPtr, unsigned int FileSize, GraphicEngine::COLOR_FORMATS ColorFormat, byte *&UncompressedDataPtr,
+ virtual bool IsCorrectImageFormat(const byte *FileDataPtr, uint FileSize);
+ virtual bool DecodeImage(const byte *FileDataPtr, uint FileSize, GraphicEngine::COLOR_FORMATS ColorFormat, byte *&UncompressedDataPtr,
int &Width, int &Height, int &Pitch);
- virtual bool ImageProperties(const byte *FileDataPtr, unsigned int FileSize, GraphicEngine::COLOR_FORMATS &ColorFormat, int &Width, int &Height);
+ virtual bool ImageProperties(const byte *FileDataPtr, uint FileSize, GraphicEngine::COLOR_FORMATS &ColorFormat, int &Width, int &Height);
};
diff --git a/engines/sword25/gfx/image/image.h b/engines/sword25/gfx/image/image.h
index 5ea4a6caa4..0404c50d6f 100644
--- a/engines/sword25/gfx/image/image.h
+++ b/engines/sword25/gfx/image/image.h
@@ -134,7 +134,7 @@ public:
virtual bool Blit(int PosX = 0, int PosY = 0,
int Flipping = FLIP_NONE,
Common::Rect *pPartRect = NULL,
- unsigned int Color = BS_ARGB(255, 255, 255, 255),
+ uint Color = BS_ARGB(255, 255, 255, 255),
int Width = -1, int Height = -1) = 0;
/**
@@ -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 Common::Rect *pFillRect = 0, unsigned int Color = BS_RGB(0, 0, 0)) = 0;
+ virtual bool Fill(const Common::Rect *pFillRect = 0, uint Color = BS_RGB(0, 0, 0)) = 0;
/**
@brief Füllt den Inhalt des Bildes mit Pixeldaten.
@@ -162,7 +162,7 @@ public:
@return Gibt false zurück, falls der Aufruf fehlgeschlagen ist.
@remark Ein Aufruf dieser Methode ist nur erlaubt, wenn IsSetContentAllowed() true zurückgibt.
*/
- virtual bool SetContent(const byte *Pixeldata, uint size, unsigned int Offset, unsigned int Stride) = 0;
+ virtual bool SetContent(const byte *Pixeldata, uint size, uint Offset, uint Stride) = 0;
/**
@brief Liest einen Pixel des Bildes.
@@ -172,7 +172,7 @@ public:
@remark Diese Methode sollte auf keine Fall benutzt werden um größere Teile des Bildes zu lesen, da sie sehr langsam ist. Sie ist
eher dafür gedacht einzelne Pixel des Bildes auszulesen.
*/
- virtual unsigned int GetPixel(int X, int Y) = 0;
+ virtual uint GetPixel(int X, int Y) = 0;
//@{
/** @name Auskunfts-Methoden */
diff --git a/engines/sword25/gfx/image/imageloader.cpp b/engines/sword25/gfx/image/imageloader.cpp
index edfe34b3ee..9ecd358071 100644
--- a/engines/sword25/gfx/image/imageloader.cpp
+++ b/engines/sword25/gfx/image/imageloader.cpp
@@ -46,7 +46,7 @@ bool ImageLoader::_ImageLoaderListInitialized = false;
// Lade Methode
// ------------
-bool ImageLoader::LoadImage(const byte *pFileData, unsigned int FileSize,
+bool ImageLoader::LoadImage(const byte *pFileData, uint FileSize,
GraphicEngine::COLOR_FORMATS ColorFormat,
byte *&pUncompressedData,
int &Width, int &Height,
@@ -71,7 +71,7 @@ bool ImageLoader::LoadImage(const byte *pFileData, unsigned int FileSize,
// Info Methode
// ------------
-bool ImageLoader::ExtractImageProperties(const byte *pFileData, unsigned int FileSize,
+bool ImageLoader::ExtractImageProperties(const byte *pFileData, uint FileSize,
GraphicEngine::COLOR_FORMATS &ColorFormat,
int &Width, int &Height) {
// Falls die Liste der BS_ImageLoader noch nicht initialisiert wurde, wird dies getan.
@@ -111,7 +111,7 @@ void ImageLoader::_DeinitializeLoaderList() {
}
}
-ImageLoader *ImageLoader::_FindSuitableImageLoader(const byte *pFileData, unsigned int FileSize) {
+ImageLoader *ImageLoader::_FindSuitableImageLoader(const byte *pFileData, uint FileSize) {
// Alle BS_ImageLoader-Objekte durchgehen, bis eins gefunden wurde, dass das Bild laden kann
Common::List<ImageLoader *>::iterator Iter = _ImageLoaderList.begin();
for (; Iter != _ImageLoaderList.end(); ++Iter) {
diff --git a/engines/sword25/gfx/image/imageloader.h b/engines/sword25/gfx/image/imageloader.h
index bafff74934..4f6fb89305 100644
--- a/engines/sword25/gfx/image/imageloader.h
+++ b/engines/sword25/gfx/image/imageloader.h
@@ -99,7 +99,7 @@ public:
@remark Die Größe der Ausgabedaten in Bytes kann wie folgt berechnet werden: Pitch * Height.
@remark Es darf nicht vergessen werden, die Ausgabedaten nach erfolgter Benutzung mit delete freizugeben.
*/
- static bool LoadImage(const byte *pFileData, unsigned int FileSize,
+ static bool LoadImage(const byte *pFileData, uint FileSize,
GraphicEngine::COLOR_FORMATS ColorFormat,
byte *&pUncompressedData,
int &Width, int &Height,
@@ -116,7 +116,7 @@ public:
@return Gibt false zurück, wenn die Bildeigenschaften nicht ausgelesen werden konnten.
@remark Es darf nicht vergessen werden, die Ausgabedaten nach erfolgter Benutzung mit delete freizugeben.
*/
- static bool ExtractImageProperties(const byte *pFileData, unsigned int FileSize,
+ static bool ExtractImageProperties(const byte *pFileData, uint FileSize,
GraphicEngine::COLOR_FORMATS &ColorFormat,
int &Width, int &Height);
//@}
@@ -148,7 +148,7 @@ protected:
@return Gibt true zurück, wenn der #BS_ImageLoader das Bild lesen kann, ansonsten false.
@remark Diese Methode muss von allen BS_ImageLoader Klassen implementiert werden.
*/
- virtual bool IsCorrectImageFormat(const byte *pFileData, unsigned int FileSize) = 0;
+ virtual bool IsCorrectImageFormat(const byte *pFileData, uint FileSize) = 0;
/**
@brief Lädt eine Bilddatei.
@@ -170,7 +170,7 @@ protected:
@remark Es darf nicht vergessen werden, die Ausgabedaten nach erfolgter Benutzung mit delete freizugeben.
@remark Diese Methode muss von allen BS_ImageLoader Klassen implementiert werden.
*/
- virtual bool DecodeImage(const byte *pFileData, unsigned int FileSize,
+ virtual bool DecodeImage(const byte *pFileData, uint FileSize,
GraphicEngine::COLOR_FORMATS ColorFormat,
byte *&pUncompressedData,
int &Width, int &Height,
@@ -187,7 +187,7 @@ protected:
@remark Es darf nicht vergessen werden, die Ausgabedaten nach erfolgter Benutzung mit delete freizugeben.
@remark Diese Methode muss von allen BS_ImageLoader Klassen implementiert werden.
*/
- virtual bool ImageProperties(const byte *pFileData, unsigned int FileSize,
+ virtual bool ImageProperties(const byte *pFileData, uint FileSize,
GraphicEngine::COLOR_FORMATS &ColorFormat,
int &Width, int &Height) = 0;
@@ -204,8 +204,8 @@ protected:
@remark Es gilt zu beachten, dass der Zielpuffer ausreichend groß ist.<br>
Es sind mindestens Width * 2 Byte notwendig.
*/
- static void RowARGB32ToRGB16(byte *pSrcData, byte *pDestData, unsigned int Width) {
- for (unsigned int i = 0; i < Width; i++) {
+ static void RowARGB32ToRGB16(byte *pSrcData, byte *pDestData, uint Width) {
+ for (uint i = 0; i < Width; i++) {
((uint16_t *)pDestData)[i] = ((pSrcData[2] >> 3) << 11) | ((pSrcData[1] >> 2) << 5) | (pSrcData[0] >> 3);
pSrcData += 4;
}
@@ -219,8 +219,8 @@ protected:
@remark Es gilt zu beachten, dass der Zielpuffer ausreichend groß ist.<br>
Es sind mindestens Width * 2 Byte notwendig.
*/
- static void RowARGB32ToRGB15(byte *pSrcData, byte *pDestData, unsigned int Width) {
- for (unsigned int i = 0; i < Width; i++) {
+ static void RowARGB32ToRGB15(byte *pSrcData, byte *pDestData, uint Width) {
+ for (uint i = 0; i < Width; i++) {
((uint16_t *)pDestData)[i] = ((pSrcData[2] >> 3) << 10) | ((pSrcData[1] >> 3) << 5) | (pSrcData[0] >> 3);
pSrcData += 4;
}
@@ -234,11 +234,11 @@ protected:
@remark Es gilt zu beachten, dass der Zielpuffer ausreichend groß sein muss.<br>
Es sind mindestens ((Width + 3) / 4) * 12 Byte notwendig.
*/
- static void RowARGB32ToRGB16_INTERLEAVED(byte *pSrcData, byte *pDestData, unsigned int Width) {
+ static void RowARGB32ToRGB16_INTERLEAVED(byte *pSrcData, byte *pDestData, uint Width) {
// Die Pixelblöcke erstellen, dabei werden immer jeweils 4 Pixel zu einem Block zusammengefasst
- unsigned int BlockFillCount = 0;
- unsigned int AlphaBlock = 0;
- for (unsigned int i = 0; i < Width; i++) {
+ uint BlockFillCount = 0;
+ uint AlphaBlock = 0;
+ for (uint i = 0; i < Width; i++) {
// Alphawert in den Alphablock schreiben
AlphaBlock = (AlphaBlock >> 8) | (pSrcData[BlockFillCount * 4 + 3] << 24);
@@ -252,7 +252,7 @@ protected:
AlphaBlock >>= (4 - BlockFillCount) * 8;
// Alphablock schreiben
- *((unsigned int *)pDestData) = AlphaBlock;
+ *((uint *)pDestData) = AlphaBlock;
pDestData += 4;
// Pixel konvertieren und schreiben
@@ -278,11 +278,11 @@ protected:
@remark Es gilt zu beachten, dass der Zielpuffer ausreichend groß ist.<br>
Es sind mindestens (Width / 4 + Width % 4) * 3 Byte notwendig.
*/
- static void RowARGB32ToRGB15_INTERLEAVED(byte *pSrcData, byte *pDestData, unsigned int Width) {
+ static void RowARGB32ToRGB15_INTERLEAVED(byte *pSrcData, byte *pDestData, uint Width) {
// Die Pixelblöcke erstellen, dabei werden immer jeweils 4 Pixel zu einem Block zusammengefasst
- unsigned int BlockFillCount = 0;
- unsigned int AlphaBlock = 0;
- for (unsigned int i = 0; i < Width; i++) {
+ uint BlockFillCount = 0;
+ uint AlphaBlock = 0;
+ for (uint i = 0; i < Width; i++) {
// Alphawert in den Alphablock schreiben
AlphaBlock = (AlphaBlock >> 8) | (pSrcData[BlockFillCount * 4 + 3] << 24);
@@ -296,7 +296,7 @@ protected:
AlphaBlock >>= (4 - BlockFillCount) * 8;
// Alphablock schreiben
- *((unsigned int *)pDestData) = AlphaBlock;
+ *((uint *)pDestData) = AlphaBlock;
pDestData += 4;
// Pixel konvertieren und schreiben
@@ -320,8 +320,8 @@ protected:
@param pDestData ein Pointer auf den Zielpuffern.
@param Width die Anzahl der Pixel in der Bildzeile.
*/
- static void RowARGB32ToABGR32(byte *pSrcData, byte *pDestData, unsigned int Width) {
- for (unsigned int i = 0; i < Width; ++i) {
+ static void RowARGB32ToABGR32(byte *pSrcData, byte *pDestData, uint Width) {
+ for (uint i = 0; i < Width; ++i) {
*pDestData++ = pSrcData[2];
*pDestData++ = pSrcData[1];
*pDestData++ = pSrcData[0];
@@ -349,7 +349,7 @@ private:
@brief Sucht zu Bilddaten ein BS_ImageLoader Objekt, dass die Bilddaten dekodieren kann.
@return Gibt einen Pointer auf ein passendes BS_ImageLoader Objekt zurück, oder NULL, wenn kein passendes Objekt gefunden wurde.
*/
- static ImageLoader *_FindSuitableImageLoader(const byte *pFileData, unsigned int FileSize);
+ static ImageLoader *_FindSuitableImageLoader(const byte *pFileData, uint FileSize);
static Common::List<ImageLoader *> _ImageLoaderList; // Die Liste aller BS_ImageLoader-Objekte
static bool _ImageLoaderListInitialized; // Gibt an, ob die Liste schon intialisiert wurde
diff --git a/engines/sword25/gfx/image/pngloader.cpp b/engines/sword25/gfx/image/pngloader.cpp
index 59e0f21e84..c7a7b513c1 100644
--- a/engines/sword25/gfx/image/pngloader.cpp
+++ b/engines/sword25/gfx/image/pngloader.cpp
@@ -62,7 +62,7 @@ static void png_user_read_data(png_structp png_ptr, png_bytep data, png_size_t l
// -----------------------------------------------------------------------------
-bool PNGLoader::DoDecodeImage(const byte *FileDataPtr, unsigned int FileSize, GraphicEngine::COLOR_FORMATS ColorFormat, byte *&UncompressedDataPtr,
+bool PNGLoader::DoDecodeImage(const byte *FileDataPtr, uint FileSize, GraphicEngine::COLOR_FORMATS ColorFormat, byte *&UncompressedDataPtr,
int &Width, int &Height, int &Pitch) {
png_structp png_ptr = NULL;
png_infop info_ptr = NULL;
@@ -259,14 +259,14 @@ bool PNGLoader::DoDecodeImage(const byte *FileDataPtr, unsigned int FileSize, G
// -----------------------------------------------------------------------------
-bool PNGLoader::DecodeImage(const byte *FileDataPtr, unsigned int FileSize, GraphicEngine::COLOR_FORMATS ColorFormat, byte *&UncompressedDataPtr,
+bool PNGLoader::DecodeImage(const byte *FileDataPtr, uint FileSize, GraphicEngine::COLOR_FORMATS ColorFormat, byte *&UncompressedDataPtr,
int &Width, int &Height, int &Pitch) {
return DoDecodeImage(FileDataPtr, FileSize, ColorFormat, UncompressedDataPtr, Width, Height, Pitch);
}
// -----------------------------------------------------------------------------
-bool PNGLoader::DoImageProperties(const byte *FileDataPtr, unsigned int FileSize, GraphicEngine::COLOR_FORMATS &ColorFormat, int &Width, int &Height) {
+bool PNGLoader::DoImageProperties(const byte *FileDataPtr, uint FileSize, GraphicEngine::COLOR_FORMATS &ColorFormat, int &Width, int &Height) {
// PNG Signatur überprüfen
if (!DoIsCorrectImageFormat(FileDataPtr, FileSize)) return false;
@@ -310,7 +310,7 @@ bool PNGLoader::DoImageProperties(const byte *FileDataPtr, unsigned int FileSize
// -----------------------------------------------------------------------------
-bool PNGLoader::ImageProperties(const byte *FileDataPtr, unsigned int FileSize, GraphicEngine::COLOR_FORMATS &ColorFormat, int &Width, int &Height) {
+bool PNGLoader::ImageProperties(const byte *FileDataPtr, uint FileSize, GraphicEngine::COLOR_FORMATS &ColorFormat, int &Width, int &Height) {
return DoImageProperties(FileDataPtr, FileSize, ColorFormat, Width, Height);
}
@@ -318,7 +318,7 @@ bool PNGLoader::ImageProperties(const byte *FileDataPtr, unsigned int FileSize,
// Header überprüfen
// -----------------------------------------------------------------------------
-bool PNGLoader::DoIsCorrectImageFormat(const byte *FileDataPtr, unsigned int FileSize) {
+bool PNGLoader::DoIsCorrectImageFormat(const byte *FileDataPtr, uint FileSize) {
if (FileSize > 8)
return png_check_sig(const_cast<byte *>(FileDataPtr), 8) ? true : false;
else
@@ -327,7 +327,7 @@ bool PNGLoader::DoIsCorrectImageFormat(const byte *FileDataPtr, unsigned int Fil
// -----------------------------------------------------------------------------
-bool PNGLoader::IsCorrectImageFormat(const byte *FileDataPtr, unsigned int FileSize) {
+bool PNGLoader::IsCorrectImageFormat(const byte *FileDataPtr, uint FileSize) {
return DoIsCorrectImageFormat(FileDataPtr, FileSize);
}
diff --git a/engines/sword25/gfx/image/pngloader.h b/engines/sword25/gfx/image/pngloader.h
index f360b92f61..0368c9cdb4 100644
--- a/engines/sword25/gfx/image/pngloader.h
+++ b/engines/sword25/gfx/image/pngloader.h
@@ -60,20 +60,20 @@ public:
// Alle virtuellen Methoden von BS_ImageLoader sind hier als static-Methode implementiert, damit sie von BS_B25SLoader aufgerufen werden können.
// Die virtuellen Methoden rufen diese Methoden auf.
- static bool DoIsCorrectImageFormat(const byte *FileDataPtr, unsigned int FileSize);
- static bool DoDecodeImage(const byte *FileDataPtr, unsigned int FileSize, GraphicEngine::COLOR_FORMATS ColorFormat, byte *&UncompressedDataPtr,
+ static bool DoIsCorrectImageFormat(const byte *FileDataPtr, uint FileSize);
+ static bool DoDecodeImage(const byte *FileDataPtr, uint FileSize, GraphicEngine::COLOR_FORMATS ColorFormat, byte *&UncompressedDataPtr,
int &Width, int &Height, int &Pitch);
- static bool DoImageProperties(const byte *FileDataPtr, unsigned int FileSize, GraphicEngine::COLOR_FORMATS &ColorFormat, int &Width, int &Height);
+ static bool DoImageProperties(const byte *FileDataPtr, uint FileSize, GraphicEngine::COLOR_FORMATS &ColorFormat, int &Width, int &Height);
protected:
PNGLoader();
- bool DecodeImage(const byte *pFileData, unsigned int FileSize,
+ bool DecodeImage(const byte *pFileData, uint FileSize,
GraphicEngine::COLOR_FORMATS ColorFormat,
byte *&pUncompressedData,
int &Width, int &Height,
int &Pitch);
- bool IsCorrectImageFormat(const byte *FileDataPtr, unsigned int FileSize);
- bool ImageProperties(const byte *FileDatePtr, unsigned int FileSize, GraphicEngine::COLOR_FORMATS &ColorFormat, int &Width, int &Height);
+ bool IsCorrectImageFormat(const byte *FileDataPtr, uint FileSize);
+ bool ImageProperties(const byte *FileDatePtr, uint FileSize, GraphicEngine::COLOR_FORMATS &ColorFormat, int &Width, int &Height);
};
} // End of namespace Sword25
diff --git a/engines/sword25/gfx/image/vectorimage.cpp b/engines/sword25/gfx/image/vectorimage.cpp
index 7976599e2e..894cc73b6f 100644
--- a/engines/sword25/gfx/image/vectorimage.cpp
+++ b/engines/sword25/gfx/image/vectorimage.cpp
@@ -60,11 +60,11 @@ namespace Sword25 {
class VectorImage::SWFBitStream {
public:
- SWFBitStream(const byte *pData, unsigned int DataSize) :
+ SWFBitStream(const byte *pData, uint DataSize) :
m_Pos(pData), m_End(pData + DataSize), m_WordMask(0)
{}
- inline uint32 GetBits(unsigned int BitCount) {
+ inline uint32 GetBits(uint BitCount) {
if (BitCount == 0 || BitCount > 32) {
error("SWFBitStream::GetBits() must read at least 1 and at most 32 bits at a time");
}
@@ -83,7 +83,7 @@ public:
return value;
}
- inline int32 GetSignedBits(unsigned int BitCount) {
+ inline int32 GetSignedBits(uint BitCount) {
// Bits einlesen
uint32 Temp = GetBits(BitCount);
@@ -130,7 +130,7 @@ public:
}
}
- inline void SkipBytes(unsigned int SkipLength) {
+ inline void SkipBytes(uint SkipLength) {
FlushByte();
if (m_Pos + SkipLength >= m_End) {
error("Attempted to read past end of file");
@@ -145,7 +145,7 @@ private:
const byte *m_End;
byte m_Word;
- unsigned int m_WordMask;
+ uint m_WordMask;
};
@@ -185,7 +185,7 @@ Common::Rect FlashRectToBSRect(VectorImage::SWFBitStream &bs) {
// Konvertiert SWF-Farben in AntiGrain Farben
// -----------------------------------------------------------------------------
-uint32 FlashColorToAGGRGBA8(unsigned int FlashColor) {
+uint32 FlashColorToAGGRGBA8(uint FlashColor) {
uint32 ResultColor = Graphics::ARGBToColor<Graphics::ColorMasks<8888> >(FlashColor >> 24, (FlashColor >> 16) & 0xff, (FlashColor >> 8) & 0xff, FlashColor & 0xff);
return ResultColor;
@@ -224,7 +224,7 @@ Common::Rect CalculateBoundingBox(const VectorImageElement &vectorImageElement)
// Konstruktion
// -----------------------------------------------------------------------------
-VectorImage::VectorImage(const byte *pFileData, unsigned int FileSize, bool &Success) {
+VectorImage::VectorImage(const byte *pFileData, uint FileSize, bool &Success) {
Success = false;
// Bitstream-Objekt erzeugen
@@ -303,7 +303,7 @@ VectorImage::VectorImage(const byte *pFileData, unsigned int FileSize, bool &Suc
// -----------------------------------------------------------------------------
-bool VectorImage::ParseDefineShape(unsigned int ShapeType, SWFBitStream &bs) {
+bool VectorImage::ParseDefineShape(uint ShapeType, SWFBitStream &bs) {
/*uint32 ShapeID = */bs.GetUInt16();
// Bounding Box auslesen
@@ -313,14 +313,14 @@ bool VectorImage::ParseDefineShape(unsigned int ShapeType, SWFBitStream &bs) {
m_Elements.resize(1);
// Styles einlesen
- unsigned int NumFillBits;
- unsigned int NumLineBits;
+ uint NumFillBits;
+ uint NumLineBits;
if (!ParseStyles(ShapeType, bs, NumFillBits, NumLineBits))
return false;
- unsigned int LineStyle = 0;
- unsigned int FillStyle0 = 0;
- unsigned int FillStyle1 = 0;
+ uint LineStyle = 0;
+ uint FillStyle0 = 0;
+ uint FillStyle1 = 0;
// Shaperecord parsen
// ------------------
@@ -451,20 +451,20 @@ bool VectorImage::ParseDefineShape(unsigned int ShapeType, SWFBitStream &bs) {
// -----------------------------------------------------------------------------
-bool VectorImage::ParseStyles(unsigned int ShapeType, SWFBitStream &bs, unsigned int &NumFillBits, unsigned int &NumLineBits) {
+bool VectorImage::ParseStyles(uint ShapeType, SWFBitStream &bs, uint &NumFillBits, uint &NumLineBits) {
bs.FlushByte();
// Fillstyles parsen
// -----------------
// Anzahl an Fillstyles bestimmen
- unsigned int FillStyleCount = bs.GetByte();
+ uint FillStyleCount = bs.GetByte();
if (FillStyleCount == 0xff) FillStyleCount = bs.GetUInt16();
// Alle Fillstyles einlesen, falls ein Fillstyle mit Typ != 0 gefunden wird, wird das Parsen abgebrochen.
// Es wird nur "solid fill" (Typ 0) unterstützt.
m_Elements.back().m_FillStyles.reserve(FillStyleCount);
- for (unsigned int i = 0; i < FillStyleCount; ++i) {
+ for (uint i = 0; i < FillStyleCount; ++i) {
byte Type = bs.GetByte();
uint32 Color;
if (ShapeType == 3) {
@@ -480,13 +480,13 @@ bool VectorImage::ParseStyles(unsigned int ShapeType, SWFBitStream &bs, unsigned
// -----------------
// Anzahl an Linestyles bestimmen
- unsigned int LineStyleCount = bs.GetByte();
+ uint LineStyleCount = bs.GetByte();
if (LineStyleCount == 0xff)
LineStyleCount = bs.GetUInt16();
// Alle Linestyles einlesen
m_Elements.back().m_LineStyles.reserve(LineStyleCount);
- for (unsigned int i = 0; i < LineStyleCount; ++i) {
+ for (uint i = 0; i < LineStyleCount; ++i) {
double Width = bs.GetUInt16();
uint32 Color;
if (ShapeType == 3)
@@ -507,7 +507,7 @@ bool VectorImage::ParseStyles(unsigned int ShapeType, SWFBitStream &bs, unsigned
// -----------------------------------------------------------------------------
-bool VectorImage::Fill(const Common::Rect *pFillRect, unsigned int Color) {
+bool VectorImage::Fill(const Common::Rect *pFillRect, uint Color) {
BS_LOG_ERRORLN("Fill() is not supported.");
return false;
}
@@ -515,14 +515,14 @@ bool VectorImage::Fill(const Common::Rect *pFillRect, unsigned int Color) {
// -----------------------------------------------------------------------------
-unsigned int VectorImage::GetPixel(int X, int Y) {
+uint VectorImage::GetPixel(int X, int Y) {
BS_LOG_ERRORLN("GetPixel() is not supported. Returning black.");
return 0;
}
// -----------------------------------------------------------------------------
-bool VectorImage::SetContent(const byte *Pixeldata, uint size, unsigned int Offset, unsigned int Stride) {
+bool VectorImage::SetContent(const byte *Pixeldata, uint size, uint Offset, uint Stride) {
BS_LOG_ERRORLN("SetContent() is not supported.");
return 0;
}
diff --git a/engines/sword25/gfx/image/vectorimage.h b/engines/sword25/gfx/image/vectorimage.h
index 42d5c4ad4e..213775c618 100644
--- a/engines/sword25/gfx/image/vectorimage.h
+++ b/engines/sword25/gfx/image/vectorimage.h
@@ -60,31 +60,31 @@ class VectorImage;
class VectorPathInfo {
public:
- VectorPathInfo(unsigned int ID, unsigned int LineStyle, unsigned int FillStyle0, unsigned int FillStyle1) :
+ VectorPathInfo(uint ID, uint LineStyle, uint FillStyle0, uint FillStyle1) :
m_ID(ID), m_LineStyle(LineStyle), m_FillStyle0(FillStyle0), m_FillStyle1(FillStyle1) {}
VectorPathInfo() {
m_ID = m_LineStyle = m_FillStyle0 = m_FillStyle1 = 0;
}
- unsigned int GetID() const {
+ uint GetID() const {
return m_ID;
}
- unsigned int GetLineStyle() const {
+ uint GetLineStyle() const {
return m_LineStyle;
}
- unsigned int GetFillStyle0() const {
+ uint GetFillStyle0() const {
return m_FillStyle0;
}
- unsigned int GetFillStyle1() const {
+ uint GetFillStyle1() const {
return m_FillStyle1;
}
private:
- unsigned int m_ID;
- unsigned int m_LineStyle;
- unsigned int m_FillStyle0;
- unsigned int m_FillStyle1;
+ uint m_ID;
+ uint m_LineStyle;
+ uint m_FillStyle0;
+ uint m_FillStyle1;
};
@@ -101,33 +101,33 @@ public:
}
#endif
- unsigned int GetPathCount() const {
+ uint GetPathCount() const {
return m_PathInfos.size();
}
- const VectorPathInfo &GetPathInfo(unsigned int PathNr) const {
+ const VectorPathInfo &GetPathInfo(uint PathNr) const {
BS_ASSERT(PathNr < GetPathCount());
return m_PathInfos[PathNr];
}
- double GetLineStyleWidth(unsigned int LineStyle) const {
+ double GetLineStyleWidth(uint LineStyle) const {
BS_ASSERT(LineStyle < m_LineStyles.size());
return m_LineStyles[LineStyle].Width;
}
- unsigned int GetLineStyleCount() const {
+ uint GetLineStyleCount() const {
return m_LineStyles.size();
}
- uint32 GetLineStyleColor(unsigned int LineStyle) const {
+ uint32 GetLineStyleColor(uint LineStyle) const {
BS_ASSERT(LineStyle < m_LineStyles.size());
return m_LineStyles[LineStyle].Color;
}
- unsigned int GetFillStyleCount() const {
+ uint GetFillStyleCount() const {
return m_FillStyles.size();
}
- uint32 GetFillStyleColor(unsigned int FillStyle) const {
+ uint32 GetFillStyleColor(uint FillStyle) const {
BS_ASSERT(FillStyle < m_FillStyles.size());
return m_FillStyles[FillStyle];
}
@@ -162,12 +162,12 @@ private:
class VectorImage : public Image {
public:
- VectorImage(const byte *pFileData, unsigned int FileSize, bool &Success);
+ VectorImage(const byte *pFileData, uint FileSize, bool &Success);
- unsigned int GetElementCount() const {
+ uint GetElementCount() const {
return m_Elements.size();
}
- const VectorImageElement &GetElement(unsigned int ElementNr) const {
+ const VectorImageElement &GetElement(uint ElementNr) const {
BS_ASSERT(ElementNr < m_Elements.size());
return m_Elements[ElementNr];
}
@@ -187,8 +187,8 @@ public:
virtual GraphicEngine::COLOR_FORMATS GetColorFormat() const {
return GraphicEngine::CF_ARGB32;
}
- 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 Fill(const Common::Rect *pFillRect = 0, uint Color = BS_RGB(0, 0, 0));
+ virtual uint GetPixel(int X, int Y);
virtual bool IsBlitSource() const {
return true;
}
@@ -210,18 +210,18 @@ public:
virtual bool IsSetContentAllowed() const {
return false;
}
- virtual bool SetContent(const byte *Pixeldata, uint size, unsigned int Offset, unsigned int Stride);
+ virtual bool SetContent(const byte *Pixeldata, uint size, uint Offset, uint Stride);
virtual bool Blit(int PosX = 0, int PosY = 0,
int Flipping = FLIP_NONE,
Common::Rect *pPartRect = NULL,
- unsigned int Color = BS_ARGB(255, 255, 255, 255),
+ uint Color = BS_ARGB(255, 255, 255, 255),
int Width = -1, int Height = -1);
class SWFBitStream;
private:
- bool ParseDefineShape(unsigned int ShapeType, SWFBitStream &bs);
- bool ParseStyles(unsigned int ShapeType, SWFBitStream &bs, unsigned int &NumFillBits, unsigned int &NumLineBits);
+ bool ParseDefineShape(uint ShapeType, SWFBitStream &bs);
+ bool ParseStyles(uint ShapeType, SWFBitStream &bs, uint &NumFillBits, uint &NumLineBits);
Common::Array<VectorImageElement> m_Elements;
Common::Rect m_BoundingBox;
diff --git a/engines/sword25/gfx/image/vectorimagerenderer.cpp b/engines/sword25/gfx/image/vectorimagerenderer.cpp
index 552b2cf58b..de34302908 100644
--- a/engines/sword25/gfx/image/vectorimagerenderer.cpp
+++ b/engines/sword25/gfx/image/vectorimagerenderer.cpp
@@ -95,7 +95,7 @@ class StyleHandler {
public:
StyleHandler(const BS_VectorImageElement &VectorImageElement) : m_ImageElement(VectorImageElement) {}
- bool is_solid(unsigned int style) const {
+ bool is_solid(uint style) const {
return true;
}
@@ -120,12 +120,12 @@ BS_VectorImageRenderer::BS_VectorImageRenderer() :
bool BS_VectorImageRenderer::Render(const BS_VectorImage &VectorImage,
float ScaleFactorX, float ScaleFactorY,
- unsigned int &Width, unsigned int &Height,
+ uint &Width, uint &Height,
byte *ImageData,
float LineScaleFactor,
bool NoAlphaShapes) {
- Width = static_cast<unsigned int>(VectorImage.GetWidth() * ScaleFactorX);
- Height = static_cast<unsigned int>(VectorImage.GetHeight() * ScaleFactorY);
+ Width = static_cast<uint>(VectorImage.GetWidth() * ScaleFactorX);
+ Height = static_cast<uint>(VectorImage.GetHeight() * ScaleFactorY);
ImageData.resize(Width * Height * 4);
memset(&ImageData[0], 0, ImageData.size());
@@ -139,7 +139,7 @@ bool BS_VectorImageRenderer::Render(const BS_VectorImage &VectorImage,
Scale = agg::trans_affine_translation(- VectorImage.GetBoundingBox().left, - VectorImage.GetBoundingBox().top);
Scale *= agg::trans_affine_scaling(ScaleFactorX, ScaleFactorY);
- for (unsigned int element = 0; element < VectorImage.GetElementCount(); ++element) {
+ for (uint element = 0; element < VectorImage.GetElementCount(); ++element) {
const BS_VectorImageElement &CurImageElement = VectorImage.GetElement(element);
CompoundShape ImageCompoundShape(CurImageElement);
@@ -151,9 +151,9 @@ bool BS_VectorImageRenderer::Render(const BS_VectorImage &VectorImage,
//----------------------
CompoundRasterizer.clip_box(0, 0, Width, Height);
CompoundRasterizer.reset();
- for (unsigned int i = 0; i < CurImageElement.GetPathCount(); ++i) {
- unsigned int FillStyle0 = CurImageElement.GetPathInfo(i).GetFillStyle0();
- unsigned int FillStyle1 = CurImageElement.GetPathInfo(i).GetFillStyle1();
+ for (uint i = 0; i < CurImageElement.GetPathCount(); ++i) {
+ uint FillStyle0 = CurImageElement.GetPathInfo(i).GetFillStyle0();
+ uint FillStyle1 = CurImageElement.GetPathInfo(i).GetFillStyle1();
if (NoAlphaShapes) {
if (FillStyle0 != 0 && CurImageElement.GetFillStyleColor(FillStyle0 - 1).a != 255) FillStyle0 = 0;
@@ -173,10 +173,10 @@ bool BS_VectorImageRenderer::Render(const BS_VectorImage &VectorImage,
Rasterizer.clip_box(0, 0, Width, Height);
Stroke.line_join(agg::round_join);
Stroke.line_cap(agg::round_cap);
- for (unsigned int i = 0; i < CurImageElement.GetPathCount(); ++i) {
+ for (uint i = 0; i < CurImageElement.GetPathCount(); ++i) {
Rasterizer.reset();
- unsigned int CurrentLineStyle = CurImageElement.GetPathInfo(i).GetLineStyle();
+ uint CurrentLineStyle = CurImageElement.GetPathInfo(i).GetLineStyle();
if (CurrentLineStyle != 0) {
Stroke.width(ScaleFactorX * CurImageElement.GetLineStyleWidth(CurrentLineStyle - 1) * LineScaleFactor);
Rasterizer.add_path(Stroke, CurImageElement.GetPathInfo(i).GetID());
@@ -202,7 +202,7 @@ VectorImageRenderer::VectorImageRenderer() {}
bool VectorImageRenderer::Render(const VectorImage &VectorImage,
float ScaleFactorX, float ScaleFactorY,
- unsigned int &Width, unsigned int &Height,
+ uint &Width, uint &Height,
byte *ImageData,
float LineScaleFactor,
bool NoAlphaShapes) {
diff --git a/engines/sword25/gfx/image/vectorimagerenderer.h b/engines/sword25/gfx/image/vectorimagerenderer.h
index e1cd25bb6a..2b1f63fdb6 100644
--- a/engines/sword25/gfx/image/vectorimagerenderer.h
+++ b/engines/sword25/gfx/image/vectorimagerenderer.h
@@ -68,7 +68,7 @@ public:
bool Render(const VectorImage &VectorImage,
float ScaleFactorX, float ScaleFactorY,
- unsigned int &Width, unsigned int &Height,
+ uint &Width, uint &Height,
byte *ImageData,
float LineScaleFactor = 1.0f,
bool NoAlphaShapes = false);