[Scummvm-cvs-logs] SF.net SVN: scummvm:[53287] scummvm/trunk/engines/sword25/gfx
sev at users.sourceforge.net
sev at users.sourceforge.net
Wed Oct 13 01:17:19 CEST 2010
Revision: 53287
http://scummvm.svn.sourceforge.net/scummvm/?rev=53287&view=rev
Author: sev
Date: 2010-10-12 23:17:19 +0000 (Tue, 12 Oct 2010)
Log Message:
-----------
SWORD25: char * -> byte * in image-related operations
Modified Paths:
--------------
scummvm/trunk/engines/sword25/gfx/image/b25sloader.cpp
scummvm/trunk/engines/sword25/gfx/image/b25sloader.h
scummvm/trunk/engines/sword25/gfx/image/imageloader.cpp
scummvm/trunk/engines/sword25/gfx/image/imageloader.h
scummvm/trunk/engines/sword25/gfx/image/pngloader.cpp
scummvm/trunk/engines/sword25/gfx/image/pngloader.h
scummvm/trunk/engines/sword25/gfx/opengl/glimage.cpp
scummvm/trunk/engines/sword25/gfx/opengl/swimage.cpp
Modified: scummvm/trunk/engines/sword25/gfx/image/b25sloader.cpp
===================================================================
--- scummvm/trunk/engines/sword25/gfx/image/b25sloader.cpp 2010-10-12 23:16:44 UTC (rev 53286)
+++ scummvm/trunk/engines/sword25/gfx/image/b25sloader.cpp 2010-10-12 23:17:19 UTC (rev 53287)
@@ -46,7 +46,7 @@
// -----------------------------------------------------------------------------
namespace {
-unsigned int FindEmbeddedPNG(const char *FileDataPtr, unsigned int FileSize) {
+unsigned int FindEmbeddedPNG(const byte *FileDataPtr, unsigned int FileSize) {
#if 0
// Einen Stringstream mit dem Anfang der Datei intialisieren. 512 Byte sollten hierf\xFCr gen\xFCgen.
istringstream StringStream(string(FileDataPtr, FileDataPtr + min(static_cast<unsigned int>(512), FileSize)));
@@ -72,7 +72,7 @@
// -----------------------------------------------------------------------------
-bool B25SLoader::IsCorrectImageFormat(const char *FileDataPtr, unsigned int FileSize) {
+bool B25SLoader::IsCorrectImageFormat(const byte *FileDataPtr, unsigned int FileSize) {
// PNG innerhalb des Spielstandes finden und den Methodenaufruf zu BS_PNGLoader weiterreichen.
unsigned int PNGOffset = FindEmbeddedPNG(FileDataPtr, FileSize);
if (PNGOffset > 0) {
@@ -84,7 +84,7 @@
// -----------------------------------------------------------------------------
-bool B25SLoader::DecodeImage(const char *FileDataPtr, unsigned int FileSize, GraphicEngine::COLOR_FORMATS ColorFormat, byte *&UncompressedDataPtr,
+bool B25SLoader::DecodeImage(const byte *FileDataPtr, unsigned int 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);
@@ -97,7 +97,7 @@
// -----------------------------------------------------------------------------
-bool B25SLoader::ImageProperties(const char *FileDataPtr, unsigned int FileSize, GraphicEngine::COLOR_FORMATS &ColorFormat, int &Width, int &Height) {
+bool B25SLoader::ImageProperties(const byte *FileDataPtr, unsigned int 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);
if (PNGOffset > 0) {
Modified: scummvm/trunk/engines/sword25/gfx/image/b25sloader.h
===================================================================
--- scummvm/trunk/engines/sword25/gfx/image/b25sloader.h 2010-10-12 23:16:44 UTC (rev 53286)
+++ scummvm/trunk/engines/sword25/gfx/image/b25sloader.h 2010-10-12 23:17:19 UTC (rev 53287)
@@ -57,10 +57,10 @@
}
protected:
- virtual bool IsCorrectImageFormat(const char *FileDataPtr, unsigned int FileSize);
- virtual bool DecodeImage(const char *FileDataPtr, unsigned int FileSize, GraphicEngine::COLOR_FORMATS ColorFormat, byte *&UncompressedDataPtr,
+ virtual bool IsCorrectImageFormat(const byte *FileDataPtr, unsigned int FileSize);
+ virtual bool DecodeImage(const byte *FileDataPtr, unsigned int FileSize, GraphicEngine::COLOR_FORMATS ColorFormat, byte *&UncompressedDataPtr,
int &Width, int &Height, int &Pitch);
- virtual bool ImageProperties(const char *FileDataPtr, unsigned int FileSize, GraphicEngine::COLOR_FORMATS &ColorFormat, int &Width, int &Height);
+ virtual bool ImageProperties(const byte *FileDataPtr, unsigned int FileSize, GraphicEngine::COLOR_FORMATS &ColorFormat, int &Width, int &Height);
};
Modified: scummvm/trunk/engines/sword25/gfx/image/imageloader.cpp
===================================================================
--- scummvm/trunk/engines/sword25/gfx/image/imageloader.cpp 2010-10-12 23:16:44 UTC (rev 53286)
+++ scummvm/trunk/engines/sword25/gfx/image/imageloader.cpp 2010-10-12 23:17:19 UTC (rev 53287)
@@ -46,7 +46,7 @@
// Lade Methode
// ------------
-bool ImageLoader::LoadImage(const char *pFileData, unsigned int FileSize,
+bool ImageLoader::LoadImage(const byte *pFileData, unsigned int FileSize,
GraphicEngine::COLOR_FORMATS ColorFormat,
byte *&pUncompressedData,
int &Width, int &Height,
@@ -71,7 +71,7 @@
// Info Methode
// ------------
-bool ImageLoader::ExtractImageProperties(const char *pFileData, unsigned int FileSize,
+bool ImageLoader::ExtractImageProperties(const byte *pFileData, unsigned int 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 @@
}
}
-ImageLoader *ImageLoader::_FindSuitableImageLoader(const char *pFileData, unsigned int FileSize) {
+ImageLoader *ImageLoader::_FindSuitableImageLoader(const byte *pFileData, unsigned int 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) {
Modified: scummvm/trunk/engines/sword25/gfx/image/imageloader.h
===================================================================
--- scummvm/trunk/engines/sword25/gfx/image/imageloader.h 2010-10-12 23:16:44 UTC (rev 53286)
+++ scummvm/trunk/engines/sword25/gfx/image/imageloader.h 2010-10-12 23:17:19 UTC (rev 53287)
@@ -99,7 +99,7 @@
@remark Die Gr\xF6\xDFe 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 char *pFileData, unsigned int FileSize,
+ static bool LoadImage(const byte *pFileData, unsigned int FileSize,
GraphicEngine::COLOR_FORMATS ColorFormat,
byte *&pUncompressedData,
int &Width, int &Height,
@@ -116,7 +116,7 @@
@return Gibt false zur\xFCck, 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 char *pFileData, unsigned int FileSize,
+ static bool ExtractImageProperties(const byte *pFileData, unsigned int FileSize,
GraphicEngine::COLOR_FORMATS &ColorFormat,
int &Width, int &Height);
//@}
@@ -148,7 +148,7 @@
@return Gibt true zur\xFCck, 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 char *pFileData, unsigned int FileSize) = 0;
+ virtual bool IsCorrectImageFormat(const byte *pFileData, unsigned int FileSize) = 0;
/**
@brief L\xE4dt eine Bilddatei.
@@ -170,7 +170,7 @@
@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 char *pFileData, unsigned int FileSize,
+ virtual bool DecodeImage(const byte *pFileData, unsigned int FileSize,
GraphicEngine::COLOR_FORMATS ColorFormat,
byte *&pUncompressedData,
int &Width, int &Height,
@@ -187,7 +187,7 @@
@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 char *pFileData, unsigned int FileSize,
+ virtual bool ImageProperties(const byte *pFileData, unsigned int FileSize,
GraphicEngine::COLOR_FORMATS &ColorFormat,
int &Width, int &Height) = 0;
@@ -204,7 +204,7 @@
@remark Es gilt zu beachten, dass der Zielpuffer ausreichend gro\xDF ist.<br>
Es sind mindestens Width * 2 Byte notwendig.
*/
- static void RowARGB32ToRGB16(unsigned char *pSrcData, unsigned char *pDestData, unsigned int Width) {
+ static void RowARGB32ToRGB16(byte *pSrcData, byte *pDestData, unsigned int Width) {
for (unsigned int i = 0; i < Width; i++) {
((uint16_t *)pDestData)[i] = ((pSrcData[2] >> 3) << 11) | ((pSrcData[1] >> 2) << 5) | (pSrcData[0] >> 3);
pSrcData += 4;
@@ -219,7 +219,7 @@
@remark Es gilt zu beachten, dass der Zielpuffer ausreichend gro\xDF ist.<br>
Es sind mindestens Width * 2 Byte notwendig.
*/
- static void RowARGB32ToRGB15(unsigned char *pSrcData, unsigned char *pDestData, unsigned int Width) {
+ static void RowARGB32ToRGB15(byte *pSrcData, byte *pDestData, unsigned int Width) {
for (unsigned int i = 0; i < Width; i++) {
((uint16_t *)pDestData)[i] = ((pSrcData[2] >> 3) << 10) | ((pSrcData[1] >> 3) << 5) | (pSrcData[0] >> 3);
pSrcData += 4;
@@ -234,7 +234,7 @@
@remark Es gilt zu beachten, dass der Zielpuffer ausreichend gro\xDF sein muss.<br>
Es sind mindestens ((Width + 3) / 4) * 12 Byte notwendig.
*/
- static void RowARGB32ToRGB16_INTERLEAVED(unsigned char *pSrcData, unsigned char *pDestData, unsigned int Width) {
+ static void RowARGB32ToRGB16_INTERLEAVED(byte *pSrcData, byte *pDestData, unsigned int Width) {
// Die Pixelbl\xF6cke erstellen, dabei werden immer jeweils 4 Pixel zu einem Block zusammengefasst
unsigned int BlockFillCount = 0;
unsigned int AlphaBlock = 0;
@@ -278,7 +278,7 @@
@remark Es gilt zu beachten, dass der Zielpuffer ausreichend gro\xDF ist.<br>
Es sind mindestens (Width / 4 + Width % 4) * 3 Byte notwendig.
*/
- static void RowARGB32ToRGB15_INTERLEAVED(unsigned char *pSrcData, unsigned char *pDestData, unsigned int Width) {
+ static void RowARGB32ToRGB15_INTERLEAVED(byte *pSrcData, byte *pDestData, unsigned int Width) {
// Die Pixelbl\xF6cke erstellen, dabei werden immer jeweils 4 Pixel zu einem Block zusammengefasst
unsigned int BlockFillCount = 0;
unsigned int AlphaBlock = 0;
@@ -320,7 +320,7 @@
@param pDestData ein Pointer auf den Zielpuffern.
@param Width die Anzahl der Pixel in der Bildzeile.
*/
- static void RowARGB32ToABGR32(unsigned char *pSrcData, unsigned char *pDestData, unsigned int Width) {
+ static void RowARGB32ToABGR32(byte *pSrcData, byte *pDestData, unsigned int Width) {
for (unsigned int i = 0; i < Width; ++i) {
*pDestData++ = pSrcData[2];
*pDestData++ = pSrcData[1];
@@ -349,7 +349,7 @@
@brief Sucht zu Bilddaten ein BS_ImageLoader Objekt, dass die Bilddaten dekodieren kann.
@return Gibt einen Pointer auf ein passendes BS_ImageLoader Objekt zur\xFCck, oder NULL, wenn kein passendes Objekt gefunden wurde.
*/
- static ImageLoader *_FindSuitableImageLoader(const char *pFileData, unsigned int FileSize);
+ static ImageLoader *_FindSuitableImageLoader(const byte *pFileData, unsigned int FileSize);
static Common::List<ImageLoader *> _ImageLoaderList; // Die Liste aller BS_ImageLoader-Objekte
static bool _ImageLoaderListInitialized; // Gibt an, ob die Liste schon intialisiert wurde
Modified: scummvm/trunk/engines/sword25/gfx/image/pngloader.cpp
===================================================================
--- scummvm/trunk/engines/sword25/gfx/image/pngloader.cpp 2010-10-12 23:16:44 UTC (rev 53286)
+++ scummvm/trunk/engines/sword25/gfx/image/pngloader.cpp 2010-10-12 23:17:19 UTC (rev 53287)
@@ -62,7 +62,7 @@
// -----------------------------------------------------------------------------
-bool PNGLoader::DoDecodeImage(const char *FileDataPtr, unsigned int FileSize, GraphicEngine::COLOR_FORMATS ColorFormat, byte *&UncompressedDataPtr,
+bool PNGLoader::DoDecodeImage(const byte *FileDataPtr, unsigned int FileSize, GraphicEngine::COLOR_FORMATS ColorFormat, byte *&UncompressedDataPtr,
int &Width, int &Height, int &Pitch) {
png_structp png_ptr = NULL;
png_infop info_ptr = NULL;
@@ -86,7 +86,7 @@
}
// PNG Signatur \xFCberpr\xFCfen
- if (!png_check_sig(reinterpret_cast<png_bytep>(const_cast<char *>(FileDataPtr)), 8)) {
+ if (!png_check_sig(reinterpret_cast<png_bytep>(const_cast<byte *>(FileDataPtr)), 8)) {
error("png_check_sig failed");
}
@@ -259,14 +259,14 @@
// -----------------------------------------------------------------------------
-bool PNGLoader::DecodeImage(const char *FileDataPtr, unsigned int FileSize, GraphicEngine::COLOR_FORMATS ColorFormat, byte *&UncompressedDataPtr,
+bool PNGLoader::DecodeImage(const byte *FileDataPtr, unsigned int 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 char *FileDataPtr, unsigned int FileSize, GraphicEngine::COLOR_FORMATS &ColorFormat, int &Width, int &Height) {
+bool PNGLoader::DoImageProperties(const byte *FileDataPtr, unsigned int FileSize, GraphicEngine::COLOR_FORMATS &ColorFormat, int &Width, int &Height) {
// PNG Signatur \xFCberpr\xFCfen
if (!DoIsCorrectImageFormat(FileDataPtr, FileSize)) return false;
@@ -310,7 +310,7 @@
// -----------------------------------------------------------------------------
-bool PNGLoader::ImageProperties(const char *FileDataPtr, unsigned int FileSize, GraphicEngine::COLOR_FORMATS &ColorFormat, int &Width, int &Height) {
+bool PNGLoader::ImageProperties(const byte *FileDataPtr, unsigned int FileSize, GraphicEngine::COLOR_FORMATS &ColorFormat, int &Width, int &Height) {
return DoImageProperties(FileDataPtr, FileSize, ColorFormat, Width, Height);
}
@@ -318,7 +318,7 @@
// Header \xFCberpr\xFCfen
// -----------------------------------------------------------------------------
-bool PNGLoader::DoIsCorrectImageFormat(const char *FileDataPtr, unsigned int FileSize) {
+bool PNGLoader::DoIsCorrectImageFormat(const byte *FileDataPtr, unsigned int FileSize) {
if (FileSize > 8)
return png_check_sig((byte *)FileDataPtr, 8) ? true : false;
else
@@ -327,7 +327,7 @@
// -----------------------------------------------------------------------------
-bool PNGLoader::IsCorrectImageFormat(const char *FileDataPtr, unsigned int FileSize) {
+bool PNGLoader::IsCorrectImageFormat(const byte *FileDataPtr, unsigned int FileSize) {
return DoIsCorrectImageFormat(FileDataPtr, FileSize);
}
Modified: scummvm/trunk/engines/sword25/gfx/image/pngloader.h
===================================================================
--- scummvm/trunk/engines/sword25/gfx/image/pngloader.h 2010-10-12 23:16:44 UTC (rev 53286)
+++ scummvm/trunk/engines/sword25/gfx/image/pngloader.h 2010-10-12 23:17:19 UTC (rev 53287)
@@ -60,20 +60,20 @@
// Alle virtuellen Methoden von BS_ImageLoader sind hier als static-Methode implementiert, damit sie von BS_B25SLoader aufgerufen werden k\xF6nnen.
// Die virtuellen Methoden rufen diese Methoden auf.
- static bool DoIsCorrectImageFormat(const char *FileDataPtr, unsigned int FileSize);
- static bool DoDecodeImage(const char *FileDataPtr, unsigned int FileSize, GraphicEngine::COLOR_FORMATS ColorFormat, byte *&UncompressedDataPtr,
+ static bool DoIsCorrectImageFormat(const byte *FileDataPtr, unsigned int FileSize);
+ static bool DoDecodeImage(const byte *FileDataPtr, unsigned int FileSize, GraphicEngine::COLOR_FORMATS ColorFormat, byte *&UncompressedDataPtr,
int &Width, int &Height, int &Pitch);
- static bool DoImageProperties(const char *FileDataPtr, unsigned int FileSize, GraphicEngine::COLOR_FORMATS &ColorFormat, int &Width, int &Height);
+ static bool DoImageProperties(const byte *FileDataPtr, unsigned int FileSize, GraphicEngine::COLOR_FORMATS &ColorFormat, int &Width, int &Height);
protected:
PNGLoader();
- bool DecodeImage(const char *pFileData, unsigned int FileSize,
+ bool DecodeImage(const byte *pFileData, unsigned int FileSize,
GraphicEngine::COLOR_FORMATS ColorFormat,
byte *&pUncompressedData,
int &Width, int &Height,
int &Pitch);
- bool IsCorrectImageFormat(const char *FileDataPtr, unsigned int FileSize);
- bool ImageProperties(const char *FileDatePtr, unsigned int FileSize, GraphicEngine::COLOR_FORMATS &ColorFormat, int &Width, int &Height);
+ bool IsCorrectImageFormat(const byte *FileDataPtr, unsigned int FileSize);
+ bool ImageProperties(const byte *FileDatePtr, unsigned int FileSize, GraphicEngine::COLOR_FORMATS &ColorFormat, int &Width, int &Height);
};
} // End of namespace Sword25
Modified: scummvm/trunk/engines/sword25/gfx/opengl/glimage.cpp
===================================================================
--- scummvm/trunk/engines/sword25/gfx/opengl/glimage.cpp 2010-10-12 23:16:44 UTC (rev 53286)
+++ scummvm/trunk/engines/sword25/gfx/opengl/glimage.cpp 2010-10-12 23:17:19 UTC (rev 53287)
@@ -63,9 +63,9 @@
_backSurface = (static_cast<GraphicEngine *>(Kernel::GetInstance()->GetService("gfx")))->getSurface();
// Datei laden
- char *pFileData;
+ byte *pFileData;
unsigned int FileSize;
- if (!(pFileData = (char *) pPackage->GetFile(Filename, &FileSize))) {
+ if (!(pFileData = (byte *) pPackage->GetFile(Filename, &FileSize))) {
BS_LOG_ERRORLN("File \"%s\" could not be loaded.", Filename.c_str());
return;
}
Modified: scummvm/trunk/engines/sword25/gfx/opengl/swimage.cpp
===================================================================
--- scummvm/trunk/engines/sword25/gfx/opengl/swimage.cpp 2010-10-12 23:16:44 UTC (rev 53286)
+++ scummvm/trunk/engines/sword25/gfx/opengl/swimage.cpp 2010-10-12 23:17:19 UTC (rev 53287)
@@ -60,9 +60,9 @@
BS_ASSERT(pPackage);
// Datei laden
- char *pFileData;
+ byte *pFileData;
unsigned int FileSize;
- if (!(pFileData = (char *) pPackage->GetFile(Filename, &FileSize))) {
+ if (!(pFileData = (byte *) pPackage->GetFile(Filename, &FileSize))) {
BS_LOG_ERRORLN("File \"%s\" could not be loaded.", Filename.c_str());
return;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list