diff options
author | Max Horn | 2002-11-06 14:19:50 +0000 |
---|---|---|
committer | Max Horn | 2002-11-06 14:19:50 +0000 |
commit | 39b60537c8119fe0e3b2cbb1599dac7d689256e5 (patch) | |
tree | ca8ca12f48bfe2d13b49b2a5102110d42934d0b4 /scumm | |
parent | 503fd9ca64a40e11524eb519e99c346fd4790f72 (diff) | |
download | scummvm-rg350-39b60537c8119fe0e3b2cbb1599dac7d689256e5.tar.gz scummvm-rg350-39b60537c8119fe0e3b2cbb1599dac7d689256e5.tar.bz2 scummvm-rg350-39b60537c8119fe0e3b2cbb1599dac7d689256e5.zip |
removed more typecasts
svn-id: r5438
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/dialogs.cpp | 5 | ||||
-rw-r--r-- | scumm/script_v2.cpp | 22 | ||||
-rw-r--r-- | scumm/scumm.h | 43 | ||||
-rw-r--r-- | scumm/string.cpp | 2 |
4 files changed, 38 insertions, 34 deletions
diff --git a/scumm/dialogs.cpp b/scumm/dialogs.cpp index 0562f46741..5be51a9e85 100644 --- a/scumm/dialogs.cpp +++ b/scumm/dialogs.cpp @@ -181,8 +181,9 @@ const ScummVM::String ScummDialog::queryResString(int stringno) 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 :) diff --git a/scumm/script_v2.cpp b/scumm/script_v2.cpp index 52a957f577..0a02f51a02 100644 --- a/scumm/script_v2.cpp +++ b/scumm/script_v2.cpp @@ -2547,8 +2547,8 @@ void Scumm::o6_talkActor() 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 @@ void Scumm::o6_talkActor() _mixer->stop(_sound->_talkChannel); _sound->_talkChannel = _sound->playBundleSound(pointer); - _messagePtr = (byte*)&transText; + _messagePtr = _transText; setStringVars(0); actorTalk(); } else { @@ -2580,7 +2580,7 @@ void Scumm::o6_talkEgo() 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 @@ void Scumm::o6_talkEgo() _mixer->stop(_sound->_talkChannel); _sound->_talkChannel = _sound->playBundleSound(pointer); - _messagePtr = (byte*)&transText; + _messagePtr = _transText; setStringVars(0); actorTalk(); } else { @@ -2851,11 +2851,11 @@ void Scumm::o6_miscOps() _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 @@ void Scumm::decodeParseString2(int m, int n) 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 @@ void Scumm::decodeParseString2(int m, int n) _mixer->stop(_sound->_talkChannel); _sound->_talkChannel = _sound->playBundleSound(pointer); - _messagePtr = (byte*)&transText; + _messagePtr = _transText; switch (m) { case 0: diff --git a/scumm/scumm.h b/scumm/scumm.h index 643633afed..08ee492878 100644 --- a/scumm/scumm.h +++ b/scumm/scumm.h @@ -778,17 +778,6 @@ public: 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 @@ public: 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 @@ public: 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 @@ public: 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(); diff --git a/scumm/string.cpp b/scumm/string.cpp index 22bdbb614e..bf18625355 100644 --- a/scumm/string.cpp +++ b/scumm/string.cpp @@ -1151,7 +1151,7 @@ void Scumm::loadLanguageBundle() { _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; |