aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/gob/scenery.cpp6
-rw-r--r--graphics/video/coktelvideo/coktelvideo.cpp17
2 files changed, 11 insertions, 12 deletions
diff --git a/engines/gob/scenery.cpp b/engines/gob/scenery.cpp
index 568835dd37..a6d6c06544 100644
--- a/engines/gob/scenery.cpp
+++ b/engines/gob/scenery.cpp
@@ -95,7 +95,7 @@ void Scenery::init() {
int16 Scenery::loadStatic(char search) {
int16 size;
- int16 *backsPtr;
+ byte *backsPtr;
int16 picsCount;
int16 resId;
int16 sceneryIndex;
@@ -108,7 +108,7 @@ int16 Scenery::loadStatic(char search) {
_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 @@ int16 Scenery::loadStatic(char search) {
ptr->layers[i].planes = 0;
ptr->layers[i].backResId = (int16) READ_LE_UINT16(backsPtr);
- backsPtr++;
+ backsPtr += 2;
}
ptr->pieces = new PieceDesc*[picsCount];
diff --git a/graphics/video/coktelvideo/coktelvideo.cpp b/graphics/video/coktelvideo/coktelvideo.cpp
index 47c8e527d3..efcd77de44 100644
--- a/graphics/video/coktelvideo/coktelvideo.cpp
+++ b/graphics/video/coktelvideo/coktelvideo.cpp
@@ -1973,11 +1973,10 @@ byte *Vmd::deDPCM(const byte *data, uint32 &size, int32 init[2]) {
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 = (int16 *) sound;
+ int16 *out = new int16[outSize];
+ byte *sound = (byte *) out;
int channel = 0;
@@ -1999,7 +1998,7 @@ byte *Vmd::deDPCM(const byte *data, uint32 &size, int32 init[2]) {
channel = (channel + 1) % channels;
}
- size = outSize;
+ size = outSize * 2;
return sound;
}
@@ -2008,10 +2007,10 @@ byte *Vmd::deADPCM(const byte *data, uint32 &size, int32 init, int32 index) {
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 @@ byte *Vmd::deADPCM(const byte *data, uint32 &size, int32 init, int32 index) {
*out++ = TO_BE_16(init);
}
- size = outSize;
+ size = outSize * 2;
return sound;
}