[Scummvm-cvs-logs] SF.net SVN: scummvm: [29445] scummvm/trunk/engines/lure
dreammaster at users.sourceforge.net
dreammaster at users.sourceforge.net
Wed Nov 7 10:39:48 CET 2007
Revision: 29445
http://scummvm.svn.sourceforge.net/scummvm/?rev=29445&view=rev
Author: dreammaster
Date: 2007-11-07 01:39:48 -0800 (Wed, 07 Nov 2007)
Log Message:
-----------
Bugfix for NPC conversations so they'll only stand still when they should, and pause correctly during scripted animations
Modified Paths:
--------------
scummvm/trunk/engines/lure/hotspots.cpp
scummvm/trunk/engines/lure/hotspots.h
scummvm/trunk/engines/lure/scripts.cpp
Modified: scummvm/trunk/engines/lure/hotspots.cpp
===================================================================
--- scummvm/trunk/engines/lure/hotspots.cpp 2007-11-07 09:36:49 UTC (rev 29444)
+++ scummvm/trunk/engines/lure/hotspots.cpp 2007-11-07 09:39:48 UTC (rev 29445)
@@ -69,7 +69,7 @@
_talkY = res->talkY;
_layer = res->layer;
_hotspotScriptOffset = res->hotspotScriptOffset;
- _tickCtr = res->tickTimeout;
+ _frameCtr = res->tickTimeout;
_colourOffset = res->colourOffset;
_tempDest.counter = 0;
@@ -84,7 +84,6 @@
setFrameNumber(_anim->upFrame);
}
- _frameCtr = 0;
_skipFlag = false;
_charRectY = 0;
_voiceCtr = 0;
@@ -140,7 +139,7 @@
_widthCopy = 24;
_yCorrection = 1;
- _tickCtr = 0;
+ _frameCtr = 0;
_voiceCtr = 40;
_tickHandler = HotspotTickHandlers::getHandler(VOICE_TICK_PROC_ID);
@@ -206,7 +205,7 @@
_heightCopy = 0;
_widthCopy = 0;
_yCorrection = 0;
- _tickCtr = 0;
+ _frameCtr = 0;
_tickHandler = NULL;
_frameWidth = _width;
_frameStartsUsed = false;
@@ -749,7 +748,7 @@
HotspotData *hotspot = Resources::getReference().getHotspot(destCharacterId);
_data->talkCountdown += hotspot->talkCountdown;
- hotspot->talkerId = _hotspotId ;
+// hotspot->talkerId = _hotspotId ;
hotspot->talkGate = 0;
}
@@ -880,6 +879,11 @@
assert(_data);
Room &room = Room::getReference();
+ if ((_data->talkDestCharacterId != 0) && (_data->talkDestCharacterId != NOONE_ID)) {
+ HotspotData *hotspot = Resources::getReference().getHotspot(_data->talkDestCharacterId);
+ hotspot->talkerId = _hotspotId;
+ }
+
if (room.roomNumber() != roomNumber()) return;
room.setTalkDialog(hotspotId(), _data->talkDestCharacterId, _data->useHotspotId,
_data->talkMessageId);
@@ -2153,7 +2157,6 @@
stream->writeUint16LE(_talkY);
stream->writeByte(_layer);
stream->writeUint16LE(_hotspotScriptOffset);
- stream->writeUint16LE(_tickCtr);
stream->writeByte(_colourOffset);
stream->writeByte((byte)_direction);
stream->writeUint16LE(_animId);
@@ -2194,7 +2197,6 @@
_talkY = stream->readUint16LE();
_layer = stream->readByte();
_hotspotScriptOffset = stream->readUint16LE();
- _tickCtr = stream->readUint16LE();
_colourOffset = stream->readByte();
_direction = (Direction)stream->readByte();
setAnimation(stream->readUint16LE());
@@ -2297,8 +2299,8 @@
}
void HotspotTickHandlers::standardAnimHandler(Hotspot &h) {
- if (h.tickCtr() > 0)
- h.setTickCtr(h.tickCtr() - 1);
+ if (h.frameCtr() > 0)
+ h.decrFrameCtr();
else
h.executeScript();
}
@@ -2875,6 +2877,7 @@
if (pathFinder.isEmpty()) {
mouse.setCursorNum(CURSOR_ARROW);
+ h.currentActions().top().setAction(DISPATCH_ACTION);
break;
}
Modified: scummvm/trunk/engines/lure/hotspots.h
===================================================================
--- scummvm/trunk/engines/lure/hotspots.h 2007-11-07 09:36:49 UTC (rev 29444)
+++ scummvm/trunk/engines/lure/hotspots.h 2007-11-07 09:39:48 UTC (rev 29445)
@@ -271,7 +271,6 @@
Direction _direction;
uint8 _layer;
uint16 _hotspotScriptOffset;
- uint16 _tickCtr;
uint8 _colourOffset;
bool _persistant;
HotspotOverrideData *_override;
@@ -392,9 +391,7 @@
}
uint16 hotspotScript() { return _hotspotScriptOffset; }
uint8 layer() { return _layer; }
- uint16 tickCtr() { return _tickCtr; }
bool skipFlag() { return _skipFlag; }
- void setTickCtr(uint16 newVal) { _tickCtr = newVal; }
void setTickProc(uint16 newVal);
bool persistant() { return _persistant; }
void setPersistant(bool value) { _persistant = value; }
Modified: scummvm/trunk/engines/lure/scripts.cpp
===================================================================
--- scummvm/trunk/engines/lure/scripts.cpp 2007-11-07 09:36:49 UTC (rev 29444)
+++ scummvm/trunk/engines/lure/scripts.cpp 2007-11-07 09:39:48 UTC (rev 29445)
@@ -1174,7 +1174,7 @@
param1 = nextVal(scriptData, offset);
debugC(ERROR_DETAILED, kLureDebugScripts, "SET FRAME_CTR = %d", param1);
- h->setTickCtr(param1);
+ h->setFrameCtr(param1);
h->setHotspotScript(offset);
breakFlag = true;
break;
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