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

athrxx at users.sourceforge.net athrxx at users.sourceforge.net
Mon Mar 9 21:34:36 CET 2009


Revision: 39275
          http://scummvm.svn.sourceforge.net/scummvm/?rev=39275&view=rev
Author:   athrxx
Date:     2009-03-09 20:34:36 +0000 (Mon, 09 Mar 2009)

Log Message:
-----------
LOL: - fixed inventory bug
- fixed monster speed

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/script_lol.cpp
    scummvm/trunk/engines/kyra/sprites_lol.cpp
    scummvm/trunk/engines/kyra/staticres.cpp
    scummvm/trunk/engines/kyra/timer_lol.cpp

Modified: scummvm/trunk/engines/kyra/gui_lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/gui_lol.cpp	2009-03-09 20:31:43 UTC (rev 39274)
+++ scummvm/trunk/engines/kyra/gui_lol.cpp	2009-03-09 20:34:36 UTC (rev 39275)
@@ -277,11 +277,11 @@
 void LoLEngine::gui_drawCharInventoryItem(int itemIndex) {	
 	static const uint8 slotShapes[] = { 0x30, 0x34, 0x30, 0x34, 0x2E, 0x2F, 0x32, 0x33, 0x31, 0x35, 0x35 };
 
-	const int8 *coords = &_charInvDefs[_charInvIndex[_characters[_selectedCharacter].raceClassSex] * 22 + itemIndex * 2];
-	int8 x = *coords++;
-	int8 y = *coords;
+	const uint8 *coords = &_charInvDefs[_charInvIndex[_characters[_selectedCharacter].raceClassSex] * 22 + itemIndex * 2];
+	uint8 x = *coords++;
+	uint8 y = *coords;
 
-	if (y == -1)
+	if (y == 0xff)
 		return;
 
 	if (!_screen->_curPage)
@@ -291,6 +291,11 @@
 	int shapeNum = i ? ((itemIndex < 9) ? 4 : 5) : slotShapes[itemIndex];
 	_screen->drawShape(_screen->_curPage, _gameShapes[shapeNum], x, y, 0, 0);
 
+	if (itemIndex > 8) {
+		x -= 5;
+		y -= 5;
+	}
+
 	if (i)
 		_screen->drawShape(_screen->_curPage, getItemIconShapePtr(i), x + 1, y + 1, 0, 0);
 }
@@ -859,10 +864,10 @@
 }
 
 void LoLEngine::gui_initCharInventorySpecialButtons(int charNum) {
-	const int8 *s = &_charInvDefs[_charInvIndex[_characters[charNum].raceClassSex] * 22];
+	const uint8 *s = &_charInvDefs[_charInvIndex[_characters[charNum].raceClassSex] * 22];
 
 	for (int i = 0; i < 11; i++) {
-		if (*s != -1)
+		if (*s != 0xff)
 			gui_initButton(33 + i, s[0], s[1], i);
 		s += 2;
 	}	

Modified: scummvm/trunk/engines/kyra/lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/lol.cpp	2009-03-09 20:31:43 UTC (rev 39274)
+++ scummvm/trunk/engines/kyra/lol.cpp	2009-03-09 20:34:36 UTC (rev 39275)
@@ -1395,10 +1395,6 @@
 		_tim->_abortFlag = 1;
 }
 
