diff options
| author | Travis Howell | 2006-12-11 22:48:57 +0000 | 
|---|---|---|
| committer | Travis Howell | 2006-12-11 22:48:57 +0000 | 
| commit | 42228fdc361b7c68d6326c2a89131b3bda966a90 (patch) | |
| tree | 97b9697bad334427cfee935acec3c0acd361526b | |
| parent | a4b835838d583cddc7e6682a3a3329a73a546668 (diff) | |
| download | scummvm-rg350-42228fdc361b7c68d6326c2a89131b3bda966a90.tar.gz scummvm-rg350-42228fdc361b7c68d6326c2a89131b3bda966a90.tar.bz2 scummvm-rg350-42228fdc361b7c68d6326c2a89131b3bda966a90.zip | |
Add cyx's patch for endian issues in DXA player
svn-id: r24844
| -rw-r--r-- | graphics/dxa_player.cpp | 17 | 
1 files changed, 9 insertions, 8 deletions
| diff --git a/graphics/dxa_player.cpp b/graphics/dxa_player.cpp index 59828340d9..d4e216d27d 100644 --- a/graphics/dxa_player.cpp +++ b/graphics/dxa_player.cpp @@ -292,9 +292,10 @@ void DXAPlayer::decode13(uint8 *data, int size, int totalSize) {  	int codeSize = _width * _curHeight / 16;  	int dataSize, motSize, maskSize; -	memcpy(&dataSize, data, 4); -	memcpy(&motSize, &data[4], 4); -	memcpy(&maskSize, &data[8], 4); + +	dataSize = READ_BE_UINT32(&data[0]); +	motSize  = READ_BE_UINT32(&data[4]); +	maskSize = READ_BE_UINT32(&data[8]);  	codeBuf = &data[12];  	dataBuf = &codeBuf[codeSize]; @@ -311,7 +312,7 @@ void DXAPlayer::decode13(uint8 *data, int size, int totalSize) {  				break;  			case 1: { -				uint16 diffMap = *(unsigned short*)maskBuf; +				uint16 diffMap = READ_BE_UINT16(maskBuf);  				maskBuf += 2;  				for (int yc = 0; yc < BLOCKH; yc++) { @@ -427,11 +428,11 @@ void DXAPlayer::decode13(uint8 *data, int size, int totalSize) {  				int count = type - 30;  				uint8 pixels[4]; -				for (int i = 0; i < count; i++) -					pixels[i] = *dataBuf++; +				memcpy(pixels, dataBuf, count); +				dataBuf += count;  				if (count == 2) { -					uint16 code = *(uint16*)maskBuf; +					uint16 code = READ_BE_UINT16(maskBuf);  					maskBuf += 2;  					for (int yc = 0; yc < BLOCKH; yc++) {  						for (int xc = 0; xc < BLOCKW; xc++) { @@ -441,7 +442,7 @@ void DXAPlayer::decode13(uint8 *data, int size, int totalSize) {  						b2 += _width;  					}  				} else { -					uint32 code = *(uint32*)maskBuf; +					uint32 code = READ_BE_UINT32(maskBuf);  					maskBuf += 4;  					for (int yc = 0; yc < BLOCKH; yc++) {  						for (int xc = 0; xc < BLOCKW; xc++) { | 
