[Scummvm-cvs-logs] scummvm master -> 3e6a1422e31f9ccdc6f6acd7def9e246d1b6f0e6

Strangerke Strangerke at scummvm.org
Wed Oct 30 08:32:09 CET 2013


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
3e6a1422e3 TOON: Fix CID 1002728, 1002729, 1003215, 1002731, 1002730


Commit: 3e6a1422e31f9ccdc6f6acd7def9e246d1b6f0e6
    https://github.com/scummvm/scummvm/commit/3e6a1422e31f9ccdc6f6acd7def9e246d1b6f0e6
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-30T00:31:14-07:00

Commit Message:
TOON: Fix CID 1002728, 1002729, 1003215, 1002731, 1002730

Changed paths:
    engines/toon/anim.cpp
    engines/toon/audio.cpp
    engines/toon/character.cpp



diff --git a/engines/toon/anim.cpp b/engines/toon/anim.cpp
index 78d3954..76b4154 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 bc0e0510..50b559e 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 83c9e3e..baab888 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) {






More information about the Scummvm-git-logs mailing list