aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2013-10-30 08:30:55 +0100
committerStrangerke2013-10-30 08:31:14 +0100
commit3e6a1422e31f9ccdc6f6acd7def9e246d1b6f0e6 (patch)
tree235393f9ce4fdbfd847e0198860ffce746d9cc8d
parenta08af2952e57098feb64621cea805be2b9bf6a18 (diff)
downloadscummvm-rg350-3e6a1422e31f9ccdc6f6acd7def9e246d1b6f0e6.tar.gz
scummvm-rg350-3e6a1422e31f9ccdc6f6acd7def9e246d1b6f0e6.tar.bz2
scummvm-rg350-3e6a1422e31f9ccdc6f6acd7def9e246d1b6f0e6.zip
TOON: Fix CID 1002728, 1002729, 1003215, 1002731, 1002730
-rw-r--r--engines/toon/anim.cpp8
-rw-r--r--engines/toon/audio.cpp2
-rw-r--r--engines/toon/character.cpp1
3 files changed, 10 insertions, 1 deletions
diff --git a/engines/toon/anim.cpp b/engines/toon/anim.cpp
index 78d3954325..76b4154d61 100644
--- a/engines/toon/anim.cpp
+++ b/engines/toon/anim.cpp
@@ -41,7 +41,7 @@ bool Animation::loadAnimation(const Common::String &file) {
if (strncmp((char *)fileData, "KevinAguilar", 12))
return false;
- strcpy(_name, file.c_str());
+ strncpy(_name, file.c_str(), 32);
uint32 headerSize = READ_LE_UINT32(fileData + 16);
uint32 uncompressedBytes = READ_LE_UINT32(fileData + 20);
@@ -52,6 +52,7 @@ bool Animation::loadAnimation(const Common::String &file) {
_x2 = READ_LE_UINT32(fileData + 40);
_y2 = READ_LE_UINT32(fileData + 44);
_paletteEntries = READ_LE_UINT32(fileData + 56);
+ // CHECKME: Useless variable _fps
_fps = READ_LE_UINT32(fileData + 60);
uint32 paletteSize = READ_LE_UINT32(fileData + 64);
@@ -119,6 +120,10 @@ Animation::Animation(ToonEngine *vm) : _vm(vm) {
_palette = NULL;
_numFrames = 0;
_frames = NULL;
+
+ _x1 = _y1 = _x2 = _y2 = 0;
+ _fps = 0;
+ _paletteEntries = 0;
}
Animation::~Animation() {
@@ -448,6 +453,7 @@ AnimationInstance::AnimationInstance(ToonEngine *vm, AnimationInstanceType type)
_y = 0;
_z = 0;
_layerZ = 0;
+ _visible = false;
}
void AnimationInstance::render() {
diff --git a/engines/toon/audio.cpp b/engines/toon/audio.cpp
index bc0e051057..50b559ee00 100644
--- a/engines/toon/audio.cpp
+++ b/engines/toon/audio.cpp
@@ -255,6 +255,8 @@ AudioStreamInstance::AudioStreamInstance(AudioManager *man, Audio::Mixer *mixer,
} else {
stopNow();
}
+
+ _soundType = Audio::Mixer::kPlainSoundType;
}
AudioStreamInstance::~AudioStreamInstance() {
diff --git a/engines/toon/character.cpp b/engines/toon/character.cpp
index 83c9e3ec70..baab8888cf 100644
--- a/engines/toon/character.cpp
+++ b/engines/toon/character.cpp
@@ -65,6 +65,7 @@ Character::Character(ToonEngine *vm) : _vm(vm) {
_numPixelToWalk = 0;
_nextIdleTime = _vm->_system->getMillis() + (_vm->randRange(0, 600) + 300) * _vm->getTickLength();
_lineToSayId = 0;
+ _time = 0;
}
Character::~Character(void) {