aboutsummaryrefslogtreecommitdiff
path: root/engines/lure
diff options
context:
space:
mode:
authorDavid Corrales2007-05-31 23:44:43 +0000
committerDavid Corrales2007-05-31 23:44:43 +0000
commit0cab5b7791e56b32455748bf20c21f0d6b42f654 (patch)
tree9e6580328542f1db230e019ba77e3db1be8fa50b /engines/lure
parent6c69d531d262e14fa02b6e1adb42baaa5c74dbe6 (diff)
parent22c0403e0dfec16badf156afa842c6c37e850263 (diff)
downloadscummvm-rg350-0cab5b7791e56b32455748bf20c21f0d6b42f654.tar.gz
scummvm-rg350-0cab5b7791e56b32455748bf20c21f0d6b42f654.tar.bz2
scummvm-rg350-0cab5b7791e56b32455748bf20c21f0d6b42f654.zip
Merged the fs branch with trunk. r26949:27031
svn-id: r27032
Diffstat (limited to 'engines/lure')
-rw-r--r--engines/lure/animseq.cpp7
-rw-r--r--engines/lure/animseq.h7
-rw-r--r--engines/lure/debug-input.cpp7
-rw-r--r--engines/lure/debug-input.h7
-rw-r--r--engines/lure/debug-methods.cpp7
-rw-r--r--engines/lure/debug-methods.h7
-rw-r--r--engines/lure/debugger.cpp7
-rw-r--r--engines/lure/debugger.h7
-rw-r--r--engines/lure/decode.cpp7
-rw-r--r--engines/lure/decode.h7
-rw-r--r--engines/lure/detection.cpp11
-rw-r--r--engines/lure/disk.cpp7
-rw-r--r--engines/lure/disk.h7
-rw-r--r--engines/lure/events.cpp7
-rw-r--r--engines/lure/events.h7
-rw-r--r--engines/lure/game.cpp7
-rw-r--r--engines/lure/game.h7
-rw-r--r--engines/lure/hotspots.cpp43
-rw-r--r--engines/lure/hotspots.h7
-rw-r--r--engines/lure/intro.cpp7
-rw-r--r--engines/lure/intro.h7
-rw-r--r--engines/lure/lure.cpp11
-rw-r--r--engines/lure/lure.h7
-rw-r--r--engines/lure/luredefs.h8
-rw-r--r--engines/lure/memory.cpp7
-rw-r--r--engines/lure/memory.h7
-rw-r--r--engines/lure/menu.cpp7
-rw-r--r--engines/lure/menu.h7
-rw-r--r--engines/lure/palette.cpp7
-rw-r--r--engines/lure/palette.h7
-rw-r--r--engines/lure/res.cpp12
-rw-r--r--engines/lure/res.h7
-rw-r--r--engines/lure/res_struct.cpp56
-rw-r--r--engines/lure/res_struct.h22
-rw-r--r--engines/lure/room.cpp7
-rw-r--r--engines/lure/room.h7
-rw-r--r--engines/lure/screen.cpp7
-rw-r--r--engines/lure/screen.h7
-rw-r--r--engines/lure/scripts.cpp44
-rw-r--r--engines/lure/scripts.h9
-rw-r--r--engines/lure/strings.cpp7
-rw-r--r--engines/lure/strings.h7
-rw-r--r--engines/lure/surface.cpp7
-rw-r--r--engines/lure/surface.h7
44 files changed, 345 insertions, 116 deletions
diff --git a/engines/lure/animseq.cpp b/engines/lure/animseq.cpp
index dfcdefc374..7b65d2cf0b 100644
--- a/engines/lure/animseq.cpp
+++ b/engines/lure/animseq.cpp
@@ -1,5 +1,8 @@
-/* ScummVM - Scumm Interpreter
- * Copyright (C) 2005-2006 The ScummVM project
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
diff --git a/engines/lure/animseq.h b/engines/lure/animseq.h
index 86f4c8e35c..665d638e48 100644
--- a/engines/lure/animseq.h
+++ b/engines/lure/animseq.h
@@ -1,5 +1,8 @@
-/* ScummVM - Scumm Interpreter
- * Copyright (C) 2005-2006 The ScummVM project
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
diff --git a/engines/lure/debug-input.cpp b/engines/lure/debug-input.cpp
index 7a061aea03..9ec520e11d 100644
--- a/engines/lure/debug-input.cpp
+++ b/engines/lure/debug-input.cpp
@@ -1,5 +1,8 @@
-/* ScummVM - Scumm Interpreter
- * Copyright (C) 2005-2006 The ScummVM project
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
diff --git a/engines/lure/debug-input.h b/engines/lure/debug-input.h
index 032543b352..aad2e58232 100644
--- a/engines/lure/debug-input.h
+++ b/engines/lure/debug-input.h
@@ -1,5 +1,8 @@
-/* ScummVM - Scumm Interpreter
- * Copyright (C) 2005-2006 The ScummVM project
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
diff --git a/engines/lure/debug-methods.cpp b/engines/lure/debug-methods.cpp
index 52487da303..520b29add6 100644
--- a/engines/lure/debug-methods.cpp
+++ b/engines/lure/debug-methods.cpp
@@ -1,5 +1,8 @@
-/* ScummVM - Scumm Interpreter
- * Copyright (C) 2005-2006 The ScummVM project
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
diff --git a/engines/lure/debug-methods.h b/engines/lure/debug-methods.h
index aa61793662..43b77d9191 100644
--- a/engines/lure/debug-methods.h
+++ b/engines/lure/debug-methods.h
@@ -1,5 +1,8 @@
-/* ScummVM - Scumm Interpreter
- * Copyright (C) 2005-2006 The ScummVM project
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
diff --git a/engines/lure/debugger.cpp b/engines/lure/debugger.cpp
index f9d94d4c1d..953e5643b7 100644
--- a/engines/lure/debugger.cpp
+++ b/engines/lure/debugger.cpp
@@ -1,5 +1,8 @@
-/* ScummVM - Scumm Interpreter
- * Copyright (C) 2005-2006 The ScummVM project
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
diff --git a/engines/lure/debugger.h b/engines/lure/debugger.h
index 2e0951fcd8..55a381cca0 100644
--- a/engines/lure/debugger.h
+++ b/engines/lure/debugger.h
@@ -1,5 +1,8 @@
-/* ScummVM - Scumm Interpreter
- * Copyright (C) 2005-2006 The ScummVM project
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
diff --git a/engines/lure/decode.cpp b/engines/lure/decode.cpp
index c32223edc3..dc4bdb95e1 100644
--- a/engines/lure/decode.cpp
+++ b/engines/lure/decode.cpp
@@ -1,5 +1,8 @@
-/* ScummVM - Scumm Interpreter
- * Copyright (C) 2005-2006 The ScummVM project
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
diff --git a/engines/lure/decode.h b/engines/lure/decode.h
index 2c40c6ff83..8e4e87a07d 100644
--- a/engines/lure/decode.h
+++ b/engines/lure/decode.h
@@ -1,5 +1,8 @@
-/* ScummVM - Scumm Interpreter
- * Copyright (C) 2005-2006 The ScummVM project
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
diff --git a/engines/lure/detection.cpp b/engines/lure/detection.cpp
index 211874690d..4b2da03aa9 100644
--- a/engines/lure/detection.cpp
+++ b/engines/lure/detection.cpp
@@ -1,5 +1,8 @@
-/* ScummVM - Scumm Interpreter
- * Copyright (C) 2005-2006 The ScummVM project
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -15,8 +18,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * $URL$
- * $Id$
+ * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/lure/detection.cpp $
+ * $Id:detection.cpp 26949 2007-05-26 20:23:24Z david_corrales $
*
*/
diff --git a/engines/lure/disk.cpp b/engines/lure/disk.cpp
index f23490272b..8f0714c42e 100644
--- a/engines/lure/disk.cpp
+++ b/engines/lure/disk.cpp
@@ -1,5 +1,8 @@
-/* ScummVM - Scumm Interpreter
- * Copyright (C) 2005-2006 The ScummVM project
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
diff --git a/engines/lure/disk.h b/engines/lure/disk.h
index 84374bf194..47ff7901c5 100644
--- a/engines/lure/disk.h
+++ b/engines/lure/disk.h
@@ -1,5 +1,8 @@
-/* ScummVM - Scumm Interpreter
- * Copyright (C) 2005-2006 The ScummVM project
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
diff --git a/engines/lure/events.cpp b/engines/lure/events.cpp
index 707263ccbc..dd96123256 100644
--- a/engines/lure/events.cpp
+++ b/engines/lure/events.cpp
@@ -1,5 +1,8 @@
-/* ScummVM - Scumm Interpreter
- * Copyright (C) 2005-2006 The ScummVM project
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
diff --git a/engines/lure/events.h b/engines/lure/events.h
index 45a664d572..fcdfc343d7 100644
--- a/engines/lure/events.h
+++ b/engines/lure/events.h
@@ -1,5 +1,8 @@
-/* ScummVM - Scumm Interpreter
- * Copyright (C) 2005-2006 The ScummVM project
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
diff --git a/engines/lure/game.cpp b/engines/lure/game.cpp
index 62425ae926..26d9c71edd 100644
--- a/engines/lure/game.cpp
+++ b/engines/lure/game.cpp
@@ -1,5 +1,8 @@
-/* ScummVM - Scumm Interpreter
- * Copyright (C) 2005-2006 The ScummVM project
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
diff --git a/engines/lure/game.h b/engines/lure/game.h
index 7164346dc7..43a146f2be 100644
--- a/engines/lure/game.h
+++ b/engines/lure/game.h
@@ -1,5 +1,8 @@
-/* ScummVM - Scumm Interpreter
- * Copyright (C) 2005-2006 The ScummVM project
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
diff --git a/engines/lure/hotspots.cpp b/engines/lure/hotspots.cpp
index f3b1c01d3d..6cc863469a 100644
--- a/engines/lure/hotspots.cpp
+++ b/engines/lure/hotspots.cpp
@@ -1,5 +1,8 @@
-/* ScummVM - Scumm Interpreter
- * Copyright (C) 2005-2006 The ScummVM project
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -867,7 +870,7 @@ HotspotPrecheckResult Hotspot::actionPrecheck(HotspotData *hotspot) {
setDelayCtr(4);
}
- hotspot->talkGate = 0x2A;
+ hotspot->talkGate = GENERAL_MAGIC_ID;
hotspot->talkDestCharacterId = _hotspotId;
return PC_WAIT;
}
@@ -2024,6 +2027,7 @@ void Hotspot::startTalk(HotspotData *charHotspot, uint16 id) {
// Signal the character that they're being talked to
charHotspot->talkDestCharacterId = _hotspotId;
+ charHotspot->talkGate = 0;
_data->talkDestCharacterId = charHotspot->hotspotId;
_data->talkGate = 0;
@@ -2067,6 +2071,7 @@ void Hotspot::saveToStream(Common::WriteStream *stream) {
stream->writeUint16LE(_blockedOffset);
stream->writeUint16LE(_exitCtr);
stream->writeByte(_walkFlag);
+ stream->writeByte(_persistant);
stream->writeUint16LE(_startRoomNumber);
stream->writeUint16LE(_supportValue);
}
@@ -2103,6 +2108,7 @@ void Hotspot::loadFromStream(Common::ReadStream *stream) {
_blockedOffset = stream->readUint16LE();
_exitCtr = stream->readUint16LE();
_walkFlag = stream->readByte() != 0;
+ _persistant = stream->readByte() != 0;
_startRoomNumber = stream->readUint16LE();
_supportValue = stream->readUint16LE();
}
@@ -2214,7 +2220,7 @@ void HotspotTickHandlers::standardCharacterAnimHandler(Hotspot &h) {
if (h.resource()->talkDestCharacterId != 0) {
debugC(ERROR_DETAILED, kLureDebugAnimations, "Use Hotspot Id = %xh, talk_gate = %d",
h.resource()->talkDestCharacterId, h.talkGate());
- if (h.talkGate() == 0x2A) {
+ if (h.talkGate() == GENERAL_MAGIC_ID) {
fields.setField(ACTIVE_HOTSPOT_ID, h.talkGate());
fields.setField(USE_HOTSPOT_ID, h.resource()->talkDestCharacterId);
Script::execute(h.talkScript());
@@ -2784,17 +2790,6 @@ void HotspotTickHandlers::playerAnimHandler(Hotspot &h) {
debugC(ERROR_DETAILED, kLureDebugAnimations, "Hotspot player anim handler end");
}
-struct RoomTranslationRecord {
- uint8 srcRoom;
- uint8 destRoom;
-};
-
-RoomTranslationRecord roomTranslations[] = {
- {0x1E, 0x13}, {0x07, 0x08}, {0x1C, 0x12}, {0x26, 0x0F},
- {0x27, 0x0F}, {0x28, 0x0F}, {0x29, 0x0F}, {0x22, 0x0A},
- {0x23, 0x13}, {0x24, 0x14}, {0x31, 0x2C}, {0x2F, 0x2C},
- {0, 0}};
-
void HotspotTickHandlers::followerAnimHandler(Hotspot &h) {
static int countdownCtr = 0;
Resources &res = Resources::getReference();
@@ -3142,9 +3137,13 @@ void HotspotTickHandlers::talkAnimHandler(Hotspot &h) {
if ((entry->preSequenceId & 0x8000) != 0) break;
}
- if (showSelections && (numLines > 1))
+ if (showSelections && (numLines > 1)) {
res.setTalkState(TALK_SELECT);
- else {
+
+ // Make sure the dest character holds still while an option is selected
+ HotspotData *destHotspot = res.getHotspot(talkDestCharacter);
+ destHotspot->talkDestCharacterId = h.hotspotId();
+ } else {
res.setTalkState(TALK_RESPOND);
res.setTalkSelection(1);
}
@@ -4457,17 +4456,21 @@ void HotspotList::loadFromStream(ReadStream *stream) {
Hotspot *destHotspot = res.getActiveHotspot(destHotspotId);
assert(destHotspot);
hotspot = new Hotspot(destHotspot, hotspotId);
- res.addHotspot(hotspot);
}
else
{
- hotspot = res.activateHotspot(hotspotId);
+ HotspotData *hotspotData = res.getHotspot(hotspotId);
+ assert(hotspotData);
+ hotspot = new Hotspot(hotspotData);
}
- assert(hotspot);
+ res.addHotspot(hotspot);
+ assert(hotspot);
hotspot->loadFromStream(stream);
+
debugC(ERROR_DETAILED, kLureDebugAnimations, "Loaded hotspot %xh", hotspotId);
+ // Get the next hotspot
hotspotId = stream->readUint16LE();
}
}
diff --git a/engines/lure/hotspots.h b/engines/lure/hotspots.h
index 5bf7f1e310..970f05414c 100644
--- a/engines/lure/hotspots.h
+++ b/engines/lure/hotspots.h
@@ -1,5 +1,8 @@
-/* ScummVM - Scumm Interpreter
- * Copyright (C) 2005-2006 The ScummVM project
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
diff --git a/engines/lure/intro.cpp b/engines/lure/intro.cpp
index c50c5bd8ef..e8107e2f1a 100644
--- a/engines/lure/intro.cpp
+++ b/engines/lure/intro.cpp
@@ -1,5 +1,8 @@
-/* ScummVM - Scumm Interpreter
- * Copyright (C) 2005-2006 The ScummVM project
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
diff --git a/engines/lure/intro.h b/engines/lure/intro.h
index 1a14ae1ec1..769081fdda 100644
--- a/engines/lure/intro.h
+++ b/engines/lure/intro.h
@@ -1,5 +1,8 @@
-/* ScummVM - Scumm Interpreter
- * Copyright (C) 2005-2006 The ScummVM project
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
diff --git a/engines/lure/lure.cpp b/engines/lure/lure.cpp
index f28dc00954..6b28753fd1 100644
--- a/engines/lure/lure.cpp
+++ b/engines/lure/lure.cpp
@@ -1,5 +1,8 @@
-/* ScummVM - Scumm Interpreter
- * Copyright (C) 2005-2006 The ScummVM project
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -141,8 +144,8 @@ bool LureEngine::saveGame(uint8 slotNumber, Common::String &caption) {
f->writeString(caption);
f->writeByte(0); // End of string terminator
- Room::getReference().saveToStream(f);
Resources::getReference().saveToStream(f);
+ Room::getReference().saveToStream(f);
delete f;
return true;
@@ -182,8 +185,8 @@ bool LureEngine::loadGame(uint8 slotNumber) {
while (f->readByte() != 0) ;
// Load in the data
- Room::getReference().loadFromStream(f);
Resources::getReference().loadFromStream(f);
+ Room::getReference().loadFromStream(f);
delete f;
return true;
diff --git a/engines/lure/lure.h b/engines/lure/lure.h
index 40405ae7a3..010361573a 100644
--- a/engines/lure/lure.h
+++ b/engines/lure/lure.h
@@ -1,5 +1,8 @@
-/* ScummVM - Scumm Interpreter
- * Copyright (C) 2005-2006 The ScummVM project
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
diff --git a/engines/lure/luredefs.h b/engines/lure/luredefs.h
index 1419c1b4cb..62c5490c8c 100644
--- a/engines/lure/luredefs.h
+++ b/engines/lure/luredefs.h
@@ -1,5 +1,8 @@
-/* ScummVM - Scumm Interpreter
- * Copyright (C) 2005-2006 The ScummVM project
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -259,6 +262,7 @@ enum Action {
#define TALK_RESPONSE_MAGIC_ID 0x1092
// Misc constants
+#define GENERAL_MAGIC_ID 42
#define VOICE_ANIM_ID 0x5810
#define PUZZLED_ANIM_ID 0x8001
#define EXCLAMATION_ANIM_ID 0x8002
diff --git a/engines/lure/memory.cpp b/engines/lure/memory.cpp
index 8580aaed9e..43b6519b11 100644
--- a/engines/lure/memory.cpp
+++ b/engines/lure/memory.cpp
@@ -1,5 +1,8 @@
-/* ScummVM - Scumm Interpreter
- * Copyright (C) 2005-2006 The ScummVM project
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
diff --git a/engines/lure/memory.h b/engines/lure/memory.h
index 7a7bb5e120..0bbefadec7 100644
--- a/engines/lure/memory.h
+++ b/engines/lure/memory.h
@@ -1,5 +1,8 @@
-/* ScummVM - Scumm Interpreter
- * Copyright (C) 2005-2006 The ScummVM project
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
diff --git a/engines/lure/menu.cpp b/engines/lure/menu.cpp
index 739e475f48..9c8a26a3f2 100644
--- a/engines/lure/menu.cpp
+++ b/engines/lure/menu.cpp
@@ -1,5 +1,8 @@
-/* ScummVM - Scumm Interpreter
- * Copyright (C) 2005-2006 The ScummVM project
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
diff --git a/engines/lure/menu.h b/engines/lure/menu.h
index ce87bc7227..6a639f7ec5 100644
--- a/engines/lure/menu.h
+++ b/engines/lure/menu.h
@@ -1,5 +1,8 @@
-/* ScummVM - Scumm Interpreter
- * Copyright (C) 2005-2006 The ScummVM project
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
diff --git a/engines/lure/palette.cpp b/engines/lure/palette.cpp
index e4d8db0a41..7191acd133 100644
--- a/engines/lure/palette.cpp
+++ b/engines/lure/palette.cpp
@@ -1,5 +1,8 @@
-/* ScummVM - Scumm Interpreter
- * Copyright (C) 2005-2006 The ScummVM project
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
diff --git a/engines/lure/palette.h b/engines/lure/palette.h
index 274df607e6..fedb3b9570 100644
--- a/engines/lure/palette.h
+++ b/engines/lure/palette.h
@@ -1,5 +1,8 @@
-/* ScummVM - Scumm Interpreter
- * Copyright (C) 2005-2006 The ScummVM project
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
diff --git a/engines/lure/res.cpp b/engines/lure/res.cpp
index 5782ccdecb..3c183ebafc 100644
--- a/engines/lure/res.cpp
+++ b/engines/lure/res.cpp
@@ -1,5 +1,8 @@
-/* ScummVM - Scumm Interpreter
- * Copyright (C) 2005-2006 The ScummVM project
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -315,7 +318,7 @@ void Resources::reloadData() {
delete mb;
// Initialise delay list
- _delayList.clear();
+ _delayList.clear(true);
// Load miscellaneous data
_cursors = d.getEntry(CURSOR_RESOURCE_ID);
@@ -651,6 +654,7 @@ void Resources::saveToStream(Common::WriteStream *stream)
_barmanLists.saveToStream(stream);
_exitJoins.saveToStream(stream);
_roomData.saveToStream(stream);
+ _delayList.saveToStream(stream);
}
void Resources::loadFromStream(Common::ReadStream *stream) {
@@ -668,6 +672,8 @@ void Resources::loadFromStream(Common::ReadStream *stream) {
_exitJoins.loadFromStream(stream);
debugC(ERROR_DETAILED, kLureDebugScripts, "Loading walkable paths");
_roomData.loadFromStream(stream);
+ debugC(ERROR_DETAILED, kLureDebugScripts, "Loading delay list");
+ _delayList.loadFromStream(stream);
debugC(ERROR_DETAILED, kLureDebugScripts, "Finished loading");
}
diff --git a/engines/lure/res.h b/engines/lure/res.h
index 7ee89f57b9..7c9970f27f 100644
--- a/engines/lure/res.h
+++ b/engines/lure/res.h
@@ -1,5 +1,8 @@
-/* ScummVM - Scumm Interpreter
- * Copyright (C) 2005-2006 The ScummVM project
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
diff --git a/engines/lure/res_struct.cpp b/engines/lure/res_struct.cpp
index 8c68462bf6..1ca4394ad3 100644
--- a/engines/lure/res_struct.cpp
+++ b/engines/lure/res_struct.cpp
@@ -1,5 +1,8 @@
-/* ScummVM - Scumm Interpreter
- * Copyright (C) 2005-2006 The ScummVM project
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -67,6 +70,12 @@ BarEntry barList[3] = {
&ewanExtraGraphic1[0], &ewanExtraGraphic2[0]}, 16, NULL}
};
+RoomTranslationRecord roomTranslations[] = {
+ {0x1E, 0x13}, {0x07, 0x08}, {0x1C, 0x12}, {0x26, 0x0F},
+ {0x27, 0x0F}, {0x28, 0x0F}, {0x29, 0x0F}, {0x22, 0x0A},
+ {0x23, 0x13}, {0x24, 0x14}, {0x31, 0x2C}, {0x2F, 0x2C},
+ {0, 0}};
+
// Room data holding class
RoomData::RoomData(RoomResource *rec, MemoryBlock *pathData) {
@@ -701,12 +710,20 @@ RoomExitCoordinateData &RoomExitCoordinates::getData(uint16 destRoomNumber) {
SequenceDelayData::SequenceDelayData(uint16 delay, uint16 seqOffset, bool canClearFlag) {
OSystem &system = *g_system;
- // The delay is in number of ticks (1/18th of a second) - convert to milliseconds
- timeoutCtr = system.getMillis() + (delay * 1000 / 18);
+ // The delay is in number of seconds
+ timeoutCtr = system.getMillis() + delay * 1000;
sequenceOffset = seqOffset;
canClear = canClearFlag;
}
+SequenceDelayData *SequenceDelayData::load(uint32 delay, uint16 seqOffset, bool canClearFlag) {
+ SequenceDelayData *result = new SequenceDelayData();
+ result->sequenceOffset = seqOffset;
+ result->timeoutCtr = delay;
+ result->canClear = canClearFlag;
+ return result;
+}
+
void SequenceDelayList::add(uint16 delay, uint16 seqOffset, bool canClear) {
SequenceDelayData *entry = new SequenceDelayData(delay, seqOffset, canClear);
push_front(entry);
@@ -728,18 +745,45 @@ void SequenceDelayList::tick() {
}
}
-void SequenceDelayList::clear() {
+void SequenceDelayList::clear(bool forceClear) {
SequenceDelayList::iterator i = begin();
while (i != end()) {
SequenceDelayData *entry = *i;
- if (entry->canClear)
+ if (entry->canClear || forceClear)
i = erase(i);
else
++i;
}
}
+void SequenceDelayList::saveToStream(WriteStream *stream) {
+ uint32 currTime = g_system->getMillis();
+ SequenceDelayList::iterator i;
+
+ for (i = begin(); i != end(); ++i) {
+ SequenceDelayData *entry = *i;
+ stream->writeUint16LE(entry->sequenceOffset);
+ stream->writeUint32LE((currTime > entry->timeoutCtr ) ? 0 :
+ entry->timeoutCtr - currTime);
+ stream->writeByte(entry->canClear);
+ }
+
+ stream->writeUint16LE(0);
+}
+
+void SequenceDelayList::loadFromStream(ReadStream *stream) {
+ clear(true);
+ uint16 seqOffset;
+ uint32 currTime = g_system->getMillis();
+
+ while ((seqOffset = stream->readUint16LE()) != 0) {
+ uint32 delay = currTime + stream->readUint32LE();
+ bool canClear = stream->readByte() != 0;
+ push_back(SequenceDelayData::load(delay, seqOffset, canClear));
+ }
+}
+
// The following classes hold the NPC schedule classes
CharacterScheduleEntry::CharacterScheduleEntry(Action theAction, ...) {
diff --git a/engines/lure/res_struct.h b/engines/lure/res_struct.h
index f53f8dd9a0..55907e4c12 100644
--- a/engines/lure/res_struct.h
+++ b/engines/lure/res_struct.h
@@ -1,5 +1,8 @@
-/* ScummVM - Scumm Interpreter
- * Copyright (C) 2005-2006 The ScummVM project
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -589,8 +592,11 @@ public:
// The following classes hold any sequence offsets that are being delayed
class SequenceDelayData {
+private:
+ SequenceDelayData() {};
public:
SequenceDelayData(uint16 delay, uint16 seqOffset, bool canClearFlag);
+ static SequenceDelayData *load(uint32 delay, uint16 seqOffset, bool canClearFlag);
uint32 timeoutCtr;
uint16 sequenceOffset;
@@ -601,7 +607,10 @@ class SequenceDelayList: public ManagedList<SequenceDelayData *> {
public:
void add(uint16 delay, uint16 seqOffset, bool canClear);
void tick();
- void clear();
+ void clear(bool forceClear = false);
+
+ void saveToStream(WriteStream *stream);
+ void loadFromStream(ReadStream *stream);
};
// The following classes holds the data for NPC schedules
@@ -732,6 +741,13 @@ public:
enum BarmanAction {WALK_AROUND = 1, POLISH_BAR = 2, WAIT = 3, WAIT_DIALOG = 4, SERVE_BEER = 5};
+struct RoomTranslationRecord {
+ uint8 srcRoom;
+ uint8 destRoom;
+};
+
+extern RoomTranslationRecord roomTranslations[];
+
enum StringEnum {S_CREDITS = 25, S_RESTART_GAME = 26, S_SAVE_GAME = 27, S_RESTORE_GAME = 28,
S_QUIT = 29, S_FAST_TEXT = 30, S_SLOW_TEXT = 31, S_SOUND_ON = 32, S_SOUND_OFF = 33,
S_NOTHING = 34, S_FOR = 35, S_TO = 36, S_ON = 37, S_AND_THEN = 38,
diff --git a/engines/lure/room.cpp b/engines/lure/room.cpp
index f0da874987..a2abd3565d 100644
--- a/engines/lure/room.cpp
+++ b/engines/lure/room.cpp
@@ -1,5 +1,8 @@
-/* ScummVM - Scumm Interpreter
- * Copyright (C) 2005-2006 The ScummVM project
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
diff --git a/engines/lure/room.h b/engines/lure/room.h
index 9094de722d..d991f36c92 100644
--- a/engines/lure/room.h
+++ b/engines/lure/room.h
@@ -1,5 +1,8 @@
-/* ScummVM - Scumm Interpreter
- * Copyright (C) 2005-2006 The ScummVM project
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
diff --git a/engines/lure/screen.cpp b/engines/lure/screen.cpp
index ad84c9e838..8477c0def4 100644
--- a/engines/lure/screen.cpp
+++ b/engines/lure/screen.cpp
@@ -1,5 +1,8 @@
-/* ScummVM - Scumm Interpreter
- * Copyright (C) 2005-2006 The ScummVM project
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
diff --git a/engines/lure/screen.h b/engines/lure/screen.h
index 8accfaeea1..9197f64a8d 100644
--- a/engines/lure/screen.h
+++ b/engines/lure/screen.h
@@ -1,5 +1,8 @@
-/* ScummVM - Scumm Interpreter
- * Copyright (C) 2005-2006 The ScummVM project
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
diff --git a/engines/lure/scripts.cpp b/engines/lure/scripts.cpp
index 6e651fbc68..b3856e5ce3 100644
--- a/engines/lure/scripts.cpp
+++ b/engines/lure/scripts.cpp
@@ -1,5 +1,8 @@
-/* ScummVM - Scumm Interpreter
- * Copyright (C) 2005-2006 The ScummVM project
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -463,6 +466,34 @@ void Script::decreaseNumGroats(uint16 characterId, uint16 numGroats, uint16 v3)
fields.numGroats() -= numGroats;
}
+// Sets a character moving to the player's room (if they're not already there)
+
+void Script::moveCharacterToPlayer(uint16 characterId, uint16 v2, uint16 v3) {
+ Resources &res = Resources::getReference();
+ Hotspot *playerHotspot = res.getActiveHotspot(PLAYER_ID);
+ Hotspot *charHotspot = res.getActiveHotspot(characterId);
+ assert(charHotspot);
+
+ // If character in same room as player, then no need to do anything
+ if (!charHotspot->currentActions().isEmpty() &&
+ (charHotspot->currentActions().top().roomNumber() == playerHotspot->roomNumber()))
+ return;
+
+ uint16 destRoom = playerHotspot->roomNumber();
+ RoomTranslationRecord *rec;
+ for (rec = &roomTranslations[0]; rec->srcRoom != 0; ++rec) {
+ if (rec->srcRoom == destRoom) {
+ destRoom = rec->destRoom;
+ break;
+ }
+ }
+
+ if (charHotspot->currentActions().isEmpty())
+ charHotspot->currentActions().addFront(DISPATCH_ACTION, destRoom);
+ else
+ charHotspot->currentActions().top().setRoomNumber(destRoom);
+}
+
// Sets the tick handler for the village Skorl to an alternate handler
void Script::setVillageSkorlTickProc(uint16 v1, uint16 v2, uint16 v3) {
@@ -510,6 +541,13 @@ void Script::enableGargoylesTalk(uint16 v1, uint16 v2, uint16 v3) {
g2->actions = 1 << (TALK_TO - 1);
}
+// Flags the player as dead
+
+void Script::killPlayer(uint16 v1, uint16 v2, uint16 v3) {
+ Game &game = Game::getReference();
+ game.setState(GS_RESTORE_RESTART);
+}
+
// Loads the specified animation, completely bypassing the standard process
// of checking for a load proc/sequence
@@ -600,11 +638,13 @@ SequenceMethodRecord scriptMethods[] = {
{49, Script::setSupportData},
{50, Script::givePlayerItem},
{51, Script::decreaseNumGroats},
+ {53, Script::moveCharacterToPlayer},
{54, Script::setVillageSkorlTickProc},
{55, Script::freeGoewin},
{56, Script::barmanServe},
{57, Script::getNumGroats},
{59, Script::enableGargoylesTalk},
+ {61, Script::killPlayer},
{62, Script::animationLoad},
{63, Script::addActions},
{64, Script::randomToGeneral},
diff --git a/engines/lure/scripts.h b/engines/lure/scripts.h
index e964328130..b0cda0b74b 100644
--- a/engines/lure/scripts.h
+++ b/engines/lure/scripts.h
@@ -1,5 +1,8 @@
-/* ScummVM - Scumm Interpreter
- * Copyright (C) 2005-2006 The ScummVM project
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -118,11 +121,13 @@ public:
static void setSupportData(uint16 hotspotId, uint16 index, uint16 v3);
static void givePlayerItem(uint16 hotspotId, uint16 v2, uint16 v3);
static void decreaseNumGroats(uint16 characterId, uint16 numGroats, uint16 v3);
+ static void moveCharacterToPlayer(uint16 characterId, uint16 v2, uint16 v3);
static void setVillageSkorlTickProc(uint16 v1, uint16 v2, uint16 v3);
static void freeGoewin(uint16 v1, uint16 v2, uint16 v3);
static void barmanServe(uint16 v1, uint16 v2, uint16 v3);
static void getNumGroats(uint16 v1, uint16 v2, uint16 v3);
static void enableGargoylesTalk(uint16 v1, uint16 v2, uint16 v3);
+ static void killPlayer(uint16 v1, uint16 v2, uint16 v3);
static void animationLoad(uint16 hotspotId, uint16 v2, uint16 v3);
static void addActions(uint16 hotspotId, uint16 actions, uint16 v3);
static void randomToGeneral(uint16 maxVal, uint16 minVal, uint16 v3);
diff --git a/engines/lure/strings.cpp b/engines/lure/strings.cpp
index 77f1471379..51840a7e9c 100644
--- a/engines/lure/strings.cpp
+++ b/engines/lure/strings.cpp
@@ -1,5 +1,8 @@
-/* ScummVM - Scumm Interpreter
- * Copyright (C) 2005-2006 The ScummVM project
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
diff --git a/engines/lure/strings.h b/engines/lure/strings.h
index 1947a14b82..29e851a641 100644
--- a/engines/lure/strings.h
+++ b/engines/lure/strings.h
@@ -1,5 +1,8 @@
-/* ScummVM - Scumm Interpreter
- * Copyright (C) 2005-2006 The ScummVM project
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
diff --git a/engines/lure/surface.cpp b/engines/lure/surface.cpp
index d0444391d7..b7baf53a76 100644
--- a/engines/lure/surface.cpp
+++ b/engines/lure/surface.cpp
@@ -1,5 +1,8 @@
-/* ScummVM - Scumm Interpreter
- * Copyright (C) 2005-2006 The ScummVM project
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
diff --git a/engines/lure/surface.h b/engines/lure/surface.h
index 2155f1b820..f97666d1e7 100644
--- a/engines/lure/surface.h
+++ b/engines/lure/surface.h
@@ -1,5 +1,8 @@
-/* ScummVM - Scumm Interpreter
- * Copyright (C) 2005-2006 The ScummVM project
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License