aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Page2008-06-05 21:20:35 +0000
committerChristopher Page2008-06-05 21:20:35 +0000
commitcae6396ce76991e240b1e23bbcff0b6d6960f9a0 (patch)
tree58ea9c6a42d7bf3655e775e3a26f6739e9daffe1
parent18b892e534c9fedf60a57c71e0978965d353fd60 (diff)
parent3c7e0f5f8dc39e27619f7d23d060264db8d906d3 (diff)
downloadscummvm-rg350-cae6396ce76991e240b1e23bbcff0b6d6960f9a0.tar.gz
scummvm-rg350-cae6396ce76991e240b1e23bbcff0b6d6960f9a0.tar.bz2
scummvm-rg350-cae6396ce76991e240b1e23bbcff0b6d6960f9a0.zip
Merged revisions 32507-32513,32516,32518,32520-32521,32523-32524,32526-32548,32550-32562 via svnmerge from
https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk svn-id: r32563
-rw-r--r--AUTHORS13
-rw-r--r--Makefile2
-rw-r--r--backends/fs/ds/ds-fs.cpp2
-rw-r--r--backends/fs/ds/ds-fs.h2
-rw-r--r--backends/fs/wii/wii-fs-factory.cpp (renamed from engines/cruise/stringSupport.h)34
-rw-r--r--backends/fs/wii/wii-fs-factory.h (renamed from engines/cruise/stringSupport.cpp)34
-rw-r--r--backends/fs/wii/wii-fs.cpp196
-rw-r--r--backends/module.mk1
-rw-r--r--backends/platform/ds/arm9/makefile2
-rw-r--r--backends/platform/sdl/events.cpp2
-rw-r--r--backends/platform/sdl/sdl.cpp2
-rw-r--r--backends/platform/wii/Makefile156
-rw-r--r--backends/platform/wii/gecko_console.cpp91
-rw-r--r--backends/platform/wii/gecko_console.h14
-rw-r--r--backends/platform/wii/gx_supp.cpp264
-rw-r--r--backends/platform/wii/gx_supp.h39
-rw-r--r--backends/platform/wii/main.cpp88
-rw-r--r--backends/platform/wii/osystem.cpp188
-rw-r--r--backends/platform/wii/osystem.h163
-rw-r--r--backends/platform/wii/osystem_events.cpp262
-rw-r--r--backends/platform/wii/osystem_gfx.cpp453
-rw-r--r--backends/platform/wii/osystem_sfx.cpp133
-rw-r--r--common/rect.h2
-rw-r--r--common/scummsys.h8
-rw-r--r--common/system.cpp2
-rwxr-xr-xconfigure6
-rw-r--r--dists/msvc7/cruise.vcproj6
-rw-r--r--dists/msvc71/cruise.vcproj6
-rw-r--r--dists/msvc8/cruise.vcproj8
-rw-r--r--dists/msvc9/cruise.vcproj8
-rw-r--r--dists/wii/READMII64
-rw-r--r--dists/wii/icon.pngbin0 -> 12233 bytes
-rw-r--r--dists/wii/meta.xml12
-rw-r--r--engines/cruise/cruise_main.h1
-rw-r--r--engines/cruise/module.mk1
-rw-r--r--engines/drascula/animation.cpp675
-rw-r--r--engines/drascula/drascula.cpp1294
-rw-r--r--engines/drascula/drascula.h449
-rw-r--r--engines/drascula/rooms.cpp1231
-rw-r--r--engines/drascula/staticdata.h624
-rw-r--r--engines/drascula/talk.cpp188
-rw-r--r--engines/kyra/kyra_mr.cpp8
-rw-r--r--engines/kyra/resource.cpp43
-rw-r--r--engines/kyra/resource.h4
-rw-r--r--engines/kyra/sound.cpp12
-rw-r--r--engines/kyra/sound.h17
-rw-r--r--engines/kyra/sound_digital.cpp164
-rw-r--r--engines/parallaction/disk.h2
-rw-r--r--engines/parallaction/disk_br.cpp27
-rw-r--r--engines/parallaction/exec_br.cpp3
-rw-r--r--engines/parallaction/graphics.cpp4
-rw-r--r--engines/parallaction/graphics.h3
-rw-r--r--engines/parallaction/parallaction.h3
-rw-r--r--engines/parallaction/parallaction_br.cpp29
-rw-r--r--engines/parallaction/parallaction_ns.cpp2
-rw-r--r--engines/parallaction/parser.h19
-rw-r--r--engines/parallaction/parser_br.cpp8
-rw-r--r--engines/parallaction/parser_ns.cpp9
-rw-r--r--engines/saga/detection.cpp4
-rw-r--r--engines/saga/interface.cpp19
-rw-r--r--engines/saga/interface.h5
-rw-r--r--engines/saga/saga.h10
-rw-r--r--engines/sword2/header.h18
-rw-r--r--engines/sword2/object.h12
-rw-r--r--engines/sword2/screen.h2
-rw-r--r--gui/credits.h3
-rw-r--r--gui/eval.cpp2
-rwxr-xr-xtools/credits.pl4
68 files changed, 4639 insertions, 2523 deletions
diff --git a/AUTHORS b/AUTHORS
index 7ebe8f1af7..2491f481a2 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -81,14 +81,14 @@ ScummVM Team
Paul Gilbert
M4:
- Torbjorn Andersson
+ Torbjorn Andersson
Paul Gilbert
- Benjamin Haisch
- Filippos Karapetis
+ Benjamin Haisch
+ Filippos Karapetis
MADE:
- Benjamin Haisch
-
+ Benjamin Haisch
+
Parallaction:
peres
@@ -139,6 +139,9 @@ ScummVM Team
Jurgen Braam
Lars Persson
+ Wii:
+ Andre Heider
+
Other subsystems
----------------
Infrastructure:
diff --git a/Makefile b/Makefile
index d230120bb0..506265032a 100644
--- a/Makefile
+++ b/Makefile
@@ -24,7 +24,7 @@ CXXFLAGS:= -Wall $(CXXFLAGS)
# Turn off some annoying and not-so-useful warnings
CXXFLAGS+= -Wno-long-long -Wno-multichar -Wno-unknown-pragmas -Wno-reorder
# Enable even more warnings...
-CXXFLAGS+= -pedantic -Wpointer-arith -Wcast-qual -Wcast-align -Wconversion
+CXXFLAGS+= -pedantic -Wpointer-arith -Wcast-qual -Wcast-align
CXXFLAGS+= -Wshadow -Wimplicit -Wundef -Wnon-virtual-dtor -Wwrite-strings
# Disable RTTI and exceptions, and enabled checking of pointers returned by "new"
diff --git a/backends/fs/ds/ds-fs.cpp b/backends/fs/ds/ds-fs.cpp
index 79b957f2e2..cffe4c118d 100644
--- a/backends/fs/ds/ds-fs.cpp
+++ b/backends/fs/ds/ds-fs.cpp
@@ -25,7 +25,7 @@
//#include <NDS/ARM9/console.h> //basic print funcionality
#include "backends/fs/ds/ds-fs.h"
#include "dsmain.h"
-#include "gba_nds_fat.h"
+#include "fat/gba_nds_fat.h"
diff --git a/backends/fs/ds/ds-fs.h b/backends/fs/ds/ds-fs.h
index 21dfa00667..9ac453aca9 100644
--- a/backends/fs/ds/ds-fs.h
+++ b/backends/fs/ds/ds-fs.h
@@ -28,7 +28,7 @@
#include "zipreader.h"
#include "ramsave.h"
#include "scummconsole.h"
-#include "gba_nds_fat.h"
+#include "fat/gba_nds_fat.h"
#include "backends/fs/abstract-fs.h"
namespace DS {
diff --git a/engines/cruise/stringSupport.h b/backends/fs/wii/wii-fs-factory.cpp
index c7cdb8efd9..9839858dd5 100644
--- a/engines/cruise/stringSupport.h
+++ b/backends/fs/wii/wii-fs-factory.cpp
@@ -8,26 +8,42 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* 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$
- *
*/
-#ifndef CRUISE_STRING_SUPPORT_H
-#define CRSUIE_STRING_SUPPORT_H
+#if defined(__WII__)
-namespace Cruise {
+#include <unistd.h>
-} // End of namespace Cruise
+#include "backends/fs/wii/wii-fs-factory.h"
+#include "backends/fs/wii/wii-fs.cpp"
+DECLARE_SINGLETON(WiiFilesystemFactory);
+
+AbstractFilesystemNode *WiiFilesystemFactory::makeRootFileNode() const {
+ return new WiiFilesystemNode();
+}
+
+AbstractFilesystemNode *WiiFilesystemFactory::makeCurrentDirectoryFileNode() const {
+ char buf[MAXPATHLEN];
+
+ if (getcwd(buf, MAXPATHLEN))
+ return new WiiFilesystemNode(buf, true);
+ else
+ return new WiiFilesystemNode();
+}
+
+AbstractFilesystemNode *WiiFilesystemFactory::makeFileNodePath(const String &path) const {
+ return new WiiFilesystemNode(path, true);
+}
#endif
+
diff --git a/engines/cruise/stringSupport.cpp b/backends/fs/wii/wii-fs-factory.h
index 7712f1e172..24badee330 100644
--- a/engines/cruise/stringSupport.cpp
+++ b/backends/fs/wii/wii-fs-factory.h
@@ -8,23 +8,43 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* 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$
+ */
+
+#ifndef _WII_FILESYSTEM_FACTORY_H_
+#define _WII_FILESYSTEM_FACTORY_H_
+
+#include "common/singleton.h"
+#include "backends/fs/fs-factory.h"
+
+/**
+ * Creates WiiFilesystemNode objects.
*
+ * Parts of this class are documented in the base interface class, FilesystemFactory.
*/
+class WiiFilesystemFactory : public FilesystemFactory, public Common::Singleton<WiiFilesystemFactory> {
+public:
+ typedef Common::String String;
+
+ virtual AbstractFilesystemNode *makeRootFileNode() const;
+ virtual AbstractFilesystemNode *makeCurrentDirectoryFileNode() const;
+ virtual AbstractFilesystemNode *makeFileNodePath(const String &path) const;
+
+protected:
+ WiiFilesystemFactory() {};
-#include "cruise/cruise_main.h"
+private:
+ friend class Common::Singleton<SingletonBaseType>;
+};
-namespace Cruise {
+#endif /*Wii_FILESYSTEM_FACTORY_H*/
-} // End of namespace Cruise
diff --git a/backends/fs/wii/wii-fs.cpp b/backends/fs/wii/wii-fs.cpp
new file mode 100644
index 0000000000..e6d0cf4c7e
--- /dev/null
+++ b/backends/fs/wii/wii-fs.cpp
@@ -0,0 +1,196 @@
+/* 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
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#if defined(__WII__)
+
+#include "backends/fs/abstract-fs.h"
+
+#include <sys/dir.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+/**
+ * Implementation of the ScummVM file system API based on Wii.
+ *
+ * Parts of this class are documented in the base interface class, AbstractFilesystemNode.
+ */
+class WiiFilesystemNode : public AbstractFilesystemNode {
+protected:
+ String _displayName;
+ String _path;
+ bool _isDirectory, _isReadable, _isWritable;
+
+public:
+ /**
+ * Creates a WiiFilesystemNode with the root node as path.
+ */
+ WiiFilesystemNode();
+
+ /**
+ * Creates a WiiFilesystemNode for a given path.
+ *
+ * @param path String with the path the new node should point to.
+ * @param verify true if the isValid and isDirectory flags should be verified during the construction.
+ */
+ WiiFilesystemNode(const String &path, bool verify);
+
+ virtual bool exists() const;
+ virtual String getDisplayName() const { return _displayName; }
+ virtual String getName() const { return _displayName; }
+ virtual String getPath() const { return _path; }
+ virtual bool isDirectory() const { return _isDirectory; }
+ virtual bool isReadable() const { return _isReadable; }
+ virtual bool isWritable() const { return _isWritable; }
+
+ virtual AbstractFilesystemNode *getChild(const String &n) const;
+ virtual bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const;
+ virtual AbstractFilesystemNode *getParent() const;
+
+private:
+ virtual void setFlags();
+};
+
+/**
+ * Returns the last component of a given path.
+ *
+ * Examples:
+ * /foo/bar.txt would return /bar.txt
+ * /foo/bar/ would return /bar/
+ *
+ * @param str String containing the path.
+ * @return Pointer to the first char of the last component inside str.
+ */
+const char *lastPathComponent(const Common::String &str) {
+ if(str.empty())
+ return "";
+
+ const char *start = str.c_str();
+ const char *cur = start + str.size() - 2;
+
+ while (cur >= start && *cur != '/') {
+ --cur;
+ }
+
+ return cur + 1;
+}
+
+void WiiFilesystemNode::setFlags() {
+ struct stat st;
+
+ _isDirectory = false;
+ _isReadable = false;
+ _isWritable = false;
+
+ if (!stat(_path.c_str(), &st)) {
+ _isDirectory = S_ISDIR(st.st_mode);
+ _isReadable = (st.st_mode & S_IRUSR) > 0;
+ _isWritable = (st.st_mode & S_IWUSR) > 0;
+ }
+}
+
+
+WiiFilesystemNode::WiiFilesystemNode() {
+ // The root dir.
+ _path = "fat:/";
+ _displayName = _path;
+
+ setFlags();
+}
+
+WiiFilesystemNode::WiiFilesystemNode(const String &p, bool verify) {
+ assert(p.size() > 0);
+
+ _path = p;
+
+ _displayName = lastPathComponent(_path);
+
+ if (verify)
+ setFlags();
+}
+
+bool WiiFilesystemNode::exists() const {
+ struct stat st;
+ return stat(_path.c_str (), &st) == 0;
+}
+
+AbstractFilesystemNode *WiiFilesystemNode::getChild(const String &n) const {
+ assert(_isDirectory);
+
+ String newPath(_path);
+ if (newPath.lastChar() != '/')
+ newPath += '/';
+ newPath += n;
+
+ return new WiiFilesystemNode(newPath, true);
+}
+
+bool WiiFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, bool hidden) const {
+ assert(_isDirectory);
+
+ DIR_ITER* dp = diropen (_path.c_str());
+
+ if (dp == NULL)
+ return false;
+
+ char filename[MAXPATHLEN];
+ struct stat st;
+
+ while (dirnext(dp, filename, &st) == 0) {
+ if (strcmp(filename, ".") == 0 || strcmp(filename, "..") == 0)
+ continue;
+
+ String newPath(_path);
+ if (newPath.lastChar() != '/')
+ newPath += '/';
+ newPath += filename;
+
+ bool isDir = S_ISDIR(st.st_mode);
+
+ if ((mode == FilesystemNode::kListFilesOnly && isDir) ||
+ (mode == FilesystemNode::kListDirectoriesOnly && !isDir))
+ continue;
+
+ if (isDir)
+ newPath += '/';
+
+ myList.push_back(new WiiFilesystemNode(newPath, true));
+ }
+
+ dirclose(dp);
+
+ return true;
+}
+
+AbstractFilesystemNode *WiiFilesystemNode::getParent() const {
+ if (_path == "/")
+ return 0;
+
+ const char *start = _path.c_str();
+ const char *end = lastPathComponent(_path);
+
+ return new WiiFilesystemNode(String(start, end - start), true);
+}
+
+#endif //#if defined(__WII__)
+
diff --git a/backends/module.mk b/backends/module.mk
index 187cc83ee9..6642a3a281 100644
--- a/backends/module.mk
+++ b/backends/module.mk
@@ -9,6 +9,7 @@ MODULE_OBJS := \
fs/psp/psp-fs-factory.o \
fs/symbian/symbian-fs-factory.o \
fs/windows/windows-fs-factory.o \
+ fs/wii/wii-fs-factory.o \
events/default/default-events.o \
midi/alsa.o \
midi/camd.o \
diff --git a/backends/platform/ds/arm9/makefile b/backends/platform/ds/arm9/makefile
index 1a4d61113e..7472a32218 100644
--- a/backends/platform/ds/arm9/makefile
+++ b/backends/platform/ds/arm9/makefile
@@ -182,7 +182,7 @@ endif
LDFLAGS = -specs=ds_arm9.specs -mthumb-interwork -Wl,--wrap,time -mno-fpu -Wl,-Map,map.txt
-INCLUDES= -I./ -I$(portdir)/$(BUILD) -I$(srcdir) -I$(srcdir)/common -I$(portdir)/source -I$(portdir)/source/fat \
+INCLUDES= -I./ -I$(portdir)/$(BUILD) -I$(srcdir) -I$(srcdir)/common -I$(portdir)/source \
-I$(portdir)/data -I$(libndsdir)/include -I$(portdir)/../commoninclude\
-I$(libndsdir)/include -I$(libndsdir)/include/nds -I$(srcdir)/engines -I$(portdir)/source/mad\
-I$(portdir)/source/libcartreset -include $(srcdir)/common/scummsys.h
diff --git a/backends/platform/sdl/events.cpp b/backends/platform/sdl/events.cpp
index 9a0a33f45c..a4a72ca380 100644
--- a/backends/platform/sdl/events.cpp
+++ b/backends/platform/sdl/events.cpp
@@ -148,7 +148,7 @@ void OSystem_SDL::handleKbdMouse() {
_km.y_down_count = 1;
}
- SDL_WarpMouse(_km.x, _km.y);
+ SDL_WarpMouse((Uint16)_km.x, (Uint16)_km.y);
}
}
}
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index b750864ad8..be3aaad926 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -406,7 +406,7 @@ bool OSystem_SDL::setSoundCallback(SoundProc proc, void *param) {
// about 1/32th of a second. Note that it must be a power of two.
// So e.g. at 22050 Hz, we request a sample buffer size of 2048.
int samples = 8192;
- while (32 * samples >= _samplesPerSec) {
+ while (16 * samples >= _samplesPerSec) {
samples >>= 1;
}
diff --git a/backends/platform/wii/Makefile b/backends/platform/wii/Makefile
new file mode 100644
index 0000000000..0654fa254d
--- /dev/null
+++ b/backends/platform/wii/Makefile
@@ -0,0 +1,156 @@
+DEBUG_WII = 1
+
+ENABLE_SCUMM = 1
+ENABLE_SCUMM_7_8 = 1
+ENABLE_HE = 1
+# ENABLE_AGI = 1
+ENABLE_AGOS = 1
+ENABLE_CINE = 1
+ENABLE_CRUISE = 1
+ENABLE_DRASCULA = 1
+ENABLE_GOB = 1
+ENABLE_IGOR = 1
+ENABLE_KYRA = 1
+ENABLE_LURE = 1
+ENABLE_M4 = 1
+ENABLE_MADE = 1
+ENABLE_PARALLACTION = 1
+ENABLE_QUEEN = 1
+ENABLE_SAGA = 1
+ENABLE_SKY = 1
+ENABLE_SWORD1 = 1
+ENABLE_SWORD2 = 1
+ENABLE_TOUCHE = 1
+
+DISABLE_HQ_SCALERS = 1
+DISABLE_SCALERS = 1
+
+USE_ZLIB = 1
+USE_MAD = 1
+USE_TREMOR = 1
+USE_FLAC = 1
+USE_MPEG2 = 1
+USE_MT32EMU = 1
+
+srcdir = ../../..
+VPATH = $(srcdir)
+HAVE_GCC3 = 1
+
+DISTPATH = $(srcdir)/dists/wii
+
+ifeq ($(strip $(DEVKITPPC)),)
+$(error "Please set DEVKITPPC in your environment. export DEVKITPPC=<path to>devkitPPC")
+endif
+
+PREFIX = $(DEVKITPPC)/bin/powerpc-gekko-
+CXX = $(PREFIX)g++
+AS = $(PREFIX)gcc
+LD = $(PREFIX)gcc
+AR = $(PREFIX)ar cru
+RANLIB = $(PREFIX)ranlib
+STRIP = $(PREFIX)strip -g
+OBJCOPY = $(PREFIX)objcopy
+MKDIR = mkdir -p
+RM = rm -f
+CP = cp -f
+
+TARGET = scummvm-wii
+
+MACHDEP = -DGEKKO -mrvl -mcpu=750 -meabi -mhard-float \
+ -ffunction-sections -fdata-sections -fmodulo-sched
+
+INCDIR = $(srcdir) . $(srcdir)/engines/ $(DEVKITPRO)/libogc/include
+LIBDIR = $(DEVKITPRO)/libogc/lib/wii
+
+CXXFLAGS = -g -Os -Wall $(MACHDEP) -D__WII__ \
+ -Wno-multichar -fno-exceptions -fno-rtti
+
+CXXFLAGS += $(addprefix -I,$(INCDIR))
+LDFLAGS = -g $(MACHDEP) -Wl,-Map,$(TARGET).elf.map
+LDFLAGS += $(addprefix -L,$(LIBDIR))
+LIBS = -lstdc++ -lfat -lwiiuse -lbte -logc -lm
+
+CXXFLAGS += -I$(DEVKITPRO)/3rd/wii/include
+LDFLAGS += -L$(DEVKITPRO)/3rd/wii/lib
+
+ifdef DEBUG_WII
+CXXFLAGS += -DDEBUG_WII
+LIBS += -ldb
+endif
+
+ifdef USE_ZLIB
+CXXFLAGS += -DUSE_ZLIB
+LIBS += -lz
+endif
+
+ifdef USE_MAD
+CXXFLAGS += -DUSE_MAD -I$(DEVKITPRO)/libogc/include/mad
+LIBS += -lmad
+endif
+
+ifdef USE_TREMOR
+CXXFLAGS += -DUSE_VORBIS -DUSE_TREMOR
+LIBS += -lvorbisidec
+endif
+
+ifdef USE_FLAC
+CXXFLAGS += -DUSE_FLAC
+LIBS += -lFLAC
+endif
+
+ifdef USE_MPEG2
+CXXFLAGS += -DUSE_MPEG2
+LIBS += -lmpeg2
+endif
+
+ifdef USE_MT32EMU
+CXXFLAGS += -DUSE_MT32EMU
+endif
+
+OBJS := backends/platform/wii/main.o \
+ backends/platform/wii/gecko_console.o \
+ backends/platform/wii/gx_supp.o \
+ backends/platform/wii/osystem.o \
+ backends/platform/wii/osystem_gfx.o \
+ backends/platform/wii/osystem_sfx.o \
+ backends/platform/wii/osystem_events.o
+
+include $(srcdir)/Makefile.common
+
+.PHONY: clean-wii distclean-wii upload dist
+
+all: $(TARGET).dol
+
+$(TARGET).dol: $(TARGET).elf
+ $(OBJCOPY) -O binary $< $@
+
+$(TARGET).elf: $(OBJS)
+ $(LD) $^ $(LDFLAGS) $(LIBS) -o $@
+
+clean: clean-wii
+
+clean-wii:
+ @-$(RM) $(TARGET).elf $(TARGET).elf.map $(TARGET).dol
+
+distclean: distclean-wii
+
+distclean-wii:
+ @-$(RM) dist
+
+upload:
+ $(DEVKITPPC)/bin/wiiload $(TARGET).dol
+
+dist:
+ $(MKDIR) dist/apps/scummvm
+ $(CP) $(TARGET).dol dist/apps/scummvm/boot.dol
+ $(CP) $(DISTPATH)/meta.xml dist/apps/scummvm/
+ $(CP) $(DISTPATH)/icon.png dist/apps/scummvm/
+ $(CP) $(DISTPATH)/READMII dist/apps/scummvm/
+ $(CP) $(srcdir)/AUTHORS dist/apps/scummvm/
+ $(CP) $(srcdir)/COPYING dist/apps/scummvm/
+ $(CP) $(srcdir)/COPYRIGHT dist/apps/scummvm/
+ $(CP) $(srcdir)/NEWS dist/apps/scummvm/
+ $(CP) $(srcdir)/README dist/apps/scummvm/
+ $(CP) $(DIST_FILES_THEMES) dist/apps/scummvm/
+ $(CP) $(DIST_FILES_ENGINEDATA) dist/apps/scummvm/
+
diff --git a/backends/platform/wii/gecko_console.cpp b/backends/platform/wii/gecko_console.cpp
new file mode 100644
index 0000000000..c419f6e7e5
--- /dev/null
+++ b/backends/platform/wii/gecko_console.cpp
@@ -0,0 +1,91 @@
+/*-------------------------------------------------------------
+
+Copyright (C) 2008
+Hector Martin (marcan)
+
+This software is provided 'as-is', without any express or implied
+warranty. In no event will the authors be held liable for any
+damages arising from the use of this software.
+
+Permission is granted to anyone to use this software for any
+purpose, including commercial applications, and to alter it and
+redistribute it freely, subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you
+must not claim that you wrote the original software. If you use
+this software in a product, an acknowledgment in the product
+documentation would be appreciated but is not required.
+
+2. Altered source versions must be plainly marked as such, and
+must not be misrepresented as being the original software.
+
+3. This notice may not be removed or altered from any source
+distribution.
+
+-------------------------------------------------------------*/
+
+#include <stdio.h>
+#include <sys/iosupport.h>
+#include <ogcsys.h>
+#include <gccore.h>
+#include <reent.h>
+
+#include "gecko_console.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+static const devoptab_t *dotab_console;
+int usb_sendbuffer_safe(s32 chn,const void *buffer,int size);
+int usb_sendbuffer(s32 chn,const void *buffer,int size);
+
+int __gecko_write(struct _reent *r,int fd,const char *ptr,int len) {
+ char *tmp = (char*)ptr;
+ u32 level;
+ if(dotab_console)
+ dotab_console->write_r(r,fd,ptr,len);
+
+ if(!tmp || len<=0)
+ return -1;
+ level = IRQ_Disable();
+ usb_sendbuffer(1, ptr, len);
+ IRQ_Restore(level);
+ return len;
+}
+
+const devoptab_t dotab_gecko = {
+ "stdout", // device name
+ 0, // size of file structure
+ NULL, // device open
+ NULL, // device close
+ __gecko_write, // device write
+ NULL, // device read
+ NULL, // device seek
+ NULL, // device fstat
+ NULL, // device stat
+ NULL, // device link
+ NULL, // device unlink
+ NULL, // device chdir
+ NULL, // device rename
+ NULL, // device mkdir
+ 0, // dirStateSize
+ NULL, // device diropen_r
+ NULL, // device dirreset_r
+ NULL, // device dirnext_r
+ NULL, // device dirclose_r
+ NULL // device statvfs_r
+};
+
+void gecko_console_init(int chain) {
+ dotab_console = NULL;
+ if(chain)
+ dotab_console = devoptab_list[STD_OUT];
+ devoptab_list[STD_OUT] = &dotab_gecko;
+ devoptab_list[STD_ERR] = &dotab_gecko;
+}
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/backends/platform/wii/gecko_console.h b/backends/platform/wii/gecko_console.h
new file mode 100644
index 0000000000..ba7c393add
--- /dev/null
+++ b/backends/platform/wii/gecko_console.h
@@ -0,0 +1,14 @@
+#ifndef _WII_GECKO_CONSOLE_H_
+#define _WII_GECKO_CONSOLE_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void gecko_console_init(int chain);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/backends/platform/wii/gx_supp.cpp b/backends/platform/wii/gx_supp.cpp
new file mode 100644
index 0000000000..4c7b8ed58a
--- /dev/null
+++ b/backends/platform/wii/gx_supp.cpp
@@ -0,0 +1,264 @@
+/****************************************************************************
+* Generic GX Support for Emulators
+* softdev 2007
+*
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License along
+* with this program; if not, write to the Free Software Foundation, Inc.,
+* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*
+* NGC GX Video Functions
+*
+* These are pretty standard functions to setup and use GX scaling.
+****************************************************************************/
+
+#include <gccore.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <malloc.h>
+
+#define DEFAULT_FIFO_SIZE (256 * 1024)
+
+#define HASPECT 320
+#define VASPECT 240
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*** 2D ***/
+static u32 whichfb;
+static u32 *xfb[2];
+static GXRModeObj *vmode;
+
+/*** 3D GX ***/
+static u8 *gp_fifo;
+
+/*** Texture memory ***/
+static u8 *texturemem;
+static u32 texturesize;
+
+GXTexObj texobj;
+static Mtx view;
+static u16 vwidth, vheight, oldvwidth, oldvheight;
+
+/* New texture based scaler */
+typedef struct tagcamera {
+ Vector pos;
+ Vector up;
+ Vector view;
+} camera;
+
+static s16 square[] ATTRIBUTE_ALIGN(32) = {
+ -HASPECT, VASPECT, 0,
+ HASPECT, VASPECT, 0,
+ HASPECT, -VASPECT, 0,
+ -HASPECT, -VASPECT, 0,
+};
+
+static camera cam = {
+ { 0.0f, 0.0f, 370.0f },
+ { 0.0f, 0.5f, 0.0f },
+ { 0.0f, 0.0f, -0.5f }
+};
+
+void GX_InitVideo() {
+ vmode = VIDEO_GetPreferredMode(NULL);
+ VIDEO_Configure(vmode);
+
+ xfb[0] = (u32 *) MEM_K0_TO_K1 (SYS_AllocateFramebuffer(vmode));
+ xfb[1] = (u32 *) MEM_K0_TO_K1 (SYS_AllocateFramebuffer(vmode));
+ gp_fifo = (u8 *) memalign(32, DEFAULT_FIFO_SIZE);
+
+ VIDEO_ClearFrameBuffer(vmode, xfb[0], COLOR_BLACK);
+ VIDEO_ClearFrameBuffer(vmode, xfb[1], COLOR_BLACK);
+
+ whichfb = 0;
+ VIDEO_SetNextFramebuffer(xfb[whichfb]);
+ VIDEO_SetBlack(FALSE);
+ VIDEO_Flush();
+ VIDEO_WaitVSync();
+
+ if (vmode->viTVMode & VI_NON_INTERLACE)
+ VIDEO_WaitVSync();
+}
+
+/****************************************************************************
+ * Scaler Support Functions
+ ****************************************************************************/
+static void draw_init(void) {
+ GX_ClearVtxDesc();
+ GX_SetVtxDesc(GX_VA_POS, GX_INDEX8);
+ GX_SetVtxDesc(GX_VA_CLR0, GX_INDEX8);
+ GX_SetVtxDesc(GX_VA_TEX0, GX_DIRECT);
+
+ GX_SetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_S16, 0);
+ GX_SetVtxAttrFmt(GX_VTXFMT0, GX_VA_CLR0, GX_CLR_RGBA, GX_RGBA8, 0);
+ GX_SetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_TEX_ST, GX_F32, 0);
+
+ GX_SetArray(GX_VA_POS, square, 3 * sizeof(s16));
+
+ GX_SetNumTexGens(1);
+ GX_SetTexCoordGen(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, GX_IDENTITY);
+
+ GX_InvalidateTexAll();
+
+ GX_InitTexObj(&texobj, texturemem, vwidth, vheight, GX_TF_RGB565,
+ GX_CLAMP, GX_CLAMP, GX_FALSE);
+}
+
+static void draw_vert(u8 pos, u8 c, f32 s, f32 t) {
+ GX_Position1x8(pos);
+ GX_Color1x8(c);
+ GX_TexCoord2f32(s, t);
+}
+
+static void draw_square(Mtx v) {
+ Mtx m;
+ Mtx mv;
+
+ guMtxIdentity(m);
+ guMtxTransApply(m, m, 0, 0, -100);
+ guMtxConcat(v, m, mv);
+
+ GX_LoadPosMtxImm(mv, GX_PNMTX0);
+ GX_Begin(GX_QUADS, GX_VTXFMT0, 4);
+ draw_vert(0, 0, 0.0, 0.0);
+ draw_vert(1, 0, 1.0, 0.0);
+ draw_vert(2, 0, 1.0, 1.0);
+ draw_vert(3, 0, 0.0, 1.0);
+ GX_End();
+}
+
+/****************************************************************************
+ * StartGX
+ ****************************************************************************/
+void GX_Start(u16 width, u16 height, s16 haspect, s16 vaspect) {
+ Mtx p;
+
+ GX_AbortFrame();
+
+ /*** Set new aspect ***/
+ square[0] = square[9] = -haspect;
+ square[3] = square[6] = haspect;
+ square[1] = square[4] = vaspect;
+ square[7] = square[10] = -vaspect;
+
+ /*** Allocate 32byte aligned texture memory ***/
+ texturesize = (width * height) * 2;
+ texturemem = (u8 *) memalign(32, texturesize);
+
+ GXColor gxbackground = { 0, 0, 0, 0xff };
+
+ /*** Clear out FIFO area ***/
+ memset(gp_fifo, 0, DEFAULT_FIFO_SIZE);
+
+ /*** Initialise GX ***/
+ GX_Init(gp_fifo, DEFAULT_FIFO_SIZE);
+ GX_SetCopyClear(gxbackground, 0x00ffffff);
+
+ GX_SetViewport(0, 0, vmode->fbWidth, vmode->efbHeight, 0, 1);
+ GX_SetDispCopyYScale((f32) vmode->xfbHeight / (f32) vmode->efbHeight);
+ GX_SetScissor(0, 0, vmode->fbWidth, vmode->efbHeight);
+ GX_SetDispCopySrc(0, 0, vmode->fbWidth, vmode->efbHeight);
+ GX_SetDispCopyDst(vmode->fbWidth, vmode->xfbHeight);
+ GX_SetCopyFilter(vmode->aa, vmode->sample_pattern, GX_TRUE,
+ vmode->vfilter);
+ GX_SetFieldMode(vmode->field_rendering,
+ ((vmode->viHeight == 2 * vmode->xfbHeight) ?
+ GX_ENABLE : GX_DISABLE));
+ GX_SetPixelFmt(GX_PF_RGB8_Z24, GX_ZC_LINEAR);
+ GX_SetCullMode(GX_CULL_NONE);
+ GX_CopyDisp(xfb[whichfb ^ 1], GX_TRUE);
+ GX_SetDispCopyGamma(GX_GM_1_0);
+
+ guPerspective(p, 60, 1.33f, 10.0f, 1000.0f);
+ GX_LoadProjectionMtx(p, GX_PERSPECTIVE);
+ memset(texturemem, 0, texturesize);
+
+ GX_Flush();
+
+ /*** Setup for first call to scaler ***/
+ vwidth = vheight = -1;
+}
+
+/****************************************************************************
+* GX_Render
+*
+* Pass in a buffer, width and height to update as a tiled RGB565 texture
+****************************************************************************/
+void GX_Render(u16 width, u16 height, u8 *buffer, u16 pitch) {
+ u16 h, w;
+ u64 *dst = (u64 *) texturemem;
+ u64 *src1 = (u64 *) buffer;
+ u64 *src2 = (u64 *) (buffer + pitch);
+ u64 *src3 = (u64 *) (buffer + (pitch * 2));
+ u64 *src4 = (u64 *) (buffer + (pitch * 3));
+ u16 rowpitch = (pitch >> 3) * 3 + pitch % 8;
+
+ vwidth = width;
+ vheight = height;
+
+ whichfb ^= 1;
+
+ if ((oldvheight != vheight) || (oldvwidth != vwidth)) {
+ /** Update scaling **/
+ oldvwidth = vwidth;
+ oldvheight = vheight;
+ draw_init();
+ memset(&view, 0, sizeof(Mtx));
+ guLookAt(view, &cam.pos, &cam.up, &cam.view);
+ GX_SetViewport(0, 0, vmode->fbWidth, vmode->efbHeight, 0, 1);
+ }
+
+ GX_InvVtxCache();
+ GX_InvalidateTexAll();
+ GX_SetTevOp(GX_TEVSTAGE0, GX_DECAL);
+ GX_SetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR0A0);
+
+ for (h = 0; h < vheight; h += 4) {
+ for (w = 0; w < (vwidth >> 2); w++) {
+ *dst++ = *src1++;
+ *dst++ = *src2++;
+ *dst++ = *src3++;
+ *dst++ = *src4++;
+ }
+
+ src1 += rowpitch;
+ src2 += rowpitch;
+ src3 += rowpitch;
+ src4 += rowpitch;
+ }
+
+ DCFlushRange(texturemem, texturesize);
+
+ GX_SetNumChans(1);
+ GX_LoadTexObj(&texobj, GX_TEXMAP0);
+
+ draw_square(view);
+
+ GX_DrawDone();
+
+ GX_SetZMode(GX_TRUE, GX_LEQUAL, GX_TRUE);
+ GX_SetColorUpdate(GX_TRUE);
+ GX_CopyDisp(xfb[whichfb], GX_TRUE);
+ GX_Flush();
+
+ VIDEO_SetNextFramebuffer(xfb[whichfb]);
+ VIDEO_Flush();
+}
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/backends/platform/wii/gx_supp.h b/backends/platform/wii/gx_supp.h
new file mode 100644
index 0000000000..9393e93a26
--- /dev/null
+++ b/backends/platform/wii/gx_supp.h
@@ -0,0 +1,39 @@
+/****************************************************************************
+* Generic GX Scaler
+* softdev 2007
+*
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License along
+* with this program; if not, write to the Free Software Foundation, Inc.,
+* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*
+* NGC GX Video Functions
+*
+* These are pretty standard functions to setup and use GX scaling.
+****************************************************************************/
+#ifndef _WII_GX_SUPP_H_
+#define _WII_GX_SUPP_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void GX_InitVideo();
+
+void GX_Start(u16 width, u16 height, s16 haspect, s16 vaspect);
+void GX_Render(u16 width, u16 height, u8 *buffer, u16 pitch);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/backends/platform/wii/main.cpp b/backends/platform/wii/main.cpp
new file mode 100644
index 0000000000..7529df6de3
--- /dev/null
+++ b/backends/platform/wii/main.cpp
@@ -0,0 +1,88 @@
+/* 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
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include <fat.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <errno.h>
+#include <unistd.h>
+
+#include "osystem.h"
+
+#ifdef DEBUG_WII
+#include <debug.h>
+#include <gecko_console.h>
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int main(int argc, char *argv[]) {
+ s32 res;
+
+ VIDEO_Init();
+ PAD_Init();
+ AUDIO_Init(NULL);
+
+#ifdef DEBUG_WII
+ gecko_console_init(0);
+ //DEBUG_Init(GDBSTUB_DEVICE_USB, 1);
+#endif
+
+ printf("startup\n");
+
+ if (!fatInitDefault()) {
+ printf("fatInitDefault failed\n");
+ } else {
+ // set the default path if libfat couldnt set it
+ // this allows loading over tcp/usbgecko
+ char buf[MAXPATHLEN];
+
+ getcwd(buf, MAXPATHLEN);
+ if (!strcmp(buf, "fat:/"))
+ chdir("/apps/scummvm");
+
+ //fatEnableReadAhead(PI_DEFAULT, 32, 128);
+ }
+
+ g_system = new OSystem_Wii();
+ assert(g_system);
+
+ res = scummvm_main(argc, argv);
+ g_system->quit();
+
+ printf("shutdown\n");
+
+ if (!fatUnmount(PI_DEFAULT)) {
+ printf("fatUnmount failed\n");
+ fatUnsafeUnmount(PI_DEFAULT);
+ }
+
+ printf("reloading\n");
+
+ return res;
+}
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/backends/platform/wii/osystem.cpp b/backends/platform/wii/osystem.cpp
new file mode 100644
index 0000000000..97bee24d0f
--- /dev/null
+++ b/backends/platform/wii/osystem.cpp
@@ -0,0 +1,188 @@
+/* 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
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include "osystem.h"
+#include "backends/fs/wii/wii-fs-factory.h"
+
+#include <unistd.h>
+
+#include <ogc/mutex.h>
+#include <ogc/lwp_watchdog.h>
+
+OSystem_Wii::OSystem_Wii() :
+ _startup_time(0),
+ _alarm(-1),
+
+ _palette(NULL),
+ _cursorPalette(NULL),
+ _cursorPaletteDisabled(true),
+
+ _gameWidth(0),
+ _gameHeight(0),
+ _gamePixels(NULL),
+
+ _overlayVisible(false),
+ _overlayWidth(0),
+ _overlayHeight(0),
+ _overlaySize(0),
+ _overlayPixels(NULL),
+
+ _lastScreenUpdate(0),
+ _texture(NULL),
+ _currentWidth(0),
+ _currentHeight(0),
+
+ _supportedGraphicsModes(NULL),
+ _activeGraphicsMode(-1),
+
+ _mouseVisible(false),
+ _mouseX(0),
+ _mouseY(0),
+ _mouseWidth(0),
+ _mouseHeight(0),
+ _mouseHotspotX(0),
+ _mouseHotspotY(0),
+ _mouseKeyColor(0),
+ _mouseCursor(NULL),
+
+ _savefile(NULL),
+ _mixer(NULL),
+ _timer(NULL) {
+}
+
+OSystem_Wii::~OSystem_Wii() {
+ if (_savefile) {
+ delete _savefile;
+ _savefile = NULL;
+ }
+
+ if (_mixer) {
+ delete _mixer;
+ _mixer = NULL;
+ }
+
+ if (_timer) {
+ delete _timer;
+ _timer = NULL;
+ }
+}
+
+void OSystem_Wii::initBackend() {
+ _startup_time = gettime();
+
+ _savefile = new DefaultSaveFileManager();
+ _mixer = new Audio::Mixer();
+ _timer = new DefaultTimerManager();
+
+ initGfx();
+ initSfx();
+ initEvents();
+
+ OSystem::initBackend();
+}
+
+void OSystem_Wii::quit() {
+ deinitEvents();
+ deinitSfx();
+ deinitGfx();
+}
+
+bool OSystem_Wii::hasFeature(Feature f) {
+ return f == kFeatureCursorHasPalette;
+}
+
+void OSystem_Wii::setFeatureState(Feature f, bool enable) {
+}
+
+bool OSystem_Wii::getFeatureState(Feature f) {
+ return false;
+}
+
+uint32 OSystem_Wii::getMillis() {
+ return ticks_to_millisecs(diff_ticks(_startup_time, gettime()));
+}
+
+void OSystem_Wii::delayMillis(uint msecs) {
+ usleep(msecs * 1000);
+}
+
+OSystem::MutexRef OSystem_Wii::createMutex() {
+ mutex_t *mutex = (mutex_t *) malloc(sizeof(mutex_t));
+ s32 res = LWP_MutexInit(mutex, false);
+
+ if (res) {
+ printf("ERROR creating mutex\n");
+ delete mutex;
+ return NULL;
+ }
+
+ return (MutexRef) mutex;
+}
+
+void OSystem_Wii::lockMutex(MutexRef mutex) {
+ s32 res = LWP_MutexLock(*(mutex_t *) mutex);
+
+ if (res)
+ printf("ERROR locking mutex %p (%d)\n", mutex, res);
+}
+
+void OSystem_Wii::unlockMutex(MutexRef mutex) {
+ s32 res = LWP_MutexUnlock(*(mutex_t *) mutex);
+
+ if (res)
+ printf("ERROR unlocking mutex %p (%d)\n", mutex, res);
+}
+
+void OSystem_Wii::deleteMutex(MutexRef mutex) {
+ s32 res = LWP_MutexDestroy(*(mutex_t *) mutex);
+
+ if (res)
+ printf("ERROR destroying mutex %p (%d)\n", mutex, res);
+}
+
+void OSystem_Wii::setWindowCaption(const char *caption) {
+ printf("window caption: %s\n", caption);
+}
+
+Common::SaveFileManager *OSystem_Wii::getSavefileManager() {
+ assert(_savefile);
+ return _savefile;
+}
+
+Audio::Mixer *OSystem_Wii::getMixer() {
+ assert(_mixer);
+ return _mixer;
+}
+
+Common::TimerManager *OSystem_Wii::getTimerManager() {
+ assert(_timer);
+ return _timer;
+}
+
+FilesystemFactory *OSystem_Wii::getFilesystemFactory() {
+ return &WiiFilesystemFactory::instance();
+}
+
+void OSystem_Wii::getTimeAndDate(struct tm &t) const {
+ time_t curTime = time(0);
+ t = *localtime(&curTime);
+}
+
diff --git a/backends/platform/wii/osystem.h b/backends/platform/wii/osystem.h
new file mode 100644
index 0000000000..f65310bada
--- /dev/null
+++ b/backends/platform/wii/osystem.h
@@ -0,0 +1,163 @@
+/* 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
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef _WII_OSYSTEM_H_
+#define _WII_OSYSTEM_H_
+
+#include "common/system.h"
+#include "base/main.h"
+
+#include "common/rect.h"
+#include "common/events.h"
+
+#include "backends/saves/default/default-saves.h"
+#include "backends/timer/default/default-timer.h"
+#include "graphics/surface.h"
+#include "sound/mixer.h"
+
+#include <gctypes.h>
+#include <gccore.h>
+#include <ogcsys.h>
+
+class OSystem_Wii : public OSystem {
+private:
+ s64 _startup_time;
+ syswd_t _alarm;
+
+ u16 *_palette;
+ u16 *_cursorPalette;
+ bool _cursorPaletteDisabled;
+
+ u16 _gameWidth, _gameHeight;
+ u8 *_gamePixels;
+ Graphics::Surface _surface;
+
+ bool _overlayVisible;
+ u16 _overlayWidth, _overlayHeight;
+ u32 _overlaySize;
+ OverlayColor *_overlayPixels;
+
+ u32 _lastScreenUpdate;
+ u16 *_texture;
+ u16 _currentWidth, _currentHeight;
+
+ OSystem::GraphicsMode *_supportedGraphicsModes;
+ s32 _activeGraphicsMode;
+
+ bool _mouseVisible;
+ s32 _mouseX, _mouseY;
+ u32 _mouseWidth, _mouseHeight;
+ s32 _mouseHotspotX, _mouseHotspotY;
+ u8 _mouseKeyColor;
+ u8 *_mouseCursor;
+
+ u32 _lastPadCheck;
+
+ void initGfx();
+ void deinitGfx();
+
+ void initSfx();
+ void deinitSfx();
+
+ void initEvents();
+ void deinitEvents();
+ void updateEventScreenResolution();
+
+protected:
+ Common::SaveFileManager *_savefile;
+ Audio::Mixer *_mixer;
+ DefaultTimerManager *_timer;
+
+public:
+ OSystem_Wii();
+ virtual ~OSystem_Wii();
+
+ virtual void initBackend();
+
+ virtual bool hasFeature(Feature f);
+ virtual void setFeatureState(Feature f, bool enable);
+ virtual bool getFeatureState(Feature f);
+ virtual const GraphicsMode *getSupportedGraphicsModes() const;
+ virtual int getDefaultGraphicsMode() const;
+ bool setGraphicsMode(const char *name);
+ virtual bool setGraphicsMode(int mode);
+ virtual int getGraphicsMode() const;
+ virtual void initSize(uint width, uint height);
+ virtual int16 getWidth();
+ virtual int16 getHeight();
+ virtual void setPalette(const byte *colors, uint start, uint num);
+ virtual void grabPalette(byte *colors, uint start, uint num);
+ virtual void setCursorPalette(const byte *colors, uint start, uint num);
+ virtual void disableCursorPalette(bool disable);
+ virtual void copyRectToScreen(const byte *buf, int pitch, int x, int y,
+ int w, int h);
+ virtual void updateScreen();
+ virtual Graphics::Surface *lockScreen();
+ virtual void unlockScreen();
+ virtual void setShakePos(int shakeOffset);
+
+ virtual void showOverlay();
+ virtual void hideOverlay();
+ virtual void clearOverlay();
+ virtual void grabOverlay(OverlayColor *buf, int pitch);
+ virtual void copyRectToOverlay(const OverlayColor *buf, int pitch,
+ int x, int y, int w, int h);
+ virtual int16 getOverlayWidth();
+ virtual int16 getOverlayHeight();
+
+ virtual OverlayColor RGBToColor(uint8 r, uint8 g, uint8 b);
+ virtual void colorToRGB(OverlayColor color, uint8 &r, uint8 &g, uint8 &b);
+ virtual OverlayColor ARGBToColor(uint8 a, uint8 r, uint8 g, uint8 b);
+ virtual void colorToARGB(OverlayColor color, uint8 &a, uint8 &r,
+ uint8 &g, uint8 &b);
+
+ virtual bool showMouse(bool visible);
+
+ virtual void warpMouse(int x, int y);
+ virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX,
+ int hotspotY, byte keycolor = 255,
+ int cursorTargetScale = 1);
+
+ virtual bool pollEvent(Common::Event &event);
+ virtual uint32 getMillis();
+ virtual void delayMillis(uint msecs);
+
+ virtual MutexRef createMutex();
+ virtual void lockMutex(MutexRef mutex);
+ virtual void unlockMutex(MutexRef mutex);
+ virtual void deleteMutex(MutexRef mutex);
+
+ typedef void (*SoundProc)(void *param, byte *buf, int len);
+ virtual int getOutputSampleRate() const;
+
+ virtual void quit();
+
+ virtual void setWindowCaption(const char *caption);
+
+ virtual Common::SaveFileManager *getSavefileManager();
+ virtual Audio::Mixer *getMixer();
+ virtual Common::TimerManager *getTimerManager();
+ FilesystemFactory *getFilesystemFactory();
+ void getTimeAndDate(struct tm &t) const;
+};
+
+#endif
+
diff --git a/backends/platform/wii/osystem_events.cpp b/backends/platform/wii/osystem_events.cpp
new file mode 100644
index 0000000000..09dfb5e96b
--- /dev/null
+++ b/backends/platform/wii/osystem_events.cpp
@@ -0,0 +1,262 @@
+/* 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
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include <unistd.h>
+#include <malloc.h>
+
+#ifndef GAMECUBE
+#include <wiiuse/wpad.h>
+#endif
+
+#include <ogc/lwp_watchdog.h>
+
+#include "osystem.h"
+
+#define TIMER_THREAD_STACKSIZE (1024 * 32)
+#define TIMER_THREAD_PRIO 64
+
+#define PAD_CHECK_TIME 40
+
+#ifndef GAMECUBE
+#define PADS_A (PAD_BUTTON_A | (WPAD_BUTTON_A << 16))
+#define PADS_B (PAD_BUTTON_B | (WPAD_BUTTON_B << 16))
+#define PADS_X (PAD_BUTTON_X | (WPAD_BUTTON_MINUS << 16))
+#define PADS_Y (PAD_BUTTON_Y | (WPAD_BUTTON_PLUS << 16))
+#define PADS_Z (PAD_TRIGGER_Z | (WPAD_BUTTON_2 << 16))
+#define PADS_START (PAD_BUTTON_START | (WPAD_BUTTON_HOME << 16))
+#define PADS_UP (PAD_BUTTON_UP | (WPAD_BUTTON_UP << 16))
+#define PADS_DOWN (PAD_BUTTON_DOWN | (WPAD_BUTTON_DOWN << 16))
+#define PADS_LEFT (PAD_BUTTON_LEFT | (WPAD_BUTTON_LEFT << 16))
+#define PADS_RIGHT (PAD_BUTTON_RIGHT | (WPAD_BUTTON_RIGHT << 16))
+#else
+#define PADS_A PAD_BUTTON_A
+#define PADS_B PAD_BUTTON_B
+#define PADS_X PAD_BUTTON_X
+#define PADS_Y PAD_BUTTON_Y
+#define PADS_Z PAD_TRIGGER_Z
+#define PADS_START PAD_BUTTON_START
+#define PADS_UP PAD_BUTTON_UP
+#define PADS_DOWN PAD_BUTTON_DOWN
+#define PADS_LEFT PAD_BUTTON_LEFT
+#define PADS_RIGHT PAD_BUTTON_RIGHT
+#endif
+
+static lwpq_t timer_queue;
+static lwp_t timer_thread;
+static u8 *timer_stack;
+static bool timer_thread_running = false;
+static bool timer_thread_quit = false;
+
+static void * timer_thread_func(void *arg) {
+ while (!timer_thread_quit) {
+ DefaultTimerManager *tm =
+ (DefaultTimerManager *) g_system->getTimerManager();
+ tm->handler();
+
+ usleep(1000 * 10);
+ }
+
+ return NULL;
+}
+
+void OSystem_Wii::initEvents() {
+ timer_thread_quit = false;
+
+ timer_stack = (u8 *) memalign(32, TIMER_THREAD_STACKSIZE);
+ memset(timer_stack, 0, TIMER_THREAD_STACKSIZE);
+
+ LWP_InitQueue(&timer_queue);
+
+ s32 res = LWP_CreateThread(&timer_thread, timer_thread_func, NULL,
+ timer_stack, TIMER_THREAD_STACKSIZE,
+ TIMER_THREAD_PRIO);
+
+ if (res) {
+ printf("ERROR creating timer thread: %d\n", res);
+ LWP_CloseQueue(timer_queue);
+ }
+
+ timer_thread_running = res == 0;
+
+#ifndef GAMECUBE
+ WPAD_Init();
+ WPAD_SetDataFormat(WPAD_CHAN_0, WPAD_FMT_BTNS_ACC_IR);
+ WPAD_SetIdleTimeout(120);
+#endif
+}
+
+void OSystem_Wii::deinitEvents() {
+ if (timer_thread_running) {
+ timer_thread_quit = true;
+ LWP_ThreadBroadcast(timer_queue);
+
+ LWP_JoinThread(timer_thread, NULL);
+ LWP_CloseQueue(timer_queue);
+
+ timer_thread_running = false;
+ }
+
+#ifndef GAMECUBE
+ WPAD_Shutdown();
+#endif
+}
+
+void OSystem_Wii::updateEventScreenResolution() {
+#ifndef GAMECUBE
+ WPAD_SetVRes(WPAD_CHAN_0, _currentWidth + _currentWidth / 5,
+ _currentHeight + _currentHeight / 5);
+#endif
+}
+
+#define KBD_EVENT(pad_button, kbd_keycode, kbd_ascii) \
+ do { \
+ if ((bd | bu) & pad_button) { \
+ if (bd & pad_button) \
+ event.type = Common::EVENT_KEYDOWN; \
+ else \
+ event.type = Common::EVENT_KEYUP; \
+ event.kbd.keycode = kbd_keycode; \
+ event.kbd.ascii = kbd_ascii; \
+ return true; \
+ } \
+ } while (0)
+
+bool OSystem_Wii::pollEvent(Common::Event &event) {
+ u32 bd, bh, bu;
+
+ PAD_ScanPads();
+
+ bd = PAD_ButtonsDown(0);
+ bh = PAD_ButtonsHeld(0);
+ bu = PAD_ButtonsUp(0);
+
+#ifndef GAMECUBE
+ WPAD_ScanPads();
+
+ s32 res = WPAD_Probe(0, NULL);
+
+ if (res == WPAD_ERR_NONE) {
+
+ bd |= WPAD_ButtonsDown(0) << 16;
+ bh |= WPAD_ButtonsHeld(0) << 16;
+ bu |= WPAD_ButtonsUp(0) << 16;
+ }
+#endif
+
+ if (bd || bu) {
+ if (bh & PADS_UP)
+ event.kbd.flags = Common::KBD_SHIFT;
+
+ KBD_EVENT(PADS_Z, Common::KEYCODE_RETURN, Common::ASCII_RETURN);
+ KBD_EVENT(PADS_X, Common::KEYCODE_ESCAPE, Common::ASCII_ESCAPE);
+ KBD_EVENT(PADS_Y, Common::KEYCODE_PERIOD, '.');
+ KBD_EVENT(PADS_START, Common::KEYCODE_F5, Common::ASCII_F5);
+ KBD_EVENT(PADS_UP, Common::KEYCODE_LSHIFT, 0);
+ KBD_EVENT(PADS_DOWN, Common::KEYCODE_0, '0');
+ KBD_EVENT(PADS_LEFT, Common::KEYCODE_y, 'y');
+ KBD_EVENT(PADS_RIGHT, Common::KEYCODE_n, 'n');
+
+ if ((bd | bu) & (PADS_A | PADS_B)) {
+ if (bd & PADS_A)
+ event.type = Common::EVENT_LBUTTONDOWN;
+ else if (bu & PADS_A)
+ event.type = Common::EVENT_LBUTTONUP;
+ else if (bd & PADS_B)
+ event.type = Common::EVENT_RBUTTONDOWN;
+ else if (bu & PADS_B)
+ event.type = Common::EVENT_RBUTTONUP;
+
+ event.mouse.x = _mouseX;
+ event.mouse.y = _mouseY;
+
+ return true;
+ }
+ }
+
+ s32 mx = _mouseX;
+ s32 my = _mouseY;
+
+#ifndef GAMECUBE
+ if (res == WPAD_ERR_NONE) {
+ struct ir_t ir;
+
+ WPAD_IR(0, &ir);
+
+ if (ir.valid) {
+ mx = ir.x - _currentWidth / 10;
+ my = ir.y - _currentHeight / 10;
+
+ if (mx < 0)
+ mx = 0;
+
+ if (mx >= _currentWidth)
+ mx = _currentWidth - 1;
+
+ if (my < 0)
+ my = 0;
+
+ if (my >= _currentHeight)
+ my = _currentHeight - 1;
+
+ if ((mx != _mouseX) || (my != _mouseY)) {
+ event.type = Common::EVENT_MOUSEMOVE;
+ event.mouse.x = _mouseX = mx;
+ event.mouse.y = _mouseY = my;
+
+ return true;
+ }
+ }
+ }
+#endif
+
+ uint32 time = getMillis();
+ if (time - _lastPadCheck > PAD_CHECK_TIME) {
+ _lastPadCheck = time;
+
+ if (abs (PAD_StickX(0)) > 16)
+ mx += PAD_StickX(0) / (4 * _overlayWidth / _currentWidth);
+ if (abs (PAD_StickY(0)) > 16)
+ my -= PAD_StickY(0) / (4 * _overlayHeight / _currentHeight);
+
+ if (mx < 0)
+ mx = 0;
+
+ if (mx >= _currentWidth)
+ mx = _currentWidth - 1;
+
+ if (my < 0)
+ my = 0;
+
+ if (my >= _currentHeight)
+ my = _currentHeight - 1;
+
+ if ((mx != _mouseX) || (my != _mouseY)) {
+ event.type = Common::EVENT_MOUSEMOVE;
+ event.mouse.x = _mouseX = mx;
+ event.mouse.y = _mouseY = my;
+
+ return true;
+ }
+ }
+
+ return false;
+}
+
diff --git a/backends/platform/wii/osystem_gfx.cpp b/backends/platform/wii/osystem_gfx.cpp
new file mode 100644
index 0000000000..1e54233c93
--- /dev/null
+++ b/backends/platform/wii/osystem_gfx.cpp
@@ -0,0 +1,453 @@
+/* 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
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include <malloc.h>
+
+#include "osystem.h"
+#include "gx_supp.h"
+
+#define MAX_FPS 30
+
+enum GraphicModeID {
+ GM_DEFAULT
+};
+
+void OSystem_Wii::initGfx() {
+ _surface.w = 0;
+ _surface.h = 0;
+ _surface.pitch = 0;
+ _surface.pixels = NULL;
+ _surface.bytesPerPixel = 0;
+
+ GX_InitVideo();
+
+ _overlayWidth = 640;
+ _overlayHeight = 480;
+
+ _overlaySize = _overlayWidth * _overlayHeight * 2;
+ _overlayPixels = (OverlayColor *) memalign(32, _overlaySize);
+
+ _palette = (u16 *) memalign(32, 256 * 2);
+ memset(_palette, 0, 256 * 2);
+
+ _cursorPalette = (u16 *) memalign(32, 256 * 2);
+ memset(_cursorPalette, 0, 256 * 2);
+
+ _supportedGraphicsModes = new OSystem::GraphicsMode[2];
+ _supportedGraphicsModes[0].name = strdup("gx");
+ _supportedGraphicsModes[0].description = strdup("wii hardware scaler");
+ _supportedGraphicsModes[0].id = GM_DEFAULT;
+ _supportedGraphicsModes[1].name = 0;
+ _supportedGraphicsModes[1].description = 0;
+ _supportedGraphicsModes[1].id = 0;
+
+ _texture = (u16 *) memalign(32, _overlaySize);
+
+ GX_Start(_overlayWidth, _overlayHeight, 320, 240);
+}
+
+void OSystem_Wii::deinitGfx() {
+ GX_AbortFrame();
+
+ if (_supportedGraphicsModes) {
+ delete[] _supportedGraphicsModes;
+ _supportedGraphicsModes = NULL;
+ }
+
+ if (_gamePixels) {
+ free(_gamePixels);
+ _gamePixels = NULL;
+ }
+
+ if (_palette) {
+ free(_palette);
+ _palette = NULL;
+ }
+
+ if (_overlayPixels) {
+ free(_overlayPixels);
+ _overlayPixels = NULL;
+ }
+
+ if (_mouseCursor) {
+ free(_mouseCursor);
+ _mouseCursor = NULL;
+ }
+
+ if (_cursorPalette) {
+ free(_cursorPalette);
+ _cursorPalette = NULL;
+ }
+
+ if (_texture) {
+ free(_texture);
+ _texture = NULL;
+ }
+}
+
+const OSystem::GraphicsMode* OSystem_Wii::getSupportedGraphicsModes() const {
+ return _supportedGraphicsModes;
+}
+
+int OSystem_Wii::getDefaultGraphicsMode() const {
+ return GM_DEFAULT;
+}
+
+bool OSystem_Wii::setGraphicsMode(const char *mode) {
+ setGraphicsMode(GM_DEFAULT);
+
+ return true;
+}
+
+bool OSystem_Wii::setGraphicsMode(int mode) {
+ return true;
+}
+
+int OSystem_Wii::getGraphicsMode() const {
+ return _activeGraphicsMode;
+}
+
+void OSystem_Wii::initSize(uint width, uint height) {
+ if (_gameWidth != width || _gameHeight != height) {
+ printf("initSize %u %u\n", width, height);
+
+ _gameWidth = width;
+ _gameHeight = height;
+
+ if(_gamePixels)
+ free(_gamePixels);
+
+ _gamePixels = (u8 *) memalign(32, _gameWidth * _gameHeight);
+
+ if (!_overlayVisible) {
+ _currentWidth = _gameWidth;
+ _currentHeight = _gameHeight;
+ updateEventScreenResolution();
+ }
+ }
+}
+
+int16 OSystem_Wii::getWidth() {
+ return _gameWidth;
+}
+
+int16 OSystem_Wii::getHeight() {
+ return _gameHeight;
+}
+
+void OSystem_Wii::setPalette(const byte *colors, uint start, uint num) {
+ const byte *p = colors;
+ for (uint i = 0; i < num; ++i) {
+ _palette[start + i] = RGBToColor(p[0], p[1], p[2]);
+ p += 4;
+ }
+}
+
+void OSystem_Wii::grabPalette(byte *colors, uint start, uint num) {
+ byte *p = colors;
+ u8 r, g, b;
+ for (uint i = 0; i < num; ++i) {
+ colorToRGB(_palette[start + i], r, g, b);
+ p[0] = r;
+ p[1] = g;
+ p[2] = b;
+ p[3] = 0xff;
+ p += 4;
+ }
+}
+
+void OSystem_Wii::setCursorPalette(const byte *colors, uint start, uint num) {
+ const byte *p = colors;
+ for (uint i = 0; i < num; ++i) {
+ _cursorPalette[start + i] = RGBToColor(p[0], p[1], p[2]);
+ p += 4;
+ }
+
+ _cursorPaletteDisabled = false;
+}
+
+void OSystem_Wii::disableCursorPalette(bool disable) {
+ _cursorPaletteDisabled = disable;
+}
+
+void OSystem_Wii::copyRectToScreen(const byte *buf, int pitch, int x, int y,
+ int w, int h) {
+ if (x < 0) {
+ w += x;
+ buf -= x;
+ x = 0;
+ }
+
+ if (y < 0) {
+ h += y;
+ buf -= y * pitch;
+ y = 0;
+ }
+
+ if (w > _gameWidth - x)
+ w = _gameWidth - x;
+
+ if (h > _gameHeight - y)
+ h = _gameHeight - y;
+
+ if (w <= 0 || h <= 0)
+ return;
+
+ byte *dst = _gamePixels + y * _gameWidth + x;
+ if (_gameWidth == pitch && pitch == w) {
+ memcpy(dst, buf, h * w);
+ } else {
+ do {
+ memcpy(dst, buf, w);
+ buf += pitch;
+ dst += _gameWidth;
+ } while (--h);
+ }
+}
+
+void OSystem_Wii::updateScreen() {
+ static u32 x, y, h, skip;
+ static s16 msx, msy, mox, moy, mskip;
+ static u16 mpx, mpy;
+ static u8 *s;
+ static u16 *d, *p;
+
+ u32 now = getMillis();
+ if (now - _lastScreenUpdate < 1000 / MAX_FPS)
+ return;
+
+ _lastScreenUpdate = now;
+
+ h = 0;
+ if (_overlayVisible) {
+ memcpy(_texture, _overlayPixels, _overlaySize);
+ } else {
+ for (y = 0; y < _gameHeight; ++y) {
+ for (x = 0; x < _gameWidth; ++x)
+ _texture[h + x] = _palette[_gamePixels[h + x]];
+
+ h += _gameWidth;
+ }
+ }
+
+ if (_mouseVisible) {
+ msx = _mouseX - _mouseHotspotX;
+ msy = _mouseY - _mouseHotspotY;
+ mox = 0;
+ moy = 0;
+ mpx = _mouseWidth;
+ mpy = _mouseHeight;
+
+ if (msx < 0) {
+ mox = -msx;
+ mpx -= mox;
+ msx = 0;
+ } else
+ if (msx + mpx > _currentWidth - 1)
+ mpx = _currentWidth - msx - 1;
+
+ if (msy < 0) {
+ moy = -msy;
+ mpy -= moy;
+ msy = 0;
+ } else
+ if (msy + mpy + 1 > _currentHeight - 1)
+ mpy = _currentHeight - msy - 1;
+
+
+ if (_cursorPaletteDisabled)
+ p = _palette;
+ else
+ p = _cursorPalette;
+
+ skip = _currentWidth - mpx;
+ mskip = _mouseWidth - mpx;
+
+ s = _mouseCursor + moy * _mouseWidth + mox;
+ d = _texture + (msy * _currentWidth + msx);
+
+ for (y = 0; y < mpy; ++y) {
+ for (x = 0; x < mpx; ++x) {
+ if (*s == _mouseKeyColor) {
+ s++;
+ d++;
+
+ continue;
+ }
+
+ *d++ = p[*s];
+ s++;
+ }
+
+ d += skip;
+ s += mskip;
+ }
+ }
+
+ GX_Render(_currentWidth, _currentHeight, (u8 *) _texture,
+ _currentWidth * 2);
+}
+
+Graphics::Surface *OSystem_Wii::lockScreen() {
+ _surface.pixels = _gamePixels;
+ _surface.w = _gameWidth;
+ _surface.h = _gameHeight;
+ _surface.pitch = _gameWidth;
+ _surface.bytesPerPixel = 1;
+
+ return &_surface;
+}
+
+void OSystem_Wii::unlockScreen() {
+}
+
+void OSystem_Wii::setShakePos(int shakeOffset) {
+}
+
+void OSystem_Wii::showOverlay() {
+ _mouseX = _overlayWidth / 2;
+ _mouseY = _overlayHeight / 2;
+ _overlayVisible = true;
+ _currentWidth = _overlayWidth;
+ _currentHeight = _overlayHeight;
+
+ updateEventScreenResolution();
+}
+
+void OSystem_Wii::hideOverlay() {
+ _mouseX = _gameWidth / 2;
+ _mouseY = _gameHeight / 2;
+ _overlayVisible = false;
+ _currentWidth = _gameWidth;
+ _currentHeight = _gameHeight;
+
+ updateEventScreenResolution();
+}
+
+void OSystem_Wii::clearOverlay() {
+ memset(_overlayPixels, 0, _overlaySize);
+}
+
+void OSystem_Wii::grabOverlay(OverlayColor *buf, int pitch) {
+ int h = _overlayHeight;
+ OverlayColor *src = _overlayPixels;
+
+ do {
+ memcpy(buf, src, _overlayWidth * sizeof(OverlayColor));
+ src += _overlayWidth;
+ buf += pitch;
+ } while (--h);
+}
+
+void OSystem_Wii::copyRectToOverlay(const OverlayColor *buf, int pitch, int x,
+ int y, int w, int h) {
+ if (x < 0) {
+ w += x;
+ buf -= x;
+ x = 0;
+ }
+
+ if (y < 0) {
+ h += y;
+ buf -= y * pitch;
+ y = 0;
+ }
+
+ if (w > _overlayWidth - x)
+ w = _overlayWidth - x;
+
+ if (h > _overlayHeight - y)
+ h = _overlayHeight - y;
+
+ if (w <= 0 || h <= 0)
+ return;
+
+ OverlayColor *dst = _overlayPixels + (y * _overlayWidth + x);
+ if (_overlayWidth == pitch && pitch == w) {
+ memcpy(dst, buf, h * w * sizeof(OverlayColor));
+ } else {
+ do {
+ memcpy(dst, buf, w * sizeof(OverlayColor));
+ buf += pitch;
+ dst += _overlayWidth;
+ } while (--h);
+ }
+}
+
+int16 OSystem_Wii::getOverlayWidth() {
+ return _overlayWidth;
+}
+
+int16 OSystem_Wii::getOverlayHeight() {
+ return _overlayHeight;
+}
+
+OverlayColor OSystem_Wii::RGBToColor(uint8 r, uint8 g, uint8 b) {
+ return (((r >> 3) & 0x1f) << 11) | (((g >> 2) & 0x3f) << 5 ) |
+ ((b >> 3) & 0x1f);
+}
+
+void OSystem_Wii::colorToRGB(OverlayColor color, uint8 &r, uint8 &g, uint8 &b) {
+ r = ((color >> 11) & 0x1f) << 3;
+ g = ((color >> 5) & 0x3f) << 2;
+ b = (color & 0x1f) << 3;
+}
+
+OverlayColor OSystem_Wii::ARGBToColor(uint8 a, uint8 r, uint8 g, uint8 b) {
+ return RGBToColor(r, g, b);
+}
+
+void OSystem_Wii::colorToARGB(OverlayColor color, uint8 &a, uint8 &r, uint8 &g,
+ uint8 &b) {
+ a = 0xff;
+ colorToRGB(color, r, g, b);
+}
+
+bool OSystem_Wii::showMouse(bool visible) {
+ bool last = _mouseVisible;
+ _mouseVisible = visible;
+
+ return last;
+}
+
+void OSystem_Wii::warpMouse(int x, int y) {
+ _mouseX = x;
+ _mouseY = y;
+}
+
+void OSystem_Wii::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX,
+ int hotspotY, byte keycolor,
+ int cursorTargetScale) {
+ (void) cursorTargetScale; // TODO
+
+ _mouseWidth = w;
+ _mouseHeight = h;
+ _mouseHotspotX = hotspotX;
+ _mouseHotspotY = hotspotY;
+ _mouseKeyColor = keycolor;
+
+ if (_mouseCursor)
+ free(_mouseCursor);
+
+ _mouseCursor = (u8 *) memalign(32, w * h);
+ memcpy(_mouseCursor, buf, w * h);
+}
+
diff --git a/backends/platform/wii/osystem_sfx.cpp b/backends/platform/wii/osystem_sfx.cpp
new file mode 100644
index 0000000000..16b2f3b055
--- /dev/null
+++ b/backends/platform/wii/osystem_sfx.cpp
@@ -0,0 +1,133 @@
+/* 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
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include <malloc.h>
+
+#include "osystem.h"
+
+#define SFX_THREAD_STACKSIZE (1024 * 128)
+#define SFX_THREAD_PRIO 80
+#define SFX_THREAD_FRAG_SIZE 4096
+
+static lwpq_t sfx_queue;
+static lwp_t sfx_thread;
+static u8 *sfx_stack;
+static bool sfx_thread_running = false;
+static bool sfx_thread_quit = false;
+
+static u8 sb = 0;
+static u8 *sound_buffer[2];
+
+static OSystem_Wii::SoundProc sound_proc = NULL;
+static void *proc_param = NULL;
+
+static void audio_switch_buffers() {
+ AUDIO_StopDMA();
+ AUDIO_InitDMA((u32) sound_buffer[sb], SFX_THREAD_FRAG_SIZE);
+ AUDIO_StartDMA();
+
+ LWP_ThreadSignal(sfx_queue);
+}
+
+static void * sfx_thread_func(void *arg) {
+ u8 next_sb;
+
+ while (true) {
+ LWP_ThreadSleep(sfx_queue);
+
+ if (sfx_thread_quit)
+ break;
+
+ next_sb = sb ^ 1;
+ sound_proc(proc_param, sound_buffer[next_sb], SFX_THREAD_FRAG_SIZE);
+ DCFlushRange(sound_buffer[next_sb], SFX_THREAD_FRAG_SIZE);
+
+ sb = next_sb;
+ }
+
+ return NULL;
+}
+
+void OSystem_Wii::initSfx() {
+ sfx_thread_running = false;
+ sfx_thread_quit = false;
+
+ sfx_stack = (u8 *) memalign(32, SFX_THREAD_STACKSIZE);
+ memset(sfx_stack, 0, SFX_THREAD_STACKSIZE);
+
+ LWP_InitQueue(&sfx_queue);
+
+ s32 res = LWP_CreateThread(&sfx_thread, sfx_thread_func, NULL, sfx_stack,
+ SFX_THREAD_STACKSIZE, SFX_THREAD_PRIO);
+
+ if (res) {
+ printf("ERROR creating sfx thread: %d\n", res);
+ LWP_CloseQueue(sfx_queue);
+ return;
+ }
+
+ sfx_thread_running = true;
+
+ sound_buffer[0] = (u8 *) memalign(32, SFX_THREAD_FRAG_SIZE);
+ sound_buffer[1] = (u8 *) memalign(32, SFX_THREAD_FRAG_SIZE);
+
+ memset(sound_buffer[0], 0, SFX_THREAD_FRAG_SIZE);
+ memset(sound_buffer[1], 0, SFX_THREAD_FRAG_SIZE);
+
+ DCFlushRange(sound_buffer[0], SFX_THREAD_FRAG_SIZE);
+ DCFlushRange(sound_buffer[1], SFX_THREAD_FRAG_SIZE);
+
+ sound_proc = Audio::Mixer::mixCallback;
+ proc_param = _mixer;
+
+ _mixer->setReady(true);
+
+ AUDIO_SetDSPSampleRate(AI_SAMPLERATE_48KHZ);
+ AUDIO_RegisterDMACallback(audio_switch_buffers);
+
+ audio_switch_buffers();
+}
+
+void OSystem_Wii::deinitSfx() {
+ if (_mixer)
+ _mixer->setReady(false);
+
+ AUDIO_StopDMA();
+ AUDIO_RegisterDMACallback(NULL);
+
+ if (sfx_thread_running) {
+ sfx_thread_quit = true;
+ LWP_ThreadBroadcast(sfx_queue);
+
+ LWP_JoinThread(sfx_thread, NULL);
+ LWP_CloseQueue(sfx_queue);
+
+ sfx_thread_running = false;
+
+ free(sound_buffer[0]);
+ free(sound_buffer[1]);
+ }
+}
+
+int OSystem_Wii::getOutputSampleRate() const {
+ return 48000;
+}
+
diff --git a/common/rect.h b/common/rect.h
index d88f400039..f71124434a 100644
--- a/common/rect.h
+++ b/common/rect.h
@@ -61,7 +61,7 @@ struct Point {
if (diffy >= 0x1000)
return 0xFFFFFF;
- return diffx*diffx + diffy*diffy;
+ return uint(diffx*diffx + diffy*diffy);
}
};
diff --git a/common/scummsys.h b/common/scummsys.h
index 4299de7243..939f34a5c3 100644
--- a/common/scummsys.h
+++ b/common/scummsys.h
@@ -369,6 +369,14 @@
#define STRINGBUFLEN 256
#define printf(fmt, ...) consolePrintf(fmt, ##__VA_ARGS__)
+#elif defined(__WII__)
+
+ #define scumm_stricmp strcasecmp
+ #define scumm_strnicmp strncasecmp
+
+ #define SCUMM_BIG_ENDIAN
+ #define SCUMM_NEED_ALIGNMENT
+
#else
#error No system type defined
diff --git a/common/system.cpp b/common/system.cpp
index f133f3c4e3..015f246b7a 100644
--- a/common/system.cpp
+++ b/common/system.cpp
@@ -137,7 +137,7 @@ void OSystem::clearScreen() {
#endif
FilesystemFactory *OSystem::getFilesystemFactory() {
- #if defined(__amigaos4__) || defined(__DC__) || defined(__SYMBIAN32__) || defined(UNIX) || defined(WIN32) || defined(__PSP__) || defined(__DS__)
+ #if defined(__amigaos4__) || defined(__DC__) || defined(__SYMBIAN32__) || defined(UNIX) || defined(WIN32) || defined(__WII__) || defined(__PSP__) || defined(__DS__)
// These ports already implement this function, so it should never be called.
return 0;
#elif defined(PALMOS_MODE)
diff --git a/configure b/configure
index 960ed4063f..f91819b7f1 100755
--- a/configure
+++ b/configure
@@ -943,6 +943,12 @@ if test "$_cxx_major" -ge "3" ; then
add_line_to_config_mk 'HAVE_GCC3 = 1'
fi;
+if test "$_cxx_major" -ge "4" && test "$_cxx_minor" -ge "3" ; then
+ CXXFLAGS="$CXXFLAGS -Wno-parentheses -Wno-empty-body"
+else
+ CXXFLAGS="$CXXFLAGS -Wconversion"
+fi;
+
add_to_config_mk_if_no $_build_hq_scalers 'DISABLE_HQ_SCALERS = 1'
add_to_config_mk_if_no $_build_scalers 'DISABLE_SCALERS = 1'
diff --git a/dists/msvc7/cruise.vcproj b/dists/msvc7/cruise.vcproj
index d34f910c0d..bac134e02c 100644
--- a/dists/msvc7/cruise.vcproj
+++ b/dists/msvc7/cruise.vcproj
@@ -244,12 +244,6 @@
RelativePath="..\..\engines\cruise\stack.h">
</File>
<File
- RelativePath="..\..\engines\cruise\stringSupport.cpp">
- </File>
- <File
- RelativePath="..\..\engines\cruise\stringSupport.h">
- </File>
- <File
RelativePath="..\..\engines\cruise\various.cpp">
</File>
<File
diff --git a/dists/msvc71/cruise.vcproj b/dists/msvc71/cruise.vcproj
index 1915be0c5d..53ed72f60e 100644
--- a/dists/msvc71/cruise.vcproj
+++ b/dists/msvc71/cruise.vcproj
@@ -258,12 +258,6 @@
RelativePath="..\..\engines\cruise\stack.h">
</File>
<File
- RelativePath="..\..\engines\cruise\stringSupport.cpp">
- </File>
- <File
- RelativePath="..\..\engines\cruise\stringSupport.h">
- </File>
- <File
RelativePath="..\..\engines\cruise\various.cpp">
</File>
<File
diff --git a/dists/msvc8/cruise.vcproj b/dists/msvc8/cruise.vcproj
index 45479ef22f..f183d07ee3 100644
--- a/dists/msvc8/cruise.vcproj
+++ b/dists/msvc8/cruise.vcproj
@@ -357,14 +357,6 @@
>
</File>
<File
- RelativePath="..\..\engines\cruise\stringSupport.cpp"
- >
- </File>
- <File
- RelativePath="..\..\engines\cruise\stringSupport.h"
- >
- </File>
- <File
RelativePath="..\..\engines\cruise\various.cpp"
>
</File>
diff --git a/dists/msvc9/cruise.vcproj b/dists/msvc9/cruise.vcproj
index 2d47ab4d2c..19a96eb7be 100644
--- a/dists/msvc9/cruise.vcproj
+++ b/dists/msvc9/cruise.vcproj
@@ -358,14 +358,6 @@
>
</File>
<File
- RelativePath="..\..\engines\cruise\stringSupport.cpp"
- >
- </File>
- <File
- RelativePath="..\..\engines\cruise\stringSupport.h"
- >
- </File>
- <File
RelativePath="..\..\engines\cruise\various.cpp"
>
</File>
diff --git a/dists/wii/READMII b/dists/wii/READMII
new file mode 100644
index 0000000000..4f157dffe7
--- /dev/null
+++ b/dists/wii/READMII
@@ -0,0 +1,64 @@
+Wii port of ScummVM README
+--------------------------
+
+features not compiled in:
+- the AGI game engine
+
+REQUIREMENTS
+
+ - sd card
+ - wiimote or gamecube controller in port 1
+
+INSTALL
+
+ - copy the "apps" folder to the root of your sd card
+ - copy your demos and/or games onto the same sd card
+ each game goes into its own subdirectory, do not place those under
+ "/apps/scummvm", and do not set the "theme" or "extra" path to that folder
+ freeware versions: http://scummvm.org/downloads.php#extras
+ demos: http://scummvm.org/demos.php
+
+RUN
+
+ either use the homebrew channel, available at
+
+ http://hbc.hackmii.com/
+
+ or load "boot.dol" with your favorite loader
+
+CONTROLS
+
+ wiimote
+
+ analog stick: mouse movement
+ a: left mouse button
+ b: right mouse button
+ minus: escape
+ plus: "." (skip current line of text)
+ 2: enter
+ home: f5 (scummvm menu)
+ dpad up: shift (mass add for the gui)
+ dpad down: "0"
+ dpad left: "y"
+ dpad right: "n"
+
+ gamecube pad
+
+ analog stick: mouse movement
+ a: left mouse button
+ b: right mouse button
+ x: escape
+ y: "." (skip current line of text)
+ z: enter
+ start: f5 (scummvm menu)
+ dpad up: shift (mass add for the gui)
+ dpad down: "0"
+ dpad left: "y"
+ dpad right: "n"
+
+THANKS
+
+ shagkur and WinterMute, for devkitppc/libogc and the coorperation
+ svpe, for fixing the libfat feof/thread bugs on the last minute
+ para, for making wiiuse available in libogc
+
diff --git a/dists/wii/icon.png b/dists/wii/icon.png
new file mode 100644
index 0000000000..dc873e66f2
--- /dev/null
+++ b/dists/wii/icon.png
Binary files differ
diff --git a/dists/wii/meta.xml b/dists/wii/meta.xml
new file mode 100644
index 0000000000..fb53474052
--- /dev/null
+++ b/dists/wii/meta.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<app version="1">
+ <name>ScummVM</name>
+ <coder>The ScummVM Team</coder>
+ <version>rev FIXME</version>
+ <release_date>FIXME</release_date>
+ <short_description>Point &amp; Click Adventures</short_description>
+ <long_description>ScummVM is a program which allows you to run certain classic graphical point-and-click adventure games, provided you already have their data files. The clever part about this: ScummVM just replaces the executables shipped with the games, allowing you to play them on systems for which they were never designed!
+
+Some of the adventures ScummVM supports include Adventure Soft's Simon the Sorcerer 1 and 2; Revolution's Beneath A Steel Sky, Broken Sword 1 and Broken Sword 2; Flight of the Amazon Queen; Wyrmkeep's Inherit the Earth; Coktel Vision's Gobliiins; Westwood Studios' The Legend of Kyrandia and games based on LucasArts' SCUMM (Script Creation Utility for Maniac Mansion) system such as Monkey Island, Day of the Tentacle, Sam and Max and more.</long_description>
+</app>
+
diff --git a/engines/cruise/cruise_main.h b/engines/cruise/cruise_main.h
index c7d597dbd6..60afe5fa4c 100644
--- a/engines/cruise/cruise_main.h
+++ b/engines/cruise/cruise_main.h
@@ -45,7 +45,6 @@
#include "cruise/stack.h"
#include "cruise/script.h"
#include "cruise/various.h"
-#include "cruise/stringSupport.h"
#include "cruise/function.h"
#include "cruise/saveload.h"
#include "cruise/linker.h"
diff --git a/engines/cruise/module.mk b/engines/cruise/module.mk
index 384d7a1ecb..8db5b1da44 100644
--- a/engines/cruise/module.mk
+++ b/engines/cruise/module.mk
@@ -27,7 +27,6 @@ MODULE_OBJS := \
saveload.o \
script.o \
stack.o \
- stringSupport.o \
various.o \
vars.o \
volume.o
diff --git a/engines/drascula/animation.cpp b/engines/drascula/animation.cpp
index 018b6e2a04..13425f7250 100644
--- a/engines/drascula/animation.cpp
+++ b/engines/drascula/animation.cpp
@@ -58,7 +58,7 @@ void DrasculaEngine::animation_1_1() {
while (term_int == 0) {
playMusic(29);
- fliplay("logoddm.bin", 9);
+ playFLI("logoddm.bin", 9);
if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
delay(600);
@@ -72,7 +72,7 @@ void DrasculaEngine::animation_1_1() {
delay(500);
if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- fliplay("logoalc.bin", 8);
+ playFLI("logoalc.bin", 8);
if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
clearRoom();
@@ -97,7 +97,7 @@ void DrasculaEngine::animation_1_1() {
if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- fliplay("scrollb.bin", 9);
+ playFLI("scrollb.bin", 9);
if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
@@ -119,10 +119,10 @@ void DrasculaEngine::animation_1_1() {
break;
clearRoom();
- loadPic("96.alg", frontSurface, COMPLETE_PAL);
- loadPic("103.alg", drawSurface1, HALF_PAL);
- loadPic("104.alg", drawSurface3, 1);
- loadPic("aux104.alg", drawSurface2, 1);
+ loadPic(96, frontSurface, COMPLETE_PAL);
+ loadPic(103, drawSurface1, HALF_PAL);
+ loadPic(104, drawSurface3);
+ loadPic("aux104.alg", drawSurface2);
playMusic(4);
if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
@@ -182,13 +182,13 @@ void DrasculaEngine::animation_1_1() {
clearRoom();
- loadPic("100.alg", drawSurface1, HALF_PAL);
- loadPic("auxigor.alg", frontSurface, 1);
- loadPic("auxdr.alg", backSurface, 1);
- sentido_dr = 0;
+ loadPic(100, drawSurface1, HALF_PAL);
+ loadPic("auxigor.alg", frontSurface);
+ loadPic("auxdr.alg", backSurface);
+ trackDrascula = 0;
x_dr = 129;
y_dr = 95;
- sentido_igor = 1;
+ trackIgor = 1;
igorX = 66;
igorY = 97;
@@ -252,7 +252,7 @@ void DrasculaEngine::animation_1_1() {
if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
clearRoom();
- loadPic("100.alg", drawSurface1, HALF_PAL);
+ loadPic(100, drawSurface1, HALF_PAL);
MusicFadeout();
stopMusic();
if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
@@ -288,20 +288,20 @@ void DrasculaEngine::animation_1_1() {
fadeFromBlack(0);
if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- sentido_dr = 1;
+ trackDrascula = 1;
talk_igor(1, kIgorDch);
if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
talk_drascula(11, 1);
if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- sentido_dr = 3;
+ trackDrascula = 3;
copyBackground(0, 0, 0, 0, 320, 200, drawSurface1, screenSurface);
placeIgor();
placeDrascula();
updateScreen();
pause(1);
- sentido_dr = 0;
+ trackDrascula = 0;
copyBackground(0, 0, 0, 0, 320, 200, drawSurface1, screenSurface);
placeIgor();
placeDrascula();
@@ -309,13 +309,13 @@ void DrasculaEngine::animation_1_1() {
talk_drascula(12);
if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- sentido_dr = 3;
+ trackDrascula = 3;
copyBackground(0, 0, 0, 0, 320, 200, drawSurface1, screenSurface);
placeIgor();
placeDrascula();
updateScreen();
pause(1);
- sentido_dr = 1;
+ trackDrascula = 1;
copyBackground(0, 0, 0, 0, 320, 200, drawSurface1, screenSurface);
placeIgor();
placeDrascula();
@@ -327,13 +327,13 @@ void DrasculaEngine::animation_1_1() {
talk_drascula(13, 1);
if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- sentido_dr = 3;
+ trackDrascula = 3;
copyBackground(0, 0, 0, 0, 320, 200, drawSurface1, screenSurface);
placeIgor();
placeDrascula();
updateScreen();
pause(1);
- sentido_dr = 0;
+ trackDrascula = 0;
copyBackground(0, 0, 0, 0, 320, 200, drawSurface1, screenSurface);
placeIgor();
placeDrascula();
@@ -356,7 +356,7 @@ void DrasculaEngine::animation_1_1() {
talk_igor(5, kIgorDch);
if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- sentido_igor = 3;
+ trackIgor = 3;
talk_drascula(17);
if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
@@ -373,18 +373,18 @@ void DrasculaEngine::animation_1_1() {
playMusic(2);
pause(5);
- fliplay("intro.bin", 12);
+ playFLI("intro.bin", 12);
term_int = 1;
}
clearRoom();
- loadPic("96.alg", frontSurface, COMPLETE_PAL);
- loadPic("99.alg", backSurface, 1);
+ loadPic(96, frontSurface, COMPLETE_PAL);
+ loadPic(99, backSurface);
}
void DrasculaEngine::animation_2_1() {
int l;
- lleva_al_hare(231, 91);
+ gotoObject(231, 91);
hare_se_ve = 0;
term_int = 0;
@@ -399,7 +399,7 @@ void DrasculaEngine::animation_2_1() {
if (_lang == kSpanish)
textSurface = frontSurface;
- loadPic("an11y13.alg", extraSurface, 1);
+ loadPic("an11y13.alg", extraSurface);
if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
@@ -410,7 +410,7 @@ void DrasculaEngine::animation_2_1() {
if (_lang == kSpanish)
textSurface = extraSurface;
- loadPic("97.alg", extraSurface, 1);
+ loadPic(97, extraSurface);
if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
@@ -448,10 +448,10 @@ void DrasculaEngine::animation_2_1() {
break;
clearRoom();
- loadPic("16.alg", drawSurface1, HALF_PAL);
+ loadPic(16, drawSurface1, HALF_PAL);
if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- loadPic("auxbj.alg", drawSurface3, 1);
+ loadPic("auxbj.alg", drawSurface3);
if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
@@ -463,27 +463,27 @@ void DrasculaEngine::animation_2_1() {
factor_red[l] = 99;
x_bj = 170;
y_bj = 90;
- sentido_bj = 0;
- hare_x = 91;
- hare_y = 95;
- sentido_hare = 1;
+ trackBJ = 0;
+ curX = 91;
+ curY = 95;
+ trackProtagonist = 1;
hare_se_ve = 1;
if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- loadPic("97g.alg", extraSurface, 1);
+ loadPic("97g.alg", extraSurface);
if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
if (animate("lev.bin", 15))
break;
- lleva_al_hare(100 + ancho_hare / 2, 99 + alto_hare);
+ gotoObject(100 + curWidth / 2, 99 + curHeight);
if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- sentido_hare = 1;
- hare_x = 100;
- hare_y = 95;
+ trackProtagonist = 1;
+ curX = 100;
+ curY = 95;
talk_bj(2);
talk(215);
@@ -507,7 +507,7 @@ void DrasculaEngine::animation_2_1() {
if (animate("bjb.bin", 14))
break;
playMusic(9);
- loadPic("97.alg", extraSurface, 1);
+ loadPic(97, extraSurface);
if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
updateRoom();
@@ -538,7 +538,7 @@ void DrasculaEngine::animation_2_1() {
pause(118);
if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- lleva_al_hare(132, 97 + alto_hare);
+ gotoObject(132, 97 + curHeight);
pause(60);
if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
@@ -546,7 +546,7 @@ void DrasculaEngine::animation_2_1() {
if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
talk_bj(12);
- lleva_al_hare(157, 98 + alto_hare);
+ gotoObject(157, 98 + curHeight);
if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
if (animate("bes.bin", 16))
@@ -554,7 +554,7 @@ void DrasculaEngine::animation_2_1() {
playMusic(11);
if (animate("rap.bin", 16))
break;
- sentido_hare = 3;
+ trackProtagonist = 3;
// The room number was originally changed here to "no_bj.alg",
// which doesn't exist. In reality, this was just a hack to
// set the room number to a non-existant one, so that BJ does
@@ -573,7 +573,7 @@ void DrasculaEngine::animation_2_1() {
pause(76);
if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- sentido_hare = 1;
+ trackProtagonist = 1;
updateRoom();
updateScreen();
talk(226);
@@ -594,7 +594,7 @@ void DrasculaEngine::animation_3_1() {
if (_lang == kSpanish)
textSurface = frontSurface;
- loadPic("an11y13.alg", extraSurface, 1);
+ loadPic("an11y13.alg", extraSurface);
talk(192);
talk_bartender(1);
@@ -622,14 +622,14 @@ void DrasculaEngine::animation_3_1() {
if (_lang == kSpanish)
textSurface = extraSurface;
- loadPic("97.alg", extraSurface, 1);
+ loadPic(97, extraSurface);
}
void DrasculaEngine::animation_4_1() {
if (_lang == kSpanish)
textSurface = frontSurface;
- loadPic("an12.alg", extraSurface, 1);
+ loadPic("an12.alg", extraSurface);
talk(205);
@@ -643,7 +643,7 @@ void DrasculaEngine::animation_4_1() {
updateRefresh_pre();
copyBackground(49, 139, 228, 112, 47, 60, extraSurface, screenSurface);
- pon_hare();
+ moveCharacters();
updateScreen();
@@ -664,22 +664,22 @@ void DrasculaEngine::animation_4_1() {
textSurface = extraSurface;
flags[11] = 0;
- loadPic("97.alg", extraSurface, 1);
+ loadPic(97, extraSurface);
}
void DrasculaEngine::animation_1_2() {
- lleva_al_hare(178, 121);
- lleva_al_hare(169, 135);
+ gotoObject(178, 121);
+ gotoObject(169, 135);
}
void DrasculaEngine::animation_2_2() {
- sentido_hare = 0;
+ trackProtagonist = 0;
copyBackground(0, 0, 0, 0, 320, 200, drawSurface1, screenSurface);
- pon_hare();
+ moveCharacters();
updateRefresh();
updateScreen();
- loadPic("an2_1.alg", frontSurface, 1);
- loadPic("an2_2.alg", extraSurface, 1);
+ loadPic("an2_1.alg", frontSurface);
+ loadPic("an2_2.alg", extraSurface);
copyBackground(0, 0, 0, 0, 320, 200, drawSurface1, screenSurface);
copyBackground(1, 1, 201, 87, 50, 52, frontSurface, screenSurface);
@@ -708,9 +708,9 @@ void DrasculaEngine::animation_2_2() {
}
void DrasculaEngine::animation_3_2() {
- lleva_al_hare(163, 106);
- lleva_al_hare(287, 101);
- sentido_hare = 0;
+ gotoObject(163, 106);
+ gotoObject(287, 101);
+ trackProtagonist = 0;
}
void DrasculaEngine::animation_4_2() {
@@ -723,10 +723,10 @@ void DrasculaEngine::animation_4_2() {
clearRoom();
loadPic("ciego1.alg", drawSurface1, HALF_PAL); // ciego = blind
- loadPic("ciego2.alg", drawSurface3, 1);
- loadPic("ciego3.alg", extraSurface, 1);
- loadPic("ciego4.alg", backSurface, 1);
- loadPic("ciego5.alg", frontSurface, 1);
+ loadPic("ciego2.alg", drawSurface3);
+ loadPic("ciego3.alg", extraSurface);
+ loadPic("ciego4.alg", backSurface);
+ loadPic("ciego5.alg", frontSurface);
if (_lang == kSpanish)
textSurface = frontSurface;
@@ -769,11 +769,11 @@ void DrasculaEngine::animation_4_2() {
clearRoom();
playMusic(roomMusic);
- loadPic("9.alg", drawSurface1, HALF_PAL);
- loadPic("aux9.alg", drawSurface3, 1);
- loadPic("96.alg", frontSurface, 1);
- loadPic("97.alg", extraSurface, 1);
- loadPic("99.alg", backSurface, 1);
+ loadPic(9, drawSurface1, HALF_PAL);
+ loadPic("aux9.alg", drawSurface3);
+ loadPic(96, frontSurface);
+ loadPic(97, extraSurface);
+ loadPic(99, backSurface);
withoutVerb();
if (_lang == kSpanish)
@@ -813,7 +813,7 @@ void DrasculaEngine::animation_14_2() {
int n, pos_cabina[6];
int l = 0;
- loadPic("an14_2.alg", backSurface, 1);
+ loadPic("an14_2.alg", backSurface);
pos_cabina[0] = 150;
pos_cabina[1] = 6;
@@ -825,8 +825,8 @@ void DrasculaEngine::animation_14_2() {
for (n = -160; n <= 0; n = n + 5 + l) {
copyBackground(0, 0, 0, 0, 320, 200, drawSurface1, screenSurface);
updateRefresh_pre();
- pon_hare();
- pon_vb();
+ moveCharacters();
+ moveVB();
pos_cabina[3] = n;
copyRectClip(pos_cabina, backSurface, screenSurface);
updateRefresh();
@@ -836,14 +836,14 @@ void DrasculaEngine::animation_14_2() {
flags[24] = 1;
- decompressPic(drawSurface1, 1);
+ memcpy(drawSurface1, screenSurface, 64000);
playSound(7);
hiccup(15);
finishSound();
- loadPic("99.alg", backSurface, 1);
+ loadPic(99, backSurface);
}
void DrasculaEngine::animation_15_2() {
@@ -958,7 +958,7 @@ void DrasculaEngine::animation_16_2() {
clearRoom();
loadPic("his4_1.alg", drawSurface1, HALF_PAL);
- loadPic("his4_2.alg", drawSurface3, 1);
+ loadPic("his4_2.alg", drawSurface3);
copyBackground(0, 0, 0, 0, 320, 200, drawSurface3, screenSurface);
@@ -993,10 +993,8 @@ void DrasculaEngine::animation_16_2() {
clearRoom();
asco:
- loadPic(roomDisk, drawSurface3, 1);
- char rm[20];
- sprintf(rm, "%i.alg", roomNumber);
- loadPic(rm, drawSurface1, HALF_PAL);
+ loadPic(roomDisk, drawSurface3);
+ loadPic(roomNumber, drawSurface1, HALF_PAL);
black();
updateRoom();
updateScreen();
@@ -1040,8 +1038,8 @@ void DrasculaEngine::animation_20_2() {
exitRoom(0);
flags[21] = 0;
flags[24] = 0;
- sentido_vb = 1;
- vb_x = 120;
+ trackVB = 1;
+ vbX = 120;
breakOut = 1;
}
@@ -1052,7 +1050,7 @@ void DrasculaEngine::animation_21_2() {
}
void DrasculaEngine::animation_23_2() {
- loadPic("an24.alg", frontSurface, 1);
+ loadPic("an24.alg", frontSurface);
flags[21] = 1;
@@ -1064,18 +1062,18 @@ void DrasculaEngine::animation_23_2() {
}
talk_vb(15);
- lleva_vb(42);
- sentido_vb = 1;
+ placeVB(42);
+ trackVB = 1;
talk_vb(16);
- sentido_vb = 2;
- lleva_al_hare(157, 147);
- lleva_al_hare(131, 149);
- sentido_hare = 0;
+ trackVB = 2;
+ gotoObject(157, 147);
+ gotoObject(131, 149);
+ trackProtagonist = 0;
animation_14_2();
if (flags[25] == 0)
talk_vb(17);
pause(8);
- sentido_vb = 1;
+ trackVB = 1;
talk_vb(18);
if (flags[29] == 0)
@@ -1083,19 +1081,19 @@ void DrasculaEngine::animation_23_2() {
else
animation_23_joined2();
- sentido_vb = 2;
+ trackVB = 2;
animation_25_2();
- lleva_vb(99);
+ placeVB(99);
if (flags[29] == 0) {
talk_vb(19);
if (flags[25] == 0) {
talk_vb(20);
- if (removeObject(7) == 0)
+ if (removeObject(kItemMoney) == 0)
flags[30] = 1;
- if (removeObject(18) == 0)
+ if (removeObject(kItemTwoCoins) == 0)
flags[31] = 1;
- if (removeObject(19) == 0)
+ if (removeObject(kItemOneCoin) == 0)
flags[32] = 1;
}
talk_vb(21);
@@ -1107,13 +1105,13 @@ void DrasculaEngine::animation_23_2() {
}
void DrasculaEngine::animation_23_joined() {
- int n, p_x = hare_x + 2, p_y = hare_y - 3;
+ int n, p_x = curX + 2, p_y = curY - 3;
int x[] = {1, 38, 75, 112, 75, 112, 75, 112, 149, 112, 149, 112, 149, 186, 223, 260,
1, 38, 75, 112, 149, 112, 149, 112, 149, 112, 149, 186, 223, 260, 260, 260, 260, 223};
int y[] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 76, 76, 76, 76, 76, 76, 76,
76, 76, 76, 76, 76, 76, 76, 1, 1, 1, 1};
- loadPic("an23.alg", backSurface, 1);
+ loadPic("an23.alg", backSurface);
for (n = 0; n < 34; n++) {
copyRect(p_x, p_y, p_x, p_y, 36, 74, drawSurface1, screenSurface);
@@ -1123,17 +1121,17 @@ void DrasculaEngine::animation_23_joined() {
pause(5);
}
- loadPic("99.alg", backSurface, 1);
+ loadPic(99, backSurface);
}
void DrasculaEngine::animation_23_joined2() {
- int n, p_x = hare_x + 4, p_y = hare_y;
+ int n, p_x = curX + 4, p_y = curY;
int x[] = {1, 35, 69, 103, 137, 171, 205, 239, 273, 1, 35, 69, 103, 137};
int y[] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 73, 73, 73, 73, 73};
pause(50);
- loadPic("an23_2.alg", backSurface, 1);
+ loadPic("an23_2.alg", backSurface);
for (n = 0; n < 14; n++) {
copyRect(p_x, p_y, p_x, p_y, 33, 71, drawSurface1, screenSurface);
@@ -1143,14 +1141,14 @@ void DrasculaEngine::animation_23_joined2() {
pause(5);
}
- loadPic("99.alg", backSurface,1);
+ loadPic(99, backSurface);
}
void DrasculaEngine::animation_25_2() {
int n, pos_cabina[6];
- loadPic("an14_2.alg", backSurface, 1);
- loadPic("18.alg", drawSurface1, 1);
+ loadPic("an14_2.alg", backSurface);
+ loadPic(18, drawSurface1);
pos_cabina[0] = 150;
pos_cabina[1] = 6;
@@ -1167,8 +1165,8 @@ void DrasculaEngine::animation_25_2() {
copyBackground(0, 0, 0, 0, 320, 200, drawSurface1, screenSurface);
updateRefresh_pre();
- pon_hare();
- pon_vb();
+ moveCharacters();
+ moveVB();
pos_cabina[3] = n;
@@ -1180,24 +1178,24 @@ void DrasculaEngine::animation_25_2() {
finishSound();
- loadPic("99.alg", backSurface, 1);
+ loadPic(99, backSurface);
}
void DrasculaEngine::animation_27_2() {
flags[22] = 1;
withoutVerb();
- removeObject(23);
- addObject(11);
+ removeObject(kItemEarWithEarPlug);
+ addObject(kItemEarplugs);
talk_vb(23);
talk_vb(24);
if (flags[30] == 1)
- addObject(7);
+ addObject(kItemMoney);
if (flags[31] == 1)
- addObject(18);
+ addObject(kItemTwoCoins);
if (flags[32] == 1)
- addObject(19);
+ addObject(kItemOneCoin);
talk_vb(25);
talk_vb(26);
}
@@ -1245,20 +1243,20 @@ void DrasculaEngine::animation_30_2() {
void DrasculaEngine::animation_31_2() {
talk_vb(44);
- lleva_vb(-50);
+ placeVB(-50);
pause(15);
- lleva_al_hare(159, 140);
- loadPic("99.alg", backSurface, 1);
- sentido_hare = 2;
+ gotoObject(159, 140);
+ loadPic(99, backSurface);
+ trackProtagonist = 2;
updateRoom();
updateScreen();
pause(78);
- sentido_hare = 0;
+ trackProtagonist = 0;
updateRoom();
updateScreen();
pause(22);
talk(406);
- lleva_vb(98);
+ placeVB(98);
talk_vb(45);
talk_vb(46);
talk_vb(47);
@@ -1282,23 +1280,23 @@ void DrasculaEngine::animation_31_2() {
flags[38] = 0;
flags[36] = 1;
withoutVerb();
- removeObject(8);
- removeObject(13);
- removeObject(15);
- removeObject(16);
- removeObject(17);
- addObject(20);
+ removeObject(kItemLeaves);
+ removeObject(kItemBubbleGum);
+ removeObject(kItemTissues);
+ removeObject(kItemCigarettes);
+ removeObject(kItemCandle);
+ addObject(kItemReefer);
}
void DrasculaEngine::animation_35_2() {
- lleva_al_hare(96, 165);
- lleva_al_hare(79, 165);
+ gotoObject(96, 165);
+ gotoObject(79, 165);
updateRoom();
updateScreen();
- loadPic("an35_1.alg", backSurface, 1);
- loadPic("an35_2.alg", frontSurface, 1);
+ loadPic("an35_1.alg", backSurface);
+ loadPic("an35_2.alg", frontSurface);
updateAnim(1, 70, 90, 46, 80, 6, backSurface);
updateAnim(82, 70, 90, 46, 80, 6, backSurface);
@@ -1340,19 +1338,19 @@ void DrasculaEngine::animation_2_3() {
flags[0] = 0;
flags[1] = 1;
- loadPic("96.alg", frontSurface, 1);
- loadPic("97.alg", extraSurface, 1);
- loadPic("99.alg", backSurface, 1);
+ loadPic(96, frontSurface);
+ loadPic(97, extraSurface);
+ loadPic(99, backSurface);
- lleva_al_hare(332, 127);
+ gotoObject(332, 127);
}
void DrasculaEngine::animation_3_3() {
- int px = hare_x - 20, py = hare_y - 1;
+ int px = curX - 20, py = curY - 1;
- loadPic("an2y_1.alg", frontSurface, 1);
- loadPic("an2y_2.alg", extraSurface, 1);
- loadPic("an2y_3.alg", backSurface, 1);
+ loadPic("an2y_1.alg", frontSurface);
+ loadPic("an2y_2.alg", extraSurface);
+ loadPic("an2y_3.alg", backSurface);
updateAnim2(2, px, py, 71, 72, 4, frontSurface);
updateAnim2(75, px, py, 71, 72, 4, frontSurface);
@@ -1365,9 +1363,9 @@ void DrasculaEngine::animation_3_3() {
void DrasculaEngine::animation_4_3() {
int px = 120, py = 63;
- loadPic("any_1.alg", frontSurface, 1);
- loadPic("any_2.alg", extraSurface, 1);
- loadPic("any_3.alg", backSurface, 1);
+ loadPic("any_1.alg", frontSurface);
+ loadPic("any_2.alg", extraSurface);
+ loadPic("any_3.alg", backSurface);
updateAnim2(1, px, py, 77, 89, 4, frontSurface);
updateAnim2(91, px, py, 77, 89, 4, frontSurface);
@@ -1378,11 +1376,11 @@ void DrasculaEngine::animation_4_3() {
}
void DrasculaEngine::animation_5_3() {
- int px = hare_x - 20, py = hare_y - 1;
+ int px = curX - 20, py = curY - 1;
- loadPic("an3y_1.alg", frontSurface, 1);
- loadPic("an3y_2.alg", extraSurface, 1);
- loadPic("an3y_3.alg", backSurface, 1);
+ loadPic("an3y_1.alg", frontSurface);
+ loadPic("an3y_2.alg", extraSurface);
+ loadPic("an3y_3.alg", backSurface);
updateAnim2(2, px, py, 71, 72, 4, frontSurface);
updateAnim2(75, px, py, 71, 72, 4, frontSurface);
@@ -1404,7 +1402,7 @@ void DrasculaEngine::animation_6_3() {
flags[1] = 0;
- loadPic("an4y.alg", frontSurface, 1);
+ loadPic("an4y.alg", frontSurface);
for (frame = 0; frame < 6; frame++) {
pause(3);
@@ -1415,18 +1413,18 @@ void DrasculaEngine::animation_6_3() {
flags[2] = 1;
- loadPic("96.alg", frontSurface, 1);
+ loadPic(96, frontSurface);
updateRoom();
updateScreen();
}
-void DrasculaEngine::animation_rayo() {
+void DrasculaEngine::animation_ray() {
loadPic("anr_1.alg", frontSurface, HALF_PAL);
- loadPic("anr_2.alg", extraSurface, 1);
- loadPic("anr_3.alg", backSurface, 1);
- loadPic("anr_4.alg", drawSurface1, 1);
- loadPic("anr_5.alg", drawSurface3, 1);
+ loadPic("anr_2.alg", extraSurface);
+ loadPic("anr_3.alg", backSurface);
+ loadPic("anr_4.alg", drawSurface1);
+ loadPic("anr_5.alg", drawSurface3);
updateScreen(0, 0, 0, 0, 320, 200, frontSurface);
@@ -1494,17 +1492,17 @@ void DrasculaEngine::animation_1_5() {
talk_bj(19);
talk(229);
pause(5);
- lleva_al_hare(114, 170);
- sentido_hare = 3;
+ gotoObject(114, 170);
+ trackProtagonist = 3;
talk(431);
talk_bj(20);
- sentido_hare = 2;
+ trackProtagonist = 2;
pause(4);
talk(438);
- sitio_x = 120;
- sitio_y = 157;
+ roomX = 120;
+ roomY = 157;
walkToObject = 1;
- sentido_final = 1;
+ trackFinal = 1;
startWalking();
talk_bj(21);
@@ -1515,13 +1513,13 @@ void DrasculaEngine::animation_1_5() {
updateScreen();
}
- sentido_hare = 1;
+ trackProtagonist = 1;
talk(229);
flags[0] = 1;
}
- sentido_hare = 1;
- converse("op_8.cal");
+ trackProtagonist = 1;
+ converse(8);
}
void DrasculaEngine::animation_2_5() {
@@ -1558,26 +1556,26 @@ void DrasculaEngine::animation_4_5() {
void DrasculaEngine::animation_5_5(){
int h;
int frame = 0;
- int hueso_x[] = {1, 99, 197, 1, 99, 197, 1, 99, 197};
- int hueso_y[] = {1, 1, 1, 66, 66, 66, 131, 131, 131};
- int vuela_x[] = {1, 63, 125, 187, 249};
- int pixelX = hare_x - 53, pixelY = hare_y - 9;
+ int boneX[] = {1, 99, 197, 1, 99, 197, 1, 99, 197};
+ int boneY[] = {1, 1, 1, 66, 66, 66, 131, 131, 131};
+ int flyX[] = {1, 63, 125, 187, 249};
+ int pixelX = curX - 53, pixelY = curY - 9;
withoutVerb();
removeObject(8);
- lleva_al_hare(hare_x - 19, hare_y + alto_hare);
- sentido_hare = 1;
+ gotoObject(curX - 19, curY + curHeight);
+ trackProtagonist = 1;
updateRoom();
updateScreen();
- loadPic("3an5_1.alg", backSurface, 1);
- loadPic("3an5_2.alg", frontSurface, 1);
+ loadPic("3an5_1.alg", backSurface);
+ loadPic("3an5_2.alg", frontSurface);
for (frame = 0; frame < 9; frame++) {
pause(3);
copyBackground(0, 0, 0, 0, 320, 200, drawSurface1, screenSurface);
- copyRect(hueso_x[frame], hueso_y[frame], pixelX, pixelY, 97, 64, backSurface, screenSurface);
+ copyRect(boneX[frame], boneY[frame], pixelX, pixelY, 97, 64, backSurface, screenSurface);
updateScreen(pixelX, pixelY, pixelX,pixelY, 97,64, screenSurface);
}
@@ -1587,7 +1585,7 @@ void DrasculaEngine::animation_5_5(){
for (frame = 0; frame < 9; frame++) {
pause(3);
copyBackground(0, 0, 0, 0, 320, 200, drawSurface1, screenSurface);
- copyRect(hueso_x[frame], hueso_y[frame], pixelX, pixelY, 97, 64, frontSurface, screenSurface);
+ copyRect(boneX[frame], boneY[frame], pixelX, pixelY, 97, 64, frontSurface, screenSurface);
updateScreen(pixelX, pixelY, pixelX,pixelY, 97, 64, screenSurface);
}
@@ -1595,26 +1593,26 @@ void DrasculaEngine::animation_5_5(){
updateVisible();
pause(12);
- loadPic("96.alg", frontSurface, 1);
+ loadPic(96, frontSurface);
for (h = 0; h < (200 - 18); h++)
copyBackground(0, 53, 0, h, 320, 19, frontSurface, screenSurface);
updateScreen();
- loadPic("101.alg", drawSurface1, HALF_PAL);
- loadPic("3an5_3.alg", backSurface, 1);
- loadPic("3an5_4.alg", extraSurface, 1);
+ loadPic(101, drawSurface1, HALF_PAL);
+ loadPic("3an5_3.alg", backSurface);
+ loadPic("3an5_4.alg", extraSurface);
updateScreen(0, 0, 0, 0, 320, 200, drawSurface1);
pause(9);
for (frame = 0; frame < 5; frame++) {
pause(3);
- copyBackground(vuela_x[frame], 1, 174, 79, 61, 109, backSurface, screenSurface);
+ copyBackground(flyX[frame], 1, 174, 79, 61, 109, backSurface, screenSurface);
updateScreen(174, 79, 174, 79, 61, 109, screenSurface);
}
for (frame = 0; frame < 5; frame++) {
pause(3);
- copyBackground(vuela_x[frame], 1, 174, 79, 61, 109, extraSurface, screenSurface);
+ copyBackground(flyX[frame], 1, 174, 79, 61, 109, extraSurface, screenSurface);
updateScreen(174, 79, 174, 79, 61, 109, screenSurface);
}
updateScreen(0, 0, 0, 0, 320, 200, drawSurface1);
@@ -1622,12 +1620,12 @@ void DrasculaEngine::animation_5_5(){
playSound(1);
finishSound();
- loadPic("99.alg", backSurface, 1);
- loadPic("97.alg", extraSurface, 1);
+ loadPic(99, backSurface);
+ loadPic(97, extraSurface);
clearRoom();
- loadPic("49.alg", drawSurface1, HALF_PAL);
+ loadPic(49, drawSurface1, HALF_PAL);
}
void DrasculaEngine::animation_6_5() {
@@ -1684,9 +1682,8 @@ void DrasculaEngine::animation_12_5() {
const int rayX[] = {1, 46, 91, 136, 181, 226, 271, 181};
const int frusky_x[] = {100, 139, 178, 217, 100, 178, 217, 139, 100, 139};
const int elfrusky_x[] = {1, 68, 135, 1, 68, 135, 1, 68, 135, 68, 1, 135, 68, 135, 68};
- //const int humo_x[] = {1, 29, 57, 85, 113, 141, 169, 197, 225};
int color, component;
- char fundido;
+ char fade;
playMusic(26);
updateRoom();
@@ -1695,11 +1692,11 @@ void DrasculaEngine::animation_12_5() {
animate("rayo1.bin", 23);
playSound(5);
animate("rayo2.bin", 17);
- sentido_hare = 1;
+ trackProtagonist = 1;
updateRoom();
updateScreen();
- hare_oscuro();
+ setDarkPalette();
for (color = 0; color < 255; color++)
for (component = 0; component < 3; component++) {
@@ -1708,25 +1705,25 @@ void DrasculaEngine::animation_12_5() {
bgPalette3[color][component] = gamePalette[color][component];
}
- for (fundido = 1; fundido >= 0; fundido--) {
+ for (fade = 1; fade >= 0; fade--) {
for (color = 0; color < 128; color++)
for (component = 0; component < 3; component++)
- bgPalette1[color][component] = adjustToVGA(bgPalette1[color][component] - 8 + fundido);
+ bgPalette1[color][component] = adjustToVGA(bgPalette1[color][component] - 8 + fade);
}
- for (fundido = 2; fundido >= 0; fundido--) {
+ for (fade = 2; fade >= 0; fade--) {
for (color = 0; color < 128; color++)
for (component = 0; component < 3; component++)
- bgPalette2[color][component] = adjustToVGA(bgPalette2[color][component] - 8 + fundido);
+ bgPalette2[color][component] = adjustToVGA(bgPalette2[color][component] - 8 + fade);
}
- for (fundido = 3; fundido >= 0; fundido--) {
+ for (fade = 3; fade >= 0; fade--) {
for (color = 0; color < 128; color++)
for (component = 0; component < 3; component++)
- bgPalette3[color][component] = adjustToVGA(bgPalette3[color][component] - 8 + fundido);
+ bgPalette3[color][component] = adjustToVGA(bgPalette3[color][component] - 8 + fade);
}
- loadPic("3an11_1.alg", backSurface, 1);
+ loadPic("3an11_1.alg", backSurface);
for (frame = 0; frame < 8; frame++) {
if (frame == 2 || frame == 4 || frame == 8 || frame==10)
@@ -1761,8 +1758,8 @@ void DrasculaEngine::animation_12_5() {
animate("frel.bin", 16);
clearRoom();
- hare_claro();
- updatePalette();
+ setBrightPalette();
+ setPalette((byte *)&gamePalette);
flags[1] = 1;
@@ -1771,21 +1768,21 @@ void DrasculaEngine::animation_12_5() {
hiccup(12);
finishSound();
- loadPic("99.alg", backSurface, 1);
+ loadPic(99, backSurface);
- lleva_al_hare(40, 169);
- lleva_al_hare(-14, 175);
+ gotoObject(40, 169);
+ gotoObject(-14, 175);
doBreak = 1;
previousMusic = roomMusic;
hare_se_ve = 1;
clearRoom();
- sentido_hare = 1;
+ trackProtagonist = 1;
characterMoved = 0;
- hare_x = -1;
+ curX = -1;
objExit = 104;
withoutVerb();
- carga_escoba("57.ald");
+ enterRoom(57);
}
void DrasculaEngine::animation_13_5() {
@@ -1795,7 +1792,7 @@ void DrasculaEngine::animation_13_5() {
int frus_y[] = {1, 1, 1, 1, 1, 1, 1, 89};
int pos_frusky[6];
- loadPic("auxfr.alg", backSurface, 1);
+ loadPic("auxfr.alg", backSurface);
pos_frusky[3] = 81;
pos_frusky[4] = 44;
@@ -1823,7 +1820,7 @@ void DrasculaEngine::animation_13_5() {
break;
if (frame == 7) {
frame = 0;
- sentido_hare = 3;
+ trackProtagonist = 3;
}
pause(6);
}
@@ -1836,16 +1833,16 @@ void DrasculaEngine::animation_14_5() {
updateScreen(0, 0, 0,0 , 320, 200, screenSurface);
finishSound();
pause(17);
- sentido_hare = 3;
+ trackProtagonist = 3;
talk(246);
- lleva_al_hare(89, 160);
+ gotoObject(89, 160);
flags[10] = 1;
playSound(7);
updateRoom();
updateScreen();
finishSound();
pause(14);
- sentido_hare = 3;
+ trackProtagonist = 3;
updateRoom();
updateScreen();
talk_solo(_textd[_lang][18], "d18.als");
@@ -1871,16 +1868,16 @@ void DrasculaEngine::animation_17_5() {
void DrasculaEngine::animation_1_6() {
int l;
- sentido_hare = 0;
- hare_x = 103;
- hare_y = 108;
+ trackProtagonist = 0;
+ curX = 103;
+ curY = 108;
flags[0] = 1;
for (l = 0; l < 200; l++)
factor_red[l] = 98;
- loadPic("auxig2.alg", frontSurface, 1);
- loadPic("auxdr.alg", drawSurface2, 1);
- loadPic("car.alg", backSurface, 1);
+ loadPic("auxig2.alg", frontSurface);
+ loadPic("auxdr.alg", drawSurface2);
+ loadPic("car.alg", backSurface);
talk_drascula(19, 1);
talk(247);
talk_drascula(20, 1);
@@ -1889,7 +1886,7 @@ void DrasculaEngine::animation_1_6() {
talk_drascula(22, 1);
talk(249);
talk_drascula(23, 1);
- converse("op_11.cal");
+ converse(11);
talk_drascula(26, 1);
animate("fum.bin", 15);
@@ -1901,7 +1898,7 @@ void DrasculaEngine::animation_1_6() {
talk_drascula(29, 1);
fadeToBlack(1);
clearRoom();
- loadPic("time1.alg", screenSurface, 1);
+ loadPic("time1.alg", screenSurface);
updateScreen();
delay(930);
clearRoom();
@@ -1916,7 +1913,7 @@ void DrasculaEngine::animation_1_6() {
talk(257);
fadeToBlack(0);
clearRoom();
- loadPic("time1.alg", screenSurface,1);
+ loadPic("time1.alg", screenSurface);
updateScreen();
delay(900);
clearRoom();
@@ -1929,18 +1926,18 @@ void DrasculaEngine::animation_1_6() {
animation_5_6();
talk_drascula(32, 1);
talk_igor(11, kIgorDch);
- sentido_igor = 3;
+ trackIgor = 3;
talk_drascula(33, 1);
talk_igor(12, kIgorFront);
talk_drascula(34, 1);
- sentido_dr = 0;
+ trackDrascula = 0;
talk_drascula(35);
if (_lang == kSpanish)
textSurface = extraSurface;
clearRoom();
- carga_escoba("102.ald");
+ enterRoom(102);
activatePendulum();
}
@@ -1988,20 +1985,20 @@ void DrasculaEngine::animation_6_6() {
clearRoom();
withoutVerb();
removeObject(20);
- loadPic("96.alg", frontSurface, 1);
- loadPic("97.alg", frontSurface, 1);
- loadPic("97.alg", extraSurface, 1);
- loadPic("99.alg", backSurface, 1);
+ loadPic(96, frontSurface);
+ loadPic(97, frontSurface);
+ loadPic(97, extraSurface);
+ loadPic(99, backSurface);
doBreak = 1;
objExit = 104;
- hare_x = -1;
+ curX = -1;
withoutVerb();
- carga_escoba("58.ald");
+ enterRoom(58);
hare_se_ve = 1;
- sentido_hare = 1;
+ trackProtagonist = 1;
animate("hbp.bin", 14);
- sentido_hare = 3;
+ trackProtagonist = 3;
flags[0] = 1;
flags[1] = 0;
flags[2] = 1;
@@ -2021,9 +2018,9 @@ void DrasculaEngine::animation_9_6() {
animate("drf.bin", 16);
fadeToBlack(0);
clearRoom();
- hare_x = -1;
+ curX = -1;
objExit = 108;
- carga_escoba("59.ald");
+ enterRoom(59);
// The room number was originally changed here to "nada.alg",
// which is a non-existant file. In reality, this was just a
// hack to set the room number to a non-existant one, so that
@@ -2034,14 +2031,14 @@ void DrasculaEngine::animation_9_6() {
roomNumber = -1;
loadPic("nota2.alg", drawSurface1, HALF_PAL);
black();
- sentido_hare = 1;
- hare_x -= 21;
+ trackProtagonist = 1;
+ curX -= 21;
updateRoom();
updateScreen();
fadeFromBlack(0);
pause(96);
- lleva_al_hare(116, 178);
- sentido_hare = 2;
+ gotoObject(116, 178);
+ trackProtagonist = 2;
updateRoom();
updateScreen();
playMusic(9);
@@ -2053,14 +2050,14 @@ void DrasculaEngine::animation_9_6() {
talk_solo(_textbj[_lang][26], "bj26.als");
talk_solo(_textbj[_lang][27], "bj27.als");
talk_solo(_textbj[_lang][28], "bj28.als");
- sentido_hare = 3;
+ trackProtagonist = 3;
clearRoom();
- loadPic("96.alg", frontSurface, COMPLETE_PAL);
+ loadPic(96, frontSurface, COMPLETE_PAL);
loadPic("nota2.alg", drawSurface1, HALF_PAL);
talk(296);
talk(297);
talk(298);
- sentido_hare = 1;
+ trackProtagonist = 1;
talk(299);
talk(300);
updateRoom();
@@ -2068,8 +2065,8 @@ void DrasculaEngine::animation_9_6() {
updateScreen();
color_abc(kColorLightGreen);
talk_solo("GOOOOOOOOOOOOOOOL", "s15.als");
- loadPic("nota2.alg", drawSurface1, 1);
- sentido_hare = 0;
+ loadPic("nota2.alg", drawSurface1);
+ trackProtagonist = 0;
updateRoom();
updateScreen();
talk(301);
@@ -2078,13 +2075,13 @@ void DrasculaEngine::animation_9_6() {
playMusic(17);
fadeToBlack(1);
clearRoom();
- fliplay("qpc.bin", 1);
+ playFLI("qpc.bin", 1);
MusicFadeout();
stopMusic();
clearRoom();
_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, v_cd * 16);
playMusic(3);
- fliplay("crd.bin", 1);
+ playFLI("crd.bin", 1);
stopMusic();
}
@@ -2139,7 +2136,7 @@ void DrasculaEngine::animation_19_6() {
copyBackground(140, 23, 161, 69, 35, 80, drawSurface3, screenSurface);
updateRefresh_pre();
- pon_hare();
+ moveCharacters();
updateScreen();
pause(6);
updateRoom();
@@ -2153,7 +2150,7 @@ void DrasculaEngine::animation_12_2() {
if (_lang == kSpanish)
textSurface = frontSurface;
- loadPic("an12.alg", extraSurface, 1);
+ loadPic("an12.alg", extraSurface);
talk(356);
@@ -2167,7 +2164,7 @@ void DrasculaEngine::animation_12_2() {
updateRefresh_pre();
copyBackground(49, 139, 228, 112, 47, 60, extraSurface, screenSurface);
- pon_hare();
+ moveCharacters();
updateScreen();
@@ -2176,20 +2173,20 @@ void DrasculaEngine::animation_12_2() {
flags[11] = 1;
talk_pianist(5);
- converse("op_1.cal");
+ converse(1);
if (_lang == kSpanish)
textSurface = extraSurface;
flags[11] = 0;
- loadPic("974.alg", extraSurface, 1);
+ loadPic(974, extraSurface);
}
void DrasculaEngine::animation_26_2() {
if (_lang == kSpanish)
textSurface = frontSurface;
- loadPic("an12.alg", extraSurface, 1);
+ loadPic("an12.alg", extraSurface);
talk(392);
@@ -2203,7 +2200,7 @@ void DrasculaEngine::animation_26_2() {
updateRefresh_pre();
copyBackground(49, 139, 228, 112, 47, 60, extraSurface, screenSurface);
- pon_hare();
+ moveCharacters();
updateScreen();
@@ -2217,7 +2214,7 @@ void DrasculaEngine::animation_26_2() {
talk_pianist(18);
talk_pianist(19);
- loadPic("an26.alg", extraSurface, 1);
+ loadPic("an26.alg", extraSurface);
updateAnim(1, 225, 113, 50, 59, 6, extraSurface);
@@ -2237,14 +2234,14 @@ void DrasculaEngine::animation_26_2() {
updateAnim(121, 225, 113, 50, 59, 6, extraSurface);
pickObject(11);
- removeObject(12);
+ removeObject(kItemBook);
if (_lang == kSpanish)
textSurface = extraSurface;
flags[11] = 0;
flags[39] = 1;
- loadPic("974.alg", extraSurface, 1);
+ loadPic(974, extraSurface);
roomMusic = 16;
}
@@ -2252,7 +2249,7 @@ void DrasculaEngine::animation_11_2() {
if (_lang == kSpanish)
textSurface = frontSurface;
- loadPic("an11y13.alg", extraSurface, 1);
+ loadPic("an11y13.alg", extraSurface);
talk(352);
talk_bartender(1);
@@ -2267,11 +2264,11 @@ void DrasculaEngine::animation_11_2() {
if (_lang == kSpanish)
textSurface = extraSurface;
- loadPic("974.alg", extraSurface, 1);
+ loadPic(974, extraSurface);
}
void DrasculaEngine::animation_13_2() {
- loadPic("an11y13.alg", frontSurface, 1);
+ loadPic("an11y13.alg", frontSurface);
if (flags[41] == 0) {
talk(103);
@@ -2285,26 +2282,26 @@ void DrasculaEngine::animation_13_2() {
talk_drunk(7);
flags[41] = 1;
}
- converse("op_2.cal");
+ converse(2);
- loadPic("964.alg", frontSurface, 1);
+ loadPic(964, frontSurface);
}
void DrasculaEngine::animation_18_2() {
talk(378);
talk_vbpuerta(4);
- converse("op_3.cal");
+ converse(3);
}
void DrasculaEngine::animation_22_2() {
talk(374);
- sentido_hare=2;
+ trackProtagonist=2;
updateRoom();
updateScreen();
playSound(13);
finishSound();
- sentido_hare = 1;
+ trackProtagonist = 1;
talk_vbpuerta(1);
talk(375);
@@ -2316,16 +2313,16 @@ void DrasculaEngine::animation_22_2() {
}
void DrasculaEngine::animation_24_2() {
- if (hare_x < 178)
- lleva_al_hare(208, 136);
- sentido_hare = 3;
+ if (curX < 178)
+ gotoObject(208, 136);
+ trackProtagonist = 3;
updateRoom();
pause(3);
- sentido_hare = 0;
+ trackProtagonist = 0;
talk(356);
- loadPic("an24.alg", frontSurface, 1);
+ loadPic("an24.alg", frontSurface);
animation_32_2();
@@ -2334,20 +2331,20 @@ void DrasculaEngine::animation_24_2() {
talk_vb(22);
if (flags[22] == 0)
- converse("op_4.cal");
+ converse(4);
else
- converse("op_5.cal");
+ converse(5);
exitRoom(0);
flags[21] = 0;
flags[24] = 0;
- sentido_vb = 1;
- vb_x = 120;
+ trackVB = 1;
+ vbX = 120;
}
void DrasculaEngine::animation_32_2() {
- loadPic("an32_1.alg", drawSurface3, 1);
- loadPic("an32_2.alg", backSurface, 1);
+ loadPic("an32_1.alg", drawSurface3);
+ loadPic("an32_2.alg", backSurface);
updateAnim(1, 113, 53, 65, 81, 4, drawSurface3, 4);
updateAnim(83, 113, 53, 65, 81, 4, drawSurface3, 4);
@@ -2363,16 +2360,16 @@ void DrasculaEngine::animation_32_2() {
pause(4);
}
- loadPic("aux18.alg", drawSurface3, 1);
+ loadPic("aux18.alg", drawSurface3);
}
void DrasculaEngine::animation_34_2() {
- sentido_hare = 1;
+ trackProtagonist = 1;
updateRoom();
updateScreen();
- loadPic("an34_1.alg", backSurface, 1);
- loadPic("an34_2.alg", extraSurface, 1);
+ loadPic("an34_1.alg", backSurface);
+ loadPic("an34_2.alg", extraSurface);
updateAnim(1, 218, 79, 83, 75, 3, backSurface);
updateAnim(77, 218, 79, 83, 75, 3, backSurface);
@@ -2389,15 +2386,15 @@ void DrasculaEngine::animation_34_2() {
updateScreen(218, 79, 218, 79, 83, 75, screenSurface);
pause(3);
- loadPic("994.alg", backSurface, 1);
- loadPic("974.alg", extraSurface, 1);
+ loadPic(994, backSurface);
+ loadPic(974, extraSurface);
}
void DrasculaEngine::animation_36_2() {
if (_lang == kSpanish)
textSurface = frontSurface;
- loadPic("an11y13.alg", extraSurface, 1);
+ loadPic("an11y13.alg", extraSurface);
talk(404);
talk_bartender(19);
@@ -2410,13 +2407,13 @@ void DrasculaEngine::animation_36_2() {
if (_lang == kSpanish)
textSurface = extraSurface;
- loadPic("974.alg", extraSurface, 1);
+ loadPic(974, extraSurface);
}
void DrasculaEngine::animation_7_2() {
- loadPic("an7_1.alg", backSurface, 1);
- loadPic("an7_2.alg", extraSurface, 1);
- loadPic("an7_3.alg", frontSurface, 1);
+ loadPic("an7_1.alg", backSurface);
+ loadPic("an7_2.alg", extraSurface);
+ loadPic("an7_3.alg", frontSurface);
if (flags[3] == 1)
copyBackground(258, 110, 85, 44, 23, 53, drawSurface3, drawSurface1);
@@ -2431,10 +2428,10 @@ void DrasculaEngine::animation_7_2() {
updateAnim2(75, 80, 64, 51, 73, 6, extraSurface);
updateAnim2(1, 80, 64, 51, 73, 6, frontSurface);
- loadPic("an7_4.alg", backSurface, 1);
- loadPic("an7_5.alg", extraSurface, 1);
- loadPic("an7_6.alg", frontSurface, 1);
- loadPic("an7_7.alg", drawSurface3, 1);
+ loadPic("an7_4.alg", backSurface);
+ loadPic("an7_5.alg", extraSurface);
+ loadPic("an7_6.alg", frontSurface);
+ loadPic("an7_7.alg", drawSurface3);
updateAnim2(1, 80, 64, 51, 73, 6, backSurface);
updateAnim2(75, 80, 64, 51, 73, 6, backSurface);
@@ -2447,8 +2444,8 @@ void DrasculaEngine::animation_7_2() {
updateAnim2(1, 80, 64, 51, 73, 6, drawSurface3);
updateAnim2(75, 80, 64, 51, 73, 2, drawSurface3);
- loadPic("an7_8.alg", backSurface, 1);
- loadPic("an7_9.alg", extraSurface, 1);
+ loadPic("an7_8.alg", backSurface);
+ loadPic("an7_9.alg", extraSurface);
updateAnim2(1, 80, 64, 51, 73, 6, backSurface);
updateAnim2(75, 80, 64, 51, 73, 6, backSurface);
@@ -2463,47 +2460,45 @@ void DrasculaEngine::animation_7_2() {
if (flags[7] == 1 && flags[26] == 1 && flags[34] == 1 && flags[35] == 1 && flags[37] == 1)
flags[38] = 1;
- loadPic("99.alg", backSurface, 1);
- loadPic("97.alg", extraSurface, 1);
- loadPic("96.alg", frontSurface, 1);
- loadPic("aux3.alg", drawSurface3, 1);
+ loadPic(99, backSurface);
+ loadPic(97, extraSurface);
+ loadPic(96, frontSurface);
+ loadPic("aux3.alg", drawSurface3);
}
void DrasculaEngine::animation_5_2() {
- sentido_hare = 0;
+ trackProtagonist = 0;
updateRoom();
updateScreen();
- loadPic("an5_1.alg", backSurface, 1);
- loadPic("an5_2.alg", extraSurface, 1);
- loadPic("an5_3.alg", frontSurface, 1);
- loadPic("an5_4.alg", drawSurface3, 1);
+ loadPic("an5_1.alg", backSurface);
+ loadPic("an5_2.alg", extraSurface);
+ loadPic("an5_3.alg", frontSurface);
+ loadPic("an5_4.alg", drawSurface3);
copyBackground(1, 1, 213, 66, 53,84, backSurface, screenSurface);
updateScreen();
- // FIXME: the widths in these calls were 53 and 52 (by mistake, probably).
- // I've set them to 53, but if any problems arise, we should try 52 as well
- updateAnim(1, 213, 66, 53, 84, 6, backSurface);
- updateAnim(86, 213, 66, 53, 84, 6, backSurface);
- updateAnim(1, 213, 66, 53, 84, 6, extraSurface);
- updateAnim(1, 213, 66, 53, 84, 6, extraSurface);
- updateAnim(86, 213, 66, 53, 84, 6, extraSurface);
- updateAnim(1, 213, 66, 53, 84, 6, frontSurface);
+ updateAnim(1, 213, 66, 52, 84, 6, backSurface);
+ updateAnim(86, 213, 66, 52, 84, 6, backSurface);
+ updateAnim(1, 213, 66, 52, 84, 6, extraSurface);
+ updateAnim(1, 213, 66, 52, 84, 6, extraSurface);
+ updateAnim(86, 213, 66, 52, 84, 6, extraSurface);
+ updateAnim(1, 213, 66, 52, 84, 6, frontSurface);
playSound(1);
- updateAnim(86, 213, 66, 53, 84, 6, frontSurface);
+ updateAnim(86, 213, 66, 52, 84, 6, frontSurface);
stopSound();
- updateAnim(1, 213, 66, 53, 84, 6, drawSurface3);
+ updateAnim(1, 213, 66, 52, 84, 6, drawSurface3);
- loadPic("994.alg", backSurface, 1);
- loadPic("974.alg", extraSurface, 1);
- loadPic("964.alg", frontSurface, 1);
- loadPic("aux5.alg", drawSurface3, 1);
+ loadPic(994, backSurface);
+ loadPic(974, extraSurface);
+ loadPic(964, frontSurface);
+ loadPic("aux5.alg", drawSurface3);
flags[8] = 1;
- hare_x = hare_x - 4;
- talk_sinc(_text[_lang][46], "46.als", "4442444244244");
+ curX = curX - 4;
+ talk_sync(_text[_lang][46], "46.als", "4442444244244");
withoutVerb();
}
@@ -2516,10 +2511,10 @@ void DrasculaEngine::animation_6_2() {
clearRoom();
loadPic("ciego1.alg", drawSurface1, HALF_PAL); // ciego = blind
- loadPic("ciego2.alg", drawSurface3, 1);
- loadPic("ciego3.alg", extraSurface, 1);
- loadPic("ciego4.alg", backSurface, 1);
- loadPic("ciego5.alg", frontSurface, 1);
+ loadPic("ciego2.alg", drawSurface3);
+ loadPic("ciego3.alg", extraSurface);
+ loadPic("ciego4.alg", backSurface);
+ loadPic("ciego5.alg", frontSurface);
copyBackground(0, 0, 0, 0, 320, 200, drawSurface1, screenSurface);
updateScreen();
@@ -2541,11 +2536,11 @@ void DrasculaEngine::animation_6_2() {
clearRoom();
playMusic(roomMusic);
- loadPic("9.alg", drawSurface1, HALF_PAL);
- loadPic("aux9.alg", drawSurface3, 1);
- loadPic("96.alg", frontSurface, 1);
- loadPic("97.alg", extraSurface, 1);
- loadPic("99.alg", backSurface, 1);
+ loadPic(9, drawSurface1, HALF_PAL);
+ loadPic("aux9.alg", drawSurface3);
+ loadPic(96, frontSurface);
+ loadPic(97, extraSurface);
+ loadPic(99, backSurface);
withoutVerb();
if (_lang == kSpanish)
@@ -2564,10 +2559,10 @@ void DrasculaEngine::animation_33_2() {
clearRoom();
loadPic("ciego1.alg", drawSurface1, HALF_PAL); // ciego = blind
- loadPic("ciego2.alg", drawSurface3, 1);
- loadPic("ciego3.alg", extraSurface, 1);
- loadPic("ciego4.alg", backSurface, 1);
- loadPic("ciego5.alg", frontSurface, 1);
+ loadPic("ciego2.alg", drawSurface3);
+ loadPic("ciego3.alg", extraSurface);
+ loadPic("ciego4.alg", backSurface);
+ loadPic("ciego5.alg", frontSurface);
if (_lang == kSpanish)
textSurface = frontSurface;
@@ -2593,11 +2588,11 @@ void DrasculaEngine::animation_33_2() {
clearRoom();
playMusic(roomMusic);
- loadPic("9.alg", drawSurface1, HALF_PAL);
- loadPic("aux9.alg", drawSurface3, 1);
- loadPic("96.alg", frontSurface, 1);
- loadPic("97.alg", extraSurface, 1);
- loadPic("99.alg", backSurface, 1);
+ loadPic(9, drawSurface1, HALF_PAL);
+ loadPic("aux9.alg", drawSurface3);
+ loadPic(96, frontSurface);
+ loadPic(97, extraSurface);
+ loadPic(99, backSurface);
withoutVerb();
if (_lang == kSpanish)
@@ -2622,7 +2617,7 @@ void DrasculaEngine::animation_1_4() {
updateRefresh_pre();
copyBackground(182, 133, 199, 95, 50, 66, drawSurface3, screenSurface);
- pon_hare();
+ moveCharacters();
updateScreen();
@@ -2646,7 +2641,7 @@ void DrasculaEngine::animation_1_4() {
updateRefresh_pre();
copyBackground(182, 133, 199, 95, 50, 66, drawSurface3, screenSurface);
- pon_hare();
+ moveCharacters();
updateScreen();
@@ -2658,34 +2653,34 @@ void DrasculaEngine::animation_1_4() {
talk_igor(6, kIgorSeated);
}
- converse("op_6.cal");
+ converse(6);
flags[20] = 0;
flags[18] = 0;
}
void DrasculaEngine::animation_5_4(){
- sentido_hare = 3;
- loadPic("anh_dr.alg", backSurface, 1);
- lleva_al_hare(99, 160);
- lleva_al_hare(38, 177);
+ trackProtagonist = 3;
+ loadPic("anh_dr.alg", backSurface);
+ gotoObject(99, 160);
+ gotoObject(38, 177);
hare_se_ve = 0;
updateRoom();
updateScreen();
delay(800);
animate("bio.bin", 14);
flags[29] = 1;
- hare_x = 95;
- hare_y = 82;
+ curX = 95;
+ curY = 82;
updateRoom();
updateScreen();
openDoor(2, 0);
- loadPic("auxigor.alg", frontSurface, 1);
+ loadPic("auxigor.alg", frontSurface);
igorX = 100;
igorY = 65;
talk_igor(29, kIgorFront);
talk_igor(30, kIgorFront);
- loadPic("96.alg", frontSurface, 1);
- loadPic("99.alg", backSurface, 1);
+ loadPic(96, frontSurface);
+ loadPic(99, backSurface);
hare_se_ve = 1;
fadeToBlack(0);
exitRoom(0);
@@ -2696,9 +2691,9 @@ void DrasculaEngine::animation_6_4() {
roomNumber = 26;
clearRoom();
- loadPic("26.alg", drawSurface1, HALF_PAL);
- loadPic("aux26.alg", drawSurface3, 1);
- loadPic("auxigor.alg", frontSurface, 1);
+ loadPic(26, drawSurface1, HALF_PAL);
+ loadPic("aux26.alg", drawSurface3);
+ loadPic("auxigor.alg", frontSurface);
copyBackground(0, 0, 0, 0, 320, 200, drawSurface1, screenSurface);
update_26_pre();
igorX = 104;
@@ -2709,11 +2704,9 @@ void DrasculaEngine::animation_6_4() {
talk_igor(26, kIgorFront);
roomNumber = prevRoom;
clearRoom();
- loadPic("96.alg", frontSurface, 1);
- loadPic(roomDisk, drawSurface3, 1);
- char rm[20];
- sprintf(rm, "%i.alg", roomNumber);
- loadPic(rm, drawSurface1, HALF_PAL);
+ loadPic(96, frontSurface);
+ loadPic(roomDisk, drawSurface3);
+ loadPic(roomNumber, drawSurface1, HALF_PAL);
withoutVerb();
updateRoom();
}
@@ -2723,7 +2716,7 @@ void DrasculaEngine::animation_8_4() {
int estanteria_x[] = {1, 75, 149, 223, 1, 75, 149, 223, 149, 223, 149, 223, 149, 223};
int estanteria_y[] = {1, 1, 1, 1, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74};
- loadPic("an_8.alg", frontSurface, 1);
+ loadPic("an_8.alg", frontSurface);
for (frame = 0; frame < 14; frame++) {
pause(2);
@@ -2731,7 +2724,7 @@ void DrasculaEngine::animation_8_4() {
updateScreen(77, 45, 77, 45, 73, 72, screenSurface);
}
- loadPic("96.alg", frontSurface, 1);
+ loadPic(96, frontSurface);
openDoor(7, 2);
}
diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp
index 4c3580caf1..f9ca3b4aa6 100644
--- a/engines/drascula/drascula.cpp
+++ b/engines/drascula/drascula.cpp
@@ -100,6 +100,7 @@ int DrasculaEngine::init() {
_lang = 0;
}
+ setupRoomsTable();
loadArchives();
return 0;
@@ -118,91 +119,89 @@ int DrasculaEngine::go() {
takeObject = 0;
menuBar = 0; menuScreen = 0; hasName = 0;
frame_y = 0;
- hare_x = -1; characterMoved = 0; sentido_hare = 3; num_frame = 0; hare_se_ve = 1;
+ curX = -1; characterMoved = 0; trackProtagonist = 3; num_frame = 0; hare_se_ve = 1;
checkFlags = 1;
doBreak = 0;
walkToObject = 0;
stepX = STEP_X; stepY = STEP_Y;
- alto_hare = CHARACTER_HEIGHT; ancho_hare = CHARACTER_WIDTH; feetHeight = FEET_HEIGHT;
+ curHeight = CHARACTER_HEIGHT; curWidth = CHARACTER_WIDTH; feetHeight = FEET_HEIGHT;
talkHeight = TALK_HEIGHT; talkWidth = TALK_WIDTH;
hasAnswer = 0;
- conta_blind_vez = 0;
+ savedTime = 0;
changeColor = 0;
breakOut = 0;
- vb_x = 120; sentido_vb = 1; vb_se_mueve = 0; frame_vb = 1;
+ vbX = 120; trackVB = 1; vbHasMoved = 0; frame_vb = 1;
frame_piano = 0;
frame_drunk = 0;
frame_candles = 0;
cont_sv = 0;
term_int = 0;
musicStopped = 0;
- hay_seleccion = 0;
+ selectionMade = 0;
UsingMem = 0;
globalSpeed = 0;
frame_blind = 0;
frame_snore = 0;
frame_bat = 0;
- c_mirar = 0;
- c_poder = 0;
+ curExcuseLook = 0;
+ curExcuseAction = 0;
allocMemory();
- hay_sb = 1;
withVoices = 0;
- hay_seleccion = 0;
+ selectionMade = 0;
- if (currentChapter != 6) {
- loadPic("95.alg", tableSurface, 1);
- }
+ if (currentChapter != 6)
+ loadPic(95, tableSurface);
if (currentChapter == 1) {
- loadPic("96.alg", frontSurface, COMPLETE_PAL);
- loadPic("99.alg", backSurface, 1);
- loadPic("97.alg", extraSurface, 1);
+ loadPic(96, frontSurface, COMPLETE_PAL);
+ loadPic(99, backSurface);
+ loadPic(97, extraSurface);
} else if (currentChapter == 2) {
- loadPic("96.alg", frontSurface, COMPLETE_PAL);
- loadPic("pts.alg", drawSurface2, 1);
+ loadPic(96, frontSurface, COMPLETE_PAL);
+ loadPic("pts.alg", drawSurface2);
} else if (currentChapter == 3) {
loadPic("aux13.alg", drawSurface1, COMPLETE_PAL);
- loadPic("96.alg", frontSurface, 1);
- loadPic("97.alg", extraSurface, 1);
- loadPic("99.alg", backSurface, 1);
+ loadPic(96, frontSurface);
+ loadPic(97, extraSurface);
+ loadPic(99, backSurface);
} else if (currentChapter == 4) {
- loadPic("96.alg", frontSurface, COMPLETE_PAL);
+ loadPic(96, frontSurface, COMPLETE_PAL);
if (hay_que_load == 0)
- animation_rayo();
- loadPic("96.alg", frontSurface, 1);
+ animation_ray();
+ loadPic(96, frontSurface);
clearRoom();
- loadPic("99.alg", backSurface, 1);
- loadPic("97.alg", extraSurface, 1);
+ loadPic(99, backSurface);
+ loadPic(97, extraSurface);
} else if (currentChapter == 5) {
- loadPic("96.alg", frontSurface, COMPLETE_PAL);
- loadPic("97.alg", extraSurface, 1);
- loadPic("99.alg", backSurface, 1);
+ loadPic(96, frontSurface, COMPLETE_PAL);
+ loadPic(97, extraSurface);
+ loadPic(99, backSurface);
} else if (currentChapter == 6) {
- igorX = 105, igorY = 85, sentido_igor = 1;
- x_dr = 62, y_dr = 99, sentido_dr = 1;
+ igorX = 105, igorY = 85, trackIgor = 1;
+ x_dr = 62, y_dr = 99, trackDrascula = 1;
frame_pen = 0;
flag_tv = 0;
pendulumSurface = drawSurface3;
- loadPic("96.alg", frontSurface, COMPLETE_PAL);
- loadPic("99.alg", backSurface, 1);
- loadPic("97.alg", extraSurface, 1);
- loadPic("95.alg", tableSurface, 1);
+ loadPic(96, frontSurface, COMPLETE_PAL);
+ loadPic(99, backSurface);
+ loadPic(97, extraSurface);
+ loadPic(95, tableSurface);
}
memset(iconName, 0, sizeof(iconName));
for (i = 0; i < 6; i++)
strcpy(iconName[i + 1], _textverbs[_lang][i]);
- paleta_hare();
- if (!escoba()) {
- releaseGame();
+ assignDefaultPalette();
+ if (!runCurrentChapter()) {
+ quitGame();
break;
}
- releaseGame();
+ quitGame();
if (currentChapter == 6)
break;
@@ -212,9 +211,8 @@ int DrasculaEngine::go() {
return 0;
}
-void DrasculaEngine::releaseGame() {
- if (hay_sb == 1)
- stopSound();
+void DrasculaEngine::quitGame() {
+ stopSound();
clearRoom();
black();
MusicFadeout();
@@ -284,33 +282,11 @@ void DrasculaEngine::loadPic(const char *NamePcc, byte *targetSurface, int color
_arj.read(cPal, 768);
_arj.close();
- decompressPic(targetSurface, colorCount);
-}
-
-void DrasculaEngine::decompressPic(byte *targetSurface, int colorCount) {
memcpy(targetSurface, pcxBuffer, 64000);
free(pcxBuffer);
setRGB((byte *)cPal, colorCount);
}
-void DrasculaEngine::paleta_hare() {
- int color, component;
-
- for (color = 235; color < 253; color++)
- for (component = 0; component < 3; component++)
- palHare[color][component] = gamePalette[color][component];
-}
-
-void DrasculaEngine::hare_oscuro() {
- int color, component;
-
- for (color = 235; color < 253; color++ )
- for (component = 0; component < 3; component++)
- gamePalette[color][component] = palHareOscuro[color][component];
-
- updatePalette();
-}
-
void DrasculaEngine::setRGB(byte *dir_lectura, int plt) {
int x, cnt = 0;
@@ -319,7 +295,7 @@ void DrasculaEngine::setRGB(byte *dir_lectura, int plt) {
gamePalette[x][1] = dir_lectura[cnt++] / 4;
gamePalette[x][2] = dir_lectura[cnt++] / 4;
}
- updatePalette();
+ setPalette((byte *)&gamePalette);
}
void DrasculaEngine::black() {
@@ -337,10 +313,6 @@ void DrasculaEngine::black() {
setPalette((byte *)&palNegra);
}
-void DrasculaEngine::updatePalette() {
- setPalette((byte *)&gamePalette);
-}
-
void DrasculaEngine::setPalette(byte *PalBuf) {
byte pal[256 * 4];
int i;
@@ -427,7 +399,7 @@ void DrasculaEngine::updateScreen(int xorg, int yorg, int xdes, int ydes, int wi
_system->updateScreen();
}
-bool DrasculaEngine::escoba() {
+bool DrasculaEngine::runCurrentChapter() {
int n;
if (_lang == kSpanish)
@@ -467,61 +439,62 @@ bool DrasculaEngine::escoba() {
animation_1_1();
withoutVerb();
- loadPic("2aux62.alg", drawSurface2, 1);
- sentido_hare = 1;
+ loadPic("2aux62.alg", drawSurface2);
+ trackProtagonist = 1;
objExit = 104;
if (hay_que_load != 0) {
- if (!para_cargar(saveName)) {
+ if (!loadGame(saveName)) {
return true;
}
} else {
- carga_escoba("62.ald");
- hare_x = -20;
- hare_y = 56;
- lleva_al_hare(65, 145);
+ enterRoom(62);
+ curX = -20;
+ curY = 56;
+ gotoObject(65, 145);
}
} else if (currentChapter == 2) {
- addObject(28);
- sentido_hare = 3;
+ addObject(kItemPhone);
+ trackProtagonist = 3;
objExit = 162;
if (hay_que_load == 0)
- carga_escoba("14.ald");
+ enterRoom(14);
else {
- if (!para_cargar(saveName)) {
+ if (!loadGame(saveName)) {
return true;
}
}
} else if (currentChapter == 3) {
- addObject(28);
- addObject(11);
- addObject(14);
- addObject(22);
- addObject(9);
- addObject(20);
- addObject(19);
+ addObject(kItemPhone);
+ addObject(kItemEarplugs);
+ addObject(kItemSickle);
+ addObject(kItemHandbag);
+ addObject(kItemCross);
+ addObject(kItemReefer);
+ addObject(kItemOneCoin);
flags[1] = 1;
- sentido_hare = 1;
+ trackProtagonist = 1;
objExit = 99;
if (hay_que_load == 0)
- carga_escoba("20.ald");
+ enterRoom(20);
else {
- if (!para_cargar(saveName)) {
+ if (!loadGame(saveName)) {
return true;
}
}
+ // From here onwards the items have different IDs
} else if (currentChapter == 4) {
- addObject(28);
- addObject(9);
- addObject(20);
- addObject(22);
+ addObject(kItemPhone2);
+ addObject(kItemCross2);
+ addObject(kItemReefer2);
+ addObject(kItemOneCoin2);
objExit = 100;
if (hay_que_load == 0) {
- carga_escoba("21.ald");
- sentido_hare = 0;
- hare_x = 235;
- hare_y = 164;
+ enterRoom(21);
+ trackProtagonist = 0;
+ curX = 235;
+ curY = 164;
} else {
- if (!para_cargar(saveName)) {
+ if (!loadGame(saveName)) {
return true;
}
}
@@ -535,12 +508,12 @@ bool DrasculaEngine::escoba() {
addObject(15);
addObject(17);
addObject(20);
- sentido_hare = 1;
+ trackProtagonist = 1;
objExit = 100;
if (hay_que_load == 0) {
- carga_escoba("45.ald");
+ enterRoom(45);
} else {
- if (!para_cargar(saveName)) {
+ if (!loadGame(saveName)) {
return true;
}
}
@@ -548,16 +521,16 @@ bool DrasculaEngine::escoba() {
addObject(28);
addObject(9);
- sentido_hare = 1;
+ trackProtagonist = 1;
objExit = 104;
if (hay_que_load == 0) {
- carga_escoba("58.ald");
+ enterRoom(58);
animation_1_6();
} else {
- if (!para_cargar(saveName)) {
+ if (!loadGame(saveName)) {
return true;
}
- loadPic("auxdr.alg", drawSurface2, 1);
+ loadPic("auxdr.alg", drawSurface2);
}
}
@@ -567,17 +540,17 @@ bool DrasculaEngine::escoba() {
stepY = STEP_Y;
}
if (characterMoved == 0 && walkToObject == 1) {
- sentido_hare = sentido_final;
+ trackProtagonist = trackFinal;
walkToObject = 0;
}
if (currentChapter == 2) {
- if (roomNumber == 3 && (hare_x == 279) && (hare_y + alto_hare == 101))
+ if (roomNumber == 3 && (curX == 279) && (curY + curHeight == 101))
animation_1_2();
- else if (roomNumber == 14 && (hare_x == 214) && (hare_y + alto_hare == 121))
- lleva_al_hare(190, 130);
- else if (roomNumber == 14 && (hare_x == 246) && (hare_y + alto_hare == 112))
- lleva_al_hare(190, 130);
+ else if (roomNumber == 14 && (curX == 214) && (curY + curHeight == 121))
+ gotoObject(190, 130);
+ else if (roomNumber == 14 && (curX == 246) && (curY + curHeight == 112))
+ gotoObject(190, 130);
}
moveCursor();
@@ -596,31 +569,31 @@ bool DrasculaEngine::escoba() {
if (menuScreen == 0 && takeObject == 1)
checkObjects();
- if (button_dch == 1 && menuScreen == 1) {
+ if (rightMouseButton == 1 && menuScreen == 1) {
delay(100);
if (currentChapter == 2)
- loadPic(menuBackground, backSurface, 1);
+ loadPic(menuBackground, backSurface);
else
- loadPic("99.alg", backSurface, 1);
+ loadPic(99, backSurface);
setPalette((byte *)&gamePalette);
menuScreen = 0;
updateEvents();
if (currentChapter != 3)
cont_sv = 0;
}
- if (button_dch == 1 && menuScreen == 0) {
+ if (rightMouseButton == 1 && menuScreen == 0) {
delay(100);
characterMoved = 0;
- if (sentido_hare == 2)
- sentido_hare = 1;
+ if (trackProtagonist == 2)
+ trackProtagonist = 1;
if (currentChapter == 4)
- loadPic("icons2.alg", backSurface, 1);
+ loadPic("icons2.alg", backSurface);
else if (currentChapter == 5)
- loadPic("icons3.alg", backSurface, 1);
+ loadPic("icons3.alg", backSurface);
else if (currentChapter == 6)
- loadPic("iconsp.alg", backSurface, 1);
+ loadPic("iconsp.alg", backSurface);
else
- loadPic("icons.alg", backSurface, 1);
+ loadPic("icons.alg", backSurface);
menuScreen = 1;
updateEvents();
withoutVerb();
@@ -628,19 +601,19 @@ bool DrasculaEngine::escoba() {
cont_sv = 0;
}
- if (button_izq == 1 && menuBar == 1) {
+ if (leftMouseButton == 1 && menuBar == 1) {
delay(100);
- elige_en_barra();
+ selectVerbFromBar();
if (currentChapter != 3)
cont_sv = 0;
- } else if (button_izq == 1 && takeObject == 0) {
+ } else if (leftMouseButton == 1 && takeObject == 0) {
delay(100);
- if (comprueba1())
+ if (verify1())
return true;
if (currentChapter != 3)
cont_sv = 0;
- } else if (button_izq == 1 && takeObject == 1) {
- if (comprueba2())
+ } else if (leftMouseButton == 1 && takeObject == 1) {
+ if (verify2())
return true;
if (currentChapter != 3)
cont_sv = 0;
@@ -673,11 +646,11 @@ bool DrasculaEngine::escoba() {
if (currentChapter != 3)
cont_sv = 0;
} else if (key == Common::KEYCODE_F9) {
- mesa();
+ volumeControls();
if (currentChapter != 3)
cont_sv = 0;
} else if (key == Common::KEYCODE_F10) {
- if (!saves())
+ if (!saveLoadScreen())
return true;
if (currentChapter != 3)
cont_sv = 0;
@@ -719,18 +692,18 @@ bool DrasculaEngine::escoba() {
void DrasculaEngine::pickObject(int objeto) {
if (currentChapter == 6)
- loadPic("iconsp.alg", backSurface, 1);
+ loadPic("iconsp.alg", backSurface);
else if (currentChapter == 4)
- loadPic("icons2.alg", backSurface, 1);
+ loadPic("icons2.alg", backSurface);
else if (currentChapter == 5)
- loadPic("icons3.alg", backSurface, 1);
+ loadPic("icons3.alg", backSurface);
else
- loadPic("icons.alg", backSurface, 1);
+ loadPic("icons.alg", backSurface);
chooseObject(objeto);
if (currentChapter == 2)
- loadPic(menuBackground, backSurface, 1);
+ loadPic(menuBackground, backSurface);
else
- loadPic("99.alg", backSurface, 1);
+ loadPic(99, backSurface);
}
void DrasculaEngine::chooseObject(int objeto) {
@@ -746,11 +719,11 @@ void DrasculaEngine::chooseObject(int objeto) {
pickedObject = objeto;
}
-int DrasculaEngine::removeObject(int osj) {
+int DrasculaEngine::removeObject(int obj) {
int result = 1;
for (int h = 1; h < 43; h++) {
- if (inventoryObjects[h] == osj) {
+ if (inventoryObjects[h] == obj) {
inventoryObjects[h] = 0;
result = 0;
break;
@@ -761,9 +734,8 @@ int DrasculaEngine::removeObject(int osj) {
}
void DrasculaEngine::withoutVerb() {
- int c = 171;
- if (menuScreen == 1)
- c = 0;
+ int c = (menuScreen == 1) ? 0 : 171;
+
if (currentChapter == 5) {
if (takeObject == 1 && pickedObject != 16)
addObject(pickedObject);
@@ -777,22 +749,6 @@ void DrasculaEngine::withoutVerb() {
hasName = 0;
}
-bool DrasculaEngine::para_cargar(char gameName[]) {
- previousMusic = roomMusic;
- menuScreen = 0;
- if (currentChapter != 1)
- clearRoom();
- if (!loadGame(gameName))
- return false;
- if (currentChapter == 2 || currentChapter == 3 || currentChapter == 5) {
- //
- }
- carga_escoba(currentData);
- withoutVerb();
-
- return true;
-}
-
char *DrasculaEngine::getLine(char *buf, int len) {
byte c;
char *b;
@@ -826,35 +782,38 @@ void DrasculaEngine::getStringFromLine(char *buf, int len, char* result) {
sscanf(buf, "%s", result);
}
-void DrasculaEngine::carga_escoba(const char *nom_fich) {
- int soc, l, martin = 0, obj_salir = 0;
+void DrasculaEngine::enterRoom(int roomIndex) {
+ debug(2, "Entering room %d", roomIndex);
+
+ char fileName[20];
+ sprintf(fileName, "%d.ald", roomIndex);
+ int soc, l, martin = 0, objIsExit = 0;
float chiquez = 0, pequegnez = 0;
char pant1[20], pant2[20], pant3[20], pant4[20];
- char para_codificar[20];
char buffer[256];
+ int palLevel = 0;
hasName = 0;
- strcpy(para_codificar, nom_fich);
- strcpy(currentData, nom_fich);
+ strcpy(currentData, fileName);
- _arj.open(nom_fich);
+ _arj.open(fileName);
if (!_arj.isOpen()) {
- error("missing data file %s", nom_fich);
+ error("missing data file %s", fileName);
}
int size = _arj.size();
getIntFromLine(buffer, size, &roomNumber);
getIntFromLine(buffer, size, &roomMusic);
getStringFromLine(buffer, size, roomDisk);
- getIntFromLine(buffer, size, &nivel_osc);
+ getIntFromLine(buffer, size, &palLevel);
if (currentChapter == 2)
getIntFromLine(buffer, size, &martin);
if (currentChapter == 2 && martin != 0) {
- ancho_hare = martin;
- getIntFromLine(buffer, size, &alto_hare);
+ curWidth = martin;
+ getIntFromLine(buffer, size, &curHeight);
getIntFromLine(buffer, size, &feetHeight);
getIntFromLine(buffer, size, &stepX);
getIntFromLine(buffer, size, &stepY);
@@ -876,25 +835,25 @@ void DrasculaEngine::carga_escoba(const char *nom_fich) {
getIntFromLine(buffer, size, &y1[l]);
getIntFromLine(buffer, size, &x2[l]);
getIntFromLine(buffer, size, &y2[l]);
- getIntFromLine(buffer, size, &sitiobj_x[l]);
- getIntFromLine(buffer, size, &sitiobj_y[l]);
- getIntFromLine(buffer, size, &sentidobj[l]);
+ getIntFromLine(buffer, size, &roomObjX[l]);
+ getIntFromLine(buffer, size, &roomObjY[l]);
+ getIntFromLine(buffer, size, &trackObj[l]);
getIntFromLine(buffer, size, &visible[l]);
getIntFromLine(buffer, size, &isDoor[l]);
if (isDoor[l] != 0) {
getStringFromLine(buffer, size, _targetSurface[l]);
getIntFromLine(buffer, size, &_destX[l]);
getIntFromLine(buffer, size, &_destY[l]);
- getIntFromLine(buffer, size, &sentido_alkeva[l]);
+ getIntFromLine(buffer, size, &trackCharacter_alkeva[l]);
getIntFromLine(buffer, size, &alapuertakeva[l]);
updateDoor(l);
}
}
- getIntFromLine(buffer, size, &suelo_x1);
- getIntFromLine(buffer, size, &suelo_y1);
- getIntFromLine(buffer, size, &suelo_x2);
- getIntFromLine(buffer, size, &suelo_y2);
+ getIntFromLine(buffer, size, &floorX1);
+ getIntFromLine(buffer, size, &floorY1);
+ getIntFromLine(buffer, size, &floorX2);
+ getIntFromLine(buffer, size, &floorY2);
if (currentChapter != 2) {
getIntFromLine(buffer, size, &far);
@@ -903,21 +862,21 @@ void DrasculaEngine::carga_escoba(const char *nom_fich) {
_arj.close();
if (currentChapter == 2 && martin != 0) {
- loadPic(pant2, extraSurface, 1);
- loadPic(pant1, frontSurface, 1);
- loadPic(pant4, backSurface, 1);
+ loadPic(pant2, extraSurface);
+ loadPic(pant1, frontSurface);
+ loadPic(pant4, backSurface);
}
if (currentChapter == 2) {
if (martin == 0) {
stepX = STEP_X;
stepY = STEP_Y;
- alto_hare = CHARACTER_HEIGHT;
- ancho_hare = CHARACTER_WIDTH;
+ curHeight = CHARACTER_HEIGHT;
+ curWidth = CHARACTER_WIDTH;
feetHeight = FEET_HEIGHT;
- loadPic("97.alg", extraSurface, 1);
- loadPic("96.alg", frontSurface, 1);
- loadPic("99.alg", backSurface, 1);
+ loadPic(97, extraSurface);
+ loadPic(96, frontSurface);
+ loadPic(99, backSurface);
strcpy(menuBackground, "99.alg");
}
@@ -925,75 +884,73 @@ void DrasculaEngine::carga_escoba(const char *nom_fich) {
for (l = 0; l < numRoomObjs; l++) {
if (objectNum[l] == objExit)
- obj_salir = l;
+ objIsExit = l;
}
if (currentChapter == 2) {
- if (hare_x == -1) {
- hare_x = _destX[obj_salir];
- hare_y = _destY[obj_salir] - alto_hare;
+ if (curX == -1) {
+ curX = _destX[objIsExit];
+ curY = _destY[objIsExit] - curHeight;
}
characterMoved = 0;
}
- loadPic(roomDisk, drawSurface3, 1);
- char rm[20];
- sprintf(rm, "%i.alg", roomNumber);
- loadPic(rm, drawSurface1, HALF_PAL);
+ loadPic(roomDisk, drawSurface3);
+ loadPic(roomNumber, drawSurface1, HALF_PAL);
copyBackground(0, 171, 0, 0, OBJWIDTH, OBJHEIGHT, backSurface, drawSurface3);
- color_hare();
- if (nivel_osc != 0)
- funde_hare(nivel_osc);
- paleta_hare_claro();
- color_hare();
- funde_hare(nivel_osc + 2);
- paleta_hare_oscuro();
+ setDefaultPalette();
+ if (palLevel != 0)
+ setPaletteBase(palLevel);
+ assignBrightPalette();
+ setDefaultPalette();
+ setPaletteBase(palLevel + 2);
+ assignDarkPalette();
- hare_claro();
+ setBrightPalette();
changeColor = -1;
if (currentChapter == 2)
color_abc(kColorLightGreen);
if (currentChapter != 2) {
- for (l = 0; l <= suelo_y1; l++)
+ for (l = 0; l <= floorY1; l++)
factor_red[l] = far;
- for (l = suelo_y1; l <= 201; l++)
+ for (l = floorY1; l <= 201; l++)
factor_red[l] = near;
- chiquez = (float)(near - far) / (float)(suelo_y2 - suelo_y1);
- for (l = suelo_y1; l <= suelo_y2; l++) {
+ chiquez = (float)(near - far) / (float)(floorY2 - floorY1);
+ for (l = floorY1; l <= floorY2; l++) {
factor_red[l] = (int)(far + pequegnez);
pequegnez = pequegnez + chiquez;
}
}
if (roomNumber == 24) {
- for (l = suelo_y1 - 1; l > 74; l--) {
+ for (l = floorY1 - 1; l > 74; l--) {
factor_red[l] = (int)(far - pequegnez);
pequegnez = pequegnez + chiquez;
}
}
if (currentChapter == 5 && roomNumber == 54) {
- for (l = suelo_y1 - 1; l > 84; l--) {
+ for (l = floorY1 - 1; l > 84; l--) {
factor_red[l] = (int)(far - pequegnez);
pequegnez = pequegnez + chiquez;
}
}
if (currentChapter != 2) {
- if (hare_x == -1) {
- hare_x = _destX[obj_salir];
- hare_y = _destY[obj_salir];
- alto_hare = (CHARACTER_HEIGHT * factor_red[hare_y]) / 100;
- ancho_hare = (CHARACTER_WIDTH * factor_red[hare_y]) / 100;
- hare_y = hare_y - alto_hare;
+ if (curX == -1) {
+ curX = _destX[objIsExit];
+ curY = _destY[objIsExit];
+ curHeight = (CHARACTER_HEIGHT * factor_red[curY]) / 100;
+ curWidth = (CHARACTER_WIDTH * factor_red[curY]) / 100;
+ curY = curY - curHeight;
} else {
- alto_hare = (CHARACTER_HEIGHT * factor_red[hare_y]) / 100;
- ancho_hare = (CHARACTER_WIDTH * factor_red[hare_y]) / 100;
+ curHeight = (CHARACTER_HEIGHT * factor_red[curY]) / 100;
+ curWidth = (CHARACTER_WIDTH * factor_red[curY]) / 100;
}
characterMoved = 0;
}
@@ -1001,7 +958,7 @@ void DrasculaEngine::carga_escoba(const char *nom_fich) {
if (currentChapter == 2) {
soc = 0;
for (l = 0; l < 6; l++) {
- soc += ancho_hare;
+ soc += curWidth;
frame_x[l] = soc;
}
}
@@ -1035,11 +992,11 @@ void DrasculaEngine::carga_escoba(const char *nom_fich) {
if (currentChapter == 2) {
if (roomNumber == 9 || roomNumber == 2 || roomNumber == 14 || roomNumber == 18)
- conta_blind_vez = getTime();
+ savedTime = getTime();
}
if (currentChapter == 4) {
if (roomNumber == 26)
- conta_blind_vez = getTime();
+ savedTime = getTime();
}
if (currentChapter == 4 && roomNumber == 24 && flags[29] == 1)
@@ -1061,18 +1018,18 @@ void DrasculaEngine::clearRoom() {
_system->updateScreen();
}
-void DrasculaEngine::lleva_al_hare(int pointX, int pointY) {
+void DrasculaEngine::gotoObject(int pointX, int pointY) {
if (currentChapter == 5 || currentChapter == 6) {
if (hare_se_ve == 0) {
- hare_x = sitio_x;
- hare_y = sitio_y;
+ curX = roomX;
+ curY = roomY;
updateRoom();
updateScreen();
return;
}
}
- sitio_x = pointX;
- sitio_y = pointY;
+ roomX = pointX;
+ roomY = pointY;
startWalking();
for (;;) {
@@ -1084,7 +1041,7 @@ void DrasculaEngine::lleva_al_hare(int pointX, int pointY) {
if (walkToObject == 1) {
walkToObject = 0;
- sentido_hare = sentido_final;
+ trackProtagonist = trackFinal;
}
updateRoom();
updateScreen();
@@ -1096,7 +1053,7 @@ void DrasculaEngine::moveCursor() {
copyBackground(0, 0, 0, 0, 320, 200, drawSurface1, screenSurface);
updateRefresh_pre();
- pon_hare();
+ moveCharacters();
updateRefresh();
if (!strcmp(textName, "hacker") && hasName == 1) {
@@ -1133,16 +1090,9 @@ void DrasculaEngine::checkObjects() {
}
}
- if (currentChapter == 2) {
- if (mouseX > hare_x + 2 && mouseY > hare_y + 2
- && mouseX < hare_x + ancho_hare - 2 && mouseY < hare_y + alto_hare - 2) {
- strcpy(textName, "hacker");
- hasName = 1;
- veo = 1;
- }
- } else {
- if (mouseX > hare_x + 2 && mouseY > hare_y + 2
- && mouseX < hare_x + ancho_hare - 2 && mouseY < hare_y + alto_hare - 2 && veo == 0) {
+ if (mouseX > curX + 2 && mouseY > curY + 2
+ && mouseX < curX + curWidth - 2 && mouseY < curY + curHeight - 2) {
+ if (currentChapter == 2 || veo == 0) {
strcpy(textName, "hacker");
hasName = 1;
veo = 1;
@@ -1153,20 +1103,19 @@ void DrasculaEngine::checkObjects() {
hasName = 0;
}
-void DrasculaEngine::elige_en_barra() {
- int n, num_verbo = -1;
-
- for (n = 0; n < 7; n++)
- if (mouseX > x_barra[n] && mouseX < x_barra[n + 1])
- num_verbo = n;
+void DrasculaEngine::selectVerbFromBar() {
+ for (int n = 0; n < 7; n++) {
+ if (mouseX > verbBarX[n] && mouseX < verbBarX[n + 1] && n > 0) {
+ selectVerb(n);
+ return;
+ }
+ }
- if (num_verbo < 1)
- withoutVerb();
- else
- selectVerb(num_verbo);
+ // no verb selected
+ withoutVerb();
}
-bool DrasculaEngine::comprueba1() {
+bool DrasculaEngine::verify1() {
int l;
if (menuScreen == 1)
@@ -1182,16 +1131,16 @@ bool DrasculaEngine::comprueba1() {
}
}
- if (mouseX > hare_x && mouseY > hare_y
- && mouseX < hare_x + ancho_hare && mouseY < hare_y + alto_hare)
+ if (mouseX > curX && mouseY > curY
+ && mouseX < curX + curWidth && mouseY < curY + curHeight)
doBreak = 1;
for (l = 0; l < numRoomObjs; l++) {
if (mouseX > x1[l] && mouseY > y1[l]
&& mouseX < x2[l] && mouseY < y2[l] && doBreak == 0) {
- sitio_x = sitiobj_x[l];
- sitio_y = sitiobj_y[l];
- sentido_final = sentidobj[l];
+ roomX = roomObjX[l];
+ roomY = roomObjY[l];
+ trackFinal = trackObj[l];
doBreak = 1;
walkToObject = 1;
startWalking();
@@ -1199,8 +1148,8 @@ bool DrasculaEngine::comprueba1() {
}
if (doBreak == 0) {
- sitio_x = CLIP(mouseX, suelo_x1, suelo_x2);
- sitio_y = CLIP(mouseY, suelo_y1 + feetHeight, suelo_y2);
+ roomX = CLIP(mouseX, floorX1, floorX2);
+ roomY = CLIP(mouseY, floorY1 + feetHeight, floorY2);
startWalking();
}
doBreak = 0;
@@ -1209,7 +1158,7 @@ bool DrasculaEngine::comprueba1() {
return false;
}
-bool DrasculaEngine::comprueba2() {
+bool DrasculaEngine::verify2() {
int l;
if (menuScreen == 1) {
@@ -1217,16 +1166,16 @@ bool DrasculaEngine::comprueba2() {
return true;
} else {
if (!strcmp(textName, "hacker") && hasName == 1) {
- if (checkFlag(50))
+ if (checkAction(50))
return true;
} else {
for (l = 0; l < numRoomObjs; l++) {
if (mouseX > x1[l] && mouseY > y1[l]
&& mouseX < x2[l] && mouseY < y2[l] && visible[l] == 1) {
- sentido_final = sentidobj[l];
+ trackFinal = trackObj[l];
walkToObject = 1;
- lleva_al_hare(sitiobj_x[l], sitiobj_y[l]);
- if (checkFlag(objectNum[l]))
+ gotoObject(roomObjX[l], roomObjY[l]);
+ if (checkAction(objectNum[l]))
return true;
if (currentChapter == 4)
break;
@@ -1263,20 +1212,20 @@ void DrasculaEngine::updateEvents() {
mouseY = event.mouse.y;
break;
case Common::EVENT_LBUTTONDOWN:
- button_izq = 1;
+ leftMouseButton = 1;
break;
case Common::EVENT_LBUTTONUP:
- button_izq = 0;
+ leftMouseButton = 0;
break;
case Common::EVENT_RBUTTONDOWN:
- button_dch = 1;
+ rightMouseButton = 1;
break;
case Common::EVENT_RBUTTONUP:
- button_dch = 0;
+ rightMouseButton = 0;
break;
case Common::EVENT_QUIT:
// TODO
- releaseGame();
+ quitGame();
exit(0);
break;
default:
@@ -1286,10 +1235,8 @@ void DrasculaEngine::updateEvents() {
}
void DrasculaEngine::selectVerb(int verbo) {
- int c = 171;
+ int c = (menuScreen == 1) ? 0 : 171;
- if (menuScreen == 1)
- c = 0;
if (currentChapter == 5) {
if (takeObject == 1 && pickedObject != 16)
addObject(pickedObject);
@@ -1304,24 +1251,33 @@ void DrasculaEngine::selectVerb(int verbo) {
pickedObject = verbo;
}
-void DrasculaEngine::mesa() {
- int nivel_master, nivel_voc, nivel_cd;
+void DrasculaEngine::updateVolume(Audio::Mixer::SoundType soundType, int prevVolume) {
+ int vol = _mixer->getVolumeForSoundType(soundType) / 16;
+ if (mouseY < prevVolume && vol < 15)
+ vol++;
+ if (mouseY > prevVolume && vol > 0)
+ vol--;
+ _mixer->setVolumeForSoundType(soundType, vol * 16);
+}
+
+void DrasculaEngine::volumeControls() {
+ int masterVolume, voiceVolume, musicVolume;
copyRect(1, 56, 73, 63, 177, 97, tableSurface, screenSurface);
updateScreen(73, 63, 73, 63, 177, 97, screenSurface);
- for (;;) {
- nivel_master = 72 + 61 - ((_mixer->getVolumeForSoundType(Audio::Mixer::kPlainSoundType) / 16) * 4);
- nivel_voc = 72 + 61 - ((_mixer->getVolumeForSoundType(Audio::Mixer::kSFXSoundType) / 16) * 4);
- nivel_cd = 72 + 61 - ((_mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType) / 16) * 4);
+ masterVolume = 72 + 61 - ((_mixer->getVolumeForSoundType(Audio::Mixer::kPlainSoundType) / 16) * 4);
+ voiceVolume = 72 + 61 - ((_mixer->getVolumeForSoundType(Audio::Mixer::kSFXSoundType) / 16) * 4);
+ musicVolume = 72 + 61 - ((_mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType) / 16) * 4);
+ for (;;) {
updateRoom();
copyRect(1, 56, 73, 63, 177, 97, tableSurface, screenSurface);
- copyBackground(183, 56, 82, nivel_master, 39, 2 + ((_mixer->getVolumeForSoundType(Audio::Mixer::kPlainSoundType) / 16) * 4), tableSurface, screenSurface);
- copyBackground(183, 56, 138, nivel_voc, 39, 2 + ((_mixer->getVolumeForSoundType(Audio::Mixer::kSFXSoundType) / 16) * 4), tableSurface, screenSurface);
- copyBackground(183, 56, 194, nivel_cd, 39, 2 + ((_mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType) / 16) * 4), tableSurface, screenSurface);
+ copyBackground(183, 56, 82, masterVolume, 39, 2 + ((_mixer->getVolumeForSoundType(Audio::Mixer::kPlainSoundType) / 16) * 4), tableSurface, screenSurface);
+ copyBackground(183, 56, 138, voiceVolume, 39, 2 + ((_mixer->getVolumeForSoundType(Audio::Mixer::kSFXSoundType) / 16) * 4), tableSurface, screenSurface);
+ copyBackground(183, 56, 194, musicVolume, 39, 2 + ((_mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType) / 16) * 4), tableSurface, screenSurface);
setCursorTable();
@@ -1329,37 +1285,25 @@ void DrasculaEngine::mesa() {
updateEvents();
- if (button_dch == 1) {
+ if (rightMouseButton == 1) {
delay(100);
break;
}
- if (button_izq == 1) {
+ if (leftMouseButton == 1) {
delay(100);
if (mouseX > 80 && mouseX < 121) {
- int vol = _mixer->getVolumeForSoundType(Audio::Mixer::kPlainSoundType) / 16;
- if (mouseY < nivel_master && vol < 15)
- vol++;
- if (mouseY > nivel_master && vol > 0)
- vol--;
- _mixer->setVolumeForSoundType(Audio::Mixer::kPlainSoundType, vol * 16);
+ updateVolume(Audio::Mixer::kPlainSoundType, mouseY);
+ masterVolume = 72 + 61 - ((_mixer->getVolumeForSoundType(Audio::Mixer::kPlainSoundType) / 16) * 4);
}
if (mouseX > 136 && mouseX < 178) {
- int vol = _mixer->getVolumeForSoundType(Audio::Mixer::kSFXSoundType) / 16;
- if (mouseY < nivel_voc && vol < 15)
- vol++;
- if (mouseY > nivel_voc && vol > 0)
- vol--;
- _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, vol * 16);
+ updateVolume(Audio::Mixer::kSFXSoundType, mouseY);
+ voiceVolume = 72 + 61 - ((_mixer->getVolumeForSoundType(Audio::Mixer::kSFXSoundType) / 16) * 4);
}
if (mouseX > 192 && mouseX < 233) {
- int vol = _mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType) / 16;
- if (mouseY < nivel_cd && vol < 15)
- vol++;
- if (mouseY > nivel_cd && vol > 0)
- vol--;
- _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, vol * 16);
+ updateVolume(Audio::Mixer::kMusicSoundType, mouseY);
+ musicVolume = 72 + 61 - ((_mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType) / 16) * 4);
}
}
@@ -1368,7 +1312,7 @@ void DrasculaEngine::mesa() {
updateEvents();
}
-bool DrasculaEngine::saves() {
+bool DrasculaEngine::saveLoadScreen() {
char names[10][23];
char file[50];
char fileEpa[50];
@@ -1398,6 +1342,8 @@ bool DrasculaEngine::saves() {
color_abc(kColorLightGreen);
+ select[0] = 0;
+
for (;;) {
y = 27;
copyBackground(0, 0, 0, 0, 320, 200, drawSurface1, screenSurface);
@@ -1412,20 +1358,20 @@ bool DrasculaEngine::saves() {
updateEvents();
- if (button_izq == 1) {
- delay(100);
+ if (leftMouseButton == 1) {
+ delay(50);
for (n = 0; n < NUM_SAVES; n++) {
if (mouseX > 115 && mouseY > y + (9 * n) && mouseX < 115 + 175 && mouseY < y + 10 + (9 * n)) {
strcpy(select, names[n]);
if (strcmp(select, "*"))
- hay_seleccion = 1;
+ selectionMade = 1;
else {
enterName();
strcpy(names[n], select);
- if (hay_seleccion == 1) {
+ if (selectionMade == 1) {
snprintf(file, 50, "%s%02d", _targetName.c_str(), n + 1);
- para_grabar(file);
+ saveGame(file);
Common::OutSaveFile *tsav;
if (!(tsav = _saveFileMan->openForSaving(fileEpa))) {
error("Can't open %s file", fileEpa);
@@ -1445,14 +1391,14 @@ bool DrasculaEngine::saves() {
print_abc(names[n2], 116, y);
y = y + 9;
}
- if (hay_seleccion == 1) {
+ if (selectionMade == 1) {
snprintf(file, 50, "%s%02d", _targetName.c_str(), n + 1);
}
num_sav = n;
}
}
- if (mouseX > 117 && mouseY > 15 && mouseX < 295 && mouseY < 24 && hay_seleccion == 1) {
+ if (mouseX > 117 && mouseY > 15 && mouseX < 295 && mouseY < 24 && selectionMade == 1) {
enterName();
strcpy(names[num_sav], select);
print_abc(select, 117, 15);
@@ -1463,12 +1409,12 @@ bool DrasculaEngine::saves() {
}
}
- if (mouseX > 125 && mouseY > 123 && mouseX < 199 && mouseY < 149 && hay_seleccion == 1) {
- if (!para_cargar(file))
+ if (mouseX > 125 && mouseY > 123 && mouseX < 199 && mouseY < 149 && selectionMade == 1) {
+ if (!loadGame(file))
return false;
break;
- } else if (mouseX > 208 && mouseY > 123 && mouseX < 282 && mouseY < 149 && hay_seleccion == 1) {
- para_grabar(file);
+ } else if (mouseX > 208 && mouseY > 123 && mouseX < 282 && mouseY < 149 && selectionMade == 1) {
+ saveGame(file);
Common::OutSaveFile *tsav;
if (!(tsav = _saveFileMan->openForSaving(fileEpa))) {
error("Can't open %s file", fileEpa);
@@ -1481,22 +1427,20 @@ bool DrasculaEngine::saves() {
delete tsav;
} else if (mouseX > 168 && mouseY > 154 && mouseX < 242 && mouseY < 180)
break;
- else if (hay_seleccion == 0) {
+ else if (selectionMade == 0) {
print_abc("elige una partida", 117, 15);
}
updateScreen();
- delay(400);
+ delay(200);
}
y = 26;
- delay(10);
+ delay(5);
}
clearRoom();
- char rm[20];
- sprintf(rm, "%i.alg", roomNumber);
- loadPic(rm, drawSurface1, HALF_PAL);
- hay_seleccion = 0;
+ loadPic(roomNumber, drawSurface1, HALF_PAL);
+ selectionMade = 0;
return true;
}
@@ -1704,7 +1648,7 @@ void DrasculaEngine::screenSaver() {
// end of efecto()
updateEvents();
- if (button_dch == 1 || button_izq == 1)
+ if (rightMouseButton == 1 || leftMouseButton == 1)
break;
if (mouseX != xr)
break;
@@ -1715,35 +1659,48 @@ void DrasculaEngine::screenSaver() {
free(copia);
free(ghost);
- char rm[20];
- sprintf(rm, "%i.alg", roomNumber);
- loadPic(rm, drawSurface1, HALF_PAL);
+ loadPic(roomNumber, drawSurface1, HALF_PAL);
}
-void DrasculaEngine::fliplay(const char *filefli, int vel) {
- openSSN(filefli, vel);
+void DrasculaEngine::playFLI(const char *filefli, int vel) {
+ // Open file
+ MiVideoSSN = (byte *)malloc(64256);
+ globalSpeed = 1000 / vel;
+ FrameSSN = 0;
+ UsingMem = 0;
+ if (MiVideoSSN == NULL)
+ return;
+ _arj.open(filefli);
+ mSession = TryInMem();
+ LastFrame = _system->getMillis();
+
while (playFrameSSN() && (!term_int)) {
if (getScan() == Common::KEYCODE_ESCAPE)
term_int = 1;
}
- EndSSN();
+
+ free(MiVideoSSN);
+ if (UsingMem)
+ free(pointer);
+ else
+ _arj.close();
}
void DrasculaEngine::fadeFromBlack(int fadeSpeed) {
- char fundido;
+ char fade;
unsigned int color, component;
- DacPalette256 palFundido;
+ DacPalette256 palFade;
- for (fundido = 0; fundido < 64; fundido++) {
+ for (fade = 0; fade < 64; fade++) {
for (color = 0; color < 256; color++) {
for (component = 0; component < 3; component++) {
- palFundido[color][component] = adjustToVGA(gamePalette[color][component] - 63 + fundido);
+ palFade[color][component] = adjustToVGA(gamePalette[color][component] - 63 + fade);
}
}
pause(fadeSpeed);
- setPalette((byte *)&palFundido);
+ setPalette((byte *)&palFade);
}
}
@@ -1841,8 +1798,7 @@ void DrasculaEngine::playSound(int soundNum) {
char file[20];
sprintf(file, "s%i.als", soundNum);
- if (hay_sb == 1)
- playFile(file);
+ playFile(file);
}
bool DrasculaEngine::animate(const char *animationFile, int FPS) {
@@ -1870,7 +1826,7 @@ bool DrasculaEngine::animate(const char *animationFile, int FPS) {
memcpy(VGA, AuxBuffDes, 64000);
_system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200);
_system->updateScreen();
- set_dac(cPal);
+ setPalette(cPal);
memcpy(AuxBuffLast, AuxBuffDes, 64000);
WaitForNext(FPS);
while (cnt < NFrames) {
@@ -1901,25 +1857,25 @@ bool DrasculaEngine::animate(const char *animationFile, int FPS) {
}
void DrasculaEngine::fadeToBlack(int fadeSpeed) {
- char fundido;
+ char fade;
unsigned int color, component;
- DacPalette256 palFundido;
+ DacPalette256 palFade;
- for (fundido = 63; fundido >= 0; fundido--) {
+ for (fade = 63; fade >= 0; fade--) {
for (color = 0; color < 256; color++) {
for (component = 0; component < 3; component++) {
- palFundido[color][component] = adjustToVGA(gamePalette[color][component] - 63 + fundido);
+ palFade[color][component] = adjustToVGA(gamePalette[color][component] - 63 + fade);
}
}
pause(fadeSpeed);
- setPalette((byte *)&palFundido);
+ setPalette((byte *)&palFade);
}
}
-void DrasculaEngine::pause(int cuanto) {
- _system->delayMillis(cuanto * 30); // was originaly 2
+void DrasculaEngine::pause(int duration) {
+ _system->delayMillis(duration * 30); // was originaly 2
}
void DrasculaEngine::placeIgor() {
@@ -1929,9 +1885,9 @@ void DrasculaEngine::placeIgor() {
if (currentChapter == 4) {
pos_igor[1] = 138;
} else {
- if (sentido_igor == 3)
+ if (trackIgor == 3)
pos_igor[1] = 138;
- else if (sentido_igor == 1)
+ else if (trackIgor == 1)
pos_igor[1] = 76;
}
pos_igor[2] = igorX;
@@ -1945,11 +1901,11 @@ void DrasculaEngine::placeIgor() {
void DrasculaEngine::placeDrascula() {
int pos_dr[6];
- if (sentido_dr == 1)
+ if (trackDrascula == 1)
pos_dr[0] = 47;
- else if (sentido_dr == 0)
+ else if (trackDrascula == 0)
pos_dr[0] = 1;
- else if (sentido_dr == 3 && currentChapter == 1)
+ else if (trackDrascula == 3 && currentChapter == 1)
pos_dr[0] = 93;
pos_dr[1] = 122;
pos_dr[2] = x_dr;
@@ -1966,9 +1922,9 @@ void DrasculaEngine::placeDrascula() {
void DrasculaEngine::placeBJ() {
int pos_bj[6];
- if (sentido_bj == 3)
+ if (trackBJ == 3)
pos_bj[0] = 10;
- else if (sentido_bj == 0)
+ else if (trackBJ == 0)
pos_bj[0] = 37;
pos_bj[1] = 99;
pos_bj[2] = x_bj;
@@ -1980,7 +1936,7 @@ void DrasculaEngine::placeBJ() {
}
void DrasculaEngine::hiccup(int counter) {
- int y = 0, sentido = 0;
+ int y = 0, trackCharacter = 0;
if (currentChapter == 3)
y = -1;
@@ -1993,21 +1949,21 @@ void DrasculaEngine::hiccup(int counter) {
else
updateScreen(0, 1, 0, y, 320, 198, screenSurface);
- if (sentido == 0)
+ if (trackCharacter == 0)
y++;
else
y--;
if (currentChapter == 3) {
if (y == 1)
- sentido = 1;
+ trackCharacter = 1;
if (y == -1)
- sentido = 0;
+ trackCharacter = 0;
} else {
if (y == 2)
- sentido = 1;
+ trackCharacter = 1;
if (y == 0)
- sentido = 0;
+ trackCharacter = 0;
}
} while (counter > 0);
@@ -2018,10 +1974,8 @@ void DrasculaEngine::hiccup(int counter) {
void DrasculaEngine::finishSound() {
delay(1);
- if (hay_sb == 1) {
- while (soundIsActive())
- _system->delayMillis(10);
- }
+ while (soundIsActive())
+ _system->delayMillis(10);
}
void DrasculaEngine::playMusic(int p) {
@@ -2042,34 +1996,39 @@ void DrasculaEngine::updateRoom() {
updateRefresh_pre();
if (currentChapter == 3) {
if (flags[0] == 0)
- pon_hare();
+ moveCharacters();
else
- copyRect(113, 54, hare_x - 20, hare_y - 1, 77, 89, drawSurface3, screenSurface);
+ copyRect(113, 54, curX - 20, curY - 1, 77, 89, drawSurface3, screenSurface);
} else {
- pon_hare();
+ moveCharacters();
}
updateRefresh();
}
bool DrasculaEngine::loadGame(const char *gameName) {
- int l, n_ejec2;
+ int l, savedChapter, roomNum = 0;
Common::InSaveFile *sav;
+ previousMusic = roomMusic;
+ menuScreen = 0;
+ if (currentChapter != 1)
+ clearRoom();
+
if (!(sav = _saveFileMan->openForLoading(gameName))) {
error("missing savegame file");
}
- n_ejec2 = sav->readSint32LE();
- if (n_ejec2 != currentChapter) {
+ savedChapter = sav->readSint32LE();
+ if (savedChapter != currentChapter) {
strcpy(saveName, gameName);
- currentChapter = n_ejec2 - 1;
+ currentChapter = savedChapter - 1;
hay_que_load = 1;
return false;
}
sav->read(currentData, 20);
- hare_x = sav->readSint32LE();
- hare_y = sav->readSint32LE();
- sentido_hare = sav->readSint32LE();
+ curX = sav->readSint32LE();
+ curY = sav->readSint32LE();
+ trackProtagonist = sav->readSint32LE();
for (l = 1; l < 43; l++) {
inventoryObjects[l] = sav->readSint32LE();
@@ -2082,6 +2041,9 @@ bool DrasculaEngine::loadGame(const char *gameName) {
takeObject = sav->readSint32LE();
pickedObject = sav->readSint32LE();
hay_que_load = 0;
+ sscanf(currentData, "%d.ald", &roomNum);
+ enterRoom(roomNum);
+ withoutVerb();
return true;
}
@@ -2138,58 +2100,76 @@ void DrasculaEngine::updateDoor(int doorNum) {
}
}
-void DrasculaEngine::color_hare() {
+void DrasculaEngine::assignDefaultPalette() {
+ int color, component;
+
+ for (color = 235; color < 253; color++)
+ for (component = 0; component < 3; component++)
+ defaultPalette[color][component] = gamePalette[color][component];
+}
+
+void DrasculaEngine::assignBrightPalette() {
int color, component;
for (color = 235; color < 253; color++) {
- for (component = 0; component < 3; component++) {
- gamePalette[color][component] = palHare[color][component];
- }
+ for (component = 0; component < 3; component++)
+ brightPalette[color][component] = gamePalette[color][component];
}
- updatePalette();
}
-void DrasculaEngine::funde_hare(int oscuridad) {
- char fundido;
- unsigned int color, component;
+void DrasculaEngine::assignDarkPalette() {
+ int color, component;
- for (fundido = oscuridad; fundido >= 0; fundido--) {
- for (color = 235; color < 253; color++) {
- for (component = 0; component < 3; component++)
- gamePalette[color][component] = adjustToVGA(gamePalette[color][component] - 8 + fundido);
- }
+ for (color = 235; color < 253; color++) {
+ for (component = 0; component < 3; component++)
+ darkPalette[color][component] = gamePalette[color][component];
}
-
- updatePalette();
}
-void DrasculaEngine::paleta_hare_claro() {
+void DrasculaEngine::setDefaultPalette() {
int color, component;
for (color = 235; color < 253; color++) {
- for (component = 0; component < 3; component++)
- palHareClaro[color][component] = gamePalette[color][component];
+ for (component = 0; component < 3; component++) {
+ gamePalette[color][component] = defaultPalette[color][component];
+ }
}
+ setPalette((byte *)&gamePalette);
}
-void DrasculaEngine::paleta_hare_oscuro() {
+void DrasculaEngine::setBrightPalette() {
int color, component;
for (color = 235; color < 253; color++) {
for (component = 0; component < 3; component++)
- palHareOscuro[color][component] = gamePalette[color][component];
+ gamePalette[color][component] = brightPalette[color][component];
}
+
+ setPalette((byte *)&gamePalette);
}
-void DrasculaEngine::hare_claro() {
+void DrasculaEngine::setDarkPalette() {
int color, component;
- for (color = 235; color < 253; color++) {
+ for (color = 235; color < 253; color++ )
for (component = 0; component < 3; component++)
- gamePalette[color][component] = palHareClaro[color][component];
+ gamePalette[color][component] = darkPalette[color][component];
+
+ setPalette((byte *)&gamePalette);
+}
+
+void DrasculaEngine::setPaletteBase(int darkness) {
+ char fade;
+ unsigned int color, component;
+
+ for (fade = darkness; fade >= 0; fade--) {
+ for (color = 235; color < 253; color++) {
+ for (component = 0; component < 3; component++)
+ gamePalette[color][component] = adjustToVGA(gamePalette[color][component] - 8 + fade);
+ }
}
- updatePalette();
+ setPalette((byte *)&gamePalette);
}
void DrasculaEngine::startWalking() {
@@ -2199,76 +2179,76 @@ void DrasculaEngine::startWalking() {
stepY = STEP_Y;
if (currentChapter == 2) {
- if ((sitio_x < hare_x) && (sitio_y <= (hare_y + alto_hare)))
+ if ((roomX < curX) && (roomY <= (curY + curHeight)))
quadrant_1();
- else if ((sitio_x < hare_x) && (sitio_y > (hare_y + alto_hare)))
+ else if ((roomX < curX) && (roomY > (curY + curHeight)))
quadrant_3();
- else if ((sitio_x > hare_x + ancho_hare) && (sitio_y <= (hare_y + alto_hare)))
+ else if ((roomX > curX + curWidth) && (roomY <= (curY + curHeight)))
quadrant_2();
- else if ((sitio_x > hare_x + ancho_hare) && (sitio_y > (hare_y + alto_hare)))
+ else if ((roomX > curX + curWidth) && (roomY > (curY + curHeight)))
quadrant_4();
- else if (sitio_y < hare_y + alto_hare)
+ else if (roomY < curY + curHeight)
walkUp();
- else if (sitio_y > hare_y + alto_hare)
+ else if (roomY > curY + curHeight)
walkDown();
} else {
- if ((sitio_x < hare_x + ancho_hare / 2 ) && (sitio_y <= (hare_y + alto_hare)))
+ if ((roomX < curX + curWidth / 2 ) && (roomY <= (curY + curHeight)))
quadrant_1();
- else if ((sitio_x < hare_x + ancho_hare / 2) && (sitio_y > (hare_y + alto_hare)))
+ else if ((roomX < curX + curWidth / 2) && (roomY > (curY + curHeight)))
quadrant_3();
- else if ((sitio_x > hare_x + ancho_hare / 2) && (sitio_y <= (hare_y + alto_hare)))
+ else if ((roomX > curX + curWidth / 2) && (roomY <= (curY + curHeight)))
quadrant_2();
- else if ((sitio_x > hare_x + ancho_hare / 2) && (sitio_y > (hare_y + alto_hare)))
+ else if ((roomX > curX + curWidth / 2) && (roomY > (curY + curHeight)))
quadrant_4();
else
characterMoved = 0;
}
- conta_vez = getTime();
+ startTime = getTime();
}
-void DrasculaEngine::pon_hare() {
- int pos_hare[6];
+void DrasculaEngine::moveCharacters() {
+ int curPos[6];
int r;
if (characterMoved == 1 && stepX == STEP_X) {
for (r = 0; r < stepX; r++) {
if (currentChapter != 2) {
- if (sentido_hare == 0 && sitio_x - r == hare_x + ancho_hare / 2) {
+ if (trackProtagonist == 0 && roomX - r == curX + curWidth / 2) {
characterMoved = 0;
stepX = STEP_X;
stepY = STEP_Y;
}
- if (sentido_hare == 1 && sitio_x + r == hare_x + ancho_hare / 2) {
+ if (trackProtagonist == 1 && roomX + r == curX + curWidth / 2) {
characterMoved = 0;
stepX = STEP_X;
stepY = STEP_Y;
- hare_x = sitio_x - ancho_hare / 2;
- hare_y = sitio_y - alto_hare;
+ curX = roomX - curWidth / 2;
+ curY = roomY - curHeight;
}
} else if (currentChapter == 2) {
- if (sentido_hare == 0 && sitio_x - r == hare_x) {
+ if (trackProtagonist == 0 && roomX - r == curX) {
characterMoved = 0;
stepX = STEP_X;
stepY = STEP_Y;
}
- if (sentido_hare == 1 && sitio_x + r == hare_x + ancho_hare) {
+ if (trackProtagonist == 1 && roomX + r == curX + curWidth) {
characterMoved = 0;
stepX = STEP_X;
stepY = STEP_Y;
- hare_x = sitio_x - ancho_hare + 4;
- hare_y = sitio_y - alto_hare;
+ curX = roomX - curWidth + 4;
+ curY = roomY - curHeight;
}
}
}
}
if (characterMoved == 1 && stepY == STEP_Y) {
for (r = 0; r < stepY; r++) {
- if (sentido_hare == 2 && sitio_y - r == hare_y + alto_hare) {
+ if (trackProtagonist == 2 && roomY - r == curY + curHeight) {
characterMoved = 0;
stepX = STEP_X;
stepY = STEP_Y;
}
- if (sentido_hare == 3 && sitio_y + r == hare_y + alto_hare) {
+ if (trackProtagonist == 3 && roomY + r == curY + curHeight) {
characterMoved = 0;
stepX = STEP_X;
stepY = STEP_Y;
@@ -2284,81 +2264,81 @@ void DrasculaEngine::pon_hare() {
}
if (characterMoved == 0) {
- pos_hare[0] = 0;
- pos_hare[1] = DIF_MASK_HARE;
- pos_hare[2] = hare_x;
- pos_hare[3] = hare_y;
+ curPos[0] = 0;
+ curPos[1] = DIF_MASK_HARE;
+ curPos[2] = curX;
+ curPos[3] = curY;
if (currentChapter == 2) {
- pos_hare[4] = ancho_hare;
- pos_hare[5] = alto_hare;
+ curPos[4] = curWidth;
+ curPos[5] = curHeight;
} else {
- pos_hare[4] = CHARACTER_WIDTH;
- pos_hare[5] = CHARACTER_HEIGHT;
+ curPos[4] = CHARACTER_WIDTH;
+ curPos[5] = CHARACTER_HEIGHT;
}
- if (sentido_hare == 0) {
- pos_hare[1] = 0;
+ if (trackProtagonist == 0) {
+ curPos[1] = 0;
if (currentChapter == 2)
- copyRectClip(pos_hare, extraSurface, screenSurface);
+ copyRectClip(curPos, extraSurface, screenSurface);
else
- reduce_hare_chico(pos_hare[0], pos_hare[1], pos_hare[2], pos_hare[3], pos_hare[4], pos_hare[5],
- factor_red[hare_y + alto_hare], extraSurface, screenSurface);
- } else if (sentido_hare == 1) {
+ reduce_hare_chico(curPos[0], curPos[1], curPos[2], curPos[3], curPos[4], curPos[5],
+ factor_red[curY + curHeight], extraSurface, screenSurface);
+ } else if (trackProtagonist == 1) {
if (currentChapter == 2)
- copyRectClip(pos_hare, extraSurface, screenSurface);
+ copyRectClip(curPos, extraSurface, screenSurface);
else
- reduce_hare_chico(pos_hare[0], pos_hare[1], pos_hare[2], pos_hare[3], pos_hare[4], pos_hare[5],
- factor_red[hare_y + alto_hare], extraSurface, screenSurface);
- } else if (sentido_hare == 2) {
+ reduce_hare_chico(curPos[0], curPos[1], curPos[2], curPos[3], curPos[4], curPos[5],
+ factor_red[curY + curHeight], extraSurface, screenSurface);
+ } else if (trackProtagonist == 2) {
if (currentChapter == 2)
- copyRectClip(pos_hare, backSurface, screenSurface);
+ copyRectClip(curPos, backSurface, screenSurface);
else
- reduce_hare_chico(pos_hare[0], pos_hare[1], pos_hare[2], pos_hare[3], pos_hare[4], pos_hare[5],
- factor_red[hare_y + alto_hare], backSurface, screenSurface);
+ reduce_hare_chico(curPos[0], curPos[1], curPos[2], curPos[3], curPos[4], curPos[5],
+ factor_red[curY + curHeight], backSurface, screenSurface);
} else {
if (currentChapter == 2)
- copyRectClip(pos_hare, frontSurface, screenSurface);
+ copyRectClip(curPos, frontSurface, screenSurface);
else
- reduce_hare_chico(pos_hare[0], pos_hare[1], pos_hare[2], pos_hare[3], pos_hare[4], pos_hare[5],
- factor_red[hare_y + alto_hare], frontSurface, screenSurface);
+ reduce_hare_chico(curPos[0], curPos[1], curPos[2], curPos[3], curPos[4], curPos[5],
+ factor_red[curY + curHeight], frontSurface, screenSurface);
}
} else if (characterMoved == 1) {
- pos_hare[0] = frame_x[num_frame];
- pos_hare[1] = frame_y + DIF_MASK_HARE;
- pos_hare[2] = hare_x;
- pos_hare[3] = hare_y;
+ curPos[0] = frame_x[num_frame];
+ curPos[1] = frame_y + DIF_MASK_HARE;
+ curPos[2] = curX;
+ curPos[3] = curY;
if (currentChapter == 2) {
- pos_hare[4] = ancho_hare;
- pos_hare[5] = alto_hare;
+ curPos[4] = curWidth;
+ curPos[5] = curHeight;
} else {
- pos_hare[4] = CHARACTER_WIDTH;
- pos_hare[5] = CHARACTER_HEIGHT;
+ curPos[4] = CHARACTER_WIDTH;
+ curPos[5] = CHARACTER_HEIGHT;
}
- if (sentido_hare == 0) {
- pos_hare[1] = 0;
+ if (trackProtagonist == 0) {
+ curPos[1] = 0;
if (currentChapter == 2)
- copyRectClip(pos_hare, extraSurface, screenSurface);
+ copyRectClip(curPos, extraSurface, screenSurface);
else
- reduce_hare_chico(pos_hare[0], pos_hare[1], pos_hare[2], pos_hare[3], pos_hare[4], pos_hare[5],
- factor_red[hare_y + alto_hare], extraSurface, screenSurface);
- } else if (sentido_hare == 1) {
+ reduce_hare_chico(curPos[0], curPos[1], curPos[2], curPos[3], curPos[4], curPos[5],
+ factor_red[curY + curHeight], extraSurface, screenSurface);
+ } else if (trackProtagonist == 1) {
if (currentChapter == 2)
- copyRectClip(pos_hare, extraSurface, screenSurface);
+ copyRectClip(curPos, extraSurface, screenSurface);
else
- reduce_hare_chico(pos_hare[0], pos_hare[1], pos_hare[2], pos_hare[3], pos_hare[4], pos_hare[5],
- factor_red[hare_y + alto_hare], extraSurface, screenSurface);
- } else if (sentido_hare == 2) {
+ reduce_hare_chico(curPos[0], curPos[1], curPos[2], curPos[3], curPos[4], curPos[5],
+ factor_red[curY + curHeight], extraSurface, screenSurface);
+ } else if (trackProtagonist == 2) {
if (currentChapter == 2)
- copyRectClip(pos_hare, backSurface, screenSurface);
+ copyRectClip(curPos, backSurface, screenSurface);
else
- reduce_hare_chico(pos_hare[0], pos_hare[1], pos_hare[2], pos_hare[3], pos_hare[4], pos_hare[5],
- factor_red[hare_y + alto_hare], backSurface, screenSurface);
+ reduce_hare_chico(curPos[0], curPos[1], curPos[2], curPos[3], curPos[4], curPos[5],
+ factor_red[curY + curHeight], backSurface, screenSurface);
} else {
if (currentChapter == 2)
- copyRectClip(pos_hare, frontSurface, screenSurface);
+ copyRectClip(curPos, frontSurface, screenSurface);
else
- reduce_hare_chico(pos_hare[0], pos_hare[1], pos_hare[2], pos_hare[3], pos_hare[4], pos_hare[5],
- factor_red[hare_y + alto_hare], frontSurface, screenSurface);
+ reduce_hare_chico(curPos[0], curPos[1], curPos[2], curPos[3], curPos[4], curPos[5],
+ factor_red[curY + curHeight], frontSurface, screenSurface);
}
increaseFrameNum();
}
@@ -2366,10 +2346,10 @@ void DrasculaEngine::pon_hare() {
void DrasculaEngine::showMenu() {
int h, n, x;
- char texto_icono[13];
+ char textIcon[13];
x = whichObject();
- strcpy(texto_icono, iconName[x]);
+ strcpy(textIcon, iconName[x]);
for (n = 1; n < 43; n++) {
h = inventoryObjects[n];
@@ -2387,18 +2367,18 @@ void DrasculaEngine::showMenu() {
}
if (x < 7)
- print_abc(texto_icono, itemLocations[x].x - 2, itemLocations[x].y - 7);
+ print_abc(textIcon, itemLocations[x].x - 2, itemLocations[x].y - 7);
}
void DrasculaEngine::clearMenu() {
- int n, sobre_verbo = 1;
+ int n, verbActivated = 1;
for (n = 0; n < 7; n++) {
- if (mouseX > x_barra[n] && mouseX < x_barra[n + 1])
- sobre_verbo = 0;
- copyRect(OBJWIDTH * n, OBJHEIGHT * sobre_verbo, x_barra[n], 2,
+ if (mouseX > verbBarX[n] && mouseX < verbBarX[n + 1])
+ verbActivated = 0;
+ copyRect(OBJWIDTH * n, OBJHEIGHT * verbActivated, verbBarX[n], 2,
OBJWIDTH, OBJHEIGHT, backSurface, screenSurface);
- sobre_verbo = 1;
+ verbActivated = 1;
}
}
@@ -2423,7 +2403,9 @@ void DrasculaEngine::removeObject() {
}
bool DrasculaEngine::exitRoom(int l) {
- char roomExit[13];
+ debug(2, "Exiting room from door %d", l);
+
+ int roomNum = 0;
if (currentChapter == 1) {
if (objectNum[l] == 105 && flags[0] == 0)
@@ -2431,12 +2413,12 @@ bool DrasculaEngine::exitRoom(int l) {
else {
updateDoor(l);
if (isDoor[l] != 0) {
- lleva_al_hare(sitiobj_x[l], sitiobj_y[l]);
- sentido_hare = sentidobj[l];
+ gotoObject(roomObjX[l], roomObjY[l]);
+ trackProtagonist = trackObj[l];
updateRoom();
updateScreen();
characterMoved = 0;
- sentido_hare = sentido_alkeva[l];
+ trackProtagonist = trackCharacter_alkeva[l];
objExit = alapuertakeva[l];
doBreak = 1;
previousMusic = roomMusic;
@@ -2446,18 +2428,17 @@ bool DrasculaEngine::exitRoom(int l) {
return true;
}
clearRoom();
- strcpy(roomExit, _targetSurface[l]);
- strcat(roomExit, ".ald");
- hare_x = -1;
- carga_escoba(roomExit);
+ sscanf(_targetSurface[l], "%d", &roomNum);
+ curX = -1;
+ enterRoom(roomNum);
}
}
} else if (currentChapter == 2) {
updateDoor(l);
if (isDoor[l] != 0) {
- lleva_al_hare(sitiobj_x[l], sitiobj_y[l]);
+ gotoObject(roomObjX[l], roomObjY[l]);
characterMoved = 0;
- sentido_hare = sentido_alkeva[l];
+ trackProtagonist = trackCharacter_alkeva[l];
objExit = alapuertakeva[l];
doBreak = 1;
previousMusic = roomMusic;
@@ -2474,91 +2455,85 @@ bool DrasculaEngine::exitRoom(int l) {
}
if (objectNum[l] == 176 && flags[29] == 1) {
flags[29] = 0;
- removeObject(23);
- addObject(11);
+ removeObject(kItemEarWithEarPlug);
+ addObject(kItemEarplugs);
}
clearRoom();
-
- strcpy(roomExit, _targetSurface[l]);
- strcat(roomExit, ".ald");
- hare_x =- 1;
- carga_escoba(roomExit);
+ sscanf(_targetSurface[l], "%d", &roomNum);
+ curX =- 1;
+ enterRoom(roomNum);
}
} else if (currentChapter == 3) {
updateDoor(l);
if (isDoor[l] != 0 && visible[l] == 1) {
- lleva_al_hare(sitiobj_x[l], sitiobj_y[l]);
- sentido_hare = sentidobj[l];
+ gotoObject(roomObjX[l], roomObjY[l]);
+ trackProtagonist = trackObj[l];
updateRoom();
updateScreen();
characterMoved = 0;
- sentido_hare = sentido_alkeva[l];
+ trackProtagonist = trackCharacter_alkeva[l];
objExit = alapuertakeva[l];
doBreak = 1;
previousMusic = roomMusic;
clearRoom();
- strcpy(roomExit, _targetSurface[l]);
- strcat(roomExit, ".ald");
- hare_x =- 1;
- carga_escoba(roomExit);
+ sscanf(_targetSurface[l], "%d", &roomNum);
+ curX =- 1;
+ enterRoom(roomNum);
}
} else if (currentChapter == 4) {
updateDoor(l);
if (isDoor[l] != 0) {
- lleva_al_hare(sitiobj_x[l], sitiobj_y[l]);
- sentido_hare = sentidobj[l];
+ gotoObject(roomObjX[l], roomObjY[l]);
+ trackProtagonist = trackObj[l];
updateRoom();
updateScreen();
characterMoved = 0;
- sentido_hare = sentido_alkeva[l];
+ trackProtagonist = trackCharacter_alkeva[l];
objExit = alapuertakeva[l];
doBreak = 1;
previousMusic = roomMusic;
if (objectNum[l] == 108)
- lleva_al_hare(171, 78);
+ gotoObject(171, 78);
clearRoom();
- strcpy(roomExit, _targetSurface[l]);
- strcat(roomExit, ".ald");
- hare_x = -1;
- carga_escoba(roomExit);
+ sscanf(_targetSurface[l], "%d", &roomNum);
+ curX = -1;
+ enterRoom(roomNum);
}
} else if (currentChapter == 5) {
updateDoor(l);
if (isDoor[l] != 0 && visible[l] == 1) {
- lleva_al_hare(sitiobj_x[l], sitiobj_y[l]);
- sentido_hare = sentidobj[l];
+ gotoObject(roomObjX[l], roomObjY[l]);
+ trackProtagonist = trackObj[l];
updateRoom();
updateScreen();
characterMoved = 0;
- sentido_hare = sentido_alkeva[l];
+ trackProtagonist = trackCharacter_alkeva[l];
objExit = alapuertakeva[l];
doBreak = 1;
previousMusic = roomMusic;
hare_se_ve = 1;
clearRoom();
- strcpy(roomExit, _targetSurface[l]);
- strcat(roomExit, ".ald");
- hare_x = -1;
- carga_escoba(roomExit);
+ sscanf(_targetSurface[l], "%d", &roomNum);
+ curX = -1;
+ enterRoom(roomNum);
}
} else if (currentChapter == 6) {
updateDoor(l);
if (isDoor[l] != 0) {
- lleva_al_hare(sitiobj_x[l], sitiobj_y[l]);
- sentido_hare = sentidobj[l];
+ gotoObject(roomObjX[l], roomObjY[l]);
+ trackProtagonist = trackObj[l];
updateRoom();
updateScreen();
characterMoved = 0;
- sentido_hare = sentido_alkeva[l];
+ trackProtagonist = trackCharacter_alkeva[l];
objExit = alapuertakeva[l];
doBreak = 1;
previousMusic = roomMusic;
clearRoom();
- strcpy(roomExit, _targetSurface[l]);
- strcat(roomExit, ".ald");
- hare_x = -1;
- carga_escoba(roomExit);
+ sscanf(_targetSurface[l], "%d", &roomNum);
+ curX = -1;
+ enterRoom(roomNum);
if (objExit == 105)
animation_19_6();
@@ -2569,8 +2544,7 @@ bool DrasculaEngine::exitRoom(int l) {
}
bool DrasculaEngine::pickupObject() {
- int h, n;
- h = pickedObject;
+ int h = pickedObject;
checkFlags = 1;
updateRoom();
@@ -2579,7 +2553,7 @@ bool DrasculaEngine::pickupObject() {
// Objects with an ID smaller than 7 are the inventory verbs
if (pickedObject >= 7) {
- for (n = 1; n < 43; n++) {
+ for (int n = 1; n < 43; n++) {
if (whichObject() == n && inventoryObjects[n] == 0) {
inventoryObjects[n] = h;
takeObject = 0;
@@ -2656,28 +2630,10 @@ void DrasculaEngine::enterName() {
}
if (h == 1) {
strcpy(select, select2);
- hay_seleccion = 1;
+ selectionMade = 1;
}
}
-void DrasculaEngine::para_grabar(char gameName[]) {
- saveGame(gameName);
- playSound(99);
- finishSound();
-}
-
-void DrasculaEngine::openSSN(const char *Name, int Pause) {
- MiVideoSSN = (byte *)malloc(64256);
- globalSpeed = 1000 / Pause;
- FrameSSN = 0;
- UsingMem = 0;
- if (MiVideoSSN == NULL)
- return;
- _arj.open(Name);
- mSession = TryInMem();
- LastFrame = _system->getMillis();
-}
-
int DrasculaEngine::playFrameSSN() {
int Exit = 0;
uint32 Lengt;
@@ -2698,7 +2654,7 @@ int DrasculaEngine::playFrameSSN() {
memcpy(dacSSN, mSession, 768);
mSession += 768;
}
- set_dacSSN(dacSSN);
+ setPalette(dacSSN);
break;
case kFrameEmptyFrame:
WaitFrameSSN();
@@ -2772,15 +2728,6 @@ int DrasculaEngine::playFrameSSN() {
return (!Exit);
}
-void DrasculaEngine::EndSSN() {
- free(MiVideoSSN);
- if (UsingMem)
- free(pointer);
- else {
- _arj.close();
- }
-}
-
byte *DrasculaEngine::TryInMem() {
int Lengt;
@@ -2797,10 +2744,6 @@ byte *DrasculaEngine::TryInMem() {
return pointer;
}
-void DrasculaEngine::set_dacSSN(byte *PalBuf) {
- setPalette((byte *)PalBuf);
-}
-
void DrasculaEngine::Des_OFF(byte *BufferOFF, byte *MiVideoOFF, int Lenght) {
int x = 0;
unsigned char Reps;
@@ -2875,10 +2818,6 @@ byte *DrasculaEngine::loadPCX(byte *NamePcc) {
return AuxBuffDes;
}
-void DrasculaEngine::set_dac(byte *dac) {
- setPalette((byte *)dac);
-}
-
void DrasculaEngine::WaitForNext(int FPS) {
_system->delayMillis(1000 / FPS);
}
@@ -2921,86 +2860,86 @@ void DrasculaEngine::reduce_hare_chico(int xx1, int yy1, int xx2, int yy2, int w
}
void DrasculaEngine::quadrant_1() {
- float distance_x, distance_y;
+ float distanceX, distanceY;
if (currentChapter == 2)
- distance_x = hare_x - sitio_x;
+ distanceX = curX - roomX;
else
- distance_x = hare_x + ancho_hare / 2 - sitio_x;
+ distanceX = curX + curWidth / 2 - roomX;
- distance_y = (hare_y + alto_hare) - sitio_y;
+ distanceY = (curY + curHeight) - roomY;
- if (distance_x < distance_y) {
- direccion_hare = 0;
- sentido_hare = 2;
- stepX = (int)(distance_x / (distance_y / STEP_Y));
+ if (distanceX < distanceY) {
+ curDirection = 0;
+ trackProtagonist = 2;
+ stepX = (int)(distanceX / (distanceY / STEP_Y));
} else {
- direccion_hare = 7;
- sentido_hare = 0;
- stepY = (int)(distance_y / (distance_x / STEP_X));
+ curDirection = 7;
+ trackProtagonist = 0;
+ stepY = (int)(distanceY / (distanceX / STEP_X));
}
}
void DrasculaEngine::quadrant_2() {
- float distance_x, distance_y;
+ float distanceX, distanceY;
if (currentChapter == 2)
- distance_x = abs(hare_x + ancho_hare - sitio_x);
+ distanceX = abs(curX + curWidth - roomX);
else
- distance_x = abs(hare_x + ancho_hare / 2 - sitio_x);
+ distanceX = abs(curX + curWidth / 2 - roomX);
- distance_y = (hare_y + alto_hare) - sitio_y;
+ distanceY = (curY + curHeight) - roomY;
- if (distance_x < distance_y) {
- direccion_hare = 1;
- sentido_hare = 2;
- stepX = (int)(distance_x / (distance_y / STEP_Y));
+ if (distanceX < distanceY) {
+ curDirection = 1;
+ trackProtagonist = 2;
+ stepX = (int)(distanceX / (distanceY / STEP_Y));
} else {
- direccion_hare = 2;
- sentido_hare = 1;
- stepY = (int)(distance_y / (distance_x / STEP_X));
+ curDirection = 2;
+ trackProtagonist = 1;
+ stepY = (int)(distanceY / (distanceX / STEP_X));
}
}
void DrasculaEngine::quadrant_3() {
- float distance_x, distance_y;
+ float distanceX, distanceY;
if (currentChapter == 2)
- distance_x = hare_x - sitio_x;
+ distanceX = curX - roomX;
else
- distance_x = hare_x + ancho_hare / 2 - sitio_x;
+ distanceX = curX + curWidth / 2 - roomX;
- distance_y = sitio_y - (hare_y + alto_hare);
+ distanceY = roomY - (curY + curHeight);
- if (distance_x < distance_y) {
- direccion_hare = 5;
- sentido_hare = 3;
- stepX = (int)(distance_x / (distance_y / STEP_Y));
+ if (distanceX < distanceY) {
+ curDirection = 5;
+ trackProtagonist = 3;
+ stepX = (int)(distanceX / (distanceY / STEP_Y));
} else {
- direccion_hare = 6;
- sentido_hare = 0;
- stepY = (int)(distance_y / (distance_x / STEP_X));
+ curDirection = 6;
+ trackProtagonist = 0;
+ stepY = (int)(distanceY / (distanceX / STEP_X));
}
}
void DrasculaEngine::quadrant_4() {
- float distance_x, distance_y;
+ float distanceX, distanceY;
if (currentChapter == 2)
- distance_x = abs(hare_x + ancho_hare - sitio_x);
+ distanceX = abs(curX + curWidth - roomX);
else
- distance_x = abs(hare_x + ancho_hare / 2 - sitio_x);
+ distanceX = abs(curX + curWidth / 2 - roomX);
- distance_y = sitio_y - (hare_y + alto_hare);
+ distanceY = roomY - (curY + curHeight);
- if (distance_x < distance_y) {
- direccion_hare = 4;
- sentido_hare = 3;
- stepX = (int)(distance_x / (distance_y / STEP_Y));
+ if (distanceX < distanceY) {
+ curDirection = 4;
+ trackProtagonist = 3;
+ stepX = (int)(distanceX / (distanceY / STEP_Y));
} else {
- direccion_hare = 3;
- sentido_hare = 1;
- stepY = (int)(distance_y / (distance_x / STEP_X));
+ curDirection = 3;
+ trackProtagonist = 1;
+ stepY = (int)(distanceY / (distanceX / STEP_X));
}
}
@@ -3013,9 +2952,9 @@ void DrasculaEngine::saveGame(char gameName[]) {
}
out->writeSint32LE(currentChapter);
out->write(currentData, 20);
- out->writeSint32LE(hare_x);
- out->writeSint32LE(hare_y);
- out->writeSint32LE(sentido_hare);
+ out->writeSint32LE(curX);
+ out->writeSint32LE(curY);
+ out->writeSint32LE(trackProtagonist);
for (l = 1; l < 43; l++) {
out->writeSint32LE(inventoryObjects[l]);
@@ -3033,37 +2972,40 @@ void DrasculaEngine::saveGame(char gameName[]) {
warning("Can't write file '%s'. (Disk full?)", gameName);
delete out;
+
+ playSound(99);
+ finishSound();
}
void DrasculaEngine::increaseFrameNum() {
- diff_vez = getTime() - conta_vez;
+ timeDiff = getTime() - startTime;
- if (diff_vez >= 6) {
- conta_vez = getTime();
+ if (timeDiff >= 6) {
+ startTime = getTime();
num_frame++;
if (num_frame == 6)
num_frame = 0;
- if (direccion_hare == 0 || direccion_hare == 7) {
- hare_x = hare_x - stepX;
- hare_y = hare_y - stepY;
- } else if (direccion_hare == 1 || direccion_hare == 2) {
- hare_x = hare_x + stepX;
- hare_y = hare_y - stepY;
- } else if (direccion_hare == 3 || direccion_hare == 4) {
- hare_x = hare_x + stepX;
- hare_y = hare_y + stepY;
- } else if (direccion_hare == 5 || direccion_hare == 6) {
- hare_x = hare_x - stepX;
- hare_y = hare_y + stepY;
+ if (curDirection == 0 || curDirection == 7) {
+ curX -= stepX;
+ curY -= stepY;
+ } else if (curDirection == 1 || curDirection == 2) {
+ curX += stepX;
+ curY -= stepY;
+ } else if (curDirection == 3 || curDirection == 4) {
+ curX += stepX;
+ curY += stepY;
+ } else if (curDirection == 5 || curDirection == 6) {
+ curX -= stepX;
+ curY += stepY;
}
}
if (currentChapter != 2) {
- hare_y += (int)(alto_hare - newHeight);
- hare_x += (int)(ancho_hare - newWidth);
- alto_hare = (int)newHeight;
- ancho_hare = (int)newWidth;
+ curY += (int)(curHeight - newHeight);
+ curX += (int)(curWidth - newWidth);
+ curHeight = (int)newHeight;
+ curWidth = (int)newWidth;
}
}
@@ -3086,7 +3028,7 @@ bool DrasculaEngine::checkMenuFlags() {
if (whichObject() == n) {
h = inventoryObjects[n];
if (h != 0)
- if (checkFlag(h))
+ if (checkAction(h))
return true;
}
}
@@ -3094,14 +3036,15 @@ bool DrasculaEngine::checkMenuFlags() {
return false;
}
-void DrasculaEngine::converse(const char *nom_fich) {
+void DrasculaEngine::converse(int index) {
+ char fileName[20];
+ sprintf(fileName, "op_%d.cal", index);
int h;
int game1 = 1, game2 = 1, game3 = 1, game4 = 1;
char phrase1[78];
char phrase2[78];
char phrase3[87];
char phrase4[78];
- char para_codificar[13];
char sound1[13];
char sound2[13];
char sound3[13];
@@ -3117,14 +3060,12 @@ void DrasculaEngine::converse(const char *nom_fich) {
breakOut = 0;
- strcpy(para_codificar, nom_fich);
-
if (currentChapter == 5)
withoutVerb();
- _arj.open(nom_fich);
+ _arj.open(fileName);
if (!_arj.isOpen()) {
- error("missing data file %s", nom_fich);
+ error("missing data file %s", fileName);
}
int size = _arj.size();
@@ -3142,19 +3083,19 @@ void DrasculaEngine::converse(const char *nom_fich) {
_arj.close();
- if (currentChapter == 2 && !strcmp(nom_fich, "op_5.cal") && flags[38] == 1 && flags[33] == 1) {
+ if (currentChapter == 2 && !strcmp(fileName, "op_5.cal") && flags[38] == 1 && flags[33] == 1) {
strcpy(phrase3, _text[_lang][405]);
strcpy(sound3, "405.als");
answer3 = 31;
}
- if (currentChapter == 6 && !strcmp(nom_fich, "op_12.cal") && flags[7] == 1) {
+ if (currentChapter == 6 && !strcmp(fileName, "op_12.cal") && flags[7] == 1) {
strcpy(phrase3, _text[_lang][273]);
strcpy(sound3, "273.als");
answer3 = 14;
}
- if (currentChapter == 6 && !strcmp(nom_fich, "op_12.cal") && flags[10] == 1) {
+ if (currentChapter == 6 && !strcmp(fileName, "op_12.cal") && flags[10] == 1) {
strcpy(phrase3, " cuanto queda para que acabe el partido?");
strcpy(sound3, "274.als");
answer3 = 15;
@@ -3180,7 +3121,7 @@ void DrasculaEngine::converse(const char *nom_fich) {
if (phrase4[h] == (char)0xa7)
phrase4[h] = ' ';
- loadPic("car.alg", backSurface, 1);
+ loadPic("car.alg", backSurface);
// TODO code here should limit y position for mouse in dialog menu,
// but we can't implement this due lack backend functionality
// from 1(top) to 31
@@ -3236,7 +3177,7 @@ void DrasculaEngine::converse(const char *nom_fich) {
updateScreen();
- if ((button_izq == 1) && (game1 == 2)) {
+ if ((leftMouseButton == 1) && (game1 == 2)) {
delay(100);
used1 = 1;
talk(phrase1, sound1);
@@ -3244,7 +3185,7 @@ void DrasculaEngine::converse(const char *nom_fich) {
grr();
else
response(answer1);
- } else if ((button_izq == 1) && (game2 == 2)) {
+ } else if ((leftMouseButton == 1) && (game2 == 2)) {
delay(100);
used2 = 1;
talk(phrase2, sound2);
@@ -3252,7 +3193,7 @@ void DrasculaEngine::converse(const char *nom_fich) {
grr();
else
response(answer2);
- } else if ((button_izq == 1) && (game3 == 2)) {
+ } else if ((leftMouseButton == 1) && (game3 == 2)) {
delay(100);
used3 = 1;
talk(phrase3, sound3);
@@ -3260,13 +3201,13 @@ void DrasculaEngine::converse(const char *nom_fich) {
grr();
else
response(answer3);
- } else if ((button_izq == 1) && (game4 == 2)) {
+ } else if ((leftMouseButton == 1) && (game4 == 2)) {
delay(100);
talk(phrase4, sound4);
breakOut = 1;
}
- if (button_izq == 1) {
+ if (leftMouseButton == 1) {
delay(100);
color_abc(kColorLightGreen);
}
@@ -3278,21 +3219,17 @@ void DrasculaEngine::converse(const char *nom_fich) {
} // while (breakOut == 0)
if (currentChapter == 2)
- loadPic(menuBackground, backSurface, 1);
+ loadPic(menuBackground, backSurface);
else
- loadPic("99.alg", backSurface, 1);
+ loadPic(99, backSurface);
if (currentChapter != 5)
withoutVerb();
}
void DrasculaEngine::response(int function) {
if (currentChapter == 1) {
- if (function == 10)
- talk_drunk(1);
- else if (function == 11)
- talk_drunk(2);
- else if (function == 12)
- talk_drunk(3);
+ if (function >= 10 && function <= 12)
+ talk_drunk(function - 9);
} else if (currentChapter == 2) {
if (function == 8)
animation_8_2();
@@ -3366,18 +3303,18 @@ void DrasculaEngine::response(int function) {
}
}
-void DrasculaEngine::addObject(int osj) {
+void DrasculaEngine::addObject(int obj) {
int h, position = 0;
for (h = 1; h < 43; h++) {
- if (inventoryObjects[h] == osj)
+ if (inventoryObjects[h] == obj)
position = 1;
}
if (position == 0) {
for (h = 1; h < 43; h++) {
if (inventoryObjects[h] == 0) {
- inventoryObjects[h] = osj;
+ inventoryObjects[h] = obj;
position = 1;
break;
}
@@ -3386,9 +3323,7 @@ void DrasculaEngine::addObject(int osj) {
}
void DrasculaEngine::stopSound() {
- if (hay_sb == 1) {
- _mixer->stopHandle(_soundHandle);
- }
+ _mixer->stopHandle(_soundHandle);
}
void DrasculaEngine::MusicFadeout() {
@@ -3494,7 +3429,7 @@ void DrasculaEngine::updateVisible() {
if (roomNumber == 59)
isDoor[1] = 0;
if (roomNumber == 60) {
- sentido_dr = 0;
+ trackDrascula = 0;
x_dr = 155;
y_dr = 69;
}
@@ -3502,38 +3437,38 @@ void DrasculaEngine::updateVisible() {
}
void DrasculaEngine::walkDown() {
- direccion_hare = 4;
- sentido_hare = 3;
+ curDirection = 4;
+ trackProtagonist = 3;
stepX = 0;
}
void DrasculaEngine::walkUp() {
- direccion_hare = 0;
- sentido_hare = 2;
+ curDirection = 0;
+ trackProtagonist = 2;
stepX = 0;
}
-void DrasculaEngine::pon_vb() {
+void DrasculaEngine::moveVB() {
int pos_vb[6];
- if (vb_se_mueve == 0) {
+ if (vbHasMoved == 0) {
pos_vb[0] = 256;
pos_vb[1] = 129;
- pos_vb[2] = vb_x;
+ pos_vb[2] = vbX;
pos_vb[3] = 66;
pos_vb[4] = 33;
pos_vb[5] = 69;
- if (sentido_vb == 0)
+ if (trackVB == 0)
pos_vb[0] = 222;
- else if (sentido_vb == 1)
+ else if (trackVB == 1)
pos_vb[0] = 188;
} else {
- pos_vb[2] = vb_x;
+ pos_vb[2] = vbX;
pos_vb[3] = 66;
pos_vb[4] = 28;
pos_vb[5] = 68;
- if (sentido_vb == 0) {
+ if (trackVB == 0) {
pos_vb[0] = frame_vb;
pos_vb[1] = 62;
} else {
@@ -3549,30 +3484,30 @@ void DrasculaEngine::pon_vb() {
copyRectClip(pos_vb, frontSurface, screenSurface);
}
-void DrasculaEngine::lleva_vb(int pointX) {
- sentido_vb = (pointX < vb_x) ? 0 : 1;
- vb_se_mueve = 1;
+void DrasculaEngine::placeVB(int pointX) {
+ trackVB = (pointX < vbX) ? 0 : 1;
+ vbHasMoved = 1;
for (;;) {
updateRoom();
updateScreen();
- if (sentido_vb == 0) {
- vb_x = vb_x - 5;
- if (vb_x <= pointX)
+ if (trackVB == 0) {
+ vbX = vbX - 5;
+ if (vbX <= pointX)
break;
} else {
- vb_x = vb_x + 5;
- if (vb_x >= pointX)
+ vbX = vbX + 5;
+ if (vbX >= pointX)
break;
}
pause(5);
}
- vb_se_mueve = 0;
+ vbHasMoved = 0;
}
void DrasculaEngine::hipo_sin_nadie(int counter){
- int y = 0, sentido = 0;
+ int y = 0, trackCharacter = 0;
if (currentChapter == 3)
y = -1;
@@ -3585,21 +3520,21 @@ void DrasculaEngine::hipo_sin_nadie(int counter){
else
updateScreen(0, 1, 0, y, 320, 198, screenSurface);
- if (sentido == 0)
+ if (trackCharacter == 0)
y++;
else
y--;
if (currentChapter == 3) {
if (y == 1)
- sentido = 1;
+ trackCharacter = 1;
if (y == -1)
- sentido = 0;
+ trackCharacter = 0;
} else {
if (y == 2)
- sentido = 1;
+ trackCharacter = 1;
if (y == 0)
- sentido = 0;
+ trackCharacter = 0;
}
} while (counter > 0);
@@ -3650,8 +3585,7 @@ void DrasculaEngine::grr() {
color_abc(kColorDarkGreen);
- if (hay_sb == 1)
- playFile("s10.als");
+ playFile("s10.als");
updateRoom();
copyBackground(253, 110, 150, 65, 20, 30, drawSurface3, screenSurface);
@@ -3671,14 +3605,14 @@ void DrasculaEngine::activatePendulum() {
flags[1] = 2;
hare_se_ve = 0;
roomNumber = 102;
- loadPic("102.alg", drawSurface1, HALF_PAL);
- loadPic("an_p1.alg", drawSurface3, 1);
- loadPic("an_p2.alg", extraSurface, 1);
- loadPic("an_p3.alg", frontSurface, 1);
+ loadPic(102, drawSurface1, HALF_PAL);
+ loadPic("an_p1.alg", drawSurface3);
+ loadPic("an_p2.alg", extraSurface);
+ loadPic("an_p3.alg", frontSurface);
copyBackground(0, 171, 0, 0, OBJWIDTH, OBJHEIGHT, backSurface, drawSurface3);
- conta_blind_vez = getTime();
+ savedTime = getTime();
}
void DrasculaEngine::closeDoor(int nflag, int doorNum) {
diff --git a/engines/drascula/drascula.h b/engines/drascula/drascula.h
index 3552bb1c0f..cbc1d0b442 100644
--- a/engines/drascula/drascula.h
+++ b/engines/drascula/drascula.h
@@ -68,6 +68,38 @@ enum Verbs {
kVerbMove = 6
};
+// Items up to chapter 3
+enum InventoryItems {
+ kItemMoney = 7,
+ kItemLeaves = 8,
+ kItemCross = 9,
+ kItemSpike = 10,
+ kItemEarplugs = 11,
+ kItemBook = 12,
+ kItemBubbleGum = 13,
+ kItemSickle = 14,
+ kItemTissues = 15,
+ kItemCigarettes = 16,
+ kItemCandle = 17,
+ kItemTwoCoins = 18,
+ kItemOneCoin = 19,
+ kItemReefer = 20,
+ kItemKey = 21,
+ kItemHandbag = 22,
+ kItemEarWithEarPlug = 23,
+ kItemPhone = 28
+};
+
+// Items from chapter 4 onwards
+enum InventoryItems2 {
+ kItemKey2 = 7,
+ kItemCross2 = 9,
+ kItemRope2 = 19,
+ kItemReefer2 = 20,
+ kItemOneCoin2 = 22,
+ kItemPhone2 = 28
+};
+
enum Colors {
kColorBrown = 1,
kColorDarkBlue = 2,
@@ -105,7 +137,8 @@ enum IgorTalkerTypes {
struct DrasculaGameDescription;
struct RoomTalkAction {
- int num;
+ int room;
+ int chapter;
int action;
int objectID;
int speechID;
@@ -122,32 +155,32 @@ struct CharInfo {
int charType; // 0 - letters, 1 - signs, 2 - accented
};
-#define CHARMAP_SIZE 93
-#define NUM_SAVES 10
-#define NUM_FLAGS 50
-#define DIF_MASK 55
-#define OBJWIDTH 40
-#define OBJHEIGHT 25
-
-#define DIF_MASK_HARE 72
-#define DIF_MASK_ABC 22
-#define CHAR_WIDTH 8
-#define CHAR_HEIGHT 6
-
-#define TALK_HEIGHT 25
-#define TALK_WIDTH 23
-#define STEP_X 8
-#define STEP_Y 3
-#define CHARACTER_HEIGHT 70
-#define CHARACTER_WIDTH 43
-#define FEET_HEIGHT 12
-
-#define CHAR_WIDTH_OPC 6
-#define CHAR_HEIGHT_OPC 5
-#define NO_DOOR 99
-
-#define COMPLETE_PAL 256
-#define HALF_PAL 128
+#define CHARMAP_SIZE 93
+#define NUM_SAVES 10
+#define NUM_FLAGS 50
+#define DIF_MASK 55
+#define OBJWIDTH 40
+#define OBJHEIGHT 25
+
+#define DIF_MASK_HARE 72
+#define DIF_MASK_ABC 22
+#define CHAR_WIDTH 8
+#define CHAR_HEIGHT 6
+
+#define TALK_HEIGHT 25
+#define TALK_WIDTH 23
+#define STEP_X 8
+#define STEP_Y 3
+#define CHARACTER_HEIGHT 70
+#define CHARACTER_WIDTH 43
+#define FEET_HEIGHT 12
+
+#define CHAR_WIDTH_OPC 6
+#define CHAR_HEIGHT_OPC 5
+#define NO_DOOR 99
+
+#define COMPLETE_PAL 256
+#define HALF_PAL 128
static const int interf_x[] ={ 1, 65, 129, 193, 1, 65, 129 };
static const int interf_y[] ={ 51, 51, 51, 51, 83, 83, 83 };
@@ -176,16 +209,20 @@ public:
void allocMemory();
void freeMemory();
- void releaseGame();
+ void quitGame();
- void loadPic(const char *NamePcc, byte *targetSurface, int colorCount);
- void decompressPic(byte *targetSurface, int colorCount);
+ void loadPic(int roomNum, byte *targetSurface, int colorCount = 1) {
+ char rm[20];
+ sprintf(rm, "%i.alg", roomNum);
+ loadPic(rm, targetSurface, colorCount);
+ }
+
+ void loadPic(const char *NamePcc, byte *targetSurface, int colorCount = 1);
typedef char DacPalette256[256][3];
void setRGB(byte *dir_lectura, int plt);
- void paleta_hare();
- void updatePalette();
+ void assignDefaultPalette();
void setPalette(byte *PalBuf);
void copyBackground(int xorg, int yorg, int xdes, int ydes, int width,
int height, byte *src, byte *dest);
@@ -208,9 +245,9 @@ public:
}
DacPalette256 gamePalette;
- DacPalette256 palHare;
- DacPalette256 palHareClaro;
- DacPalette256 palHareOscuro;
+ DacPalette256 defaultPalette;
+ DacPalette256 brightPalette;
+ DacPalette256 darkPalette;
byte *VGA;
@@ -230,8 +267,7 @@ public:
Common::ArjFile _arj;
- int hay_sb;
- int nivel_osc, previousMusic, roomMusic;
+ int previousMusic, roomMusic;
int roomNumber;
char roomDisk[20];
char currentData[20];
@@ -242,10 +278,10 @@ public:
char iconName[44][13];
int objectNum[40], visible[40], isDoor[40];
- int sitiobj_x[40], sitiobj_y[40], sentidobj[40];
+ int roomObjX[40], roomObjY[40], trackObj[40];
int inventoryObjects[43];
char _targetSurface[40][20];
- int _destX[40], _destY[40], sentido_alkeva[40], alapuertakeva[40];
+ int _destX[40], _destY[40], trackCharacter_alkeva[40], alapuertakeva[40];
int x1[40], y1[40], x2[40], y2[40];
int takeObject, pickedObject;
int withVoices;
@@ -254,28 +290,28 @@ public:
int frame_blind;
int frame_snore;
int frame_bat;
- int c_mirar;
- int c_poder;
+ int curExcuseLook;
+ int curExcuseAction;
int flags[NUM_FLAGS];
int frame_y;
- int hare_x, hare_y, characterMoved, direccion_hare, sentido_hare, num_frame, hare_se_ve;
- int sitio_x, sitio_y, checkFlags;
+ int curX, curY, characterMoved, curDirection, trackProtagonist, num_frame, hare_se_ve;
+ int roomX, roomY, checkFlags;
int doBreak;
int stepX, stepY;
- int alto_hare, ancho_hare, feetHeight;
+ int curHeight, curWidth, feetHeight;
int talkHeight, talkWidth;
- int suelo_x1, suelo_y1, suelo_x2, suelo_y2;
+ int floorX1, floorY1, floorX2, floorY2;
int near, far;
- int sentido_final, walkToObject;
+ int trackFinal, walkToObject;
int objExit;
- int diff_vez, conta_vez;
+ int timeDiff, startTime;
int hasAnswer;
- int conta_blind_vez;
+ int savedTime;
int changeColor;
int breakOut;
- int vb_x, sentido_vb, vb_se_mueve, frame_vb;
+ int vbX, trackVB, vbHasMoved, frame_vb;
float newHeight, newWidth;
int factor_red[202];
int frame_piano;
@@ -283,9 +319,9 @@ public:
int frame_candles;
int color_solo;
int blinking;
- int igorX, igorY, sentido_igor;
- int x_dr, y_dr, sentido_dr;
- int x_bj, y_bj, sentido_bj;
+ int igorX, igorY, trackIgor;
+ int x_dr, y_dr, trackDrascula;
+ int x_bj, y_bj, trackBJ;
int cont_sv;
int term_int;
int currentChapter;
@@ -294,118 +330,40 @@ public:
int _color;
int musicStopped;
char select[23];
- int hay_seleccion;
+ int selectionMade;
int mouseX;
int mouseY;
int mouseY_ant;
- int button_izq;
- int button_dch;
+ int leftMouseButton;
+ int rightMouseButton;
- bool escoba();
+ bool runCurrentChapter();
void black();
void pickObject(int);
void walkUp();
void walkDown();
- void pon_vb();
- void lleva_vb(int pointX);
+ void moveVB();
+ void placeVB(int pointX);
void hipo_sin_nadie(int counter);
void openDoor(int nflag, int doorNum);
void showMap();
- void animation_1_1();
- void animation_2_1();
- void animation_1_2();
- void animation_2_2();
- void animation_3_1();
- void animation_4_1();
- void animation_3_2();
- void animation_4_2();
- void animation_5_2();
- void animation_6_2();
- void animation_7_2();
- void animation_8_2();
- void animation_9_2();
- void animation_10_2();
- void animation_11_2();
- void animation_12_2();
- void animation_13_2();
- void animation_14_2();
- void animation_15_2();
- void animation_16_2();
- void animation_17_2();
- void animation_18_2();
- void animation_19_2();
- void animation_20_2();
- void animation_21_2();
- void animation_22_2();
- void animation_23_2();
- void animation_23_joined();
- void animation_23_joined2();
- void animation_24_2();
- void animation_25_2();
- void animation_26_2();
- void animation_27_2();
- void animation_28_2();
- void animation_29_2();
- void animation_30_2();
- void animation_31_2();
- void animation_32_2();
- void animation_33_2();
- void animation_34_2();
- void animation_35_2();
- void animation_36_2();
-
- void update_1_pre();
- void update_2();
- void update_3();
- void update_3_pre();
- void update_4();
- void update_5();
- void update_5_pre();
- void update_6_pre();
- void update_7_pre();
- void update_9_pre();
- void update_12_pre();
- void update_14_pre();
- void update_15();
- void update_16_pre();
- void update_17_pre();
- void update_17();
- void update_18_pre();
- void update_18();
- void update_21_pre();
- void update_22_pre();
- void update_23_pre();
- void update_24_pre();
- void update_26_pre();
- void update_26();
- void update_27();
- void update_27_pre();
- void update_29();
- void update_29_pre();
- void update_30_pre();
- void update_31_pre();
- void update_34_pre();
- void update_35_pre();
- void update_31();
- void update_34();
- void update_35();
- void hare_oscuro();
+ void setDarkPalette();
void withoutVerb();
- bool para_cargar(char[]);
- void carga_escoba(const char *);
+ void enterRoom(int);
void clearRoom();
- void lleva_al_hare(int, int);
+ void gotoObject(int, int);
void moveCursor();
void checkObjects();
- void elige_en_barra();
- bool comprueba1();
- bool comprueba2();
+ void selectVerbFromBar();
+ bool verify1();
+ bool verify2();
Common::KeyCode getScan();
void selectVerb(int);
- void mesa();
- bool saves();
+ void updateVolume(Audio::Mixer::SoundType soundType, int prevVolume);
+ void volumeControls();
+ bool saveLoadScreen();
void print_abc(const char *, int, int);
void delay(int ms);
bool confirmExit();
@@ -413,7 +371,7 @@ public:
void chooseObject(int objeto);
void addObject(int);
int removeObject(int osj);
- void fliplay(const char *filefli, int vel);
+ void playFLI(const char *filefli, int vel);
void fadeFromBlack(int fadeSpeed);
char adjustToVGA(char value);
void color_abc(int cl);
@@ -439,7 +397,7 @@ public:
void talk_baul(int);
void talk(int);
void talk(const char *, const char *);
- void talk_sinc(const char *, const char *, const char *);
+ void talk_sync(const char *, const char *, const char *);
void talk_drunk(int);
void talk_pianist(int);
void talk_wolf(int);
@@ -460,34 +418,30 @@ public:
void updateRoom();
bool loadGame(const char *);
void updateDoor(int);
- void color_hare();
- void funde_hare(int oscuridad);
- void paleta_hare_claro();
- void paleta_hare_oscuro();
- void hare_claro();
+ void setDefaultPalette();
+ void setPaletteBase(int darkness);
+ void assignBrightPalette();
+ void assignDarkPalette();
+ void setBrightPalette();
void updateVisible();
void startWalking();
void updateRefresh();
void updateRefresh_pre();
- void pon_hare();
+ void moveCharacters();
void showMenu();
void clearMenu();
void removeObject();
bool exitRoom(int);
bool pickupObject();
- bool checkFlag(int);
+ bool checkAction(int);
void setCursorTable();
void enterName();
- void para_grabar(char[]);
bool soundIsActive();
- void openSSN(const char *Name, int Pause);
void WaitFrameSSN();
void MixVideo(byte *OldScreen, byte *NewScreen);
void Des_RLE(byte *BufferRLE, byte *MiVideoRLE);
void Des_OFF(byte *BufferOFF, byte *MiVideoOFF, int Lenght);
- void set_dacSSN(byte *dacSSN);
byte *TryInMem();
- void EndSSN();
int playFrameSSN();
byte *AuxBuffOrg;
@@ -508,7 +462,6 @@ public:
int flag_tv;
byte *loadPCX(byte *NamePcc);
- void set_dac(byte *dac);
void WaitForNext(int FPS);
int getTime();
void reduce_hare_chico(int, int, int, int, int, int, int, byte *, byte *);
@@ -516,14 +469,28 @@ public:
void quadrant_2();
void quadrant_3();
void quadrant_4();
- void update_62();
- void update_62_pre();
- void update_63();
void saveGame(char[]);
void increaseFrameNum();
int whichObject();
bool checkMenuFlags();
- bool roomParse(RoomTalkAction*, int);
+ void setupRoomsTable();
+ bool roomParse(int, int);
+ void converse(int);
+ void print_abc_opc(const char *, int, int, int);
+ void response(int);
+ void activatePendulum();
+
+ void MusicFadeout();
+ void playFile(const char *fname);
+
+ char *getLine(char *buf, int len);
+ void getIntFromLine(char *buf, int len, int* result);
+ void getStringFromLine(char *buf, int len, char* result);
+
+ void grr();
+ void updateAnim(int y, int destX, int destY, int width, int height, int count, byte* src, int delayVal = 3);
+ void updateAnim2(int y, int px, int py, int width, int height, int count, byte* src);
+
void room_0();
void room_1(int);
void room_2(int);
@@ -535,6 +502,7 @@ public:
void room_8(int);
void room_9(int);
void room_12(int);
+ bool room_13(int fl);
void room_14(int);
void room_15(int);
void room_16(int);
@@ -553,32 +521,71 @@ public:
void room_34(int);
void room_35(int);
void room_44(int);
+ void room_49(int);
+ void room_53(int);
+ void room_54(int);
+ void room_55(int);
+ bool room_56(int);
+ void room_58(int);
+ void room_59(int);
+ bool room_60(int);
+ void room_61(int);
void room_62(int);
void room_63(int);
- void converse(const char *);
- void print_abc_opc(const char *, int, int, int);
- void response(int);
+ void room_102(int);
- void MusicFadeout();
- void playFile(const char *fname);
-
- char *getLine(char *buf, int len);
- void getIntFromLine(char *buf, int len, int* result);
- void getStringFromLine(char *buf, int len, char* result);
-
- void grr();
- bool room_13(int fl);
- void update_13();
- void update_20();
- void updateAnim(int y, int destX, int destY, int width, int height, int count, byte* src, int delayVal = 3);
- void updateAnim2(int y, int px, int py, int width, int height, int count, byte* src);
+ void animation_1_1();
+ void animation_2_1();
+ void animation_3_1();
+ void animation_4_1();
+ //
+ void animation_1_2();
+ void animation_2_2();
+ void animation_3_2();
+ void animation_4_2();
+ void animation_5_2();
+ void animation_6_2();
+ void animation_7_2();
+ void animation_8_2();
+ void animation_9_2();
+ void animation_10_2();
+ void animation_11_2();
+ void animation_12_2();
+ void animation_13_2();
+ void animation_14_2();
+ void animation_15_2();
+ void animation_16_2();
+ void animation_17_2();
+ void animation_18_2();
+ void animation_19_2();
+ void animation_20_2();
+ void animation_21_2();
+ void animation_22_2();
+ void animation_23_2();
+ void animation_23_joined();
+ void animation_23_joined2();
+ void animation_24_2();
+ void animation_25_2();
+ void animation_26_2();
+ void animation_27_2();
+ void animation_28_2();
+ void animation_29_2();
+ void animation_30_2();
+ void animation_31_2();
+ void animation_32_2();
+ void animation_33_2();
+ void animation_34_2();
+ void animation_35_2();
+ void animation_36_2();
+ //
void animation_1_3();
void animation_2_3();
void animation_3_3();
void animation_4_3();
void animation_5_3();
void animation_6_3();
- void animation_rayo();
+ void animation_ray();
+ //
void animation_1_4();
void animation_2_4();
void animation_3_4();
@@ -588,6 +595,7 @@ public:
void animation_7_4();
void animation_8_4();
void animation_9_4();
+ //
void animation_1_5();
void animation_2_5();
void animation_3_5();
@@ -605,29 +613,7 @@ public:
void animation_15_5();
void animation_16_5();
void animation_17_5();
- void room_49(int);
- void room_53(int);
- void room_54(int);
- void room_55(int);
- bool room_56(int);
- void update_53_pre();
- void update_54_pre();
- void update_49_pre();
- void update_56_pre();
- void update_50();
- void update_57();
- void room_58(int);
- void room_59(int);
- bool room_60(int);
- void room_61(int);
- void room_pendulum(int);
- void update_pendulum();
- void update_58();
- void update_58_pre();
- void update_59_pre();
- void update_60_pre();
- void update_60();
- void update_61();
+ //
void animation_1_6();
void animation_2_6();
void animation_3_6();
@@ -644,7 +630,60 @@ public:
void animation_15_6();
void animation_18_6();
void animation_19_6();
- void activatePendulum();
+
+ void update_1_pre();
+ void update_2();
+ void update_3();
+ void update_3_pre();
+ void update_4();
+ void update_5();
+ void update_5_pre();
+ void update_6_pre();
+ void update_7_pre();
+ void update_9_pre();
+ void update_12_pre();
+ void update_14_pre();
+ void update_13();
+ void update_15();
+ void update_16_pre();
+ void update_17_pre();
+ void update_17();
+ void update_18_pre();
+ void update_18();
+ void update_20();
+ void update_21_pre();
+ void update_22_pre();
+ void update_23_pre();
+ void update_24_pre();
+ void update_26_pre();
+ void update_26();
+ void update_27();
+ void update_27_pre();
+ void update_29();
+ void update_29_pre();
+ void update_30_pre();
+ void update_31_pre();
+ void update_34_pre();
+ void update_35_pre();
+ void update_31();
+ void update_34();
+ void update_35();
+ void update_49_pre();
+ void update_53_pre();
+ void update_54_pre();
+ void update_56_pre();
+ void update_50();
+ void update_57();
+ void update_58();
+ void update_58_pre();
+ void update_59_pre();
+ void update_60_pre();
+ void update_60();
+ void update_61();
+ void update_62();
+ void update_62_pre();
+ void update_63();
+ void update_102();
private:
int _lang;
@@ -669,7 +708,7 @@ extern const char *_textd1[][11];
extern const ItemLocation itemLocations[];
extern int frame_x[20];
extern const int x_pol[44], y_pol[44];
-extern const int x_barra[];
+extern const int verbBarX[];
extern const int x1d_menu[], y1d_menu[];
extern const CharInfo charMap[];
diff --git a/engines/drascula/rooms.cpp b/engines/drascula/rooms.cpp
index d5b4c0b82e..62d8c557fe 100644
--- a/engines/drascula/rooms.cpp
+++ b/engines/drascula/rooms.cpp
@@ -23,65 +23,186 @@
*
*/
+#include "common/array.h"
+
#include "drascula/drascula.h"
#include "drascula/staticdata.h"
namespace Drascula {
-bool DrasculaEngine::roomParse(RoomTalkAction* roomActions, int fl) {
- bool didAction = false;
+typedef void (DrasculaEngine::*RoomParser)(int args);
+
+struct DrasculaRoomParser {
+ DrasculaRoomParser(const char* d, RoomParser p) : desc(d), proc(p) {}
+ const char* desc;
+ RoomParser proc;
+};
+
+typedef void (DrasculaEngine::*Updater)();
+
+struct DrasculaUpdater {
+ DrasculaUpdater(const char* d, Updater p) : desc(d), proc(p) {}
+ const char* desc;
+ Updater proc;
+};
+
+Common::Array<DrasculaRoomParser*> _roomParsers;
+Common::Array<DrasculaUpdater*> _roomPreupdaters;
+Common::Array<DrasculaUpdater*> _roomUpdaters;
+
+#define ROOM(x) _roomParsers.push_back(new DrasculaRoomParser(#x, &DrasculaEngine::x))
+#define PREUPDATEROOM(x) _roomPreupdaters.push_back(new DrasculaUpdater(#x, &DrasculaEngine::x))
+#define UPDATEROOM(x) _roomUpdaters.push_back(new DrasculaUpdater(#x, &DrasculaEngine::x))
+
+void DrasculaEngine::setupRoomsTable() {
+ //ROOM(room_0); // default
+ ROOM(room_1);
+ ROOM(room_3);
+ ROOM(room_4);
+ ROOM(room_5);
+ ROOM(room_6);
+ ROOM(room_7);
+ ROOM(room_8);
+ ROOM(room_9);
+ ROOM(room_12);
+ //ROOM(room_13); // returns bool
+ ROOM(room_14);
+ ROOM(room_15);
+ ROOM(room_16);
+ ROOM(room_17);
+ ROOM(room_18);
+ ROOM(room_19);
+ //ROOM(room_21); // returns bool
+ ROOM(room_22);
+ ROOM(room_23);
+ ROOM(room_24);
+ ROOM(room_26);
+ ROOM(room_27);
+ ROOM(room_29);
+ ROOM(room_30);
+ ROOM(room_31);
+ ROOM(room_34);
+ ROOM(room_35);
+ ROOM(room_44);
+ ROOM(room_49);
+ ROOM(room_53);
+ ROOM(room_54);
+ ROOM(room_55);
+ //ROOM(room_56); // returns bool
+ ROOM(room_58);
+ ROOM(room_59);
+ //ROOM(room_60); // returns bool
+ ROOM(room_61);
+ ROOM(room_62);
+ ROOM(room_63);
+ ROOM(room_102);
+
+ PREUPDATEROOM(update_1_pre);
+ PREUPDATEROOM(update_3_pre);
+ PREUPDATEROOM(update_5_pre);
+ PREUPDATEROOM(update_6_pre);
+ PREUPDATEROOM(update_7_pre);
+ PREUPDATEROOM(update_9_pre);
+ PREUPDATEROOM(update_12_pre);
+ PREUPDATEROOM(update_14_pre);
+ PREUPDATEROOM(update_16_pre);
+ PREUPDATEROOM(update_17_pre);
+ PREUPDATEROOM(update_18_pre);
+ PREUPDATEROOM(update_21_pre);
+ PREUPDATEROOM(update_22_pre);
+ PREUPDATEROOM(update_23_pre);
+ PREUPDATEROOM(update_24_pre);
+ PREUPDATEROOM(update_26_pre);
+ PREUPDATEROOM(update_27_pre);
+ PREUPDATEROOM(update_29_pre);
+ PREUPDATEROOM(update_30_pre);
+ PREUPDATEROOM(update_31_pre);
+ PREUPDATEROOM(update_34_pre);
+ PREUPDATEROOM(update_35_pre);
+ PREUPDATEROOM(update_49_pre);
+ PREUPDATEROOM(update_53_pre);
+ PREUPDATEROOM(update_54_pre);
+ PREUPDATEROOM(update_56_pre);
+ PREUPDATEROOM(update_58_pre);
+ PREUPDATEROOM(update_59_pre);
+ PREUPDATEROOM(update_60_pre);
+ PREUPDATEROOM(update_62_pre);
+
+ UPDATEROOM(update_2);
+ UPDATEROOM(update_3);
+ UPDATEROOM(update_4);
+ UPDATEROOM(update_5);
+ UPDATEROOM(update_13);
+ UPDATEROOM(update_15);
+ UPDATEROOM(update_17);
+ UPDATEROOM(update_18);
+ UPDATEROOM(update_20);
+ UPDATEROOM(update_26);
+ UPDATEROOM(update_27);
+ UPDATEROOM(update_29);
+ UPDATEROOM(update_31);
+ UPDATEROOM(update_34);
+ UPDATEROOM(update_35);
+ UPDATEROOM(update_50);
+ UPDATEROOM(update_57);
+ UPDATEROOM(update_58);
+ UPDATEROOM(update_60);
+ UPDATEROOM(update_61);
+ UPDATEROOM(update_62);
+ UPDATEROOM(update_63);
+ UPDATEROOM(update_102);
+}
+
+bool DrasculaEngine::roomParse(int room, int fl) {
+ bool seen = false;
for (int i = 0; i < ARRAYSIZE(roomActions); i++) {
- if (roomActions[i].num == currentChapter ||
- roomActions[i].num == -1) {
- if (roomActions[i].action == pickedObject ||
- roomActions[i].action == kVerbDefault) {
- if (roomActions[i].objectID == fl ||
- roomActions[i].objectID == -1) {
- talk(roomActions[i].speechID);
- didAction = true;
- break;
+ if (roomActions[i].room == room) {
+ seen = true;
+ if (roomActions[i].chapter == currentChapter ||
+ roomActions[i].chapter == -1) {
+ if (roomActions[i].action == pickedObject ||
+ roomActions[i].action == kVerbDefault) {
+ if (roomActions[i].objectID == fl ||
+ roomActions[i].objectID == -1) {
+ talk(roomActions[i].speechID);
+ hasAnswer = 1;
+ return true;
+ }
}
}
- }
+ } else if (seen) // Stop searching down the list
+ break;
}
- return didAction;
+ return false;
}
void DrasculaEngine::room_0() {
- static const int mirar_t[3] = {100, 101, 54};
- static const int poder_t[6] = {11, 109, 111, 110, 115, 116};
+ static const int lookExcuses[3] = {100, 101, 54};
+ static const int actionExcuses[6] = {11, 109, 111, 110, 115, 116};
- if (roomParse(room0Actions, -1))
- return;
+ if (roomParse(0, -1))
+ return;
// non-default actions
if (currentChapter == 2 || currentChapter == 4 ||
currentChapter == 5 || currentChapter == 6) {
if (pickedObject == kVerbLook) {
- talk(mirar_t[c_mirar]);
- c_mirar++;
- if (c_mirar == 3)
- c_mirar = 0;
- } else if (pickedObject == kVerbPick) {
- talk(poder_t[c_poder]);
- c_poder++;
- if (c_poder == 6)
- c_poder = 0;
+ talk(lookExcuses[curExcuseLook]);
+ curExcuseLook++;
+ if (curExcuseLook == 3)
+ curExcuseLook = 0;
} else {
- talk(poder_t[c_poder]);
- c_poder++;
- if (c_poder == 6)
- c_poder = 0;
+ talk(actionExcuses[curExcuseAction]);
+ curExcuseAction++;
+ if (curExcuseAction == 6)
+ curExcuseAction = 0;
}
}
}
void DrasculaEngine::room_1(int fl) {
- if (roomParse(room1Actions, fl))
- return;
-
if (pickedObject == kVerbLook && fl == 118) {
talk(1);
pause(10);
@@ -93,15 +214,12 @@ void DrasculaEngine::room_1(int fl) {
}
void DrasculaEngine::room_3(int fl) {
- if (roomParse(room3Actions, fl))
- return;
-
if (pickedObject == kVerbTalk && fl == 129) {
talk(23);
pause(6);
- talk_sinc(_text[_lang][50], "50.als", "11111111111144432554433");
+ talk_sync(_text[_lang][50], "50.als", "11111111111144432554433");
} else if (pickedObject == kVerbTalk && fl == 133) {
- talk_sinc(_text[_lang][322], "322.als", "13333334125433333333");
+ talk_sync(_text[_lang][322], "322.als", "13333334125433333333");
updateRoom();
updateScreen();
pause(25);
@@ -112,7 +230,7 @@ void DrasculaEngine::room_3(int fl) {
} else if (pickedObject == kVerbPick && fl == 165) {
copyBackground(0, 0, 0,0, 320, 200, drawSurface1, screenSurface);
updateRefresh_pre();
- copyRect(44, 1, hare_x, hare_y, 41, 70, drawSurface2, screenSurface);
+ copyRect(44, 1, curX, curY, 41, 70, drawSurface2, screenSurface);
updateRefresh();
updateScreen();
pause(4);
@@ -132,9 +250,6 @@ void DrasculaEngine::room_3(int fl) {
}
void DrasculaEngine::room_4(int fl) {
- if (roomParse(room4Actions, fl))
- return;
-
if (pickedObject == kVerbMove && fl == 189 && flags[34] == 0) {
talk(327);
pickObject(13);
@@ -146,22 +261,16 @@ void DrasculaEngine::room_4(int fl) {
}
void DrasculaEngine::room_5(int fl) {
- if (roomParse(room5Actions, fl))
- return;
-
if (pickedObject == kVerbLook && fl == 136 && flags[8] == 0)
talk(14);
else if (pickedObject == 10 && fl == 136) {
animation_5_2();
- removeObject(10);
+ removeObject(kItemSpike);
} else
hasAnswer = 0;
}
void DrasculaEngine::room_6(int fl){
- if (roomParse(room6Actions, fl))
- return;
-
if (pickedObject == kVerbLook && fl==144) {
talk(41);
talk(42);
@@ -172,7 +281,7 @@ void DrasculaEngine::room_6(int fl){
else if (pickedObject == kVerbOpen && fl == 143 && flags[2] == 0) {
copyBackground(0, 0, 0, 0, 320, 200, drawSurface1, screenSurface);
updateRefresh_pre();
- copyRect(228, 102, hare_x + 5, hare_y - 1, 47, 73, drawSurface3, screenSurface);
+ copyRect(228, 102, curX + 5, curY - 1, 47, 73, drawSurface3, screenSurface);
updateScreen();
pause(10);
playSound(3);
@@ -184,7 +293,7 @@ void DrasculaEngine::room_6(int fl){
copyBackground(0, 0, 0, 0, 320, 200, drawSurface1, screenSurface);
flags[2] = 0;
updateRefresh_pre();
- copyRect(228, 102, hare_x + 5, hare_y - 1, 47, 73, drawSurface3, screenSurface);
+ copyRect(228, 102, curX + 5, curY - 1, 47, 73, drawSurface3, screenSurface);
updateScreen();
pause(5);
playSound(4);
@@ -194,7 +303,7 @@ void DrasculaEngine::room_6(int fl){
} else if (pickedObject == kVerbOpen && fl == 139 && flags[1] == 0) {
copyBackground(0, 0, 0, 0, 320, 200, drawSurface1, screenSurface);
updateRefresh_pre();
- copyRect(267, 1, hare_x - 14, hare_y - 2, 52, 73, drawSurface3, screenSurface);
+ copyRect(267, 1, curX - 14, curY - 2, 52, 73, drawSurface3, screenSurface);
updateScreen();
pause(19);
playSound(3);
@@ -207,7 +316,7 @@ void DrasculaEngine::room_6(int fl){
} else if (pickedObject == kVerbPick && fl == 140) {
copyBackground(0, 0, 0, 0, 320, 200, drawSurface1, screenSurface);
updateRefresh_pre();
- copyRect(267, 1, hare_x - 14, hare_y - 2, 52, 73, drawSurface3, screenSurface);
+ copyRect(267, 1, curX - 14, curY - 2, 52, 73, drawSurface3, screenSurface);
updateScreen();
pause(19);
pickObject(9);
@@ -220,11 +329,7 @@ void DrasculaEngine::room_6(int fl){
}
void DrasculaEngine::room_7(int fl){
- if (pickedObject == kVerbLook && fl == 169)
- talk(44);
- else if (pickedObject == kVerbLook && fl == 164)
- talk(35);
- else if (pickedObject == kVerbPick && fl == 190) {
+ if (pickedObject == kVerbPick && fl == 190) {
pickObject(17);
flags[35] = 1;
visible[3] = 0;
@@ -235,41 +340,34 @@ void DrasculaEngine::room_7(int fl){
}
void DrasculaEngine::room_8(int fl) {
- if (pickedObject == kVerbLook && fl == 147 && flags[7] == 0) {
- talk(58);
- pickObject(15);
- flags[7] = 1;
- if (flags[7] == 1 && flags[26] == 1 && flags[34] == 1 && flags[35] == 1 && flags[37] == 1)
- flags[38] = 1;
- } else if (pickedObject == kVerbLook && fl == 147)
- talk(59);
- else
+ if (pickedObject == kVerbLook && fl == 147) {
+ if (flags[7] == 0) {
+ talk(58);
+ pickObject(15);
+ flags[7] = 1;
+ if (flags[7] == 1 && flags[26] == 1 && flags[34] == 1 && flags[35] == 1 && flags[37] == 1)
+ flags[38] = 1;
+ } else {
+ talk(59);
+ }
+ } else
hasAnswer = 0;
}
void DrasculaEngine::room_9(int fl){
- if (pickedObject == kVerbLook && fl == 150)
- talk(35);
- else if (pickedObject == kVerbTalk && fl == 150)
- talk(6);
- else if (pickedObject == kVerbLook && fl == 51)
- talk(60);
- else if (pickedObject == kVerbTalk && fl == 51 && flags[4] == 0)
+ if (pickedObject == kVerbTalk && fl == 51 && flags[4] == 0)
animation_4_2();
else if (pickedObject == kVerbTalk && fl == 51 && flags[4] == 1)
animation_33_2();
else if (pickedObject == 7 && fl == 51) {
animation_6_2();
- removeObject(7);
+ removeObject(kItemMoney);
pickObject(14);}
else
hasAnswer = 0;
}
void DrasculaEngine::room_12(int fl){
- if (roomParse(room12Actions, fl))
- return;
-
if (pickedObject == kVerbOpen && fl == 156)
openDoor(16, 4);
else if (pickedObject == kVerbClose && fl == 156)
@@ -281,11 +379,11 @@ void DrasculaEngine::room_12(int fl){
bool DrasculaEngine::room_13(int fl) {
if (pickedObject == kVerbLook && fl == 51) {
talk(411);
- sentido_hare = 3;
+ trackProtagonist = 3;
talk(412);
strcpy(objName[1], "yoda");
} else if (pickedObject == kVerbTalk && fl == 51)
- converse("op_7.cal");
+ converse(7);
else if (pickedObject == 19 && fl == 51)
animation_1_3();
else if (pickedObject == 9 && fl == 51) {
@@ -297,9 +395,6 @@ bool DrasculaEngine::room_13(int fl) {
}
void DrasculaEngine::room_14(int fl) {
- if (roomParse(room14Actions, fl))
- return;
-
if (pickedObject == kVerbTalk && fl == 54 && flags[39] == 0)
animation_12_2();
else if (pickedObject == kVerbTalk && fl == 54 && flags[39] == 1)
@@ -317,28 +412,24 @@ void DrasculaEngine::room_14(int fl) {
}
void DrasculaEngine::room_15(int fl) {
- if (pickedObject == kVerbTalk && fl == 188)
- talk(333);
- else if (pickedObject == kVerbLook && fl == 188)
- talk(334);
- else if (pickedObject == 19 && fl == 188 && flags[27] == 0)
+ if (pickedObject == 19 && fl == 188 && flags[27] == 0)
talk(335);
else if (pickedObject == 19 && fl == 188 && flags[27] == 1) {
talk(336);
- sentido_hare = 3;
+ trackProtagonist = 3;
talk(337);
- talk_sinc(_text[_lang][46], "46.als", "4442444244244");
- sentido_hare = 1;
+ talk_sync(_text[_lang][46], "46.als", "4442444244244");
+ trackProtagonist = 1;
} else if (pickedObject == 18 && fl == 188 && flags[26] == 0) {
copyBackground(0, 0, 0, 0, 320, 200, drawSurface1, screenSurface);
- copyRect(133, 135, hare_x + 6, hare_y, 39, 63, drawSurface3, screenSurface);
+ copyRect(133, 135, curX + 6, curY, 39, 63, drawSurface3, screenSurface);
updateScreen();
playSound(8);
finishSound();
talk(338);
flags[27] = 0;
pickObject(19);
- removeObject(18);
+ removeObject(kItemTwoCoins);
} else if (pickedObject == kVerbMove && fl == 188 && flags[27] == 0) {
animation_34_2();
talk(339);
@@ -347,38 +438,26 @@ void DrasculaEngine::room_15(int fl) {
flags[27] = 1;
if (flags[7] == 1 && flags[26] == 1 && flags[34] == 1 && flags[35] == 1 && flags[37] == 1)
flags[38] = 1;
- } else if (pickedObject == kVerbLook && fl == 205)
- talk(172);
- else if (pickedObject == kVerbLook && fl == 206)
- talk(173);
- else if (pickedObject == kVerbMove && fl == 206)
- talk(174);
- else if (pickedObject == kVerbOpen && fl == 206)
- talk(174);
- else
+ } else
hasAnswer = 0;
}
void DrasculaEngine::room_16(int fl) {
- if (pickedObject == kVerbTalk && fl == 163)
- talk(6);
- else if (pickedObject == kVerbOpen && fl == 163)
+ if (pickedObject == kVerbOpen && fl == 163)
openDoor(17, 0);
else if (pickedObject == kVerbClose && fl == 163)
closeDoor(17, 0);
- else if (pickedObject == kVerbLook && fl == 183)
- talk(340);
else if (pickedObject == kVerbTalk && fl == 183) {
talk(341);
pause(10);
- talk_sinc(_text[_lang][50], "50.als", "11111111111144432554433");
+ talk_sync(_text[_lang][50], "50.als", "11111111111144432554433");
pause(3);
talk_baul(83);
} else if (pickedObject == kVerbOpen && fl == 183) {
openDoor(19, NO_DOOR);
if (flags[20] == 0) {
flags[20] = 1;
- sentido_hare = 3;
+ trackProtagonist = 3;
updateRoom();
updateScreen();
talk(342);
@@ -386,23 +465,13 @@ void DrasculaEngine::room_16(int fl) {
}
} else if (pickedObject == kVerbClose && fl == 183)
closeDoor(19, NO_DOOR);
- else if (pickedObject == kVerbLook && fl == 185)
- talk(37);
- else if (pickedObject == kVerbPick && fl == 185)
- talk(7);
- else if (pickedObject == kVerbMove && fl == 185)
- talk(7);
- else if (pickedObject == kVerbTalk && fl == 185)
- talk(38);
else if (pickedObject == kVerbLook && fl == 187) {
talk(343);
- sentido_hare = 3;
+ trackProtagonist = 3;
updateRoom();
updateScreen();
talk(344);
- } else if (pickedObject == kVerbTalk && fl == 187)
- talk(345);
- else
+ } else
hasAnswer = 0;
}
@@ -425,7 +494,7 @@ void DrasculaEngine::room_17(int fl) {
talk(347);
flags[29] = 1;
pickObject(23);
- removeObject(11);
+ removeObject(kItemEarplugs);
} else
hasAnswer = 0;
}
@@ -435,20 +504,16 @@ void DrasculaEngine::room_18(int fl) {
animation_24_2();
else if (pickedObject == kVerbTalk && fl == 55 && flags[36] == 1)
talk(109);
- else if (pickedObject == kVerbLook && fl == 181)
- talk(348);
else if (pickedObject == kVerbPick && fl == 182) {
copyBackground(0, 0, 0, 0, 320, 200, drawSurface1, screenSurface);
updateRefresh_pre();
- copyRect(44, 1, hare_x, hare_y, 41, 70, drawSurface2, screenSurface);
+ copyRect(44, 1, curX, curY, 41, 70, drawSurface2, screenSurface);
updateRefresh();
updateScreen();
pause(4);
pickObject(12);
visible[2] = 0;
flags[28] = 1;
- } else if (pickedObject == kVerbLook && fl == 182) {
- talk(154);
} else if (fl == 55 && flags[38] == 0 && flags[33] == 0) {
if (pickedObject == 8 || pickedObject == 13 || pickedObject == 15 ||
pickedObject == 16 || pickedObject == 17)
@@ -459,28 +524,25 @@ void DrasculaEngine::room_18(int fl) {
animation_24_2();
}
else if (pickedObject == 11 && fl == 50 && flags[22] == 0) {
- sentido_hare = 3;
+ trackProtagonist = 3;
updateRoom();
updateScreen();
copyBackground(0, 0, 0, 0, 320, 200, drawSurface1, screenSurface);
updateRefresh_pre();
- copyRect(1, 1, hare_x - 1, hare_y + 3, 42, 67, drawSurface2, screenSurface);
+ copyRect(1, 1, curX - 1, curY + 3, 42, 67, drawSurface2, screenSurface);
updateRefresh();
updateScreen();
pause(6);
talk(347);
flags[29] = 1;
pickObject(23);
- removeObject(11);
+ removeObject(kItemEarplugs);
} else
hasAnswer = 0;
}
void DrasculaEngine::room_19(int fl) {
- if (pickedObject == kVerbLook && fl == 214)
- talk(191);
- else
- hasAnswer = 0;
+ hasAnswer = 0;
}
bool DrasculaEngine::room_21(int fl) {
@@ -508,9 +570,7 @@ bool DrasculaEngine::room_21(int fl) {
}
void DrasculaEngine::room_22(int fl) {
- if (pickedObject == kVerbPick && fl == 140)
- talk(7);
- else if (pickedObject == 11 && fl == 140) {
+ if (pickedObject == 11 && fl == 140) {
pickObject(18);
visible[1] = 0;
flags[24] = 1;
@@ -523,14 +583,10 @@ void DrasculaEngine::room_22(int fl) {
withoutVerb();
removeObject(22);
updateVisible();
- sentido_hare = 3;
+ trackProtagonist = 3;
talk(499);
talk(500);
- } else if (pickedObject == kVerbLook && fl == 52)
- talk(497);
- else if (pickedObject == kVerbTalk && fl == 52)
- talk(498);
- else if (pickedObject == kVerbPick && fl == 180 && flags[26] == 0)
+ } else if (pickedObject == kVerbPick && fl == 180 && flags[26] == 0)
talk(420);
else if (pickedObject == kVerbPick && fl == 180 && flags[26] == 1) {
pickObject(7);
@@ -572,8 +628,6 @@ void DrasculaEngine::room_24(int fl) {
openDoor(2, 1);
else if (pickedObject == kVerbClose && fl == 106)
closeDoor(2, 1);
- else if (pickedObject == kVerbLook && fl == 151)
- talk(461);
else
hasAnswer = 0;
}
@@ -594,41 +648,25 @@ void DrasculaEngine::room_26(int fl) {
else if (pickedObject == 16 && fl == 50 && flags[18] == 1 && flags[12] == 1)
animation_5_4();
else if (pickedObject == kVerbPick && fl == 143 && flags[18] == 1) {
- lleva_al_hare(260, 180);
+ gotoObject(260, 180);
pickObject(10);
visible[1] = 0;
flags[12] = 1;
closeDoor(2, 0);
- sentido_hare = 2;
+ trackProtagonist = 2;
talk_igor(27, kIgorDoor);
flags[30] = 1;
talk_igor(28, kIgorDoor);
- lleva_al_hare(153, 180);
+ gotoObject(153, 180);
} else if (pickedObject == kVerbPick && fl == 143 && flags[18] == 0) {
- lleva_al_hare(260, 180);
+ gotoObject(260, 180);
copyBackground(80, 78, 199, 94, 38, 27, drawSurface3, screenSurface);
updateScreen(199, 94, 199, 94, 38, 27, screenSurface);
pause(3);
talk_igor(25, kIgorWig);
- lleva_al_hare(153, 180);
+ gotoObject(153, 180);
} else if (pickedObject == kVerbTalk && fl == 51)
animation_1_4();
- else if (pickedObject == kVerbOpen && fl == 167)
- talk(467);
- else if (pickedObject == kVerbLook && fl == 164)
- talk(470);
- else if (pickedObject == kVerbOpen && fl == 164)
- talk(471);
- else if (pickedObject == kVerbLook && fl == 163)
- talk(472);
- else if (pickedObject == kVerbPick && fl == 163)
- talk(473);
- else if (pickedObject == kVerbLook && fl == 165)
- talk(474);
- else if (pickedObject == kVerbLook && fl == 168)
- talk(476);
- else if (pickedObject == kVerbPick && fl == 168)
- talk(477);
else
hasAnswer = 0;
}
@@ -659,16 +697,6 @@ void DrasculaEngine::room_29(int fl) {
openDoor(4, 1);
else if (pickedObject == kVerbClose && fl == 114)
closeDoor(4, 1);
- else if (pickedObject == kVerbLook && fl == 152)
- talk(463);
- else if (pickedObject == kVerbOpen && fl == 152)
- talk(464);
- else if (pickedObject == kVerbLook && fl == 153)
- talk(465);
- else if (pickedObject == kVerbPick && fl == 154)
- talk(466);
- else if (pickedObject == kVerbOpen && fl == 156)
- talk(467);
else
hasAnswer = 0;
}
@@ -696,11 +724,7 @@ void DrasculaEngine::room_30(int fl) {
else if (pickedObject == 13 && fl == 144) {
talk(424);
flags[19] = 1;
- } else if (pickedObject == kVerbOpen && fl == 157)
- talk(468);
- else if (pickedObject == kVerbLook && fl == 158)
- talk(469);
- else
+ } else
hasAnswer = 0;
}
@@ -713,10 +737,6 @@ void DrasculaEngine::room_31(int fl) {
openDoor(5, 0);
else if (pickedObject == kVerbClose && fl == 117)
closeDoor(5, 0);
- else if (pickedObject == kVerbLook && fl == 161)
- talk(470);
- else if (pickedObject == kVerbOpen && fl == 161)
- talk(471);
else
hasAnswer = 0;
}
@@ -724,15 +744,11 @@ void DrasculaEngine::room_31(int fl) {
void DrasculaEngine::room_34(int fl) {
if (pickedObject == kVerbMove && fl == 146)
animation_8_4();
- else if (pickedObject == kVerbLook && fl == 146)
- talk(458);
- else if (pickedObject == kVerbPick && fl == 146)
- talk(459);
else if (pickedObject == kVerbOpen && fl == 120 && flags[25] == 1)
openDoor(8, 2);
else if (pickedObject == kVerbOpen && fl == 120 && flags[25] == 0) {
openDoor(8, 2);
- sentido_hare = 3;
+ trackProtagonist = 3;
talk(425);
pickObject(14);
flags[25] = 1;
@@ -767,27 +783,14 @@ void DrasculaEngine::room_35(int fl) {
}
void DrasculaEngine::room_44(int fl) {
- if (pickedObject == kVerbLook && fl == 172)
- talk(428);
- else
- hasAnswer = 0;
+ hasAnswer = 0;
}
void DrasculaEngine::room_49(int fl){
if (pickedObject == kVerbTalk && fl ==51)
- converse("op_9.cal");
- else if (pickedObject == kVerbLook && fl == 51)
- talk(132);
+ converse(9);
else if ((pickedObject == 8 && fl == 51) || (pickedObject == 8 && fl == 203))
animation_5_5();
- else if (pickedObject == kVerbLook && fl == 200)
- talk(133);
- else if (pickedObject == kVerbTalk && fl == 200)
- talk(134);
- else if (pickedObject == kVerbLook && fl == 201)
- talk(135);
- else if (pickedObject == kVerbLook && fl == 203)
- talk(137);
else
hasAnswer = 0;
}
@@ -796,16 +799,8 @@ void DrasculaEngine::room_53(int fl) {
if (pickedObject == kVerbPick && fl == 120) {
pickObject(16);
visible[3] = 0;
- } else if (pickedObject == kVerbLook && fl == 121)
- talk(128);
- else if (pickedObject == kVerbLook && fl == 209)
- talk(129);
- else if (pickedObject == kVerbMove && fl == 123)
+ } else if (pickedObject == kVerbMove && fl == 123)
animation_11_5();
- else if (pickedObject == kVerbLook && fl == 52)
- talk(447);
- else if (pickedObject == kVerbTalk && fl == 52)
- talk(131);
else if (pickedObject == 12 && fl == 52)
animation_10_5();
else if (pickedObject == 15 && fl == 52)
@@ -827,8 +822,6 @@ void DrasculaEngine::room_54(int fl) {
animation_1_5();
else if (pickedObject == kVerbLook && fl == 118 && flags[0]==1)
talk(124);
- else if (pickedObject == kVerbLook && fl == 53)
- talk(127);
else if (pickedObject == kVerbTalk && fl == 53 && flags[14] == 0) {
talk(288);
flags[12] = 1;
@@ -837,7 +830,7 @@ void DrasculaEngine::room_54(int fl) {
talk(289);
talk_mus(2);
talk_mus(3);
- converse("op_10.cal");
+ converse(10);
flags[12] = 0;
flags[14] = 1;
} else if (pickedObject == kVerbTalk && fl == 53 && flags[14] == 1)
@@ -847,11 +840,7 @@ void DrasculaEngine::room_54(int fl) {
flags[13] = 1;
talk_mus(10);
updateVisible();
- } else if (pickedObject == kVerbOpen && fl == 119)
- talk(125);
- else if (pickedObject == kVerbLook && fl == 119)
- talk(126);
- else if (pickedObject == 10 && fl == 119) {
+ } else if (pickedObject == 10 && fl == 119) {
pause(4);
talk(436);
withoutVerb();
@@ -865,32 +854,23 @@ void DrasculaEngine::room_55(int fl) {
pickObject(12);
flags[8] = 1;
updateVisible();
- } else if (pickedObject == kVerbLook && fl == 122)
- talk(138);
- else if (pickedObject == kVerbLook && fl == 204)
- talk(139);
- else if (pickedObject == kVerbLook && fl == 205)
- talk(140);
- else if (fl == 206) {
+ } else if (fl == 206) {
playSound(11);
animate("det.bin", 17);
finishSound();
- lleva_al_hare(hare_x - 3, hare_y + alto_hare + 6);
+ gotoObject(curX - 3, curY + curHeight + 6);
} else
hasAnswer = 0;
}
bool DrasculaEngine::room_56(int fl) {
+ if (roomParse(56, fl))
+ return false;
+
if (pickedObject == kVerbOpen && fl == 124) {
animation_14_5();
return true;
- } else if (pickedObject == kVerbLook && fl == 124)
- talk(450);
- else if (pickedObject == kVerbOpen && fl == 207)
- talk(141);
- else if (pickedObject == kVerbLook && fl == 208)
- talk(142);
- else
+ } else
hasAnswer = 0;
return false;
@@ -899,8 +879,6 @@ bool DrasculaEngine::room_56(int fl) {
void DrasculaEngine::room_58(int fl) {
if (pickedObject == kVerbMove && fl == 103)
animation_7_6();
- else if (pickedObject == kVerbLook && fl == 104)
- talk(454);
else
hasAnswer = 0;
}
@@ -922,8 +900,8 @@ void DrasculaEngine::room_59(int fl) {
delay(40);
finishSound();
delay(10);
- lleva_al_hare(174, 168);
- sentido_hare = 2;
+ gotoObject(174, 168);
+ trackProtagonist = 2;
updateRoom();
updateScreen();
pause(40);
@@ -932,15 +910,15 @@ void DrasculaEngine::room_59(int fl) {
stopSound();
hare_se_ve = 0;
updateRoom();
- copyRect(101, 34, hare_x - 4, hare_y - 1, 37, 70, drawSurface3, screenSurface);
+ copyRect(101, 34, curX - 4, curY - 1, 37, 70, drawSurface3, screenSurface);
copyBackground(0, 0, 0, 0, 320, 200, screenSurface, drawSurface1);
updateScreen();
hare_se_ve = 1;
clearRoom();
loadPic("tlef0.alg", drawSurface1, COMPLETE_PAL);
- loadPic("tlef1.alg", drawSurface3, 1);
- loadPic("tlef2.alg", frontSurface, 1);
- loadPic("tlef3.alg", backSurface, 1);
+ loadPic("tlef1.alg", drawSurface3);
+ loadPic("tlef2.alg", frontSurface);
+ loadPic("tlef3.alg", backSurface);
talk_htel(240);
color_abc(kColorBrown);
@@ -958,11 +936,11 @@ void DrasculaEngine::room_59(int fl) {
color_abc(kColorBrown);
talk_solo(_textvb[_lang][62], "VB62.als");
clearRoom();
- loadPic("aux59.alg", drawSurface3, 1);
- loadPic("96.alg", frontSurface, COMPLETE_PAL);
- loadPic("99.alg", backSurface, 1);
- loadPic("59.alg", drawSurface1, HALF_PAL);
- sentido_hare = 3;
+ loadPic("aux59.alg", drawSurface3);
+ loadPic(96, frontSurface, COMPLETE_PAL);
+ loadPic(99, backSurface);
+ loadPic(59, drawSurface1, HALF_PAL);
+ trackProtagonist = 3;
talk(245);
withoutVerb();
flags[11] = 1;
@@ -972,31 +950,18 @@ void DrasculaEngine::room_59(int fl) {
}
bool DrasculaEngine::room_60(int fl) {
+ if (roomParse(60, fl))
+ return false;
+
if (pickedObject == kVerbMove && fl == 112)
animation_10_6();
- else if (pickedObject == kVerbLook && fl == 112)
- talk(440);
else if (pickedObject == kVerbTalk && fl == 52) {
talk(266);
talk_bartender(1, 1);
- converse("op_12.cal");
+ converse(12);
withoutVerb();
pickedObject = 0;
- } else if (pickedObject == kVerbTalk && fl == 115)
- talk(455);
- else if (pickedObject == kVerbTalk && fl == 56)
- talk(455);
- else if (pickedObject == kVerbLook && fl == 114)
- talk(167);
- else if (pickedObject == kVerbLook && fl == 113)
- talk(168);
- else if (pickedObject == kVerbPick && fl == 113)
- talk(170);
- else if (pickedObject == kVerbMove && fl == 113)
- talk(170);
- else if (pickedObject == kVerbTalk && fl == 113)
- talk(169);
- else if (pickedObject == 21 && fl == 56)
+ } else if (pickedObject == 21 && fl == 56)
animation_18_6();
else if (pickedObject == 9 && fl == 56 && flags[6] == 1) {
animation_9_6();
@@ -1011,63 +976,28 @@ bool DrasculaEngine::room_60(int fl) {
}
void DrasculaEngine::room_61(int fl) {
- if (pickedObject == kVerbLook && fl == 116)
- talk(172);
- else if (pickedObject == kVerbLook && fl == 117)
- talk(173);
- else if (pickedObject == kVerbMove && fl == 117)
- talk(174);
- else if (pickedObject == kVerbOpen && fl == 117)
- talk(174);
- else
- hasAnswer = 0;
+ hasAnswer = 0;
}
void DrasculaEngine::room_62(int fl) {
if (pickedObject == kVerbTalk && fl == 53)
- converse("op_13.cal");
+ converse(13);
else if (pickedObject == kVerbTalk && fl == 52 && flags[0] == 0)
animation_3_1();
else if (pickedObject == kVerbTalk && fl == 52 && flags[0] == 1)
talk(109);
else if (pickedObject == kVerbTalk && fl == 54)
animation_4_1();
- else if (pickedObject == kVerbLook && fl == 100)
- talk(168);
- else if (pickedObject == kVerbTalk && fl == 100)
- talk(169);
- else if (pickedObject == kVerbPick && fl == 100)
- talk(170);
- else if (pickedObject == kVerbLook && fl == 101)
- talk(171);
- else if (pickedObject == kVerbLook && fl == 102)
- talk(167);
- else if (pickedObject == kVerbLook && fl == 103)
- talk(166);
- else hasAnswer = 0;
+ else
+ hasAnswer = 0;
}
void DrasculaEngine::room_63(int fl) {
- if (pickedObject == kVerbLook && fl == 110)
- talk(172);
- else if (pickedObject == kVerbLook && fl == 109)
- talk(173);
- else if (pickedObject == kVerbMove && fl == 109)
- talk(174);
- else if (pickedObject == kVerbLook && fl == 108)
- talk(334);
- else if (pickedObject == kVerbTalk && fl == 108)
- talk(333);
- else
- hasAnswer = 0;
+ hasAnswer = 0;
}
-void DrasculaEngine::room_pendulum(int fl) {
- if (pickedObject == kVerbLook && fl == 100)
- talk(452);
- else if (pickedObject == kVerbLook && fl == 101)
- talk(123);
- else if (pickedObject == kVerbPick && fl == 101)
+void DrasculaEngine::room_102(int fl) {
+ if (pickedObject == kVerbPick && fl == 101)
pickObject(20);
else if (pickedObject == 20 && fl == 100)
animation_6_6();
@@ -1078,159 +1008,56 @@ void DrasculaEngine::room_pendulum(int fl) {
}
void DrasculaEngine::updateRefresh() {
- if (currentChapter == 1) {
- if (roomNumber == 63)
- update_63();
- else if (roomNumber == 62)
- update_62();
- } else if (currentChapter == 2) {
- if (roomNumber == 3)
- update_3();
- else if (roomNumber == 2)
- update_2();
- else if (roomNumber == 4)
- update_4();
- else if (roomNumber == 5)
- update_5();
- else if (roomNumber == 15)
- update_15();
- else if (roomNumber == 17)
- update_17();
- else if (roomNumber == 18)
- update_18();
- else if (roomNumber == 10)
- showMap();
- } else if (currentChapter == 3) {
- if (roomNumber == 20)
- update_20();
- else if (roomNumber == 13)
- update_13();
- } else if (currentChapter == 4) {
- if (roomNumber == 29)
- update_29();
- else if (roomNumber == 26)
- update_26();
- else if (roomNumber == 27)
- update_27();
- else if (roomNumber == 31)
- update_31();
- else if (roomNumber == 34)
- update_34();
- else if (roomNumber == 35)
- update_35();
- } else if (currentChapter == 5) {
- if (roomNumber == 45)
- showMap();
- else if (roomNumber == 50)
- update_50();
- else if (roomNumber == 57)
- update_57();
- } else if (currentChapter == 6) {
- if (roomNumber == 60)
- update_60();
- else if (roomNumber == 61)
- update_61();
- else if (roomNumber == 58)
- update_58();
+ // Call room-specific updater
+ char rm[20];
+ sprintf(rm, "update_%d", roomNumber);
+ for (uint i = 0; i < _roomUpdaters.size(); i++) {
+ if (!strcmp(rm, _roomUpdaters[i]->desc)) {
+ debug(4, "Calling room updater %d", roomNumber);
+ (this->*(_roomUpdaters[i]->proc))();
+ break;
+ }
}
+
+ if (roomNumber == 10)
+ showMap();
+ else if (roomNumber == 45)
+ showMap();
}
void DrasculaEngine::updateRefresh_pre() {
- if (currentChapter == 1) {
- if (roomNumber == 62)
- update_62_pre();
- else if (roomNumber == 16)
- placeBJ();
- } else if (currentChapter == 2) {
- if (roomNumber == 1)
- update_1_pre();
- else if (roomNumber == 3)
- update_3_pre();
- else if (roomNumber == 5)
- update_5_pre();
- else if (roomNumber == 6)
- update_6_pre();
- else if (roomNumber == 7)
- update_7_pre();
- else if (roomNumber == 9)
- update_9_pre();
- else if (roomNumber == 12)
- update_12_pre();
- else if (roomNumber == 14)
- update_14_pre();
- else if (roomNumber == 16)
- update_16_pre();
- else if (roomNumber == 17)
- update_17_pre();
- else if (roomNumber == 18)
- update_18_pre();
- } else if (currentChapter == 3) {
- // nothing
- } else if (currentChapter == 4) {
- if (roomNumber == 21)
- update_21_pre();
- else if (roomNumber == 22)
- update_22_pre();
- else if (roomNumber == 23)
- update_23_pre();
- else if (roomNumber == 24)
- update_24_pre();
- else if (roomNumber == 26)
- update_26_pre();
- else if (roomNumber == 27)
- update_27_pre();
- else if (roomNumber == 29)
- update_29_pre();
- else if (roomNumber == 30)
- update_30_pre();
- else if (roomNumber == 31)
- update_31_pre();
- else if (roomNumber == 34)
- update_34_pre();
- else if (roomNumber == 35)
- update_35_pre();
- } else if (currentChapter == 5) {
- if (roomNumber == 49)
- update_49_pre();
- else if (roomNumber == 53)
- update_53_pre();
- else if (roomNumber == 54)
- update_54_pre();
- else if (roomNumber == 56)
- update_56_pre();
- } else if (currentChapter == 6) {
- if (roomNumber == 102)
- update_pendulum();
- else if (roomNumber == 58)
- update_58_pre();
- else if (roomNumber == 59)
- update_59_pre();
- else if (roomNumber == 60)
- update_60_pre();
+ // Call room-specific preupdater
+ char rm[20];
+ sprintf(rm, "update_%d_pre", roomNumber);
+ for (uint i = 0; i < _roomPreupdaters.size(); i++) {
+ if (!strcmp(rm, _roomPreupdaters[i]->desc)) {
+ debug(4, "Calling room preupdater %d", roomNumber);
+ (this->*(_roomPreupdaters[i]->proc))();
+ break;
+ }
}
+
+ if (currentChapter == 1 && roomNumber == 16)
+ placeBJ();
}
void DrasculaEngine::update_1_pre() {
- int cambio_col_antes = changeColor;
-
- if (hare_x > 98 && hare_x < 153)
+ if (curX > 98 && curX < 153) {
changeColor = 1;
- else
+ setDarkPalette();
+ } else {
changeColor = 0;
-
- if (cambio_col_antes != changeColor && changeColor == 1)
- hare_oscuro();
- if (cambio_col_antes != changeColor && changeColor == 0)
- hare_claro();
+ setBrightPalette();
+ }
if (flags[8] == 0)
copyBackground(2, 158, 208, 67, 27, 40, drawSurface3, screenSurface);
}
void DrasculaEngine::update_2(){
- int pos_murci[6];
+ int batPos[6];
int difference;
- int murci_x[] = {0, 38, 76, 114, 152, 190, 228, 266,
+ int batX[] = {0, 38, 76, 114, 152, 190, 228, 266,
0, 38, 76, 114, 152, 190, 228, 266,
0, 38, 76, 114, 152, 190,
0, 48, 96, 144, 192, 240,
@@ -1238,7 +1065,7 @@ void DrasculaEngine::update_2(){
88, 146, 204, 262,
88, 146, 204, 262};
- int murci_y[] = {179, 179, 179, 179, 179, 179, 179, 179,
+ int batY[] = {179, 179, 179, 179, 179, 179, 179, 179,
158, 158, 158, 158, 158, 158, 158, 158,
137, 137, 137, 137, 137, 137,
115, 115, 115, 115, 115, 115,
@@ -1249,28 +1076,28 @@ void DrasculaEngine::update_2(){
if (frame_bat == 41)
frame_bat = 0;
- pos_murci[0] = murci_x[frame_bat];
- pos_murci[1] = murci_y[frame_bat];
+ batPos[0] = batX[frame_bat];
+ batPos[1] = batY[frame_bat];
if (frame_bat < 22) {
- pos_murci[4] = 37;
- pos_murci[5] = 21;
+ batPos[4] = 37;
+ batPos[5] = 21;
} else if (frame_bat > 27) {
- pos_murci[4] = 57;
- pos_murci[5] = 36;
+ batPos[4] = 57;
+ batPos[5] = 36;
} else {
- pos_murci[4] = 47;
- pos_murci[5] = 22;
+ batPos[4] = 47;
+ batPos[5] = 22;
}
- pos_murci[2] = 239;
- pos_murci[3] = 19;
+ batPos[2] = 239;
+ batPos[3] = 19;
- copyRectClip(pos_murci, drawSurface3, screenSurface);
- difference = getTime() - conta_blind_vez;
+ copyRectClip(batPos, drawSurface3, screenSurface);
+ difference = getTime() - savedTime;
if (difference >= 6) {
frame_bat++;
- conta_blind_vez = getTime();
+ savedTime = getTime();
}
copyRect(29, 37, 58, 114, 57, 39, drawSurface3, screenSurface);
@@ -1283,22 +1110,19 @@ void DrasculaEngine::update_3_pre() {
}
void DrasculaEngine::update_3() {
- if (hare_y + alto_hare < 118)
+ if (curY + curHeight < 118)
copyRect(129, 110, 194, 36, 126, 88, drawSurface3, screenSurface);
copyRect(47, 57, 277, 143, 43, 50, drawSurface3, screenSurface);
}
void DrasculaEngine::update_4() {
- int cambio_col_antes = changeColor;
- if (hare_x > 190)
+ if (curX > 190) {
changeColor = 1;
- else
+ setDarkPalette();
+ } else {
changeColor = 0;
-
- if (cambio_col_antes != changeColor && changeColor == 1)
- hare_oscuro();
- if (cambio_col_antes != changeColor && changeColor == 0)
- hare_claro();
+ setBrightPalette();
+ }
}
void DrasculaEngine::update_5_pre(){
@@ -1311,23 +1135,19 @@ void DrasculaEngine::update_5() {
}
void DrasculaEngine::update_6_pre() {
- int cambio_col_antes = changeColor;
-
- if ((hare_x > 149 && hare_y + alto_hare > 160 && hare_x < 220 && hare_y + alto_hare < 188) ||
- (hare_x > 75 && hare_y + alto_hare > 183 && hare_x < 145))
+ if ((curX > 149 && curY + curHeight > 160 && curX < 220 && curY + curHeight < 188) ||
+ (curX > 75 && curY + curHeight > 183 && curX < 145)) {
changeColor = 0;
- else
+ setBrightPalette();
+ } else {
changeColor = 1;
+ setDarkPalette();
+ }
- if (cambio_col_antes != changeColor && changeColor == 1)
- hare_oscuro();
- if (cambio_col_antes != changeColor && changeColor == 0)
- hare_claro();
-
- if (flags[1] == 0)
- copyBackground(97, 117, 34, 148, 36, 31, drawSurface3, screenSurface);
if (flags[0] == 0)
copyBackground(3, 103, 185, 69, 23, 76, drawSurface3, screenSurface);
+ if (flags[1] == 0)
+ copyBackground(97, 117, 34, 148, 36, 31, drawSurface3, screenSurface);
if (flags[2] == 0)
copyBackground(28, 100, 219, 72, 64, 97, drawSurface3, screenSurface);
}
@@ -1338,16 +1158,16 @@ void DrasculaEngine::update_7_pre() {
}
void DrasculaEngine::update_9_pre() {
- int blind_x[] = {26, 68, 110, 152, 194, 236, 278, 26, 68};
- int blind_y[] = {51, 51, 51, 51, 51, 51, 51, 127, 127};
+ int blindX[] = {26, 68, 110, 152, 194, 236, 278, 26, 68};
+ int blindY[] = {51, 51, 51, 51, 51, 51, 51, 127, 127};
int difference;
- copyRect(blind_x[frame_blind], blind_y[frame_blind], 122, 57, 41, 72, drawSurface3, screenSurface);
+ copyRect(blindX[frame_blind], blindY[frame_blind], 122, 57, 41, 72, drawSurface3, screenSurface);
if (flags[9] == 0) {
- difference = getTime() - conta_blind_vez;
+ difference = getTime() - savedTime;
if (difference >= 11) {
frame_blind++;
- conta_blind_vez = getTime();
+ savedTime = getTime();
}
if (frame_blind == 9)
frame_blind = 0;
@@ -1361,7 +1181,7 @@ void DrasculaEngine::update_12_pre() {
}
void DrasculaEngine::update_13() {
- if (hare_x > 55 && flags[3] == 0)
+ if (curX > 55 && flags[3] == 0)
animation_6_3();
if (flags[1] == 0)
copyRect(185, 110, 121, 65, 67, 88, drawSurface3, screenSurface);
@@ -1371,29 +1191,29 @@ void DrasculaEngine::update_13() {
}
void DrasculaEngine::update_14_pre() {
- int candles_y[] = {158, 172, 186};
- int cirio_x[] = {14, 19, 24};
- int pianista_x[] = {1, 91, 61, 31, 91, 31, 1, 61, 31};
- int drunk_x[] = {1, 42, 83, 124, 165, 206, 247, 1};
+ int candleY[] = {158, 172, 186};
+ int candleX[] = {14, 19, 24};
+ int pianistX[] = {1, 91, 61, 31, 91, 31, 1, 61, 31};
+ int drunkX[] = {1, 42, 83, 124, 165, 206, 247, 1};
int difference;
- copyBackground(123, candles_y[frame_candles], 142, 14, 39, 13, drawSurface3, screenSurface);
- copyBackground(cirio_x[frame_candles], 146, 311, 80, 4, 8, drawSurface3, screenSurface);
+ copyBackground(123, candleY[frame_candles], 142, 14, 39, 13, drawSurface3, screenSurface);
+ copyBackground(candleX[frame_candles], 146, 311, 80, 4, 8, drawSurface3, screenSurface);
if (blinking == 5)
copyBackground(1, 149, 127, 52, 9, 5, drawSurface3, screenSurface);
- if (hare_x > 101 && hare_x < 155)
+ if (curX > 101 && curX < 155)
copyBackground(31, 138, 178, 51, 18, 16, drawSurface3, screenSurface);
if (flags[11] == 0)
- copyBackground(pianista_x[frame_piano], 157, 245, 130, 29, 42, drawSurface3, screenSurface);
+ copyBackground(pianistX[frame_piano], 157, 245, 130, 29, 42, drawSurface3, screenSurface);
else if (flags[5] == 0)
copyBackground(145, 139, 228, 112, 47, 60, extraSurface, screenSurface);
else
copyBackground(165, 140, 229, 117, 43, 59, drawSurface3, screenSurface);
if (flags[12] == 1)
- copyBackground(drunk_x[frame_drunk], 82, 170, 50, 40, 53, drawSurface3, screenSurface);
- difference = getTime() - conta_blind_vez;
+ copyBackground(drunkX[frame_drunk], 82, 170, 50, 40, 53, drawSurface3, screenSurface);
+ difference = getTime() - savedTime;
if (difference > 6) {
if (flags[12] == 1) {
frame_drunk++;
@@ -1411,7 +1231,7 @@ void DrasculaEngine::update_14_pre() {
if (frame_piano == 9)
frame_piano = 0;
blinking = _rnd->getRandomNumber(10);
- conta_blind_vez = getTime();
+ savedTime = getTime();
}
}
@@ -1420,6 +1240,11 @@ void DrasculaEngine::update_15() {
}
void DrasculaEngine::update_16_pre() {
+ if (currentChapter != 2) {
+ debug(4, "update_16_pre: Special case, current chapter is not 2, not performing update");
+ return;
+ }
+
if (flags[17] == 0)
copyBackground(1, 103, 24, 72, 33, 95, drawSurface3, screenSurface);
if (flags[19] == 1)
@@ -1444,14 +1269,14 @@ void DrasculaEngine::update_18_pre() {
copyBackground(1, 69, 120, 58, 56, 61, drawSurface3, screenSurface);
copyBackground(snore_x[frame_snore], snore_y[frame_snore], 124, 59, 40, 37, drawSurface3, screenSurface);
} else
- pon_vb();
+ moveVB();
- difference = getTime() - conta_blind_vez;
+ difference = getTime() - savedTime;
if (difference > 9) {
frame_snore++;
if (frame_snore == 16)
frame_snore = 0;
- conta_blind_vez = getTime();
+ savedTime = getTime();
}
}
@@ -1520,10 +1345,10 @@ void DrasculaEngine::update_26_pre() {
if (blinking == 5 && flags[18] == 0)
copyBackground(52, 172, 226, 106, 3, 4, drawSurface3, screenSurface);
- difference = getTime() - conta_blind_vez;
+ difference = getTime() - savedTime;
if (difference >= 10) {
blinking = _rnd->getRandomNumber(10);
- conta_blind_vez = getTime();
+ savedTime = getTime();
}
if (flags[20] == 1)
@@ -1532,7 +1357,7 @@ void DrasculaEngine::update_26_pre() {
void DrasculaEngine::update_26() {
if (flags[29] == 1)
- copyRect(93, 1, hare_x, hare_y, 45, 78, backSurface, screenSurface);
+ copyRect(93, 1, curX, curY, 45, 78, backSurface, screenSurface);
copyRect(233, 107, 17, 102, 66, 92, drawSurface3, screenSurface);
}
@@ -1675,18 +1500,18 @@ void DrasculaEngine::update_59_pre() {
}
void DrasculaEngine::update_60_pre() {
- int candles_y[] = {158, 172, 186};
+ int candleY[] = {158, 172, 186};
int difference;
if (flags[5] == 0)
placeDrascula();
- copyBackground(123, candles_y[frame_candles], 142, 14, 39, 13, drawSurface3, screenSurface);
+ copyBackground(123, candleY[frame_candles], 142, 14, 39, 13, drawSurface3, screenSurface);
if (flag_tv == 1)
copyBackground(114, 158, 8, 30, 8, 23, drawSurface3, screenSurface);
- difference = getTime() - conta_blind_vez;
+ difference = getTime() - savedTime;
blinking = _rnd->getRandomNumber(7);
if (blinking == 5 && flag_tv == 0)
flag_tv = 1;
@@ -1696,12 +1521,12 @@ void DrasculaEngine::update_60_pre() {
frame_candles++;
if (frame_candles == 3)
frame_candles = 0;
- conta_blind_vez = getTime();
+ savedTime = getTime();
}
}
void DrasculaEngine::update_60() {
- if (hare_y - 10 < y_dr && flags[5] == 0)
+ if (curY - 10 < y_dr && flags[5] == 0)
placeDrascula();
}
@@ -1710,32 +1535,32 @@ void DrasculaEngine::update_61() {
}
void DrasculaEngine::update_62_pre() {
- int candles_y[] = { 158, 172, 186 };
- int cirio_x[] = { 14, 19, 24 };
- int pianista_x[] = {1, 91, 61, 31, 91, 31, 1, 61, 31 };
- int drunk_x[] = {1, 42, 83, 124, 165, 206, 247, 1 };
+ int candleY[] = { 158, 172, 186 };
+ int candleX[] = { 14, 19, 24 };
+ int pianistX[] = {1, 91, 61, 31, 91, 31, 1, 61, 31 };
+ int drunkX[] = {1, 42, 83, 124, 165, 206, 247, 1 };
int difference;
- copyBackground(123, candles_y[frame_candles], 142, 14, 39, 13, drawSurface3, screenSurface);
- copyBackground(cirio_x[frame_candles], 146, 311, 80, 4, 8, drawSurface3, screenSurface);
+ copyBackground(123, candleY[frame_candles], 142, 14, 39, 13, drawSurface3, screenSurface);
+ copyBackground(candleX[frame_candles], 146, 311, 80, 4, 8, drawSurface3, screenSurface);
if (blinking == 5)
copyBackground(1, 149, 127, 52, 9, 5, drawSurface3, screenSurface);
- if (hare_x > 101 && hare_x < 155)
+ if (curX > 101 && curX < 155)
copyBackground(31, 138, 178, 51, 18, 16, drawSurface3, screenSurface);
if (flags[11] == 0)
- copyBackground(pianista_x[frame_piano], 157, 245, 130, 29, 42, drawSurface3, screenSurface);
+ copyBackground(pianistX[frame_piano], 157, 245, 130, 29, 42, drawSurface3, screenSurface);
else if (flags[5] == 0)
copyBackground(145, 139, 228, 112, 47, 60, extraSurface, screenSurface);
else
copyBackground(165, 140, 229, 117, 43, 59, drawSurface3, screenSurface);
if (flags[12] == 1)
- copyBackground(drunk_x[frame_drunk], 82, 170, 50, 40, 53, drawSurface3, screenSurface);
+ copyBackground(drunkX[frame_drunk], 82, 170, 50, 40, 53, drawSurface3, screenSurface);
- difference = getTime() - conta_blind_vez;
+ difference = getTime() - savedTime;
if (difference > 6) {
if (flags[12] == 1) {
frame_drunk++;
@@ -1753,18 +1578,18 @@ void DrasculaEngine::update_62_pre() {
if (frame_piano == 9)
frame_piano = 0;
blinking = _rnd->getRandomNumber(10);
- conta_blind_vez = getTime();
+ savedTime = getTime();
}
}
void DrasculaEngine::update_62() {
- int drunk_x[] = { 1, 42, 83, 124, 165, 206, 247, 1 };
+ int drunkX[] = { 1, 42, 83, 124, 165, 206, 247, 1 };
copyRect(1, 1, 0, 0, 62, 142, drawSurface2, screenSurface);
- if (hare_y + alto_hare < 89) {
+ if (curY + curHeight < 89) {
copyRect(205, 1, 180, 9, 82, 80, drawSurface3, screenSurface);
- copyBackground(drunk_x[frame_drunk], 82, 170, 50, 40, 53, drawSurface3, screenSurface);
+ copyBackground(drunkX[frame_drunk], 82, 170, 50, 40, 53, drawSurface3, screenSurface);
}
}
@@ -1772,7 +1597,7 @@ void DrasculaEngine::update_63() {
copyRect(1, 154, 83, 122, 131, 44, drawSurface3, screenSurface);
}
-void DrasculaEngine::update_pendulum() {
+void DrasculaEngine::update_102() {
int pendulum_x[] = {40, 96, 152, 208, 264, 40, 96, 152, 208, 208, 152, 264, 40, 96, 152, 208, 264};
int difference;
@@ -1791,123 +1616,43 @@ void DrasculaEngine::update_pendulum() {
if (flags[1] == 0)
copyRect(44, 145, 145, 105, 25, 29, drawSurface3, screenSurface);
- difference = getTime() - conta_blind_vez;
+ difference = getTime() - savedTime;
if (difference > 8) {
frame_pen++;
if (frame_pen == 17)
frame_pen = 0;
- conta_blind_vez = getTime();
+ savedTime = getTime();
}
}
-bool DrasculaEngine::checkFlag(int fl) {
+bool DrasculaEngine::checkAction(int fl) {
characterMoved = 0;
updateRoom();
updateScreen();
hasAnswer = 1;
- if (menuScreen == 1) {
+ if (menuScreen == 1 && roomParse(200, fl)) {
+ ;
+ } else if (menuScreen != 1 && roomParse(201, fl)) {
+ ;
+ } else if (menuScreen == 1) {
if (currentChapter == 1) {
- if (pickedObject == kVerbLook && fl == 28)
- talk(328);
+ hasAnswer = 0;
} else if (currentChapter == 2) {
if ((pickedObject == kVerbLook && fl == 22 && flags[23] == 0)
- || (pickedObject == kVerbOpen && fl == 22 && flags[23] == 0)) {
+ || (pickedObject == kVerbOpen && fl == 22 && flags[23] == 0)) {
talk(164);
flags[23] = 1;
withoutVerb();
- addObject(7);
- addObject(18);
+ addObject(kItemMoney);
+ addObject(kItemTwoCoins);
} else if (pickedObject == kVerbLook && fl == 22 && flags[23] == 1)
talk(307);
- else if (pickedObject == kVerbLook && fl == 28)
- talk(328);
- else if (pickedObject == kVerbLook && fl == 7)
- talk(143);
- else if (pickedObject == kVerbTalk && fl == 7)
- talk(144);
- else if (pickedObject == kVerbLook && fl == 8)
- talk(145);
- else if (pickedObject == kVerbTalk && fl == 8)
- talk(146);
- else if (pickedObject == kVerbLook && fl == 9)
- talk(147);
- else if (pickedObject == kVerbTalk && fl == 9)
- talk(148);
- else if (pickedObject == kVerbLook && fl == 10)
- talk(151);
- else if (pickedObject == kVerbLook && fl == 11)
- talk(152);
- else if (pickedObject == kVerbTalk && fl == 11)
- talk(153);
- else if (pickedObject == kVerbLook && fl == 12)
- talk(154);
- else if (pickedObject == kVerbLook && fl == 13)
- talk(155);
- else if (pickedObject == kVerbLook && fl == 14)
- talk(157);
- else if (pickedObject == kVerbLook && fl == 15)
- talk(58);
- else if (pickedObject == kVerbLook && fl == 16)
- talk(158);
- else if (pickedObject == kVerbLook && fl == 17)
- talk(159);
- else if (pickedObject == kVerbLook && fl == 18)
- talk(160);
- else if (pickedObject == kVerbLook && fl == 19)
- talk(161);
- else if (pickedObject == kVerbLook && fl == 20)
- talk(162);
- else if (pickedObject == kVerbLook && fl == 23)
- talk(152);
else
hasAnswer = 0;
} else if (currentChapter == 3) {
- if (pickedObject == kVerbLook && fl == 22)
- talk(307);
- else if (pickedObject == kVerbLook && fl == 28)
- talk(328);
- else if (pickedObject == kVerbLook && fl == 7)
- talk(143);
- else if (pickedObject == kVerbTalk && fl == 7)
- talk(144);
- else if (pickedObject == kVerbLook && fl == 8)
- talk(145);
- else if (pickedObject == kVerbTalk && fl == 8)
- talk(146);
- else if (pickedObject == kVerbLook && fl == 9)
- talk(147);
- else if (pickedObject == kVerbTalk && fl == 9)
- talk(148);
- else if (pickedObject == kVerbLook && fl == 10)
- talk(151);
- else if (pickedObject == kVerbLook && fl == 11)
- talk(152);
- else if (pickedObject == kVerbTalk && fl == 11)
- talk(153);
- else if (pickedObject == kVerbLook && fl == 12)
- talk(154);
- else if (pickedObject == kVerbLook && fl == 13)
- talk(155);
- else if (pickedObject == kVerbLook && fl == 14)
- talk(157);
- else if (pickedObject == kVerbLook && fl == 15)
- talk(58);
- else if (pickedObject == kVerbLook && fl == 16)
- talk(158);
- else if (pickedObject == kVerbLook && fl == 17)
- talk(159);
- else if (pickedObject == kVerbLook && fl == 18)
- talk(160);
- else if (pickedObject == kVerbLook && fl == 19)
- talk(161);
- else if (pickedObject == kVerbLook && fl == 20)
- talk(162);
- else if (pickedObject == kVerbLook && fl == 23)
- talk(152);
- else
- hasAnswer = 0;
+ hasAnswer = 0;
} else if (currentChapter == 4) {
if ((pickedObject == 18 && fl == 19) || (pickedObject == 19 && fl == 18)) {
withoutVerb();
@@ -1916,175 +1661,42 @@ bool DrasculaEngine::checkFlag(int fl) {
removeObject(19);
} else if ((pickedObject == 14 && fl == 19) || (pickedObject == 19 && fl == 14))
talk(484);
- else if (pickedObject == kVerbLook && fl == 28)
- talk(328);
- else if (pickedObject == kVerbLook && fl == 7)
- talk(478);
- else if (pickedObject == kVerbLook && fl == 8)
- talk(480);
else if (pickedObject == kVerbLook && fl == 9) {
talk(482);
talk(483);
- } else if (pickedObject == kVerbLook && fl == 10)
- talk(485);
- else if (pickedObject == kVerbLook && fl == 11)
- talk(488);
- else if (pickedObject == kVerbLook && fl == 12)
- talk(486);
- else if (pickedObject == kVerbLook && fl == 13)
- talk(490);
- else if (pickedObject == kVerbLook && fl == 14)
- talk(122);
- else if (pickedObject == kVerbLook && fl == 15)
- talk(117);
- else if (pickedObject == kVerbTalk && fl == 15)
- talk(118);
- else if (pickedObject == kVerbOpen && fl == 15)
- talk(119);
- else if (pickedObject == kVerbLook && fl == 16)
- talk(491);
- else if (pickedObject == kVerbLook && fl == 17)
- talk(478);
- else if (pickedObject == kVerbLook && fl == 18)
- talk(493);
- else if (pickedObject == kVerbLook && fl == 19) {
+ } else if (pickedObject == kVerbLook && fl == 19) {
talk(494);
talk(495);
- } else if (pickedObject == kVerbLook && fl == 20)
- talk(162);
- else if (pickedObject == kVerbLook && fl == 21)
- talk(496);
- else if (pickedObject == kVerbLook && fl == 22)
- talk(161);
- else
+ } else
hasAnswer = 0;
} else if (currentChapter == 5) {
- if (pickedObject == kVerbLook && fl == 28)
- talk(328);
- else if (pickedObject == kVerbLook && fl == 7)
- talk(478);
- else if (pickedObject == kVerbLook && fl == 8)
- talk(120);
- else if (pickedObject == kVerbLook && fl == 9) {
+ if (pickedObject == kVerbLook && fl == 9) {
talk(482);
talk(483);
- } else if (pickedObject == kVerbLook && fl == 11)
- talk(488);
- else if (pickedObject == kVerbLook && fl == 13)
- talk(490);
- else if (pickedObject == kVerbLook && fl == 14)
- talk(121);
- else if (pickedObject == kVerbLook && fl == 15)
- talk(117);
- else if (pickedObject == kVerbTalk && fl == 15)
- talk(118);
- else if (pickedObject == kVerbOpen && fl == 15)
- talk(119);
- else if (pickedObject == kVerbLook && fl == 17)
- talk(478);
- else if (pickedObject == kVerbLook && fl == 20)
- talk(162);
- else
+ } else
hasAnswer = 0;
} else if (currentChapter == 6) {
- if (pickedObject == kVerbLook && fl == 28)
- talk(328);
- else if (pickedObject == kVerbLook && fl == 9) {
+ if (pickedObject == kVerbLook && fl == 9) {
talk(482);
talk(483);
- } else if (pickedObject == kVerbLook && fl == 20)
- talk(123);
- else if (pickedObject == kVerbLook && fl == 21)
- talk(441);
- else
+ } else
hasAnswer = 0;
}
} else {
if (currentChapter == 1) {
- if (pickedObject == kVerbLook && fl == 50)
- talk(308);
- else if (pickedObject == kVerbOpen && fl == 50)
- talk(310);
- else if (pickedObject == kVerbClose && fl == 50)
- talk(311);
- else if (pickedObject == kVerbMove && fl == 50)
- talk(312);
- else if (pickedObject == kVerbPick && fl == 50)
- talk(313);
- else if (pickedObject == kVerbTalk && fl == 50)
- talk(314);
- else if (roomNumber == 62)
- room_62(fl);
- else if (roomNumber == 63)
- room_63(fl);
- else
- hasAnswer = 0;
+ hasAnswer = 0;
} else if (currentChapter == 2) {
- if (pickedObject == kVerbLook && fl == 50)
- talk(308);
- else if (pickedObject == kVerbOpen && fl == 50)
- talk(310);
- else if (pickedObject == kVerbClose && fl == 50)
- talk(311);
- else if (pickedObject == kVerbMove && fl == 50)
- talk(312);
- else if (pickedObject == kVerbPick && fl == 50)
- talk(313);
- else if (pickedObject == kVerbTalk && fl == 50)
- talk(314);
// Note: the original check was strcmp(num_room, "18.alg")
- else if (pickedObject == 11 && fl == 50 && flags[22] == 0 && roomNumber != 18)
+ if (pickedObject == 11 && fl == 50 && flags[22] == 0 && roomNumber != 18)
talk(315);
else if (pickedObject == 13 && fl == 50)
talk(156);
else if (pickedObject == 20 && fl == 50)
talk(163);
- else if (roomNumber == 1)
- room_1(fl);
- else if (roomNumber == 3)
- room_3(fl);
- else if (roomNumber == 4)
- room_4(fl);
- else if (roomNumber == 5)
- room_5(fl);
- else if (roomNumber == 6)
- room_6(fl);
- else if (roomNumber == 7)
- room_7(fl);
- else if (roomNumber == 8)
- room_8(fl);
- else if (roomNumber == 9)
- room_9(fl);
- else if (roomNumber == 12)
- room_12(fl);
- else if (roomNumber == 14)
- room_14(fl);
- else if (roomNumber == 15)
- room_15(fl);
- else if (roomNumber == 16)
- room_16(fl);
- else if (roomNumber == 17)
- room_17(fl);
- else if (roomNumber == 18)
- room_18(fl);
- else if (roomNumber == 19)
- room_19(fl);
else
hasAnswer = 0;
} else if (currentChapter == 3) {
- if (pickedObject == kVerbLook && fl == 50)
- talk(309);
- else if (pickedObject == kVerbOpen && fl == 50)
- talk(310);
- else if (pickedObject == kVerbClose && fl == 50)
- talk(311);
- else if (pickedObject == kVerbMove && fl == 50)
- talk(312);
- else if (pickedObject == kVerbPick && fl == 50)
- talk(313);
- else if (pickedObject == kVerbTalk && fl == 50)
- talk(314);
- else if (roomNumber == 13) {
+ if (roomNumber == 13) {
if (room_13(fl))
return true;
} else
@@ -2092,18 +1704,6 @@ bool DrasculaEngine::checkFlag(int fl) {
} else if (currentChapter == 4) {
if (roomNumber == 28)
talk(178);
- else if (pickedObject == kVerbLook && fl == 50)
- talk(309);
- else if (pickedObject == kVerbOpen && fl == 50)
- talk(310);
- else if (pickedObject == kVerbClose && fl == 50)
- talk(311);
- else if (pickedObject == kVerbMove && fl == 50)
- talk(312);
- else if (pickedObject == kVerbPick && fl == 50)
- talk(313);
- else if (pickedObject == kVerbTalk && fl == 50)
- talk(314);
else if (pickedObject == 8 && fl == 50 && flags[18] == 0)
talk(481);
else if (pickedObject == 9 && fl == 50)
@@ -2115,53 +1715,11 @@ bool DrasculaEngine::checkFlag(int fl) {
else if (roomNumber == 21) {
if (room_21(fl))
return true;
- } else if (roomNumber == 22)
- room_22(fl);
- else if (roomNumber == 23)
- room_23(fl);
- else if (roomNumber == 24)
- room_24(fl);
- else if (roomNumber == 26)
- room_26(fl);
- else if (roomNumber == 27)
- room_27(fl);
- else if (roomNumber == 29)
- room_29(fl);
- else if (roomNumber == 30)
- room_30(fl);
- else if (roomNumber == 31)
- room_31(fl);
- else if (roomNumber == 34)
- room_34(fl);
- else if (roomNumber == 35)
- room_35(fl);
- else if (roomNumber == 44)
- room_44(fl);
- else
+ } else
hasAnswer = 0;
} else if (currentChapter == 5) {
- if (pickedObject == kVerbLook && fl == 50)
- talk("Cuanto mas me miro, mas me gusto", "54.als");
- else if (pickedObject == kVerbOpen && fl == 50)
- talk("y luego como me cierro", "19.als");
- else if (pickedObject == kVerbClose && fl == 50)
- talk("Tendre que abrirme primero no", "19.als");
- else if (pickedObject == kVerbMove && fl == 50)
- talk("Estoy bien donde estoy", "19.als");
- else if (pickedObject == kVerbPick && fl == 50)
- talk("Ya me tengo", "11.als");
- else if (pickedObject == kVerbTalk && fl == 50)
- talk("hola yo", "16.als");
- else if (pickedObject == 20 && fl == 50)
+ if (pickedObject == 20 && fl == 50)
talk(487);
- else if (roomNumber == 49)
- room_49(fl);
- else if (roomNumber == 53)
- room_53(fl);
- else if (roomNumber == 54)
- room_54(fl);
- else if (roomNumber == 55)
- room_55(fl);
else if (roomNumber == 56) {
if (room_56(fl))
return true;
@@ -2171,35 +1729,36 @@ bool DrasculaEngine::checkFlag(int fl) {
if (pickedObject == kVerbLook && fl == 50 && flags[0] == 1)
talk(308);
else if (pickedObject == kVerbLook && fl == 50 && flags[0] == 0)
- talk(310 );
- else if (pickedObject == kVerbOpen && fl == 50)
- talk(310 );
- else if (pickedObject == kVerbClose && fl == 50)
- talk(311 );
- else if (pickedObject == kVerbMove && fl == 50)
- talk(312 );
- else if (pickedObject == kVerbPick && fl == 50)
- talk(313 );
- else if (pickedObject == kVerbTalk && fl == 50)
- talk(314 );
+ talk(310);
else if (roomNumber == 102)
- room_pendulum(fl);
- else if (roomNumber == 58)
- room_58(fl);
- else if (roomNumber == 59)
- room_59(fl);
+ room_102(fl);
else if (roomNumber == 60) {
if (room_60(fl))
return true;
- } else if (roomNumber == 61)
- room_61(fl);
+ }
else
hasAnswer = 0;
}
}
- if (hasAnswer == 0 && hasName == 1)
- room_0();
- else if (hasAnswer == 0 && menuScreen == 1)
+
+ if (hasAnswer == 0) {
+ hasAnswer = 1;
+
+ if (!roomParse(roomNumber, fl)) {
+ // Call room-specific parser
+ char rm[20];
+ sprintf(rm, "room_%d", roomNumber);
+ for (uint i = 0; i < _roomParsers.size(); i++) {
+ if (!strcmp(rm, _roomParsers[i]->desc)) {
+ debug(4, "Calling room parser %d", roomNumber);
+ (this->*(_roomParsers[i]->proc))(fl);
+ break;
+ }
+ }
+ }
+ }
+
+ if (hasAnswer == 0 && (hasName == 1 || menuScreen == 1))
room_0();
return false;
diff --git a/engines/drascula/staticdata.h b/engines/drascula/staticdata.h
index c5fb4c0679..58bf24f75d 100644
--- a/engines/drascula/staticdata.h
+++ b/engines/drascula/staticdata.h
@@ -116,7 +116,7 @@ const int y_pol[44] = {0, 1, 1, 1, 1, 1, 1, 1, 27, 27, 1,
1, 1, 1, 1, 1, 27, 27, 27, 27, 27,
1, 1, 1, 1, 1, 27, 27, 27, 27, 27,
27, 1, 1};
-const int x_barra[] = {6, 51, 96, 141, 186, 232, 276, 321};
+const int verbBarX[] = {6, 51, 96, 141, 186, 232, 276, 321};
const int x1d_menu[] = {280, 40, 80, 120, 160, 200, 240, 0, 40, 80, 120,
160, 200, 240, 0, 40, 80, 120, 160, 200, 240, 0,
40, 80, 120, 160, 200, 240, 0};
@@ -127,174 +127,426 @@ int frame_x[20] = {43, 87, 130, 173, 216, 259};
// Note: default action needs to be LAST for each group
// of actions with the same number
-RoomTalkAction room0Actions[] = {
- // num action object speech
- { 1, kVerbLook, -1, 54 },
- { 1, kVerbMove, -1, 19 },
- { 1, kVerbPick, -1, 11 },
- { 1, kVerbOpen, -1, 9 },
- { 1, kVerbClose, -1, 9 },
- { 1, kVerbTalk, -1, 16 },
- { 1, kVerbDefault, -1, 11 },
+RoomTalkAction roomActions[] = {
+ //room num action object speech
+ { 0, 1, kVerbLook, -1, 54 },
+ { 0, 1, kVerbMove, -1, 19 },
+ { 0, 1, kVerbPick, -1, 11 },
+ { 0, 1, kVerbOpen, -1, 9 },
+ { 0, 1, kVerbClose, -1, 9 },
+ { 0, 1, kVerbTalk, -1, 16 },
+ { 0, 1, kVerbDefault, -1, 11 },
// ----------------------------------
- { 2, kVerbMove, -1, 19 },
- { 2, kVerbOpen, -1, 9 },
- { 2, kVerbClose, -1, 9 },
- { 2, kVerbTalk, -1, 16 },
+ { 0, 2, kVerbMove, -1, 19 },
+ { 0, 2, kVerbOpen, -1, 9 },
+ { 0, 2, kVerbClose, -1, 9 },
+ { 0, 2, kVerbTalk, -1, 16 },
// ----------------------------------
- { 3, kVerbLook, -1, 316 },
- { 3, kVerbMove, -1, 317 },
- { 3, kVerbPick, -1, 318 },
- { 3, kVerbOpen, -1, 319 },
- { 3, kVerbClose, -1, 319 },
- { 3, kVerbTalk, -1, 320 },
- { 3, kVerbDefault, -1, 318 },
+ { 0, 3, kVerbLook, -1, 316 },
+ { 0, 3, kVerbMove, -1, 317 },
+ { 0, 3, kVerbPick, -1, 318 },
+ { 0, 3, kVerbOpen, -1, 319 },
+ { 0, 3, kVerbClose, -1, 319 },
+ { 0, 3, kVerbTalk, -1, 320 },
+ { 0, 3, kVerbDefault, -1, 318 },
// ----------------------------------
- { 4, kVerbMove, -1, 19 },
- { 4, kVerbOpen, -1, 9 },
- { 4, kVerbClose, -1, 9 },
- { 4, kVerbTalk, -1, 16 },
+ { 0, 4, kVerbMove, -1, 19 },
+ { 0, 4, kVerbOpen, -1, 9 },
+ { 0, 4, kVerbClose, -1, 9 },
+ { 0, 4, kVerbTalk, -1, 16 },
// ----------------------------------
- { 5, kVerbOpen, -1, 9 },
- { 5, kVerbClose, -1, 9 },
- { 5, kVerbTalk, -1, 16 },
+ { 0, 5, kVerbOpen, -1, 9 },
+ { 0, 5, kVerbClose, -1, 9 },
+ { 0, 5, kVerbTalk, -1, 16 },
// ----------------------------------
- { 6, kVerbMove, -1, 19 },
- { 6, kVerbOpen, -1, 9 },
- { 6, kVerbClose, -1, 9 },
- { 6, kVerbTalk, -1, 16 }
-};
-
-RoomTalkAction room1Actions[] = {
- // num action object speech
- { -1, kVerbPick, 118, 5 },
- { -1, kVerbOpen, 118, 3 },
- { -1, kVerbClose, 118, 4 },
- { -1, kVerbTalk, 118, 6 },
+ { 0, 6, kVerbMove, -1, 19 },
+ { 0, 6, kVerbOpen, -1, 9 },
+ { 0, 6, kVerbClose, -1, 9 },
+ { 0, 6, kVerbTalk, -1, 16 },
+ // ==================================
+ { 1, -1, kVerbPick, 118, 5 },
+ { 1, -1, kVerbOpen, 118, 3 },
+ { 1, -1, kVerbClose, 118, 4 },
+ { 1, -1, kVerbTalk, 118, 6 },
// ----------------------------------
- { -1, kVerbLook, 119, 8 },
- { -1, kVerbMove, 119, 13 },
- { -1, kVerbClose, 119, 10 },
- { -1, kVerbTalk, 119, 12 },
+ { 1, -1, kVerbLook, 119, 8 },
+ { 1, -1, kVerbMove, 119, 13 },
+ { 1, -1, kVerbClose, 119, 10 },
+ { 1, -1, kVerbTalk, 119, 12 },
// ----------------------------------
- { -1, kVerbMove, 120, 13 },
- { -1, kVerbOpen, 120, 18 },
- { -1, kVerbTalk, 120, 15 }
-};
-
-RoomTalkAction room3Actions[] = {
- // num action object speech
- { -1, kVerbLook, 129, 21 },
- { -1, kVerbPick, 129, 5 },
- { -1, kVerbMove, 129, 24 },
- { -1, kVerbOpen, 129, 22 },
- { -1, kVerbClose, 129, 10 },
+ { 1, -1, kVerbMove, 120, 13 },
+ { 1, -1, kVerbOpen, 120, 18 },
+ { 1, -1, kVerbTalk, 120, 15 },
+ // ==================================
+ { 3, -1, kVerbLook, 129, 21 },
+ { 3, -1, kVerbPick, 129, 5 },
+ { 3, -1, kVerbMove, 129, 24 },
+ { 3, -1, kVerbOpen, 129, 22 },
+ { 3, -1, kVerbClose, 129, 10 },
// ----------------------------------
- { -1, kVerbLook, 131, 27 },
- { -1, kVerbPick, 131, 5 },
- { -1, kVerbMove, 131, 24 },
- { -1, kVerbOpen, 131, 22 },
- { -1, kVerbClose, 131, 10 },
- { -1, kVerbTalk, 131, 23 },
+ { 3, -1, kVerbLook, 131, 27 },
+ { 3, -1, kVerbPick, 131, 5 },
+ { 3, -1, kVerbMove, 131, 24 },
+ { 3, -1, kVerbOpen, 131, 22 },
+ { 3, -1, kVerbClose, 131, 10 },
+ { 3, -1, kVerbTalk, 131, 23 },
// ----------------------------------
- { -1, kVerbLook, 132, 28 },
- { -1, kVerbPick, 132, 5 },
- { -1, kVerbMove, 132, 24 },
- { -1, kVerbOpen, 132, 22 },
- { -1, kVerbClose, 132, 10 },
- { -1, kVerbTalk, 132, 23 },
+ { 3, -1, kVerbLook, 132, 28 },
+ { 3, -1, kVerbPick, 132, 5 },
+ { 3, -1, kVerbMove, 132, 24 },
+ { 3, -1, kVerbOpen, 132, 22 },
+ { 3, -1, kVerbClose, 132, 10 },
+ { 3, -1, kVerbTalk, 132, 23 },
// ----------------------------------
- { -1, kVerbLook, 133, 321 },
- { -1, kVerbPick, 133, 31 },
- { -1, kVerbMove, 133, 34 },
- { -1, kVerbOpen, 133, 30 },
- { -1, kVerbClose, 133, 10 },
+ { 3, -1, kVerbLook, 133, 321 },
+ { 3, -1, kVerbPick, 133, 31 },
+ { 3, -1, kVerbMove, 133, 34 },
+ { 3, -1, kVerbOpen, 133, 30 },
+ { 3, -1, kVerbClose, 133, 10 },
// ----------------------------------
- { -1, kVerbLook, 166, 55 },
- { -1, kVerbPick, 166, 7 },
+ { 3, -1, kVerbLook, 166, 55 },
+ { 3, -1, kVerbPick, 166, 7 },
// ----------------------------------
- { -1, kVerbLook, 211, 184 }
-};
-
-RoomTalkAction room4Actions[] = {
- // num action object speech
- { -1, kVerbLook, 189, 182 },
+ { 3, -1, kVerbLook, 211, 184 },
+ // ==================================
+ { 4, -1, kVerbLook, 189, 182 },
// ----------------------------------
- { -1, kVerbLook, 207, 175 },
- { -1, kVerbTalk, 207, 176 },
+ { 4, -1, kVerbLook, 207, 175 },
+ { 4, -1, kVerbTalk, 207, 176 },
// ----------------------------------
- { -1, kVerbLook, 208, 177 },
+ { 4, -1, kVerbLook, 208, 177 },
// ----------------------------------
- { -1, kVerbLook, 209, 179 },
+ { 4, -1, kVerbLook, 209, 179 },
// ----------------------------------
- { -1, kVerbLook, 210, 180 },
- { -1, kVerbOpen, 210, 181 }
-};
-
-RoomTalkAction room5Actions[] = {
- // num action object speech
- { -1, kVerbMove, 136, 13 },
- { -1, kVerbOpen, 136, 18 },
- { -1, kVerbTalk, 136, 15 },
+ { 4, -1, kVerbLook, 210, 180 },
+ { 4, -1, kVerbOpen, 210, 181 },
+ // ==================================
+ { 5, -1, kVerbMove, 136, 13 },
+ { 5, -1, kVerbOpen, 136, 18 },
+ { 5, -1, kVerbTalk, 136, 15 },
// ----------------------------------
- { -1, kVerbLook, 212, 187 },
- { -1, kVerbTalk, 212, 188 },
+ { 5, -1, kVerbLook, 212, 187 },
+ { 5, -1, kVerbTalk, 212, 188 },
// ----------------------------------
- { -1, kVerbLook, 213, 189 },
- { -1, kVerbOpen, 213, 190 }
-};
-
-RoomTalkAction room6Actions[] = {
- // num action object speech
- { -1, kVerbPick, 144, 43 },
+ { 5, -1, kVerbLook, 213, 189 },
+ { 5, -1, kVerbOpen, 213, 190 },
+ // ==================================
+ { 6, -1, kVerbPick, 144, 43 },
// ----------------------------------
- { -1, kVerbLook, 138, 35 },
- { -1, kVerbTalk, 138, 6 },
+ { 6, -1, kVerbLook, 138, 35 },
+ { 6, -1, kVerbTalk, 138, 6 },
// ----------------------------------
- { -1, kVerbLook, 143, 37 },
- { -1, kVerbPick, 143, 7 },
- { -1, kVerbMove, 143, 7 },
- { -1, kVerbTalk, 143, 38 },
+ { 6, -1, kVerbLook, 143, 37 },
+ { 6, -1, kVerbPick, 143, 7 },
+ { 6, -1, kVerbMove, 143, 7 },
+ { 6, -1, kVerbTalk, 143, 38 },
// ----------------------------------
- { -1, kVerbLook, 139, 36 },
+ { 6, -1, kVerbLook, 139, 36 },
// ----------------------------------
- { -1, kVerbLook, 140, 147 }
-};
-
-RoomTalkAction room12Actions[] = {
- // num action object speech
- { -1, kVerbLook, 154, 329 },
- { -1, kVerbTalk, 154, 330 },
+ { 6, -1, kVerbLook, 140, 147 },
+ // ==================================
+ { 7, -1, kVerbLook, 164, 35 },
// ----------------------------------
- { -1, kVerbMove, 155, 48 },
- { -1, kVerbTalk, 155, 331 },
+ { 7, -1, kVerbLook, 169, 44 },
+ // ==================================
+ { 9, -1, kVerbLook, 150, 35 },
+ { 9, -1, kVerbTalk, 150, 6 },
// ----------------------------------
- { -1, kVerbLook, 156, 35 },
- { -1, kVerbMove, 156, 48 },
- { -1, kVerbTalk, 156, 50 }
-};
-
-RoomTalkAction room14Actions[] = {
- // num action object speech
- { -1, kVerbLook, 200, 165 },
+ { 9, -1, kVerbLook, 51, 60 },
+ // ==================================
+ { 12, -1, kVerbLook, 154, 329 },
+ { 12, -1, kVerbTalk, 154, 330 },
+ // ----------------------------------
+ { 12, -1, kVerbMove, 155, 48 },
+ { 12, -1, kVerbTalk, 155, 331 },
+ // ----------------------------------
+ { 12, -1, kVerbLook, 156, 35 },
+ { 12, -1, kVerbMove, 156, 48 },
+ { 12, -1, kVerbTalk, 156, 50 },
+ // ==================================
+ { 14, -1, kVerbLook, 200, 165 },
+ // ----------------------------------
+ { 14, -1, kVerbLook, 201, 166 },
+ // ----------------------------------
+ { 14, -1, kVerbLook, 202, 167 },
+ // ----------------------------------
+ { 14, -1, kVerbLook, 203, 168 },
+ { 14, -1, kVerbPick, 203, 170 },
+ { 14, -1, kVerbMove, 203, 170 },
+ { 14, -1, kVerbTalk, 203, 169 },
+ // ----------------------------------
+ { 14, -1, kVerbLook, 204, 171 },
+ // ==================================
+ { 15, -1, kVerbTalk, 188, 333 },
+ { 15, -1, kVerbLook, 188, 334 },
+ // ----------------------------------
+ { 15, -1, kVerbLook, 205, 172 },
+ // ----------------------------------
+ { 15, -1, kVerbLook, 206, 173 },
+ { 15, -1, kVerbMove, 206, 174 },
+ { 15, -1, kVerbOpen, 206, 174 },
+ // ==================================
+ { 16, -1, kVerbTalk, 163, 6 },
+ // ----------------------------------
+ { 16, -1, kVerbLook, 183, 340 },
+ // ----------------------------------
+ { 16, -1, kVerbLook, 185, 37 },
+ { 16, -1, kVerbPick, 185, 7 },
+ { 16, -1, kVerbMove, 185, 7 },
+ { 16, -1, kVerbTalk, 185, 38 },
+ // ----------------------------------
+ { 16, -1, kVerbTalk, 187, 345 },
+ // ==================================
+ { 18, -1, kVerbLook, 181, 348 },
+ // ----------------------------------
+ { 18, -1, kVerbLook, 182, 154 },
+ // ==================================
+ { 19, -1, kVerbLook, 214, 191 },
+ // ==================================
+ { 22, -1, kVerbPick, 140, 7 },
+ // ----------------------------------
+ { 22, -1, kVerbLook, 52, 497 },
+ { 22, -1, kVerbTalk, 52, 498 },
+ // ==================================
+ { 24, -1, kVerbLook, 151, 461 },
+ // ==================================
+ { 26, -1, kVerbOpen, 167, 467 },
+ // ----------------------------------
+ { 26, -1, kVerbLook, 164, 470 },
+ { 26, -1, kVerbOpen, 164, 471 },
+ // ----------------------------------
+ { 26, -1, kVerbLook, 163, 472 },
+ { 26, -1, kVerbPick, 163, 473 },
+ // ----------------------------------
+ { 26, -1, kVerbLook, 165, 474 },
+ // ----------------------------------
+ { 26, -1, kVerbLook, 168, 476 },
+ { 26, -1, kVerbPick, 168, 477 },
+ // ==================================
+ { 29, -1, kVerbLook, 152, 463 },
+ { 29, -1, kVerbOpen, 152, 464 },
+ // ----------------------------------
+ { 29, -1, kVerbLook, 153, 465 },
// ----------------------------------
- { -1, kVerbLook, 201, 166 },
+ { 29, -1, kVerbPick, 154, 466 },
// ----------------------------------
- { -1, kVerbLook, 202, 167 },
+ { 29, -1, kVerbOpen, 156, 467 },
+ // ==================================
+ { 30, -1, kVerbOpen, 157, 468 },
// ----------------------------------
- { -1, kVerbLook, 203, 168 },
- { -1, kVerbPick, 203, 170 },
- { -1, kVerbMove, 203, 170 },
- { -1, kVerbTalk, 203, 169 },
+ { 30, -1, kVerbLook, 158, 469 },
+ // ==================================
+ { 31, -1, kVerbLook, 161, 470 },
+ { 31, -1, kVerbOpen, 161, 471 },
+ // ==================================
+ { 34, -1, kVerbLook, 146, 458 },
+ { 34, -1, kVerbPick, 146, 459 },
+ // ==================================
+ { 44, -1, kVerbLook, 172, 428 },
+ // ==================================
+ { 49, -1, kVerbLook, 51, 132 },
// ----------------------------------
- { -1, kVerbLook, 204, 171 }
+ { 49, -1, kVerbLook, 200, 133 },
+ { 49, -1, kVerbTalk, 200, 134 },
+ // ----------------------------------
+ { 49, -1, kVerbLook, 201, 135 },
+ // ----------------------------------
+ { 49, -1, kVerbLook, 203, 137 },
+ // ==================================
+ { 53, -1, kVerbLook, 121, 128 },
+ // ----------------------------------
+ { 53, -1, kVerbLook, 209, 129 },
+ // ----------------------------------
+ { 53, -1, kVerbLook, 52, 447 },
+ { 53, -1, kVerbTalk, 52, 131 },
+ // ==================================
+ { 54, -1, kVerbLook, 53, 127 },
+ // ----------------------------------
+ { 54, -1, kVerbOpen, 119, 125 },
+ { 54, -1, kVerbLook, 119, 126 },
+ // ==================================
+ { 55, -1, kVerbLook, 122, 138 },
+ // ----------------------------------
+ { 55, -1, kVerbLook, 204, 139 },
+ // ----------------------------------
+ { 55, -1, kVerbLook, 205, 140 },
+ // ==================================
+ { 56, -1, kVerbLook, 124, 450 },
+ // ----------------------------------
+ { 56, -1, kVerbOpen, 207, 141 },
+ // ----------------------------------
+ { 56, -1, kVerbLook, 208, 142 },
+ // ==================================
+ { 58, -1, kVerbLook, 104, 454 },
+ // ==================================
+ { 60, -1, kVerbLook, 112, 440 },
+ // ----------------------------------
+ { 60, -1, kVerbTalk, 115, 455 },
+ // ----------------------------------
+ { 60, -1, kVerbTalk, 56, 455 },
+ // ----------------------------------
+ { 60, -1, kVerbLook, 114, 167 },
+ // ----------------------------------
+ { 60, -1, kVerbLook, 113, 168 },
+ { 60, -1, kVerbPick, 113, 170 },
+ { 60, -1, kVerbMove, 113, 170 },
+ { 60, -1, kVerbTalk, 113, 169 },
+ // ==================================
+ { 61, -1, kVerbLook, 116, 172 },
+ // ----------------------------------
+ { 61, -1, kVerbLook, 117, 173 },
+ // ----------------------------------
+ { 61, -1, kVerbMove, 117, 174 },
+ { 61, -1, kVerbOpen, 117, 174 },
+ { 62, -1, kVerbLook, 100, 168 },
+ { 62, -1, kVerbTalk, 100, 169 },
+ { 62, -1, kVerbPick, 100, 170 },
+ // ----------------------------------
+ { 62, -1, kVerbLook, 101, 171 },
+ // ----------------------------------
+ { 62, -1, kVerbLook, 102, 167 },
+ // ----------------------------------
+ { 62, -1, kVerbLook, 103, 166 },
+ // ==================================
+ { 63, -1, kVerbLook, 110, 172 },
+ // ----------------------------------
+ { 63, -1, kVerbLook, 109, 173 },
+ { 63, -1, kVerbMove, 109, 174 },
+ // ----------------------------------
+ { 63, -1, kVerbLook, 108, 334 },
+ { 63, -1, kVerbTalk, 108, 333 },
+ // ==================================
+ { 102, -1, kVerbLook, 100, 452 },
+ { 102, -1, kVerbLook, 101, 123 },
+ // ==================================
+ // Pseudoroom. checkAction() menuScreen == 1
+ { 200, 1, kVerbLook, 28, 328 },
+ // ----------------------------------
+ { 200, 2, kVerbLook, 28, 328 },
+ { 200, 2, kVerbLook, 7, 143 },
+ { 200, 2, kVerbLook, 8, 145 },
+ { 200, 2, kVerbLook, 9, 147 },
+ { 200, 2, kVerbLook, 10, 151 },
+ { 200, 2, kVerbLook, 11, 152 },
+ { 200, 2, kVerbLook, 12, 154 },
+ { 200, 2, kVerbLook, 13, 155 },
+ { 200, 2, kVerbLook, 14, 157 },
+ { 200, 2, kVerbLook, 15, 58 },
+ { 200, 2, kVerbLook, 16, 158 },
+ { 200, 2, kVerbLook, 17, 159 },
+ { 200, 2, kVerbLook, 18, 160 },
+ { 200, 2, kVerbLook, 19, 161 },
+ { 200, 2, kVerbLook, 23, 152 },
+ { 200, 2, kVerbTalk, 7, 144 },
+ { 200, 2, kVerbTalk, 8, 146 },
+ { 200, 2, kVerbTalk, 9, 148 },
+ { 200, 2, kVerbTalk, 11, 153 },
+ // ----------------------------------
+ { 200, 3, kVerbLook, 22, 307 },
+ { 200, 3, kVerbLook, 28, 328 },
+ { 200, 3, kVerbLook, 7, 143 },
+ { 200, 3, kVerbLook, 8, 145 },
+ { 200, 3, kVerbLook, 9, 147 },
+ { 200, 3, kVerbLook, 10, 151 },
+ { 200, 3, kVerbLook, 11, 152 },
+ { 200, 3, kVerbLook, 12, 154 },
+ { 200, 3, kVerbLook, 13, 155 },
+ { 200, 3, kVerbLook, 14, 157 },
+ { 200, 3, kVerbLook, 15, 58 },
+ { 200, 3, kVerbLook, 16, 158 },
+ { 200, 3, kVerbLook, 17, 159 },
+ { 200, 3, kVerbLook, 18, 160 },
+ { 200, 3, kVerbLook, 19, 161 },
+ { 200, 3, kVerbLook, 20, 162 },
+ { 200, 3, kVerbLook, 23, 152 },
+ { 200, 3, kVerbTalk, 7, 144 },
+ { 200, 3, kVerbTalk, 8, 146 },
+ { 200, 3, kVerbTalk, 9, 148 },
+ { 200, 3, kVerbTalk, 11, 153 },
+ // ----------------------------------
+ { 200, 4, kVerbLook, 7, 478 },
+ { 200, 4, kVerbLook, 8, 480 },
+ { 200, 4, kVerbLook, 10, 485 },
+ { 200, 4, kVerbLook, 11, 488 },
+ { 200, 4, kVerbLook, 12, 486 },
+ { 200, 4, kVerbLook, 13, 490 },
+ { 200, 4, kVerbLook, 14, 122 },
+ { 200, 4, kVerbLook, 15, 117 },
+ { 200, 4, kVerbLook, 16, 491 },
+ { 200, 4, kVerbLook, 17, 478 },
+ { 200, 4, kVerbLook, 18, 493 },
+ { 200, 4, kVerbLook, 20, 162 },
+ { 200, 4, kVerbLook, 21, 496 },
+ { 200, 4, kVerbLook, 22, 161 },
+ { 200, 4, kVerbLook, 28, 328 },
+ { 200, 4, kVerbTalk, 15, 118 },
+ { 200, 4, kVerbOpen, 15, 119 },
+ // ----------------------------------
+ { 200, 5, kVerbLook, 7, 478 },
+ { 200, 5, kVerbLook, 8, 120 },
+ { 200, 5, kVerbLook, 11, 488 },
+ { 200, 5, kVerbLook, 13, 490 },
+ { 200, 5, kVerbLook, 14, 121 },
+ { 200, 5, kVerbLook, 15, 117 },
+ { 200, 5, kVerbLook, 17, 478 },
+ { 200, 5, kVerbLook, 20, 162 },
+ { 200, 5, kVerbLook, 28, 328 },
+ { 200, 5, kVerbTalk, 15, 118 },
+ { 200, 5, kVerbOpen, 15, 119 },
+ // ----------------------------------
+ { 200, 6, kVerbLook, 20, 123 },
+ { 200, 6, kVerbLook, 21, 441 },
+ { 200, 6, kVerbLook, 28, 328 },
+ // ==================================
+ // Pseudoroom. checkAction() menuScreen != 1
+ { 201, 1, kVerbLook, 50, 308 },
+ { 201, 1, kVerbOpen, 50, 310 },
+ { 201, 1, kVerbClose, 50, 311 },
+ { 201, 1, kVerbMove, 50, 312 },
+ { 201, 1, kVerbPick, 50, 313 },
+ { 201, 1, kVerbTalk, 50, 314 },
+ // ----------------------------------
+ { 201, 2, kVerbLook, 50, 308 },
+ { 201, 2, kVerbOpen, 50, 310 },
+ { 201, 2, kVerbClose, 50, 311 },
+ { 201, 2, kVerbMove, 50, 312 },
+ { 201, 2, kVerbPick, 50, 313 },
+ { 201, 2, kVerbTalk, 50, 314 },
+ // ----------------------------------
+ { 201, 3, kVerbLook, 50, 309 },
+ { 201, 3, kVerbOpen, 50, 310 },
+ { 201, 3, kVerbClose, 50, 311 },
+ { 201, 3, kVerbMove, 50, 312 },
+ { 201, 3, kVerbPick, 50, 313 },
+ { 201, 3, kVerbTalk, 50, 314 },
+ // ----------------------------------
+ { 201, 4, kVerbLook, 50, 309 },
+ { 201, 4, kVerbOpen, 50, 310 },
+ { 201, 4, kVerbClose, 50, 311 },
+ { 201, 4, kVerbMove, 50, 312 },
+ { 201, 4, kVerbPick, 50, 313 },
+ { 201, 4, kVerbTalk, 50, 314 },
+ // ----------------------------------
+ { 201, 5, kVerbLook, 50, 309 }, // Originally these are with
+ { 201, 5, kVerbOpen, 50, 310 }, // completely wrong voices
+ { 201, 5, kVerbClose, 50, 311 },
+ { 201, 5, kVerbMove, 50, 312 },
+ { 201, 5, kVerbPick, 50, 313 },
+ { 201, 5, kVerbTalk, 50, 314 },
+ // ----------------------------------
+ { 201, 6, kVerbOpen, 50, 310 },
+ { 201, 6, kVerbClose, 50, 311 },
+ { 201, 6, kVerbMove, 50, 312 },
+ { 201, 6, kVerbPick, 50, 313 },
+ { 201, 6, kVerbTalk, 50, 314 },
+
};
const char *_text[][501] = {
{
// 0
"",
- "ITS THE SECOND BIGGEST DOOR I'VE SEEN IN MY LIFE",
+ "THAT'S THE SECOND BIGGEST DOOR I'VE SEEN IN MY LIFE",
"NOT REALLY",
"THE CHURCH IS ALL BOARDED UP, IT MUST HAVE BEEN ABANDONED SEVERAL YEARS AGO",
"I HAVEN'T OPENED IT",
@@ -302,7 +554,7 @@ const char *_text[][501] = {
"WHAT SHOULD I DO, SHOULD I PULL IT OFF?",
"HI THERE DOOR, I'M GOING TO MAKE YOU A DOOR-FRAME",
"IT'S TOO MUCH FOR ME",
- "THERE'S A WINDOW STOPPING THE GAME FROM WORKING PROPERLY",
+ "THE WINDOW IS BOARDED UP",
"I CAN'T",
// 10
"YES, THAT'S DONE",
@@ -332,7 +584,7 @@ const char *_text[][501] = {
"ITS LOCKED",
"I'VE GOT ONE",
"YOO HOO, UNCLE EVARISTO!",
- "THERE'S NO REPLY",
+ "THERE'S NO POWER",
"IT'S NOT WELL PARKED",
// 35
"IT'S A DOOR",
@@ -422,7 +674,7 @@ const char *_text[][501] = {
"HOW IS THE FAMILY?",
"THAT IS JUST LIKE YOU!",
"BUT HOW DO I GET THAT?",
- "MY RELIGION DOES NOT ALLOW ME",
+ "MY RELIGION DOES NOT ALLOW ME TO",
"IT'D BE BETTER NOT",
// 110
"YEAH, SURE MAN!",
@@ -438,8 +690,8 @@ const char *_text[][501] = {
"NO, IT MUST BE KEPT SOMEWHERE AWAY FROM THE MUTANT ACTION OF THE ATMOSPHERE",
// 120
"HE IS VERY STIFF, JUST LIKE MY BOSS",
- "A VERY SHARP STICK",
- "YOU FAITHFUL SHARP-PAINTED STICK, NOBLE TRANSILVANIAN OAK TREE",
+ "A VERY SHARP STAKE",
+ "YOU FAITHFUL SHARP-PAINTED STAKE, NOBLE TRANSILVANIAN OAK TREE",
"DAMN, I HAVE TO CUT MY NAILS!",
"B.J. IS IN THERE... SHE IS A REALLY HOT CHICK!",
// 125
@@ -453,7 +705,7 @@ const char *_text[][501] = {
"FORGET IT. I AM NOT GOING TO TELL HIM ANYTHING IN CASE HE GETS MAD",
"IT SEEMS QUITE RATIONAL",
"IT IS A PICTURE OF PLATO WRITING HIS LOST DIALOGUE",
- "I AM NOT ONE OF THOSE WHO TALKS TO POSTERS",
+ "I AM NOT ONE OF THOSE PEOPLE WHO TALKS TO POSTERS",
// 135
"THAT'S A VERY CUTE DESK",
"IT IS A VAMPIRES HUNTER'S DIPLOMA OFFICIALLY APPROVED BY OXFORD UNIVERSITY",
@@ -461,7 +713,7 @@ const char *_text[][501] = {
"IT SEEMS LIKE THESE SCREWS ARE NOT TIGHTENED PROPERLY",
"DON'T LOOK NOW, BUT I THINK THAT A HIDDEN CAMERA IS FOCUSING ON ME",
// 140
- "THAT'S A VERY MODERN STICK DETECTOR",
+ "THAT'S A VERY MODERN STAKE DETECTOR",
"NO. THE LABORATORY IS ON THE SECOND FLOOR",
"A NICE BEDSIDE TABLE",
"IT'S A LOT OF MONEY THAT CAN'T BE MISSING IN ANY VALUABLE ADVENTURE",
@@ -469,24 +721,24 @@ const char *_text[][501] = {
// 145
"THOSE ARE STRANGE LEAVES. THEY MUST HAVE BROUGHT THEM FROM SOUTH AMERICA OR AROUND THERE",
"I DON'T THINK THEY WOULD ANSWER ME",
- "THAT'S A BEAUTIFUL WOODEN CRUCIFIX. THE ICON DOESN'T REALLY SHOW THE BEAUTY WITHIN IT",
+ "THAT'S A BEAUTIFUL WOODEN CRUCIFIX. THE ICON DOESN'T REALLY SHOW THE FULL EXTENT OF ITS BEAUTY",
"I ONLY PRAY BEFORE I GO TO BED",
- "HEY, THIS PIKE SEEMS A LITTLE BIT LOOSE!",
+ "HEY, THIS SPIKE SEEMS A LITTLE BIT LOOSE!",
// 150
"I HOPE YOU WON'T COMPLAIN ABOUT NOT GETTING ANY CLUES FROM ME",
- "IT'S A QUITE CONVENTIONAL PIKE",
+ "IT'S A QUITE CONVENTIONAL SPIKE",
"THEY ARE CUTE, THOUGH THEY ARE COVERED WITH A LITTLE BIT OF SHIT",
"NO, THEY WON'T HEAR ME. HA,HA,HA THIS IS GREAT!",
"\"SLEEPING BEAUTY\" FROM TCHAIKOVSKY, OR CHOIFRUSKY, OR WHATEVER IT IS",
// 155
"VERY TEMPTING",
- "NO, I DO NOT PUT USED BUBBLE GUMS IN MY MOUTH",
+ "NO, I DO NOT PUT USED BUBBLE GUM IN MY MOUTH",
"THAT'S A VERY NICE SICKLE. I WONDER WHERE THE HAMMER IS",
"TOBACCO MANUFACTURERS WARN ABOUT HEALTH BEING SERIOUSLY DAMAGED BY SANITARY AUTHORITIES",
"AN ABSOLUTELY NORMAL CANDLE, INCLUDING WAX AND EVERYTHING",
// 160
- "THESE TWO SHINY COINS REALLY DO GLITTER!",
- "THIS SHINY COIN REALLY DOES GLITTER!",
+ "THESE TWO SHINY COINS REALLY GLITTER!",
+ "THIS SHINY COIN REALLY GLITTERS!",
"WITH THIS I WILL BE IMMUNE AGAINST VAMPIRE BITES",
"NO, IT'S IS NOT THE RIGHT MOMENT YET",
"THERE IS A ONE THOUSAND BILL AND A COUPLE OF COINS",
@@ -511,7 +763,7 @@ const char *_text[][501] = {
// 180
"A VERY NICE DOOR",
"IT'S CLOSED",
- "A COMPLETELY LOCKED BARREL",
+ "A COMPLETELY SEALED BARREL",
"",
"AREN'T THESE BUGS REALLY CUTE?",
// 185
@@ -519,19 +771,19 @@ const char *_text[][501] = {
"THERE IS NO ANSWER",
"THE MOON IS A SATELLITE THAT TURNS AROUND THE EARTH WITH A REVOLUTION PERIOD OF 28 DAYS",
"HI, LOONY MOON",
- "IT'S TOTALLY BLOCKED UP WITH PLANKS",
+ "IT'S TOTALLY BOARDED UP WITH PLANKS",
// 190
"IT'S IMPOSSIBLE. NOT EVEN THAT TOUGH GUY FROM TV COULD OPEN THIS",
"HEY! THE SHADOW OF THAT CYPRESS LOOKS PROLONGED TO ME!",
"YOU, BARTENDER...!!",
"I WOULD LIKE TO HAVE A ROOM PLEASE",
- "DO YOU KNOW WHERE I CAN FIND THE SO CALLED DRASCULA?",
+ "DO YOU KNOW WHERE I CAN FIND THE MAN CALLED DRASCULA?",
// 195
"YES, SO WHAT?",
"SO?",
"IS...THAT RIGHT?",
- "GOOD QUESTION. NOW, LET ME TELL YOU MY STORY. LOOK...",
- "IT'S JUST FIVE MINUTES",
+ "GOOD QUESTION. GET ME A DRINK AND LET ME TELL YOU MY STORY. LOOK...",
+ "IT WILL TAKE JUST FIVE MINUTES",
// 200
"I'M JOHN HACKER AND I REPRESENT A BRITISH PROPERTY COMPANY",
"AS FAR AS I KNOW, COUNT DRASCULA WANTS TO BUY SOME PIECES OF LAND IN GIBRALTAR AND MY COMPANY SENT ME HERE TO NEGOTIATE THE SALE",
@@ -549,9 +801,9 @@ const char *_text[][501] = {
"AND HOW IS THE FAMILY?",
"THIS IS QUITE GROOVY, HUH?",
"I'D BETTER NOT SAY ANYTHING",
- "THERE IS NO PLACE LIKE HOME. THERE IS NO...WHAT?, BUT YOU ARE NOT AUNT EMMA. AS A MATTER OF FACT, I DON'T HAVE ANY AUNT EMMA!",
+ "THERE IS NO PLACE LIKE HOME. THERE IS NO...WHAT?, BUT YOU ARE NOT AUNTIE EMMA. AS A MATTER OF FACT, I DON'T HAVE AN AUNTIE EMMA!",
// 215
- "YES, SO DOES MINE. YOU CAN CALL ME ANYTHING YOU WANT, BUT IF YOU CALL ME JHONNY, I'LL COME TO YOU LIKE A DOG",
+ "YES, SO DOES MINE. YOU CAN CALL ME ANYTHING YOU WANT, BUT IF YOU CALL ME JOHNNY, I'LL COME TO YOU LIKE A DOG",
"AREN'T I JUST A FUNNY GUY, HUH?. BY THE WAY, WHERE AM I?",
"YES",
"SHOOT...!",
@@ -569,13 +821,13 @@ const char *_text[][501] = {
"AHHH A WEREWOLF!! DIE YOU DAMNED EVIL!",
"YES, WELL...",
// 230
- "YES, WELL...I THINK I'LL JUST GO ON MY WAY. EXCUSE ME",
+ "YES, WELL... I THINK I'LL JUST GO ON MY WAY. EXCUSE ME",
"WHAT?",
"TO TELL YOU THE TRUTH...ON SECOND THOUGHTS...I DON'T REALLY THINK SO",
"AND SO TELL ME YOU ERUDITE PHILOSOPHER, IS THERE ANY RELATIONSHIP CAUSE-AND-EFFECT BETWEEN SILLY AND BILLY?",
"OK, OK, FORGET IT. I DON'T EVEN KNOW WHY I SAID ANYTHING ABOUT IT",
// 235
- "WHAT ARE YOU DOING PHILOSOPHIZING INSTEAD OF EATING SOME PEOPLE",
+ "WHY ARE YOU PHILOSOPHIZING INSTEAD OF EATING PEOPLE?",
"HOW COME?",
"HEY, COULD YOU SAY ALL THAT STUFF ABOUT PRE-EVOLUTIONARY RELATIONSHIPS AGAIN?",
"YES, MAN. ALL THAT STUFF YOU TOLD ME ABOUT BEFORE. I DIDN'T UNDERSTAND IT, YOU KNOW",
@@ -585,13 +837,13 @@ const char *_text[][501] = {
"YES, WHAT'S UP?",
"WELL, NOW THAT YOU MENTION IT, I'LL TELL YOU THAT...",
"",
- "WELL, THANKS FOR CALLING. BY THE WAY, THIS IS NOT THE CASE, OF COURSE, BUT WHAT COULD HAPPEN IF A VAMPIRE GOT THE RECIPE BY ANY CHANCE?",
+ "BY THE WAY, THIS IS NOT THE CASE, OF COURSE, BUT WHAT COULD HAPPEN IF A VAMPIRE GOT THE RECIPE BY ANY CHANCE?",
// 245
- "WELL ANYWAY. LISTEN, DOESN'T THIS LOOK TO YOU LIKE A LOT OF CRAP TO END UP SOON WITH THE GAME?. WELL, MAYBE NOT",
+ "WELL ANYWAY. LISTEN, DOESN'T THIS LOOK TO YOU LIKE A LOT OF CRAP TO END THE GAME WITH?. WELL, MAYBE NOT",
"IT'S EMPTY!",
- "WHY DID YOU TAKE MY ONLY LOVE, B.J., AWAY FROM ME?. LIFE HAS NO MEANING FOR WITHOUT HER",
+ "WHY DID YOU TAKE MY ONLY LOVE, B.J., AWAY FROM ME?. LIFE HAS NO MEANING FOR ME WITHOUT HER",
"HER BRAIN?\?!!",
- "TO TELL YOU THE TRUTH, I THINK I HAD JUST ENOUGH WITH YOUR OF YOUR LITTLE MONSTER",
+ "TO TELL YOU THE TRUTH, I THINK I HAVE HAD JUST ABOUT ENOUGH OF YOUR LITTLE MONSTER",
// 250
"OH PLEASE, HOLY VIRGIN, DON'T LET ANYTHING WORSE HAPPEN TO ME!!",
"YOU ARE NOT GOING TO GET YOUR WAY. I'M SURE SUPERMAN WILL COME AND RESCUE ME!",
@@ -600,7 +852,7 @@ const char *_text[][501] = {
"HA. HA, I'M NOW IMMUNIZED AGAINST YOU DAMNED EVIL!. THIS CIGARETTE IS AN ANTI-VAMPIRE BREW THAT VON BRAUN GAVE TO ME",
// 255
"YES SURE, BUT YOU'LL NEVER GET ME TO GIVE YOU THE RECIPE",
- "APART FROM CREATING TORTURE, I CAN ALSO STAND IT.",
+ "APART FROM CREATING TORTURE, I CAN ALSO WITHSTAND IT.",
"OH, NO PLEASE! I'LL TALK, BUT PLEASE, DON'T DO THAT TO ME!",
"ALL RIGHT THEN. I TOLD YOU WHAT YOU WANTED TO KNOW. NOW SET B.J. AND ME FREE THEN LEAVE US ALONE!",
"WHAT ARE YOU DOING HERE B.J.?. WHERE IS DRASCULA?",
@@ -800,10 +1052,10 @@ const char *_text[][501] = {
"THE MAGPIE WOULD PECK OUT MY EYES IF I TRIED!",
"OH MY GOD. IT'S LOCKED...THAT'S SCARY, HUH?",
"THE HINGES ARE RUSTY",
- "THERE IS ONLY ONE CAN OF FLOUR IN THERE",
+ "THERE IS ONLY ONE BAG OF FLOUR IN THERE",
"THAT TOOK AWAY THE RUST",
// 425
- "I FOUND A PINE STICK",
+ "I FOUND A PINE STAKE",
"I'LL TAKE THIS THICKER ONE",
"WELL, I THINK I CAN GET RID OF THIS STUPID DISGUISE",
"\"PASSAGE TO TOWERS CLOSED FOR REPAIRS. PLEASE USE THE MAIN ENTRANCE. SORRY FOR THE INCONVENIENCE\"",
@@ -3355,7 +3607,7 @@ const char *_textd[][84] = {
"OK, LET'S SEE IT. IGOR, BRING ME THE CD \"SCRATCHING YOUR NAILS ALL OVER THE BLACKBOARD\"",
"NO WAY. THE GIRL STAYS WITH ME. YOU'RE STAYING THERE UNTIL THE PENDULUM CUTS YOU INTO THIN SLICES. HA, HA, HA",
"MAN I'M I JUST BAD... COME ON IGOR, LET'S MAKE THE BREW AND CONQUER THE WORLD",
- "WHAT HAPPENS NOW?",
+ "WHAT HAPPENED NOW?",
"YES, WHAT?...OH, DAMNED, THE GAME!",
// 35
"I FORGOT ABOUT THAT. GET THE GIRL AND LET'S GO AND WATCH IT. WE CAN CONQUER THE WORLD LATER",
@@ -3941,7 +4193,7 @@ const char *_textbj[][29] = {
"ARE YOU ALL RIGHT? HEY, COME ON, WAKE UP! CAN YOU HEAR ME? ARE YOU DEAD?",
"NO, MY NAME IS BILLIE JEAN, BUT YOU CAN CALL ME B.J. IT'S SHORTER",
"HA, HA...! THAT WAS A GOOD ONE!",
- "WELL, JHONNY. YOU SEE, I WAS HERE JUST READY TO GO TO BED WHEN I HEARD THIS LOUD NOISE DOWN THE CORRIDOR",
+ "WELL, JOHNNY. YOU SEE, I WAS HERE JUST READY TO GO TO BED WHEN I HEARD THIS LOUD NOISE DOWN THE CORRIDOR",
// 5
"I DIDN'T PAY ATTENTION AT FIRST, BUT AFTER ABOUT TWO HOURS OR SO I COULDN'T SLEEP AND WENT OUT FOR A WALK",
"AS I OPENED THE DOOR I WAS SHOCKED TO FIND YOU THERE, LYING ON THE FLOOR. I THOUGHT YOU WERE DEAD, I SWEAR... HA, HA, SILLY BILLY",
@@ -3952,7 +4204,7 @@ const char *_textbj[][29] = {
"OH, NO...! IT WASN'T THE HIT, HA, HA. I JUST STEPPED ON YOUR GLASSES BY ACCIDENT",
"YOU REALLY LOOK GOOD WITH THOSE GLASSES. I KNOW HE'S NOT FERNANDO LANCHA, BUT I FIND HIM ATTRACTIVE...",
"YES, YES, I DO... COME ON, HOLD ME AND KISS ME TIGHT",
- "OH JHONNY, HONEY, THANK GOD YOU'RE HERE... THAT DAMNED DRASCULA TIED ME UP TO THE BED AND THEN HE'S GONE DOWNSTAIRS TO WATCH THE FOOTBALL GAME",
+ "OH JOHNNY, HONEY, THANK GOD YOU'RE HERE... THAT DAMNED DRASCULA TIED ME UP TO THE BED AND THEN HE'S GONE DOWNSTAIRS TO WATCH THE FOOTBALL GAME",
"YES, IT'S TRUE. PLEASE, SET ME FREE",
// 15
"NO, I'M SORRY. I USED THEM ALL IN THE TOWER WHEN I WAS TRYING TO ESCAPE WHILE YOU LET ME DOWN",
@@ -3961,7 +4213,7 @@ const char *_textbj[][29] = {
"FIRSTLY HE BROUGHT ME FLYING OVER HERE AND THEN PUT ME IN THIS DISGUSTING ROOM WITHOUT A MIRROR OR ANYTHING",
"I'M TELLING YOU! AND THE WORST PART IS THAT HE DIDN'T EVEN APOLOGIZE, NOT EVEN ONCE",
// 20
- "JHONNY HONEY, WHERE ARE YOU?",
+ "JOHNNY HONEY, WHERE ARE YOU?",
"I'M READY TO LEAVE DEAR",
"WAIT, I'M GOING TO TAKE A LOOK... NO DARLING, I'M SORRY",
"THERE YOU GO...",
@@ -3969,7 +4221,7 @@ const char *_textbj[][29] = {
// 25
"I'LL NEVER FORGET YOU BUT I'VE REALIZED THAT THIS JUST COULDN'T WORK OUT RIGHT. TO BE HONEST, I'LL TELL YOU THAT THERE IS ANOTHER MAN. HE'S TALLER, STRONGER",
"AND HE HAS ALSO RESCUED ME FROM DRASCULA. HE HAS ASKED ME TO MARRY HIM, AND I HAVE ACCEPTED",
- "BYE JHONNY. PLEASE DON'T TRY TO FIND SOME KIND OF EXPLANATION. YOU KNOW LOVE IS BLIND AND HAS ITS OWN WAYS",
+ "BYE JOHNNY. PLEASE DON'T TRY TO FIND SOME KIND OF EXPLANATION. YOU KNOW LOVE IS BLIND AND HAS ITS OWN WAYS",
"I HOPE THERE WON'T BE HARD FEELINGS BETWEEN US. REMEMBER THAT I STILL LOVE YOU, BUT ONLY AS A FRIEND",
},
{
@@ -4511,8 +4763,8 @@ const char *_textl[][32] = {
"WELL THEN",
"WELL, THAT DEPENDS ON WHAT WE TAKE A RELATIONSHIP FOR. SOME AUTHORS DEFEND...",
// 10
- "PUKE! HUNTING AS A WAY TO SURVIVE IS AN INCOMPATIBLE ARCHAIC THING FOR A SUPERIOR BEING LIKE ME. BESIDES, I'VE BECOME A VEGETARIAN",
- "IT JUST HAPPENS THAT I WAS ACTUALLY EATING A GUY AND I STARTED TO THINK AND GET TO THE ABOVE MENTIONED THOUGHT",
+ "YUCK! HUNTING AS A WAY TO SURVIVE IS AN INCOMPREHENSIBLE ARCHAIC THING FOR A SUPERIOR BEING LIKE ME. BESIDES, I'VE BECOME A VEGETARIAN",
+ "IT JUST SO HAPPENS THAT I WAS ACTUALLY EATING A GUY AND I STARTED TO THINK AND GET TO THE ABOVE MENTIONED THOUGHT",
"IT TOOK ME A LONG TIME TO QUIT OLD HABITS BUT AT LEAST MY IRASCIBLE SOUL BIT UP THE CONCUPISCIBLE ONE, AND EVER SINCE, I'VE NEVER EATEN MEAT AGAIN",
"NOT EVEN THE PLEASURE OF SUCKING UP THE BONE, FEELING THE TASTE OF THE SKIN AND THAT SWEET TASTE OF MARROW...THAT JUST TAKES YOU TO HEAVENLY PLACES",
"IT DOESN'T REALLY GET TO ME AT ALL",
@@ -4842,14 +5094,14 @@ const char *_textt[][25] = {
// 0
"",
"WHAT HAPPENED? WHAT'S THE MATTER?",
- "OK. ROOM 512. UPSTAIRS. THE KEY IS ON THE DOOR",
+ "OK. ROOM 512. UPSTAIRS. THE KEY IS UNDER THE DOOR",
"COUNT DRASCULA!!?",
- "NO, NOTHING. THAT GUY JUST HAS A BAD REPUTATION OVER HERE",
+ "NO, NOTHING. THAT GUY JUST HAS A BAD REPUTATION AROUND HERE",
// 5
"WELL, THERE ARE ALL KINDS OF STORIES GOING AROUND ABOUT HIM, SOME SAY HE IS A VAMPIRE WHO KIDNAPS PEOPLE TO SUCK THEIR BLOOD",
"HOWEVER, SOME OTHERS SAY THAT HE IS JUST AN ORGAN-DEALER AND THAT IS THE REASON WHY THERE ARE BODY PARTS ALL OVER THE PLACE",
"BUT OF COURSE, THOSE ARE JUST RUMORS. HE'S PROBABLY BOTH THINGS. BY THE WAY, WHY DO YOU WANT TO MEET HIM?",
- "NO, FORGET IT. I'M REALLY BUSY...",
+ "HERE IS YOUR DRINK, FORGET IT. I'M REALLY BUSY...",
"WELL, OK. BUT JUST BECAUSE I WANT TO DO IT, NOT BECAUSE YOU TOLD ME TO",
// 10
"THEY'RE WINNING",
@@ -5036,9 +5288,9 @@ const char *_textvb[][63] = {
// 25
"LEAVE ME ALONE NOW, I WANT TO GET SOME SLEEP",
"WHENEVER YOU ARE READY TO FIGHT AGAINST THE VAMPIRES, JUST COME BACK AND I'LL HELP YOU OUT",
- "OH, THAT'S EASY. JUST USING THE LIGHT OF ONE CRUCIFIX IS ENOUGH TO DESTROY HIM",
+ "OH, THAT'S EASY. TAKE THIS CRUCIFIX JUST USING THE LIGHT OF THIS CRUCIFIX IS ENOUGH TO DESTROY HIM",
"YOU HAVE TO BE EXTRA CAREFUL WITH DRASCULA, HIS FRISISNOTIC POWERS HAVE MADE OF HIM THE MOST POWERFUL VAMPIRE",
- "YOU'D BE LOST IF IT WASN'T FOR THEM...",
+ "YOU'D BE LOST IF IT WASN'T FOR THIS...",
// 30
"...BREW!",
"YEAH, YOU'RE RIGHT! I MIGHT HAVE SOME PROBLEMS WITH MY BACK IN THE FUTURE IF I KEEP ON SLEEPING THIS WAY",
@@ -5482,8 +5734,8 @@ const char *_textd1[][11] = {
// 75
"44447774444555500222205550444444466666225266444755444722255000222275555444446633223220044022203336227555770550444660557220553302224477777550550550222635533000662220002275572227025555",
"5555500004445550330244472225500022227555544444662755644446666005204402266222003332222774440446665555005550335544444",
- "56665004444447222550002222755554444466555033022755555000444444444444444444444444444444"
- "004447222550002222755554444466222000220555002220550444446666662220000557550033344477222522665444466663337446055504446550550550222633003330000666622044422755722270255566667555655007222777",
+ "56665004444447222550002222755554444466555033022755555000444444444444444444444444444444",
+ "004447222550002222755554444466222000220555002220550444446666662220000557550033344477222522665444466663337446055504446550550550222633003330000666622044422755722270255566667555655007222777"
},
{
// 68
@@ -5498,8 +5750,8 @@ const char *_textd1[][11] = {
// 75
"4444777444455550022220555044444446666622526644475533223220044022203336227555770550444660557220553302224477777550550550222635533000662220002275572227025555",
"5555000444555033022755644446666005204402266222003332222774440446665555005550335544444",
- "5666500444555033022755555000444444444444444444444444444444"
- "00222000220555002220550444446666662220000557550033344477222522665444466663337446055504446550550550222633003330000666622044422755722270255566667555655007222777",
+ "5666500444555033022755555000444444444444444444444444444444",
+ "00222000220555002220550444446666662220000557550033344477222522665444466663337446055504446550550550222633003330000666622044422755722270255566667555655007222777"
},
{
// 68
@@ -5514,8 +5766,8 @@ const char *_textd1[][11] = {
// 75
"44447774444555500222205550444444466666225266444755444722255000222275555444446633223220044022203336227555770550444660557220553302224477777550550550222635533000662220002275572227025555",
"5555500004445550330244472225500022227555544444662755644446666005204402266222003332222774440446665555005550335544444",
- "56665004444447222550002222755554444466555033022755555000444444444444444444444444444444"
- "004447222550002222755554444466222000220555002220550444446666662220000557550033344477222522665444466663337446055504446550550550222633003330000666622044422755722270255566667555655007222777",
+ "56665004444447222550002222755554444466555033022755555000444444444444444444444444444444",
+ "004447222550002222755554444466222000220555002220550444446666662220000557550033344477222522665444466663337446055504446550550550222633003330000666622044422755722270255566667555655007222777"
},
{
// 68
@@ -5530,8 +5782,8 @@ const char *_textd1[][11] = {
// 75
"44447774444555500222205550444444466666225266444755444722255000222275555444446633223220044022203336227555770550444660557220553302224477777550550550222635533000662220002275572227025555",
"5555500004445550330244472225500022227555544444662755644446666005204402266222003332222774440446665555005550335544444",
- "56665004444447222550002222755554444466555033022755555000444444444444444444444444444444"
- "004447222550002222755554444466222000220555002220550444446666662220000557550033344477222522665444466663337446055504446550550550222633003330000666622044422755722270255566667555655007222777",
+ "56665004444447222550002222755554444466555033022755555000444444444444444444444444444444",
+ "004447222550002222755554444466222000220555002220550444446666662220000557550033344477222522665444466663337446055504446550550550222633003330000666622044422755722270255566667555655007222777"
},
{
// 68
@@ -5546,8 +5798,8 @@ const char *_textd1[][11] = {
// 75
"44447774444555500222205550444444466666225266444755444722255000222275555444446633223220044022203336227555770550444660557220553302224477777550550550222635533000662220002275572227025555",
"5555500004445550330244472225500022227555544444662755644446666005204402266222003332222774440446665555005550335544444",
- "56665004444447222550002222755554444466555033022755555000444444444444444444444444444444"
- "004447222550002222755554444466222000220555002220550444446666662220000557550033344477222522665444466663337446055504446550550550222633003330000666622044422755722270255566667555655007222777",
+ "56665004444447222550002222755554444466555033022755555000444444444444444444444444444444",
+ "004447222550002222755554444466222000220555002220550444446666662220000557550033344477222522665444466663337446055504446550550550222633003330000666622044422755722270255566667555655007222777"
},
};
diff --git a/engines/drascula/talk.cpp b/engines/drascula/talk.cpp
index 40c5d4a1ab..108434fe9a 100644
--- a/engines/drascula/talk.cpp
+++ b/engines/drascula/talk.cpp
@@ -27,25 +27,21 @@
namespace Drascula {
+int x_talk_dch[6] = {1, 25, 49, 73, 97, 121};
+int x_talk_izq[6] = {145, 169, 193, 217, 241, 265};
+
void DrasculaEngine::talkInit(const char *filename) {
_rnd->setSeed((unsigned int)_system->getMillis() / 2);
- if (hay_sb == 1)
- playFile(filename);
+ playFile(filename);
}
bool DrasculaEngine::isTalkFinished(int* length) {
byte key = getScan();
if (key != 0)
stopSound();
- if (hay_sb == 1) {
- if (soundIsActive())
- return false;
- } else {
- length -= 2;
- if (length > 0)
- return false;
- }
+ if (soundIsActive())
+ return false;
return true;
}
@@ -112,7 +108,7 @@ void DrasculaEngine::talk_igor(int index, int talkerType) {
updateScreen();
} else if (talkerType == 3) {
copyBackground(x_talk3[face], 109, 207, 92, 21, 23, drawSurface3, screenSurface);
- pon_hare();
+ moveCharacters();
updateRefresh();
if (withVoices == 0)
centerText(said, 221, 102);
@@ -121,7 +117,7 @@ void DrasculaEngine::talk_igor(int index, int talkerType) {
pause(3);
} else if (talkerType == 4) {
copyBackground(x_talk4[face], 78, 199, 94, 38, 27, drawSurface3, screenSurface);
- pon_hare();
+ moveCharacters();
updateRefresh();
if (withVoices == 0)
centerText(said, 221, 102);
@@ -169,7 +165,7 @@ void DrasculaEngine::talk_drascula(int index, int talkerType) {
placeIgor();
placeDrascula();
if (currentChapter == 6)
- pon_hare();
+ moveCharacters();
copyBackground(x_dr, y_dr, x_dr, y_dr, 38 + offset, 31, drawSurface1, screenSurface);
if (currentChapter == 6)
@@ -198,7 +194,7 @@ void DrasculaEngine::talk_drascula(int index, int talkerType) {
placeDrascula();
if (talkerType == 1 && currentChapter == 6)
- pon_hare();
+ moveCharacters();
updateScreen();
}
@@ -278,7 +274,7 @@ void DrasculaEngine::talk_bartender(int index, int talkerType) {
copyBackground(x_talk[face], 2, 121, 44, 21, 24, extraSurface, screenSurface);
else
copyBackground(x_talk[face], 130, 151, 43, 21, 24, drawSurface3, screenSurface);
- pon_hare();
+ moveCharacters();
updateRefresh();
if (withVoices == 0)
@@ -318,7 +314,7 @@ void DrasculaEngine::talk_bj(int index) {
copyRect(x_talk[face], 99, x_bj + 2, y_bj - 1, 27, 40,
drawSurface3, screenSurface);
- pon_hare();
+ moveCharacters();
updateRefresh();
if (withVoices == 0)
@@ -348,13 +344,11 @@ void DrasculaEngine::talk(int index) {
}
void DrasculaEngine::talk(const char *said, const char *filename) {
- int suma_1_pixel = 0;
+ int talkOffset = 0;
if (currentChapter != 2)
- suma_1_pixel = 1;
+ talkOffset = 1;
int y_mask_talk = 170;
- int x_talk_dch[6] = { 1, 25, 49, 73, 97, 121 };
- int x_talk_izq[6] = { 145, 169, 193, 217, 241, 265 };
int face;
int length = strlen(said);
@@ -370,8 +364,8 @@ void DrasculaEngine::talk(const char *said, const char *filename) {
}
if (currentChapter != 2) {
- if (factor_red[hare_y + alto_hare] == 100)
- suma_1_pixel = 0;
+ if (factor_red[curY + curHeight] == 100)
+ talkOffset = 0;
}
if (currentChapter == 4) {
@@ -391,65 +385,65 @@ void DrasculaEngine::talk(const char *said, const char *filename) {
updateRefresh_pre();
if (currentChapter == 2)
- copyBackground(hare_x, hare_y, OBJWIDTH + 1, 0, ancho_hare, talkHeight - 1, screenSurface, drawSurface3);
+ copyBackground(curX, curY, OBJWIDTH + 1, 0, curWidth, talkHeight - 1, screenSurface, drawSurface3);
else
- copyBackground(hare_x, hare_y, OBJWIDTH + 1, 0, (int)(((float)ancho_hare / 100) * factor_red[hare_y + alto_hare]),
- (int)(((float)(talkHeight - 1) / 100) * factor_red[hare_y + alto_hare]),
+ copyBackground(curX, curY, OBJWIDTH + 1, 0, (int)(((float)curWidth / 100) * factor_red[curY + curHeight]),
+ (int)(((float)(talkHeight - 1) / 100) * factor_red[curY + curHeight]),
screenSurface, drawSurface3);
- pon_hare();
+ moveCharacters();
if (currentChapter == 2) {
if (!strcmp(menuBackground, "99.alg") || !strcmp(menuBackground, "994.alg"))
- copyBackground(OBJWIDTH + 1, 0, hare_x, hare_y, ancho_hare, talkHeight - 1, drawSurface3, screenSurface);
+ copyBackground(OBJWIDTH + 1, 0, curX, curY, curWidth, talkHeight - 1, drawSurface3, screenSurface);
} else {
- copyBackground(OBJWIDTH + 1, 0, hare_x, hare_y, (int)(((float)ancho_hare / 100) * factor_red[hare_y + alto_hare]),
- (int)(((float)(talkHeight - 1) / 100) * factor_red[hare_y + alto_hare]),
+ copyBackground(OBJWIDTH + 1, 0, curX, curY, (int)(((float)curWidth / 100) * factor_red[curY + curHeight]),
+ (int)(((float)(talkHeight - 1) / 100) * factor_red[curY + curHeight]),
drawSurface3, screenSurface);
}
- if (sentido_hare == 0) {
+ if (trackProtagonist == 0) {
if (currentChapter == 2)
- copyRect(x_talk_izq[face], y_mask_talk, hare_x + 8, hare_y - 1, talkWidth, talkHeight,
+ copyRect(x_talk_izq[face], y_mask_talk, curX + 8, curY - 1, talkWidth, talkHeight,
extraSurface, screenSurface);
else
- reduce_hare_chico(x_talk_izq[face], y_mask_talk, hare_x + (int)((8.0f / 100) * factor_red[hare_y + alto_hare]),
- hare_y, talkWidth, talkHeight, factor_red[hare_y + alto_hare],
+ reduce_hare_chico(x_talk_izq[face], y_mask_talk, curX + (int)((8.0f / 100) * factor_red[curY + curHeight]),
+ curY, talkWidth, talkHeight, factor_red[curY + curHeight],
extraSurface, screenSurface);
updateRefresh();
- } else if (sentido_hare == 1) {
+ } else if (trackProtagonist == 1) {
if (currentChapter == 2)
- copyRect(x_talk_dch[face], y_mask_talk, hare_x + 12, hare_y, talkWidth, talkHeight,
+ copyRect(x_talk_dch[face], y_mask_talk, curX + 12, curY, talkWidth, talkHeight,
extraSurface, screenSurface);
else
- reduce_hare_chico(x_talk_dch[face], y_mask_talk, hare_x + (int)((12.0f / 100) * factor_red[hare_y + alto_hare]),
- hare_y, talkWidth, talkHeight, factor_red[hare_y + alto_hare], extraSurface, screenSurface);
+ reduce_hare_chico(x_talk_dch[face], y_mask_talk, curX + (int)((12.0f / 100) * factor_red[curY + curHeight]),
+ curY, talkWidth, talkHeight, factor_red[curY + curHeight], extraSurface, screenSurface);
updateRefresh();
- } else if (sentido_hare == 2) {
+ } else if (trackProtagonist == 2) {
if (currentChapter == 2)
- copyRect(x_talk_izq[face], y_mask_talk, hare_x + 12, hare_y, talkWidth, talkHeight,
+ copyRect(x_talk_izq[face], y_mask_talk, curX + 12, curY, talkWidth, talkHeight,
frontSurface, screenSurface);
else
reduce_hare_chico(x_talk_izq[face], y_mask_talk,
- suma_1_pixel + hare_x + (int)((12.0f / 100) * factor_red[hare_y + alto_hare]),
- hare_y, talkWidth, talkHeight, factor_red[hare_y + alto_hare],
+ talkOffset + curX + (int)((12.0f / 100) * factor_red[curY + curHeight]),
+ curY, talkWidth, talkHeight, factor_red[curY + curHeight],
frontSurface, screenSurface);
updateRefresh();
- } else if (sentido_hare == 3) {
+ } else if (trackProtagonist == 3) {
if (currentChapter == 2)
- copyRect(x_talk_dch[face], y_mask_talk, hare_x + 8, hare_y, talkWidth, talkHeight,
+ copyRect(x_talk_dch[face], y_mask_talk, curX + 8, curY, talkWidth, talkHeight,
frontSurface, screenSurface);
else
reduce_hare_chico(x_talk_dch[face], y_mask_talk,
- suma_1_pixel + hare_x + (int)((8.0f / 100) * factor_red[hare_y + alto_hare]),
- hare_y, talkWidth,talkHeight, factor_red[hare_y + alto_hare],
+ talkOffset + curX + (int)((8.0f / 100) * factor_red[curY + curHeight]),
+ curY, talkWidth,talkHeight, factor_red[curY + curHeight],
frontSurface, screenSurface);
updateRefresh();
}
if (withVoices == 0)
- centerText(said, hare_x, hare_y);
+ centerText(said, curX, curY);
updateScreen();
@@ -486,7 +480,7 @@ void DrasculaEngine::talk_pianist(int index) {
copyBackground(x_talk[face], 139, 228, 112, 47, 60,
extraSurface, screenSurface);
- pon_hare();
+ moveCharacters();
updateRefresh();
if (withVoices == 0)
@@ -509,9 +503,8 @@ void DrasculaEngine::talk_drunk(int index) {
int face;
int length = strlen(said);
- if (currentChapter == 1) {
- loadPic("an11y13.alg", frontSurface, 1);
- }
+ if (currentChapter == 1)
+ loadPic("an11y13.alg", frontSurface);
flags[13] = 1;
@@ -532,7 +525,7 @@ void DrasculaEngine::talk_drunk(int index) {
updateRefresh_pre();
copyBackground(x_talk[face], 29, 177, 50, 19, 19, frontSurface, screenSurface);
- pon_hare();
+ moveCharacters();
updateRefresh();
if (withVoices == 0)
@@ -547,9 +540,8 @@ void DrasculaEngine::talk_drunk(int index) {
updateScreen();
flags[13] = 0;
- if (currentChapter == 1) {
- loadPic("96.alg", frontSurface, 1);
- }
+ if (currentChapter == 1)
+ loadPic("96.alg", frontSurface);
if (currentChapter == 1) {
if (musicStatus() == 0 && flags[11] == 0)
@@ -572,23 +564,23 @@ void DrasculaEngine::talk_vb(int index) {
talkInit(filename);
- copyBackground(vb_x + 5, 64, OBJWIDTH + 1, 0, 25, 27, drawSurface1, drawSurface3);
+ copyBackground(vbX + 5, 64, OBJWIDTH + 1, 0, 25, 27, drawSurface1, drawSurface3);
do {
- if (sentido_vb == 1) {
+ if (trackVB == 1) {
face = _rnd->getRandomNumber(5);
copyBackground(0, 0, 0, 0, 320, 200, drawSurface1, screenSurface);
- pon_hare();
- pon_vb();
+ moveCharacters();
+ moveVB();
- copyBackground(OBJWIDTH + 1, 0, vb_x + 5, 64, 25, 27, drawSurface3, screenSurface);
- copyRect(x_talk[face], 34, vb_x + 5, 64, 25, 27, frontSurface, screenSurface);
+ copyBackground(OBJWIDTH + 1, 0, vbX + 5, 64, 25, 27, drawSurface3, screenSurface);
+ copyRect(x_talk[face], 34, vbX + 5, 64, 25, 27, frontSurface, screenSurface);
updateRefresh();
}
if (withVoices == 0)
- centerText(said, vb_x, 66);
+ centerText(said, vbX, 66);
updateScreen();
@@ -633,7 +625,7 @@ void DrasculaEngine::talk_blind(int index) {
char filename[20];
sprintf(filename, "d%i.als", index + TEXTD_START - 1);
const char *said = _textd[_lang][index + TEXTD_START - 1];
- const char *sincronia = _textd1[_lang][index - 1];
+ const char *syncChar = _textd1[_lang][index - 1];
byte *faceBuffer;
int p = 0;
@@ -656,7 +648,7 @@ void DrasculaEngine::talk_blind(int index) {
do {
copyBackground(0, 0, 0, 0, 320, 200, drawSurface1, screenSurface);
pos_blind[5] = 149;
- char c = toupper(sincronia[p]);
+ char c = toupper(syncChar[p]);
if (c == '0' || c == '2' || c == '4' || c == '6')
pos_blind[0] = 1;
@@ -722,7 +714,7 @@ void DrasculaEngine::talk_wolf(int index) {
updateRefresh_pre();
copyBackground(x_talk[face], 136, 198, 81, 26, 24, drawSurface3, screenSurface);
- pon_hare();
+ moveCharacters();
updateRefresh();
if (withVoices == 0)
@@ -757,7 +749,7 @@ void DrasculaEngine::talk_mus(int index) {
updateRefresh_pre();
copyBackground(x_talk[face], 156, 190, 64, 18, 24, drawSurface3, screenSurface);
- pon_hare();
+ moveCharacters();
updateRefresh();
if (withVoices == 0)
@@ -846,7 +838,7 @@ void DrasculaEngine::talk_bj_bed(int index) {
copyBackground(65, 103, 65, 103, 49, 38, drawSurface1, screenSurface);
copyRect(x_talk[face], 105, 65, 103, 49, 38, drawSurface3, screenSurface);
- pon_hare();
+ moveCharacters();
updateRefresh();
if (withVoices == 0)
@@ -900,19 +892,18 @@ void DrasculaEngine::talk_htel(int index) {
updateScreen();
}
-void DrasculaEngine::talk_sinc(const char *said, const char *filename, const char *sincronia) {
- int suma_1_pixel = 1;
+void DrasculaEngine::talk_sync(const char *said, const char *filename, const char *syncChar) {
+ int talkOffset = 1;
int y_mask_talk = 170;
- int x_talk_dch[6] = {1, 25, 49, 73, 97, 121};
- int x_talk_izq[6] = {145, 169, 193, 217, 241, 265};
int p, face = 0;
int length = strlen(said);
+ char buf[2];
color_abc(kColorYellow);
if (currentChapter == 1) {
- if (factor_red[hare_y + alto_hare] == 100)
- suma_1_pixel = 0;
+ if (factor_red[curY + curHeight] == 100)
+ talkOffset = 0;
}
p = 0;
@@ -920,58 +911,59 @@ void DrasculaEngine::talk_sinc(const char *said, const char *filename, const cha
talkInit(filename);
do {
- face = atoi(&sincronia[p]);
+ strncpy(buf, &syncChar[p], 1);
+ face = atoi(buf);
copyBackground(0, 0, 0, 0, 320, 200, drawSurface1, screenSurface);
updateRefresh_pre();
if (currentChapter == 2)
- copyBackground(hare_x, hare_y, OBJWIDTH + 1, 0, ancho_hare, talkHeight - 1, screenSurface, drawSurface3);
+ copyBackground(curX, curY, OBJWIDTH + 1, 0, curWidth, talkHeight - 1, screenSurface, drawSurface3);
else
- copyBackground(hare_x, hare_y, OBJWIDTH + 1, 0, (int)(((float)ancho_hare / 100) * factor_red[hare_y + alto_hare]),
- (int)(((float)(talkHeight - 1) / 100) * factor_red[hare_y + alto_hare]), screenSurface, drawSurface3);
- pon_hare();
+ copyBackground(curX, curY, OBJWIDTH + 1, 0, (int)(((float)curWidth / 100) * factor_red[curY + curHeight]),
+ (int)(((float)(talkHeight - 1) / 100) * factor_red[curY + curHeight]), screenSurface, drawSurface3);
+ moveCharacters();
if (currentChapter == 2) {
- if (alto_hare != 56)
- copyBackground(OBJWIDTH + 1, 0, hare_x, hare_y, ancho_hare, talkHeight - 1, drawSurface3, screenSurface);
+ if (curHeight != 56)
+ copyBackground(OBJWIDTH + 1, 0, curX, curY, curWidth, talkHeight - 1, drawSurface3, screenSurface);
} else
- copyBackground(OBJWIDTH + 1, 0, hare_x, hare_y, (int)(((float)ancho_hare / 100) * factor_red[hare_y + alto_hare]),
- (int)(((float)(talkHeight - 1) / 100) * factor_red[hare_y + alto_hare]), drawSurface3, screenSurface);
+ copyBackground(OBJWIDTH + 1, 0, curX, curY, (int)(((float)curWidth / 100) * factor_red[curY + curHeight]),
+ (int)(((float)(talkHeight - 1) / 100) * factor_red[curY + curHeight]), drawSurface3, screenSurface);
- if (sentido_hare == 0) {
+ if (trackProtagonist == 0) {
if (currentChapter == 2)
- copyRect(x_talk_izq[face], y_mask_talk, hare_x + 8, hare_y - 1, talkWidth, talkHeight, extraSurface, screenSurface);
+ copyRect(x_talk_izq[face], y_mask_talk, curX + 8, curY - 1, talkWidth, talkHeight, extraSurface, screenSurface);
else
- reduce_hare_chico(x_talk_izq[face], y_mask_talk, (int)(hare_x + (8.0f / 100) * factor_red[hare_y + alto_hare]),
- hare_y, talkWidth, talkHeight, factor_red[hare_y + alto_hare], extraSurface, screenSurface);
+ reduce_hare_chico(x_talk_izq[face], y_mask_talk, (int)(curX + (8.0f / 100) * factor_red[curY + curHeight]),
+ curY, talkWidth, talkHeight, factor_red[curY + curHeight], extraSurface, screenSurface);
updateRefresh();
- } else if (sentido_hare == 1) {
+ } else if (trackProtagonist == 1) {
if (currentChapter == 2)
- copyRect(x_talk_dch[face], y_mask_talk, hare_x + 12, hare_y, talkWidth, talkHeight, extraSurface, screenSurface);
+ copyRect(x_talk_dch[face], y_mask_talk, curX + 12, curY, talkWidth, talkHeight, extraSurface, screenSurface);
else
- reduce_hare_chico(x_talk_dch[face], y_mask_talk, (int)(hare_x + (12.0f / 100) * factor_red[hare_y + alto_hare]),
- hare_y, talkWidth, talkHeight, factor_red[hare_y + alto_hare], extraSurface, screenSurface);
+ reduce_hare_chico(x_talk_dch[face], y_mask_talk, (int)(curX + (12.0f / 100) * factor_red[curY + curHeight]),
+ curY, talkWidth, talkHeight, factor_red[curY + curHeight], extraSurface, screenSurface);
updateRefresh();
- } else if (sentido_hare == 2) {
+ } else if (trackProtagonist == 2) {
if (currentChapter == 2)
- copyRect(x_talk_izq[face], y_mask_talk, hare_x + 12, hare_y, talkWidth, talkHeight, frontSurface, screenSurface);
+ copyRect(x_talk_izq[face], y_mask_talk, curX + 12, curY, talkWidth, talkHeight, frontSurface, screenSurface);
else
reduce_hare_chico(x_talk_izq[face], y_mask_talk,
- (int)(suma_1_pixel + hare_x + (12.0f / 100) * factor_red[hare_y + alto_hare]), hare_y,
- talkWidth, talkHeight, factor_red[hare_y + alto_hare], frontSurface, screenSurface);
+ (int)(talkOffset + curX + (12.0f / 100) * factor_red[curY + curHeight]), curY,
+ talkWidth, talkHeight, factor_red[curY + curHeight], frontSurface, screenSurface);
updateRefresh();
- } else if (sentido_hare == 3) {
+ } else if (trackProtagonist == 3) {
if (currentChapter == 2)
- copyRect(x_talk_dch[face], y_mask_talk, hare_x + 8, hare_y, talkWidth, talkHeight, frontSurface, screenSurface);
+ copyRect(x_talk_dch[face], y_mask_talk, curX + 8, curY, talkWidth, talkHeight, frontSurface, screenSurface);
else
reduce_hare_chico(x_talk_dch[face], y_mask_talk,
- (int)(suma_1_pixel + hare_x + (8.0f / 100) * factor_red[hare_y + alto_hare]), hare_y,
- talkWidth, talkHeight, factor_red[hare_y + alto_hare], frontSurface, screenSurface);
+ (int)(talkOffset + curX + (8.0f / 100) * factor_red[curY + curHeight]), curY,
+ talkWidth, talkHeight, factor_red[curY + curHeight], frontSurface, screenSurface);
updateRefresh();
}
if (withVoices == 0)
- centerText(said, hare_x, hare_y);
+ centerText(said, curX, curY);
updateScreen();
diff --git a/engines/kyra/kyra_mr.cpp b/engines/kyra/kyra_mr.cpp
index c842e318ec..8a49b8e155 100644
--- a/engines/kyra/kyra_mr.cpp
+++ b/engines/kyra/kyra_mr.cpp
@@ -59,7 +59,7 @@ const KyraEngine_v2::EngineDesc KyraEngine_MR::_mrEngineDesc = {
KyraEngine_MR::KyraEngine_MR(OSystem *system, const GameFlags &flags) : KyraEngine_v2(system, flags, _mrEngineDesc) {
_soundDigital = 0;
_musicSoundChannel = -1;
- _menuAudioFile = "TITLE1.AUD";
+ _menuAudioFile = "TITLE1";
_lastMusicCommand = -1;
_itemBuffer1 = _itemBuffer2 = 0;
_scoreFile = 0;
@@ -425,7 +425,7 @@ void KyraEngine_MR::snd_playWanderScoreViaMap(int track, int force) {
assert(track < _soundListSize && track >= 0);
char file[13];
- sprintf(file, "%s.AUD", _soundList[track]);
+ sprintf(file, "%s", _soundList[track]);
_musicSoundChannel = _soundDigital->playSound(file, 0xFF, Audio::Mixer::kMusicSoundType);
}
@@ -483,7 +483,7 @@ void KyraEngine_MR::snd_playSoundEffect(int item, int volume) {
if (_sfxFileMap[item*2+0] != 0xFF) {
char filename[16];
assert(_sfxFileMap[item*2+0] < _sfxFileListSize);
- snprintf(filename, 16, "%s.AUD", _sfxFileList[_sfxFileMap[item*2+0]]);
+ snprintf(filename, 16, "%s", _sfxFileList[_sfxFileMap[item*2+0]]);
uint8 priority = _sfxFileMap[item*2+1];
_soundDigital->playSound(filename, priority, Audio::Mixer::kSFXSoundType, volume);
@@ -498,7 +498,7 @@ void KyraEngine_MR::playVoice(int high, int low) {
void KyraEngine_MR::snd_playVoiceFile(int file) {
debugC(9, kDebugLevelMain, "KyraEngine_MR::snd_playVoiceFile(%d)", file);
char filename[16];
- snprintf(filename, 16, "%u.AUD", (uint)file);
+ snprintf(filename, 16, "%.08u", (uint)file);
_voiceSoundChannel = _soundDigital->playSound(filename, 0xFE, Audio::Mixer::kSpeechSoundType, 255);
}
diff --git a/engines/kyra/resource.cpp b/engines/kyra/resource.cpp
index 46c73c9d3b..01702f08b3 100644
--- a/engines/kyra/resource.cpp
+++ b/engines/kyra/resource.cpp
@@ -543,6 +543,20 @@ bool ResLoaderPak::isLoadable(const Common::String &filename, Common::SeekableRe
return true;
}
+namespace {
+
+Common::String readString(Common::SeekableReadStream &stream) {
+ Common::String result;
+ char c = 0;
+
+ while ((c = stream.readByte()) != 0)
+ result += c;
+
+ return result;
+}
+
+} // end of anonymous namespace
+
bool ResLoaderPak::loadFile(const Common::String &filename, Common::SeekableReadStream &stream, FileList &files) const {
uint32 filesize = stream.size();
@@ -610,6 +624,33 @@ bool ResLoaderPak::loadFile(const Common::String &filename, Common::SeekableRead
startoffset = endoffset;
}
+ FileList::const_iterator iter = Common::find(files.begin(), files.end(), Common::String("LINKLIST"));
+ if (iter != files.end()) {
+ stream.seek(iter->entry.offset, SEEK_SET);
+
+ uint32 magic = stream.readUint32BE();
+
+ if (magic != MKID_BE('SCVM'))
+ error("LINKLIST file does not contain 'SCVM' header");
+
+ uint32 links = stream.readUint32BE();
+ for (uint i = 0; i < links; ++i) {
+ Common::String linksTo = readString(stream);
+ uint32 sources = stream.readUint32BE();
+
+ iter = Common::find(files.begin(), files.end(), linksTo);
+ if (iter == files.end())
+ error("PAK file link destination '%s' not found", linksTo.c_str());
+
+ for (uint j = 0; j < sources; ++j) {
+ Common::String dest = readString(stream);
+ files.push_back(File(dest, iter->entry));
+ // Better safe than sorry, we update the 'iter' value, in case push_back invalidated it
+ iter = Common::find(files.begin(), files.end(), linksTo);
+ }
+ }
+ }
+
return true;
}
@@ -767,7 +808,7 @@ bool ResLoaderTlk::loadFile(const Common::String &filename, Common::SeekableRead
entry.offset = resOffset+4;
char realFilename[20];
- snprintf(realFilename, 20, "%u.AUD", resFilename);
+ snprintf(realFilename, 20, "%.08u.AUD", resFilename);
uint32 curOffset = stream.pos();
stream.seek(resOffset, SEEK_SET);
diff --git a/engines/kyra/resource.h b/engines/kyra/resource.h
index 167ccd7943..d43f730e6b 100644
--- a/engines/kyra/resource.h
+++ b/engines/kyra/resource.h
@@ -75,6 +75,10 @@ public:
File() : filename(), entry() {}
File(const Common::String &f, const ResFileEntry &e) : filename(f), entry(e) {}
+ bool operator ==(const Common::String &r) const {
+ return filename.equalsIgnoreCase(r);
+ }
+
Common::String filename;
ResFileEntry entry;
};
diff --git a/engines/kyra/sound.cpp b/engines/kyra/sound.cpp
index 8f9077705e..f56c43aabd 100644
--- a/engines/kyra/sound.cpp
+++ b/engines/kyra/sound.cpp
@@ -50,9 +50,9 @@ Sound::~Sound() {
bool Sound::voiceFileIsPresent(const char *file) {
char filenamebuffer[25];
- for (int i = 0; _supportedCodes[i].fileext; ++i) {
+ for (int i = 0; _supportedCodecs[i].fileext; ++i) {
strcpy(filenamebuffer, file);
- strcat(filenamebuffer, _supportedCodes[i].fileext);
+ strcat(filenamebuffer, _supportedCodecs[i].fileext);
if (_vm->resource()->getFileSize(filenamebuffer) > 0)
return true;
}
@@ -77,14 +77,14 @@ int32 Sound::voicePlay(const char *file, bool isSfx) {
Audio::AudioStream *audioStream = 0;
- for (int i = 0; _supportedCodes[i].fileext; ++i) {
+ for (int i = 0; _supportedCodecs[i].fileext; ++i) {
strcpy(filenamebuffer, file);
- strcat(filenamebuffer, _supportedCodes[i].fileext);
+ strcat(filenamebuffer, _supportedCodecs[i].fileext);
Common::SeekableReadStream *stream = _vm->resource()->getFileStream(filenamebuffer);
if (!stream)
continue;
- audioStream = _supportedCodes[i].streamFunc(stream, true, 0, 0, 1);
+ audioStream = _supportedCodecs[i].streamFunc(stream, true, 0, 0, 1);
break;
}
@@ -551,7 +551,7 @@ bool KyraEngine_v1::snd_voiceIsPlaying() {
// static res
-const Sound::SpeechCodecs Sound::_supportedCodes[] = {
+const Sound::SpeechCodecs Sound::_supportedCodecs[] = {
#ifdef USE_FLAC
{ ".VOF", Audio::makeFlacStream },
#endif // USE_FLAC
diff --git a/engines/kyra/sound.h b/engines/kyra/sound.h
index 2427a6cdde..1baeb3064a 100644
--- a/engines/kyra/sound.h
+++ b/engines/kyra/sound.h
@@ -232,7 +232,7 @@ private:
uint numLoops);
};
- static const SpeechCodecs _supportedCodes[];
+ static const SpeechCodecs _supportedCodecs[];
};
class AdlibDriver;
@@ -498,6 +498,7 @@ private:
// Digital Audio
class AUDStream;
+class KyraAudioStream;
class KyraEngine_MR;
/**
@@ -564,8 +565,20 @@ private:
char filename[16];
uint8 priority;
- AUDStream *stream;
+ KyraAudioStream *stream;
} _sounds[4];
+
+ struct AudioCodecs {
+ const char *fileext;
+ Audio::AudioStream *(*streamFunc)(
+ Common::SeekableReadStream *stream,
+ bool disposeAfterUse,
+ uint32 startTime,
+ uint32 duration,
+ uint numLoops);
+ };
+
+ static const AudioCodecs _supportedCodecs[];
};
} // end of namespace Kyra
diff --git a/engines/kyra/sound_digital.cpp b/engines/kyra/sound_digital.cpp
index bac7d67129..20f3a7f9f9 100644
--- a/engines/kyra/sound_digital.cpp
+++ b/engines/kyra/sound_digital.cpp
@@ -29,8 +29,79 @@
#include "sound/audiostream.h"
+#include "sound/mp3.h"
+#include "sound/vorbis.h"
+#include "sound/flac.h"
+
namespace Kyra {
+class KyraAudioStream : public Audio::AudioStream {
+public:
+ KyraAudioStream(Audio::AudioStream *impl) : _impl(impl), _rate(impl->getRate()), _fadeSamples(0), _fadeCount(0), _fading(0), _endOfData(false) {}
+ ~KyraAudioStream() { delete _impl; _impl = 0; }
+
+ int readBuffer(int16 *buffer, const int numSamples);
+ bool isStereo() const { return _impl->isStereo(); }
+ bool endOfData() const { return _impl->endOfData() | _endOfData; }
+ int getRate() const { return _rate; }
+ int32 getTotalPlayTime() const { return _impl->getTotalPlayTime(); }
+
+ void setRate(int newRate) { _rate = newRate; }
+ void beginFadeOut(uint32 millis);
+private:
+ Audio::AudioStream *_impl;
+
+ int _rate;
+
+ int32 _fadeSamples;
+ int32 _fadeCount;
+ int _fading;
+
+ bool _endOfData;
+};
+
+void KyraAudioStream::beginFadeOut(uint32 millis) {
+ _fadeSamples = (millis * getRate()) / 1000;
+ if (_fading == 0)
+ _fadeCount = _fadeSamples;
+ _fading = -1;
+}
+
+int KyraAudioStream::readBuffer(int16 *buffer, const int numSamples) {
+ int samplesRead = _impl->readBuffer(buffer, numSamples);
+
+ if (_fading) {
+ int samplesProcessed = 0;
+ for (; samplesProcessed < samplesRead; ++samplesProcessed) {
+ // To help avoid overflows for long fade times, we divide both
+ // _fadeSamples and _fadeCount when calculating the new sample.
+
+ int32 div = _fadeSamples / 256;
+ if (_fading) {
+ *buffer = (*buffer * (_fadeCount / 256)) / div;
+ ++buffer;
+
+ _fadeCount += _fading;
+
+ if (_fadeCount < 0) {
+ _fadeCount = 0;
+ _endOfData = true;
+ } else if (_fadeCount > _fadeSamples) {
+ _fadeCount = _fadeSamples;
+ _fading = 0;
+ }
+ }
+ }
+
+ if (_endOfData) {
+ memset(buffer, 0, (samplesRead - samplesProcessed) * sizeof(int16));
+ samplesRead = samplesProcessed;
+ }
+ }
+
+ return samplesRead;
+}
+
// Thanks to Torbjorn Andersson (eriktorbjorn) for his aud player on which
// this code is based on
@@ -46,11 +117,7 @@ public:
bool isStereo() const { return false; }
bool endOfData() const { return _endOfData; }
- void setRate(int newRate) { _rate = newRate; }
int getRate() const { return _rate; }
-
- void beginFadeIn(uint32 millis);
- void beginFadeOut(uint32 millis);
private:
Common::SeekableReadStream *_stream;
bool _loop;
@@ -69,10 +136,6 @@ private:
byte *_inBuffer;
uint _inBufferSize;
- int32 _fadeSamples;
- int32 _fadeCount;
- int _fading;
-
int readChunk(int16 *buffer, const int maxSamples);
static const int8 WSTable2Bit[];
@@ -93,9 +156,6 @@ AUDStream::AUDStream(Common::SeekableReadStream *stream, bool loop) : _stream(st
_totalSize = _stream->readUint32LE();
_loop = loop;
- _fadeSamples = 0;
- _fading = 0;
-
// TODO?: add checks
int flags = _stream->readByte(); // flags
int type = _stream->readByte(); // type
@@ -114,20 +174,6 @@ AUDStream::~AUDStream() {
delete _stream;
}
-void AUDStream::beginFadeIn(uint32 millis) {
- _fadeSamples = (millis * getRate()) / 1000;
- if (_fading == 0)
- _fadeCount = 0;
- _fading = 1;
-}
-
-void AUDStream::beginFadeOut(uint32 millis) {
- _fadeSamples = (millis * getRate()) / 1000;
- if (_fading == 0)
- _fadeCount = _fadeSamples;
- _fading = -1;
-}
-
int AUDStream::readBuffer(int16 *buffer, const int numSamples) {
int samplesRead = 0, samplesLeft = numSamples;
@@ -288,34 +334,13 @@ int AUDStream::readChunk(int16 *buffer, const int maxSamples) {
samplesProcessed += samples;
_bytesLeft -= samples;
- // To help avoid overflows for long fade times, we divide both
- // _fadeSamples and _fadeCount when calculating the new sample.
-
- int32 div = _fadeSamples / 256;
-
while (samples--) {
int16 sample = (_outBuffer[_outBufferOffset++] << 8) ^ 0x8000;
- if (_fading) {
- sample = (sample * (_fadeCount / 256)) / div;
- _fadeCount += _fading;
-
- if (_fadeCount < 0) {
- _fadeCount = 0;
- _endOfData = true;
- } else if (_fadeCount > _fadeSamples) {
- _fadeCount = _fadeSamples;
- _fading = 0;
- }
- }
-
*buffer++ = sample;
}
}
- if (_fading < 0 && _fadeCount == 0)
- _fading = 0;
-
return samplesProcessed;
}
@@ -367,7 +392,19 @@ int SoundDigital::playSound(const char *filename, uint8 priority, Audio::Mixer::
}
}
- Common::SeekableReadStream *stream = _vm->resource()->getFileStream(filename);
+ Common::SeekableReadStream *stream = 0;
+ int usedCodec = -1;
+ for (int i = 0; _supportedCodecs[i].fileext; ++i) {
+ Common::String file = filename;
+ file += _supportedCodecs[i].fileext;
+
+ if (!_vm->resource()->exists(file.c_str()))
+ continue;
+
+ stream = _vm->resource()->getFileStream(file);
+ usedCodec = i;
+ }
+
if (!stream) {
warning("Couldn't find soundfile '%s'", filename);
return -1;
@@ -375,7 +412,13 @@ int SoundDigital::playSound(const char *filename, uint8 priority, Audio::Mixer::
strncpy(use->filename, filename, sizeof(use->filename));
use->priority = priority;
- use->stream = new AUDStream(stream, loop);
+ Audio::AudioStream *audioStream = _supportedCodecs[usedCodec].streamFunc(stream, true, 0, 0, loop ? 0 : 1);
+ if (!audioStream) {
+ warning("Couldn't create audio stream for file '%s'", filename);
+ return -1;
+ }
+ use->stream = new KyraAudioStream(audioStream);
+ assert(use->stream);
if (use->stream->endOfData()) {
delete use->stream;
use->stream = 0;
@@ -428,5 +471,30 @@ void SoundDigital::beginFadeOut(int channel, int ticks) {
_sounds[channel].stream->beginFadeOut(ticks * _vm->tickLength());
}
+// static res
+
+namespace {
+
+Audio::AudioStream *makeAUDStream(Common::SeekableReadStream *stream, bool disposeAfterUse, uint32 startTime, uint32 duration, uint numLoops) {
+ return new AUDStream(stream, numLoops == 0 ? true : false);
+}
+
+} // end of anonymous namespace
+
+const SoundDigital::AudioCodecs SoundDigital::_supportedCodecs[] = {
+#ifdef USE_FLAC
+ { ".FLA", Audio::makeFlacStream },
+#endif // USE_FLAC
+#ifdef USE_VORBIS
+ { ".OGG", Audio::makeVorbisStream },
+#endif // USE_VORBIS
+#ifdef USE_MAD
+ { ".MP3", Audio::makeMP3Stream },
+#endif // USE_MAD
+ { ".AUD", makeAUDStream },
+ { 0, 0 }
+};
+
+
} // end of namespace Kyra
diff --git a/engines/parallaction/disk.h b/engines/parallaction/disk.h
index 21ff4aba76..b76c66aead 100644
--- a/engines/parallaction/disk.h
+++ b/engines/parallaction/disk.h
@@ -209,7 +209,7 @@ protected:
protected:
void errorFileNotFound(const char *s);
Font *createFont(const char *name, Common::ReadStream &stream);
- Sprites* createSprites(const char *name);
+ Sprites* createSprites(Common::ReadStream &stream);
void loadBitmap(Common::SeekableReadStream &stream, Graphics::Surface &surf, byte *palette);
public:
diff --git a/engines/parallaction/disk_br.cpp b/engines/parallaction/disk_br.cpp
index e4c4ce7492..5e88327879 100644
--- a/engines/parallaction/disk_br.cpp
+++ b/engines/parallaction/disk_br.cpp
@@ -139,12 +139,19 @@ DosDisk_br::~DosDisk_br() {
}
Frames* DosDisk_br::loadTalk(const char *name) {
- debugC(5, kDebugDisk, "DosDisk_br::loadTalk");
+ debugC(5, kDebugDisk, "DosDisk_br::loadTalk(%s)", name);
+
+ Common::File stream;
char path[PATH_LEN];
- sprintf(path, "%s/tal/%s.tal", _partPath, name);
+ sprintf(path, "%s/tal/%s", _partPath, name);
+ if (!stream.open(path)) {
+ sprintf(path, "%s/tal/%s.tal", _partPath, name);
+ if (!stream.open(path))
+ errorFileNotFound(path);
+ }
- return createSprites(path);
+ return createSprites(stream);
}
Script* DosDisk_br::loadLocation(const char *name) {
@@ -252,12 +259,7 @@ Frames* DosDisk_br::loadStatic(const char* name) {
return new SurfaceToFrames(surf);
}
-Sprites* DosDisk_br::createSprites(const char *path) {
-
- Common::File stream;
- if (!stream.open(path)) {
- errorFileNotFound(path);
- }
+Sprites* DosDisk_br::createSprites(Common::ReadStream &stream) {
uint16 num = stream.readUint16LE();
@@ -284,7 +286,12 @@ Frames* DosDisk_br::loadFrames(const char* name) {
char path[PATH_LEN];
sprintf(path, "%s/ani/%s", _partPath, name);
- return createSprites(path);
+ Common::File stream;
+ if (!stream.open(path))
+ errorFileNotFound(path);
+
+
+ return createSprites(stream);
}
// Slides in Nippon Safes are basically screen-sized pictures with valid
diff --git a/engines/parallaction/exec_br.cpp b/engines/parallaction/exec_br.cpp
index 2aeec6358d..3b67b4c370 100644
--- a/engines/parallaction/exec_br.cpp
+++ b/engines/parallaction/exec_br.cpp
@@ -176,7 +176,8 @@ DECLARE_COMMAND_OPCODE(stop) {
DECLARE_COMMAND_OPCODE(character) {
- warning("Parallaction_br::cmdOp_character not yet implemented");
+ debugC(9, kDebugExec, "Parallaction_br::cmdOp_character(%s)", _cmdRunCtxt.cmd->u._string);
+ changeCharacter(_cmdRunCtxt.cmd->u._string);
}
diff --git a/engines/parallaction/graphics.cpp b/engines/parallaction/graphics.cpp
index 9110731a04..58fb02a750 100644
--- a/engines/parallaction/graphics.cpp
+++ b/engines/parallaction/graphics.cpp
@@ -33,10 +33,6 @@
namespace Parallaction {
-
-typedef Common::HashMap<Common::String, int32, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> VarMap;
-VarMap _vars;
-
void Gfx::registerVar(const Common::String &name, int32 initialValue) {
if (_vars.contains(name)) {
warning("Variable '%s' already registered, ignoring initial value.\n", name.c_str());
diff --git a/engines/parallaction/graphics.h b/engines/parallaction/graphics.h
index 7528a20c67..f03b8538b8 100644
--- a/engines/parallaction/graphics.h
+++ b/engines/parallaction/graphics.h
@@ -453,10 +453,13 @@ enum {
kBackgroundSlide = 2
};
+typedef Common::HashMap<Common::String, int32, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> VarMap;
+
class Gfx {
public:
Disk *_disk;
+ VarMap _vars;
GfxObjList _gfxobjList[3];
GfxObj* loadAnim(const char *name);
diff --git a/engines/parallaction/parallaction.h b/engines/parallaction/parallaction.h
index b100342c2e..5ae1386378 100644
--- a/engines/parallaction/parallaction.h
+++ b/engines/parallaction/parallaction.h
@@ -658,6 +658,7 @@ public:
public:
typedef void (Parallaction_br::*Callable)(void*);
virtual void callFunction(uint index, void* parm);
+ void changeCharacter(const char *name);
public:
Table *_countersNames;
@@ -692,7 +693,6 @@ private:
void setInventoryCursor(int pos);
void changeLocation(char *location);
- void changeCharacter(const char *name);
void runPendingZones();
void initPart();
@@ -727,6 +727,7 @@ private:
const Callable *_callables;
void parseLocation(const char* name);
+ void loadProgram(AnimationPtr a, const char *filename);
DECLARE_UNQUALIFIED_COMMAND_OPCODE(location);
DECLARE_UNQUALIFIED_COMMAND_OPCODE(open);
diff --git a/engines/parallaction/parallaction_br.cpp b/engines/parallaction/parallaction_br.cpp
index 06f728f603..b22e1b0f2d 100644
--- a/engines/parallaction/parallaction_br.cpp
+++ b/engines/parallaction/parallaction_br.cpp
@@ -74,7 +74,9 @@ int Parallaction_br::init() {
initCursors();
initOpcodes();
_locationParser = new LocationParser_br(this);
+ _locationParser->init();
_programParser = new ProgramParser_br(this);
+ _programParser->init();
_part = -1;
@@ -203,7 +205,7 @@ void Parallaction_br::runPendingZones() {
if (_activeZone) {
z = _activeZone; // speak Zone or sound
_activeZone = nullZonePtr;
-// runZone(z); // FIXME: BRA doesn't handle sound yet
+ runZone(z); // FIXME: BRA doesn't handle sound yet
}
if (_activeZone2) {
@@ -261,9 +263,34 @@ void Parallaction_br::parseLocation(const char *filename) {
return;
}
+void Parallaction_br::loadProgram(AnimationPtr a, const char *filename) {
+ debugC(1, kDebugParser, "loadProgram(Animation: %s, script: %s)", a->_name, filename);
+
+ Script *script = _disk->loadScript(filename);
+ ProgramPtr program(new Program);
+ program->_anim = a;
+
+ _programParser->parse(script, program);
+
+ delete script;
+
+ _vm->_location._programs.push_back(program);
+
+ debugC(1, kDebugParser, "loadProgram() done");
+
+ return;
+}
+
+
void Parallaction_br::changeCharacter(const char *name) {
+ const char *charName = _char.getName();
+ if (!scumm_stricmp(charName, name)) {
+ return;
+ }
+ _char.setName(name);
+ _char._talk = _disk->loadTalk(name);
}
diff --git a/engines/parallaction/parallaction_ns.cpp b/engines/parallaction/parallaction_ns.cpp
index 08599cb06b..f346a278f7 100644
--- a/engines/parallaction/parallaction_ns.cpp
+++ b/engines/parallaction/parallaction_ns.cpp
@@ -137,7 +137,9 @@ int Parallaction_ns::init() {
initCursors();
initOpcodes();
_locationParser = new LocationParser_ns(this);
+ _locationParser->init();
_programParser = new ProgramParser_ns(this);
+ _programParser->init();
_introSarcData1 = 0;
_introSarcData2 = 1;
diff --git a/engines/parallaction/parser.h b/engines/parallaction/parser.h
index b6858ab175..1541fb89b2 100644
--- a/engines/parallaction/parser.h
+++ b/engines/parallaction/parser.h
@@ -131,6 +131,7 @@ protected:
char *bgName;
char *maskName;
char *pathName;
+ char *characterName;
} ctxt;
void warning_unexpected();
@@ -207,7 +208,6 @@ protected:
} _forwardedCommands[MAX_FORWARDS];
uint _numForwardedCommands;
- void init();
void clearSet(OpcodeSet &opcodes) {
for (Common::Array<const Opcode*>::iterator i = opcodes.begin(); i != opcodes.end(); ++i)
delete *i;
@@ -216,9 +216,10 @@ protected:
public:
LocationParser_ns(Parallaction_ns *vm) : _vm(vm) {
- init();
}
+ virtual void init();
+
virtual ~LocationParser_ns() {
delete _parser;
delete _commandsNames;
@@ -283,13 +284,12 @@ protected:
DECLARE_UNQUALIFIED_ANIM_PARSER(moveto);
DECLARE_UNQUALIFIED_ANIM_PARSER(endanimation);
- void init();
-
public:
LocationParser_br(Parallaction_br *vm) : LocationParser_ns((Parallaction_ns*)vm), _vm(vm) {
- init();
}
+ virtual void init();
+
virtual ~LocationParser_br() {
delete _commandsNames;
delete _locationStmt;
@@ -344,7 +344,6 @@ protected:
void parseLValue(ScriptVar &var, const char *str);
virtual void parseRValue(ScriptVar &var, const char *str);
- void init();
void clearSet(OpcodeSet &opcodes) {
for (Common::Array<const Opcode*>::iterator i = opcodes.begin(); i != opcodes.end(); ++i)
delete *i;
@@ -353,9 +352,10 @@ protected:
public:
ProgramParser_ns(Parallaction_ns *vm) : _vm(vm) {
- init();
}
+ virtual void init();
+
virtual ~ProgramParser_ns() {
delete _parser;
delete _instructionNames;
@@ -383,13 +383,12 @@ protected:
virtual void parseRValue(ScriptVar &var, const char *str);
- void init();
-
public:
ProgramParser_br(Parallaction_br *vm) : ProgramParser_ns((Parallaction_ns*)vm), _vm(vm) {
- init();
}
+ virtual void init();
+
virtual ~ProgramParser_br() {
delete _instructionNames;
delete _parser;
diff --git a/engines/parallaction/parser_br.cpp b/engines/parallaction/parser_br.cpp
index cebda4b5ed..51da7eb396 100644
--- a/engines/parallaction/parser_br.cpp
+++ b/engines/parallaction/parser_br.cpp
@@ -442,7 +442,7 @@ DECLARE_LOCATION_PARSER(redundant) {
DECLARE_LOCATION_PARSER(character) {
debugC(7, kDebugParser, "LOCATION_PARSER(character) ");
-// changeCharacter(character);
+ ctxt.characterName = strdup(_tokens[0]);
}
@@ -1113,15 +1113,21 @@ void LocationParser_br::parse(Script *script) {
ctxt.bgName = 0;
ctxt.maskName = 0;
ctxt.pathName = 0;
+ ctxt.characterName = 0;
LocationParser_ns::parse(script);
_vm->_gfx->setBackground(kBackgroundLocation, ctxt.bgName, ctxt.maskName, ctxt.pathName);
_vm->_pathBuffer = &_vm->_gfx->_backgroundInfo.path;
+ if (ctxt.characterName) {
+ _vm->changeCharacter(ctxt.characterName);
+ }
+
free(ctxt.bgName);
free(ctxt.maskName);
free(ctxt.pathName);
+ free(ctxt.characterName);
}
diff --git a/engines/parallaction/parser_ns.cpp b/engines/parallaction/parser_ns.cpp
index 1b66394abf..c654e3008e 100644
--- a/engines/parallaction/parser_ns.cpp
+++ b/engines/parallaction/parser_ns.cpp
@@ -308,8 +308,6 @@ void LocationParser_ns::parseAnimation(AnimationList &list, char *name) {
void ProgramParser_ns::parseInstruction() {
- InstructionPtr inst(new Instruction);
-
_script->readLineToken(true);
if (_tokens[0][1] == '.') {
@@ -322,10 +320,13 @@ void ProgramParser_ns::parseInstruction() {
} else
ctxt.a = _program->_anim;
- ctxt.inst = inst;
+ if (!ctxt.a) {
+ return;
+ }
+ InstructionPtr inst(new Instruction);
+ ctxt.inst = inst;
_parser->parseStatement();
-
_program->_instructions.push_back(inst);
return;
diff --git a/engines/saga/detection.cpp b/engines/saga/detection.cpp
index 7fd1024405..9c897d8ebc 100644
--- a/engines/saga/detection.cpp
+++ b/engines/saga/detection.cpp
@@ -54,8 +54,8 @@ struct SAGAGameDescription {
const GamePatchDescription *patchDescriptions;
};
-const bool SagaEngine::isBigEndian() const { return (_gameDescription->features & GF_BIG_ENDIAN_DATA) != 0; }
-const bool SagaEngine::isMacResources() const { return (getPlatform() == Common::kPlatformMacintosh); }
+bool SagaEngine::isBigEndian() const { return (_gameDescription->features & GF_BIG_ENDIAN_DATA) != 0; }
+bool SagaEngine::isMacResources() const { return (getPlatform() == Common::kPlatformMacintosh); }
const GameResourceDescription *SagaEngine::getResourceDescription() { return _gameDescription->resourceDescription; }
const GameSoundInfo *SagaEngine::getVoiceInfo() const { return _gameDescription->voiceInfo; }
const GameSoundInfo *SagaEngine::getSfxInfo() const { return _gameDescription->sfxInfo; }
diff --git a/engines/saga/interface.cpp b/engines/saga/interface.cpp
index fe1ee0eefc..7380570a99 100644
--- a/engines/saga/interface.cpp
+++ b/engines/saga/interface.cpp
@@ -326,6 +326,9 @@ Interface::Interface(SagaEngine *vm) : _vm(vm) {
_statusTextInputState = kStatusTextInputFirstRun;
_disableAbortSpeeches = false;
+
+ // set save game reminder alarm
+ _vm->_timer->installTimerProc(&saveReminderCallback, TIMETOSAVE, this);
}
Interface::~Interface(void) {
@@ -336,6 +339,22 @@ Interface::~Interface(void) {
_scenePortraits.freeMem();
}
+void Interface::saveReminderCallback(void *refCon) {
+ ((Interface *)refCon)->updateSaveReminder();
+}
+
+void Interface::updateSaveReminder() {
+ // TODO: finish this
+ /*
+ if (_active && _panelMode == kPanelMain) {
+ _vm->_timer->removeTimerProc(&saveReminderCallback);
+ _saveReminderState = (_saveReminderState == 0) ? 1 : 0;
+ drawStatusBar();
+ _vm->_timer->installTimerProc(&saveReminderCallback, TIMETOSAVE, this);
+ }
+ */
+}
+
int Interface::activate() {
if (!_active) {
_active = true;
diff --git a/engines/saga/interface.h b/engines/saga/interface.h
index 74cf5ace44..2091c9f071 100644
--- a/engines/saga/interface.h
+++ b/engines/saga/interface.h
@@ -59,6 +59,8 @@ enum InterfaceUpdateFlags {
#define RID_IHNM_BOSS_SCREEN 19 // not in demo
#define RID_ITE_TYCHO_MAP 1686
#define RID_ITE_SPR_CROSSHAIR (73 + 9)
+#define TIMETOSAVE (kScriptTimeTicksPerSecond * 1000 * 60 * 30)
+#define TIMETOBLINK (kScriptTimeTicksPerSecond * 1000 * 1)
// Converse-specific stuff
@@ -237,6 +239,9 @@ public:
void disableAbortSpeeches(bool d) { _disableAbortSpeeches = d; }
+ static void saveReminderCallback(void *refCon);
+ void updateSaveReminder();
+
bool _textInput;
bool _statusTextInput;
diff --git a/engines/saga/saga.h b/engines/saga/saga.h
index 4fd789cb4e..4a5fae7ddb 100644
--- a/engines/saga/saga.h
+++ b/engines/saga/saga.h
@@ -580,15 +580,15 @@ public:
_mouseClickCount = 0;
}
- const bool leftMouseButtonPressed() const {
+ bool leftMouseButtonPressed() const {
return _leftMouseButtonPressed;
}
- const bool rightMouseButtonPressed() const {
+ bool rightMouseButtonPressed() const {
return _rightMouseButtonPressed;
}
- const bool mouseButtonPressed() const {
+ bool mouseButtonPressed() const {
return _leftMouseButtonPressed || _rightMouseButtonPressed;
}
@@ -622,8 +622,8 @@ public:
public:
bool initGame(void);
- const bool isBigEndian() const;
- const bool isMacResources() const;
+ bool isBigEndian() const;
+ bool isMacResources() const;
const GameResourceDescription *getResourceDescription();
const GameSoundInfo *getVoiceInfo() const;
const GameSoundInfo *getSfxInfo() const;
diff --git a/engines/sword2/header.h b/engines/sword2/header.h
index 5100e43de1..8cd8c900f8 100644
--- a/engines/sword2/header.h
+++ b/engines/sword2/header.h
@@ -56,7 +56,7 @@ struct ResHeader {
// compressed)
byte name[NAME_LEN]; // Name of object
- static const int size() {
+ static int size() {
return 44;
}
@@ -152,7 +152,7 @@ struct AnimHeader {
uint8 feetEndDir; // Direction to start in after running anim
uint16 blend;
- static const int size() {
+ static int size() {
return 15;
}
@@ -209,7 +209,7 @@ struct CdtEntry {
uint8 frameType; // 0 = print sprite normally with top-left
// corner at (x,y), otherwise see below...
- static const int size() {
+ static int size() {
return 9;
}
@@ -250,7 +250,7 @@ struct FrameHeader {
uint16 width; // Dimensions of frame
uint16 height;
- static const int size() {
+ static int size() {
return 8;
}
@@ -299,7 +299,7 @@ struct MultiScreenHeader {
uint32 paletteTable;
uint32 maskOffset;
- static const int size() {
+ static int size() {
return 36;
}
@@ -339,7 +339,7 @@ struct ScreenHeader {
uint16 height;
uint16 noLayers; // number of layer areas
- static const int size() {
+ static int size() {
return 6;
}
@@ -374,7 +374,7 @@ struct LayerHeader {
uint32 offset; // where to find mask data (from start of
// standard file header)
- static const int size() {
+ static int size() {
return 16;
}
@@ -436,7 +436,7 @@ public:
_addr = NULL;
}
- static const int size() {
+ static int size() {
return 44;
}
@@ -479,7 +479,7 @@ struct TextHeader {
uint32 noOfLines; // how many lines of text are there in this
// module
- static const int size() {
+ static int size() {
return 4;
}
diff --git a/engines/sword2/object.h b/engines/sword2/object.h
index 57f020eb63..b6b6ca5174 100644
--- a/engines/sword2/object.h
+++ b/engines/sword2/object.h
@@ -48,7 +48,7 @@ struct ObjectMouse {
int32 priority;
int32 pointer; // type (or resource id?) of pointer used over this area
- static const int size() {
+ static int size() {
return 24;
}
@@ -91,7 +91,7 @@ public:
_addr = addr;
}
- static const int size() {
+ static int size() {
return 8;
}
@@ -139,7 +139,7 @@ public:
_addr = addr;
}
- static const int size() {
+ static int size() {
return 12;
}
@@ -178,7 +178,7 @@ public:
_addr = addr;
}
- static const int size() {
+ static int size() {
return 36;
}
@@ -240,7 +240,7 @@ public:
_addr = addr;
}
- static const int size() {
+ static int size() {
return 56;
}
@@ -291,7 +291,7 @@ struct ObjectWalkdata {
int32 dx[8 * (12 + 1)]; // walk step distances in x direction
int32 dy[8 * (12 + 1)]; // walk step distances in y direction
- static const int size() {
+ static int size() {
return 916;
}
diff --git a/engines/sword2/screen.h b/engines/sword2/screen.h
index 93cc5e40ce..6defe51fdc 100644
--- a/engines/sword2/screen.h
+++ b/engines/sword2/screen.h
@@ -187,7 +187,7 @@ struct Parallax {
// The dimensions are followed by an offset table, but we don't know in
// advance how big it is. See initializeBackgroundLayer().
- static const int size() {
+ static int size() {
return 4;
}
diff --git a/gui/credits.h b/gui/credits.h
index a84cc53d98..41544a2248 100644
--- a/gui/credits.h
+++ b/gui/credits.h
@@ -144,6 +144,9 @@ static const char *credits[] = {
"\\C\\c0""Jurgen Braam",
"\\C\\c0""Lars Persson",
"\\C\\c0""",
+"\\C\\c1""Wii",
+"\\C\\c0""Andre Heider",
+"\\C\\c0""",
"\\C\\c0""",
"\\C\\c1""Other subsystems",
"\\C\\c1""Infrastructure",
diff --git a/gui/eval.cpp b/gui/eval.cpp
index a2aec6d0d3..716006c108 100644
--- a/gui/eval.cpp
+++ b/gui/eval.cpp
@@ -102,7 +102,7 @@ void Eval::level4(int *result) {
char op;
op = 0;
- if ((_tokenType == tDelimiter) && *_token == '+' || *_token == '-') {
+ if ((_tokenType == tDelimiter) && (*_token == '+' || *_token == '-')) {
op = *_token;
getToken();
}
diff --git a/tools/credits.pl b/tools/credits.pl
index f176a6d957..fa806db7de 100755
--- a/tools/credits.pl
+++ b/tools/credits.pl
@@ -626,6 +626,10 @@ begin_credits("Credits");
add_person("Lars Persson", "AnotherGuest", "");
end_section();
+ begin_section("Wii");
+ add_person("Andre Heider", "dhewg", "");
+ end_section();
+
end_section();
begin_section("Other subsystems");