[Scummvm-cvs-logs] SF.net SVN: scummvm:[53098] scummvm/trunk/engines/toon

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Sat Oct 9 13:11:26 CEST 2010


Revision: 53098
          http://scummvm.svn.sourceforge.net/scummvm/?rev=53098&view=rev
Author:   lordhoto
Date:     2010-10-09 11:11:26 +0000 (Sat, 09 Oct 2010)

Log Message:
-----------
TOON: Ran astyle over the toon engine (+ some manual corrections).

Modified Paths:
--------------
    scummvm/trunk/engines/toon/anim.cpp
    scummvm/trunk/engines/toon/anim.h
    scummvm/trunk/engines/toon/audio.cpp
    scummvm/trunk/engines/toon/character.cpp
    scummvm/trunk/engines/toon/conversation.cpp
    scummvm/trunk/engines/toon/conversation.h
    scummvm/trunk/engines/toon/detection.cpp
    scummvm/trunk/engines/toon/drew.cpp
    scummvm/trunk/engines/toon/flux.cpp
    scummvm/trunk/engines/toon/font.cpp
    scummvm/trunk/engines/toon/hotspot.cpp
    scummvm/trunk/engines/toon/path.cpp
    scummvm/trunk/engines/toon/path.h
    scummvm/trunk/engines/toon/picture.cpp
    scummvm/trunk/engines/toon/picture.h
    scummvm/trunk/engines/toon/resource.h
    scummvm/trunk/engines/toon/script.cpp
    scummvm/trunk/engines/toon/script.h
    scummvm/trunk/engines/toon/script_func.cpp
    scummvm/trunk/engines/toon/state.cpp
    scummvm/trunk/engines/toon/toon.cpp
    scummvm/trunk/engines/toon/toon.h

