[Scummvm-cvs-logs] SF.net SVN: scummvm:[39852] scummvm/trunk/engines/kyra

athrxx at users.sourceforge.net athrxx at users.sourceforge.net
Sat Apr 4 23:10:35 CEST 2009


Revision: 39852
          http://scummvm.svn.sourceforge.net/scummvm/?rev=39852&view=rev
Author:   athrxx
Date:     2009-04-04 21:10:35 +0000 (Sat, 04 Apr 2009)

Log Message:
-----------
LOL: implemented compass

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/gui_lol.cpp
    scummvm/trunk/engines/kyra/lol.cpp
    scummvm/trunk/engines/kyra/lol.h
    scummvm/trunk/engines/kyra/scene_lol.cpp
    scummvm/trunk/engines/kyra/script_lol.cpp

Modified: scummvm/trunk/engines/kyra/gui_lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/gui_lol.cpp	2009-04-04 17:57:00 UTC (rev 39851)
+++ scummvm/trunk/engines/kyra/gui_lol.cpp	2009-04-04 21:10:35 UTC (rev 39852)
@@ -133,7 +133,7 @@
 
 	int cp = _screen->setCurPage(2);
 	LoLCharacter *l = &_characters[charNum];
-	
+
 	int id = l->id;
 	if (id < 0)
 		id = -id;
@@ -274,7 +274,7 @@
 	} while (prc);
 }
 
-void LoLEngine::gui_drawCharInventoryItem(int itemIndex) {	
+void LoLEngine::gui_drawCharInventoryItem(int itemIndex) {
 	static const uint8 slotShapes[] = { 0x30, 0x34, 0x30, 0x34, 0x2E, 0x2F, 0x32, 0x33, 0x31, 0x35, 0x35 };
 
 	const uint8 *coords = &_charInvDefs[_charInvIndex[_characters[_selectedCharacter].raceClassSex] * 22 + itemIndex * 2];
@@ -307,7 +307,7 @@
 		cur = 0;
 
 	int32 e = MIN(cur, max);
-	
+
 	if (!--w)
 		return;
 	if (!--h)
@@ -803,7 +803,7 @@
 				break;
 		}
 	}
-	
+
 	removeInputTop();
 	_eventList.push_back(Event(evt, true));
 	_preserveEvents = true;
@@ -883,7 +883,7 @@
 		if (*s != 0xff)
 			gui_initButton(33 + i, s[0], s[1], i);
 		s += 2;
