[Scummvm-cvs-logs] CVS: scummvm/scumm dialogs.cpp,1.22,1.23 script_v2.cpp,1.47,1.48 scumm.h,1.54,1.55 string.cpp,1.42,1.43

Max Horn fingolfin at users.sourceforge.net
Wed Nov 6 06:20:08 CET 2002


Update of /cvsroot/scummvm/scummvm/scumm
In directory usw-pr-cvs1:/tmp/cvs-serv16409

Modified Files:
	dialogs.cpp script_v2.cpp scumm.h string.cpp 
Log Message:
removed more typecasts

Index: dialogs.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/dialogs.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- dialogs.cpp	5 Nov 2002 22:37:11 -0000	1.22
+++ dialogs.cpp	6 Nov 2002 14:19:50 -0000	1.23
@@ -181,8 +181,9 @@
 
 	result = (char *)_scumm->getStringAddress(string);
 	if (result && *result == '/') {
-		_scumm->translateText((char*)result, (char*)&_scumm->transText);
-		strcpy((char*)result, (char*)&_scumm->transText);
+		byte tmp[256];
+		_scumm->translateText((byte *)result, tmp);
+		strcpy(result, (char*)tmp);
 	}
 
 	if (!result) {								// Gracelessly degrade to english :)

Index: script_v2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v2.cpp,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -d -r1.47 -r1.48
--- script_v2.cpp	2 Nov 2002 12:39:42 -0000	1.47
+++ script_v2.cpp	6 Nov 2002 14:19:50 -0000	1.48
@@ -2547,8 +2547,8 @@
 		char pointer[20];
 		int i, j;
 
-		_scriptPointer += resStrLen((char*)_scriptPointer)+ 1;
-		translateText((char*)_messagePtr, (char*)&transText);
+		_scriptPointer += resStrLen((char*)_scriptPointer) + 1;
+		translateText(_messagePtr, _transText);
 		for (i = 0, j = 0; (_messagePtr[i] != '/' || j == 0) && j < 19; i++) {
 			if (_messagePtr[i] != '/')
 				pointer[j++] = _messagePtr[i];
@@ -2560,7 +2560,7 @@
 			_mixer->stop(_sound->_talkChannel);		
 
 		_sound->_talkChannel = _sound->playBundleSound(pointer);
-		_messagePtr = (byte*)&transText;
+		_messagePtr = _transText;
 		setStringVars(0);
 		actorTalk();
 	} else {
@@ -2580,7 +2580,7 @@
 		int i, j;
 
 		_scriptPointer += resStrLen((char*)_scriptPointer) + 1;
-		translateText((char*)_messagePtr, (char*)&transText);
+		translateText(_messagePtr, _transText);
 		for (i = 0, j = 0; (_messagePtr[i] != '/' || j == 0) && j < 19; i++) {
 			if (_messagePtr[i] != '/')
 				pointer[j++] = _messagePtr[i];
@@ -2592,7 +2592,7 @@
 			_mixer->stop(_sound->_talkChannel);
 
 		_sound->_talkChannel = _sound->playBundleSound(pointer);
-		_messagePtr = (byte*)&transText;
+		_messagePtr = _transText;
 		setStringVars(0);
 		actorTalk();
 	} else {
@@ -2851,11 +2851,11 @@
 				_msgPtrToAdd = buf;
 				setStringVars(0);
 				addMessageToStack(getStringAddressVar(VAR_STRING2DRAW));
-				if (strncmp("/SYSTEM.007/ /", (char*)&buf, 14) == 0) {
-					translateText((char*)&buf + 13, (char*)&charset._buffer);
+				if (strncmp("/SYSTEM.007/ /", (char *)buf, 14) == 0) {
+					translateText(buf + 13, charset._buffer);
 					//description();
-				}	else if (strncmp("/SYSTEM.007/ ", (char*)&buf, 13) == 0) {
-					strcpy((char*)&charset._buffer, (char*)&buf + 13);
+				}	else if (strncmp("/SYSTEM.007/ ", (char *)buf, 13) == 0) {
+					strcpy((char *)charset._buffer, (char *)buf + 13);
 					//description();
 				}
 			} else { 
@@ -3218,7 +3218,7 @@
 				int i, j;
 
 				_scriptPointer += resStrLen((char*)_scriptPointer)+ 1;
-				translateText((char*)_messagePtr, (char*)&transText);
+				translateText(_messagePtr, _transText);
 				for (i = 0, j = 0; (_messagePtr[i] != '/' || j == 0) && j < 19; i++) {
 				if (_messagePtr[i] != '/')
 					pointer[j++] = _messagePtr[i];
@@ -3230,7 +3230,7 @@
 					_mixer->stop(_sound->_talkChannel);
 
 				_sound->_talkChannel = _sound->playBundleSound(pointer);
-				_messagePtr = (byte*)&transText;
+				_messagePtr = _transText;
 
 				switch (m) {
 				case 0:

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -d -r1.54 -r1.55
--- scumm.h	6 Nov 2002 07:28:39 -0000	1.54
+++ scumm.h	6 Nov 2002 14:19:50 -0000	1.55
@@ -778,17 +778,6 @@
 	void drawRoomObjects(int arg);
 	void drawRoomObject(int i, int arg);
 	void drawBox(int x, int y, int x2, int y2, int color);
-	void drawBomp(BompDrawData * bd, int param1, byte *data_ptr, int decode_mode, int mask);
-	int32 setupBompScale(byte * scalling, int32 size, byte scale);
-	void bompScaleFuncX(byte * line_buffer, byte * scalling_x_ptr, byte skip, int32 size);
-	int32 bompDecodeLineMode0(byte * src, byte * line_buffer, int32 size);
-	int32 bompDecodeLineMode1(byte * src, byte * line_buffer, int32 size);
-	int32 bompDecodeLineMode3(byte * src, byte * line_buffer, int32 size);
-	void bompApplyMask(byte * line_buffer, byte * mask_out, byte bits, int32 size);
-	void bompApplyShadow0(byte * line_buffer, byte * dst, int32 size);
-	void bompApplyShadow1(byte * line_buffer, byte * dst, int32 size);
-	void bompApplyShadow3(byte * line_buffer, byte * dst, int32 size);
-	void bompApplyActorPalette(byte * line_buffer, int32 size);
 
 	void restoreBG(int left, int top, int right, int bottom);
 	void redrawBGStrip(int start, int num);	
@@ -860,7 +849,28 @@
 
 	void blit(byte *dst, byte *src, int w, int h);
 
+	// bomp
 	void decompressBomp(byte *dst, byte *src, int w, int h);
+	void drawBomp(BompDrawData * bd, int param1, byte *data_ptr, int decode_mode, int mask);
+	int32 setupBompScale(byte * scalling, int32 size, byte scale);
+	void bompScaleFuncX(byte * line_buffer, byte * scalling_x_ptr, byte skip, int32 size);
+	int32 bompDecodeLineMode0(byte * src, byte * line_buffer, int32 size);
+	int32 bompDecodeLineMode1(byte * src, byte * line_buffer, int32 size);
+	int32 bompDecodeLineMode3(byte * src, byte * line_buffer, int32 size);
+	void bompApplyMask(byte * line_buffer, byte * mask_out, byte bits, int32 size);
+	void bompApplyShadow0(byte * line_buffer, byte * dst, int32 size);
+	void bompApplyShadow1(byte * line_buffer, byte * dst, int32 size);
+	void bompApplyShadow3(byte * line_buffer, byte * dst, int32 size);
+	void bompApplyActorPalette(byte * line_buffer, int32 size);
+
+	uint16 _bompShadowMode;
+	int32 _bompScaleRight, _bompScaleBottom;
+	byte * _bompScallingXPtr, * _bompScallingYPtr;
+	byte * _bompMaskPtr;
+	int32 _bompMaskPitch;
+	byte * _bompActorPalletePtr;
+
+
 	uint _shakeFrame;
 	int _screenStartStrip, _screenEndStrip;
 	int _screenLeft, _screenTop;
@@ -875,13 +885,6 @@
 	void removeBlastObjects();
 	void removeBlastObject(BlastObject *eo);
 
-	uint16 _bompShadowMode;
-	int32 _bompScaleRight, _bompScaleBottom;
-	byte * _bompScallingXPtr, * _bompScallingYPtr;
-	byte * _bompMaskPtr;
-	int32 _bompMaskPitch;
-	byte * _bompActorPalletePtr;
-
 	int _drawObjectQueNr;
 	byte _drawObjectQue[200];
 	byte _palManipStart, _palManipEnd;
@@ -970,8 +973,8 @@
 	bool _existLanguageFile;
 	char *_languageBuffer;
 	void loadLanguageBundle();
-	void translateText(char * text, char * trans_buff);
-	char transText[200];
+	void translateText(byte *text, byte *trans_buff);
+	byte _transText[256];
 
 	bool checkFixedDisk();
 

Index: string.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/string.cpp,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -d -r1.42 -r1.43
--- string.cpp	6 Nov 2002 08:19:25 -0000	1.42
+++ string.cpp	6 Nov 2002 14:19:50 -0000	1.43
@@ -1151,7 +1151,7 @@
 	_existLanguageFile = true;
 }
 
-void Scumm::translateText(char * text, char * trans_buff) {
+void Scumm::translateText(byte *text, byte *trans_buff) {
 	if ((_existLanguageFile == true) && (text[0] == '/') && (text[1] != ' ')) {
 		char name[20], tmp[20], tmp2[20], num_s[20];
 		int32 num, l, j, k, r, pos;





More information about the Scummvm-git-logs mailing list