Modified: scummvm/trunk/engines/toon/anim.cpp
===================================================================
--- scummvm/trunk/engines/toon/anim.cpp	2010-10-09 10:41:01 UTC (rev 53097)
+++ scummvm/trunk/engines/toon/anim.cpp	2010-10-09 11:11:26 UTC (rev 53098)
@@ -680,8 +680,8 @@
 		changed = false;
 		for (uint32 i = 0; i < _instances.size() - 1; i++) {
 			if ((_instances[i]->getLayerZ() > _instances[i + 1]->getLayerZ()) ||
-			    ((_instances[i]->getLayerZ() == _instances[i + 1]->getLayerZ()) && 
-			     (_instances[i]->getId() < _instances[i+1]->getId()))) {
+			    ((_instances[i]->getLayerZ() == _instances[i + 1]->getLayerZ()) &&
+			    (_instances[i]->getId() < _instances[i+1]->getId()))) {
 				AnimationInstance *instance = _instances[i];
 				_instances[i] = _instances[i + 1];
 				_instances[i + 1] = instance;

Modified: scummvm/trunk/engines/toon/anim.h
===================================================================
--- scummvm/trunk/engines/toon/anim.h	2010-10-09 10:41:01 UTC (rev 53097)
+++ scummvm/trunk/engines/toon/anim.h	2010-10-09 11:11:26 UTC (rev 53098)
@@ -176,8 +176,8 @@
 	int32 _id;
 	bool _active;
 
-	void load(ToonEngine* vm,Common::ReadStream *stream);
-	void save(ToonEngine* vm,Common::WriteStream *stream);
+	void load(ToonEngine *vm, Common::ReadStream *stream);
+	void save(ToonEngine *vm, Common::WriteStream *stream);
 };
 
 class SceneAnimationScript {

Modified: scummvm/trunk/engines/toon/audio.cpp
===================================================================
--- scummvm/trunk/engines/toon/audio.cpp	2010-10-09 10:41:01 UTC (rev 53097)
+++ scummvm/trunk/engines/toon/audio.cpp	2010-10-09 11:11:26 UTC (rev 53098)
@@ -332,7 +332,7 @@
 	_lastADPCMval2 = v19;
 }
 
-void AudioStreamInstance::play(bool fade, Audio::Mixer::SoundType soundType ) {
+void AudioStreamInstance::play(bool fade, Audio::Mixer::SoundType soundType) {
 	debugC(1, kDebugAudio, "play(%d)", (fade) ? 1 : 0);
 
 	Audio::SoundHandle soundHandle;

Modified: scummvm/trunk/engines/toon/character.cpp
===================================================================
--- scummvm/trunk/engines/toon/character.cpp	2010-10-09 10:41:01 UTC (rev 53097)
+++ scummvm/trunk/engines/toon/character.cpp	2010-10-09 11:11:26 UTC (rev 53098)
@@ -55,7 +55,7 @@
 	_currentPathNodeCount = 0;
 	_currentPathNode = 0;
 	_visible = true;
-	_speed = 150;	// 150 = nominal drew speed
+	_speed = 150;   // 150 = nominal drew speed
 	_lastWalkTime = 0;
 	_numPixelToWalk = 0;
 	_nextIdleTime = _vm->getSystem()->getMillis() + (_vm->randRange(0, 600) + 300) * _vm->getTickLength();
@@ -75,7 +75,7 @@
 
 void Character::setPosition(int32 x, int32 y) {
 	debugC(5, kDebugCharacter, "setPosition(%d, %d)", x, y);
-	
+
 	_x = x;
 	_y = y;
 	if (_animationInstance)
@@ -86,7 +86,7 @@
 bool Character::walkTo(int32 newPosX, int32 newPosY) {
 	debugC(1, kDebugCharacter, "walkTo(%d, %d)", newPosX, newPosY);
 
-	if (!_visible) 
+	if (!_visible)
 		return true;
 
 	if (_x == newPosX && _y == newPosY)
@@ -95,13 +95,13 @@
 	_vm->getPathFinding()->resetBlockingRects();
 
 	if (_id == 1) {
-		int32 sizeX = MAX(5,40 * _vm->getDrew()->getScale() / 1024);
-		int32 sizeY = MAX(2,20 * _vm->getDrew()->getScale() / 1024);
-		_vm->getPathFinding()->addBlockingEllipse(_vm->getDrew()->getFinalX(),_vm->getDrew()->getFinalY(),sizeX,sizeY );
+		int32 sizeX = MAX(5, 40 * _vm->getDrew()->getScale() / 1024);
+		int32 sizeY = MAX(2, 20 * _vm->getDrew()->getScale() / 1024);
+		_vm->getPathFinding()->addBlockingEllipse(_vm->getDrew()->getFinalX(), _vm->getDrew()->getFinalY(), sizeX, sizeY);
 	}
 
 	_vm->getPathFinding()->findClosestWalkingPoint(newPosX, newPosY, &_finalX, &_finalY, _x, _y);
-	if (_x == _finalX && _y == _finalY) 
+	if (_x == _finalX && _y == _finalY)
 		return true;
 
 
@@ -131,19 +131,19 @@
 					setFacing(getFacingFromDirection(dx, dy));
 					playWalkAnim(0, 0);
 				}
-				
+
 				// in 1/1000 pixels
 				_numPixelToWalk += _speed * (_vm->getSystem()->getMillis() - _lastWalkTime) * _scale / 1024;
 				_lastWalkTime =  _vm->getSystem()->getMillis();
 
-				while(_numPixelToWalk >= 1000  && _currentPathNode < _currentPathNodeCount) {
+				while (_numPixelToWalk >= 1000 && _currentPathNode < _currentPathNodeCount) {
 					_x = _currentPathX[_currentPathNode];
 					_y = _currentPathY[_currentPathNode];
 					_currentPathNode += 1;
 					_numPixelToWalk -= 1000;
 				}
 				setPosition(_x, _y);
-			
+
 				_vm->doFrame();
 			}
 			playStandingAnim();
@@ -256,7 +256,7 @@
 	if (_animFlags & 0x40) {
 		playStandingAnim();
 	}
-	
+
 #if 0
 	_animationInstance->setFrame(0);
 	playStandingAnim();
@@ -279,7 +279,7 @@
 			_numPixelToWalk += _speed * (_vm->getSystem()->getMillis() - _lastWalkTime) * _scale / 1024;
 			_lastWalkTime =  _vm->getSystem()->getMillis();
 
-			while(_numPixelToWalk > 1000 && _currentPathNode < _currentPathNodeCount) {
+			while (_numPixelToWalk > 1000 && _currentPathNode < _currentPathNodeCount) {
 				_x = _currentPathX[_currentPathNode];
 				_y = _currentPathY[_currentPathNode];
 				_currentPathNode += 1;
@@ -357,7 +357,7 @@
 	}
 
 	if ((_animFlags & 3) == 2) {
-		if (_vm->getCurrentLineToSay() != _lineToSayId || !_vm->getAudioManager()->voiceStillPlaying() ) // || (_flags & 8)) && _vm->getAudioManager()->voiceStillPlaying() )
+		if (_vm->getCurrentLineToSay() != _lineToSayId || !_vm->getAudioManager()->voiceStillPlaying())  // || (_flags & 8)) && _vm->getAudioManager()->voiceStillPlaying())
 			_animFlags |= 1;
 
 // Strangerke - Commented (not used)
@@ -564,12 +564,12 @@
 	_finalY = stream->readSint32LE();
 	_scale = stream->readSint32LE();
 	_id = stream->readSint32LE();
-	
+
 	_animScriptId = stream->readSint32LE();
 	_animFlags = stream->readSint32LE();
 	_animSpecialDefaultId = stream->readSint32LE();
 	_sceneAnimationId = stream->readSint32LE();
-	
+
 	if (_sceneAnimationId > -1) {
 		setAnimationInstance(_vm->getSceneAnimation(_sceneAnimationId)->_animInstance);
 	}
@@ -986,7 +986,7 @@
 	return _sceneAnimationId;
 }
 
-void Character::setDefaultSpecialAnimationId( int32 defaultAnimationId ) {
+void Character::setDefaultSpecialAnimationId(int32 defaultAnimationId) {
 	_animSpecialDefaultId = defaultAnimationId;
 }
 
@@ -1003,16 +1003,16 @@
 
 	// only flux and drew
 	if (_id > 1)
-		return; 
+		return;
 
 	if (_vm->state()->_mouseHidden)
-		_nextIdleTime = _vm->getOldMilli() + (300 + _vm->randRange(0,600)) * _vm->getTickLength();
+		_nextIdleTime = _vm->getOldMilli() + (300 + _vm->randRange(0, 600)) * _vm->getTickLength();
 
 	if (_vm->getOldMilli() > _nextIdleTime) {
-		if ( ((_flags & 1) == 0) || ((_flags & 2) != 0) ) {
+		if (((_flags & 1) == 0) || ((_flags & 2) != 0)) {
 			if (!_vm->state()->_inCloseUp && !_vm->state()->_inCutaway && _animSpecialId == -1) {
 				if (!_vm->state()->_mouseHidden) {
-					_nextIdleTime = _vm->getOldMilli() + (300 + _vm->randRange(0,600)) * _vm->getTickLength();
+					_nextIdleTime = _vm->getOldMilli() + (300 + _vm->randRange(0, 600)) * _vm->getTickLength();
 					playAnim(getRandomIdleAnim(), 0, 0x40);
 					_flags |= 0x4;
 				}

Modified: scummvm/trunk/engines/toon/conversation.cpp
===================================================================
--- scummvm/trunk/engines/toon/conversation.cpp	2010-10-09 10:41:01 UTC (rev 53097)
+++ scummvm/trunk/engines/toon/conversation.cpp	2010-10-09 11:11:26 UTC (rev 53098)
@@ -27,16 +27,16 @@
 
 namespace Toon {
 
-void Conversation::save(Common::WriteStream *stream, int16* conversationDataBase) {
+void Conversation::save(Common::WriteStream *stream, int16 *conversationDataBase) {
 	stream->writeSint32BE(_enable);
 	for (int32 i = 0; i < 10; i++) {
 		stream->writeSint32BE(state[i]._data2);
 		stream->writeSint16BE(state[i]._data3);
-		stream->writeSint32BE((int16*)state[i]._data4 - conversationDataBase);
+		stream->writeSint32BE((int16 *)state[i]._data4 - conversationDataBase);
 	}
 }
 
-void Conversation::load(Common::ReadStream *stream, int16* conversationDataBase) {
+void Conversation::load(Common::ReadStream *stream, int16 *conversationDataBase) {
 	_enable = stream->readSint32BE();
 	for (int32 i = 0; i < 10; i++) {
 		state[i]._data2 = stream->readSint32BE();

Modified: scummvm/trunk/engines/toon/conversation.h
===================================================================
--- scummvm/trunk/engines/toon/conversation.h	2010-10-09 10:41:01 UTC (rev 53097)
+++ scummvm/trunk/engines/toon/conversation.h	2010-10-09 11:11:26 UTC (rev 53098)
@@ -41,8 +41,8 @@
 		void *_data4; // 10
 	} state[10];
 
-	void save(Common::WriteStream *stream, int16* conversationDataBase);
-	void load(Common::ReadStream *stream, int16* conversationDataBase);
+	void save(Common::WriteStream *stream, int16 *conversationDataBase);
+	void load(Common::ReadStream *stream, int16 *conversationDataBase);
 };
 
 } // End of namespace Toon

Modified: scummvm/trunk/engines/toon/detection.cpp
===================================================================
--- scummvm/trunk/engines/toon/detection.cpp	2010-10-09 10:41:01 UTC (rev 53097)
+++ scummvm/trunk/engines/toon/detection.cpp	2010-10-09 11:11:26 UTC (rev 53098)
@@ -41,39 +41,54 @@
 using Common::GUIO_NONE;
 
 static const ADGameDescription gameDescriptions[] = {
-	{ "toon", "", {
-		{"local.pak", 0, "3290209ef9bc92692108dd2f45df0736", 3237611},
-		{"arcaddbl.svl", 0, "c418478cd2833c7c983799f948af41ac", 7844688},
-		{"study.svl", 0, "281efa3f33f6712c0f641a605f4d40fd", 2511090},
-		AD_LISTEND},
+	{
+		"toon", "",
+		{
+			{"local.pak", 0, "3290209ef9bc92692108dd2f45df0736", 3237611},
+			{"arcaddbl.svl", 0, "c418478cd2833c7c983799f948af41ac", 7844688},
+			{"study.svl", 0, "281efa3f33f6712c0f641a605f4d40fd", 2511090},
+			AD_LISTEND
+		},
 		Common::EN_ANY, Common::kPlatformPC, ADGF_NO_FLAGS, GUIO_NONE
 	},
-	{ "toon", "", {
-		{"local.pak", 0, "517132c3575b38806d1e7b6f59848072", 3224044},
-		{"arcaddbl.svl", 0, "ff74008827b62fbef1f46f104c438e44", 9699256},
-		{"study.svl", 0, "df056b94ea83f1ed92a539cf636053ab", 2542668},
-		AD_LISTEND},
+	{
+		"toon", "",
+		{
+			{"local.pak", 0, "517132c3575b38806d1e7b6f59848072", 3224044},
+			{"arcaddbl.svl", 0, "ff74008827b62fbef1f46f104c438e44", 9699256},
+			{"study.svl", 0, "df056b94ea83f1ed92a539cf636053ab", 2542668},
+			AD_LISTEND
+		},
 		Common::FR_FRA, Common::kPlatformPC, ADGF_NO_FLAGS, GUIO_NONE
 	},
-	{ "toon", "", {
-		{"local.pak", 0, "bf5da4c03f78ffbd643f12122319366e", 3250841},
-		{"arcaddbl.svl", 0, "7a0d74f4d66d1c722b946abbeb0834ef", 9122249},
-		{"study.svl", 0, "72fe96a9e10967d3138e918295babc42", 2910283},
-		AD_LISTEND},
+	{
+		"toon", "",
+		{
+			{"local.pak", 0, "bf5da4c03f78ffbd643f12122319366e", 3250841},
+			{"arcaddbl.svl", 0, "7a0d74f4d66d1c722b946abbeb0834ef", 9122249},
+			{"study.svl", 0, "72fe96a9e10967d3138e918295babc42", 2910283},
+			AD_LISTEND
+		},
 		Common::DE_DEU, Common::kPlatformPC, ADGF_NO_FLAGS, GUIO_NONE
 	},
-	{ "toon", "", {
-		{"local.pak", 0, "e8645168a247e2abdbfc2f9fa9d1c0fa", 3232222},
-		{"arcaddbl.svl", 0, "7893ac4cc78d51356baa058bbee7aa28", 8275016},
-		{"study.svl", 0, "b6b1ee2d9d94d53d305856039ab7bde7", 2634620},
-		AD_LISTEND},
+	{
+		"toon", "",
+		{
+			{"local.pak", 0, "e8645168a247e2abdbfc2f9fa9d1c0fa", 3232222},
+			{"arcaddbl.svl", 0, "7893ac4cc78d51356baa058bbee7aa28", 8275016},
+			{"study.svl", 0, "b6b1ee2d9d94d53d305856039ab7bde7", 2634620},
+			AD_LISTEND
+		},
 		Common::ES_ESP, Common::kPlatformPC, ADGF_NO_FLAGS, GUIO_NONE
 	},
-	{ "toon", "", {
-		{"local.pak", 0, "bf5da4c03f78ffbd643f12122319366e", 3250841},
-		{"wacexdbl.emc", 0, "cfbc2156a31b294b038204888407ebc8", 6974},
-		{"generic.svl", 0, "5eb99850ada22f0b8cf6392262d4dd07", 9404599},
-		AD_LISTEND},
+	{
+		"toon", "",
+		{
+			{"local.pak", 0, "bf5da4c03f78ffbd643f12122319366e", 3250841},
+			{"wacexdbl.emc", 0, "cfbc2156a31b294b038204888407ebc8", 6974},
+			{"generic.svl", 0, "5eb99850ada22f0b8cf6392262d4dd07", 9404599},
+			AD_LISTEND
+		},
 		Common::DE_DEU, Common::kPlatformPC, ADGF_DEMO, GUIO_NONE
 	},
 
@@ -135,12 +150,12 @@
 
 bool ToonMetaEngine::hasFeature(MetaEngineFeature f) const {
 	return
-		(f == kSupportsListSaves) ||
-//		(f == kSupportsLoadingDuringStartup) ||
-		(f == kSupportsDeleteSave) ||
-		(f == kSavesSupportMetaInfo) ||
-		(f == kSavesSupportThumbnail) ||
-		(f == kSavesSupportCreationDate);
+	    (f == kSupportsListSaves) ||
+//	    (f == kSupportsLoadingDuringStartup) ||
+	    (f == kSupportsDeleteSave) ||
+	    (f == kSavesSupportMetaInfo) ||
+	    (f == kSavesSupportThumbnail) ||
+	    (f == kSavesSupportCreationDate);
 }
 
 int ToonMetaEngine::getMaximumSaveSlot() const { return 99; }
@@ -152,7 +167,7 @@
 	pattern += ".???";
 
 	filenames = saveFileMan->listSavefiles(pattern);
-	sort(filenames.begin(), filenames.end());	// Sort (hopefully ensuring we are sorted numerically..)
+	sort(filenames.begin(), filenames.end());   // Sort (hopefully ensuring we are sorted numerically..)
 
 	SaveStateList saveList;
 	int slotNum = 0;

Modified: scummvm/trunk/engines/toon/drew.cpp
===================================================================
--- scummvm/trunk/engines/toon/drew.cpp	2010-10-09 10:41:01 UTC (rev 53097)
+++ scummvm/trunk/engines/toon/drew.cpp	2010-10-09 11:11:26 UTC (rev 53098)
@@ -22,7 +22,7 @@
  * $Id$
  *
  */
- 
+
 #include "toon/drew.h"
 
 namespace Toon {

Modified: scummvm/trunk/engines/toon/flux.cpp
===================================================================
--- scummvm/trunk/engines/toon/flux.cpp	2010-10-09 10:41:01 UTC (rev 53097)
+++ scummvm/trunk/engines/toon/flux.cpp	2010-10-09 11:11:26 UTC (rev 53098)
@@ -52,8 +52,7 @@
 void CharacterFlux::setVisible(bool visible) {
 	if (_vm->state()->_currentChapter == 2) {
 		Character::setVisible(false);
-	}
-	else {
+	} else {
 		Character::setVisible(visible);
 	}
 }

Modified: scummvm/trunk/engines/toon/font.cpp
===================================================================
--- scummvm/trunk/engines/toon/font.cpp	2010-10-09 10:41:01 UTC (rev 53097)
+++ scummvm/trunk/engines/toon/font.cpp	2010-10-09 11:11:26 UTC (rev 53098)
@@ -132,7 +132,7 @@
 	debugC(5, kDebugFont, "setFontColorByCharacter(%d)", characterId);
 
 	// unfortunately this table was hardcoded in the original executable
-	static const byte colorsByCharacters[] = { 
+	static const byte colorsByCharacters[] = {
 		0xe0, 0xdc, 0xc8,   0xd6, 0xc1, 0xc8,   0xe9, 0xde, 0xc8,   0xeb, 0xe8, 0xc8,
 		0xd1, 0xcf, 0xc8,   0xd8, 0xd5, 0xc8,   0xfb, 0xfa, 0xc8,   0xd9, 0xd7, 0xc8,
 		0xe8, 0xe4, 0xc8,   0xe9, 0xfa, 0xc8,   0xeb, 0xe4, 0xc8,   0xeb, 0xe4, 0xc8,
@@ -247,7 +247,7 @@
 	// adapt x
 	if (x - 30 - maxWidth / 2 < 0)
 		x = maxWidth / 2 + 30;
-	
+
 	if (x + 30 + (maxWidth / 2) > 640)
 		x = 640 - (maxWidth / 2) - 30;
 

Modified: scummvm/trunk/engines/toon/hotspot.cpp
===================================================================
--- scummvm/trunk/engines/toon/hotspot.cpp	2010-10-09 10:41:01 UTC (rev 53097)
+++ scummvm/trunk/engines/toon/hotspot.cpp	2010-10-09 11:11:26 UTC (rev 53098)
@@ -42,7 +42,7 @@
 
 	for (int32 i = 0; i < _numItems; i++) {
 		for (int32 a = 0; a < 256; a++)
-			_items[i].setData(a,Stream->readSint16BE());
+			_items[i].setData(a, Stream->readSint16BE());
 	}
 }
 
@@ -104,7 +104,7 @@
 
 	uint32 size = 0;
 	uint8 *rifData = _vm->resources()->getFileData(rifName, &size);
-	if (!rifData) 
+	if (!rifData)
 		return false;
 
 	uint32 size2 = 0;
@@ -121,7 +121,7 @@
 
 	_numItems = (rifsize + rifsize2) / 512;
 
-	if (_items) 
+	if (_items)
 		delete[] _items;
 
 	_items = new HotspotData[_numItems];

Modified: scummvm/trunk/engines/toon/path.cpp
===================================================================
--- scummvm/trunk/engines/toon/path.cpp	2010-10-09 10:41:01 UTC (rev 53097)
+++ scummvm/trunk/engines/toon/path.cpp	2010-10-09 11:11:26 UTC (rev 53098)
@@ -144,8 +144,7 @@
 		if (_blockingRects[i][4] == 0) {
 			if (x >= _blockingRects[i][0] && x <= _blockingRects[i][2] && y >= _blockingRects[i][1] && y < _blockingRects[i][3])
 				return false;
-		} 
-		else {
+		} else {
 			int32 dx = abs(_blockingRects[i][0] - x);
 			int32 dy = abs(_blockingRects[i][1] - y);
 			if ((dx << 8) / _blockingRects[i][2] < (1 << 8) && (dy << 8) / _blockingRects[i][3] < (1 << 8)) {
@@ -200,7 +199,7 @@
 		_gridPathCount = 0;
 		return true;
 	}
-	
+
 	memset(_gridTemp , 0, _width * _height * sizeof(int32));
 	_heap->clear();
 	int32 curX = x;

Modified: scummvm/trunk/engines/toon/path.h
===================================================================
--- scummvm/trunk/engines/toon/path.h	2010-10-09 10:41:01 UTC (rev 53097)
+++ scummvm/trunk/engines/toon/path.h	2010-10-09 11:11:26 UTC (rev 53098)
@@ -63,7 +63,7 @@
 
 	void resetBlockingRects();
 	void addBlockingRect(int32 x1, int32 y1, int32 x2, int32 y2);
-	void addBlockingEllipse(int32 x1, int32 y1, int32 w, int32 h); 
+	void addBlockingEllipse(int32 x1, int32 y1, int32 w, int32 h);
 
 	int32 getPathNodeCount() const;
 	int32 getPathNodeX(int32 nodeId) const;

Modified: scummvm/trunk/engines/toon/picture.cpp
===================================================================
--- scummvm/trunk/engines/toon/picture.cpp	2010-10-09 10:41:01 UTC (rev 53097)
+++ scummvm/trunk/engines/toon/picture.cpp	2010-10-09 11:11:26 UTC (rev 53098)
@@ -220,7 +220,7 @@
 }
 
 // use original work from johndoe
-void Picture::floodFillNotWalkableOnMask( int32 x, int32 y ) {
+void Picture::floodFillNotWalkableOnMask(int32 x, int32 y) {
 	debugC(1, kDebugPicture, "floodFillNotWalkableOnMask(%d, %d)", x, y);
 
 	// Stack-based floodFill algorithm based on
@@ -254,7 +254,7 @@
 	}
 }
 
-void Picture::drawLineOnMask( int32 x, int32 y, int32 x2, int32 y2, bool walkable ) {
+void Picture::drawLineOnMask(int32 x, int32 y, int32 x2, int32 y2, bool walkable) {
 	debugC(1, kDebugPicture, "drawLineOnMask(%d, %d, %d, %d, %d)", x, y, x2, y2, (walkable) ? 1 : 0);
 
 	static int32 lastX = 0;
@@ -291,7 +291,7 @@
 			_data[_width * (by >> 16) + (bx >> 16)] = v;
 			_data[_width * (by >> 16) + (bx >> 16)+1] = v;
 		}
-	
+
 		bx += cdx;
 		by += cdy;
 		i--;

Modified: scummvm/trunk/engines/toon/picture.h
===================================================================
--- scummvm/trunk/engines/toon/picture.h	2010-10-09 10:41:01 UTC (rev 53097)
+++ scummvm/trunk/engines/toon/picture.h	2010-10-09 11:11:26 UTC (rev 53098)
@@ -45,7 +45,7 @@
 	void draw(Graphics::Surface &surface, int32 x, int32 y, int32 dx, int32 dy);
 	void drawMask(Graphics::Surface &surface, int32 x, int32 y, int32 dx, int32 dy);
 	void drawLineOnMask(int32 x, int32 y, int32 x2, int32 y2, bool walkable);
-	void floodFillNotWalkableOnMask( int32 x, int32 y );
+	void floodFillNotWalkableOnMask(int32 x, int32 y);
 	uint8 getData(int32 x, int32 y);
 	uint8 *getDataPtr() { return _data; }
 	int32 getWidth() const { return _width; }

Modified: scummvm/trunk/engines/toon/resource.h
===================================================================
--- scummvm/trunk/engines/toon/resource.h	2010-10-09 10:41:01 UTC (rev 53097)
+++ scummvm/trunk/engines/toon/resource.h	2010-10-09 11:11:26 UTC (rev 53098)
@@ -42,7 +42,7 @@
 	uint8 *getFileData(Common::String fileName, uint32 *fileSize);
 	Common::String getPackName() { return _packName; }
 	Common::SeekableReadStream *createReadStream(Common::String fileName);
-	void close(); 
+	void close();
 
 protected:
 	struct File {
@@ -68,7 +68,7 @@
 public:
 	Resources(ToonEngine *vm);
 	void openPackage(Common::String file, bool preloadEntirePackage);
-	void closePackage(Common::String fileName); 
+	void closePackage(Common::String fileName);
 	Common::SeekableReadStream *openFile(Common::String file);
 	uint8 *getFileData(Common::String fileName, uint32 *fileSize);
 

Modified: scummvm/trunk/engines/toon/script.cpp
===================================================================
--- scummvm/trunk/engines/toon/script.cpp	2010-10-09 10:41:01 UTC (rev 53097)
+++ scummvm/trunk/engines/toon/script.cpp	2010-10-09 11:11:26 UTC (rev 53098)
@@ -214,8 +214,8 @@
 		error("Unknown script opcode: %d in file '%s' at offset 0x%.08X", opcode, script->dataPtr->filename, instOffset);
 	} else {
 		static bool EMCDebug = false;
-		if (EMCDebug )
-			debugC(5, 0, "[0x%.08X] EMCInterpreter::%s([%d/%u])", instOffset*2, _opcodes[opcode].desc, _parameter, (uint)_parameter);
+		if (EMCDebug)
+			debugC(5, 0, "[0x%.08X] EMCInterpreter::%s([%d/%u])", instOffset * 2, _opcodes[opcode].desc, _parameter, (uint)_parameter);
 		//debug(0, "[0x%.08X] EMCInterpreter::%s([%d/%u])", instOffset, _opcodes[opcode].desc, _parameter, (uint)_parameter);
 
 		(this->*(_opcodes[opcode].proc))(script);
@@ -457,16 +457,15 @@
 	}
 }
 
-void EMCInterpreter::saveState(EMCState* script, Common::WriteStream * stream) {
+void EMCInterpreter::saveState(EMCState *script, Common::WriteStream *stream) {
 	stream->writeSint16LE(script->bp);
 	stream->writeSint16LE(script->sp);
 	if (!script->ip) {
 		stream->writeSint16LE(-1);
-	}
-	else {
+	} else {
 		stream->writeSint16LE(script->ip - script->dataPtr->data);
 	}
-	
+
 	for (int32 i = 0; i < EMCState::kStackSize; i++) {
 		stream->writeSint16LE(script->stack[i]);
 	}
@@ -478,18 +477,17 @@
 	stream->writeSint16LE(script->retValue);
 	stream->writeByte(script->running);
 }
-void EMCInterpreter::loadState(EMCState* script, Common::ReadStream* stream) {
+void EMCInterpreter::loadState(EMCState *script, Common::ReadStream *stream) {
 	script->bp = stream->readSint16LE();
 	script->sp = stream->readSint16LE();
 
 	int16 scriptIp = stream->readSint16LE();
-	if(scriptIp == -1) {
+	if (scriptIp == -1) {
 		script->ip = 0;
-	}
-	else {
+	} else {
 		script->ip = scriptIp + script->dataPtr->data;
 	}
-	
+
 	for (int32 i = 0; i < EMCState::kStackSize; i++) {
 		script->stack[i] = stream->readSint16LE();
 	}

Modified: scummvm/trunk/engines/toon/script.h
===================================================================
--- scummvm/trunk/engines/toon/script.h	2010-10-09 10:41:01 UTC (rev 53097)
+++ scummvm/trunk/engines/toon/script.h	2010-10-09 11:11:26 UTC (rev 53098)
@@ -104,8 +104,8 @@
 	void init(EMCState *scriptState, const EMCData *data);
 	bool start(EMCState *script, int function);
 
-	void saveState(EMCState* script, Common::WriteStream * stream);
-	void loadState(EMCState* script, Common::ReadStream* stream);
+	void saveState(EMCState *script, Common::WriteStream *stream);
+	void loadState(EMCState *script, Common::ReadStream *stream);
 
 	bool isValid(EMCState *script);
 

Modified: scummvm/trunk/engines/toon/script_func.cpp
===================================================================
--- scummvm/trunk/engines/toon/script_func.cpp	2010-10-09 10:41:01 UTC (rev 53097)
+++ scummvm/trunk/engines/toon/script_func.cpp	2010-10-09 11:11:26 UTC (rev 53098)
@@ -388,7 +388,7 @@
 }
 
 int32 ScriptFunc::sys_Cmd_Make_Line_Non_Walkable(EMCState *state) {
-	_vm->makeLineNonWalkable(stackPos(0),stackPos(1),stackPos(2),stackPos(3));
+	_vm->makeLineNonWalkable(stackPos(0), stackPos(1), stackPos(2), stackPos(3));
 
 	// we have to store some info for savegame
 	_vm->getSaveBufferStream()->writeSint16BE(2); // 2 = sys_Cmd_Make_Line_Non_Walkable
@@ -400,7 +400,7 @@
 }
 
 int32 ScriptFunc::sys_Cmd_Make_Line_Walkable(EMCState *state) {
-	_vm->makeLineWalkable(stackPos(0),stackPos(1),stackPos(2),stackPos(3));
+	_vm->makeLineWalkable(stackPos(0), stackPos(1), stackPos(2), stackPos(3));
 
 	// we have to store some info for savegame
 	_vm->getSaveBufferStream()->writeSint16BE(3); // 3 = sys_Cmd_Make_Line_Walkable
@@ -784,7 +784,7 @@
 }
 
 int32 ScriptFunc::sys_Cmd_Fade_Palette(EMCState *state) {
-	debugC(0,0xfff, "fadePalette %d %d", stackPos(0),stackPos(1));
+	debugC(0, 0xfff, "fadePalette %d %d", stackPos(0), stackPos(1));
 	return 0;
 }
 
@@ -829,8 +829,8 @@
 		// we have to store some info for savegame
 		_vm->getSaveBufferStream()->writeSint16BE(1); // 1 = Draw_Scene_Anim_WSA_Frame_To_Back
 		_vm->getSaveBufferStream()->writeSint16BE(frame);
-		_vm->getSaveBufferStream()->writeSint16BE(strlen(sceneAnim->_animInstance->getAnimation()->_name)+1);
-		_vm->getSaveBufferStream()->write(sceneAnim->_animInstance->getAnimation()->_name, strlen(sceneAnim->_animInstance->getAnimation()->_name)+1);
+		_vm->getSaveBufferStream()->writeSint16BE(strlen(sceneAnim->_animInstance->getAnimation()->_name) + 1);
+		_vm->getSaveBufferStream()->write(sceneAnim->_animInstance->getAnimation()->_name, strlen(sceneAnim->_animInstance->getAnimation()->_name) + 1);
 		_vm->getSaveBufferStream()->writeSint16BE(sceneAnim->_animInstance->getX());
 		_vm->getSaveBufferStream()->writeSint16BE(sceneAnim->_animInstance->getY());
 		_vm->getSaveBufferStream()->writeSint16BE(sceneAnim->_animInstance->getZ());
@@ -905,7 +905,6 @@
 
 	_vm->getAnimationManager()->addInstance(sceneAnim->_animInstance);
 
-
 	debugC(0, 0xfff, "Init Anim %s %d %d %d %d %d %d %d %d %d %d %d %d %d\n", GetText(12, state), stackPos(0), stackPos(1), stackPos(2), stackPos(3),
 	       stackPos(4), stackPos(5), stackPos(6), stackPos(7), stackPos(8), stackPos(9), stackPos(10), stackPos(11),  stackPos(12));
 
@@ -979,7 +978,7 @@
 		else if (animId == 20 || animId == 15 || animId == 21 || animId == 16 || animId == 17 || animId == 18)
 			_vm->pauseSceneAnimationScript(_vm->getCurrentUpdatingSceneAnimation(), 1);
 	}
-	
+
 	if (_vm->state()->_currentScene == 29) {
 		if (animId == 16 || animId == 26 || animId == 36)
 			_vm->pauseSceneAnimationScript(_vm->getCurrentUpdatingSceneAnimation(), 2);
@@ -1004,7 +1003,7 @@
 int32 ScriptFunc::sys_Cmd_Set_Location_Data(EMCState *state) {
 	// initial setup of locations
 	int32 locationId = stackPos(0);
-	debugC(0,0, "setlocationdata(%d) %s %x %s %s %d %d", locationId, GetText(1,state), stackPos(2), GetText(3,state), GetText(4,state), stackPos(5),stackPos(6));
+	debugC(0, 0, "setlocationdata(%d) %s %x %s %s %d %d", locationId, GetText(1, state), stackPos(2), GetText(3, state), GetText(4, state), stackPos(5), stackPos(6));
 	strcpy(_vm->state()->_locations[locationId]._name, GetText(1, state));
 	strcpy(_vm->state()->_locations[locationId]._music, GetText(3, state));
 	strcpy(_vm->state()->_locations[locationId]._cutaway, GetText(4, state));
@@ -1092,7 +1091,7 @@
 }
 
 int32 ScriptFunc::sys_Cmd_Knight_Puzzle_Get_Coord(EMCState *state) {
-	static uint16 knightCoords[] = { 
+	static const uint16 knightCoords[] = {
 		0x327, 0x0fa, 0x354, 0x0f8, 0x383, 0x0f4, 0x3a4, 0x0f0, 0x3d3, 0x0ed,
 		0x3fd, 0x0ef, 0x2fe, 0x12d, 0x2fe, 0x12d, 0x310, 0x109, 0x349, 0x103,
 		0x378, 0x103, 0x3a4, 0x102, 0x3d5, 0x102, 0x403, 0x103, 0x2fe, 0x12d,

Modified: scummvm/trunk/engines/toon/state.cpp
===================================================================
--- scummvm/trunk/engines/toon/state.cpp	2010-10-09 10:41:01 UTC (rev 53097)
+++ scummvm/trunk/engines/toon/state.cpp	2010-10-09 11:11:26 UTC (rev 53098)
@@ -29,26 +29,26 @@
 namespace Toon {
 
 void Location::save(Common::WriteStream *stream) {
-	stream->write(_cutaway,64);
-	stream->write(_music,64);
-	stream->write(_name,64);
+	stream->write(_cutaway, 64);
+	stream->write(_music, 64);
+	stream->write(_name, 64);
 	stream->writeSint16BE(_numRifBoxes);
 	stream->writeSint16BE(_numSceneAnimations);
 	stream->writeSByte(_visited);
 
-	for (int32 i = 0; i < _numRifBoxes*2; i++) {
+	for (int32 i = 0; i < _numRifBoxes * 2; i++) {
 		stream->writeSint16BE(_rifBoxesFlags[i]);
 	}
 }
 void Location::load(Common::ReadStream *stream) {
-	stream->read(_cutaway,64);
-	stream->read(_music,64);
-	stream->read(_name,64);
+	stream->read(_cutaway, 64);
+	stream->read(_music, 64);
+	stream->read(_name, 64);
 	_numRifBoxes = stream->readSint16BE();
 	_numSceneAnimations = stream->readSint16BE();
 	_visited = stream->readSByte();
 
-	for (int32 i = 0; i < _numRifBoxes*2; i++) {
+	for (int32 i = 0; i < _numRifBoxes * 2; i++) {
 		_rifBoxesFlags[i] = stream->readSint16BE();
 	}
 }
@@ -135,7 +135,7 @@
 	return false;
 }
 
-void State::save(Common::WriteStream * stream) {
+void State::save(Common::WriteStream *stream) {
 
 	for (int32 i = 0; i < 256; i++) {
 		_locations[i].save(stream);
@@ -191,7 +191,7 @@
 	stream->writeSint32BE(_timerDelay[1]);
 }
 
-void State::load(Common::ReadStream* stream) {
+void State::load(Common::ReadStream *stream) {
 	for (int32 i = 0; i < 256; i++) {
 		_locations[i].load(stream);
 	}

Modified: scummvm/trunk/engines/toon/toon.cpp
===================================================================
--- scummvm/trunk/engines/toon/toon.cpp	2010-10-09 10:41:01 UTC (rev 53097)
+++ scummvm/trunk/engines/toon/toon.cpp	2010-10-09 11:11:26 UTC (rev 53098)
@@ -89,7 +89,7 @@
 	_saveBufferStream = new Common::MemoryWriteStreamDynamic();
 
 	_firstFrame = false;
-	
+
 	const Common::FSNode gameDataDir(ConfMan.get("path"));
 	SearchMan.addSubDirectoryMatching(gameDataDir, "misc");
 
@@ -182,11 +182,10 @@
 					if (saveGame(slotNum)) {
 						// ok
 						char buf[256];
-						snprintf(buf, 256, "Saved game in slot #%d ",slotNum);
+						snprintf(buf, 256, "Saved game in slot #%d ", slotNum);
 						GUI::TimedMessageDialog dialog(buf, 1000);
 						dialog.runModal();
-					}
-					else {
+					} else {
 						char buf[256];
 						snprintf(buf, 256, "Could not quick save into slot #%d", slotNum);
 						GUI::MessageDialog dialog2(buf, "OK", 0);
@@ -206,8 +205,7 @@
 						snprintf(buf, 256, "Savegame #%d quick loaded", slotNum);
 						GUI::TimedMessageDialog dialog(buf, 1000);
 						dialog.runModal();
-					}
-					else {
+					} else {
 						char buf[256];
 						snprintf(buf, 256, "Could not quick load the savegame #%d", slotNum);
 						GUI::MessageDialog dialog(buf, "OK", 0);
@@ -257,7 +255,7 @@
 		if (_gameState->_timerEnabled[i]) {
 			if (_gameState->_timerDelay[i] > -1 && getOldMilli() > _gameState->_timerTimeout[i]) {
 				if (i == 0) {
-					
+
 					EMCState *status = &_scriptState[_currentScriptRegion];
 					_script->init(status, &_scriptData);
 
@@ -275,7 +273,7 @@
 					_currentScriptRegion--;
 
 					_gameState->_timerTimeout[i] = getOldMilli() + _gameState->_timerDelay[i] * getTickLength();
-	
+
 					return;
 
 				}
@@ -291,7 +289,7 @@
 			if (_drew->getFacing() <= 4)
 				lastScrollOffset = 200;
 			else
-				lastScrollOffset = 440;	
+				lastScrollOffset = 440;
 		}
 
 		if (_gameState->_inCutaway || _gameState->_inInventory || _gameState->_inCloseUp)
@@ -302,7 +300,7 @@
 		if ((_gameState->_locations[_gameState->_currentScene]._flags & 0x80) == 0) {
 			if (desiredScrollValue < 0)
 				desiredScrollValue = 0;
-			if (desiredScrollValue >= _currentPicture->getWidth() - 640) 
+			if (desiredScrollValue >= _currentPicture->getWidth() - 640)
 				desiredScrollValue = _currentPicture->getWidth() - 640;
 
 			if (force) {
@@ -327,14 +325,14 @@
 
 void ToonEngine::update(int32 timeIncrement) {
 	// to make sure we're updating the game at 5fps at least
-	if (timeIncrement > 200) 
+	if (timeIncrement > 200)
 		timeIncrement = 200;
 
 	updateAnimationSceneScripts(timeIncrement);
 	updateCharacters(timeIncrement);
 	updateTimer(timeIncrement);
 	updateTimers();
-	updateScrolling(false,timeIncrement);
+	updateScrolling(false, timeIncrement);
 	_animationManager->update(timeIncrement);
 	_cursorAnimationInstance->update(timeIncrement);
 
@@ -346,7 +344,7 @@
 
 void ToonEngine::updateTimer(int32 timeIncrement) {
 	if (_gameState->_gameTimer > 0) {
-		debugC(0, 0xfff,"updateTimer(%d)", timeIncrement);
+		debugC(0, 0xfff, "updateTimer(%d)", timeIncrement);
 		_gameState->_gameTimer -= timeIncrement;
 		if (_gameState->_gameTimer < 0)
 			_gameState->_gameTimer = 0;
@@ -371,10 +369,10 @@
 #if 0
 	char test[256];
 	if (_mouseX > 0 && _mouseX < 640 && _mouseY > 0 && _mouseY < 400) {
-		sprintf(test, "%d %d / mask %d layer %d z %d", _mouseX, _mouseY, getMask()->getData(_mouseX,_mouseY), getLayerAtPoint(_mouseX,_mouseY), getZAtPoint(_mouseX,_mouseY));
+		sprintf(test, "%d %d / mask %d layer %d z %d", _mouseX, _mouseY, getMask()->getData(_mouseX, _mouseY), getLayerAtPoint(_mouseX, _mouseY), getZAtPoint(_mouseX, _mouseY));
 
-		int32 c = *(uint8*)_mainSurface->getBasePtr(_mouseX,_mouseY);
-		sprintf(test, "%d %d / color id %d %d,%d,%d", _mouseX, _mouseY, c, _finalPalette[c*3+0],_finalPalette[c*3+1],_finalPalette[c*3+2]);
+		int32 c = *(uint8 *)_mainSurface->getBasePtr(_mouseX, _mouseY);
+		sprintf(test, "%d %d / color id %d %d,%d,%d", _mouseX, _mouseY, c, _finalPalette[c*3+0], _finalPalette[c*3+1], _finalPalette[c*3+2]);
 
 		_fontRenderer->setFont(_fontToon);
 		_fontRenderer->renderText(40, 150, Common::String(test), 0);
@@ -397,7 +395,7 @@
 		_cursorAnimationInstance->render();
 	}
 	_system->copyRectToScreen((byte *)_mainSurface->pixels + state()->_currentScrollValue, 1280, 0, 0, 640, 400);
-	if (updateScreen) 
+	if (updateScreen)
 		_system->updateScreen();
 }
 
@@ -411,7 +409,7 @@
 		int32 currentTimer = _system->getMillis();
 // Strangerke - Commented (not used)
 //		int32 elapsedTime = currentTimer - _oldTimer;
-	
+
 		update(currentTimer - _oldTimer);
 		_oldTimer = currentTimer;
 		_oldTimer2 = currentTimer;
@@ -470,7 +468,7 @@
 	int activeFrame;
 };
 
-bool ToonEngine::showMainmenu(bool& loadedGame) {
+bool ToonEngine::showMainmenu(bool &loadedGame) {
 	Picture *mainmenuPicture = new Picture(this);
 	mainmenuPicture->loadPicture("TITLESCR.CPS", true);
 	mainmenuPicture->setupPalette();
@@ -529,7 +527,7 @@
 					entries[entryNr].animation->drawFrame(*_mainSurface, frameNr, 0, 0);
 				}
 			}
-			
+
 			parseInput();
 			copyToVirtualScreen(true);
 			_system->delayMillis(17);
@@ -576,8 +574,8 @@
 			musicPlaying = false;
 		}
 
-	
 
+
 		switch (clickingOn) {
 		case MAINMENUHOTSPOT_START:
 			// Start game (actually exit main menu)
@@ -624,7 +622,7 @@
 
 	// show mainmenu
 	bool loadedGame = false;
-	if(!showMainmenu(loadedGame)) {
+	if (!showMainmenu(loadedGame)) {
 		return Common::kNoError;
 	}
 
@@ -683,10 +681,10 @@
 		_gameVariant = 3;
 		break;
 	default:
-	// 0 - english
+		// 0 - english
 		_gameVariant = 0;
 		break;
-	}	
+	}
 }
 
 ToonEngine::~ToonEngine() {
@@ -756,14 +754,14 @@
 
 	do {
 		if (_sceneAnimationScripts[_lastProcessedSceneScript]._lastTimer <= _system->getMillis() &&
-		    !_sceneAnimationScripts[_lastProcessedSceneScript]._frozen) {
+		        !_sceneAnimationScripts[_lastProcessedSceneScript]._frozen) {
 			_animationSceneScriptRunFlag = true;
 
 			while (_animationSceneScriptRunFlag && _sceneAnimationScripts[_lastProcessedSceneScript]._lastTimer <= _system->getMillis() && !shouldQuit()) {
 				if (!_script->run(&_sceneAnimationScripts[_lastProcessedSceneScript]._state))
 					_animationSceneScriptRunFlag = false;
 
-				if (_sceneAnimationScripts[_lastProcessedSceneScript]._frozen) 
+				if (_sceneAnimationScripts[_lastProcessedSceneScript]._frozen)
 					break;
 			}
 
@@ -813,7 +811,7 @@
 		do {
 			_gameState->_currentChapter++;
 			flag >>= 1;
-		} while((flag & 1) == 0);
+		} while ((flag & 1) == 0);
 	}
 
 	for (int32 i = 0; i < 8; i++) {
@@ -823,7 +821,7 @@
 	_drew->setVisible(true);
 
 	// hide flux in chapter 2
-	if ( _gameState->_currentChapter == 1) {
+	if (_gameState->_currentChapter == 1) {
 		_flux->playStandingAnim();
 		_flux->setVisible(true);
 	} else {
@@ -841,8 +839,8 @@
 	_gameState->_currentScrollValue = 0;
 	_gameState->_currentScrollLock = false;
 	_gameState->_inCloseUp = false;
-	
 
+
 	if (_gameState->_mouseState >= 0)
 		addItemToInventory(_gameState->_mouseState);
 
@@ -976,7 +974,7 @@
 
 
 	if (!forGameLoad) {
-	
+
 		_script->start(&_scriptState[0], 0);
 
 		while (_script->run(&_scriptState[0]))
@@ -1084,10 +1082,10 @@
 
 void ToonEngine::setCursor(int32 type, bool inventory, int32 offsetX, int32 offsetY) {
 
-	static int32 offsets[] = {
-		0,   1,  1,  6,  7,  1,  8,   10, 18,  10, 
-		28,  8,  36, 10, 46, 10, 56,  10, 66,  10, 
-		76,  10, 86, 10, 96, 10, 106, 10, 116, 10, 
+	static const int32 offsets[] = {
+		0,   1,  1,  6,  7,  1,  8,   10, 18,  10,
+		28,  8,  36, 10, 46, 10, 56,  10, 66,  10,
+		76,  10, 86, 10, 96, 10, 106, 10, 116, 10,
 		126, 10
 	};
 
@@ -1245,8 +1243,7 @@
 					// walk was canceled ?
 					return;
 				}
-			}
-			else {
+			} else {
 				if (!_drew->walkTo(_mouseX, _mouseY)) {
 					// walk was canceled ?
 					return;
@@ -1275,7 +1272,7 @@
 		break;
 	case 6:
 		createMouseItem(argument);
-		currentHot->setData(7,-1);
+		currentHot->setData(7, -1);
 		break;
 	case 7:
 		// switch to CloseUp
@@ -1313,7 +1310,7 @@
 		int32 val = _scriptState[_currentScriptRegion].regs[4];
 		currentHot->setData(4, currentHot->getData(4) & val);
 	}
- 
+
 }
 
 void ToonEngine::selectHotspot() {
@@ -1447,14 +1444,13 @@
 				delete _characters[i];
 				_characters[i] = 0;
 			}
-		} 
-		else {
+		} else {
 			_characters[i]->stopSpecialAnim();
 		}
 	}
 
 	for (int32 i = 0; i < 2; i++) {
-		_gameState->_timerEnabled[i] = false; 
+		_gameState->_timerEnabled[i] = false;
 	}
 
 	// put back our item if inventory if needed
@@ -1641,7 +1637,7 @@
 		if (currentLine < 1000)
 			currentLine = _roomTexts->getNext(currentLine);
 		else
-			currentLine = _genericTexts->getNext(currentLine-1000) + 1000;
+			currentLine = _genericTexts->getNext(currentLine - 1000) + 1000;
 	}
 
 #if 0
@@ -1664,7 +1660,7 @@
 		myLine = _genericTexts->getText(dialogid - 1000);
 		myId = dialogid - 1000;
 	}
-	debugC(0, 0xfff, "Talker = %d will say '%s' \n", READ_LE_UINT16(c-2), myLine);
+	debugC(0, 0xfff, "Talker = %d will say '%s' \n", READ_LE_UINT16(c - 2), myLine);
 #endif
 
 	if (_audioManager->voiceStillPlaying())
@@ -1689,17 +1685,17 @@
 			if (talker) {
 				// character talks
 			}
-		} else 
+		} else
 #endif
 		if (characterId == 0) {
 			_drew->playAnim(animID, 0, (talker ? 8 : 0) + 2);
 		} else if (characterId == 1) {
 			// stop flux if he is walking
-			if(_flux->getFlag() & 1) {
+			if (_flux->getFlag() & 1) {
 				_flux->stopWalk();
 			}
 			_flux->playAnim(animID, 0, (talker ? 8 : 0) + 2);
-			_flux->setFlag( _flux->getFlag() | 1 );
+			_flux->setFlag(_flux->getFlag() | 1);
 		} else {
 			Character *character = getCharacterById(characterId);
 			if (character) {
@@ -1714,7 +1710,7 @@
 }
 
 int32 ToonEngine::characterTalk(int32 dialogid, bool blocking) {
-	if(blocking == false && _audioManager->voiceStillPlaying()) {
+	if (blocking == false && _audioManager->voiceStillPlaying()) {
 		// someone is already talking, and this voice is not important
 		// skip it
 		return 0;
@@ -1890,7 +1886,7 @@
 				a++;
 			}
 		}
-		if(shouldQuit()) return;
+		if (shouldQuit()) return;
 		_gameState->_showConversationIcons = false;
 		_gameState->_mouseHidden = 1;
 
@@ -2226,12 +2222,12 @@
 		break;
 		//
 	case 105:
-		if ( getConversationFlag( _gameState->_currentScene, v4)) {
-			result = *(int16*)(*command + 4);
+		if (getConversationFlag(_gameState->_currentScene, v4)) {
+			result = *(int16 *)(*command + 4);
 			*command = (int16 *)((char *)_conversationData + result);
 			*command = (int16 *)((char *)_conversationData + result - 4);
 		} else {
-			int16* newPtr = *command + 1;
+			int16 *newPtr = *command + 1;
 			*command = newPtr;
 		}
 		break;
@@ -2324,9 +2320,9 @@
 			for (int32 i = 0; i < _gameState->_numInventoryItems; i++) {
 				int32 x = 57 * (i % 7) + 114;
 				int32 y = ((9 * (i % 7)) & 0xf) + 56 * (i / 7) + 80;
-				if (_mouseX >= (_gameState->_currentScrollValue + x - 6) && 
-				    _mouseX <= (_gameState->_currentScrollValue + x + 44 + 7) && 
-				    _mouseY >= y - 6 && _mouseY <= y + 50) {
+				if (_mouseX >= (_gameState->_currentScrollValue + x - 6) &&
+				        _mouseX <= (_gameState->_currentScrollValue + x + 44 + 7) &&
+				        _mouseY >= y - 6 && _mouseY <= y + 50) {
 					foundObj = i;
 					break;
 				}
@@ -2380,7 +2376,7 @@
 		}
 
 		renderInventory();
-		
+
 	}
 
 	_gameState->_currentScrollValue = oldScrollValue;
@@ -2390,8 +2386,7 @@
 	if (_gameState->_inCloseUp) {
 		_gameState->_inCloseUp = false;
 		flipScreens();
-	}
-	else if (_gameState->_inCutaway) {
+	} else if (_gameState->_inCutaway) {
 		_currentCutaway->setupPalette();
 		setupGeneralPalette();
 	} else {
@@ -2515,7 +2510,7 @@
 }
 
 void ToonEngine::newGame() {
-	
+
 	if (_isDemo) {
 		addItemToInventory(59);
 		addItemToInventory(67);
@@ -2637,8 +2632,7 @@
 		savegameId = dialog->runModal(plugin, ConfMan.getActiveDomainName());
 		savegameDescription = dialog->getResultString();
 		delete dialog;
-	} 
-	else {
+	} else {
 		savegameId = slot;
 		savegameDescription = Common::String::printf("Quick save #%d", slot);
 	}
@@ -2654,13 +2648,13 @@
 
 	// save savegame header
 	saveFile->writeSint32BE(TOON_SAVEGAME_VERSION);
-	
+
 	if (savegameDescription == "") {
 		savegameDescription = "Untitled savegame";
 	}
 
-	saveFile->writeSint16BE(savegameDescription.size()+1);
-	saveFile->write(savegameDescription.c_str(), savegameDescription.size()+1);
+	saveFile->writeSint16BE(savegameDescription.size() + 1);
+	saveFile->write(savegameDescription.c_str(), savegameDescription.size() + 1);
 
 	Graphics::saveThumbnail(*saveFile);
 
@@ -2673,7 +2667,7 @@
 	saveFile->writeUint32BE(saveDate);
 	saveFile->writeUint16BE(saveTime);
 
-	
+
 	// save global state
 	_gameState->save(saveFile);
 	_gameState->saveConversations(saveFile);
@@ -2712,8 +2706,8 @@
 	// save "command buffer"
 	saveFile->writeSint16BE(_saveBufferStream->pos());
 	if (_saveBufferStream->pos() > 0) {
-	saveFile->write(_saveBufferStream->getData(), _saveBufferStream->pos());
-	saveFile->writeSint16BE(0);
+		saveFile->write(_saveBufferStream->getData(), _saveBufferStream->pos());
+		saveFile->writeSint16BE(0);
 	}
 
 	delete saveFile;
@@ -2731,8 +2725,7 @@
 		dialog->setSaveMode(false);
 		savegameId = dialog->runModal(plugin, ConfMan.getActiveDomainName());
 		delete dialog;
-	}
-	else {
+	} else {
 		savegameId = slot;
 	}
 	if (savegameId < 0)
@@ -2800,13 +2793,13 @@
 			// we have to fix up our pointers...
 			for (int32 a = 0; a < 10; a++) {
 				if (_gameState->_conversationState[i].state[a]._data4)
-					_gameState->_conversationState[i].state[a]._data4 = (int16*)_gameState->_conversationState[i].state[a]._data4 + diff;
+					_gameState->_conversationState[i].state[a]._data4 = (int16 *)_gameState->_conversationState[i].state[a]._data4 + diff;
 			}
 		}
 	}
 	*/
 
-	_gameState->_conversationData = _conversationData; 
+	_gameState->_conversationData = _conversationData;
 	_firstFrame = true;
 
 	// read characters info
@@ -2817,7 +2810,7 @@
 
 		if (!_characters[c]) {
 			_characters[c] = new Character(this);
-		}	
+		}
 		_characters[c]->load(loadFile);
 		//_characters[c]->setVisible(true);
 		_characters[c]->update(0);
@@ -2826,60 +2819,60 @@
 	// load "command buffer"
 	int32 size = loadFile->readSint16BE();
 	if (size) {
-		uint8* buf = new uint8[size+2];
-		loadFile->read(buf, size+2);
+		uint8 *buf = new uint8[size+2];
+		loadFile->read(buf, size + 2);
 
-		Common::MemoryReadStream rStr(buf, size+2);
+		Common::MemoryReadStream rStr(buf, size + 2);
 		while (1) {
 			int16 command = rStr.readSint16BE();
 			if (!command) break;
 			switch (command) {
-				case 1: {
-						int16 frame = rStr.readSint16BE();
-						int16 animLen = rStr.readSint16BE();
-						char animName[32];
-						rStr.read(animName,animLen);
-						int16 x = rStr.readSint16BE();
-						int16 y = rStr.readSint16BE();
-//						int16 z = rStr.readSint16BE();
-//						int16 layerZ = rStr.readSint16BE();
-						rStr.readSint16BE();
-						rStr.readSint16BE();
+			case 1: {
+				int16 frame = rStr.readSint16BE();
+				int16 animLen = rStr.readSint16BE();
+				char animName[32];
+				rStr.read(animName, animLen);
+				int16 x = rStr.readSint16BE();
+				int16 y = rStr.readSint16BE();
+//				int16 z = rStr.readSint16BE();
+//				int16 layerZ = rStr.readSint16BE();
+				rStr.readSint16BE();
+				rStr.readSint16BE();
 
-						Animation* anim = new Animation(this);
-						anim->loadAnimation(animName);
-						anim->drawFrameOnPicture(frame,x,y);
-						delete anim;
-						break;
-					}
-				case 2: {
-						int16 x =  rStr.readSint16BE();
-						int16 y = rStr.readSint16BE();
-						int16 x1 = rStr.readSint16BE();
-						int16 y1 = rStr.readSint16BE();
-						makeLineNonWalkable(x,y,x1,y1);
-						break;
-					}
-				case 3: {
-						int16 x =  rStr.readSint16BE();
-						int16 y = rStr.readSint16BE();
-						int16 x1 = rStr.readSint16BE();
-						int16 y1 = rStr.readSint16BE();
-						makeLineWalkable(x,y,x1,y1);
-						break;
-					}
-				case 4: {
-						int16 x = rStr.readSint16BE();
-						int16 y = rStr.readSint16BE();
-						getMask()->floodFillNotWalkableOnMask(x,y);
-						break;
-					}
-				default:
-					break;
+				Animation *anim = new Animation(this);
+				anim->loadAnimation(animName);
+				anim->drawFrameOnPicture(frame, x, y);
+				delete anim;
+				break;
 			}
+			case 2: {
+				int16 x =  rStr.readSint16BE();
+				int16 y = rStr.readSint16BE();
+				int16 x1 = rStr.readSint16BE();
+				int16 y1 = rStr.readSint16BE();
+				makeLineNonWalkable(x, y, x1, y1);
+				break;
+			}
+			case 3: {
+				int16 x =  rStr.readSint16BE();
+				int16 y = rStr.readSint16BE();
+				int16 x1 = rStr.readSint16BE();
+				int16 y1 = rStr.readSint16BE();
+				makeLineWalkable(x, y, x1, y1);
+				break;
+			}
+			case 4: {
+				int16 x = rStr.readSint16BE();
+				int16 y = rStr.readSint16BE();
+				getMask()->floodFillNotWalkableOnMask(x, y);
+				break;
+			}
+			default:
+				break;
+			}
 		}
 
-		_saveBufferStream->write(buf,size);
+		_saveBufferStream->write(buf, size);
 		delete loadFile;
 	}
 	return true;
@@ -2934,7 +2927,7 @@
 
 // Strangerke - Commented (not used)
 //	if (_characters[characterIndex])
-		//delete current char
+//		delete current char
 
 	_characters[characterIndex] = new Character(this);
 	_characters[characterIndex]->setId(characterId);
@@ -2984,7 +2977,7 @@
 	storePalette();
 	fadeOut(5);
 
-	Picture* pic = new Picture(this);
+	Picture *pic = new Picture(this);
 	pic->loadPicture(str, false);
 	pic->setupPalette();
 	flushPalette();
@@ -3024,14 +3017,14 @@
 			_firstFrame = false;
 			fadeIn(5);
 		}
-		
+
 		copyToVirtualScreen();
 	}
 
 	fadeOut(5);
 	restorePalette();
 	_firstFrame = true;
-	_gameState->_currentScrollValue= oldScrollValue;
+	_gameState->_currentScrollValue = oldScrollValue;
 	delete pic;
 
 }
@@ -4204,40 +4197,38 @@
 	return res;
 }
 
-void ToonEngine::makeLineNonWalkable( int32 x, int32 y, int32 x2, int32 y2 ) {
-	_currentMask->drawLineOnMask(x,y,x2,y2,false);
+void ToonEngine::makeLineNonWalkable(int32 x, int32 y, int32 x2, int32 y2) {
+	_currentMask->drawLineOnMask(x, y, x2, y2, false);
 }
 
-void ToonEngine::makeLineWalkable( int32 x, int32 y, int32 x2, int32 y2 ) {
-	_currentMask->drawLineOnMask(x,y,x2,y2,true);
+void ToonEngine::makeLineWalkable(int32 x, int32 y, int32 x2, int32 y2) {
+	_currentMask->drawLineOnMask(x, y, x2, y2, true);
 }
 
-void SceneAnimation::save(ToonEngine* vm, Common::WriteStream *stream) {
+void SceneAnimation::save(ToonEngine *vm, Common::WriteStream *stream) {
 	stream->writeByte(_active);
 	stream->writeSint32BE(_id);
 
-	if (!_active) 
+	if (!_active)
 		return;
 
 	if (_animInstance) {
 		stream->writeByte(1);
 		_animInstance->save(stream);
-	} 
-	else {
+	} else {
 		stream->writeByte(0);
 	}
 
 	if (!_animation) {
 		stream->writeByte(0);
-	} 
-	else {
-		stream->writeByte(strlen(_animation->_name)+1);
-		stream->write(_animation->_name, strlen(_animation->_name)+1);
+	} else {
+		stream->writeByte(strlen(_animation->_name) + 1);
+		stream->write(_animation->_name, strlen(_animation->_name) + 1);
 	}
 }
-void SceneAnimation::load(ToonEngine* vm,Common::ReadStream *stream) {
-	
-	_active = stream->readByte(); 
+void SceneAnimation::load(ToonEngine *vm, Common::ReadStream *stream) {
+
+	_active = stream->readByte();
 	_id = stream->readSint32BE();
 
 
@@ -4256,21 +4247,20 @@
 	int8 strSize = stream->readByte();
 	if (!strSize) {
 		_animation = 0;
-		if(_animInstance) 
+		if (_animInstance)
 			_animInstance->setAnimation(0);
-	} 
-	else {
+	} else {
 		stream->read(animationName, strSize);
 		animationName[strSize] = 0;
 
 		_animation = new Animation(vm);
 		_animation->loadAnimation(animationName);
 
-		if(_animInstance)
+		if (_animInstance)
 			_animInstance->setAnimation(_animation, false);
 
 		printf("load animation instance %d / %s / visible %d \n", _id, _animation->_name, _animInstance->getVisible());
 	}
-}	
+}
 
 } // End of namespace Toon

Modified: scummvm/trunk/engines/toon/toon.h
===================================================================
--- scummvm/trunk/engines/toon/toon.h	2010-10-09 10:41:01 UTC (rev 53097)
+++ scummvm/trunk/engines/toon/toon.h	2010-10-09 11:11:26 UTC (rev 53098)
@@ -53,7 +53,7 @@
 
 enum ToonDebugChannels {
 	kDebugAnim      = 1 <<  0,
-	kDebugCharacter = 1 <<  1,	
+	kDebugCharacter = 1 <<  1,
 	kDebugAudio     = 1 <<  2,
 	kDebugHotspot   = 1 <<  3,
 	kDebugFont      = 1 <<  4,
@@ -91,7 +91,7 @@
 	char **_specialInfoLine;
 
 	virtual Common::Error run();
-	virtual bool showMainmenu(bool& loadedGame);
+	virtual bool showMainmenu(bool &loadedGame);
 	virtual void init();
 	bool loadToonDat();
 	char **loadTextsVariante(Common::File &in);
@@ -367,7 +367,7 @@
 
 	AudioManager *_audioManager;
 
-	Common::MemoryWriteStreamDynamic* _saveBufferStream;
+	Common::MemoryWriteStreamDynamic *_saveBufferStream;
 
 	int16 *_conversationData;
 


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