[Scummvm-cvs-logs] SF.net SVN: scummvm:[53308] scummvm/trunk/engines/sword25

sev at users.sourceforge.net sev at users.sourceforge.net
Wed Oct 13 01:26:49 CEST 2010


Revision: 53308
          http://scummvm.svn.sourceforge.net/scummvm/?rev=53308&view=rev
Author:   sev
Date:     2010-10-12 23:26:48 +0000 (Tue, 12 Oct 2010)

Log Message:
-----------
SWORD25: unsigned char -> byte

Modified Paths:
--------------
    scummvm/trunk/engines/sword25/fmv/yuvtorgba.cpp
    scummvm/trunk/engines/sword25/gfx/image/vectorimage.cpp
    scummvm/trunk/engines/sword25/gfx/image/vectorimage.h
    scummvm/trunk/engines/sword25/gfx/opengl/openglgfx.cpp
    scummvm/trunk/engines/sword25/gfx/screenshot.cpp
    scummvm/trunk/engines/sword25/gfx/text.cpp
    scummvm/trunk/engines/sword25/input/inputengine.h
    scummvm/trunk/engines/sword25/input/inputengine_script.cpp
    scummvm/trunk/engines/sword25/input/scummvminput.cpp
    scummvm/trunk/engines/sword25/input/scummvminput.h
    scummvm/trunk/engines/sword25/kernel/inputpersistenceblock.cpp
    scummvm/trunk/engines/sword25/kernel/inputpersistenceblock.h
    scummvm/trunk/engines/sword25/kernel/outputpersistenceblock.cpp
    scummvm/trunk/engines/sword25/kernel/outputpersistenceblock.h
    scummvm/trunk/engines/sword25/kernel/persistenceblock.h
    scummvm/trunk/engines/sword25/kernel/scummvmwindow.cpp
    scummvm/trunk/engines/sword25/script/luascript.cpp

Modified: scummvm/trunk/engines/sword25/fmv/yuvtorgba.cpp
===================================================================
--- scummvm/trunk/engines/sword25/fmv/yuvtorgba.cpp	2010-10-12 23:25:54 UTC (rev 53307)
+++ scummvm/trunk/engines/sword25/fmv/yuvtorgba.cpp	2010-10-12 23:26:48 UTC (rev 53308)
@@ -183,12 +183,12 @@
 
 	const int *cl = &CLAMP_TAB[320];
 