-	}	
+	}
 }
 
 void LoLEngine::gui_initMagicScrollButtons() {
@@ -1063,7 +1063,7 @@
 	int c = button->data2Val2;
 
 	gui_enableDefaultPlayfieldButtons();
-	
+
 	if (notEnoughMagic(c, _availableSpells[_selectedSpell], spellLevel)) {
 		_characters[c].flags &= 0xffef;
 		gui_drawCharPortraitWithStats(c);
@@ -1139,7 +1139,7 @@
 		int type = _itemProperties[_itemsInPlay[_itemInHand].itemPropertyIndex].type;
 		if (!(sl & type)) {
 			bool f = false;
-			
+
 			for (int i = 0; i < 11; i++) {
 				if (!(type & (1 << i)))
 					continue;
@@ -1205,7 +1205,7 @@
 	_lastCharInventory = -1;
 	updateDrawPage2();
 	enableSysTimer(2);
-	
+
 	return 1;
 }
 
@@ -1228,7 +1228,7 @@
 	uint16 x = 0;
 	uint16 y = 0;
 	int i = dirIndex[(_currentDirection << 2) + button->data2Val2];
-	
+
 	calcCoordinates(x, y, block, offsX[i], offsY[i]);
 	setItemPosition(_itemInHand, x, y, 0, 1);
 	setHandItem(0);
@@ -1309,7 +1309,7 @@
 		}
 
 		_screen->showMouse();
-		
+
 		wsa->close();
 		delete wsa;
 
@@ -1353,7 +1353,7 @@
 	int block = calcNewBlockPosition(_currentBlock, _currentDirection);
 	int dir = _currentDirection ^ 2;
 	uint8 type = _wllBuffer3[_levelBlockProperties[block].walls[dir]];
-	
+
 	int res = 0;
 	switch (type) {
 		case 1:
@@ -1449,6 +1449,16 @@
 }
 
 int LoLEngine::clickedCompass(Button *button) {
+	if (!(_gameFlags[15] & 0x4000))
+		return 0;
+
+	if (_compassBroken) {
+		if (characterSays(0x425b, -1, true))
+			_txt->printMessage(4, getLangString(0x425b));
+	} else {
+		_txt->printMessage(0, getLangString(0x402f + _currentDirection));
+	}
+
 	return 1;
 }
 

Modified: scummvm/trunk/engines/kyra/lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/lol.cpp	2009-04-04 17:57:00 UTC (rev 39851)
+++ scummvm/trunk/engines/kyra/lol.cpp	2009-04-04 21:10:35 UTC (rev 39852)
@@ -192,17 +192,17 @@
 	memset(_activeTim, 0, sizeof(_activeTim));
 	memset(_activeVoiceFile, 0, sizeof(_activeVoiceFile));
 	memset(_openDoorState, 0, sizeof(_openDoorState));
-	
+
 	_activeVoiceFileTotalTime = 0;
 	_pageBuffer1 = _pageBuffer2 = 0;
 
 	memset(_charStatsTemp, 0, sizeof(_charStatsTemp));
-	
-	_unkBt1 = _unkBt2 = 0;
+
+	_compassBroken = _unkBt2 = 0;
 	_dialogueField = false;
 
 	_rndSpecial = 0x12349876;
-	
+
 	_buttonData = 0;
 	_activeButtons = 0;
 	_preserveEvents = false;
@@ -214,10 +214,12 @@
 
 	memset(_lvlTempData, 0, sizeof(_lvlTempData));
 	_unkIceSHpFlag = 0;
-	
+
 	_mapOverlay = 0;
 	_automapShapes = 0;
 	_defaultLegendData = 0;
+
+	_compassTimer = 0;
 }
 
 LoLEngine::~LoLEngine() {
@@ -352,7 +354,7 @@
 			delete[] _lvlTempData[i]->monsters;
 			delete[] _lvlTempData[i]->flyingObjects;
 			delete _lvlTempData[i];
-		}		
+		}
 	}
 
 	delete[] _defaultLegendData;
@@ -390,7 +392,7 @@
 	memset(_pageBuffer1, 0, 0xfa00);
 	_pageBuffer2 = new uint8[0xfa00];
 	memset(_pageBuffer2, 0, 0xfa00);
- 
+
 	_itemsInPlay = new ItemInPlay[400];
 	memset(_itemsInPlay, 0, sizeof(ItemInPlay) * 400);
 