-uint32 LoLEngine::snd_getElapsedSpeechTime() {
-	return _sound->voicePlayedTime(_activeVoiceFile);
-}
-
 void LoLEngine::snd_playSoundEffect(int track, int volume) {
 	debugC(9, kDebugLevelMain | kDebugLevelSound, "LoLEngine::snd_playSoundEffect(%d, %d)", track, volume);
 

Modified: scummvm/trunk/engines/kyra/lol.h
===================================================================
--- scummvm/trunk/engines/kyra/lol.h	2009-03-09 20:31:43 UTC (rev 39274)
+++ scummvm/trunk/engines/kyra/lol.h	2009-03-09 20:34:36 UTC (rev 39275)
@@ -112,7 +112,7 @@
 	uint16 unk3[8];
 	uint16 itemProtection;
 	uint16 might;
-	uint8 b;
+	uint8 waitTicks;
 	uint16 flags;
 	uint16 unk5;
 	uint16 unk6[5];
@@ -144,7 +144,7 @@
 	uint8 field_1B;
 	uint8 field_1C;
 	int16 might;
-	uint8 field_1F;
+	uint8 tick;
 	uint8 type;
 	MonsterProperty *properties;
 	uint8 field_25;
@@ -312,7 +312,7 @@
 	void timerProcessMonsters(int timerNum);
 	void timerSub3(int timerNum);
 	void timerSub4(int timerNum);
-	void timerUpdateSceneAnims(int timerNum);
+	void timerRunSceneAnimScript(int timerNum);
 	void timerSub6(int timerNum);
 	void timerUpdatePortraitAnimations(int skipUpdate);
 	void timerUpdateLampState(int timerNum);
@@ -327,7 +327,6 @@
 	bool snd_playCharacterSpeech(int id, int8 speaker, int);
 	int snd_characterSpeaking();
 	void snd_stopSpeech(bool setFlag);
-	uint32 snd_getElapsedSpeechTime();
 	void snd_playSoundEffect(int track, int volume);
 	void snd_processEnvironmentalSoundEffect(int soundId, int block);
 	void snd_loadSoundFile(int track);
@@ -936,7 +935,7 @@
 
 	const uint8 *_charInvIndex;
 	int _charInvIndexSize;
-	const int8 *_charInvDefs;
+	const uint8 *_charInvDefs;
 	int _charInvDefsSize;
 
 	EMCData _itemScript;

Modified: scummvm/trunk/engines/kyra/script_lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/script_lol.cpp	2009-03-09 20:31:43 UTC (rev 39274)
+++ scummvm/trunk/engines/kyra/script_lol.cpp	2009-03-09 20:34:36 UTC (rev 39275)
@@ -693,7 +693,7 @@
 	l->pos = &l->field2[0];
 	l->itemProtection = stackPos(25);
 	l->might = stackPos(26);
-	l->b = 1;
+	l->waitTicks = 1;
 	l->flags = stackPos(27);
 	l->unk5 = stackPos(28);
 	// FIXME???

Modified: scummvm/trunk/engines/kyra/sprites_lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/sprites_lol.cpp	2009-03-09 20:31:43 UTC (rev 39274)
+++ scummvm/trunk/engines/kyra/sprites_lol.cpp	2009-03-09 20:34:36 UTC (rev 39275)
@@ -836,17 +836,15 @@
 }
 
 void LoLEngine::updateMonster(MonsterInPlay *monster) {
-	static const uint8 monsterState[] = { 1, 0, 1, 3, 3, 0, 0, 3, 4, 1, 0, 0, 4, 0, 0 };
+	static const uint8 flags[] = { 1, 0, 1, 3, 3, 0, 0, 3, 4, 1, 0, 0, 4, 0, 0 };
 	if (monster->mode > 14)
 		return;
 
-	int s = monsterState[monster->mode];
-	int a = monster->field_1F++;
-
-	if ((a < monster->properties->b) && (s & 4))
+	int f = flags[monster->mode];
+	if ((monster->tick++ < monster->properties->waitTicks) && (!(f & 4)))
 		return;
 
-	monster->field_1F = 0;
+	monster->tick = 0;
 
 	if (monster->properties->flags & 0x40) {
 		monster->might += _rnd.getRandomNumberRng(1, 8);
@@ -859,13 +857,13 @@
 		monster->destY = _partyPosY;
 	}
 
-	if (s & 2) {
+	if (f & 2) {
 
 		/////
 		// TODO
 	}
 
-	if ((s & 1) && (monster->flags & 0x10))
+	if ((f & 1) && (monster->flags & 0x10))
 		setMonsterMode(monster, 7);
 
 	if ((monster->mode != 11) && (monster->mode != 14)) {

Modified: scummvm/trunk/engines/kyra/staticres.cpp
===================================================================
--- scummvm/trunk/engines/kyra/staticres.cpp	2009-03-09 20:31:43 UTC (rev 39274)
+++ scummvm/trunk/engines/kyra/staticres.cpp	2009-03-09 20:34:36 UTC (rev 39275)
@@ -1755,7 +1755,7 @@
 	_spellProperties = _staticres->loadSpellData(kLolSpellProperties, _spellPropertiesSize);
 	_gameShapeMap = (const int8*)_staticres->loadRawData(kLolGameShapeMap, _gameShapeMapSize);
 	_charInvIndex = _staticres->loadRawData(kLolCharInvIndex, _charInvIndexSize);
-	_charInvDefs = (const int8*)_staticres->loadRawData(kLolCharInvDefs, _charInvDefsSize);
+	_charInvDefs = _staticres->loadRawData(kLolCharInvDefs, _charInvDefsSize);
 	_charDefsMan = _staticres->loadRawDataBe16(kLolCharDefsMan, _charDefsManSize);
 	_charDefsWoman = _staticres->loadRawDataBe16(kLolCharDefsWoman, _charDefsWomanSize);
 	_charDefsKieran = _staticres->loadRawDataBe16(kLolCharDefsKieran, _charDefsKieranSize);

Modified: scummvm/trunk/engines/kyra/timer_lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/timer_lol.cpp	2009-03-09 20:31:43 UTC (rev 39274)
+++ scummvm/trunk/engines/kyra/timer_lol.cpp	2009-03-09 20:34:36 UTC (rev 39275)
@@ -42,9 +42,9 @@
 	_timer->setNextRun(0x11, _system->getMillis() + 3 * _tickLength);
 	_timer->addTimer(3, TimerV2(timerSub3), 15, true);
 	_timer->addTimer(4, TimerV2(timerSub4), 1, true);
-	_timer->addTimer(0x50, TimerV2(timerUpdateSceneAnims), 0, false);
-	_timer->addTimer(0x51, TimerV2(timerUpdateSceneAnims), 0, false);
-	_timer->addTimer(0x52, TimerV2(timerUpdateSceneAnims), 0, false);
+	_timer->addTimer(0x50, TimerV2(timerRunSceneAnimScript), 0, false);
+	_timer->addTimer(0x51, TimerV2(timerRunSceneAnimScript), 0, false);
+	_timer->addTimer(0x52, TimerV2(timerRunSceneAnimScript), 0, false);
 	_timer->addTimer(8, TimerV2(timerSub6), 1200, true);
 	_timer->addTimer(9, TimerV2(timerUpdatePortraitAnimations), 10, true);
 	_timer->addTimer(10, TimerV2(timerUpdateLampState), 360, true);
@@ -119,7 +119,7 @@
 
 }
 
-void LoLEngine::timerUpdateSceneAnims(int timerNum) {
+void LoLEngine::timerRunSceneAnimScript(int timerNum) {
 	runLevelScript(0x401 + (timerNum & 0x0f), -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