[Scummvm-cvs-logs] SF.net SVN: scummvm:[42857] scummvm/trunk

drmccoy at users.sourceforge.net drmccoy at users.sourceforge.net
Tue Jul 28 17:19:56 CEST 2009


Revision: 42857
          http://scummvm.svn.sourceforge.net/scummvm/?rev=42857&view=rev
Author:   drmccoy
Date:     2009-07-28 15:19:55 +0000 (Tue, 28 Jul 2009)

Log Message:
-----------
Changing stuff around a bit so alignment requirements won't increase

Modified Paths:
--------------
    scummvm/trunk/engines/gob/scenery.cpp
    scummvm/trunk/graphics/video/coktelvideo/coktelvideo.cpp

Modified: scummvm/trunk/engines/gob/scenery.cpp
===================================================================
--- scummvm/trunk/engines/gob/scenery.cpp	2009-07-28 15:05:44 UTC (rev 42856)
+++ scummvm/trunk/engines/gob/scenery.cpp	2009-07-28 15:19:55 UTC (rev 42857)
@@ -95,7 +95,7 @@
 
 int16 Scenery::loadStatic(char search) {
 	int16 size;
-	int16 *backsPtr;
+	byte *backsPtr;
 	int16 picsCount;
 	int16 resId;
 	int16 sceneryIndex;
@@ -108,7 +108,7 @@
 	_vm->_game->_script->evalExpr(&sceneryIndex);
 
 	size      = _vm->_game->_script->readInt16();
-	backsPtr  = (int16 *) (_vm->_game->_script->getData() + _vm->_game->_script->pos());
+	backsPtr  = _vm->_game->_script->getData() + _vm->_game->_script->pos();
 	_vm->_game->_script->skip(size * 2);
 	picsCount = _vm->_game->_script->readInt16();
 	resId     = _vm->_game->_script->readInt16();
@@ -162,7 +162,7 @@
 			ptr->layers[i].planes = 0;
 
 		ptr->layers[i].backResId = (int16) READ_LE_UINT16(backsPtr);
-		backsPtr++;
+		backsPtr += 2;
 	}
 
 	ptr->pieces      = new PieceDesc*[picsCount];

Modified: scummvm/trunk/graphics/video/coktelvideo/coktelvideo.cpp
===================================================================
--- scummvm/trunk/graphics/video/coktelvideo/coktelvideo.cpp	2009-07-28 15:05:44 UTC (rev 42856)
+++ scummvm/trunk/graphics/video/coktelvideo/coktelvideo.cpp	2009-07-28 15:19:55 UTC (rev 42857)
@@ -1973,12 +1973,11 @@
 	int channels = (_soundStereo > 0) ? 2 : 1;
 
 	uint32 inSize  = size;
-	uint32 outSize = (size + channels) * 2;
+	uint32 outSize = size + channels;
 
-	byte *sound = new byte[outSize];
+	int16 *out   = new int16[outSize];
+	byte  *sound = (byte *) out;
 
-	int16 *out = (int16 *) sound;
-
 	int channel = 0;
 
 	for (int i = 0; i < channels; i++) {
@@ -1999,7 +1998,7 @@
 		channel = (channel + 1) % channels;
 	}
 
-	size = outSize;
+	size = outSize * 2;
 	return sound;
 }
 
@@ -2008,10 +2007,10 @@
 	if (!data || (size == 0))
 		return 0;
 
-	uint32 outSize = size * 4;
+	uint32 outSize = size * 2;
 
-	byte  *sound = new byte[outSize];
-	int16 *out   = (int16 *) sound;
+	int16 *out   = new int16[outSize];
+	byte  *sound = (byte *) out;
 
 	index = CLIP<int32>(index, 0, 88);
 
@@ -2056,7 +2055,7 @@
 		*out++ = TO_BE_16(init);
 	}
 
-	size = outSize;
+	size = outSize * 2;
 	return sound;
 }
 


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