@@ -755,11 +757,11 @@
 
 void LoLEngine::startupNew() {
 	_selectedSpell = 0;
-	_compassUnk = 0;
+	_compassStep = 0;
 	_compassDirection = _compassDirectionIndex = -1;
 
 	_lastMouseRegion = -1;
-	
+
 	/*
 	_unk5 = 1;
 	_unk6 = 1;
@@ -830,7 +832,7 @@
 	if (_gameFlags[15] & 0x800 || !(_updateFlags & 4))
 		updateLampStatus();
 
-	if (_gameFlags[15] & 0x4000 && !(_updateFlags & 4) && (_compassDirection == -1 || (_currentDirection << 6) != _compassDirection || _compassUnk))
+	if (_gameFlags[15] & 0x4000 && !(_updateFlags & 4) && (_compassDirection == -1 || (_currentDirection << 6) != _compassDirection || _compassStep))
 		updateCompass();
 
 	snd_characterSpeaking();
@@ -933,7 +935,7 @@
 		l->arrayUnk2[i] = unk1;
 		l->arrayUnk1[i] = unk2;
 		_timer->setNextRun(3, _system->getMillis());
-		_timer->enable(3);		
+		_timer->enable(3);
 	}
 }
 
@@ -1157,7 +1159,7 @@
 				_txt->printMessage(0x8003, getLangString(0x4024), _characters[charNum].name);
 				inc = (_characters[charNum].defaultModifiers[6] * (_rnd.getRandomNumberRng(1, 8) + 17)) >> 8;
 				_characters[charNum].magicPointsCur += inc;
-				_characters[charNum].magicPointsMax += inc;			
+				_characters[charNum].magicPointsMax += inc;
 				inc = _rnd.getRandomNumberRng(1, 6);
 				_characters[charNum].hitPointsCur += inc;
 				_characters[charNum].hitPointsMax += inc;
@@ -1308,9 +1310,9 @@
 		setupScreenDims();
 		_txt->clearDim(4);
 	}
-	
+
 	_currentControlMode = controlMode;
-	_dialogueField = true;	
+	_dialogueField = true;
 }
 
 void LoLEngine::restoreAfterDialogueSequence(int controlMode) {
@@ -1375,7 +1377,7 @@
 		if (brightness < 0)
 			brightness = 0;
 	}
-	
+
 	for (int i = 0; i < 384; i++) {
 		uint16 c = (dst[i] * brightness) >> 8;
 		dst[i] = c & 0xff;
@@ -1401,7 +1403,7 @@
 void LoLEngine::restorePage5() {
 	if (!_pageSavedFlag)
 		return;
-	
+
 	for (int i = 0; i < 6; i++)
 		_tim->freeAnimStruct(i);
 
@@ -1667,6 +1669,8 @@
 int LoLEngine::characterSays(int track, int charId, bool redraw) {
 	if (charId == 1) {
 		charId = _selectedCharacter;
+	} if (charId <= 0) {
+		charId = 0;
 	} else {
 		int i = 0;
 		for (;i < 4; i++) {
@@ -1798,10 +1802,10 @@
 	uint cs = c >> 7;
 
 	a >>= 1;
-	c = (c << 1) | as;	
+	c = (c << 1) | as;
 	b = (b << 1) | cs;
 
-	a -= ((_rndSpecial & 0xff) - bs);	
+	a -= ((_rndSpecial & 0xff) - bs);
 	as = a & 1;
 	a >>= 1;
 
@@ -1839,7 +1843,7 @@
 		if (_monsters[target & 0x7fff].mode >= 13)
 			return 0;
 	}
-	
+
 	uint16 hitChanceModifier = 0;
 	uint16 evadeChanceModifier = 0;
 	int sk = 0;
@@ -1848,7 +1852,7 @@
 		hitChanceModifier = _monsters[target & 0x7fff].properties->fightingStats[0];
 		sk = 100 - _monsters[target & 0x7fff].properties->skillLevel;
 	} else {
-		hitChanceModifier = _characters[attacker].defaultModifiers[0];		
+		hitChanceModifier = _characters[attacker].defaultModifiers[0];
 		uint8 m = _characters[attacker].skillModifiers[skill];
 		if (skill == 1)
 			m *= 3;
@@ -1876,7 +1880,7 @@
 
 int LoLEngine::calcInflictableDamage(int16 attacker, int16 target, int hitType) {
 	const uint16 *s = getCharacterOrMonsterStats(attacker);
-	
+
 	int res = 0;
 	for (int i = 0; i < 8; i++)
 		res += calcInflictableDamagePerStat(attacker, target, s[2 + i], i, hitType);
@@ -1904,7 +1908,7 @@
 		if (_monsters[i].mode > 13)
 			continue;
 
-		int d = ABS(x - _monsters[i].x) + ABS(y - _monsters[i].y);		
+		int d = ABS(x - _monsters[i].x) + ABS(y - _monsters[i].y);
 		if (d < minDist) {
 			minDist = d;
 			id = 0x8000 | i;
@@ -1996,7 +2000,7 @@
 
 	for (int i = 0; i < 109; i++)
 		_automapShapes[i] = _screen->getPtrToShape(shp, i + 11);
-	
+
 	_screen->generateGrayOverlay(_screen->getPalette(3), _mapOverlay, 52, 0, 0, 0, 256, false);
 
 	_screen->loadFont(Screen::FID_9_FNT, "FONT9PN.FNT");
@@ -2124,7 +2128,7 @@
 }
 
 void LoLEngine::loadMapLegendData(int level) {
-	uint16 *legendData = (uint16 *)_tempBuffer5120;
+	uint16 *legendData= (uint16*) _tempBuffer5120;
 	for (int i = 0; i < 32; i++) {
 		legendData[i * 6] = 0xffff;
 		legendData[i * 6 + 5] = 0xffff;
@@ -2159,7 +2163,7 @@
 void LoLEngine::drawMapPage(int pageNum) {
 	for (int i = 0; i < 2; i++) {
 		_screen->loadBitmap("parch.cps", pageNum, pageNum, _screen->getPalette(3));
-		
+
 		int cp = _screen->setCurPage(pageNum);
 		Screen::FontId of = _screen->setFont(Screen::FID_9_FNT);
 		_screen->printText(getLangString(_autoMapStrings[_currentMapLevel]), 236, 8, 1, 0);
@@ -2227,7 +2231,7 @@
 		sx = mapGetStartPosX();
 		sy = mapGetStartPosY();
 
-		uint16 *legendData = (uint16 *)_tempBuffer5120;
+		uint16 *legendData = (uint16*)_tempBuffer5120;
 
 		for (int ii = 0; ii < 32; ii++)  {
 			uint16 *l = &legendData[ii * 6];
@@ -2252,9 +2256,9 @@
 			_levelBlockProperties[cbl2].flags |= 7;
 			_screen->drawShape(2, _automapShapes[l[5] << 2], (l[3] - sx) * 7 + _automapTopLeftX - 3, (l[4] - sy) * 6 + _automapTopLeftY - 3, 0, 0);
 			_screen->drawShape(2, _automapShapes[l[5] << 2], 231, (tY << 3) + 19, 0, 0);
-			tY++;			
+			tY++;
 		}
-			
+
 		cp = _screen->setCurPage(pageNum);
 
 		for (int ii = 0; ii < 11; ii++) {
@@ -2293,7 +2297,7 @@
 		delay (_tickLength);
 	}
 
-	if (r == 0) {			
+	if (r == 0) {
 		automapForwardButton();
 		printMapExitButtonText();
 	} else if (r == 1) {
@@ -2312,7 +2316,7 @@
 		if (i >= 32 || i == _currentMapLevel)
 			return;
 	}
-	
+
 	for (int l = 0; l < 11; l++) {
 		_defaultLegendData[l].enable = false;
 		_defaultLegendData[l].shapeIndex = 255;
@@ -2331,7 +2335,7 @@
 		if (i < 0 || i == _currentMapLevel)
 			return;
 	}
-	
+
 	for (int l = 0; l < 11; l++) {
 		_defaultLegendData[l].enable = false;
 		_defaultLegendData[l].shapeIndex = 255;
@@ -2403,7 +2407,7 @@
 	do {
 		for (a = 0; a < 32; a++) {
 			if (_levelBlockProperties[(a << 5) + d].flags)
-				break;				
+				break;
 		}
 		if (a == 32)
 			d--;

Modified: scummvm/trunk/engines/kyra/lol.h
===================================================================
--- scummvm/trunk/engines/kyra/lol.h	2009-04-04 17:57:00 UTC (rev 39851)
+++ scummvm/trunk/engines/kyra/lol.h	2009-04-04 21:10:35 UTC (rev 39852)
@@ -443,8 +443,9 @@
 	uint32 _buttonPressTimer;
 	int _selectedCharacter;
 	int _compassDirection;
-	int _compassUnk;
+	int _compassStep;
 	int _compassDirectionIndex;
+	uint32 _compassTimer;
 	int _charInventoryUnk;
 
 	const CompassDef *_compassDefs;
@@ -578,7 +579,7 @@
 	int olol_clearDialogueField(EMCState *script);
 	int olol_setupBackgroundAnimationPart(EMCState *script);
 	int olol_startBackgroundAnimation(EMCState *script);
-	int olol_fadeToBlack(EMCState *script);	
+	int olol_fadeToBlack(EMCState *script);
 	int olol_fadePalette(EMCState *script);
 	int olol_loadBitmap(EMCState *script);
 	int olol_stopBackgroundAnimation(EMCState *script);
@@ -633,7 +634,7 @@
 	int olol_checkMonsterTypeHostility(EMCState *script);
 	int olol_setNextFunc(EMCState *script);
 	int olol_dummy1(EMCState *script);
-	int olol_suspendMonster(EMCState *script);	
+	int olol_suspendMonster(EMCState *script);
 	int olol_setDoorState(EMCState *script);
 	int olol_processButtonClick(EMCState *script);
 	int olol_savePage5(EMCState *script);
@@ -648,7 +649,7 @@
 	int olol_enableSysTimer(EMCState *script);
 	int olol_disableControls(EMCState *script);
 	int olol_enableControls(EMCState *script);
-	int olol_characterSays(EMCState *script);	
+	int olol_characterSays(EMCState *script);
 	int olol_queueSpeech(EMCState *script);
 	int olol_getItemPrice(EMCState *script);
 	int olol_getLanguage(EMCState *script);
@@ -676,7 +677,7 @@
 	int tlol_drawScene(const TIM *tim, const uint16 *param);
 	int tlol_update(const TIM *tim, const uint16 *param);
 	int tlol_loadSoundFile(const TIM *tim, const uint16 *param);
-	int tlol_playMusicTrack(const TIM *tim, const uint16 *param);	
+	int tlol_playMusicTrack(const TIM *tim, const uint16 *param);
 	int tlol_playDialogueTalkText(const TIM *tim, const uint16 *param);
 	int tlol_playSoundEffect(const TIM *tim, const uint16 *param);
 	int tlol_startBackgroundAnimation(const TIM *tim, const uint16 *param);
@@ -954,9 +955,9 @@
 	int _lastMouseRegion;
 	int _seqWindowX1, _seqWindowY1,	_seqWindowX2, _seqWindowY2, _seqTrigger;
 	int _spsWindowX, _spsWindowY,	_spsWindowW, _spsWindowH;
-	
+
 	uint8 *_tempBuffer5120;
-	
+
 	const char *const * _levelDatList;
 	int _levelDatListSize;
 	const char *const * _levelShpList;
@@ -1027,7 +1028,7 @@
 	void processObjectFlight(FlyingObject *t, int x, int y);
 	void updateObjectFlightPosition(FlyingObject *t);
 	void objectFlightProcessHits(FlyingObject *t, int x, int y, int objectOnNextBlock);
-	void updateFlyingObjects(FlyingObject *t);	
+	void updateFlyingObjects(FlyingObject *t);
 
 	void assignItemToBlock(uint16 *assignedBlockObjects, int id);
 	int checkDrawObjectSpace(int itemX, int itemY, int partyX, int partyY);
@@ -1081,7 +1082,7 @@
 	void giveItemToMonster(MonsterInPlay *monster, uint16 item);
 	int checkBlockBeforeObjectPlacement(int x, int y, int objectWidth, int testFlag, int wallFlag);
 	int checkBlockForWallsAndSufficientSpace(int block, int x, int y, int objectWidth, int testFlag, int wallFlag);
-	int calcMonsterSkillLevel(int id, int a);	
+	int calcMonsterSkillLevel(int id, int a);
 	bool checkBlockOccupiedByParty(int x, int y, int testFlag);
 	const uint16 *getCharacterOrMonsterStats(int id);
 	void drawBlockObjects(int blockArrayIndex);
@@ -1138,7 +1139,7 @@
 	void delay(uint32 millis, bool cUpdate = false, bool isMainLoop = false);
 	uint8 getRandomNumberSpecial();
 
-	uint8 _unkBt1;
+	uint8 _compassBroken;
 	uint8 _unkBt2;
 	uint16 _unkWordArraySize8[8];
 
@@ -1152,7 +1153,7 @@
 	void battleHit_sub2(int16 target, int damageInflicted, int16 attacker, uint32 b);
 	void battleHit_sub3(MonsterInPlay *monster, int16 target, int16 damageInflicted);
 	int calcInflictableDamagePerStat(int16 attacker, int16 target, uint16 stat2m, int index, int hitType);
-	
+
 	uint16 getClosestMonster(int x, int y);
 	uint16 getClosestPartyMember(int x, int y);
 

Modified: scummvm/trunk/engines/kyra/scene_lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/scene_lol.cpp	2009-04-04 17:57:00 UTC (rev 39851)
+++ scummvm/trunk/engines/kyra/scene_lol.cpp	2009-04-04 21:10:35 UTC (rev 39852)
@@ -403,7 +403,7 @@
 			uint8 *pal2 = _screen->getPalette(2);
 			for (int i = 1; i < 768; i++)
 				SWAP(pal0[i], pal2[i]);
-		}		
+		}
 	}
 
 	memcpy(_vcnBlocks, v, vcnLen);
@@ -584,7 +584,53 @@
 }
 
 void LoLEngine::updateCompass() {
+	if (!(_gameFlags[15] & 0x4000) || (_updateFlags & 4))
+		return;
 
+	if (_compassDirection == -1) {
+		_compassStep = 0;
+		gui_drawCompass();
+		return;
+	}
+
+	if (_compassTimer >= _system->getMillis())
+		return;
+
+	if ((_currentDirection << 6) == _compassDirection && (!_compassStep))
+		return;
+
+	_compassTimer = _system->getMillis() + 3 * _tickLength;
+	int dir = _compassStep >= 0 ? 1 : -1;
+	if (_compassStep)
+		_compassStep -= (((ABS(_compassStep) >> 4) + 2) * dir);
+
+	int16 d = _compassBroken ? ((int8)getRandomNumberSpecial() - _compassDirection) : (_currentDirection << 6) - _compassDirection;
+	if (d <= -128)
+		d += 256;
+	if (d >= 128)
+		d -= 256;
+
+	d >>= 2;
+	_compassStep += d;
+	_compassStep = CLIP(_compassStep, -24, 24);
+	_compassDirection += _compassStep;
+
+	if (_compassDirection < 0)
+		_compassDirection += 256;
+	if (_compassDirection > 255)
+		_compassDirection -= 256;
+
+	if ((_compassDirection >> 6) == _currentDirection && _compassStep < 2) {
+		int16 d2 = d >> 16;
+		d ^= d2;
+		d -= d2;
+		if (d < 4) {
+			_compassDirection = _currentDirection << 6;
+			_compassStep = 0;
+		}
+	}
+
+	gui_drawCompass();
 }
 
 void LoLEngine::moveParty(uint16 direction, int unk1, int unk2, int buttonShape) {
@@ -642,7 +688,7 @@
 
 			if (_levelBlockProperties[npos].walls[0] == 0x1a)
 				memset(_levelBlockProperties[npos].walls, 0, 4);
-		}		
+		}
 	}
 
 	updateAutoMap(_currentBlock);
@@ -731,7 +777,7 @@
 
 	snd_stopSpeech(true);
 	runLevelScript(block, 0x40);
-	
+
 	return 1;
 }
 
@@ -765,7 +811,7 @@
 }
 
 int LoLEngine::clickedWallOnlyScript(uint16 block) {
-	runLevelScript(block, 0x40);	
+	runLevelScript(block, 0x40);
 	return 1;
 }
 
@@ -803,7 +849,7 @@
 bool LoLEngine::clickedShape(int shapeIndex) {
 	while (shapeIndex) {
 		uint16 s = _levelShapeProperties[shapeIndex].shapeIndex[1];
-		
+
 		if (s == 0xffff)
 			continue;
 
@@ -873,7 +919,7 @@
 		_openDoorState[s1].wall = c;
 
 		flg = (-openClose == 1) ? 0x10 : (-openClose == -1 ? 0x20 : 0);
-		
+
 		if (_wllWallFlags[v] & flg) {
 			_levelBlockProperties[block].walls[c] += openClose;
 			_levelBlockProperties[block].walls[c ^ 2] += openClose;
@@ -890,7 +936,7 @@
 	} else {
 		while (!(flg & _wllWallFlags[v]))
 			v += openClose;
-		
+
 		_levelBlockProperties[block].walls[c] = _levelBlockProperties[block].walls[c ^ 2] = v;
 		checkSceneUpdateNeed(block);
 	}
@@ -902,7 +948,7 @@
 			continue;
 
 		uint16 b = _openDoorState[i].block;
-		
+
 		do {
 			_levelBlockProperties[b].walls[_openDoorState[i].wall] += _openDoorState[i].state;
 			_levelBlockProperties[b].walls[_openDoorState[i].wall ^ 2] += _openDoorState[i].state;
@@ -1228,7 +1274,7 @@
 			_levelBlockProperties[block].flags |= 0x20;
 		} else {
 			_levelBlockProperties[block].flags &= 0xdf;
-		}		
+		}
 	} else {
 		_levelBlockProperties[block].walls[wall] = val;
 	}
@@ -1256,7 +1302,7 @@
 			_screen->fadePalette(_screen->getPalette(3), 10);
 			_screen->_fadeFlag = 0;
 		}
-		
+
 		setSpecialSceneButtons(0, 0, 320, 130, controlMode);
 
 	} else {
@@ -1306,7 +1352,7 @@
 	if (releaseTimScripts) {
 		for (int i = 0; i < TIM::kWSASlots; i++)
 			_tim->freeAnimStruct(i);
-		
+
 		for (int i = 0; i < 10; i++)
 			_tim->unload(_activeTim[i]);
 	}
@@ -1319,8 +1365,8 @@
 				_screen->fadeToBlack(10);
 			else
 				_screen->fadeClearSceneWindow(10);
-		} 
-		
+		}
+
 		_currentControlMode = 0;
 		calcCharPortraitXpos();
 
@@ -1333,7 +1379,7 @@
 		_currentControlMode = 0;
 		calcCharPortraitXpos();
 
-		if (redrawPlayField)			
+		if (redrawPlayField)
 			gui_drawPlayField();
 	}
 
@@ -1582,7 +1628,7 @@
 			uint16 vcnOffset = *bdb++;
 
 			if (vcnOffset & 0x8000) {
-				// this renders a wall block over the transparent pixels of a floor/ceiling block 
+				// this renders a wall block over the transparent pixels of a floor/ceiling block
 				remainder = vcnOffset - 0x8000;
 				vcnOffset = 0;
 			}
@@ -1899,9 +1945,9 @@
 	// flags: 0x10 = ice wall, 0x20 = teleporter, 0x40 = blue slime spot, 0x80 = blood spot
 	if (!(flg & 0xf0))
 		return;
-	
+
 	type = (type == 0) ? 2 : 0;
-	
+
 	for (int i = 0; i < 2; i++, type++) {
 		if (!((0x10 << type) & flg))
 			continue;
@@ -1910,7 +1956,7 @@
 		uint16 y = yOffs[type];
 		uint16 drawFlag = (type == 3) ? 0x80 : 0x20;
 		uint8 *ovl = (type == 3) ? _screen->_grayOverlay : 0;
-		
+
 		calcCoordinatesAddDirectionOffset(x, y, _currentDirection);
 
 		x |= ((_visibleBlockIndex[index] & 0x1f) << 8);

Modified: scummvm/trunk/engines/kyra/script_lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/script_lol.cpp	2009-04-04 17:57:00 UTC (rev 39851)
+++ scummvm/trunk/engines/kyra/script_lol.cpp	2009-04-04 21:10:35 UTC (rev 39852)
@@ -575,7 +575,7 @@
 	case 10:
 		return _sceneDefaultUpdate;
 	case 11:
-		return _unkBt1;
+		return _compassBroken;
 	case 12:
 		return _unkBt2;
 	case 13:
@@ -647,7 +647,7 @@
 		break;
 
 	case 11:
-		_unkBt1 = a & 0xff;
+		_compassBroken = a & 0xff;
 		break;
 
 	case 12:
@@ -711,7 +711,7 @@
 		if (l->might || l->mode == 13)
 			continue;
 
-		memset(l, 0, sizeof(MonsterInPlay));		
+		memset(l, 0, sizeof(MonsterInPlay));
 		l->id = i;
 		l->x = x;
 		l->y = y;
@@ -777,7 +777,7 @@
 	_screen->fadeClearSceneWindow(10);
 	_screen->fillRect(112, 0, 288, 120, 0);
 	disableSysTimer(2);
-	
+
 	for (int i = 0; i < 8; i++) {
 		if (!_flyingObjects[i].enable || _flyingObjects[i].a)
 			continue;
@@ -943,7 +943,7 @@
 
 		_characters[i].flags &= 0xfffe;
 		calcCharPortraitXpos();
-		
+
 		if (!_updateFlags) {
 			gui_enableDefaultPlayfieldButtons();
 			gui_drawPlayField();
@@ -1100,7 +1100,7 @@
 
 int LoLEngine::olol_drawExitButton(EMCState *script) {
 	debugC(3, kDebugLevelScriptFuncs, "LoLEngine::olol_drawExitButton(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
-	
+
 	static const uint8 printPara[] = { 0x90, 0x78, 0x0C, 0x9F, 0x80, 0x1E };
 
 	int cp = _screen->setCurPage(0);
@@ -1111,7 +1111,7 @@
 
 	char *str = getLangString(0x4033);
 	int w = _screen->getTextWidth(str);
-	
+
 	gui_drawBox(x - offs - w, y - 9, w + offs, 9, 136, 251, 252);
 	_screen->printText(str, x - (offs >> 1) - w, y - 7, 144, 0);
 
@@ -1119,7 +1119,7 @@
 		_screen->drawGridBox(x - offs - w + 1, y - 8, w + offs - 2, 7, 1);
 
 	_screen->setFont(cf);
-	_screen->setCurPage(cp);	
+	_screen->setCurPage(cp);
 	return 1;
 }
 


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