-	const unsigned char *ySrc0 = YUVBuffer[0].data;
-	const unsigned char *ySrc1 = YUVBuffer[0].data + YUVBuffer[0].stride;
-	const unsigned char *uSrc  = YUVBuffer[1].data;
-	const unsigned char *vSrc  = YUVBuffer[2].data;
-	unsigned char *dst0  = &PixelData[0];
-	unsigned char *dst1  = &PixelData[0] + YUVBuffer[0].width * 4;
+	const byte *ySrc0 = YUVBuffer[0].data;
+	const byte *ySrc1 = YUVBuffer[0].data + YUVBuffer[0].stride;
+	const byte *uSrc  = YUVBuffer[1].data;
+	const byte *vSrc  = YUVBuffer[2].data;
+	byte *dst0  = &PixelData[0];
+	byte *dst1  = &PixelData[0] + YUVBuffer[0].width * 4;
 
 	for (int h = 0; h < YUVBuffer[0].height / 2; ++h) {
 		for (int w = 0; w < YUVBuffer[0].width / 2; ++w) {

Modified: scummvm/trunk/engines/sword25/gfx/image/vectorimage.cpp
===================================================================
--- scummvm/trunk/engines/sword25/gfx/image/vectorimage.cpp	2010-10-12 23:25:54 UTC (rev 53307)
+++ scummvm/trunk/engines/sword25/gfx/image/vectorimage.cpp	2010-10-12 23:26:48 UTC (rev 53308)
@@ -60,7 +60,7 @@
 
 class VectorImage::SWFBitStream {
 public:
-	SWFBitStream(const unsigned char *pData, unsigned int DataSize) :
+	SWFBitStream(const byte *pData, unsigned int DataSize) :
 		m_Pos(pData), m_End(pData + DataSize), m_WordMask(0)
 	{}
 
@@ -141,8 +141,8 @@
 	}
 
 private:
-	const unsigned char    *m_Pos;
-	const unsigned char    *m_End;
+	const byte    *m_Pos;
+	const byte    *m_End;
 
 	byte                      m_Word;
 	unsigned int            m_WordMask;
@@ -224,7 +224,7 @@
 // Konstruktion
 // -----------------------------------------------------------------------------
 
-VectorImage::VectorImage(const unsigned char *pFileData, unsigned int FileSize, bool &Success) {
+VectorImage::VectorImage(const byte *pFileData, unsigned int FileSize, bool &Success) {
 	Success = false;
 
 	// Bitstream-Objekt erzeugen

Modified: scummvm/trunk/engines/sword25/gfx/image/vectorimage.h
===================================================================
--- scummvm/trunk/engines/sword25/gfx/image/vectorimage.h	2010-10-12 23:25:54 UTC (rev 53307)
+++ scummvm/trunk/engines/sword25/gfx/image/vectorimage.h	2010-10-12 23:26:48 UTC (rev 53308)
@@ -162,7 +162,7 @@
 
 class VectorImage : public Image {
 public:
-	VectorImage(const unsigned char *pFileData, unsigned int FileSize, bool &Success);
+	VectorImage(const byte *pFileData, unsigned int FileSize, bool &Success);
 
 	unsigned int GetElementCount() const {
 		return m_Elements.size();

Modified: scummvm/trunk/engines/sword25/gfx/opengl/openglgfx.cpp
===================================================================
--- scummvm/trunk/engines/sword25/gfx/opengl/openglgfx.cpp	2010-10-12 23:25:54 UTC (rev 53307)
+++ scummvm/trunk/engines/sword25/gfx/opengl/openglgfx.cpp	2010-10-12 23:26:48 UTC (rev 53308)
@@ -331,9 +331,9 @@
 		BS_ASSERT(pPackage);
 
 		// Datei laden
-		unsigned char *pFileData;
+		byte *pFileData;
 		unsigned int FileSize;
-		if (!(pFileData = static_cast<unsigned char *>(pPackage->GetFile(FileName, &FileSize)))) {
+		if (!(pFileData = static_cast<byte *>(pPackage->GetFile(FileName, &FileSize)))) {
 			BS_LOG_ERRORLN("File \"%s\" could not be loaded.", FileName.c_str());
 			return 0;
 		}

Modified: scummvm/trunk/engines/sword25/gfx/screenshot.cpp
===================================================================
--- scummvm/trunk/engines/sword25/gfx/screenshot.cpp	2010-10-12 23:25:54 UTC (rev 53307)
+++ scummvm/trunk/engines/sword25/gfx/screenshot.cpp	2010-10-12 23:26:48 UTC (rev 53308)
@@ -46,15 +46,15 @@
 // -----------------------------------------------------------------------------
 
 struct RGB_PIXEL {
-	RGB_PIXEL(unsigned char _Red, unsigned char _Green, unsigned char _Blue) :
+	RGB_PIXEL(byte _Red, byte _Green, byte _Blue) :
 		Red(_Red),
 		Green(_Green),
 		Blue(_Blue)
 	{};
 
-	unsigned char Red;
-	unsigned char Green;
-	unsigned char Blue;
+	byte Red;
+	byte Green;
+	byte Blue;
 };
 
 bool Screenshot::SaveToFile(unsigned int Width, unsigned int Height, const byte *Data, const Common::String &Filename) {

Modified: scummvm/trunk/engines/sword25/gfx/text.cpp
===================================================================
--- scummvm/trunk/engines/sword25/gfx/text.cpp	2010-10-12 23:25:54 UTC (rev 53307)
+++ scummvm/trunk/engines/sword25/gfx/text.cpp	2010-10-12 23:26:48 UTC (rev 53308)
@@ -183,7 +183,7 @@
 		int CurX = m_AbsoluteX + (*Iter).BBox.left;
 		int CurY = m_AbsoluteY + (*Iter).BBox.top;
 		for (unsigned int i = 0; i < (*Iter).Text.size(); ++i) {
-			Common::Rect CurRect = FontPtr->GetCharacterRect((unsigned char)(*Iter).Text[i]);
+			Common::Rect CurRect = FontPtr->GetCharacterRect((byte)(*Iter).Text[i]);
 
 			Common::Rect RenderRect(CurX, CurY, CurX + CurRect.width(), CurY + CurRect.height());
 			int RenderX = CurX + (RenderRect.left - RenderRect.left);
@@ -258,9 +258,9 @@
 			TempLineWidth = 0;
 			LastSpace = 0;
 			for (j = i; j < m_Text.size(); ++j) {
-				if ((unsigned char)m_Text[j] == ' ') LastSpace = j;
+				if ((byte)m_Text[j] == ' ') LastSpace = j;
 
-				const Common::Rect &CurCharRect = FontPtr->GetCharacterRect((unsigned char)m_Text[j]);
+				const Common::Rect &CurCharRect = FontPtr->GetCharacterRect((byte)m_Text[j]);
 				TempLineWidth += CurCharRect.width();
 				TempLineWidth += FontPtr->GetGapWidth();
 
@@ -275,7 +275,7 @@
 			for (j = i; j < LastSpace; ++j) {
 				m_Lines[CurLine].Text += m_Text[j];
 
-				const Common::Rect &CurCharRect = FontPtr->GetCharacterRect((unsigned char)m_Text[j]);
+				const Common::Rect &CurCharRect = FontPtr->GetCharacterRect((byte)m_Text[j]);
 				CurLineWidth += CurCharRect.width();
 				CurLineWidth += FontPtr->GetGapWidth();
 				if ((unsigned int) CurCharRect.height() > CurLineHeight) CurLineHeight = CurCharRect.height();
@@ -322,7 +322,7 @@
 	m_Height = 0;
 
 	for (unsigned int i = 0; i < m_Text.size(); ++i) {
-		const Common::Rect &CurRect = FontResource.GetCharacterRect((unsigned char)m_Text[i]);
+		const Common::Rect &CurRect = FontResource.GetCharacterRect((byte)m_Text[i]);
 		m_Width += CurRect.width();
 		if (i != m_Text.size() - 1) m_Width += FontResource.GetGapWidth();
 		if (m_Height < CurRect.height()) m_Height = CurRect.height();

Modified: scummvm/trunk/engines/sword25/input/inputengine.h
===================================================================
--- scummvm/trunk/engines/sword25/input/inputengine.h	2010-10-12 23:25:54 UTC (rev 53307)
+++ scummvm/trunk/engines/sword25/input/inputengine.h	2010-10-12 23:26:48 UTC (rev 53308)
@@ -296,7 +296,7 @@
 	 */
 	virtual bool UnregisterCommandCallback(CommandCallback Callback) = 0;
 
-	virtual void ReportCharacter(unsigned char Character) = 0;
+	virtual void ReportCharacter(byte Character) = 0;
 	virtual void ReportCommand(KEY_COMMANDS Command) = 0;
 
 private:

Modified: scummvm/trunk/engines/sword25/input/inputengine_script.cpp
===================================================================
--- scummvm/trunk/engines/sword25/input/inputengine_script.cpp	2010-10-12 23:25:54 UTC (rev 53307)
+++ scummvm/trunk/engines/sword25/input/inputengine_script.cpp	2010-10-12 23:26:48 UTC (rev 53308)
@@ -244,7 +244,7 @@
 // -----------------------------------------------------------------------------
 
 static void TheCharacterCallback(int Character) {
-	CharacterCallbackPtr->Character = static_cast<unsigned char>(Character);
+	CharacterCallbackPtr->Character = static_cast<byte>(Character);
 	lua_State *L = static_cast<lua_State *>(Kernel::GetInstance()->GetScript()->GetScriptObject());
 	CharacterCallbackPtr->InvokeCallbackFunctions(L, 1);
 }

Modified: scummvm/trunk/engines/sword25/input/scummvminput.cpp
===================================================================
--- scummvm/trunk/engines/sword25/input/scummvminput.cpp	2010-10-12 23:25:54 UTC (rev 53307)
+++ scummvm/trunk/engines/sword25/input/scummvminput.cpp	2010-10-12 23:26:48 UTC (rev 53308)
@@ -303,7 +303,7 @@
 
 // -----------------------------------------------------------------------------
 
-void ScummVMInput::ReportCharacter(unsigned char Character) {
+void ScummVMInput::ReportCharacter(byte Character) {
 	Common::List<CharacterCallback>::const_iterator CallbackIter = m_CharacterCallbacks.begin();
 	while (CallbackIter != m_CharacterCallbacks.end()) {
 		// Iterator vor dem Aufruf erh\xF6hen und im Folgendem auf einer Kopie arbeiten.

Modified: scummvm/trunk/engines/sword25/input/scummvminput.h
===================================================================
--- scummvm/trunk/engines/sword25/input/scummvminput.h	2010-10-12 23:25:54 UTC (rev 53307)
+++ scummvm/trunk/engines/sword25/input/scummvminput.h	2010-10-12 23:26:48 UTC (rev 53308)
@@ -69,7 +69,7 @@
 	virtual bool UnregisterCharacterCallback(CallbackPtr Callback);
 	virtual bool RegisterCommandCallback(CallbackPtr Callback);
 	virtual bool UnregisterCommandCallback(CallbackPtr Callback);
-	virtual void ReportCharacter(unsigned char Character);
+	virtual void ReportCharacter(byte Character);
 	virtual void ReportCommand(KEY_COMMANDS Command);
 
 	bool Persist(OutputPersistenceBlock &Writer);

Modified: scummvm/trunk/engines/sword25/kernel/inputpersistenceblock.cpp
===================================================================
--- scummvm/trunk/engines/sword25/kernel/inputpersistenceblock.cpp	2010-10-12 23:25:54 UTC (rev 53307)
+++ scummvm/trunk/engines/sword25/kernel/inputpersistenceblock.cpp	2010-10-12 23:26:48 UTC (rev 53308)
@@ -47,7 +47,7 @@
 // -----------------------------------------------------------------------------
 
 InputPersistenceBlock::InputPersistenceBlock(const void *Data, unsigned int DataLength) :
-	m_Data(static_cast<const unsigned char *>(Data), DataLength),
+	m_Data(static_cast<const byte *>(Data), DataLength),
 	m_ErrorState(NONE) {
 	m_Iter = m_Data.begin();
 }
@@ -132,13 +132,13 @@
 
 // -----------------------------------------------------------------------------
 
-void InputPersistenceBlock::Read(Common::Array<unsigned char> &Value) {
+void InputPersistenceBlock::Read(Common::Array<byte> &Value) {
 	if (CheckMarker(BLOCK_MARKER)) {
 		unsigned int Size;
 		Read(Size);
 
 		if (CheckBlockSize(Size)) {
-			Value = Common::Array<unsigned char>(m_Iter, Size);
+			Value = Common::Array<byte>(m_Iter, Size);
 			m_Iter += Size;
 		}
 	}
@@ -167,7 +167,7 @@
 
 // -----------------------------------------------------------------------------
 
-bool InputPersistenceBlock::CheckMarker(unsigned char Marker) {
+bool InputPersistenceBlock::CheckMarker(byte Marker) {
 	if (!IsGood() || !CheckBlockSize(1)) return false;
 
 	if (*m_Iter++ == Marker) {

Modified: scummvm/trunk/engines/sword25/kernel/inputpersistenceblock.h
===================================================================
--- scummvm/trunk/engines/sword25/kernel/inputpersistenceblock.h	2010-10-12 23:25:54 UTC (rev 53307)
+++ scummvm/trunk/engines/sword25/kernel/inputpersistenceblock.h	2010-10-12 23:26:48 UTC (rev 53308)
@@ -66,7 +66,7 @@
 	void Read(float &Value);
 	void Read(bool &Value);
 	void Read(Common::String &Value);
-	void Read(Common::Array<unsigned char> &Value);
+	void Read(Common::Array<byte> &Value);
 
 	bool IsGood() const {
 		return m_ErrorState == NONE;
@@ -76,12 +76,12 @@
 	}
 
 private:
-	bool CheckMarker(unsigned char Marker);
+	bool CheckMarker(byte Marker);
 	bool CheckBlockSize(int Size);
 	void RawRead(void *DestPtr, size_t Size);
 
-	Common::Array<unsigned char> m_Data;
-	Common::Array<unsigned char>::const_iterator m_Iter;
+	Common::Array<byte> m_Data;
+	Common::Array<byte>::const_iterator m_Iter;
 	ErrorState m_ErrorState;
 };
 

Modified: scummvm/trunk/engines/sword25/kernel/outputpersistenceblock.cpp
===================================================================
--- scummvm/trunk/engines/sword25/kernel/outputpersistenceblock.cpp	2010-10-12 23:25:54 UTC (rev 53307)
+++ scummvm/trunk/engines/sword25/kernel/outputpersistenceblock.cpp	2010-10-12 23:26:48 UTC (rev 53308)
@@ -114,7 +114,7 @@
 
 // -----------------------------------------------------------------------------
 
-void OutputPersistenceBlock::WriteMarker(unsigned char Marker) {
+void OutputPersistenceBlock::WriteMarker(byte Marker) {
 	m_Data.push_back(Marker);
 }
 

Modified: scummvm/trunk/engines/sword25/kernel/outputpersistenceblock.h
===================================================================
--- scummvm/trunk/engines/sword25/kernel/outputpersistenceblock.h	2010-10-12 23:25:54 UTC (rev 53307)
+++ scummvm/trunk/engines/sword25/kernel/outputpersistenceblock.h	2010-10-12 23:26:48 UTC (rev 53308)
@@ -67,10 +67,10 @@
 	}
 
 private:
-	void WriteMarker(unsigned char Marker);
+	void WriteMarker(byte Marker);
 	void RawWrite(const void *DataPtr, size_t Size);
 
-	Common::Array<unsigned char> m_Data;
+	Common::Array<byte> m_Data;
 };
 
 } // End of namespace Sword25

Modified: scummvm/trunk/engines/sword25/kernel/persistenceblock.h
===================================================================
--- scummvm/trunk/engines/sword25/kernel/persistenceblock.h	2010-10-12 23:25:54 UTC (rev 53307)
+++ scummvm/trunk/engines/sword25/kernel/persistenceblock.h	2010-10-12 23:26:48 UTC (rev 53308)
@@ -50,19 +50,19 @@
 class PersistenceBlock {
 public:
 	static unsigned int GetSInt32Size() {
-		return sizeof(signed int) + sizeof(unsigned char);
+		return sizeof(signed int) + sizeof(byte);
 	}
 	static unsigned int GetUInt32Size() {
-		return sizeof(unsigned int) + sizeof(unsigned char);
+		return sizeof(unsigned int) + sizeof(byte);
 	}
 	static unsigned int GetFloat32Size() {
-		return sizeof(float) + sizeof(unsigned char);
+		return sizeof(float) + sizeof(byte);
 	}
 	static unsigned int GetBoolSize() {
-		return sizeof(unsigned char) + sizeof(unsigned char);
+		return sizeof(byte) + sizeof(byte);
 	}
 	static unsigned int GetStringSize(const Common::String &String) {
-		return static_cast<unsigned int>(sizeof(unsigned int) + String.size() + sizeof(unsigned char));
+		return static_cast<unsigned int>(sizeof(unsigned int) + String.size() + sizeof(byte));
 	}
 
 protected:
@@ -98,7 +98,7 @@
 private:
 	static bool IsBigEndian() {
 		unsigned int Dummy = 1;
-		unsigned char *DummyPtr = reinterpret_cast<unsigned char *>(&Dummy);
+		byte *DummyPtr = reinterpret_cast<byte *>(&Dummy);
 		return DummyPtr[0] == 0;
 	}
 
@@ -111,7 +111,7 @@
 
 	static void ReverseByteOrder(void *Ptr) {
 		// Reverses the byte order of the 32-bit word pointed to by Ptr
-		unsigned char *CharPtr = static_cast<unsigned char *>(Ptr);
+		byte *CharPtr = static_cast<byte *>(Ptr);
 		Swap(CharPtr[0], CharPtr[3]);
 		Swap(CharPtr[1], CharPtr[2]);
 	}
@@ -122,7 +122,7 @@
 // -----------------------------------------------------------------------------
 
 #define CTASSERT(ex) typedef char ctassert_type[(ex) ? 1 : -1]
-CTASSERT(sizeof(unsigned char) == 1);
+CTASSERT(sizeof(byte) == 1);
 CTASSERT(sizeof(signed int) == 4);
 CTASSERT(sizeof(unsigned int) == 4);
 CTASSERT(sizeof(float) == 4);

Modified: scummvm/trunk/engines/sword25/kernel/scummvmwindow.cpp
===================================================================
--- scummvm/trunk/engines/sword25/kernel/scummvmwindow.cpp	2010-10-12 23:25:54 UTC (rev 53307)
+++ scummvm/trunk/engines/sword25/kernel/scummvmwindow.cpp	2010-10-12 23:26:48 UTC (rev 53308)
@@ -247,7 +247,7 @@
 
     case WM_CHAR:
         {
-            unsigned char theChar = static_cast<unsigned char>(wParam & 0xff);
+            byte theChar = static_cast<byte>(wParam & 0xff);
 
             // Alle Zeichen, die keine Steuerzeichen sind, werden als Buchstaben dem Input-Service mitgeteilt.
             if (theChar >= 32)

Modified: scummvm/trunk/engines/sword25/script/luascript.cpp
===================================================================
--- scummvm/trunk/engines/sword25/script/luascript.cpp	2010-10-12 23:25:54 UTC (rev 53307)
+++ scummvm/trunk/engines/sword25/script/luascript.cpp	2010-10-12 23:26:48 UTC (rev 53308)
@@ -439,8 +439,8 @@
 
 namespace {
 int Chunkwriter(lua_State *L, const void *p, size_t sz, void *ud) {
-	Common::Array<unsigned char> & chunkData = *reinterpret_cast<Common::Array<unsigned char> * >(ud);
-	const unsigned char *buffer = reinterpret_cast<const unsigned char *>(p);
+	Common::Array<byte> & chunkData = *reinterpret_cast<Common::Array<byte> * >(ud);
+	const byte *buffer = reinterpret_cast<const byte *>(p);
 
 	while (sz--) chunkData.push_back(*buffer++) ;
 
@@ -461,7 +461,7 @@
 	lua_getglobal(m_State, "_G");
 
 	// Lua persists and stores the data in a Common::Array
-	Common::Array<unsigned char> chunkData;
+	Common::Array<byte> chunkData;
 	pluto_persist(m_State, Chunkwriter, &chunkData);
 
 	// Persistenzdaten in den Writer schreiben.
@@ -569,7 +569,7 @@
 	ClearGlobalTable(m_State, ClearExceptionsSecondPass);
 
 	// Persisted Lua data
-	Common::Array<unsigned char> chunkData;
+	Common::Array<byte> chunkData;
 	Reader.Read(chunkData);
 
 	// Chunk-Reader initialisation. It is used with pluto_unpersist to restore read data


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